package com.lantone.security.web;

import com.lantone.common.api.CommonResult;
import com.lantone.security.dto.GetMedoupManageDTO;
import com.lantone.security.facade.MedoupManagementFacade;
import com.lantone.security.vo.AddMedoupManageVO;
import com.lantone.security.vo.DeleteMedoupManageVO;
import com.lantone.security.vo.GetMedoupManageVO;
import com.lantone.security.vo.UpdateMedoupManageVO;
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;

/**
 * @Description: 医疗组管理API
 * @author： zhanghang
 * @time: 2022/3/17 13:20
 */
@RestController
@Api(value = "医疗组管理API", tags = { "医疗组管理API" })
@RequestMapping("/medoupManage")
public class MedoupManagementController {
    @Autowired
    MedoupManagementFacade medoupManagementFacade;

    @ApiOperation(value = "新增医疗组信息 [by:zhanghang]")
    @PostMapping("/addMedoupManage")
    @Transactional
    public CommonResult<Boolean> addMedoupManage(@RequestBody AddMedoupManageVO addMedoupManageVO) {
        return CommonResult.success(medoupManagementFacade.addMedoupManage(addMedoupManageVO));
    }

    @ApiOperation(value = "查看医疗组具体信息 [by:zhanghang]")
    @PostMapping("/getMedoupManage")
    public CommonResult<GetMedoupManageDTO> getMedoupManage(@RequestBody GetMedoupManageVO getMedoupManageVO) {
        return CommonResult.success(medoupManagementFacade.getMedoupManage(getMedoupManageVO));
    }

    @ApiOperation(value = "修改医疗组信息 [by:zhanghang]")
    @PostMapping("/updateMedoupManage")
    @Transactional
    public CommonResult<Boolean> updateMedoupManage(@RequestBody UpdateMedoupManageVO updateMedoupManageVO) {
        return CommonResult.success(medoupManagementFacade.updateMedoupManage(updateMedoupManageVO));
    }

    @ApiOperation(value = "删除医疗组信息 [by:zhanghang]")
    @PostMapping("/deleteMedoupManage")
    @Transactional
    public CommonResult<Boolean> deleteMedoupManage(@RequestBody DeleteMedoupManageVO deleteMedoupManageVO) {
        return CommonResult.success(medoupManagementFacade.deleteMedoupManage(deleteMedoupManageVO));
    }
}
