update 优化 多租户插件初始化流程

This commit is contained in:
疯狂的狮子Li 2024-10-29 16:55:41 +08:00
parent 8cd30ae86b
commit 112157ade0

View File

@ -32,15 +32,20 @@ import org.springframework.context.annotation.Primary;
@ConditionalOnProperty(value = "tenant.enable", havingValue = "true")
public class TenantConfig {
@ConditionalOnClass(TenantLineInnerInterceptor.class)
@AutoConfiguration
static class MybatisPlusConfiguration {
/**
* 多租户插件
*/
@ConditionalOnClass(TenantLineInnerInterceptor.class)
@Bean
public TenantLineInnerInterceptor tenantLineInnerInterceptor(TenantProperties tenantProperties) {
return new TenantLineInnerInterceptor(new PlusTenantLineHandler(tenantProperties));
}
}
@Bean
public RedissonAutoConfigurationCustomizer tenantRedissonCustomizer(RedissonProperties redissonProperties) {
return config -> {