package com.diagbot.web;


import com.diagbot.annotation.SysLogger;
import com.diagbot.dto.BasDeptInfoDTO;
import com.diagbot.dto.RespDTO;
import com.diagbot.facade.BasDeptInfoFacade;
import com.diagbot.vo.BasDeptInfoVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
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-27
 */
@RestController
@RequestMapping("/bas/dept")
@Api(value = "医院科室API", tags = { "医院科室API" })
@SuppressWarnings("unchecked")
public class BasDeptInfoController {
    @Autowired
    private BasDeptInfoFacade basDeptInfoFacade;

    @ApiOperation(value = "获取用户管理下医院科室下拉列表信息[by:gaodm]",
            notes = "inputStr: 搜索参数")
    @PostMapping("/listForUser")
    @SysLogger("listForUser")
    public RespDTO<List<BasDeptInfoDTO>> listForUser(@RequestBody BasDeptInfoVO basDeptInfoVO) {
        return RespDTO.onSuc(basDeptInfoFacade.listForUser(basDeptInfoVO));
    }


    @ApiOperation(value = "获取病历质控一览下医院科室下拉列表信息[by:gaodm]",
            notes = "inputStr: 搜索参数")
    @PostMapping("/getList")
    @SysLogger("getList")
    public RespDTO<List<BasDeptInfoDTO>> getList(@RequestBody BasDeptInfoVO basDeptInfoVO) {
        return RespDTO.onSuc(basDeptInfoFacade.listForUser(basDeptInfoVO));
    }

    @ApiOperation(value = "获取病历质控一览下用户科室下拉列表信息[by:gaodm]",
            notes = "inputStr: 搜索参数")
    @PostMapping("/getListUser")
    @SysLogger("getListUser")
    public RespDTO<List<BasDeptInfoDTO>> getListUser(@RequestBody BasDeptInfoVO basDeptInfoVO) {
        return RespDTO.onSuc(basDeptInfoFacade.getListUserFac(basDeptInfoVO));
    }
}
