|
@@ -7,6 +7,7 @@ import com.sd.business.entity.department.dto.DepartmentSelectDto;
|
|
|
import com.sd.business.entity.department.vo.DepartmentVo;
|
|
|
import com.sd.business.service.department.DepartmentService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
@@ -48,7 +49,7 @@ public class DepartmentController {
|
|
|
* 事业部新增
|
|
|
*/
|
|
|
@PostMapping("/add")
|
|
|
- public void add(@RequestBody DepartmentDto departmentDto) {
|
|
|
+ public void add(@Validated @RequestBody DepartmentDto departmentDto) {
|
|
|
departmentService.add(departmentDto);
|
|
|
}
|
|
|
|
|
@@ -56,7 +57,7 @@ public class DepartmentController {
|
|
|
* 事业部编辑
|
|
|
*/
|
|
|
@PostMapping("/edit")
|
|
|
- public void edit(@RequestBody DepartmentDto departmentDto) {
|
|
|
+ public void edit(@Validated @RequestBody DepartmentDto departmentDto) {
|
|
|
departmentService.edit(departmentDto);
|
|
|
}
|
|
|
|