mirror of https://gitee.com/stylefeng/roses
Merge branch 'dev-7.6.0-update' of https://gitee.com/stylefeng/roses.git into dev-7.6.0-update
commit
a8440ea221
|
@ -83,13 +83,27 @@ public class MenuFactory {
|
|||
// 将菜单信息转化为响应类型
|
||||
List<MenuItemDetail> 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<MenuItemDetail> menuItemDetailList = new DefaultTreeBuildFactory<MenuItemDetail>().doTreeBuild(appMenuItems);
|
||||
appGroupDetail.setMenuList(menuItemDetailList);
|
||||
|
||||
// 将一级菜单展开
|
||||
List<Long> 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;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
||||
/**
|
||||
|
@ -40,6 +43,11 @@ public class AppGroupDetail {
|
|||
*/
|
||||
private List<MenuItemDetail> menuList;
|
||||
|
||||
/**
|
||||
* 展开的菜单id列表
|
||||
*/
|
||||
private List<Long> openMenuIdList;
|
||||
|
||||
public AppGroupDetail() {
|
||||
}
|
||||
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取所有角色列表
|
||||
* <p>
|
||||
* 一般用在用户分配角色,响应所有的角色列表
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2023/06/10 21:29
|
||||
*/
|
||||
@GetResource(name = "分页查询-角色列表", path = "/sysRole/list")
|
||||
public ResponseData<List<SysRole>> list(SysRoleRequest sysRoleRequest) {
|
||||
return new SuccessResponseData<>(sysRoleService.findList(sysRoleRequest));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue