Search in sources :

Example 1 with MenuTreeBean

use of com.github.liuweijw.business.admin.beans.MenuTreeBean in project fw-cloud-framework by liuweijw.

the class MenuController method menuTreeList.

// 获取所有菜单列表 以及功能权限
@GetMapping(value = "/menuTreeList/{roleCode}")
@PrePermissions(value = Functional.VIEW)
public R<MenuTreeBean> menuTreeList(@PathVariable("roleCode") String roleCode) {
    MenuTreeBean menuTreeBean = new MenuTreeBean();
    List<MenuTree> menuTree = menuService.findAllMenuTree();
    menuTreeBean.setMenuList(menuTree);
    Set<String> permissions = new HashSet<String>();
    permissions.addAll(permissionService.findMenuPermissions(roleCode));
    menuTreeBean.setPermissions(permissions.toArray(new String[permissions.size()]));
    return new R<MenuTreeBean>().data(menuTreeBean);
}
Also used : MenuTree(com.github.liuweijw.business.commons.tree.MenuTree) MenuTreeBean(com.github.liuweijw.business.admin.beans.MenuTreeBean) HashSet(java.util.HashSet) GetMapping(org.springframework.web.bind.annotation.GetMapping) PrePermissions(com.github.liuweijw.business.commons.web.aop.PrePermissions)

Example 2 with MenuTreeBean

use of com.github.liuweijw.business.admin.beans.MenuTreeBean in project fw-cloud-framework by liuweijw.

the class MenuController method menuTreeList.

// 获取所有菜单列表
@GetMapping(value = "/menuTreeAllList")
@PrePermissions(value = Functional.VIEW)
public R<MenuTreeBean> menuTreeList() {
    MenuTreeBean menuTreeBean = new MenuTreeBean();
    List<MenuTree> menuTree = menuService.findAllMenuTreeList();
    menuTreeBean.setMenuList(menuTree);
    return new R<MenuTreeBean>().data(menuTreeBean);
}
Also used : MenuTree(com.github.liuweijw.business.commons.tree.MenuTree) MenuTreeBean(com.github.liuweijw.business.admin.beans.MenuTreeBean) GetMapping(org.springframework.web.bind.annotation.GetMapping) PrePermissions(com.github.liuweijw.business.commons.web.aop.PrePermissions)

Aggregations

MenuTreeBean (com.github.liuweijw.business.admin.beans.MenuTreeBean)2 MenuTree (com.github.liuweijw.business.commons.tree.MenuTree)2 PrePermissions (com.github.liuweijw.business.commons.web.aop.PrePermissions)2 GetMapping (org.springframework.web.bind.annotation.GetMapping)2 HashSet (java.util.HashSet)1