diff --git a/roncoo-education-common/roncoo-education-common-core/src/main/java/com/roncoo/education/common/core/tools/Constants.java b/roncoo-education-common/roncoo-education-common-core/src/main/java/com/roncoo/education/common/core/tools/Constants.java index 029dfbfb..1390d5e3 100644 --- a/roncoo-education-common/roncoo-education-common-core/src/main/java/com/roncoo/education/common/core/tools/Constants.java +++ b/roncoo-education-common/roncoo-education-common-core/src/main/java/com/roncoo/education/common/core/tools/Constants.java @@ -23,7 +23,7 @@ private Constants() { public final static int SESSIONTIME = 40; public interface RedisPre { - String ADMINI_MENU = "admin::menu::"; + String ADMINI_APIS = "admin::apis::"; String ADMIN_VERI_CODE = "admin::ver::code::"; String USER_STUDY = "user::study::"; /** diff --git a/roncoo-education-gateway/src/main/java/com/roncoo/education/gateway/filter/EduGlobalFilter.java b/roncoo-education-gateway/src/main/java/com/roncoo/education/gateway/filter/EduGlobalFilter.java index 3c596ad2..f33982d7 100644 --- a/roncoo-education-gateway/src/main/java/com/roncoo/education/gateway/filter/EduGlobalFilter.java +++ b/roncoo-education-gateway/src/main/java/com/roncoo/education/gateway/filter/EduGlobalFilter.java @@ -85,16 +85,16 @@ public Mono filter(ServerWebExchange exchange, GatewayFilterChain chain) { Long userId = getUserId(request); if (FilterUtil.checkUri(uri, FilterUtil.ADMIN_URL_PREFIX)) { // admin校验 - if (!stringRedisTemplate.hasKey(Constants.RedisPre.ADMINI_MENU.concat(userId.toString()))) { + if (!stringRedisTemplate.hasKey(Constants.RedisPre.ADMINI_APIS.concat(userId.toString()))) { throw new BaseException(ResultEnum.MENU_PAST); } - String tk = stringRedisTemplate.opsForValue().get(Constants.RedisPre.ADMINI_MENU.concat(userId.toString())); + String tk = stringRedisTemplate.opsForValue().get(Constants.RedisPre.ADMINI_APIS.concat(userId.toString())); // 校验接口是否有权限 if (!checkUri(uri, tk)) { throw new BaseException(ResultEnum.MENU_NO); } // 更新时间,使用户菜单不过期 - stringRedisTemplate.expire(Constants.RedisPre.ADMINI_MENU.concat(userId.toString()), Constants.SESSIONTIME, TimeUnit.MINUTES); + stringRedisTemplate.expire(Constants.RedisPre.ADMINI_APIS.concat(userId.toString()), Constants.SESSIONTIME, TimeUnit.MINUTES); } request.mutate().header(Constants.USER_ID, String.valueOf(userId)); return chain.filter(exchange); diff --git a/roncoo-education-service/roncoo-education-service-system/src/main/java/com/roncoo/education/system/dao/impl/mapper/entity/SysMenu.java b/roncoo-education-service/roncoo-education-service-system/src/main/java/com/roncoo/education/system/dao/impl/mapper/entity/SysMenu.java index e317e75d..b76c9135 100644 --- a/roncoo-education-service/roncoo-education-service-system/src/main/java/com/roncoo/education/system/dao/impl/mapper/entity/SysMenu.java +++ b/roncoo-education-service/roncoo-education-service-system/src/main/java/com/roncoo/education/system/dao/impl/mapper/entity/SysMenu.java @@ -16,22 +16,24 @@ public class SysMenu implements Serializable { private Long parentId; + private Boolean isShow; + private Integer menuType; private String menuName; private String menuIcon; - private String pathRouter; - - private String pathApi; + private String path; - private String componentPath; + private String component; - private String componentName; + private String apis; private String permission; + private String remark; + private static final long serialVersionUID = 1L; public Long getId() { @@ -82,6 +84,14 @@ public void setParentId(Long parentId) { this.parentId = parentId; } + public Boolean getIsShow() { + return isShow; + } + + public void setIsShow(Boolean isShow) { + this.isShow = isShow; + } + public Integer getMenuType() { return menuType; } @@ -106,36 +116,28 @@ public void setMenuIcon(String menuIcon) { this.menuIcon = menuIcon == null ? null : menuIcon.trim(); } - public String getPathRouter() { - return pathRouter; + public String getPath() { + return path; } - public void setPathRouter(String pathRouter) { - this.pathRouter = pathRouter == null ? null : pathRouter.trim(); + public void setPath(String path) { + this.path = path == null ? null : path.trim(); } - public String getPathApi() { - return pathApi; + public String getComponent() { + return component; } - public void setPathApi(String pathApi) { - this.pathApi = pathApi == null ? null : pathApi.trim(); + public void setComponent(String component) { + this.component = component == null ? null : component.trim(); } - public String getComponentPath() { - return componentPath; + public String getApis() { + return apis; } - public void setComponentPath(String componentPath) { - this.componentPath = componentPath == null ? null : componentPath.trim(); - } - - public String getComponentName() { - return componentName; - } - - public void setComponentName(String componentName) { - this.componentName = componentName == null ? null : componentName.trim(); + public void setApis(String apis) { + this.apis = apis == null ? null : apis.trim(); } public String getPermission() { @@ -146,6 +148,14 @@ public void setPermission(String permission) { this.permission = permission == null ? null : permission.trim(); } + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark == null ? null : remark.trim(); + } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -158,14 +168,15 @@ public String toString() { sb.append(", statusId=").append(statusId); sb.append(", sort=").append(sort); sb.append(", parentId=").append(parentId); + sb.append(", isShow=").append(isShow); sb.append(", menuType=").append(menuType); sb.append(", menuName=").append(menuName); sb.append(", menuIcon=").append(menuIcon); - sb.append(", pathRouter=").append(pathRouter); - sb.append(", pathApi=").append(pathApi); - sb.append(", componentPath=").append(componentPath); - sb.append(", componentName=").append(componentName); + sb.append(", path=").append(path); + sb.append(", component=").append(component); + sb.append(", apis=").append(apis); sb.append(", permission=").append(permission); + sb.append(", remark=").append(remark); sb.append(", serialVersionUID=").append(serialVersionUID); sb.append("]"); return sb.toString(); diff --git a/roncoo-education-service/roncoo-education-service-system/src/main/java/com/roncoo/education/system/dao/impl/mapper/entity/SysMenuExample.java b/roncoo-education-service/roncoo-education-service-system/src/main/java/com/roncoo/education/system/dao/impl/mapper/entity/SysMenuExample.java index 8d56a5ab..d2a72fa5 100644 --- a/roncoo-education-service/roncoo-education-service-system/src/main/java/com/roncoo/education/system/dao/impl/mapper/entity/SysMenuExample.java +++ b/roncoo-education-service/roncoo-education-service-system/src/main/java/com/roncoo/education/system/dao/impl/mapper/entity/SysMenuExample.java @@ -485,6 +485,66 @@ public Criteria andParentIdNotBetween(Long value1, Long value2) { return (Criteria) this; } + public Criteria andIsShowIsNull() { + addCriterion("is_show is null"); + return (Criteria) this; + } + + public Criteria andIsShowIsNotNull() { + addCriterion("is_show is not null"); + return (Criteria) this; + } + + public Criteria andIsShowEqualTo(Boolean value) { + addCriterion("is_show =", value, "isShow"); + return (Criteria) this; + } + + public Criteria andIsShowNotEqualTo(Boolean value) { + addCriterion("is_show <>", value, "isShow"); + return (Criteria) this; + } + + public Criteria andIsShowGreaterThan(Boolean value) { + addCriterion("is_show >", value, "isShow"); + return (Criteria) this; + } + + public Criteria andIsShowGreaterThanOrEqualTo(Boolean value) { + addCriterion("is_show >=", value, "isShow"); + return (Criteria) this; + } + + public Criteria andIsShowLessThan(Boolean value) { + addCriterion("is_show <", value, "isShow"); + return (Criteria) this; + } + + public Criteria andIsShowLessThanOrEqualTo(Boolean value) { + addCriterion("is_show <=", value, "isShow"); + return (Criteria) this; + } + + public Criteria andIsShowIn(List values) { + addCriterion("is_show in", values, "isShow"); + return (Criteria) this; + } + + public Criteria andIsShowNotIn(List values) { + addCriterion("is_show not in", values, "isShow"); + return (Criteria) this; + } + + public Criteria andIsShowBetween(Boolean value1, Boolean value2) { + addCriterion("is_show between", value1, value2, "isShow"); + return (Criteria) this; + } + + public Criteria andIsShowNotBetween(Boolean value1, Boolean value2) { + addCriterion("is_show not between", value1, value2, "isShow"); + return (Criteria) this; + } + public Criteria andMenuTypeIsNull() { addCriterion("menu_type is null"); return (Criteria) this; @@ -685,353 +745,353 @@ public Criteria andMenuIconNotBetween(String value1, String value2) { return (Criteria) this; } - public Criteria andPathRouterIsNull() { - addCriterion("path_router is null"); + public Criteria andPathIsNull() { + addCriterion("path is null"); return (Criteria) this; } - public Criteria andPathRouterIsNotNull() { - addCriterion("path_router is not null"); + public Criteria andPathIsNotNull() { + addCriterion("path is not null"); return (Criteria) this; } - public Criteria andPathRouterEqualTo(String value) { - addCriterion("path_router =", value, "pathRouter"); + public Criteria andPathEqualTo(String value) { + addCriterion("path =", value, "path"); return (Criteria) this; } - public Criteria andPathRouterNotEqualTo(String value) { - addCriterion("path_router <>", value, "pathRouter"); + public Criteria andPathNotEqualTo(String value) { + addCriterion("path <>", value, "path"); return (Criteria) this; } - public Criteria andPathRouterGreaterThan(String value) { - addCriterion("path_router >", value, "pathRouter"); + public Criteria andPathGreaterThan(String value) { + addCriterion("path >", value, "path"); return (Criteria) this; } - public Criteria andPathRouterGreaterThanOrEqualTo(String value) { - addCriterion("path_router >=", value, "pathRouter"); + public Criteria andPathGreaterThanOrEqualTo(String value) { + addCriterion("path >=", value, "path"); return (Criteria) this; } - public Criteria andPathRouterLessThan(String value) { - addCriterion("path_router <", value, "pathRouter"); + public Criteria andPathLessThan(String value) { + addCriterion("path <", value, "path"); return (Criteria) this; } - public Criteria andPathRouterLessThanOrEqualTo(String value) { - addCriterion("path_router <=", value, "pathRouter"); + public Criteria andPathLessThanOrEqualTo(String value) { + addCriterion("path <=", value, "path"); return (Criteria) this; } - public Criteria andPathRouterLike(String value) { - addCriterion("path_router like", value, "pathRouter"); + public Criteria andPathLike(String value) { + addCriterion("path like", value, "path"); return (Criteria) this; } - public Criteria andPathRouterNotLike(String value) { - addCriterion("path_router not like", value, "pathRouter"); + public Criteria andPathNotLike(String value) { + addCriterion("path not like", value, "path"); return (Criteria) this; } - public Criteria andPathRouterIn(List values) { - addCriterion("path_router in", values, "pathRouter"); + public Criteria andPathIn(List values) { + addCriterion("path in", values, "path"); return (Criteria) this; } - public Criteria andPathRouterNotIn(List values) { - addCriterion("path_router not in", values, "pathRouter"); + public Criteria andPathNotIn(List values) { + addCriterion("path not in", values, "path"); return (Criteria) this; } - public Criteria andPathRouterBetween(String value1, String value2) { - addCriterion("path_router between", value1, value2, "pathRouter"); + public Criteria andPathBetween(String value1, String value2) { + addCriterion("path between", value1, value2, "path"); return (Criteria) this; } - public Criteria andPathRouterNotBetween(String value1, String value2) { - addCriterion("path_router not between", value1, value2, "pathRouter"); + public Criteria andPathNotBetween(String value1, String value2) { + addCriterion("path not between", value1, value2, "path"); return (Criteria) this; } - public Criteria andPathApiIsNull() { - addCriterion("path_api is null"); + public Criteria andComponentIsNull() { + addCriterion("component is null"); return (Criteria) this; } - public Criteria andPathApiIsNotNull() { - addCriterion("path_api is not null"); + public Criteria andComponentIsNotNull() { + addCriterion("component is not null"); return (Criteria) this; } - public Criteria andPathApiEqualTo(String value) { - addCriterion("path_api =", value, "pathApi"); + public Criteria andComponentEqualTo(String value) { + addCriterion("component =", value, "component"); return (Criteria) this; } - public Criteria andPathApiNotEqualTo(String value) { - addCriterion("path_api <>", value, "pathApi"); + public Criteria andComponentNotEqualTo(String value) { + addCriterion("component <>", value, "component"); return (Criteria) this; } - public Criteria andPathApiGreaterThan(String value) { - addCriterion("path_api >", value, "pathApi"); + public Criteria andComponentGreaterThan(String value) { + addCriterion("component >", value, "component"); return (Criteria) this; } - public Criteria andPathApiGreaterThanOrEqualTo(String value) { - addCriterion("path_api >=", value, "pathApi"); + public Criteria andComponentGreaterThanOrEqualTo(String value) { + addCriterion("component >=", value, "component"); return (Criteria) this; } - public Criteria andPathApiLessThan(String value) { - addCriterion("path_api <", value, "pathApi"); + public Criteria andComponentLessThan(String value) { + addCriterion("component <", value, "component"); return (Criteria) this; } - public Criteria andPathApiLessThanOrEqualTo(String value) { - addCriterion("path_api <=", value, "pathApi"); + public Criteria andComponentLessThanOrEqualTo(String value) { + addCriterion("component <=", value, "component"); return (Criteria) this; } - public Criteria andPathApiLike(String value) { - addCriterion("path_api like", value, "pathApi"); + public Criteria andComponentLike(String value) { + addCriterion("component like", value, "component"); return (Criteria) this; } - public Criteria andPathApiNotLike(String value) { - addCriterion("path_api not like", value, "pathApi"); + public Criteria andComponentNotLike(String value) { + addCriterion("component not like", value, "component"); return (Criteria) this; } - public Criteria andPathApiIn(List values) { - addCriterion("path_api in", values, "pathApi"); + public Criteria andComponentIn(List values) { + addCriterion("component in", values, "component"); return (Criteria) this; } - public Criteria andPathApiNotIn(List values) { - addCriterion("path_api not in", values, "pathApi"); + public Criteria andComponentNotIn(List values) { + addCriterion("component not in", values, "component"); return (Criteria) this; } - public Criteria andPathApiBetween(String value1, String value2) { - addCriterion("path_api between", value1, value2, "pathApi"); + public Criteria andComponentBetween(String value1, String value2) { + addCriterion("component between", value1, value2, "component"); return (Criteria) this; } - public Criteria andPathApiNotBetween(String value1, String value2) { - addCriterion("path_api not between", value1, value2, "pathApi"); + public Criteria andComponentNotBetween(String value1, String value2) { + addCriterion("component not between", value1, value2, "component"); return (Criteria) this; } - public Criteria andComponentPathIsNull() { - addCriterion("component_path is null"); + public Criteria andApisIsNull() { + addCriterion("apis is null"); return (Criteria) this; } - public Criteria andComponentPathIsNotNull() { - addCriterion("component_path is not null"); + public Criteria andApisIsNotNull() { + addCriterion("apis is not null"); return (Criteria) this; } - public Criteria andComponentPathEqualTo(String value) { - addCriterion("component_path =", value, "componentPath"); + public Criteria andApisEqualTo(String value) { + addCriterion("apis =", value, "apis"); return (Criteria) this; } - public Criteria andComponentPathNotEqualTo(String value) { - addCriterion("component_path <>", value, "componentPath"); + public Criteria andApisNotEqualTo(String value) { + addCriterion("apis <>", value, "apis"); return (Criteria) this; } - public Criteria andComponentPathGreaterThan(String value) { - addCriterion("component_path >", value, "componentPath"); + public Criteria andApisGreaterThan(String value) { + addCriterion("apis >", value, "apis"); return (Criteria) this; } - public Criteria andComponentPathGreaterThanOrEqualTo(String value) { - addCriterion("component_path >=", value, "componentPath"); + public Criteria andApisGreaterThanOrEqualTo(String value) { + addCriterion("apis >=", value, "apis"); return (Criteria) this; } - public Criteria andComponentPathLessThan(String value) { - addCriterion("component_path <", value, "componentPath"); + public Criteria andApisLessThan(String value) { + addCriterion("apis <", value, "apis"); return (Criteria) this; } - public Criteria andComponentPathLessThanOrEqualTo(String value) { - addCriterion("component_path <=", value, "componentPath"); + public Criteria andApisLessThanOrEqualTo(String value) { + addCriterion("apis <=", value, "apis"); return (Criteria) this; } - public Criteria andComponentPathLike(String value) { - addCriterion("component_path like", value, "componentPath"); + public Criteria andApisLike(String value) { + addCriterion("apis like", value, "apis"); return (Criteria) this; } - public Criteria andComponentPathNotLike(String value) { - addCriterion("component_path not like", value, "componentPath"); + public Criteria andApisNotLike(String value) { + addCriterion("apis not like", value, "apis"); return (Criteria) this; } - public Criteria andComponentPathIn(List values) { - addCriterion("component_path in", values, "componentPath"); + public Criteria andApisIn(List values) { + addCriterion("apis in", values, "apis"); return (Criteria) this; } - public Criteria andComponentPathNotIn(List values) { - addCriterion("component_path not in", values, "componentPath"); + public Criteria andApisNotIn(List values) { + addCriterion("apis not in", values, "apis"); return (Criteria) this; } - public Criteria andComponentPathBetween(String value1, String value2) { - addCriterion("component_path between", value1, value2, "componentPath"); + public Criteria andApisBetween(String value1, String value2) { + addCriterion("apis between", value1, value2, "apis"); return (Criteria) this; } - public Criteria andComponentPathNotBetween(String value1, String value2) { - addCriterion("component_path not between", value1, value2, "componentPath"); + public Criteria andApisNotBetween(String value1, String value2) { + addCriterion("apis not between", value1, value2, "apis"); return (Criteria) this; } - public Criteria andComponentNameIsNull() { - addCriterion("component_name is null"); + public Criteria andPermissionIsNull() { + addCriterion("permission is null"); return (Criteria) this; } - public Criteria andComponentNameIsNotNull() { - addCriterion("component_name is not null"); + public Criteria andPermissionIsNotNull() { + addCriterion("permission is not null"); return (Criteria) this; } - public Criteria andComponentNameEqualTo(String value) { - addCriterion("component_name =", value, "componentName"); + public Criteria andPermissionEqualTo(String value) { + addCriterion("permission =", value, "permission"); return (Criteria) this; } - public Criteria andComponentNameNotEqualTo(String value) { - addCriterion("component_name <>", value, "componentName"); + public Criteria andPermissionNotEqualTo(String value) { + addCriterion("permission <>", value, "permission"); return (Criteria) this; } - public Criteria andComponentNameGreaterThan(String value) { - addCriterion("component_name >", value, "componentName"); + public Criteria andPermissionGreaterThan(String value) { + addCriterion("permission >", value, "permission"); return (Criteria) this; } - public Criteria andComponentNameGreaterThanOrEqualTo(String value) { - addCriterion("component_name >=", value, "componentName"); + public Criteria andPermissionGreaterThanOrEqualTo(String value) { + addCriterion("permission >=", value, "permission"); return (Criteria) this; } - public Criteria andComponentNameLessThan(String value) { - addCriterion("component_name <", value, "componentName"); + public Criteria andPermissionLessThan(String value) { + addCriterion("permission <", value, "permission"); return (Criteria) this; } - public Criteria andComponentNameLessThanOrEqualTo(String value) { - addCriterion("component_name <=", value, "componentName"); + public Criteria andPermissionLessThanOrEqualTo(String value) { + addCriterion("permission <=", value, "permission"); return (Criteria) this; } - public Criteria andComponentNameLike(String value) { - addCriterion("component_name like", value, "componentName"); + public Criteria andPermissionLike(String value) { + addCriterion("permission like", value, "permission"); return (Criteria) this; } - public Criteria andComponentNameNotLike(String value) { - addCriterion("component_name not like", value, "componentName"); + public Criteria andPermissionNotLike(String value) { + addCriterion("permission not like", value, "permission"); return (Criteria) this; } - public Criteria andComponentNameIn(List values) { - addCriterion("component_name in", values, "componentName"); + public Criteria andPermissionIn(List values) { + addCriterion("permission in", values, "permission"); return (Criteria) this; } - public Criteria andComponentNameNotIn(List values) { - addCriterion("component_name not in", values, "componentName"); + public Criteria andPermissionNotIn(List values) { + addCriterion("permission not in", values, "permission"); return (Criteria) this; } - public Criteria andComponentNameBetween(String value1, String value2) { - addCriterion("component_name between", value1, value2, "componentName"); + public Criteria andPermissionBetween(String value1, String value2) { + addCriterion("permission between", value1, value2, "permission"); return (Criteria) this; } - public Criteria andComponentNameNotBetween(String value1, String value2) { - addCriterion("component_name not between", value1, value2, "componentName"); + public Criteria andPermissionNotBetween(String value1, String value2) { + addCriterion("permission not between", value1, value2, "permission"); return (Criteria) this; } - public Criteria andPermissionIsNull() { - addCriterion("permission is null"); + public Criteria andRemarkIsNull() { + addCriterion("remark is null"); return (Criteria) this; } - public Criteria andPermissionIsNotNull() { - addCriterion("permission is not null"); + public Criteria andRemarkIsNotNull() { + addCriterion("remark is not null"); return (Criteria) this; } - public Criteria andPermissionEqualTo(String value) { - addCriterion("permission =", value, "permission"); + public Criteria andRemarkEqualTo(String value) { + addCriterion("remark =", value, "remark"); return (Criteria) this; } - public Criteria andPermissionNotEqualTo(String value) { - addCriterion("permission <>", value, "permission"); + public Criteria andRemarkNotEqualTo(String value) { + addCriterion("remark <>", value, "remark"); return (Criteria) this; } - public Criteria andPermissionGreaterThan(String value) { - addCriterion("permission >", value, "permission"); + public Criteria andRemarkGreaterThan(String value) { + addCriterion("remark >", value, "remark"); return (Criteria) this; } - public Criteria andPermissionGreaterThanOrEqualTo(String value) { - addCriterion("permission >=", value, "permission"); + public Criteria andRemarkGreaterThanOrEqualTo(String value) { + addCriterion("remark >=", value, "remark"); return (Criteria) this; } - public Criteria andPermissionLessThan(String value) { - addCriterion("permission <", value, "permission"); + public Criteria andRemarkLessThan(String value) { + addCriterion("remark <", value, "remark"); return (Criteria) this; } - public Criteria andPermissionLessThanOrEqualTo(String value) { - addCriterion("permission <=", value, "permission"); + public Criteria andRemarkLessThanOrEqualTo(String value) { + addCriterion("remark <=", value, "remark"); return (Criteria) this; } - public Criteria andPermissionLike(String value) { - addCriterion("permission like", value, "permission"); + public Criteria andRemarkLike(String value) { + addCriterion("remark like", value, "remark"); return (Criteria) this; } - public Criteria andPermissionNotLike(String value) { - addCriterion("permission not like", value, "permission"); + public Criteria andRemarkNotLike(String value) { + addCriterion("remark not like", value, "remark"); return (Criteria) this; } - public Criteria andPermissionIn(List values) { - addCriterion("permission in", values, "permission"); + public Criteria andRemarkIn(List values) { + addCriterion("remark in", values, "remark"); return (Criteria) this; } - public Criteria andPermissionNotIn(List values) { - addCriterion("permission not in", values, "permission"); + public Criteria andRemarkNotIn(List values) { + addCriterion("remark not in", values, "remark"); return (Criteria) this; } - public Criteria andPermissionBetween(String value1, String value2) { - addCriterion("permission between", value1, value2, "permission"); + public Criteria andRemarkBetween(String value1, String value2) { + addCriterion("remark between", value1, value2, "remark"); return (Criteria) this; } - public Criteria andPermissionNotBetween(String value1, String value2) { - addCriterion("permission not between", value1, value2, "permission"); + public Criteria andRemarkNotBetween(String value1, String value2) { + addCriterion("remark not between", value1, value2, "remark"); return (Criteria) this; } } diff --git a/roncoo-education-service/roncoo-education-service-system/src/main/java/com/roncoo/education/system/service/admin/biz/AdminLoginBiz.java b/roncoo-education-service/roncoo-education-service-system/src/main/java/com/roncoo/education/system/service/admin/biz/AdminLoginBiz.java index 9840b19c..cccb1bf1 100644 --- a/roncoo-education-service/roncoo-education-service-system/src/main/java/com/roncoo/education/system/service/admin/biz/AdminLoginBiz.java +++ b/roncoo-education-service/roncoo-education-service-system/src/main/java/com/roncoo/education/system/service/admin/biz/AdminLoginBiz.java @@ -5,6 +5,7 @@ import com.roncoo.education.common.cache.CacheRedis; import com.roncoo.education.common.core.base.Result; import com.roncoo.education.common.core.enums.StatusIdEnum; +import com.roncoo.education.common.core.tools.BeanUtil; import com.roncoo.education.common.core.tools.Constants; import com.roncoo.education.common.core.tools.JWTUtil; import com.roncoo.education.common.core.tools.SHA1Util; @@ -18,6 +19,7 @@ import com.roncoo.education.system.dao.impl.mapper.entity.SysUser; import com.roncoo.education.system.service.admin.req.AdminSysUserLoginReq; import com.roncoo.education.system.service.admin.resp.AdminSysUserLoginResp; +import com.roncoo.education.system.service.admin.resp.AdminSysUserLoginRouterResp; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Component; @@ -70,14 +72,20 @@ public Result login(AdminSysUserLoginReq req) { // token,放入缓存 cacheRedis.set(resp.getToken(), sysUser.getId(), 1, TimeUnit.DAYS); - // 获取菜单权限,放入缓存 - cacheRedis.set(Constants.RedisPre.ADMINI_MENU.concat(sysUser.getId().toString()), extracted(sysUser), 1, TimeUnit.DAYS); + // 列出菜单 + List sysMenus = listMenu(sysUser); + + // 路由权限返回 + resp.setRouterList(BeanUtil.copyProperties(sysMenus, AdminSysUserLoginRouterResp.class)); + + // 获取接口权限,放入缓存 + List apis = sysMenus.stream().map(SysMenu::getApis).collect(Collectors.toList()); + cacheRedis.set(Constants.RedisPre.ADMINI_APIS.concat(sysUser.getId().toString()), apis, 1, TimeUnit.DAYS); - // TODO 登录日志 return Result.success(resp); } - private List extracted(SysUser sysUser) { + private List listMenu(SysUser sysUser) { List roleUsers = sysRoleUserDao.listByUserId(sysUser.getId()); if (CollectionUtil.isEmpty(roleUsers)) { return new ArrayList<>(); @@ -90,7 +98,8 @@ private List extracted(SysUser sysUser) { if (CollectionUtil.isEmpty(sysMenus)) { return new ArrayList<>(); } - return sysMenus.stream().map(SysMenu::getPathApi).collect(Collectors.toList()); + return sysMenus; + //return sysMenus.stream().map(SysMenu::getApis).collect(Collectors.toList()); } } diff --git a/roncoo-education-service/roncoo-education-service-system/src/main/java/com/roncoo/education/system/service/admin/biz/AdminSysMenuBiz.java b/roncoo-education-service/roncoo-education-service-system/src/main/java/com/roncoo/education/system/service/admin/biz/AdminSysMenuBiz.java index 9f0b1cdb..c681e5e1 100644 --- a/roncoo-education-service/roncoo-education-service-system/src/main/java/com/roncoo/education/system/service/admin/biz/AdminSysMenuBiz.java +++ b/roncoo-education-service/roncoo-education-service-system/src/main/java/com/roncoo/education/system/service/admin/biz/AdminSysMenuBiz.java @@ -188,6 +188,6 @@ public Result> permissionList() { c.andMenuTypeEqualTo(MenuTypeEnum.PERMISSION.getCode()); example.setOrderByClause("sort asc, id desc"); List sysMenuList = dao.listByExample(example); - return Result.success(sysMenuList.stream().map(SysMenu::getPathApi).collect(Collectors.toList())); + return Result.success(sysMenuList.stream().map(SysMenu::getPermission).collect(Collectors.toList())); } } diff --git a/roncoo-education-service/roncoo-education-service-system/src/main/java/com/roncoo/education/system/service/admin/resp/AdminSysMenuResp.java b/roncoo-education-service/roncoo-education-service-system/src/main/java/com/roncoo/education/system/service/admin/resp/AdminSysMenuResp.java index 796cf35e..983c924c 100644 --- a/roncoo-education-service/roncoo-education-service-system/src/main/java/com/roncoo/education/system/service/admin/resp/AdminSysMenuResp.java +++ b/roncoo-education-service/roncoo-education-service-system/src/main/java/com/roncoo/education/system/service/admin/resp/AdminSysMenuResp.java @@ -43,46 +43,35 @@ public class AdminSysMenuResp implements Serializable { @JsonSerialize(using = ToStringSerializer.class) private Long parentId; /** - * 菜单名称 + * 是否显示(1: 显示;0:不显示) */ - @ApiModelProperty(value = "菜单名称") - private String menuName; - + @ApiModelProperty(value = "是否显示(1: 显示;0:隐藏)") + private Integer isShow; /** - * 菜单名称(Tree 树形控件规范) + * 菜单类型(1目录 2菜单 3按钮) */ - @ApiModelProperty(value = "菜单名称") - private String label; + @ApiModelProperty(value = "菜单类型(1目录 2菜单 3按钮)") + private Integer menuType; /** - * 菜单路径 + * 菜单名称 */ - @ApiModelProperty(value = "菜单路径") - private String menuUrl; + @ApiModelProperty(value = "菜单名称") + private String menuName; /** * 菜单图标 */ @ApiModelProperty(value = "菜单图标") private String menuIcon; /** - * 接口URL - */ - @ApiModelProperty(value = "接口URL") - private String authValue; - /** - * 备注 - */ - @ApiModelProperty(value = "备注") - private String remark; - /** - * 是否显示(1: 显示;0:不显示) + * 菜单路径 */ - @ApiModelProperty(value = "是否显示(1: 显示;0:不显示)") - private Integer hiddenType; + @ApiModelProperty(value = "菜单路径") + private String path; /** - * 菜单类型(1目录 2菜单 3按钮) + * 前端权限 */ - @ApiModelProperty(value = "菜单类型(1目录 2菜单 3按钮)") - private Integer menuType; + @ApiModelProperty(value = "前端权限") + private String permission; /** * 下级菜单集合 */ diff --git a/roncoo-education-service/roncoo-education-service-system/src/main/java/com/roncoo/education/system/service/admin/resp/AdminSysUserLoginResp.java b/roncoo-education-service/roncoo-education-service-system/src/main/java/com/roncoo/education/system/service/admin/resp/AdminSysUserLoginResp.java index d3ef4276..46169541 100644 --- a/roncoo-education-service/roncoo-education-service-system/src/main/java/com/roncoo/education/system/service/admin/resp/AdminSysUserLoginResp.java +++ b/roncoo-education-service/roncoo-education-service-system/src/main/java/com/roncoo/education/system/service/admin/resp/AdminSysUserLoginResp.java @@ -6,6 +6,7 @@ import lombok.experimental.Accessors; import java.io.Serializable; +import java.util.List; /** * @author fengyw @@ -23,6 +24,9 @@ public class AdminSysUserLoginResp implements Serializable { @ApiModelProperty(value = "昵称", required = true) private String realName; - @ApiModelProperty(value = "token,有效期为1天", required = true) + @ApiModelProperty(value = "token", required = true) private String token; + + @ApiModelProperty(value = "用户路由", required = true) + private List routerList; } diff --git a/roncoo-education-service/roncoo-education-service-system/src/main/java/com/roncoo/education/system/service/admin/resp/AdminSysUserLoginRouterResp.java b/roncoo-education-service/roncoo-education-service-system/src/main/java/com/roncoo/education/system/service/admin/resp/AdminSysUserLoginRouterResp.java new file mode 100644 index 00000000..3c311f02 --- /dev/null +++ b/roncoo-education-service/roncoo-education-service-system/src/main/java/com/roncoo/education/system/service/admin/resp/AdminSysUserLoginRouterResp.java @@ -0,0 +1,51 @@ +package com.roncoo.education.system.service.admin.resp; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.io.Serializable; + +/** + * @author fengyw + */ +@Data +@Accessors(chain = true) +@ApiModel(description = "用户路由") +public class AdminSysUserLoginRouterResp implements Serializable { + + /** + * 主键 + */ + @ApiModelProperty(value = "主键") + @JsonSerialize(using = ToStringSerializer.class) + private Long id; + /** + * 排序 + */ + @ApiModelProperty(value = "排序") + private Integer sort; + /** + * 菜单名称 + */ + @ApiModelProperty(value = "菜单名称") + private String menuName; + /** + * 菜单路径 + */ + @ApiModelProperty(value = "菜单路径") + private String path; + /** + * 组件路径 + */ + @ApiModelProperty(value = "组件路径") + private String component; + /** + * 前端权限 + */ + @ApiModelProperty(value = "前端权限") + private String permission; +} diff --git a/roncoo-education-service/roncoo-education-service-system/src/main/resources/mybatis/SysMenuMapper.xml b/roncoo-education-service/roncoo-education-service-system/src/main/resources/mybatis/SysMenuMapper.xml index 3d5eb722..d7c4dee4 100644 --- a/roncoo-education-service/roncoo-education-service-system/src/main/resources/mybatis/SysMenuMapper.xml +++ b/roncoo-education-service/roncoo-education-service-system/src/main/resources/mybatis/SysMenuMapper.xml @@ -8,14 +8,15 @@ + - - - - + + + + @@ -77,8 +78,8 @@ id - , gmt_create, gmt_modified, status_id, sort, parent_id, menu_type, menu_name, menu_icon, - path_router, path_api, component_path, component_name, permission + , gmt_create, gmt_modified, status_id, sort, parent_id, is_show, menu_type, menu_name, + menu_icon, path, component, apis, permission, remark @@ -244,6 +251,9 @@ parent_id = #{record.parentId,jdbcType=BIGINT}, + + is_show = #{record.isShow,jdbcType=BIT}, + menu_type = #{record.menuType,jdbcType=TINYINT}, @@ -253,21 +263,21 @@ menu_icon = #{record.menuIcon,jdbcType=VARCHAR}, - - path_router = #{record.pathRouter,jdbcType=VARCHAR}, - - - path_api = #{record.pathApi,jdbcType=VARCHAR}, + + path = #{record.path,jdbcType=VARCHAR}, - - component_path = #{record.componentPath,jdbcType=VARCHAR}, + + component = #{record.component,jdbcType=VARCHAR}, - - component_name = #{record.componentName,jdbcType=VARCHAR}, + + apis = #{record.apis,jdbcType=VARCHAR}, permission = #{record.permission,jdbcType=VARCHAR}, + + remark = #{record.remark,jdbcType=VARCHAR}, + @@ -281,14 +291,15 @@ status_id = #{record.statusId,jdbcType=TINYINT}, sort = #{record.sort,jdbcType=INTEGER}, parent_id = #{record.parentId,jdbcType=BIGINT}, + is_show = #{record.isShow,jdbcType=BIT}, menu_type = #{record.menuType,jdbcType=TINYINT}, menu_name = #{record.menuName,jdbcType=VARCHAR}, menu_icon = #{record.menuIcon,jdbcType=VARCHAR}, - path_router = #{record.pathRouter,jdbcType=VARCHAR}, - path_api = #{record.pathApi,jdbcType=VARCHAR}, - component_path = #{record.componentPath,jdbcType=VARCHAR}, - component_name = #{record.componentName,jdbcType=VARCHAR}, - permission = #{record.permission,jdbcType=VARCHAR} + path = #{record.path,jdbcType=VARCHAR}, + component = #{record.component,jdbcType=VARCHAR}, + apis = #{record.apis,jdbcType=VARCHAR}, + permission = #{record.permission,jdbcType=VARCHAR}, + remark = #{record.remark,jdbcType=VARCHAR} @@ -311,6 +322,9 @@ parent_id = #{parentId,jdbcType=BIGINT}, + + is_show = #{isShow,jdbcType=BIT}, + menu_type = #{menuType,jdbcType=TINYINT}, @@ -320,39 +334,40 @@ menu_icon = #{menuIcon,jdbcType=VARCHAR}, - - path_router = #{pathRouter,jdbcType=VARCHAR}, - - - path_api = #{pathApi,jdbcType=VARCHAR}, + + path = #{path,jdbcType=VARCHAR}, - - component_path = #{componentPath,jdbcType=VARCHAR}, + + component = #{component,jdbcType=VARCHAR}, - - component_name = #{componentName,jdbcType=VARCHAR}, + + apis = #{apis,jdbcType=VARCHAR}, permission = #{permission,jdbcType=VARCHAR}, + + remark = #{remark,jdbcType=VARCHAR}, + where id = #{id,jdbcType=BIGINT} update sys_menu - set gmt_create = #{gmtCreate,jdbcType=TIMESTAMP}, - gmt_modified = #{gmtModified,jdbcType=TIMESTAMP}, - status_id = #{statusId,jdbcType=TINYINT}, - sort = #{sort,jdbcType=INTEGER}, - parent_id = #{parentId,jdbcType=BIGINT}, - menu_type = #{menuType,jdbcType=TINYINT}, - menu_name = #{menuName,jdbcType=VARCHAR}, - menu_icon = #{menuIcon,jdbcType=VARCHAR}, - path_router = #{pathRouter,jdbcType=VARCHAR}, - path_api = #{pathApi,jdbcType=VARCHAR}, - component_path = #{componentPath,jdbcType=VARCHAR}, - component_name = #{componentName,jdbcType=VARCHAR}, - permission = #{permission,jdbcType=VARCHAR} + set gmt_create = #{gmtCreate,jdbcType=TIMESTAMP}, + gmt_modified = #{gmtModified,jdbcType=TIMESTAMP}, + status_id = #{statusId,jdbcType=TINYINT}, + sort = #{sort,jdbcType=INTEGER}, + parent_id = #{parentId,jdbcType=BIGINT}, + is_show = #{isShow,jdbcType=BIT}, + menu_type = #{menuType,jdbcType=TINYINT}, + menu_name = #{menuName,jdbcType=VARCHAR}, + menu_icon = #{menuIcon,jdbcType=VARCHAR}, + path = #{path,jdbcType=VARCHAR}, + component = #{component,jdbcType=VARCHAR}, + apis = #{apis,jdbcType=VARCHAR}, + permission = #{permission,jdbcType=VARCHAR}, + remark = #{remark,jdbcType=VARCHAR} where id = #{id,jdbcType=BIGINT}