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

补充事务开关

上级 c2ba94d7
...@@ -3,12 +3,13 @@ TARGET=PSSYSTEM ...@@ -3,12 +3,13 @@ TARGET=PSSYSTEM
</#ibiztemplate> </#ibiztemplate>
package ${pub.getPKGCodeName()}.config; package ${pub.getPKGCodeName()}.config;
import com.alibaba.cloud.seata.feign.SeataFeignClientAutoConfiguration;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import; import org.springframework.context.annotation.Import;
@Configuration @Configuration
@Import({SeataFeignClientAutoConfiguration.class}) <#if pub.isEnableGlobalTransaction?? && pub.isEnableGlobalTransaction()?? && pub.isEnableGlobalTransaction()==true>
@Import({com.alibaba.cloud.seata.feign.SeataFeignClientAutoConfiguration.class})
</#if>
public class DevBootAutoConfiguration { public class DevBootAutoConfiguration {
} }
...@@ -101,6 +101,7 @@ TARGET=PSSYSTEM ...@@ -101,6 +101,7 @@ TARGET=PSSYSTEM
<artifactId>jobs-spring-boot-starter</artifactId> <artifactId>jobs-spring-boot-starter</artifactId>
</dependency> </dependency>
<#if pub.isEnableGlobalTransaction?? && pub.isEnableGlobalTransaction()?? && pub.isEnableGlobalTransaction()==true>
<!-- 阿里seata分布式事务 --> <!-- 阿里seata分布式事务 -->
<dependency> <dependency>
<groupId>io.seata</groupId> <groupId>io.seata</groupId>
...@@ -123,6 +124,7 @@ TARGET=PSSYSTEM ...@@ -123,6 +124,7 @@ TARGET=PSSYSTEM
</exclusion> </exclusion>
</exclusions> </exclusions>
</dependency> </dependency>
</#if>
</dependencies> </dependencies>
......
...@@ -300,6 +300,7 @@ TARGET=PSSYSTEM ...@@ -300,6 +300,7 @@ TARGET=PSSYSTEM
<version>${r'${baomidou-jobs.version}'}</version> <version>${r'${baomidou-jobs.version}'}</version>
</dependency> </dependency>
<#if pub.isEnableGlobalTransaction?? && pub.isEnableGlobalTransaction()?? && pub.isEnableGlobalTransaction()==true>
<!-- 阿里seata分布式事务 --> <!-- 阿里seata分布式事务 -->
<dependency> <dependency>
<groupId>io.seata</groupId> <groupId>io.seata</groupId>
...@@ -324,6 +325,7 @@ TARGET=PSSYSTEM ...@@ -324,6 +325,7 @@ TARGET=PSSYSTEM
</exclusion> </exclusion>
</exclusions> </exclusions>
</dependency> </dependency>
</#if>
</dependencies> </dependencies>
</dependencyManagement> </dependencyManagement>
......
...@@ -18,9 +18,11 @@ import java.util.concurrent.Executor; ...@@ -18,9 +18,11 @@ import java.util.concurrent.Executor;
import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.ThreadPoolExecutor;
import org.springframework.context.annotation.Import; import org.springframework.context.annotation.Import;
<#if pub.isEnableGlobalTransaction?? && pub.isEnableGlobalTransaction()?? && pub.isEnableGlobalTransaction()==true>
@Import({ @Import({
com.alibaba.cloud.seata.feign.SeataFeignClientAutoConfiguration.class, com.alibaba.cloud.seata.feign.SeataFeignClientAutoConfiguration.class,
}) })
</#if>
@Configuration @Configuration
@ConditionalOnClass(${item.codeName}RestConfiguration.class) @ConditionalOnClass(${item.codeName}RestConfiguration.class)
@ConditionalOnWebApplication @ConditionalOnWebApplication
......
...@@ -33,6 +33,7 @@ TARGET=PSSYSTEM ...@@ -33,6 +33,7 @@ TARGET=PSSYSTEM
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<#if pub.isEnableGlobalTransaction?? && pub.isEnableGlobalTransaction()?? && pub.isEnableGlobalTransaction()==true>
<!-- 阿里seata分布式事务 --> <!-- 阿里seata分布式事务 -->
<dependency> <dependency>
<groupId>io.seata</groupId> <groupId>io.seata</groupId>
...@@ -55,6 +56,7 @@ TARGET=PSSYSTEM ...@@ -55,6 +56,7 @@ TARGET=PSSYSTEM
</exclusion> </exclusion>
</exclusions> </exclusions>
</dependency> </dependency>
</#if>
</dependencies> </dependencies>
......
...@@ -295,6 +295,7 @@ server: ...@@ -295,6 +295,7 @@ server:
mime-types: application/javascript,text/css,application/json,application/xml,text/html,text/xml,text/plain mime-types: application/javascript,text/css,application/json,application/xml,text/html,text/xml,text/plain
min-response-size: 10240 min-response-size: 10240
<#if pub.isEnableGlobalTransaction?? && pub.isEnableGlobalTransaction()?? && pub.isEnableGlobalTransaction()==true>
seata: seata:
enabled: ${seataEnable} #是否开启全局事务 enabled: ${seataEnable} #是否开启全局事务
application-id: ${sys.getName()} #服务标识 application-id: ${sys.getName()} #服务标识
...@@ -311,6 +312,7 @@ seata: ...@@ -311,6 +312,7 @@ seata:
namespace: ${nacosNamespace} #服务命名空间 namespace: ${nacosNamespace} #服务命名空间
userName: "${nacosUserName}" #用户名 userName: "${nacosUserName}" #用户名
password: "${nacosPassWord}" #密码 password: "${nacosPassWord}" #密码
</#if>
<#macro singleDatasourceConfig> <#macro singleDatasourceConfig>
datasource: datasource:
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册