|
@@ -3,13 +3,11 @@ package com.simuwang.manage.api.system;
|
|
import com.simuwang.base.common.support.MybatisPage;
|
|
import com.simuwang.base.common.support.MybatisPage;
|
|
import com.simuwang.base.pojo.dto.DeleteByIdCmd;
|
|
import com.simuwang.base.pojo.dto.DeleteByIdCmd;
|
|
import com.simuwang.base.pojo.dto.UpdateStatusCmd;
|
|
import com.simuwang.base.pojo.dto.UpdateStatusCmd;
|
|
-import com.simuwang.base.pojo.dto.sys.RoleUserPageQuery;
|
|
|
|
-import com.simuwang.base.pojo.dto.sys.UserAddCmd;
|
|
|
|
-import com.simuwang.base.pojo.dto.sys.UserEditCmd;
|
|
|
|
-import com.simuwang.base.pojo.dto.sys.UserPageQuery;
|
|
|
|
|
|
+import com.simuwang.base.pojo.dto.sys.*;
|
|
import com.simuwang.base.pojo.vo.sys.SysRoleUserVO;
|
|
import com.simuwang.base.pojo.vo.sys.SysRoleUserVO;
|
|
import com.simuwang.base.pojo.vo.sys.SysUserVO;
|
|
import com.simuwang.base.pojo.vo.sys.SysUserVO;
|
|
import com.simuwang.manage.service.system.SysUserService;
|
|
import com.simuwang.manage.service.system.SysUserService;
|
|
|
|
+import jakarta.validation.Valid;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -54,7 +52,7 @@ public class SysUserController {
|
|
* @param command 用户信息
|
|
* @param command 用户信息
|
|
*/
|
|
*/
|
|
@PostMapping("save")
|
|
@PostMapping("save")
|
|
- public boolean save(@RequestBody UserAddCmd command) {
|
|
|
|
|
|
+ public boolean save(@Valid @RequestBody UserAddCmd command) {
|
|
this.service.insert(command);
|
|
this.service.insert(command);
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
@@ -65,7 +63,7 @@ public class SysUserController {
|
|
* @param command 用户id+用户信息
|
|
* @param command 用户id+用户信息
|
|
*/
|
|
*/
|
|
@PostMapping("update")
|
|
@PostMapping("update")
|
|
- public boolean update(@RequestBody UserEditCmd command) {
|
|
|
|
|
|
+ public boolean update(@Valid @RequestBody UserEditCmd command) {
|
|
this.service.update(command);
|
|
this.service.update(command);
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
@@ -76,7 +74,7 @@ public class SysUserController {
|
|
* @param command 用户id+状态对象
|
|
* @param command 用户id+状态对象
|
|
*/
|
|
*/
|
|
@PostMapping("update-status")
|
|
@PostMapping("update-status")
|
|
- public boolean updateStatus(@RequestBody UpdateStatusCmd command) {
|
|
|
|
|
|
+ public boolean updateStatus(@Valid @RequestBody UpdateStatusCmd command) {
|
|
this.service.updateStatus(command);
|
|
this.service.updateStatus(command);
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
@@ -87,8 +85,19 @@ public class SysUserController {
|
|
* @param command 用户id对象
|
|
* @param command 用户id对象
|
|
*/
|
|
*/
|
|
@PostMapping("del")
|
|
@PostMapping("del")
|
|
- public boolean deleteById(@RequestBody DeleteByIdCmd command) {
|
|
|
|
|
|
+ public boolean deleteById(@Valid @RequestBody DeleteByIdCmd command) {
|
|
this.service.delete(command);
|
|
this.service.delete(command);
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 用户角色绑定
|
|
|
|
+ *
|
|
|
|
+ * @param command 用户绑定的角色对象
|
|
|
|
+ */
|
|
|
|
+ @PostMapping("bind-roles")
|
|
|
|
+ public boolean bindRoles(@Valid @RequestBody UserRoleBindCmd command) {
|
|
|
|
+ this.service.bindRoles(command);
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
}
|
|
}
|