ds
潘志宝
2024-08-22 ac01adfffedee777788f7d3c8d5f22bcba65bbbe
ds
已修改2个文件
21 ■■■■ 文件已修改
iailab-framework/iailab-common-biz-tenant/src/main/java/com/iailab/framework/tenant/config/IailabTenantAutoConfiguration.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-framework/iailab-common-biz-tenant/src/main/java/com/iailab/framework/tenant/core/service/TenantFrameworkServiceImpl.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-framework/iailab-common-biz-tenant/src/main/java/com/iailab/framework/tenant/config/IailabTenantAutoConfiguration.java
@@ -1,10 +1,13 @@
package com.iailab.framework.tenant.config;
import com.baomidou.dynamic.datasource.processor.DsProcessor;
import com.baomidou.dynamic.datasource.processor.DsSpelExpressionProcessor;
import com.iailab.framework.common.enums.WebFilterOrderEnum;
import com.iailab.framework.mybatis.core.util.MyBatisUtils;
import com.iailab.framework.redis.config.IailabCacheProperties;
import com.iailab.framework.tenant.core.aop.TenantIgnoreAspect;
import com.iailab.framework.tenant.core.db.TenantDatabaseInterceptor;
import com.iailab.framework.tenant.core.db.dynamic.TenantDsProcessor;
import com.iailab.framework.tenant.core.job.TenantJobAspect;
import com.iailab.framework.tenant.core.mq.rabbitmq.TenantRabbitMQInitializer;
import com.iailab.framework.tenant.core.mq.redis.TenantRedisMessageInterceptor;
@@ -65,6 +68,18 @@
        return inner;
    }
    @Bean
    public DsProcessor dsProcessor(
//            TenantFrameworkService tenantFrameworkService,
//                                   DataSource dataSource,
//                                   DefaultDataSourceCreator dataSourceCreator
    ) {
//        TenantDsProcessor tenantDsProcessor = new TenantDsProcessor(tenantFrameworkService, dataSourceCreator);
        TenantDsProcessor tenantDsProcessor = new TenantDsProcessor();
        tenantDsProcessor.setNextProcessor(new DsSpelExpressionProcessor());
        return tenantDsProcessor;
    }
    // ========== WEB ==========
    @Bean
iailab-framework/iailab-common-biz-tenant/src/main/java/com/iailab/framework/tenant/core/service/TenantFrameworkServiceImpl.java
@@ -69,9 +69,9 @@
                        return null;
                    }
                    // 转换成 dynamic-datasource 配置
                    /*return new DataSourceProperty()
                            .setPoolName(dataSourceConfig.getName()).setUrl(dataSourceConfig.getUrl())
                            .setUsername(dataSourceConfig.getUsername()).setPassword(dataSourceConfig.getPassword());*/
//                    return new DataSourceProperty()
//                            .setPoolName(dataSourceConfig.getName()).setUrl(dataSourceConfig.getUrl())
//                            .setUsername(dataSourceConfig.getUsername()).setPassword(dataSourceConfig.getPassword());
                    DataSourceProperty ds = new DataSourceProperty();
                    ds.setPoolName(dataSourceConfig.getName());