first commit

This commit is contained in:
2023-06-13 23:12:09 +08:00
parent c407eace59
commit 5511fd8fb0
6 changed files with 203 additions and 186 deletions

View File

@ -64,6 +64,10 @@ public class DynamicDataSourceConfig {
initTenant();
}
public static DruidDataSource getPrimaryDataSource(String tenantId) {
return (DruidDataSource) PRIMARY_DATASOURCE_MAP.get(DynamicDatasourceConstant.MASTER_PREFIX + tenantId);
}
private void initDefault() {
List<DynamicDataSource> dataSources = dataSourceProperties.getDataSources();
// 0索引作为主数据源