use of com.ibeiliao.deployment.admin.vo.account.RoleResRelation in project Corgi by kevinYin.
the class EditRoleController method listAllAppMenu.
/**
* 读取所有APP的菜单,及角色的菜单权限
* @param roleId 角色ID
* @return
*/
@MenuResource("读取角色菜单")
@RequestMapping("allAppMenus")
@ResponseBody
public Map<String, Object> listAllAppMenu(int roleId) {
Map<String, Object> map = new HashMap<>(4);
List<AppDefine> apps = appService.listAll();
List<MenuItem> appMenus = new ArrayList<>(apps.size());
for (AppDefine app : apps) {
appMenus.add(menuService.getMenuTree(app.getAppId()));
}
map.put("success", Boolean.TRUE);
map.put("appList", apps);
map.put("appMenus", appMenus);
if (roleId > 0) {
List<RoleMenuRelation> menuIds = roleService.listRoleMenus(roleId);
map.put("menuIds", menuIds);
Role role = roleService.getById(roleId);
map.put("role", role);
List<RoleResRelation> resList = roleService.listRoleResources(roleId);
map.put("resIds", resList);
}
return map;
}
Aggregations