package com.gkhy.labRiskManage.api.controller.account; import cn.hutool.json.JSONObject; import com.gkhy.labRiskManage.api.controller.common.BaseController; import com.gkhy.labRiskManage.application.account.dto.repDto.SysDepartmentAppAddReqDTO; import com.gkhy.labRiskManage.application.account.dto.repDto.SysDepartmentAppUpdateReqDTO; import com.gkhy.labRiskManage.application.account.service.SysDepartmentAppService; import com.gkhy.labRiskManage.commons.domain.Result; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; /** * @email 1603559716@qq.com * @author: zf * @date: 2023/3/7 * @time: 16:34 */ @RestController @RequestMapping("account/department") public class SysDepartmentController extends BaseController { @Autowired private SysDepartmentAppService sysDepartmentAppService; @PostMapping("/save") public Result save(@RequestBody SysDepartmentAppAddReqDTO req){ return sysDepartmentAppService.save(req,getCurrentUserId()); } @PostMapping("/update") public Result update(@RequestBody SysDepartmentAppUpdateReqDTO req){ return sysDepartmentAppService.update(req,getCurrentUserId()); } @PostMapping("/delete") public Result delete(@RequestBody JSONObject jsonObject){ return sysDepartmentAppService.delete(jsonObject.getLong("id"),getCurrentUserId()); } @GetMapping("/list") public Result list(){ return sysDepartmentAppService.list(); } }