package thyyxxk.webserver.controller.crbmanagement;

import com.alibaba.fastjson.JSONObject;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import thyyxxk.webserver.config.auth.PassToken;
import thyyxxk.webserver.entity.ResultVo;
import thyyxxk.webserver.entity.crbmanagement.BaseDept;
import thyyxxk.webserver.entity.crbmanagement.BaseUser;
import thyyxxk.webserver.entity.crbmanagement.EmrPatientInfo;
import thyyxxk.webserver.service.crbmanagement.CrbBaseService;

import java.util.List;

/**
 * @ClassName CrbBaseController
 * @Author hsh
 * @Date 2025/7/25 0025 11:15
 * @Version 1.0
 * @Description 国家传染病上报前置机软件接口
 **/
@RestController
@RequestMapping("/crbBase")
public class CrbBaseController {

    private final CrbBaseService service;


    public CrbBaseController(CrbBaseService service) {
        this.service = service;
    }

    @PassToken
    @PostMapping("uploadBaseUser")
    public ResultVo<JSONObject> uploadBaseUser(@RequestBody @Validated BaseUser baseUser){
        return service.uploadBaseUser(baseUser);
    }

    @PassToken
    @PostMapping("uploadBaseDept")
    public ResultVo<JSONObject> uploadBaseDept(@RequestBody @Validated BaseDept baseDept){
        return service.uploadBaseDept(baseDept);
    }

    @PassToken
    @PostMapping("selectBaseUser")
    public ResultVo<List<BaseUser>> selectBaseUser(@RequestBody @Validated BaseUser baseUser){
        return service.selectBaseUser(baseUser);
    }

    @PassToken
    @PostMapping("selectBaseDept")
    public ResultVo<List<BaseDept>> selectBaseDept(@RequestBody @Validated BaseDept baseDept){
        return service.selectBaseDept(baseDept);
    }

    @PassToken
    @PostMapping("uploadEmrPatientInfo")
    public ResultVo<JSONObject> uploadEmrPatientInfo(@RequestBody @Validated EmrPatientInfo emrPatientInfo){
        return service.uploadEmrPatientInfo(emrPatientInfo);
    }

}
