提交 8fe0e95a 编写于 作者: zhouweidong's avatar zhouweidong

mp动态数据源

上级 9e41ab8c
<#ibiztemplate>
TARGET=PSSYSTEM
</#ibiztemplate>
<#assign bDynamicDS=false>
<#list sys.getAllPSDataEntities() as entity>
<#if (entity.getStorageMode()==1 || entity.getStorageMode()==2) && entity.getDSLink()!='DEFAULT'>
<#assign bDynamicDS=true>
<#break>
</#if>
</#list>
package ${pub.getPKGCodeName()}.util.domain;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
@Data
@Component
<#if bDynamicDS>
@ConfigurationProperties(prefix = "spring.datasource.dynamic.datasource.master")
<#else>
@ConfigurationProperties(prefix = "spring.datasource")
@Data
</#if>
public class LiquibaseProp{
private String url;
......
......@@ -282,7 +282,7 @@ server:
defaultSchema: ${dbUserName}
<#list sys.getAllPSDataEntities() as entity>
<#if (entity.getStorageMode()==1 || entity.getStorageMode()==2) && entity.getDSLink()!='DEFAULT'>
<#assign dbLink=entity.getDSLink()>
<#assign dbLink=entity.getDSLink()?lower_case>
<#if !P.exists('dynamicDatasource',dbLink)>
${dbLink}:
username: ${dbUserName}
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册