From 4adb0063ef324e235218cc73eea63e39a6e8e59f Mon Sep 17 00:00:00 2001 From: inleft <inleft@qq.com> Date: Fri, 26 Aug 2022 18:44:55 +0800 Subject: [PATCH] 微调字段 --- snowy-main/src/main/java/vip/xiaonuo/modular/blogfriendshiplink/param/BlogFriendshipLinkParam.java | 11 +++++++++-- 1 files changed, 9 insertions(+), 2 deletions(-) diff --git a/snowy-main/src/main/java/vip/xiaonuo/modular/blogfriendshiplink/param/BlogFriendshipLinkParam.java b/snowy-main/src/main/java/vip/xiaonuo/modular/blogfriendshiplink/param/BlogFriendshipLinkParam.java index 00fc567..34c3ae9 100644 --- a/snowy-main/src/main/java/vip/xiaonuo/modular/blogfriendshiplink/param/BlogFriendshipLinkParam.java +++ b/snowy-main/src/main/java/vip/xiaonuo/modular/blogfriendshiplink/param/BlogFriendshipLinkParam.java @@ -29,13 +29,15 @@ import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; +import javax.validation.constraints.Pattern; +import javax.validation.constraints.Size; /** -* 友情链接参数类 + * 友情链接参数类 * * @author inleft * @date 2022-02-17 15:05:44 -*/ + */ @Data public class BlogFriendshipLinkParam extends BaseParam { @@ -54,17 +56,22 @@ /** * url地址 */ + @Size(max = 200, groups = {add.class, edit.class}) @NotBlank(message = "url地址不能为空,请检查url参数", groups = {add.class, edit.class}) + @Pattern(regexp = "^$|^((https|http)?:\\/\\/)[^\\s]+", message = "url格式错误", groups = {add.class}) private String url; /** * 头像地址 */ + @Size(max = 200, groups = {add.class, edit.class}) + @Pattern(regexp = "^$|^((https|http)?:\\/\\/)[^\\s]+", message = "头像格式错误", groups = {add.class}) private String avatar; /** * 描述 */ + @Size(max = 200) //@NotBlank(message = "描述不能为空,请检查remark参数", groups = {add.class, edit.class}) private String remark; -- Gitblit v1.9.1