|
|
@ -21,13 +21,13 @@ import java.util.Map;
|
|
|
|
public class DataSourceConfiguration {
|
|
|
|
public class DataSourceConfiguration {
|
|
|
|
|
|
|
|
|
|
|
|
@Bean(name = "masterDataSource")
|
|
|
|
@Bean(name = "masterDataSource")
|
|
|
|
@ConfigurationProperties(prefix = "app.datasource.master")
|
|
|
|
@ConfigurationProperties(prefix = "spring.datasource.master")
|
|
|
|
public DataSource masterDataSource() {
|
|
|
|
public DataSource masterDataSource() {
|
|
|
|
return DataSourceBuilder.create().type(HikariDataSource.class).build();
|
|
|
|
return DataSourceBuilder.create().type(HikariDataSource.class).build();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Bean(name = "slaveDataSource")
|
|
|
|
@Bean(name = "slaveDataSource")
|
|
|
|
@ConfigurationProperties(prefix = "app.datasource.slave")
|
|
|
|
@ConfigurationProperties(prefix = "spring.datasource.slave")
|
|
|
|
public DataSource slaveDataSource() {
|
|
|
|
public DataSource slaveDataSource() {
|
|
|
|
return DataSourceBuilder.create().type(HikariDataSource.class).build();
|
|
|
|
return DataSourceBuilder.create().type(HikariDataSource.class).build();
|
|
|
|
}
|
|
|
|
}
|
|
|
|