| | |
| | | package com.vincent.rsf.server.common.config; |
| | | |
| | | import com.alibaba.druid.pool.DruidDataSource; |
| | | import org.springframework.beans.factory.annotation.Qualifier; |
| | | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; |
| | | import org.springframework.boot.context.properties.ConfigurationProperties; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.jdbc.core.JdbcTemplate; |
| | | |
| | | import javax.sql.DataSource; |
| | | |
| | | /** |
| | | * cus_item_sync_view 专用副库连接 |
| | | * 鼎捷 专用副库连接 |
| | | */ |
| | | @Configuration |
| | | @ConditionalOnProperty(prefix = "spring.datasource.cus-item-sync", name = "url") |
| | | @ConditionalOnProperty(prefix = "spring.datasource.dj-cloud-wms", name = "url") |
| | | public class CusItemSyncDataSourceConfig { |
| | | |
| | | @Bean(name = "cusItemSyncDataSource") |
| | | @ConfigurationProperties(prefix = "spring.datasource.cus-item-sync") |
| | | @ConfigurationProperties(prefix = "spring.datasource.dj-cloud-wms") |
| | | public DataSource cusItemSyncDataSource() { |
| | | return new DruidDataSource(); |
| | | } |
| | | |
| | | @Bean(name = "cusItemSyncJdbcTemplate") |
| | | public JdbcTemplate cusItemSyncJdbcTemplate(@Qualifier("cusItemSyncDataSource") DataSource dataSource) { |
| | | return new JdbcTemplate(dataSource); |
| | | } |
| | | } |