Merge branch 'dev-7.6.0-update' of https://gitee.com/stylefeng/roses.git into dev-7.6.0-update

pull/57/head
Liyanjun 2023-07-03 21:17:00 +08:00
commit a8440ea221
4 changed files with 37 additions and 4 deletions

View File

@ -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;

View File

@ -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);
}

View File

@ -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() {
}

View File

@ -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));
}
}