diff --git a/cash-api/account-server/src/main/java/com/czg/controller/TestController.java b/cash-api/account-server/src/main/java/com/czg/controller/TestController.java new file mode 100644 index 00000000..306e68cc --- /dev/null +++ b/cash-api/account-server/src/main/java/com/czg/controller/TestController.java @@ -0,0 +1,22 @@ +package com.czg.controller; + +import com.czg.account.service.TestService; +import jakarta.annotation.Resource; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @author GYJoker + */ +@RestController +@RequestMapping("/test") +public class TestController { + + @Resource + private TestService testService; + + @RequestMapping("/hello") + public String hello() { + return testService.insertData(); + } +} diff --git a/cash-api/account-server/src/main/resources/application-dev.yml b/cash-api/account-server/src/main/resources/application-dev.yml index e32b73d4..ce2d4991 100644 --- a/cash-api/account-server/src/main/resources/application-dev.yml +++ b/cash-api/account-server/src/main/resources/application-dev.yml @@ -23,10 +23,10 @@ dubbo: application: name: account-server qos-port: 22221 - qos-enable: true +# qos-enable: true registry: address: nacos://121.40.109.122:8848 # Nacos 服务地址 - group: server + group: server-dev namespace: 237e1905-0a66-4375-9bb6-a51c3c034aca protocol: port: 9101 @@ -34,3 +34,13 @@ dubbo: threadpool: fixed +seata: + application-id: account-server + tx-service-group: group_seata + config: + type: nacos + nacos: + server-addr: 121.40.109.122:8848 + namespace: + group: group_seata + diff --git a/cash-api/account-server/src/main/resources/application-test.yml b/cash-api/account-server/src/main/resources/application-test.yml index 11a3abbd..eb1180ca 100644 --- a/cash-api/account-server/src/main/resources/application-test.yml +++ b/cash-api/account-server/src/main/resources/application-test.yml @@ -34,3 +34,15 @@ dubbo: threads: 20 threadpool: fixed + + +seata: + application-id: account-server + tx-service-group: group_seata + config: + type: nacos + nacos: + server-addr: 121.40.109.122:8848 + namespace: + group: group_seata + diff --git a/cash-api/order-server/src/main/resources/application-dev.yml b/cash-api/order-server/src/main/resources/application-dev.yml index e9b78476..109d67d4 100644 --- a/cash-api/order-server/src/main/resources/application-dev.yml +++ b/cash-api/order-server/src/main/resources/application-dev.yml @@ -33,12 +33,19 @@ dubbo: # qos-enable: true registry: address: nacos://121.40.109.122:8848 # Nacos 服务地址 - group: server + group: server-dev namespace: 237e1905-0a66-4375-9bb6-a51c3c034aca protocol: - port: 9101 + port: 9201 threads: 20 threadpool: fixed -rabbitmq: - prefix: dev_ +seata: + application-id: order-server + tx-service-group: group_seata + config: + type: nacos + nacos: + server-addr: 121.40.109.122:8848 + namespace: + group: group_seata diff --git a/cash-api/order-server/src/main/resources/application-test.yml b/cash-api/order-server/src/main/resources/application-test.yml index eb8d30bb..fb77f9a4 100644 --- a/cash-api/order-server/src/main/resources/application-test.yml +++ b/cash-api/order-server/src/main/resources/application-test.yml @@ -37,10 +37,18 @@ dubbo: group: server-test namespace: 237e1905-0a66-4375-9bb6-a51c3c034aca protocol: - port: 9101 + port: 9201 threads: 20 threadpool: fixed -rabbitmq: - prefix: test_ \ No newline at end of file +seata: + application-id: order-server + tx-service-group: group_seata + config: + type: nacos + nacos: + server-addr: 121.40.109.122:8848 + namespace: + group: group_seata + diff --git a/cash-api/product-server/src/main/resources/application-dev.yml b/cash-api/product-server/src/main/resources/application-dev.yml index e9f41485..1379b0c8 100644 --- a/cash-api/product-server/src/main/resources/application-dev.yml +++ b/cash-api/product-server/src/main/resources/application-dev.yml @@ -38,9 +38,19 @@ dubbo: qos-enable: true registry: address: nacos://121.40.109.122:8848 # Nacos 服务地址 - group: server + group: server-dev namespace: 237e1905-0a66-4375-9bb6-a51c3c034aca protocol: - port: 9101 + port: 9301 threads: 20 threadpool: fixed + +seata: + application-id: product-server + tx-service-group: group_seata + config: + type: nacos + nacos: + server-addr: 121.40.109.122:8848 + namespace: + group: group_seata diff --git a/cash-api/product-server/src/main/resources/application-test.yml b/cash-api/product-server/src/main/resources/application-test.yml index 844c31fd..f6543f65 100644 --- a/cash-api/product-server/src/main/resources/application-test.yml +++ b/cash-api/product-server/src/main/resources/application-test.yml @@ -30,7 +30,17 @@ dubbo: group: server-test namespace: 237e1905-0a66-4375-9bb6-a51c3c034aca protocol: - port: 9101 + port: 9301 threads: 20 threadpool: fixed + +seata: + application-id: product-server + tx-service-group: group_seata + config: + type: nacos + nacos: + server-addr: 121.40.109.122:8848 + namespace: + group: group_seata diff --git a/cash-api/system-server/src/main/resources/application-dev.yml b/cash-api/system-server/src/main/resources/application-dev.yml index 729779f3..903a8685 100644 --- a/cash-api/system-server/src/main/resources/application-dev.yml +++ b/cash-api/system-server/src/main/resources/application-dev.yml @@ -39,3 +39,14 @@ dubbo: port: 9401 threads: 20 threadpool: fixed + +seata: + application-id: system-server + tx-service-group: group_seata + config: + type: nacos + nacos: + server-addr: 121.40.109.122:8848 + namespace: + group: group_seata + diff --git a/cash-api/system-server/src/main/resources/application-test.yml b/cash-api/system-server/src/main/resources/application-test.yml index dabfdb3c..2216c268 100644 --- a/cash-api/system-server/src/main/resources/application-test.yml +++ b/cash-api/system-server/src/main/resources/application-test.yml @@ -39,3 +39,15 @@ dubbo: port: 9401 threads: 20 threadpool: fixed + + +seata: + application-id: system-server + tx-service-group: group_seata + config: + type: nacos + nacos: + server-addr: 121.40.109.122:8848 + namespace: + group: group_seata + diff --git a/cash-common/cash-common-service/src/main/java/com/czg/account/service/TestService.java b/cash-common/cash-common-service/src/main/java/com/czg/account/service/TestService.java new file mode 100644 index 00000000..78ced34c --- /dev/null +++ b/cash-common/cash-common-service/src/main/java/com/czg/account/service/TestService.java @@ -0,0 +1,8 @@ +package com.czg.account.service; + +/** + * @author GYJoker + */ +public interface TestService { + String insertData(); +} diff --git a/cash-dependencies/pom.xml b/cash-dependencies/pom.xml index 8987ba71..6c2f22b4 100644 --- a/cash-dependencies/pom.xml +++ b/cash-dependencies/pom.xml @@ -32,6 +32,7 @@ 3.3.3 3.3.3 3.3.3 + 2.0.0 4.40.54.ALL 2.0.24 2.8.3 @@ -159,6 +160,13 @@ dubbo ${dubbo.version} + + + io.seata + seata-spring-boot-starter + ${seata.version} + +