From af0e0a110e7187bf008655f7510199a0c0b25ec4 Mon Sep 17 00:00:00 2001 From: Nymph2333 <498092988@qq.com> Date: 星期一, 10 四月 2023 14:27:40 +0800 Subject: [PATCH] newInstance() 已弃用,使用clazz.getDeclaredConstructor().newInstance() This method propagates any exception thrown by the nullary constructor, including a checked exception. Use of this method effectively bypasses the compile-time exception checking that would otherwise be performed by the compiler. The Constructor.newInstance method avoids this problem by wrapping any exception thrown by the constructor in a (checked) InvocationTargetException. The call clazz.newInstance() can be replaced by clazz.getDeclaredConstructor().newInstance() The latter sequence of calls is inferred to be able to throw the additional exception types InvocationTargetException and NoSuchMethodException. Both of these exception types are subclasses of ReflectiveOperationException. --- ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysMenu.java | 38 +++++++++++++++++++++++++++++++++----- 1 files changed, 33 insertions(+), 5 deletions(-) diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysMenu.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysMenu.java index b8ad1f3..9f3a6f6 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysMenu.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysMenu.java @@ -3,6 +3,7 @@ import java.util.ArrayList; import java.util.List; import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; @@ -30,7 +31,7 @@ private Long parentId; /** 显示顺序 */ - private String orderNum; + private Integer orderNum; /** 路由地址 */ private String path; @@ -38,8 +39,14 @@ /** 组件路径 */ private String component; + /** 路由参数 */ + private String query; + /** 是否为外链(0是 1否) */ private String isFrame; + + /** 是否缓存(0缓存 1不缓存) */ + private String isCache; /** 类型(M目录 C菜单 F按钮) */ private String menuType; @@ -47,7 +54,7 @@ /** 显示状态(0显示 1隐藏) */ private String visible; - /** 菜单状态(0显示 1隐藏) */ + /** 菜单状态(0正常 1停用) */ private String status; /** 权限字符串 */ @@ -101,13 +108,13 @@ this.parentId = parentId; } - @NotBlank(message = "显示顺序不能为空") - public String getOrderNum() + @NotNull(message = "显示顺序不能为空") + public Integer getOrderNum() { return orderNum; } - public void setOrderNum(String orderNum) + public void setOrderNum(Integer orderNum) { this.orderNum = orderNum; } @@ -134,6 +141,16 @@ this.component = component; } + public String getQuery() + { + return query; + } + + public void setQuery(String query) + { + this.query = query; + } + public String getIsFrame() { return isFrame; @@ -142,6 +159,16 @@ public void setIsFrame(String isFrame) { this.isFrame = isFrame; + } + + public String getIsCache() + { + return isCache; + } + + public void setIsCache(String isCache) + { + this.isCache = isCache; } @NotBlank(message = "菜单类型不能为空") @@ -216,6 +243,7 @@ .append("path", getPath()) .append("component", getComponent()) .append("isFrame", getIsFrame()) + .append("IsCache", getIsCache()) .append("menuType", getMenuType()) .append("visible", getVisible()) .append("status ", getStatus()) -- Gitblit v1.9.2