Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
iBiz4j Spring R7
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
iBiz-R7后台标准模板
iBiz4j Spring R7
提交
05974565
提交
05974565
编写于
7月 28, 2020
作者:
zhouweidong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
seata分布式事务
上级
9f0c27df
变更
5
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
118 行增加
和
8 行删除
+118
-8
%APP%Application.java.ftl
...ava/%SYS_PKGPATH%/%APP_PKGPATH%/%APP%Application.java.ftl
+1
-0
DevBootApplication.java.ftl
...t/src/main/java/%SYS_PKGPATH%/DevBootApplication.java.ftl
+1
-0
pom.xml.ftl
SLN/%PUBPRJ%-dependencies/pom.xml.ftl
+33
-1
%SYS%%API%Application.java.ftl
..._PKGPATH%/%SYSAPI_PKGPATH%/%SYS%%API%Application.java.ftl
+1
-0
application-sys.yml.ftl
SLN/%PUBPRJ%-util/src/main/resources/application-sys.yml.ftl
+82
-7
未找到文件。
SLN/%PUBPRJ%-app/%PUBPRJ%-app-%APP_PKGPATH%/src/main/java/%SYS_PKGPATH%/%APP_PKGPATH%/%APP%Application.java.ftl
浏览文件 @
05974565
...
...
@@ -27,6 +27,7 @@ import java.util.List;
@
Slf4j
@
Import
({
com
.
alibaba
.
cloud
.
seata
.
feign
.
SeataFeignClientAutoConfiguration
.
class
,
FeignClientsConfiguration
.
class
})
@
EnableDiscoveryClient
...
...
SLN/%PUBPRJ%-boot/src/main/java/%SYS_PKGPATH%/DevBootApplication.java.ftl
浏览文件 @
05974565
...
...
@@ -53,6 +53,7 @@ import java.util.List;
//
}
)
@
Import
({
com
.
alibaba
.
cloud
.
seata
.
feign
.
SeataFeignClientAutoConfiguration
.
class
,
org
.
springframework
.
cloud
.
openfeign
.
FeignClientsConfiguration
.
class
})
@
EnableAsync
...
...
SLN/%PUBPRJ%-dependencies/pom.xml.ftl
浏览文件 @
05974565
...
...
@@ -31,7 +31,7 @@ TARGET=PSSYSTEM
<#-- properties, usually record jars version constants -->
<properties>
<!-- Spring Cloud Alibaba(2.1.x.RELEASE) & Spring Cloud(Spring Cloud Greenwich) & Spring Boot(2.1.x.RELEASE) compatibility -->
<spring-cloud-alibaba.version>2.
1
.1.RELEASE</spring-cloud-alibaba.version>
<spring-cloud-alibaba.version>2.
2
.1.RELEASE</spring-cloud-alibaba.version>
<spring-cloud-openfeign.version>2.2.1.RELEASE</spring-cloud-openfeign.version>
...
...
@@ -91,6 +91,12 @@ TARGET=PSSYSTEM
<!-- eureka微服务注册中心 -->
<eureka-client.version>2.2.1.RELEASE</eureka-client.version>
<!-- 阿里sentinel熔断器 -->
<alibaba-sentinel.version>2.1.1.RELEASE</alibaba-sentinel.version>
<!-- 阿里seata分布式事务 -->
<alibaba-seata.version>1.3.0</alibaba-seata.version>
<#if sys.getAllPSSystemDBConfigs()??>
<#list sys.getAllPSSystemDBConfigs() as dbConfig>
<#if dbConfig.getDBType()=='MYSQL5'>
...
...
@@ -321,6 +327,7 @@ TARGET=PSSYSTEM
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
<version>${r'${alibaba-sentinel.version}'}</version>
</dependency>
<!-- Lombok -->
...
...
@@ -388,6 +395,31 @@ TARGET=PSSYSTEM
</dependency>
</#if>
<!-- 阿里seata分布式事务 -->
<dependency>
<groupId>io.seata</groupId>
<artifactId>seata-spring-boot-starter</artifactId>
<version>${r'${alibaba-seata.version}'}</version>
<exclusions>
<exclusion>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-seata</artifactId>
<version> ${r'${spring-cloud-alibaba.version}'}</version>
<exclusions>
<exclusion>
<groupId>io.seata</groupId>
<artifactId>seata-spring-boot-starter</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
</project>
SLN/%PUBPRJ%-provider/%PUBPRJ%-provider-%SYSAPI_PKGPATH%/src/main/java/%SYS_PKGPATH%/%SYSAPI_PKGPATH%/%SYS%%API%Application.java.ftl
浏览文件 @
05974565
...
...
@@ -57,6 +57,7 @@ import java.util.List;
</#
if
>
})
@
Import
({
com
.
alibaba
.
cloud
.
seata
.
feign
.
SeataFeignClientAutoConfiguration
.
class
,
org
.
springframework
.
cloud
.
openfeign
.
FeignClientsConfiguration
.
class
})
@
EnableFeignClients
(
basePackages
=
{
"${pub.getPKGCodeName()}"
})
...
...
SLN/%PUBPRJ%-util/src/main/resources/application-sys.yml.ftl
浏览文件 @
05974565
...
...
@@ -26,22 +26,56 @@ TARGET=PSSYSTEM
<#break>
</#if>
</#list>
<#assign seataEnable="false">
<#assign TcServerCluster="default">
<#assign seataServerName="seata-server">
<#assign nacosAddress="localhost">
<#assign nacosGroup="DEFAULT_GROUP">
<#assign nacosNamespace="">
<#assign nacosUserName="">
<#assign nacosPassWord="">
<#comment>前端应用微服务平台配置</#comment>
<#if sys.getAllPSDevSlnMSDepApps()??>
<#list sys.getAllPSDevSlnMSDepApps() as depApp>
<#if depApp.getPSDCMSPlatform()??>
<#assign appPlatform=depApp.getPSDCMSPlatform()>
<#if appPlatform.getUserParam("spring.redis.host","127.0.0.1")??>
<#assign redisHost = appPlatform.getUserParam("spring.redis.host","127.0.0.1")>
<#assign redisHost = appPlatform.getUserParam("spring.redis.host","127.0.0.1")>
</#if>
<#if appPlatform.getUserParam("spring.redis.port","6379")??>
<#assign redisPort = appPlatform.getUserParam("spring.redis.port","6379")>
<#assign redisPort = appPlatform.getUserParam("spring.redis.port","6379")>
</#if>
<#if appPlatform.getUserParam("spring.redis.database","0")??>
<#assign redisDataBase = appPlatform.getUserParam("spring.redis.database","0")>
<#assign redisDataBase = appPlatform.getUserParam("spring.redis.database","0")>
</#if>
<#if appPlatform.getUserParam("spring.data.mongodb.uri",mongodbUri)??>
<#assign mongodbUri = appPlatform.getUserParam("spring.data.mongodb.uri",mongodbUri)>
<#assign mongodbUri = appPlatform.getUserParam("spring.data.mongodb.uri",mongodbUri)>
</#if>
<#if appPlatform.getUserParam("seata.enabled",seataEnable)??>
<#assign seataEnable = appPlatform.getUserParam("seata.enabled",seataEnable)>
</#if>
<#if appPlatform.getUserParam("seata.service.vgroup-mapping."+sys.getName()+"group",TcServerCluster)??>
<#assign TcServerCluster = appPlatform.getUserParam("seata.service.vgroup-mapping."+sys.getName()+"group",TcServerCluster)>
</#if>
<#if appPlatform.getUserParam("seata.registry.nacos.application",seataServerName)??>
<#assign seataServerName = appPlatform.getUserParam("seata.registry.nacos.application",seataServerName)>
</#if>
<#if appPlatform.getUserParam("seata.registry.nacos.server-addr",nacosAddress)??>
<#assign nacosAddress = appPlatform.getUserParam("seata.registry.nacos.server-addr",nacosAddress)>
</#if>
<#if appPlatform.getUserParam("seata.registry.nacos.group",nacosGroup)??>
<#assign nacosGroup = appPlatform.getUserParam("seata.registry.nacos.group",nacosGroup)>
</#if>
<#if appPlatform.getUserParam("seata.registry.nacos.namespace",nacosNamespace)??>
<#assign nacosNamespace = appPlatform.getUserParam("seata.registry.nacos.namespace",nacosNamespace)>
</#if>
<#if appPlatform.getUserParam("seata.registry.nacos.userName",nacosUserName)??>
<#assign nacosUserName = appPlatform.getUserParam("seata.registry.nacos.userName",nacosUserName)>
</#if>
<#if appPlatform.getUserParam("seata.registry.nacos.password",nacosPassWord)??>
<#assign nacosPassWord = appPlatform.getUserParam("seata.registry.nacos.password",nacosPassWord)>
</#if>
<#break>
</#if>
...
...
@@ -53,17 +87,41 @@ TARGET=PSSYSTEM
<#if depSysApi.getPSDCMSPlatform()?? >
<#assign sysApiPlatform=depSysApi.getPSDCMSPlatform()>
<#if sysApiPlatform.getUserParam("spring.redis.host","127.0.0.1")??>
<#assign redisHost = sysApiPlatform.getUserParam("spring.redis.host","127.0.0.1")>
<#assign redisHost = sysApiPlatform.getUserParam("spring.redis.host","127.0.0.1")>
</#if>
<#if sysApiPlatform.getUserParam("spring.redis.port","6379")??>
<#assign redisPort = sysApiPlatform.getUserParam("spring.redis.port","6379")>
<#assign redisPort = sysApiPlatform.getUserParam("spring.redis.port","6379")>
</#if>
<#if sysApiPlatform.getUserParam("spring.redis.database","0")??>
<#assign redisDataBase = sysApiPlatform.getUserParam("spring.redis.database","0")>
<#assign redisDataBase = sysApiPlatform.getUserParam("spring.redis.database","0")>
</#if>
<#if sysApiPlatform.getUserParam("spring.data.mongodb.uri",mongodbUri)??>
<#assign mongodbUri = sysApiPlatform.getUserParam("spring.data.mongodb.uri",mongodbUri)>
</#if>
<#if sysApiPlatform.getUserParam("seata.enabled",seataEnable)??>
<#assign seataEnable = sysApiPlatform.getUserParam("seata.enabled",seataEnable)>
</#if>
<#if sysApiPlatform.getUserParam("seata.service.vgroup-mapping."+sys.getName()+"group",TcServerCluster)??>
<#assign TcServerCluster = sysApiPlatform.getUserParam("seata.service.vgroup-mapping."+sys.getName()+"group",TcServerCluster)>
</#if>
<#if sysApiPlatform.getUserParam("seata.registry.nacos.application",seataServerName)??>
<#assign seataServerName = sysApiPlatform.getUserParam("seata.registry.nacos.application",seataServerName)>
</#if>
<#if sysApiPlatform.getUserParam("seata.registry.nacos.server-addr",nacosAddress)??>
<#assign nacosAddress = sysApiPlatform.getUserParam("seata.registry.nacos.server-addr",nacosAddress)>
</#if>
<#if sysApiPlatform.getUserParam("seata.registry.nacos.group",nacosGroup)??>
<#assign nacosGroup = sysApiPlatform.getUserParam("seata.registry.nacos.group",nacosGroup)>
</#if>
<#if sysApiPlatform.getUserParam("seata.registry.nacos.namespace",nacosNamespace)??>
<#assign nacosNamespace = sysApiPlatform.getUserParam("seata.registry.nacos.namespace",nacosNamespace)>
</#if>
<#if sysApiPlatform.getUserParam("seata.registry.nacos.userName",nacosUserName)??>
<#assign nacosUserName = sysApiPlatform.getUserParam("seata.registry.nacos.userName",nacosUserName)>
</#if>
<#if sysApiPlatform.getUserParam("seata.registry.nacos.password",nacosPassWord)??>
<#assign nacosPassWord = sysApiPlatform.getUserParam("seata.registry.nacos.password",nacosPassWord)>
</#if>
<#break>
</#if>
</#list>
...
...
@@ -230,6 +288,23 @@ server:
mime-types: application/javascript,text/css,application/json,application/xml,text/html,text/xml,text/plain
min-response-size: 10240
seata:
enabled: ${seataEnable} #是否开启全局事务
application-id: ${sys.getName()} #服务标识
tx-service-group: ${sys.getName()}group #事务组
service:
vgroup-mapping:
${sys.getName()}group: ${TcServerCluster} #指定事务组对应的Tc Server集群
registry:
type: nacos #注册中心
nacos:
application: ${seataServerName} #Tc Server服务标识
server-addr: ${nacosAddress} #注册中心地址
group: ${nacosGroup} #服务组
namespace: ${nacosNamespace} #服务命名空间
userName: "${nacosUserName}" #用户名
password: "${nacosPassWord}" #密码
<#macro singleDatasourceConfig>
datasource:
username: ${dbUserName}
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录