调整请求参数校验
This commit is contained in:
parent
0c328605b7
commit
b6498b4483
|
@ -19,17 +19,21 @@ public class AdminsProductCategoryAddRequest {
|
||||||
|
|
||||||
// TODO FROM 芋艿 to 伟帆:写了 swagger 注解,我们可以少写一份 Java 注释。[DONE]
|
// TODO FROM 芋艿 to 伟帆:写了 swagger 注解,我们可以少写一份 Java 注释。[DONE]
|
||||||
@ApiModelProperty(name = "pid", value = "父级分类编号", required = true, example = "1")
|
@ApiModelProperty(name = "pid", value = "父级分类编号", required = true, example = "1")
|
||||||
|
@NotNull(message = "父分类编号不能为空")
|
||||||
private Integer pid;
|
private Integer pid;
|
||||||
|
|
||||||
@ApiModelProperty(name = "name", value = "分类名字(标识)", required = true, example = "admin/info")
|
@ApiModelProperty(name = "name", value = "分类名字(标识)", required = true, example = "admin/info")
|
||||||
|
@NotNull(message = "名称不能为空")
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
@ApiModelProperty(name = "description", value = "描述", required = true, example = "1")
|
@ApiModelProperty(name = "description", value = "描述", required = true, example = "1")
|
||||||
|
@NotNull(message = "描述不能为空")
|
||||||
private String description;
|
private String description;
|
||||||
|
|
||||||
@ApiModelProperty(name = "picUrl", value = "分类图片", example = "http://www.iocoder.cn/images/common/wechat_mp_2017_07_31_bak.jpg/")
|
@ApiModelProperty(name = "picUrl", value = "分类图片", example = "http://www.iocoder.cn/images/common/wechat_mp_2017_07_31_bak.jpg/")
|
||||||
private String picUrl;
|
private String picUrl;
|
||||||
|
|
||||||
@ApiModelProperty(name = "sort", value = "排序", required = true, example = "1")
|
@ApiModelProperty(name = "sort", value = "排序", required = true, example = "1")
|
||||||
|
@NotNull(message = "排序值不能为空")
|
||||||
private Integer sort;
|
private Integer sort;
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,20 +18,25 @@ import javax.validation.constraints.NotNull;
|
||||||
public class AdminsProductCategoryUpdateRequest {
|
public class AdminsProductCategoryUpdateRequest {
|
||||||
|
|
||||||
@ApiModelProperty(name = "id", value = "分类编号", required = true, example = "1")
|
@ApiModelProperty(name = "id", value = "分类编号", required = true, example = "1")
|
||||||
|
@NotNull(message = "编号不能为空")
|
||||||
private Integer id;
|
private Integer id;
|
||||||
|
|
||||||
@ApiModelProperty(name = "pid", value = "父级分类编号", required = true, example = "1")
|
@ApiModelProperty(name = "pid", value = "父级分类编号", required = true, example = "1")
|
||||||
|
@NotNull(message = "父分类编号不能为空")
|
||||||
private Integer pid;
|
private Integer pid;
|
||||||
|
|
||||||
@ApiModelProperty(name = "name", value = "分类名字(标识)", required = true, example = "admin/info")
|
@ApiModelProperty(name = "name", value = "分类名字(标识)", required = true, example = "admin/info")
|
||||||
|
@NotNull(message = "名称不能为空")
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
@ApiModelProperty(name = "description", value = "描述", required = true, example = "1")
|
@ApiModelProperty(name = "description", value = "描述", required = true, example = "1")
|
||||||
|
@NotNull(message = "描述不能为空")
|
||||||
private String description;
|
private String description;
|
||||||
|
|
||||||
@ApiModelProperty(name = "picUrl", value = "分类图片", example = "http://www.iocoder.cn/images/common/wechat_mp_2017_07_31_bak.jpg/")
|
@ApiModelProperty(name = "picUrl", value = "分类图片", example = "http://www.iocoder.cn/images/common/wechat_mp_2017_07_31_bak.jpg/")
|
||||||
private String picUrl;
|
private String picUrl;
|
||||||
|
|
||||||
@ApiModelProperty(name = "sort", value = "排序", required = true, example = "1")
|
@ApiModelProperty(name = "sort", value = "排序", required = true, example = "1")
|
||||||
|
@NotNull(message = "排序值不能为空")
|
||||||
private Integer sort;
|
private Integer sort;
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,8 +18,10 @@ import javax.validation.constraints.NotNull;
|
||||||
public class AdminsProductCategoryUpdateStatusRequest {
|
public class AdminsProductCategoryUpdateStatusRequest {
|
||||||
|
|
||||||
@ApiModelProperty(name = "id", value = "分类编号", required = true, example = "1")
|
@ApiModelProperty(name = "id", value = "分类编号", required = true, example = "1")
|
||||||
|
@NotNull(message = "编号不能为空")
|
||||||
private Integer id;
|
private Integer id;
|
||||||
|
|
||||||
@ApiModelProperty(name = "status", value = "状态。1 - 开启;2 - 禁用", required = true, example = "1")
|
@ApiModelProperty(name = "status", value = "状态。1 - 开启;2 - 禁用", required = true, example = "1")
|
||||||
|
@NotNull(message = "状态不能为空")
|
||||||
private Integer status;
|
private Integer status;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue