package com.diagbot.web;

import com.diagbot.annotation.SysLogger;
import com.diagbot.dto.QcCasesDTO;
import com.diagbot.dto.RespDTO;
import com.diagbot.facade.QcCasesFacade;
import com.diagbot.vo.QcCasesSaveListVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
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 java.util.List;

/**
 * <p>
 * 病历大模块 前端控制器
 * </p>
 *
 * @author gaodm
 * @time: 2024-04-12
 */
@RequestMapping("/qc/cases")
@RestController
@SuppressWarnings("unchecked")
@Api(value = "模块数据维护API", tags = { "模块数据维护API" })
public class QcCasesController {

    @Autowired
    private QcCasesFacade qcCasesFacade;

    @ApiOperation(value = "获取医院模块数据信息[by:gaodm]",
            notes = "")
    @PostMapping("/getQcCases")
    @SysLogger("getQcCases")
    public RespDTO<List<QcCasesDTO>> getQcCasesFac() {
        return RespDTO.onSuc(qcCasesFacade.getQcCasesFac());
    }


    @ApiOperation(value = "批量更新模块数据[by:gaodm]",
            notes = "")
    @PostMapping("/saveQcCases")
    @SysLogger("saveQcCases")
    @Transactional
    public RespDTO<Boolean> saveQcCases(@RequestBody QcCasesSaveListVO qcCasesSaveVOList) {
        return RespDTO.onSuc(qcCasesFacade.saveQcCases(qcCasesSaveVOList));
    }
}
