refactor: 升级框架

This commit is contained in:
caiyuchao
2025-05-21 14:13:15 +08:00
parent b2a5bedb30
commit 27941674a7
1000 changed files with 1833 additions and 1800 deletions

View File

@@ -20,7 +20,7 @@ import org.agt.framework.tenant.core.web.TenantContextWebFilter;
import org.agt.framework.tenant.core.web.TenantVisitContextInterceptor;
import org.agt.framework.web.config.WebProperties;
import org.agt.framework.web.core.handler.GlobalExceptionHandler;
import org.agt.module.system.api.tenant.TenantApi;
import org.agt.framework.common.biz.system.tenant.TenantCommonApi;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.TenantLineInnerInterceptor;
import jakarta.annotation.Resource;
@@ -60,10 +60,10 @@ public class AgtTenantAutoConfiguration {
private ApplicationContext applicationContext;
@Bean
public TenantFrameworkService tenantFrameworkService(TenantApi tenantApi) {
public TenantFrameworkService tenantFrameworkService(TenantCommonApi tenantApi) {
// 参见 https://gitee.com/zhijiantianya/agt-cloud/issues/IC6YZF
try {
TenantApi tenantApiImpl = SpringUtil.getBean("tenantApiImpl", TenantApi.class);
TenantCommonApi tenantApiImpl = SpringUtil.getBean("tenantApiImpl", TenantCommonApi.class);
if (tenantApiImpl != null) {
tenantApi = tenantApiImpl;
}

View File

@@ -1,16 +1,15 @@
package org.agt.framework.tenant.config;
import org.agt.framework.tenant.core.rpc.TenantRequestInterceptor;
import org.agt.module.system.api.tenant.TenantApi;
import org.agt.framework.common.biz.system.tenant.TenantCommonApi;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@AutoConfiguration
@ConditionalOnProperty(prefix = "agt.tenant", value = "enable", matchIfMissing = true) // 允许使用 agt.tenant.enable=false 禁用多租户
@EnableFeignClients(clients = TenantApi.class) // 主要是引入相关的 API 服务
@EnableFeignClients(clients = TenantCommonApi.class) // 主要是引入相关的 API 服务
public class AgtTenantRpcAutoConfiguration {
@Bean

View File

@@ -1,8 +1,7 @@
package org.agt.framework.tenant.core.service;
import org.agt.framework.common.pojo.CommonResult;
import org.agt.framework.common.util.cache.CacheUtils;
import org.agt.module.system.api.tenant.TenantApi;
import org.agt.framework.common.biz.system.tenant.TenantCommonApi;
import com.google.common.cache.CacheLoader;
import com.google.common.cache.LoadingCache;
import lombok.RequiredArgsConstructor;
@@ -21,7 +20,7 @@ import static org.agt.framework.common.util.cache.CacheUtils.buildAsyncReloading
@RequiredArgsConstructor
public class TenantFrameworkServiceImpl implements TenantFrameworkService {
private final TenantApi tenantApi;
private final TenantCommonApi tenantApi;
/**
* 针对 {@link #getTenantIds()} 的缓存