From 0489dc81bbdd08b8cfb9e652f4242777afe1a0cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?= <15040126243@163.com> Date: Mon, 23 Oct 2023 15:59:50 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E4=BF=AE=E5=A4=8D=20=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=BB=84=E5=AF=BC=E8=87=B4=E7=9A=84=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C=E4=B8=8D=E7=94=9F=E6=95=88=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dromara/system/domain/bo/SysClientBo.java | 10 ++++------ .../dromara/system/domain/bo/SysConfigBo.java | 15 +++++++-------- .../org/dromara/system/domain/bo/SysDeptBo.java | 12 ++++++------ .../dromara/system/domain/bo/SysDictDataBo.java | 17 +++++++---------- .../dromara/system/domain/bo/SysDictTypeBo.java | 17 +++++++---------- .../org/dromara/system/domain/bo/SysMenuBo.java | 17 +++++++---------- .../dromara/system/domain/bo/SysNoticeBo.java | 15 ++++++--------- .../org/dromara/system/domain/bo/SysPostBo.java | 17 +++++++---------- .../org/dromara/system/domain/bo/SysRoleBo.java | 17 +++++++---------- 9 files changed, 58 insertions(+), 79 deletions(-) diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/SysClientBo.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/SysClientBo.java index 82a9180d..eb0135e4 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/SysClientBo.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/SysClientBo.java @@ -5,8 +5,6 @@ import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.NotNull; import lombok.Data; import lombok.EqualsAndHashCode; -import org.dromara.common.core.validate.AddGroup; -import org.dromara.common.core.validate.EditGroup; import org.dromara.common.mybatis.core.domain.BaseEntity; import org.dromara.system.domain.SysClient; @@ -25,7 +23,7 @@ public class SysClientBo extends BaseEntity { /** * id */ - @NotNull(message = "id不能为空", groups = { EditGroup.class }) + @NotNull(message = "id不能为空") private Long id; /** @@ -36,19 +34,19 @@ public class SysClientBo extends BaseEntity { /** * 客户端key */ - @NotBlank(message = "客户端key不能为空", groups = { AddGroup.class, EditGroup.class }) + @NotBlank(message = "客户端key不能为空") private String clientKey; /** * 客户端秘钥 */ - @NotBlank(message = "客户端秘钥不能为空", groups = { AddGroup.class, EditGroup.class }) + @NotBlank(message = "客户端秘钥不能为空") private String clientSecret; /** * 授权类型 */ - @NotNull(message = "授权类型不能为空", groups = { AddGroup.class, EditGroup.class }) + @NotNull(message = "授权类型不能为空") private List grantTypeList; /** diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/SysConfigBo.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/SysConfigBo.java index 7af84ce9..56c40faa 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/SysConfigBo.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/SysConfigBo.java @@ -1,15 +1,14 @@ package org.dromara.system.domain.bo; import io.github.linpeilie.annotations.AutoMapper; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; import lombok.Data; import lombok.EqualsAndHashCode; -import org.dromara.common.core.validate.AddGroup; -import org.dromara.common.core.validate.EditGroup; import org.dromara.common.mybatis.core.domain.BaseEntity; import org.dromara.system.domain.SysConfig; -import jakarta.validation.constraints.*; - /** * 参数配置业务对象 sys_config * @@ -24,27 +23,27 @@ public class SysConfigBo extends BaseEntity { /** * 参数主键 */ - @NotNull(message = "参数主键不能为空", groups = { EditGroup.class }) + @NotNull(message = "参数主键不能为空") private Long configId; /** * 参数名称 */ - @NotBlank(message = "参数名称不能为空", groups = { AddGroup.class, EditGroup.class }) + @NotBlank(message = "参数名称不能为空") @Size(min = 0, max = 100, message = "参数名称不能超过{max}个字符") private String configName; /** * 参数键名 */ - @NotBlank(message = "参数键名不能为空", groups = { AddGroup.class, EditGroup.class }) + @NotBlank(message = "参数键名不能为空") @Size(min = 0, max = 100, message = "参数键名长度不能超过{max}个字符") private String configKey; /** * 参数键值 */ - @NotBlank(message = "参数键值不能为空", groups = { AddGroup.class, EditGroup.class }) + @NotBlank(message = "参数键值不能为空") @Size(min = 0, max = 500, message = "参数键值长度不能超过{max}个字符") private String configValue; diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/SysDeptBo.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/SysDeptBo.java index 07242e30..9b2951e8 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/SysDeptBo.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/SysDeptBo.java @@ -1,15 +1,15 @@ package org.dromara.system.domain.bo; import io.github.linpeilie.annotations.AutoMapper; +import jakarta.validation.constraints.Email; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; import lombok.Data; import lombok.EqualsAndHashCode; -import org.dromara.common.core.validate.AddGroup; -import org.dromara.common.core.validate.EditGroup; import org.dromara.common.mybatis.core.domain.BaseEntity; import org.dromara.system.domain.SysDept; -import jakarta.validation.constraints.*; - /** * 部门业务对象 sys_dept * @@ -24,7 +24,7 @@ public class SysDeptBo extends BaseEntity { /** * 部门id */ - @NotNull(message = "部门id不能为空", groups = { EditGroup.class }) + @NotNull(message = "部门id不能为空") private Long deptId; /** @@ -35,7 +35,7 @@ public class SysDeptBo extends BaseEntity { /** * 部门名称 */ - @NotBlank(message = "部门名称不能为空", groups = { AddGroup.class, EditGroup.class }) + @NotBlank(message = "部门名称不能为空") @Size(min = 0, max = 30, message = "部门名称长度不能超过{max}个字符") private String deptName; diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/SysDictDataBo.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/SysDictDataBo.java index 6305b876..24a86c17 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/SysDictDataBo.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/SysDictDataBo.java @@ -1,17 +1,14 @@ package org.dromara.system.domain.bo; import io.github.linpeilie.annotations.AutoMapper; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; import lombok.Data; import lombok.EqualsAndHashCode; -import org.dromara.common.core.validate.AddGroup; -import org.dromara.common.core.validate.EditGroup; import org.dromara.common.mybatis.core.domain.BaseEntity; import org.dromara.system.domain.SysDictData; -import jakarta.validation.constraints.NotBlank; -import jakarta.validation.constraints.NotNull; -import jakarta.validation.constraints.Size; - /** * 字典数据业务对象 sys_dict_data * @@ -26,7 +23,7 @@ public class SysDictDataBo extends BaseEntity { /** * 字典编码 */ - @NotNull(message = "字典编码不能为空", groups = { EditGroup.class }) + @NotNull(message = "字典编码不能为空") private Long dictCode; /** @@ -37,21 +34,21 @@ public class SysDictDataBo extends BaseEntity { /** * 字典标签 */ - @NotBlank(message = "字典标签不能为空", groups = { AddGroup.class, EditGroup.class }) + @NotBlank(message = "字典标签不能为空") @Size(min = 0, max = 100, message = "字典标签长度不能超过{max}个字符") private String dictLabel; /** * 字典键值 */ - @NotBlank(message = "字典键值不能为空", groups = { AddGroup.class, EditGroup.class }) + @NotBlank(message = "字典键值不能为空") @Size(min = 0, max = 100, message = "字典键值长度不能超过{max}个字符") private String dictValue; /** * 字典类型 */ - @NotBlank(message = "字典类型不能为空", groups = { AddGroup.class, EditGroup.class }) + @NotBlank(message = "字典类型不能为空") @Size(min = 0, max = 100, message = "字典类型长度不能超过{max}个字符") private String dictType; diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/SysDictTypeBo.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/SysDictTypeBo.java index e4b15145..90294fe3 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/SysDictTypeBo.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/SysDictTypeBo.java @@ -1,17 +1,14 @@ package org.dromara.system.domain.bo; import io.github.linpeilie.annotations.AutoMapper; -import lombok.Data; -import lombok.EqualsAndHashCode; -import org.dromara.common.core.validate.AddGroup; -import org.dromara.common.core.validate.EditGroup; -import org.dromara.common.mybatis.core.domain.BaseEntity; -import org.dromara.system.domain.SysDictType; - import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.Pattern; import jakarta.validation.constraints.Size; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.dromara.common.mybatis.core.domain.BaseEntity; +import org.dromara.system.domain.SysDictType; /** * 字典类型业务对象 sys_dict_type @@ -27,20 +24,20 @@ public class SysDictTypeBo extends BaseEntity { /** * 字典主键 */ - @NotNull(message = "字典主键不能为空", groups = { EditGroup.class }) + @NotNull(message = "字典主键不能为空") private Long dictId; /** * 字典名称 */ - @NotBlank(message = "字典名称不能为空", groups = { AddGroup.class, EditGroup.class }) + @NotBlank(message = "字典名称不能为空") @Size(min = 0, max = 100, message = "字典类型名称长度不能超过{max}个字符") private String dictName; /** * 字典类型 */ - @NotBlank(message = "字典类型不能为空", groups = { AddGroup.class, EditGroup.class }) + @NotBlank(message = "字典类型不能为空") @Size(min = 0, max = 100, message = "字典类型类型长度不能超过{max}个字符") @Pattern(regexp = "^[a-z][a-z0-9_]*$", message = "字典类型必须以字母开头,且只能为(小写字母,数字,下滑线)") private String dictType; diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/SysMenuBo.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/SysMenuBo.java index d73de5e7..751a49ad 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/SysMenuBo.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/SysMenuBo.java @@ -2,17 +2,14 @@ package org.dromara.system.domain.bo; import com.fasterxml.jackson.annotation.JsonInclude; import io.github.linpeilie.annotations.AutoMapper; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; import lombok.Data; import lombok.EqualsAndHashCode; -import org.dromara.common.core.validate.AddGroup; -import org.dromara.common.core.validate.EditGroup; import org.dromara.common.mybatis.core.domain.BaseEntity; import org.dromara.system.domain.SysMenu; -import jakarta.validation.constraints.NotBlank; -import jakarta.validation.constraints.NotNull; -import jakarta.validation.constraints.Size; - /** * 菜单权限业务对象 sys_menu * @@ -27,7 +24,7 @@ public class SysMenuBo extends BaseEntity { /** * 菜单ID */ - @NotNull(message = "菜单ID不能为空", groups = { EditGroup.class }) + @NotNull(message = "菜单ID不能为空") private Long menuId; /** @@ -38,14 +35,14 @@ public class SysMenuBo extends BaseEntity { /** * 菜单名称 */ - @NotBlank(message = "菜单名称不能为空", groups = { AddGroup.class, EditGroup.class }) + @NotBlank(message = "菜单名称不能为空") @Size(min = 0, max = 50, message = "菜单名称长度不能超过{max}个字符") private String menuName; /** * 显示顺序 */ - @NotNull(message = "显示顺序不能为空", groups = { AddGroup.class, EditGroup.class }) + @NotNull(message = "显示顺序不能为空") private Integer orderNum; /** @@ -78,7 +75,7 @@ public class SysMenuBo extends BaseEntity { /** * 菜单类型(M目录 C菜单 F按钮) */ - @NotBlank(message = "菜单类型不能为空", groups = { AddGroup.class, EditGroup.class }) + @NotBlank(message = "菜单类型不能为空") private String menuType; /** diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/SysNoticeBo.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/SysNoticeBo.java index b7edb3ac..6a004f28 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/SysNoticeBo.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/SysNoticeBo.java @@ -1,18 +1,15 @@ package org.dromara.system.domain.bo; import io.github.linpeilie.annotations.AutoMapper; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; import lombok.Data; import lombok.EqualsAndHashCode; -import org.dromara.common.core.validate.AddGroup; -import org.dromara.common.core.validate.EditGroup; -import org.dromara.common.mybatis.core.domain.BaseEntity; import org.dromara.common.core.xss.Xss; +import org.dromara.common.mybatis.core.domain.BaseEntity; import org.dromara.system.domain.SysNotice; -import jakarta.validation.constraints.NotBlank; -import jakarta.validation.constraints.NotNull; -import jakarta.validation.constraints.Size; - /** * 通知公告业务对象 sys_notice * @@ -27,14 +24,14 @@ public class SysNoticeBo extends BaseEntity { /** * 公告ID */ - @NotNull(message = "公告ID不能为空", groups = { EditGroup.class }) + @NotNull(message = "公告ID不能为空") private Long noticeId; /** * 公告标题 */ @Xss(message = "公告标题不能包含脚本字符") - @NotBlank(message = "公告标题不能为空", groups = { AddGroup.class, EditGroup.class }) + @NotBlank(message = "公告标题不能为空") @Size(min = 0, max = 50, message = "公告标题不能超过{max}个字符") private String noticeTitle; diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/SysPostBo.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/SysPostBo.java index 8bfbf11c..1a5160aa 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/SysPostBo.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/SysPostBo.java @@ -1,17 +1,14 @@ package org.dromara.system.domain.bo; import io.github.linpeilie.annotations.AutoMapper; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; import lombok.Data; import lombok.EqualsAndHashCode; -import org.dromara.common.core.validate.AddGroup; -import org.dromara.common.core.validate.EditGroup; import org.dromara.common.mybatis.core.domain.BaseEntity; import org.dromara.system.domain.SysPost; -import jakarta.validation.constraints.NotBlank; -import jakarta.validation.constraints.NotNull; -import jakarta.validation.constraints.Size; - /** * 岗位信息业务对象 sys_post * @@ -26,27 +23,27 @@ public class SysPostBo extends BaseEntity { /** * 岗位ID */ - @NotNull(message = "岗位ID不能为空", groups = { EditGroup.class }) + @NotNull(message = "岗位ID不能为空") private Long postId; /** * 岗位编码 */ - @NotBlank(message = "岗位编码不能为空", groups = { AddGroup.class, EditGroup.class }) + @NotBlank(message = "岗位编码不能为空") @Size(min = 0, max = 64, message = "岗位编码长度不能超过{max}个字符") private String postCode; /** * 岗位名称 */ - @NotBlank(message = "岗位名称不能为空", groups = { AddGroup.class, EditGroup.class }) + @NotBlank(message = "岗位名称不能为空") @Size(min = 0, max = 50, message = "岗位名称长度不能超过{max}个字符") private String postName; /** * 显示顺序 */ - @NotNull(message = "显示顺序不能为空", groups = { AddGroup.class, EditGroup.class }) + @NotNull(message = "显示顺序不能为空") private Integer postSort; /** diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/SysRoleBo.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/SysRoleBo.java index a381d631..788973ca 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/SysRoleBo.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/SysRoleBo.java @@ -1,19 +1,16 @@ package org.dromara.system.domain.bo; import io.github.linpeilie.annotations.AutoMapper; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; import org.dromara.common.core.constant.UserConstants; -import org.dromara.common.core.validate.AddGroup; -import org.dromara.common.core.validate.EditGroup; import org.dromara.common.mybatis.core.domain.BaseEntity; import org.dromara.system.domain.SysRole; -import jakarta.validation.constraints.NotBlank; -import jakarta.validation.constraints.NotNull; -import jakarta.validation.constraints.Size; - /** * 角色信息业务对象 sys_role * @@ -29,27 +26,27 @@ public class SysRoleBo extends BaseEntity { /** * 角色ID */ - @NotNull(message = "角色ID不能为空", groups = { EditGroup.class }) + @NotNull(message = "角色ID不能为空") private Long roleId; /** * 角色名称 */ - @NotBlank(message = "角色名称不能为空", groups = { AddGroup.class, EditGroup.class }) + @NotBlank(message = "角色名称不能为空") @Size(min = 0, max = 30, message = "角色名称长度不能超过{max}个字符") private String roleName; /** * 角色权限字符串 */ - @NotBlank(message = "角色权限字符串不能为空", groups = { AddGroup.class, EditGroup.class }) + @NotBlank(message = "角色权限字符串不能为空") @Size(min = 0, max = 100, message = "权限字符长度不能超过{max}个字符") private String roleKey; /** * 显示顺序 */ - @NotNull(message = "显示顺序不能为空", groups = { AddGroup.class, EditGroup.class }) + @NotNull(message = "显示顺序不能为空") private Integer roleSort; /**