|
|
@@ -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();
|
|
|
}
|