From b6498b4483d0aa0bb3759a8835b6dcafa29573e2 Mon Sep 17 00:00:00 2001 From: jiangweifan <1553713823@qq.com> Date: Fri, 8 May 2020 12:48:58 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=AF=B7=E6=B1=82=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../request/category/AdminsProductCategoryAddRequest.java | 4 ++++ .../request/category/AdminsProductCategoryUpdateRequest.java | 5 +++++ .../category/AdminsProductCategoryUpdateStatusRequest.java | 2 ++ 3 files changed, 11 insertions(+) diff --git a/product/product-rest/src/main/java/cn/iocoder/mall/product/rest/request/category/AdminsProductCategoryAddRequest.java b/product/product-rest/src/main/java/cn/iocoder/mall/product/rest/request/category/AdminsProductCategoryAddRequest.java index 565be064d..6b25daf69 100644 --- a/product/product-rest/src/main/java/cn/iocoder/mall/product/rest/request/category/AdminsProductCategoryAddRequest.java +++ b/product/product-rest/src/main/java/cn/iocoder/mall/product/rest/request/category/AdminsProductCategoryAddRequest.java @@ -19,17 +19,21 @@ public class AdminsProductCategoryAddRequest { // TODO FROM 芋艿 to 伟帆:写了 swagger 注解,我们可以少写一份 Java 注释。[DONE] @ApiModelProperty(name = "pid", value = "父级分类编号", required = true, example = "1") + @NotNull(message = "父分类编号不能为空") private Integer pid; @ApiModelProperty(name = "name", value = "分类名字(标识)", required = true, example = "admin/info") + @NotNull(message = "名称不能为空") private String name; @ApiModelProperty(name = "description", value = "描述", required = true, example = "1") + @NotNull(message = "描述不能为空") private String description; @ApiModelProperty(name = "picUrl", value = "分类图片", example = "http://www.iocoder.cn/images/common/wechat_mp_2017_07_31_bak.jpg/") private String picUrl; @ApiModelProperty(name = "sort", value = "排序", required = true, example = "1") + @NotNull(message = "排序值不能为空") private Integer sort; } diff --git a/product/product-rest/src/main/java/cn/iocoder/mall/product/rest/request/category/AdminsProductCategoryUpdateRequest.java b/product/product-rest/src/main/java/cn/iocoder/mall/product/rest/request/category/AdminsProductCategoryUpdateRequest.java index db28ab019..27dd4a6ff 100644 --- a/product/product-rest/src/main/java/cn/iocoder/mall/product/rest/request/category/AdminsProductCategoryUpdateRequest.java +++ b/product/product-rest/src/main/java/cn/iocoder/mall/product/rest/request/category/AdminsProductCategoryUpdateRequest.java @@ -18,20 +18,25 @@ import javax.validation.constraints.NotNull; public class AdminsProductCategoryUpdateRequest { @ApiModelProperty(name = "id", value = "分类编号", required = true, example = "1") + @NotNull(message = "编号不能为空") private Integer id; @ApiModelProperty(name = "pid", value = "父级分类编号", required = true, example = "1") + @NotNull(message = "父分类编号不能为空") private Integer pid; @ApiModelProperty(name = "name", value = "分类名字(标识)", required = true, example = "admin/info") + @NotNull(message = "名称不能为空") private String name; @ApiModelProperty(name = "description", value = "描述", required = true, example = "1") + @NotNull(message = "描述不能为空") private String description; @ApiModelProperty(name = "picUrl", value = "分类图片", example = "http://www.iocoder.cn/images/common/wechat_mp_2017_07_31_bak.jpg/") private String picUrl; @ApiModelProperty(name = "sort", value = "排序", required = true, example = "1") + @NotNull(message = "排序值不能为空") private Integer sort; } diff --git a/product/product-rest/src/main/java/cn/iocoder/mall/product/rest/request/category/AdminsProductCategoryUpdateStatusRequest.java b/product/product-rest/src/main/java/cn/iocoder/mall/product/rest/request/category/AdminsProductCategoryUpdateStatusRequest.java index 01b2d773f..d572e89ba 100644 --- a/product/product-rest/src/main/java/cn/iocoder/mall/product/rest/request/category/AdminsProductCategoryUpdateStatusRequest.java +++ b/product/product-rest/src/main/java/cn/iocoder/mall/product/rest/request/category/AdminsProductCategoryUpdateStatusRequest.java @@ -18,8 +18,10 @@ import javax.validation.constraints.NotNull; public class AdminsProductCategoryUpdateStatusRequest { @ApiModelProperty(name = "id", value = "分类编号", required = true, example = "1") + @NotNull(message = "编号不能为空") private Integer id; @ApiModelProperty(name = "status", value = "状态。1 - 开启;2 - 禁用", required = true, example = "1") + @NotNull(message = "状态不能为空") private Integer status; }