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

动态数据源

上级 25ca4437
......@@ -354,6 +354,12 @@ seata:
<#macro dynamicDatasourceConfig>
datasource:
username: ${dbUserName}
password: '${dbPassWord}'
url: ${dbUrl}
driver-class-name: ${dbDriver}
isSyncDBSchema: false
defaultSchema: <#if dbUserName=='root'>${sys.name}<#else>${dbUserName}</#if>
dynamic:
druid: #以下是全局默认值,可以全局更改
filters: stat,wall,log4j2
......@@ -376,25 +382,25 @@ seata:
max-pool-prepared-statement-per-connection-size: 20
datasource:
master:
username: ${dbUserName}
password: '${dbPassWord}'
url: ${dbUrl}
driver-class-name: ${dbDriver}
username: ${r'${spring.datasource.username}'}
password: ${r'${spring.datasource.password}'}
url: ${r'${spring.datasource.url}'}
driver-class-name: ${r'${spring.datasource.driver-class-name}'}
conf: classpath:liquibase/master.xml
isSyncDBSchema: false
defaultSchema: <#if dbUserName=='root'>${sys.name}<#else>${dbUserName}</#if>
isSyncDBSchema: ${r'${spring.datasource.isSyncDBSchema}'}
defaultSchema: ${r'${spring.datasource.defaultSchema}'}
<#list sys.getAllPSDataEntities() as entity>
<#if (entity.getStorageMode()==1 || entity.getStorageMode()==2) && entity.getDSLink()!='DEFAULT'>
<#assign dbLink=entity.getDSLink()?lower_case>
<#if !P.exists('dynamicDatasource',dbLink)>
${dbLink}:
username: ${dbUserName}
password: '${dbPassWord}'
url: ${dbUrl}
driver-class-name: ${dbDriver}
username: ${r'${spring.datasource.username}'}
password: ${r'${spring.datasource.password}'}
url: ${r'${spring.datasource.url}'}
driver-class-name: ${r'${spring.datasource.driver-class-name}'}
conf: classpath:liquibase/master.xml
isSyncDBSchema: false
defaultSchema: <#if dbUserName=='root'>${sys.name}<#else>${dbUserName}</#if>
isSyncDBSchema: ${r'${spring.datasource.isSyncDBSchema}'}
defaultSchema: ${r'${spring.datasource.defaultSchema}'}
</#if>
</#if>
</#list>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册