From 2afd2bca1e6e42d45a5c6ecc643924405224c239 Mon Sep 17 00:00:00 2001 From: fengshuonan Date: Mon, 3 Jul 2023 14:00:10 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E3=80=907.6.0=E3=80=91=E3=80=90menu?= =?UTF-8?q?=E3=80=91=E5=BA=94=E7=94=A8=E8=8F=9C=E5=8D=95=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E5=BA=94=E7=94=A8=E5=9B=BE=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kernel/sys/modular/menu/pojo/response/AppGroupDetail.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kernel-s-sys/sys-business-permission/src/main/java/cn/stylefeng/roses/kernel/sys/modular/menu/pojo/response/AppGroupDetail.java b/kernel-s-sys/sys-business-permission/src/main/java/cn/stylefeng/roses/kernel/sys/modular/menu/pojo/response/AppGroupDetail.java index 24d0beb16..78eee49bf 100644 --- a/kernel-s-sys/sys-business-permission/src/main/java/cn/stylefeng/roses/kernel/sys/modular/menu/pojo/response/AppGroupDetail.java +++ b/kernel-s-sys/sys-business-permission/src/main/java/cn/stylefeng/roses/kernel/sys/modular/menu/pojo/response/AppGroupDetail.java @@ -1,5 +1,7 @@ package cn.stylefeng.roses.kernel.sys.modular.menu.pojo.response; +import cn.stylefeng.roses.kernel.file.api.format.FileUrlFormatProcess; +import cn.stylefeng.roses.kernel.rule.annotation.SimpleFieldFormat; import lombok.Data; import java.util.List; @@ -28,6 +30,7 @@ public class AppGroupDetail { /** * 应用图标的文件id */ + @SimpleFieldFormat(processClass = FileUrlFormatProcess.class) private Long appIcon; /** From d47a77b3545cc6888d60360dedcb3de92a981ff9 Mon Sep 17 00:00:00 2001 From: fengshuonan Date: Mon, 3 Jul 2023 15:06:11 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E3=80=907.6.0=E3=80=91=E3=80=90role?= =?UTF-8?q?=E3=80=91=E8=8E=B7=E5=8F=96=E8=A7=92=E8=89=B2=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modular/role/controller/SysRoleController.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/kernel-s-sys/sys-business-permission/src/main/java/cn/stylefeng/roses/kernel/sys/modular/role/controller/SysRoleController.java b/kernel-s-sys/sys-business-permission/src/main/java/cn/stylefeng/roses/kernel/sys/modular/role/controller/SysRoleController.java index 8568e3965..2e9f05182 100644 --- a/kernel-s-sys/sys-business-permission/src/main/java/cn/stylefeng/roses/kernel/sys/modular/role/controller/SysRoleController.java +++ b/kernel-s-sys/sys-business-permission/src/main/java/cn/stylefeng/roses/kernel/sys/modular/role/controller/SysRoleController.java @@ -14,6 +14,7 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; +import java.util.List; /** * 系统角色控制器 @@ -98,4 +99,17 @@ public class SysRoleController { return new SuccessResponseData<>(sysRoleService.findPage(sysRoleRequest)); } + /** + * 获取所有角色列表 + *

+ * 一般用在用户分配角色,响应所有的角色列表 + * + * @author fengshuonan + * @date 2023/06/10 21:29 + */ + @GetResource(name = "分页查询-角色列表", path = "/sysRole/list") + public ResponseData> list(SysRoleRequest sysRoleRequest) { + return new SuccessResponseData<>(sysRoleService.findList(sysRoleRequest)); + } + } From 495dfe2d273d8a76c5c360326aca67b65bbd7247 Mon Sep 17 00:00:00 2001 From: fengshuonan Date: Mon, 3 Jul 2023 15:19:23 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E3=80=907.6.0=E3=80=91=E3=80=90menu?= =?UTF-8?q?=E3=80=91=E5=A2=9E=E5=8A=A0=E5=B1=95=E5=BC=80=E7=9A=84=E8=8F=9C?= =?UTF-8?q?=E5=8D=95id=E9=9B=86=E5=90=88=E8=BF=94=E5=9B=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sys/modular/menu/factory/MenuFactory.java | 16 +++++++++++++++- .../menu/pojo/response/AppGroupDetail.java | 5 +++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/kernel-s-sys/sys-business-permission/src/main/java/cn/stylefeng/roses/kernel/sys/modular/menu/factory/MenuFactory.java b/kernel-s-sys/sys-business-permission/src/main/java/cn/stylefeng/roses/kernel/sys/modular/menu/factory/MenuFactory.java index a84c0cd19..4315c0d00 100644 --- a/kernel-s-sys/sys-business-permission/src/main/java/cn/stylefeng/roses/kernel/sys/modular/menu/factory/MenuFactory.java +++ b/kernel-s-sys/sys-business-permission/src/main/java/cn/stylefeng/roses/kernel/sys/modular/menu/factory/MenuFactory.java @@ -83,13 +83,27 @@ public class MenuFactory { // 将菜单信息转化为响应类型 List appMenuItems = new ArrayList<>(); for (SysMenu appMenu : appMenus) { - MenuItemDetail menuItemDetail = new MenuItemDetail(appMenu.getMenuId(), appMenu.getMenuParentId(), appMenu.getMenuName(), appMenu.getMenuType()); + MenuItemDetail menuItemDetail = new MenuItemDetail(appMenu.getMenuId(), appMenu.getMenuParentId(), appMenu.getMenuName(), + appMenu.getMenuType()); appMenuItems.add(menuItemDetail); } // 将应用下的菜单组装成树 List menuItemDetailList = new DefaultTreeBuildFactory().doTreeBuild(appMenuItems); appGroupDetail.setMenuList(menuItemDetailList); + + // 将一级菜单展开 + List openMenuIdList = new ArrayList<>(); + if (ObjectUtil.isEmpty(menuItemDetailList)) { + appGroupDetail.setOpenMenuIdList(openMenuIdList); + } else { + for (MenuItemDetail menuItemDetail : menuItemDetailList) { + if (ObjectUtil.isNotEmpty(menuItemDetail.getChildren())) { + openMenuIdList.add(menuItemDetail.getMenuId()); + } + } + appGroupDetail.setOpenMenuIdList(openMenuIdList); + } } return appGroupDetails; diff --git a/kernel-s-sys/sys-business-permission/src/main/java/cn/stylefeng/roses/kernel/sys/modular/menu/pojo/response/AppGroupDetail.java b/kernel-s-sys/sys-business-permission/src/main/java/cn/stylefeng/roses/kernel/sys/modular/menu/pojo/response/AppGroupDetail.java index 78eee49bf..42a06c29e 100644 --- a/kernel-s-sys/sys-business-permission/src/main/java/cn/stylefeng/roses/kernel/sys/modular/menu/pojo/response/AppGroupDetail.java +++ b/kernel-s-sys/sys-business-permission/src/main/java/cn/stylefeng/roses/kernel/sys/modular/menu/pojo/response/AppGroupDetail.java @@ -43,6 +43,11 @@ public class AppGroupDetail { */ private List menuList; + /** + * 展开的菜单id列表 + */ + private List openMenuIdList; + public AppGroupDetail() { } From 47dcf031a3356231dbf16ce1764fcf5c31c8b4c3 Mon Sep 17 00:00:00 2001 From: fengshuonan Date: Mon, 3 Jul 2023 16:42:07 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E3=80=907.6.0=E3=80=91=E3=80=90menu?= =?UTF-8?q?=E3=80=91=E5=90=8E=E5=8F=B0=E8=8F=9C=E5=8D=95=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E5=92=8C=E7=BC=96=E8=BE=91=E5=8F=96=E6=B6=88=E6=A0=A1=E9=AA=8C?= =?UTF-8?q?component=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kernel/sys/modular/menu/factory/MenuValidateFactory.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/kernel-s-sys/sys-business-permission/src/main/java/cn/stylefeng/roses/kernel/sys/modular/menu/factory/MenuValidateFactory.java b/kernel-s-sys/sys-business-permission/src/main/java/cn/stylefeng/roses/kernel/sys/modular/menu/factory/MenuValidateFactory.java index 5aadd44e9..5e318de29 100644 --- a/kernel-s-sys/sys-business-permission/src/main/java/cn/stylefeng/roses/kernel/sys/modular/menu/factory/MenuValidateFactory.java +++ b/kernel-s-sys/sys-business-permission/src/main/java/cn/stylefeng/roses/kernel/sys/modular/menu/factory/MenuValidateFactory.java @@ -55,9 +55,6 @@ public class MenuValidateFactory { if (ObjectUtil.isEmpty(sysMenuRequest.getAntdvRouter())) { throw new ServiceException(SysMenuExceptionEnum.URL_CANT_EMPTY); } - if (ObjectUtil.isEmpty(sysMenuRequest.getAntdvComponent())) { - throw new ServiceException(SysMenuExceptionEnum.COMPONENT_PATH_CANT_EMPTY); - } if (ObjectUtil.isEmpty(sysMenuRequest.getAntdvVisible())) { throw new ServiceException(SysMenuExceptionEnum.HIDDEN_FLAG_CANT_EMPTY); }