@Test public void getUserPermissions() { Long id = mockData(); List<Map<String, List<Map<String, String>>>> structuringPermissions = userService.getStructualUserPermissions(id); assertTrue(structuringPermissions.size() > 0); log.info("structuringPermissions: {}", structuringPermissions); boolean anyMatch = structuringPermissions.stream().anyMatch(it -> it.containsKey("炉石传说")); assertTrue(anyMatch); }
@Override public List<PermissionDO> getUserPermissions(Long userId) { List<Long> groupIds = groupService.getUserGroupIdsByUserId(userId); if (groupIds == null || groupIds.size() == 0) { return new ArrayList<>(); } return permissionService.getPermissionByGroupIds(groupIds); }
UserServiceImpl extends ServiceImpl<UserMapper, UserDO> implements UserService { @Override public List<PermissionDO> getUserPermissions(Long userId) { List<Long> groupIds = groupService.getUserGroupIdsByUserId(userId); if (groupIds == null || groupIds.size() == 0) { return new ArrayList<>(); } return permissionService.getPermissionByGroupIds(groupIds); } }
UserServiceImpl extends ServiceImpl<UserMapper, UserDO> implements UserService { @Override public List<PermissionDO> getUserPermissions(Long userId) { List<Long> groupIds = groupService.getUserGroupIdsByUserId(userId); if (groupIds == null || groupIds.size() == 0) { return new ArrayList<>(); } return permissionService.getPermissionByGroupIds(groupIds); }  }
UserServiceImpl extends ServiceImpl<UserMapper, UserDO> implements UserService { @Override public List<PermissionDO> getUserPermissions(Long userId) { List<Long> groupIds = groupService.getUserGroupIdsByUserId(userId); if (groupIds == null || groupIds.size() == 0) { return new ArrayList<>(); } return permissionService.getPermissionByGroupIds(groupIds); }  @Transactional @Override UserDO createUser(RegisterDTO dto); @Transactional @Override UserDO updateUserInfo(UpdateInfoDTO dto); @Override UserDO changeUserPassword(ChangePasswordDTO dto); @Override List<GroupDO> getUserGroups(Long userId); @Override List<Map<String, List<Map<String, String>>>> getStructualUserPermissions(Long userId); @Override List<PermissionDO> getUserPermissions(Long userId); @Override UserDO getUserByUsername(String username); @Override boolean checkUserExistByUsername(String username); @Override boolean checkUserExistByEmail(String email); @Override boolean checkUserExistById(Long id); @Override IPage<UserDO> getUserPageByGroupId(Page pager, Long groupId); }
UserServiceImpl extends ServiceImpl<UserMapper, UserDO> implements UserService { @Override public List<PermissionDO> getUserPermissions(Long userId) { List<Long> groupIds = groupService.getUserGroupIdsByUserId(userId); if (groupIds == null || groupIds.size() == 0) { return new ArrayList<>(); } return permissionService.getPermissionByGroupIds(groupIds); }  @Transactional @Override UserDO createUser(RegisterDTO dto); @Transactional @Override UserDO updateUserInfo(UpdateInfoDTO dto); @Override UserDO changeUserPassword(ChangePasswordDTO dto); @Override List<GroupDO> getUserGroups(Long userId); @Override List<Map<String, List<Map<String, String>>>> getStructualUserPermissions(Long userId); @Override List<PermissionDO> getUserPermissions(Long userId); @Override UserDO getUserByUsername(String username); @Override boolean checkUserExistByUsername(String username); @Override boolean checkUserExistByEmail(String email); @Override boolean checkUserExistById(Long id); @Override IPage<UserDO> getUserPageByGroupId(Page pager, Long groupId);  }