浏览代码

修改参数校验规则

haonan 1 年之前
父节点
当前提交
9a6e7845da

+ 2 - 2
cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/controller/TenantInfoController.java

@@ -54,7 +54,7 @@ public class TenantInfoController extends BaseController {
     @PostMapping("/add")
     @ApiOperation(value = "更新", notes = "传入TenantInfo")
     @PreAuthorize("@pcs.hasPermissions('tenantInfo/add')")
-    public HttpResponseResult<Boolean> add(@Validated @RequestBody TenantInfoVo.TenantInfo info) {
+    public HttpResponseResult<Boolean> add( @RequestBody TenantInfoVo.TenantInfo info) {
         return succeed(tenantInfoService.add(JSON.parseObject(info.jsonString(), TenantInfo.class)));
     }
 
@@ -64,7 +64,7 @@ public class TenantInfoController extends BaseController {
     @PostMapping("/update")
     @ApiOperation(value = "修改", notes = "传入TenantInfo")
     @PreAuthorize("@pcs.hasPermissions('tenantInfo/update')")
-    public HttpResponseResult<Boolean> update(@Valid @RequestBody TenantInfoVo.TenantInfo info) {
+    public HttpResponseResult<Boolean> update( @RequestBody TenantInfoVo.TenantInfo info) {
         return succeed(tenantInfoService.update(JSON.parseObject(info.jsonString(), TenantInfo.class)));
     }
 

+ 0 - 5
cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/io/request/TenantInfoVo.java

@@ -27,7 +27,6 @@ public class TenantInfoVo {
         private Long id;
 
         @ApiModelProperty("名称")
-        @NotNull
         private String name;
 
         @ApiModelProperty("logo")
@@ -37,15 +36,12 @@ public class TenantInfoVo {
         private String briefIntroduction;
 
         @ApiModelProperty("省份编码")
-        @NotNull
         private Integer provinceCode;
 
         @ApiModelProperty("城市编码")
-        @NotNull
         private Integer cityCode;
 
         @ApiModelProperty("地区/街道")
-        @NotNull
         private Integer regionCode;
 
         @ApiModelProperty("联系人")
@@ -53,7 +49,6 @@ public class TenantInfoVo {
         private String username;
 
         @ApiModelProperty("手机号")
-        @NotNull
         @Pattern(regexp = "^1\\d{10}$", message = "手机号码格式错误")
         private String phone;