package com.ygtx.gxt.conf;

import com.alibaba.druid.pool.DruidDataSource;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.sql.DataSource;

/**
 * 源数据库数据源配置
 * 用于设备同步任务从其他数据库获取数据
 */
@Configuration
public class SourceDataSourceConfig {

    /**
     * 源数据库数据源
     * 
     * @return DataSource 数据源
     */
    @Bean(name = "sourceDataSource")
    @ConfigurationProperties(prefix = "spring.datasource.druid.source")
    public DataSource sourceDataSource() {
        return new DruidDataSource();
    }
}