提交 11ae7e27 编写于 作者: Tyl666's avatar Tyl666

【Liquibase逆向工程】第三版 根据不同数据源生成不同实例数据源

上级 fae60288
...@@ -27,6 +27,7 @@ import org.apache.commons.io.IOUtils; ...@@ -27,6 +27,7 @@ import org.apache.commons.io.IOUtils;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.liquibase.LiquibaseDataSource; import org.springframework.boot.autoconfigure.liquibase.LiquibaseDataSource;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Lazy;
import org.springframework.util.DigestUtils; import org.springframework.util.DigestUtils;
import javax.annotation.Resource; import javax.annotation.Resource;
......
...@@ -2,15 +2,15 @@ package cn.ibizlab.core.util.config; ...@@ -2,15 +2,15 @@ package cn.ibizlab.core.util.config;
import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor; import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.*;
import org.springframework.context.annotation.Configuration;
import javax.sql.DataSource; import javax.sql.DataSource;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature; import com.fasterxml.jackson.databind.SerializationFeature;
import org.apache.ibatis.mapping.VendorDatabaseIdProvider; import org.apache.ibatis.mapping.VendorDatabaseIdProvider;
import org.apache.ibatis.mapping.DatabaseIdProvider; import org.apache.ibatis.mapping.DatabaseIdProvider;
import java.util.Properties; import java.util.Properties;
import org.springframework.context.annotation.Primary;
import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.jdbc.DataSourceBuilder; import org.springframework.boot.jdbc.DataSourceBuilder;
import cn.ibizlab.util.domain.LiquibaseProp; import cn.ibizlab.util.domain.LiquibaseProp;
...@@ -29,6 +29,8 @@ public class LiquibaseConfiguration { ...@@ -29,6 +29,8 @@ public class LiquibaseConfiguration {
* @return * @return
*/ */
@Bean @Bean
@Lazy
@Scope("prototype")
public SpringLiquibase masterliquibase(LiquibaseProp masterProperties) { public SpringLiquibase masterliquibase(LiquibaseProp masterProperties) {
return LiquibaseInit(masterProperties); return LiquibaseInit(masterProperties);
} }
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册