Quellcode durchsuchen

fix(字典):
修改字典存储方式

18339543638 vor 2 Jahren
Ursprung
Commit
cd4f5d7d12

+ 6 - 0
tr-plugins/tr-spring-boot-starter-plugin-biz-tenant/pom.xml

@@ -21,6 +21,12 @@
             <artifactId>tr-framework</artifactId>
         </dependency>
 
+        <dependency>
+            <groupId>cn.tr</groupId>
+            <artifactId>tr-spring-boot-starter-plugin-mybatis</artifactId>
+            <scope>provided</scope>
+        </dependency>
+
         <dependency>
             <groupId>org.projectlombok</groupId>
             <artifactId>lombok</artifactId>

+ 5 - 4
tr-plugins/tr-spring-boot-starter-plugin-biz-tenant/src/main/java/cn/tr/plugin/biz/tenant/TrTenantAutoConfiguration.java

@@ -8,6 +8,7 @@ import cn.tr.plugin.biz.tenant.config.db.TenantDatabaseInterceptor;
 import cn.tr.plugin.biz.tenant.config.ignore.TenantIgnoreUrlConfig;
 import cn.tr.plugin.biz.tenant.config.web.TenantContextWebFilter;
 import cn.tr.plugin.biz.tenant.properties.TenantProperties;
+import cn.tr.plugin.mybatis.config.handler.CreateAndUpdateMetaObjectHandler;
 import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
 import com.baomidou.mybatisplus.extension.plugins.inner.TenantLineInnerInterceptor;
 import org.springframework.beans.BeansException;
@@ -16,9 +17,7 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.boot.autoconfigure.web.ServerProperties;
 import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import org.springframework.boot.web.servlet.FilterRegistrationBean;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Lazy;
-import org.springframework.context.annotation.Primary;
+import org.springframework.context.annotation.*;
 import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping;
 
 import java.util.*;
@@ -31,6 +30,9 @@ import java.util.*;
  */
 @ConditionalOnProperty(prefix = "tr.tenant", value = "enable", matchIfMissing = true)
 @EnableConfigurationProperties(TenantProperties.class)
+@ComponentScan(excludeFilters = {
+        @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, classes = CreateAndUpdateMetaObjectHandler.class)
+})
 public class TrTenantAutoConfiguration implements BeanPostProcessor {
 
     @Override
@@ -65,7 +67,6 @@ public class TrTenantAutoConfiguration implements BeanPostProcessor {
     }
 
     @Bean
-    @Primary
     public MetaObjectHandler tenantCreateAndUpdateMetaObjectHandler(){
         return new TenantCreateAndUpdateMetaObjectHandler();
     }