
com.gitee.huanminabc.utils_tools.dynamic_datasource.bean.YmlDataSourceProvider Maven / Gradle / Ivy
package com.gitee.huanminabc.utils_tools.dynamic_datasource.bean;
import com.gitee.huanminabc.utils_tools.dynamic_datasource.base.DynamicDataSourceService;
import com.gitee.huanminabc.utils_tools.dynamic_datasource.entity.DataSourceEneity;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.codehaus.janino.IClass;
import org.springframework.boot.autoconfigure.jdbc.DataSourceProperties;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.jdbc.DataSourceBuilder;
import org.springframework.context.annotation.DependsOn;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import javax.sql.DataSource;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
* 文件读取yml里的数据源配置
*/
@Component
@Data
@DependsOn("springContextHolder") //当前bean初始化之前,优先加载指定的bean
@ConfigurationProperties(prefix = "spring.datasource")
@Slf4j
public class YmlDataSourceProvider {
private List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy