|
@ -52,7 +52,7 @@ public class DepartmentController { |
|
|
@PostMapping("adddepartment") |
|
|
@PostMapping("adddepartment") |
|
|
@RequirePermission(requirePermission = RequirePermissionEnum.ORG_DEPARTMENT_CREATE) |
|
|
@RequirePermission(requirePermission = RequirePermissionEnum.ORG_DEPARTMENT_CREATE) |
|
|
public Result<AddDepartmentResultDTO> addDepartment(@LoginUser TokenDto tokenDTO, @RequestBody AddDepartmentFormDTO formDTO) { |
|
|
public Result<AddDepartmentResultDTO> addDepartment(@LoginUser TokenDto tokenDTO, @RequestBody AddDepartmentFormDTO formDTO) { |
|
|
ValidatorUtils.validateEntity(formDTO); |
|
|
ValidatorUtils.validateEntity(formDTO, AddDepartmentFormDTO.AddDept.class); |
|
|
return departmentService.addDepartment(formDTO); |
|
|
return departmentService.addDepartment(formDTO); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -65,7 +65,7 @@ public class DepartmentController { |
|
|
@PostMapping("editdepartment") |
|
|
@PostMapping("editdepartment") |
|
|
@RequirePermission(requirePermission = RequirePermissionEnum.ORG_DEPARTMENT_UPDATE) |
|
|
@RequirePermission(requirePermission = RequirePermissionEnum.ORG_DEPARTMENT_UPDATE) |
|
|
public Result editDepartment(@LoginUser TokenDto tokenDTO, @RequestBody EditDepartmentFormDTO formDTO) { |
|
|
public Result editDepartment(@LoginUser TokenDto tokenDTO, @RequestBody EditDepartmentFormDTO formDTO) { |
|
|
ValidatorUtils.validateEntity(formDTO); |
|
|
ValidatorUtils.validateEntity(formDTO, EditDepartmentFormDTO.EditDept.class); |
|
|
return departmentService.editDepartment(formDTO); |
|
|
return departmentService.editDepartment(formDTO); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|