fix(): 修复run()方法
parent
be2fc79d49
commit
d81b53910e
|
@ -91,29 +91,17 @@ public class ManyDataSource implements ApplicationRunner {
|
|||
*/
|
||||
@Bean
|
||||
public DynamicDataSource dynamicDataSource(DruidDataSourceFactory druidDataSourceFactory) {
|
||||
List<DataSourceInfo> sourceInfoList = dataSourceInfoList().stream()
|
||||
Map<Object, Object> dataSourceMap = dataSourceInfoList().stream()
|
||||
.map(entInfo -> DataSourceInfo.hostAndPortBuild(
|
||||
entInfo.getEntCode(),
|
||||
entInfo.getIp(),
|
||||
entInfo.getPort()
|
||||
)
|
||||
).toList();
|
||||
|
||||
Map<Object, Object> dataSourceMap = sourceInfoList.stream().collect(Collectors.toMap(
|
||||
)
|
||||
.collect(Collectors.toMap(
|
||||
dataSourceInfo -> dataSourceInfo.getKey(),
|
||||
dataSourceInfo -> druidDataSourceFactory.create(dataSourceInfo)
|
||||
));
|
||||
// Map<Object, Object> dataSourceMap = dataSourceInfoList().stream()
|
||||
// .map(entInfo -> DataSourceInfo.hostAndPortBuild(
|
||||
// entInfo.getEntCode(),
|
||||
// entInfo.getIp(),
|
||||
// entInfo.getPort()
|
||||
// )
|
||||
// )
|
||||
// .collect(Collectors.toMap(
|
||||
// dataSourceInfo -> dataSourceInfo.getKey(),
|
||||
// dataSourceInfo -> druidDataSourceFactory.create(dataSourceInfo)
|
||||
// ));
|
||||
|
||||
//设置动态数据源
|
||||
DynamicDataSource dynamicDataSource = new DynamicDataSource();
|
||||
|
|
Loading…
Reference in New Issue