Skip to content

Commit

Permalink
* 代码整理
Browse files Browse the repository at this point in the history
  • Loading branch information
fjn committed Jan 14, 2021
1 parent 2077605 commit 3129b57
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public DynamicDataSourcesProperties namedDataSourcesProperties(Environment envir
@Bean(name = "dataSourcesFactoryBean")
public ListFactoryBean dataSourcesFactoryBean(
final CentralizedDataSourceFactory centralizedDataSourceFactory,
DynamicDataSourcesProperties namedDataSourcesProperties,
DynamicDataSourcesProperties dynamicDataSourcesProperties,
// 该参数只是为了兼容Spring Boot 默认的 DataSource配置而已
ObjectProvider<DataSource> springBootOriginDataSourceProvider,
ObjectProvider<org.springframework.boot.autoconfigure.jdbc.DataSourceProperties> builtInDataSourceProperties,
Expand All @@ -123,7 +123,7 @@ public ListFactoryBean dataSourcesFactoryBean(
}
}

List<DataSourceProperties> dataSourcePropertiesList = namedDataSourcesProperties.getDatasources();
List<DataSourceProperties> dataSourcePropertiesList = dynamicDataSourcesProperties.getDatasources();

// spring bean factory
final AbstractAutowireCapableBeanFactory beanFactory = ((AbstractAutowireCapableBeanFactory) applicationContext.getAutowireCapableBeanFactory());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
* @since 3.4.1
*/
public class SpringDataSourcePropertiesAdapter {

public static com.jn.sqlhelper.datasource.config.DataSourceProperties adapt(DataSourceProperties properties) {
com.jn.sqlhelper.datasource.config.DataSourceProperties dataSourceProperties = new com.jn.sqlhelper.datasource.config.DataSourceProperties();
dataSourceProperties.setUsername(properties.getUsername());
Expand Down

0 comments on commit 3129b57

Please sign in to comment.