test_class.declarator: menuService
test_class.modifier: @Autowired
      private
test_class.original_string: @Autowired
      private MenuService menuService;
test_class.type: MenuService
test_class.var_name: menuService
test_class.declarator: userService
test_class.modifier: @Autowired
      private
test_class.original_string: @Autowired
      private UserService userService;
test_class.type: UserService
test_class.var_name: userService
test_class.file: frame-ucenter/src/test/java/com/blessedbin/frame/ucenter/service/MenuServiceTest.java
test_class.identifier: MenuServiceTest
test_class.superclass: extends FrameUcenterApplicationTests
test_case.body: @Test
      public void getUserMenu() {
  
          SysUser admin = userService.findByUsername("admin");
          String uuid = admin.getUuid();
  
          List<MenuTreeDto> menus = menuService.getUserMenu(uuid);
          System.out.println(menus);
  
      }
test_case.class_method_signature: MenuServiceTest.getUserMenu()
test_case.full_signature: @Test public void getUserMenu()
test_case.identifier: getUserMenu
test_case.invocations: findByUsername getUuid getUserMenu println
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void getUserMenu()
focal_class.declarator: permissionService
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private ISysPermissionService permissionService;
focal_class.type: ISysPermissionService
focal_class.var_name: permissionService
focal_class.declarator: roleService
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private ISysRoleService roleService;
focal_class.type: ISysRoleService
focal_class.var_name: roleService
focal_class.declarator: objectMapper
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private ObjectMapper objectMapper;
focal_class.type: ObjectMapper
focal_class.var_name: objectMapper
focal_class.file: frame-ucenter/src/main/java/com/blessedbin/frame/ucenter/service/MenuService.java
focal_class.identifier: MenuService
focal_class.class_method_signature: MenuService.allMenus()
focal_class.full_signature: private List<Menu> allMenus()
focal_class.identifier: allMenus
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: List<Menu>
focal_class.signature: List<Menu> allMenus()
focal_class.class_method_signature: MenuService.allMenuEnabled()
focal_class.full_signature: private List<Menu> allMenuEnabled()
focal_class.identifier: allMenuEnabled
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: List<Menu>
focal_class.signature: List<Menu> allMenuEnabled()
focal_class.class_method_signature: MenuService.toMenus(List<SysPermission> permissions)
focal_class.full_signature: private List<Menu> toMenus(List<SysPermission> permissions)
focal_class.identifier: toMenus
focal_class.modifiers: private
focal_class.parameters: (List<SysPermission> permissions)
focal_class.return: List<Menu>
focal_class.signature: List<Menu> toMenus(List<SysPermission> permissions)
focal_class.class_method_signature: MenuService.buildMenuTree(List<Menu> menus,Integer pid)
focal_class.full_signature: private List<MenuTreeDto> buildMenuTree(List<Menu> menus,Integer pid)
focal_class.identifier: buildMenuTree
focal_class.modifiers: private
focal_class.parameters: (List<Menu> menus,Integer pid)
focal_class.return: List<MenuTreeDto>
focal_class.signature: List<MenuTreeDto> buildMenuTree(List<Menu> menus,Integer pid)
focal_class.class_method_signature: MenuService.getMenuTree()
focal_class.full_signature: public List<MenuTreeDto> getMenuTree()
focal_class.identifier: getMenuTree
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: List<MenuTreeDto>
focal_class.signature: List<MenuTreeDto> getMenuTree()
focal_class.class_method_signature: MenuService.getMenuTreeEnabled()
focal_class.full_signature: public List<MenuTreeDto> getMenuTreeEnabled()
focal_class.identifier: getMenuTreeEnabled
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: List<MenuTreeDto>
focal_class.signature: List<MenuTreeDto> getMenuTreeEnabled()
focal_class.class_method_signature: MenuService.getUserMenu(String uuid)
focal_class.full_signature: public List<MenuTreeDto> getUserMenu(String uuid)
focal_class.identifier: getUserMenu
focal_class.modifiers: public
focal_class.parameters: (String uuid)
focal_class.return: List<MenuTreeDto>
focal_class.signature: List<MenuTreeDto> getUserMenu(String uuid)
focal_class.class_method_signature: MenuService.addMenu(Menu menu)
focal_class.full_signature: @Transactional(rollbackFor = Exception.class) public void addMenu(Menu menu)
focal_class.identifier: addMenu
focal_class.modifiers: @Transactional(rollbackFor = Exception.class) public
focal_class.parameters: (Menu menu)
focal_class.return: void
focal_class.signature: void addMenu(Menu menu)
focal_class.class_method_signature: MenuService.updateMenu(Menu menu)
focal_class.full_signature: @Transactional(rollbackFor = Exception.class) public void updateMenu(Menu menu)
focal_class.identifier: updateMenu
focal_class.modifiers: @Transactional(rollbackFor = Exception.class) public
focal_class.parameters: (Menu menu)
focal_class.return: void
focal_class.signature: void updateMenu(Menu menu)
focal_class.class_method_signature: MenuService.deleteById(Integer id)
focal_class.full_signature: @Transactional(rollbackFor = Exception.class) public boolean deleteById(Integer id)
focal_class.identifier: deleteById
focal_class.modifiers: @Transactional(rollbackFor = Exception.class) public
focal_class.parameters: (Integer id)
focal_class.return: boolean
focal_class.signature: boolean deleteById(Integer id)
focal_class.class_method_signature: MenuService.hasChildren(Integer menuId)
focal_class.full_signature: public boolean hasChildren(Integer menuId)
focal_class.identifier: hasChildren
focal_class.modifiers: public
focal_class.parameters: (Integer menuId)
focal_class.return: boolean
focal_class.signature: boolean hasChildren(Integer menuId)
focal_class.class_method_signature: MenuService.getMenu(Integer id)
focal_class.full_signature: public Menu getMenu(Integer id)
focal_class.identifier: getMenu
focal_class.modifiers: public
focal_class.parameters: (Integer id)
focal_class.return: Menu
focal_class.signature: Menu getMenu(Integer id)
focal_class.class_method_signature: MenuService.toMenu(SysPermission permission)
focal_class.full_signature: private Menu toMenu(SysPermission permission)
focal_class.identifier: toMenu
focal_class.modifiers: private
focal_class.parameters: (SysPermission permission)
focal_class.return: Menu
focal_class.signature: Menu toMenu(SysPermission permission)
focal_method.body: 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);
      }
focal_method.class_method_signature: MenuService.getUserMenu(String uuid)
focal_method.full_signature: public List<MenuTreeDto> getUserMenu(String uuid)
focal_method.identifier: getUserMenu
focal_method.invocations: notNull selectByUuid anyMatch stream equals getRoleKey getMenuTreeEnabled selectByUuidAndType collect map stream toList buildMenuTree
focal_method.modifiers: public
focal_method.parameters: (String uuid)
focal_method.return: List<MenuTreeDto>
focal_method.signature: List<MenuTreeDto> getUserMenu(String uuid)