|
|
@@ -4,7 +4,7 @@ import cn.hutool.extra.spring.SpringUtil;
|
|
|
import com.xindazhou.framework.common.biz.system.tenant.TenantCommonApi;
|
|
|
import com.xindazhou.framework.common.enums.WebFilterOrderEnum;
|
|
|
import com.xindazhou.framework.mybatis.core.util.MyBatisUtils;
|
|
|
-import com.xindazhou.framework.redis.config.YudaoCacheProperties;
|
|
|
+import com.xindazhou.framework.redis.config.XdzCacheProperties;
|
|
|
import com.xindazhou.framework.security.core.service.SecurityFrameworkService;
|
|
|
import com.xindazhou.framework.tenant.core.aop.TenantIgnore;
|
|
|
import com.xindazhou.framework.tenant.core.aop.TenantIgnoreAspect;
|
|
|
@@ -56,14 +56,14 @@ import static com.xindazhou.framework.common.util.collection.CollectionUtils.con
|
|
|
@AutoConfiguration
|
|
|
@ConditionalOnProperty(prefix = "xdz.tenant", value = "enable", matchIfMissing = true) // 允许使用 xdz.tenant.enable=false 禁用多租户
|
|
|
@EnableConfigurationProperties(TenantProperties.class)
|
|
|
-public class YudaoTenantAutoConfiguration {
|
|
|
+public class XdzTenantAutoConfiguration {
|
|
|
|
|
|
@Resource
|
|
|
private ApplicationContext applicationContext;
|
|
|
|
|
|
@Bean
|
|
|
public TenantFrameworkService tenantFrameworkService(TenantCommonApi tenantApi) {
|
|
|
- // 参见 https://gitee.com/zhijiantianya/yudao-cloud/issues/IC6YZF
|
|
|
+ // 特殊处理:获取实际的 TenantCommonApi 实现
|
|
|
try {
|
|
|
TenantCommonApi tenantApiImpl = SpringUtil.getBean("tenantApiImpl", TenantCommonApi.class);
|
|
|
if (tenantApiImpl != null) {
|
|
|
@@ -209,12 +209,12 @@ public class YudaoTenantAutoConfiguration {
|
|
|
@Primary // 引入租户时,tenantRedisCacheManager 为主 Bean
|
|
|
public RedisCacheManager tenantRedisCacheManager(RedisTemplate<String, Object> redisTemplate,
|
|
|
RedisCacheConfiguration redisCacheConfiguration,
|
|
|
- YudaoCacheProperties yudaoCacheProperties,
|
|
|
+ XdzCacheProperties xdzCacheProperties,
|
|
|
TenantProperties tenantProperties) {
|
|
|
// 创建 RedisCacheWriter 对象
|
|
|
RedisConnectionFactory connectionFactory = Objects.requireNonNull(redisTemplate.getConnectionFactory());
|
|
|
RedisCacheWriter cacheWriter = RedisCacheWriter.nonLockingRedisCacheWriter(connectionFactory,
|
|
|
- BatchStrategies.scan(yudaoCacheProperties.getRedisScanBatchSize()));
|
|
|
+ BatchStrategies.scan(xdzCacheProperties.getRedisScanBatchSize()));
|
|
|
// 创建 TenantRedisCacheManager 对象
|
|
|
return new TenantRedisCacheManager(cacheWriter, redisCacheConfiguration, tenantProperties.getIgnoreCaches());
|
|
|
}
|