Search in sources :

Example 1 with AuthPermission

use of com.github.liuweijw.core.beans.system.AuthPermission in project fw-cloud-framework by liuweijw.

the class ApiController method findMenuByRole.

/**
 * 通过用户名查询用户菜单
 */
@GetMapping("/findMenuByRole/{roleCode}")
public Set<AuthPermission> findMenuByRole(@PathVariable String roleCode) {
    Set<AuthPermission> permissions = new HashSet<AuthPermission>();
    Set<AuthMenu> menus = menuService.findMenuByRole(roleCode);
    if (null == menus || menus.size() == 0)
        return permissions;
    menus.stream().forEach(r -> {
        permissions.add(new AuthPermission(r.getUrl()));
    });
    return permissions;
}
Also used : AuthMenu(com.github.liuweijw.core.beans.system.AuthMenu) AuthPermission(com.github.liuweijw.core.beans.system.AuthPermission) HashSet(java.util.HashSet) GetMapping(org.springframework.web.bind.annotation.GetMapping)

Aggregations

AuthMenu (com.github.liuweijw.core.beans.system.AuthMenu)1 AuthPermission (com.github.liuweijw.core.beans.system.AuthPermission)1 HashSet (java.util.HashSet)1 GetMapping (org.springframework.web.bind.annotation.GetMapping)1