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

支持nacos.eureka注册中心切换

上级 8fe0e95a
......@@ -3,6 +3,6 @@ TARGET=PSSYSAPP
</#ibiztemplate>
spring:
profiles:
include: sys , ${app.getPKGCodeName()?lower_case}-prod
include: sys ,nacos, ${app.getPKGCodeName()?lower_case}-prod
application:
name: ${sys.getCodeName()?lower_case}-${app.getPKGCodeName()?lower_case}
......@@ -19,7 +19,7 @@ TARGET=PSSYSTEM
</#if>
spring:
profiles:
include: sys , <#if refAppYaml!=''>${refAppYaml}</#if> <#if refProviderYaml!=''> ${refProviderYaml} </#if> dev
include: sys ,nacos, <#if refAppYaml!=''>${refAppYaml}</#if> <#if refProviderYaml!=''> ${refProviderYaml} </#if> dev
application:
name: ${item.getCodeName()?lower_case}
main:
......
......@@ -88,6 +88,9 @@ TARGET=PSSYSTEM
<!--baomidou-jobs定时服务 -->
<baomidou-jobs.version>1.0.3</baomidou-jobs.version>
<!-- eureka微服务注册中心 -->
<eureka-client.version>2.2.1.RELEASE</eureka-client.version>
<#if sys.getAllPSSystemDBConfigs()??>
<#list sys.getAllPSSystemDBConfigs() as dbConfig>
<#if dbConfig.getDBType()=='MYSQL5'>
......@@ -344,6 +347,13 @@ TARGET=PSSYSTEM
<artifactId>h2</artifactId>
</dependency>
<!-- eureka服务注册中心 -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
<version>${r'${eureka-client.version}'}</version>
</dependency>
<#if sys.getAllPSSystemDBConfigs()??>
<#list sys.getAllPSSystemDBConfigs() as dbConfig>
<#if dbConfig.getDBType()=='MYSQL5'>
......
......@@ -3,6 +3,6 @@ TARGET=PSSYSSERVICEAPI
</#ibiztemplate>
spring:
profiles:
include: sys , ${item.codeName?lower_case}-prod
include: sys ,nacos, ${item.codeName?lower_case}-prod
application:
name: ${sys.getCodeName()?lower_case}-${item.getCodeName()?lower_case}
\ No newline at end of file
<#ibiztemplate>
TARGET=PSSYSTEM
</#ibiztemplate>
<#assign eurekaUrl = "http://127.0.0.1:40002/eureka/" >
<#comment>前端应用微服务平台配置</#comment>
<#if sys.getAllPSDevSlnMSDepApps()??>
<#list sys.getAllPSDevSlnMSDepApps() as depApp>
<#if depApp.getPSDCMSPlatform()??>
<#assign appPlatform=depApp.getPSDCMSPlatform()>
<#if appPlatform.getUserParam("eureka","http://127.0.0.1:40002/eureka/")??>
<#assign eurekaUrl = appPlatform.getUserParam("eureka","http://127.0.0.1:40002/eureka/")>
</#if>
<#break>
</#if>
</#list>
</#if>
<#comment>服务接口微服务平台配置</#comment>
<#if sys.getAllPSDevSlnMSDepAPIs()??>
<#list sys.getAllPSDevSlnMSDepAPIs() as depSysApi>
<#if depSysApi.getPSDCMSPlatform()?? >
<#assign sysApiPlatform=depSysApi.getPSDCMSPlatform()>
<#if sysApiPlatform.getUserParam("eureka","http://127.0.0.1:40002/eureka/")??>
<#assign eurekaUrl = sysApiPlatform.getUserParam("eureka","http://127.0.0.1:40002/eureka/")>
</#if>
<#break>
</#if>
</#list>
</#if>
#eureka配置中心
spring:
cloud:
nacos:
discovery:
enabled: false
eureka:
client:
enabled: true
serviceUrl:
defaultZone: ${eurekaUrl}
<#ibiztemplate>
TARGET=PSSYSTEM
</#ibiztemplate>
<#assign nacosUrl = "127.0.0.1:8848" >
<#comment>前端应用微服务平台配置</#comment>
<#if sys.getAllPSDevSlnMSDepApps()??>
<#list sys.getAllPSDevSlnMSDepApps() as depApp>
<#if depApp.getPSDCMSPlatform()??>
<#assign appPlatform=depApp.getPSDCMSPlatform()>
<#if appPlatform.getUserParam("nacos","127.0.0.1:8848")??>
<#assign nacosUrl = appPlatform.getUserParam("nacos","127.0.0.1:8848")>
</#if>
<#break>
</#if>
</#list>
</#if>
<#comment>服务接口微服务平台配置</#comment>
<#if sys.getAllPSDevSlnMSDepAPIs()??>
<#list sys.getAllPSDevSlnMSDepAPIs() as depSysApi>
<#if depSysApi.getPSDCMSPlatform()?? >
<#assign sysApiPlatform=depSysApi.getPSDCMSPlatform()>
<#if sysApiPlatform.getUserParam("nacos","127.0.0.1:8848")??>
<#assign nacosUrl = sysApiPlatform.getUserParam("nacos","127.0.0.1:8848")>
</#if>
<#break>
</#if>
</#list>
</#if>
#nacos配置中心
spring:
cloud:
nacos:
discovery:
server-addr: ${nacosUrl}
enabled: true
eureka:
client:
enabled: false
......@@ -2,7 +2,6 @@
TARGET=PSSYSTEM
</#ibiztemplate>
<#comment>通用配置文件</#comment>
<#assign nacosUrl = "127.0.0.1:8848" >
<#assign redisHost = "127.0.0.1" >
<#assign redisPort = "6379" >
<#assign redisDataBase = "0" >
......@@ -22,9 +21,6 @@ TARGET=PSSYSTEM
<#list sys.getAllPSDevSlnMSDepApps() as depApp>
<#if depApp.getPSDCMSPlatform()??>
<#assign appPlatform=depApp.getPSDCMSPlatform()>
<#if appPlatform.getUserParam("nacos","127.0.0.1:8848")??>
<#assign nacosUrl = appPlatform.getUserParam("nacos","127.0.0.1:8848")>
</#if>
<#if appPlatform.getUserParam("spring.redis.host","127.0.0.1")??>
<#assign redisHost = appPlatform.getUserParam("spring.redis.host","127.0.0.1")>
</#if>
......@@ -43,9 +39,6 @@ TARGET=PSSYSTEM
<#list sys.getAllPSDevSlnMSDepAPIs() as depSysApi>
<#if depSysApi.getPSDCMSPlatform()?? >
<#assign sysApiPlatform=depSysApi.getPSDCMSPlatform()>
<#if sysApiPlatform.getUserParam("nacos","127.0.0.1:8848")??>
<#assign nacosUrl = sysApiPlatform.getUserParam("nacos","127.0.0.1:8848")>
</#if>
<#if sysApiPlatform.getUserParam("spring.redis.host","127.0.0.1")??>
<#assign redisHost = sysApiPlatform.getUserParam("spring.redis.host","127.0.0.1")>
</#if>
......@@ -129,12 +122,8 @@ TARGET=PSSYSTEM
</#if>
</#list>
</#if>
#nacos配置中心、数据源
#缓存、数据源
spring:
cloud:
nacos:
discovery:
server-addr: ${nacosUrl}
cache:
redis:
time-to-live: 3600
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册