package com.qiaoba.common.database.factories;

import com.qiaoba.common.database.config.DynamicDataSourceConfig;
import com.qiaoba.common.database.config.DynamicDataSourceContext;
import com.qiaoba.common.database.properties.DefaultDataSourceProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 动态数据源工厂
 *
 * @author ailanyin
 * @version 1.0
 * @since 2021/10/15 0015 下午 16:43
 */
@Configuration
public class DynamicDataSourceFactory {

    @Bean
    public DynamicDataSourceContext dataSource() {
        return new DynamicDataSourceContext();
    }

    @Bean
    public DynamicDataSourceConfig dynamicDataSourceConfig() {
        return new DynamicDataSourceConfig();
    }

    @Bean
    public DefaultDataSourceProperties defaultDataSourceProperties() {
        return new DefaultDataSourceProperties();
    }

}
