class MenuService {

    public List<MenuTreeDto> getUserMenu(String uuid){
        Assert.notNull(uuid,"uuid is not null");

        // 判断是否是超级管理员
        List<SysRole> roles = roleService.selectByUuid(uuid);
        boolean isAdmin = roles.stream().anyMatch(role -> "ROLE_ADMIN".equals(role.getRoleKey()));
        if(isAdmin) {
            return getMenuTreeEnabled();
        }

        List<SysPermission> permissions = permissionService.selectByUuidAndType(uuid, TYPE_MENU);
        List<Menu> collect = permissions.stream().map(this::toMenu).collect(Collectors.toList());
        return buildMenuTree(collect,-1);
    }

}