Browse Source

用户启用/禁用,批量启用/禁用入参异常解决

v_HuilingDeng 3 years ago
parent
commit
450767717b

+ 2 - 2
abi-cloud-qr-platform-server/src/main/java/com/abi/qms/platform/controller/console/UserManagerController.java

@@ -75,7 +75,7 @@ public class UserManagerController {
 
     @ApiOperation("启用/停用用户")
     @PostMapping("enableUser")
-    public BaseResponse enableUser(@Validated UserInfoIdReq userInfoIdReq) throws Exception {
+    public BaseResponse enableUser(@Validated @RequestBody UserInfoIdReq userInfoIdReq) throws Exception {
         userManagerService.enableUser(userInfoIdReq.getId());
         //包装出参
         return BaseResponse.create();
@@ -83,7 +83,7 @@ public class UserManagerController {
 
     @ApiOperation("批量启用/停用用户")
     @PostMapping("batchEnableUser")
-    public BaseResponse batchEnableUser(@Validated BatchEnableUserReq batchEnableUserReq) throws Exception {
+    public BaseResponse batchEnableUser(@Validated @RequestBody BatchEnableUserReq batchEnableUserReq) throws Exception {
         userManagerService.batchEnableUser(batchEnableUserReq);
         //包装出参
         return BaseResponse.create();

+ 0 - 2
abi-cloud-qr-platform-server/src/main/java/com/abi/qms/platform/dto/req/BatchEnableUserReq.java

@@ -18,11 +18,9 @@ import java.util.List;
 @ApiModel
 public class BatchEnableUserReq implements Serializable {
 
-    @NotNull(message = "用户id列表为空")
     @ApiModelProperty(value = "用户id列表")
     private List<Long> ids;
 
-    @NotEmpty(message = "启用/停用为空")
     @ApiModelProperty(value = "启用/停用(1:启用 0:停用)")
     private Integer isEnable;
 }

+ 0 - 1
abi-cloud-qr-platform-server/src/main/java/com/abi/qms/platform/dto/req/UserInfoIdReq.java

@@ -15,7 +15,6 @@ import java.io.Serializable;
 @ApiModel
 public class UserInfoIdReq implements Serializable {
 
-    @NotNull(message = "用户id为空")
     @ApiModelProperty(value = "用户id")
     private Long id;
 }