test_class.declarator: baseAuthorityService
test_class.modifier: @Autowired
      private
test_class.original_string: @Autowired
      private BaseAuthorityService baseAuthorityService;
test_class.type: BaseAuthorityService
test_class.var_name: baseAuthorityService
test_class.file: platform/base-server/src/test/java/com/opencloud/base/server/service/impl/BaseAuthorityServiceImplTest.java
test_class.identifier: BaseAuthorityServiceImplTest
test_class.superclass: extends BaseTest
test_case.body: @Test
      public void clearInvalidApi() {
          String[] serviceIds = {
                  "serviceId",
                  "serviceId2"
          };
          for (String serviceId : serviceIds) {
              // 清空无效服务 权限 和 api接口数据
              baseAuthorityService.clearInvalidApi(serviceId, Collections.emptyList());
          }
      }
test_case.class_method_signature: BaseAuthorityServiceImplTest.clearInvalidApi()
test_case.full_signature: @Test public void clearInvalidApi()
test_case.identifier: clearInvalidApi
test_case.invocations: clearInvalidApi emptyList
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void clearInvalidApi()
focal_class.declarator: baseAuthorityMapper
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private BaseAuthorityMapper baseAuthorityMapper;
focal_class.type: BaseAuthorityMapper
focal_class.var_name: baseAuthorityMapper
focal_class.declarator: baseAuthorityRoleMapper
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private BaseAuthorityRoleMapper baseAuthorityRoleMapper;
focal_class.type: BaseAuthorityRoleMapper
focal_class.var_name: baseAuthorityRoleMapper
focal_class.declarator: baseAuthorityUserMapper
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private BaseAuthorityUserMapper baseAuthorityUserMapper;
focal_class.type: BaseAuthorityUserMapper
focal_class.var_name: baseAuthorityUserMapper
focal_class.declarator: baseAuthorityAppMapper
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private BaseAuthorityAppMapper baseAuthorityAppMapper;
focal_class.type: BaseAuthorityAppMapper
focal_class.var_name: baseAuthorityAppMapper
focal_class.declarator: baseAuthorityActionMapper
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private BaseAuthorityActionMapper baseAuthorityActionMapper;
focal_class.type: BaseAuthorityActionMapper
focal_class.var_name: baseAuthorityActionMapper
focal_class.declarator: baseMenuService
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private BaseMenuService baseMenuService;
focal_class.type: BaseMenuService
focal_class.var_name: baseMenuService
focal_class.declarator: baseActionService
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private BaseActionService baseActionService;
focal_class.type: BaseActionService
focal_class.var_name: baseActionService
focal_class.declarator: baseApiService
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private BaseApiService baseApiService;
focal_class.type: BaseApiService
focal_class.var_name: baseApiService
focal_class.declarator: baseRoleService
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private BaseRoleService baseRoleService;
focal_class.type: BaseRoleService
focal_class.var_name: baseRoleService
focal_class.declarator: baseUserService
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private BaseUserService baseUserService;
focal_class.type: BaseUserService
focal_class.var_name: baseUserService
focal_class.declarator: baseAppService
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private BaseAppService baseAppService;
focal_class.type: BaseAppService
focal_class.var_name: baseAppService
focal_class.declarator: redisTokenStore
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private RedisTokenStore redisTokenStore;
focal_class.type: RedisTokenStore
focal_class.var_name: redisTokenStore
focal_class.declarator: DEFAULT_SERVICE_ID
focal_class.modifier: @Value("${spring.application.name}")
      private
focal_class.original_string: @Value("${spring.application.name}")
      private String DEFAULT_SERVICE_ID;
focal_class.type: String
focal_class.var_name: DEFAULT_SERVICE_ID
focal_class.file: platform/base-server/src/main/java/com/opencloud/base/server/service/impl/BaseAuthorityServiceImpl.java
focal_class.identifier: BaseAuthorityServiceImpl
focal_class.interfaces: implements BaseAuthorityService
focal_class.class_method_signature: BaseAuthorityServiceImpl.findAuthorityResource()
focal_class.full_signature: @Override public List<AuthorityResource> findAuthorityResource()
focal_class.identifier: findAuthorityResource
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: List<AuthorityResource>
focal_class.signature: List<AuthorityResource> findAuthorityResource()
focal_class.class_method_signature: BaseAuthorityServiceImpl.findAuthorityMenu(Integer status, String serviceId)
focal_class.full_signature: @Override public List<AuthorityMenu> findAuthorityMenu(Integer status, String serviceId)
focal_class.identifier: findAuthorityMenu
focal_class.modifiers: @Override public
focal_class.parameters: (Integer status, String serviceId)
focal_class.return: List<AuthorityMenu>
focal_class.signature: List<AuthorityMenu> findAuthorityMenu(Integer status, String serviceId)
focal_class.class_method_signature: BaseAuthorityServiceImpl.findAuthorityApi(String serviceId)
focal_class.full_signature: @Override public List<AuthorityApi> findAuthorityApi(String serviceId)
focal_class.identifier: findAuthorityApi
focal_class.modifiers: @Override public
focal_class.parameters: (String serviceId)
focal_class.return: List<AuthorityApi>
focal_class.signature: List<AuthorityApi> findAuthorityApi(String serviceId)
focal_class.class_method_signature: BaseAuthorityServiceImpl.findAuthorityAction(Long actionId)
focal_class.full_signature: @Override public List<BaseAuthorityAction> findAuthorityAction(Long actionId)
focal_class.identifier: findAuthorityAction
focal_class.modifiers: @Override public
focal_class.parameters: (Long actionId)
focal_class.return: List<BaseAuthorityAction>
focal_class.signature: List<BaseAuthorityAction> findAuthorityAction(Long actionId)
focal_class.class_method_signature: BaseAuthorityServiceImpl.saveOrUpdateAuthority(Long resourceId, ResourceType resourceType)
focal_class.full_signature: @Override public BaseAuthority saveOrUpdateAuthority(Long resourceId, ResourceType resourceType)
focal_class.identifier: saveOrUpdateAuthority
focal_class.modifiers: @Override public
focal_class.parameters: (Long resourceId, ResourceType resourceType)
focal_class.return: BaseAuthority
focal_class.signature: BaseAuthority saveOrUpdateAuthority(Long resourceId, ResourceType resourceType)
focal_class.class_method_signature: BaseAuthorityServiceImpl.removeAuthority(Long resourceId, ResourceType resourceType)
focal_class.full_signature: @Override public void removeAuthority(Long resourceId, ResourceType resourceType)
focal_class.identifier: removeAuthority
focal_class.modifiers: @Override public
focal_class.parameters: (Long resourceId, ResourceType resourceType)
focal_class.return: void
focal_class.signature: void removeAuthority(Long resourceId, ResourceType resourceType)
focal_class.class_method_signature: BaseAuthorityServiceImpl.getAuthority(Long resourceId, ResourceType resourceType)
focal_class.full_signature: @Override public BaseAuthority getAuthority(Long resourceId, ResourceType resourceType)
focal_class.identifier: getAuthority
focal_class.modifiers: @Override public
focal_class.parameters: (Long resourceId, ResourceType resourceType)
focal_class.return: BaseAuthority
focal_class.signature: BaseAuthority getAuthority(Long resourceId, ResourceType resourceType)
focal_class.class_method_signature: BaseAuthorityServiceImpl.isGranted(Long resourceId, ResourceType resourceType)
focal_class.full_signature: @Override public Boolean isGranted(Long resourceId, ResourceType resourceType)
focal_class.identifier: isGranted
focal_class.modifiers: @Override public
focal_class.parameters: (Long resourceId, ResourceType resourceType)
focal_class.return: Boolean
focal_class.signature: Boolean isGranted(Long resourceId, ResourceType resourceType)
focal_class.class_method_signature: BaseAuthorityServiceImpl.buildQueryWrapper(Long resourceId, ResourceType resourceType)
focal_class.full_signature: private QueryWrapper<BaseAuthority> buildQueryWrapper(Long resourceId, ResourceType resourceType)
focal_class.identifier: buildQueryWrapper
focal_class.modifiers: private
focal_class.parameters: (Long resourceId, ResourceType resourceType)
focal_class.return: QueryWrapper<BaseAuthority>
focal_class.signature: QueryWrapper<BaseAuthority> buildQueryWrapper(Long resourceId, ResourceType resourceType)
focal_class.class_method_signature: BaseAuthorityServiceImpl.removeAuthorityApp(String appId)
focal_class.full_signature: @Override public void removeAuthorityApp(String appId)
focal_class.identifier: removeAuthorityApp
focal_class.modifiers: @Override public
focal_class.parameters: (String appId)
focal_class.return: void
focal_class.signature: void removeAuthorityApp(String appId)
focal_class.class_method_signature: BaseAuthorityServiceImpl.removeAuthorityAction(Long actionId)
focal_class.full_signature: @Override public void removeAuthorityAction(Long actionId)
focal_class.identifier: removeAuthorityAction
focal_class.modifiers: @Override public
focal_class.parameters: (Long actionId)
focal_class.return: void
focal_class.signature: void removeAuthorityAction(Long actionId)
focal_class.class_method_signature: BaseAuthorityServiceImpl.addAuthorityRole(Long roleId, Date expireTime, String... authorityIds)
focal_class.full_signature: @Override public void addAuthorityRole(Long roleId, Date expireTime, String... authorityIds)
focal_class.identifier: addAuthorityRole
focal_class.modifiers: @Override public
focal_class.parameters: (Long roleId, Date expireTime, String... authorityIds)
focal_class.return: void
focal_class.signature: void addAuthorityRole(Long roleId, Date expireTime, String... authorityIds)
focal_class.class_method_signature: BaseAuthorityServiceImpl.addAuthorityUser(Long userId, Date expireTime, String... authorityIds)
focal_class.full_signature: @Override public void addAuthorityUser(Long userId, Date expireTime, String... authorityIds)
focal_class.identifier: addAuthorityUser
focal_class.modifiers: @Override public
focal_class.parameters: (Long userId, Date expireTime, String... authorityIds)
focal_class.return: void
focal_class.signature: void addAuthorityUser(Long userId, Date expireTime, String... authorityIds)
focal_class.class_method_signature: BaseAuthorityServiceImpl.addAuthorityApp(String appId, Date expireTime, String... authorityIds)
focal_class.full_signature: @CacheEvict(value = {"apps"}, key = "'client:'+#appId") @Override public void addAuthorityApp(String appId, Date expireTime, String... authorityIds)
focal_class.identifier: addAuthorityApp
focal_class.modifiers: @CacheEvict(value = {"apps"}, key = "'client:'+#appId") @Override public
focal_class.parameters: (String appId, Date expireTime, String... authorityIds)
focal_class.return: void
focal_class.signature: void addAuthorityApp(String appId, Date expireTime, String... authorityIds)
focal_class.class_method_signature: BaseAuthorityServiceImpl.addAuthorityApp(String appId, Date expireTime, String authorityId)
focal_class.full_signature: @CacheEvict(value = {"apps"}, key = "'client:'+#appId") @Override public void addAuthorityApp(String appId, Date expireTime, String authorityId)
focal_class.identifier: addAuthorityApp
focal_class.modifiers: @CacheEvict(value = {"apps"}, key = "'client:'+#appId") @Override public
focal_class.parameters: (String appId, Date expireTime, String authorityId)
focal_class.return: void
focal_class.signature: void addAuthorityApp(String appId, Date expireTime, String authorityId)
focal_class.class_method_signature: BaseAuthorityServiceImpl.addAuthorityAction(Long actionId, String... authorityIds)
focal_class.full_signature: @Override public void addAuthorityAction(Long actionId, String... authorityIds)
focal_class.identifier: addAuthorityAction
focal_class.modifiers: @Override public
focal_class.parameters: (Long actionId, String... authorityIds)
focal_class.return: void
focal_class.signature: void addAuthorityAction(Long actionId, String... authorityIds)
focal_class.class_method_signature: BaseAuthorityServiceImpl.findAuthorityByApp(String appId)
focal_class.full_signature: @Override public List<OpenAuthority> findAuthorityByApp(String appId)
focal_class.identifier: findAuthorityByApp
focal_class.modifiers: @Override public
focal_class.parameters: (String appId)
focal_class.return: List<OpenAuthority>
focal_class.signature: List<OpenAuthority> findAuthorityByApp(String appId)
focal_class.class_method_signature: BaseAuthorityServiceImpl.findAuthorityByRole(Long roleId)
focal_class.full_signature: @Override public List<OpenAuthority> findAuthorityByRole(Long roleId)
focal_class.identifier: findAuthorityByRole
focal_class.modifiers: @Override public
focal_class.parameters: (Long roleId)
focal_class.return: List<OpenAuthority>
focal_class.signature: List<OpenAuthority> findAuthorityByRole(Long roleId)
focal_class.class_method_signature: BaseAuthorityServiceImpl.findAuthorityByType(String type)
focal_class.full_signature: @Override public List<OpenAuthority> findAuthorityByType(String type)
focal_class.identifier: findAuthorityByType
focal_class.modifiers: @Override public
focal_class.parameters: (String type)
focal_class.return: List<OpenAuthority>
focal_class.signature: List<OpenAuthority> findAuthorityByType(String type)
focal_class.class_method_signature: BaseAuthorityServiceImpl.findAuthorityByUser(Long userId, Boolean root)
focal_class.full_signature: @Override public List<OpenAuthority> findAuthorityByUser(Long userId, Boolean root)
focal_class.identifier: findAuthorityByUser
focal_class.modifiers: @Override public
focal_class.parameters: (Long userId, Boolean root)
focal_class.return: List<OpenAuthority>
focal_class.signature: List<OpenAuthority> findAuthorityByUser(Long userId, Boolean root)
focal_class.class_method_signature: BaseAuthorityServiceImpl.findAuthorityMenuByUser(Long userId, Boolean root)
focal_class.full_signature: @Override public List<AuthorityMenu> findAuthorityMenuByUser(Long userId, Boolean root)
focal_class.identifier: findAuthorityMenuByUser
focal_class.modifiers: @Override public
focal_class.parameters: (Long userId, Boolean root)
focal_class.return: List<AuthorityMenu>
focal_class.signature: List<AuthorityMenu> findAuthorityMenuByUser(Long userId, Boolean root)
focal_class.class_method_signature: BaseAuthorityServiceImpl.findAuthorityMenuByUser(Long userId, Boolean root, String serviceId)
focal_class.full_signature: @Override public List<AuthorityMenu> findAuthorityMenuByUser(Long userId, Boolean root, String serviceId)
focal_class.identifier: findAuthorityMenuByUser
focal_class.modifiers: @Override public
focal_class.parameters: (Long userId, Boolean root, String serviceId)
focal_class.return: List<AuthorityMenu>
focal_class.signature: List<AuthorityMenu> findAuthorityMenuByUser(Long userId, Boolean root, String serviceId)
focal_class.class_method_signature: BaseAuthorityServiceImpl.isGrantedByRoleIds(String authorityId, Long... roleIds)
focal_class.full_signature: @Override public Boolean isGrantedByRoleIds(String authorityId, Long... roleIds)
focal_class.identifier: isGrantedByRoleIds
focal_class.modifiers: @Override public
focal_class.parameters: (String authorityId, Long... roleIds)
focal_class.return: Boolean
focal_class.signature: Boolean isGrantedByRoleIds(String authorityId, Long... roleIds)
focal_class.class_method_signature: BaseAuthorityServiceImpl.clearInvalidApi(String serviceId, Collection<String> codes)
focal_class.full_signature: @Override public void clearInvalidApi(String serviceId, Collection<String> codes)
focal_class.identifier: clearInvalidApi
focal_class.modifiers: @Override public
focal_class.parameters: (String serviceId, Collection<String> codes)
focal_class.return: void
focal_class.signature: void clearInvalidApi(String serviceId, Collection<String> codes)
focal_class.superclass: extends BaseServiceImpl<BaseAuthorityMapper, BaseAuthority>
focal_method.body: @Override
      public void clearInvalidApi(String serviceId, Collection<String> codes) {
          if (StringUtils.isBlank(serviceId)) {
              return;
          }
          List<String> invalidApiIds = baseApiService.listObjs(new QueryWrapper<BaseApi>().select("api_id").eq("service_id", serviceId).notIn(codes != null && !codes.isEmpty(), "api_code", codes), e -> e.toString());
          if (invalidApiIds != null) {
              // 防止删除默认api
              invalidApiIds.remove("1");
              invalidApiIds.remove("2");
              // 获取无效的权限
              if (invalidApiIds.isEmpty()) {
                  return;
              }
              List<String> invalidAuthorityIds = listObjs(new QueryWrapper<BaseAuthority>().select("authority_id").in("api_id", invalidApiIds), e -> e.toString());
              if (invalidAuthorityIds != null && !invalidAuthorityIds.isEmpty()) {
                  // 移除关联数据
                  baseAuthorityAppMapper.delete(new QueryWrapper<BaseAuthorityApp>().in("authority_id", invalidAuthorityIds));
                  baseAuthorityActionMapper.delete(new QueryWrapper<BaseAuthorityAction>().in("authority_id", invalidAuthorityIds));
                  baseAuthorityRoleMapper.delete(new QueryWrapper<BaseAuthorityRole>().in("authority_id", invalidAuthorityIds));
                  baseAuthorityUserMapper.delete(new QueryWrapper<BaseAuthorityUser>().in("authority_id", invalidAuthorityIds));
                  // 移除权限数据
                  this.removeByIds(invalidAuthorityIds);
                  // 移除接口资源
                  baseApiService.removeByIds(invalidApiIds);
              }
          }
      }
focal_method.class_method_signature: BaseAuthorityServiceImpl.clearInvalidApi(String serviceId, Collection<String> codes)
focal_method.full_signature: @Override public void clearInvalidApi(String serviceId, Collection<String> codes)
focal_method.identifier: clearInvalidApi
focal_method.invocations: isBlank listObjs notIn eq select isEmpty toString remove remove isEmpty listObjs in select toString isEmpty delete in delete in delete in delete in removeByIds removeByIds
focal_method.modifiers: @Override public
focal_method.parameters: (String serviceId, Collection<String> codes)
focal_method.return: void
focal_method.signature: void clearInvalidApi(String serviceId, Collection<String> codes)