From 6cc24dc763c4da6d4105a79b9cf534f23f4af19b Mon Sep 17 00:00:00 2001 From: DoubleH <1402818247@qq.com> Date: 星期六, 06 七月 2024 13:58:26 +0800 Subject: [PATCH] !561 使用封装好的StreamUtils工具类代替项目中的部分stream操作 * refactor : 使用封装好的StreamUtils工具类代替项目中的部分stream操作 --- ruoyi-common/ruoyi-common-tenant/src/main/java/org/dromara/common/tenant/config/TenantConfig.java | 21 ++++++++++++++------- 1 files changed, 14 insertions(+), 7 deletions(-) diff --git a/ruoyi-common/ruoyi-common-tenant/src/main/java/org/dromara/common/tenant/config/TenantConfig.java b/ruoyi-common/ruoyi-common-tenant/src/main/java/org/dromara/common/tenant/config/TenantConfig.java index 0ff39fd..07302bc 100644 --- a/ruoyi-common/ruoyi-common-tenant/src/main/java/org/dromara/common/tenant/config/TenantConfig.java +++ b/ruoyi-common/ruoyi-common-tenant/src/main/java/org/dromara/common/tenant/config/TenantConfig.java @@ -16,6 +16,7 @@ import org.redisson.config.SingleServerConfig; import org.redisson.spring.starter.RedissonAutoConfigurationCustomizer; import org.springframework.boot.autoconfigure.AutoConfiguration; +import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.cache.CacheManager; @@ -28,16 +29,22 @@ * @author Lion Li */ @EnableConfigurationProperties(TenantProperties.class) -@AutoConfiguration(after = {RedisConfig.class, MybatisPlusConfig.class}) +@AutoConfiguration(after = {RedisConfig.class}) @ConditionalOnProperty(value = "tenant.enable", havingValue = "true") public class TenantConfig { - /** - * 澶氱鎴锋彃浠� - */ - @Bean - public TenantLineInnerInterceptor tenantLineInnerInterceptor(TenantProperties tenantProperties) { - return new TenantLineInnerInterceptor(new PlusTenantLineHandler(tenantProperties)); + @ConditionalOnBean(MybatisPlusConfig.class) + @AutoConfiguration(after = {MybatisPlusConfig.class}) + static class MybatisPlusConfiguration { + + /** + * 澶氱鎴锋彃浠� + */ + @Bean + public TenantLineInnerInterceptor tenantLineInnerInterceptor(TenantProperties tenantProperties) { + return new TenantLineInnerInterceptor(new PlusTenantLineHandler(tenantProperties)); + } + } @Bean -- Gitblit v1.9.3