requestOriginParserOptional) {
- SentinelWebMvcConfig sentinelWebMvcConfig = new SentinelWebMvcConfig();
- sentinelWebMvcConfig.setHttpMethodSpecify(properties.getHttpMethodSpecify());
- sentinelWebMvcConfig.setWebContextUnify(properties.getWebContextUnify());
-
- if (blockExceptionHandlerOptional.isPresent()) {
- blockExceptionHandlerOptional.ifPresent(sentinelWebMvcConfig::setBlockExceptionHandler);
- }
- else {
- if (StringUtils.hasText(properties.getBlockPage())) {
- sentinelWebMvcConfig.setBlockExceptionHandler(
- ((request, response, e) -> response.sendRedirect(properties.getBlockPage())));
- }
- else {
- sentinelWebMvcConfig.setBlockExceptionHandler(new DefaultBlockExceptionHandler());
- }
- }
-
- urlCleanerOptional.ifPresent(sentinelWebMvcConfig::setUrlCleaner);
- requestOriginParserOptional.ifPresent(sentinelWebMvcConfig::setOriginParser);
- return sentinelWebMvcConfig;
- }
-
-}
diff --git a/pigx-common/pigx-common-sequence/pom.xml b/pigx-common/pigx-common-sequence/pom.xml
index 7812a5377..a4c18443f 100755
--- a/pigx-common/pigx-common-sequence/pom.xml
+++ b/pigx-common/pigx-common-sequence/pom.xml
@@ -6,7 +6,7 @@
com.pig4cloud
pigx-common
- 4.3.0
+ 4.4.0
pigx-common-sequence
diff --git a/pigx-common/pigx-common-sequence/src/main/java/com/pig4cloud/pigx/common/sequence/range/impl/db/provider/DmSqlProvider.java b/pigx-common/pigx-common-sequence/src/main/java/com/pig4cloud/pigx/common/sequence/range/impl/db/provider/DmSqlProvider.java
new file mode 100644
index 000000000..630f02561
--- /dev/null
+++ b/pigx-common/pigx-common-sequence/src/main/java/com/pig4cloud/pigx/common/sequence/range/impl/db/provider/DmSqlProvider.java
@@ -0,0 +1,42 @@
+package com.pig4cloud.pigx.common.sequence.range.impl.db.provider;
+
+import com.baomidou.mybatisplus.annotation.DbType;
+import org.springframework.stereotype.Component;
+
+/**
+ * 数据源提供者
+ *
+ * @author 达梦数据库支持
+ * @date 2022-04-27
+ *
+ * sql server
+ */
+@Component
+public class DmSqlProvider implements SqlProvider {
+
+ /**
+ * 获取表是否存在
+ * @return
+ */
+ @Override
+ public String getExistTableSql() {
+ return "select count(*) from user_tables where table_name =upper('#tableName')";
+ }
+
+ /**
+ * 获取建表语句
+ * @return
+ */
+ @Override
+ public String getCreateTableSql() {
+ return "CREATE TABLE #tableName (ID BIGINT IDENTITY (1,1) NOT NULL,VALUE BIGINT NOT NULL"
+ + ",NAME VARCHAR (32) NOT NULL,GMT_CREATE TIMESTAMP (0) NOT NULL,GMT_MODIFIED TIMESTAMP (0) NOT NULL"
+ + ",NOT CLUSTER PRIMARY KEY (ID),CONSTRAINT UK_NAME UNIQUE (NAME)) STORAGE (ON MAIN,CLUSTERBTR);";
+ }
+
+ @Override
+ public Boolean support(DbType dbType) {
+ return DbType.SQL_SERVER.equals(dbType);
+ }
+
+}
diff --git a/pigx-common/pigx-common-sequence/src/main/java/com/pig4cloud/pigx/common/sequence/range/impl/db/provider/MssqlSqlProvider.java b/pigx-common/pigx-common-sequence/src/main/java/com/pig4cloud/pigx/common/sequence/range/impl/db/provider/MssqlSqlProvider.java
new file mode 100644
index 000000000..cf8ad245b
--- /dev/null
+++ b/pigx-common/pigx-common-sequence/src/main/java/com/pig4cloud/pigx/common/sequence/range/impl/db/provider/MssqlSqlProvider.java
@@ -0,0 +1,34 @@
+package com.pig4cloud.pigx.common.sequence.range.impl.db.provider;
+
+import com.baomidou.mybatisplus.annotation.DbType;
+import org.springframework.stereotype.Component;
+
+/**
+ * 数据源提供者
+ *
+ * @author hanyichao
+ * @date 2022-04-27
+ *
+ * sql server
+ */
+@Component
+public class MssqlSqlProvider implements SqlProvider {
+
+ /**
+ * 获取建表语句
+ * @return
+ */
+ @Override
+ public String getCreateTableSql() {
+ return "IF NOT EXISTS (\n"
+ + "SELECT*FROM sys.all_objects WHERE object_id=OBJECT_ID(N'#tableName') AND type IN ('U')) \n"
+ + "CREATE TABLE #tableName (id bigint NOT NULL,VALUE bigint NOT NULL,name nvarchar (32) COLLATE "
+ + "Chinese_PRC_CI_AS NOT NULL,gmt_create datetime2 (7) NOT NULL,gmt_modified datetime2 (7) NOT NULL) GO";
+ }
+
+ @Override
+ public Boolean support(DbType dbType) {
+ return DbType.SQL_SERVER2005.equals(dbType);
+ }
+
+}
diff --git a/pigx-common/pigx-common-swagger/pom.xml b/pigx-common/pigx-common-swagger/pom.xml
index 32b3c5c19..96766e922 100644
--- a/pigx-common/pigx-common-swagger/pom.xml
+++ b/pigx-common/pigx-common-swagger/pom.xml
@@ -24,7 +24,7 @@
com.pig4cloud
pigx-common
- 4.3.0
+ 4.4.0
pigx-common-swagger
diff --git a/pigx-common/pigx-common-test/pom.xml b/pigx-common/pigx-common-test/pom.xml
index 1055f8302..265ad1757 100755
--- a/pigx-common/pigx-common-test/pom.xml
+++ b/pigx-common/pigx-common-test/pom.xml
@@ -6,7 +6,7 @@
com.pig4cloud
pigx-common
- 4.3.0
+ 4.4.0
pigx-common-test
diff --git a/pigx-common/pigx-common-transaction/pom.xml b/pigx-common/pigx-common-transaction/pom.xml
deleted file mode 100644
index a1f4e6f70..000000000
--- a/pigx-common/pigx-common-transaction/pom.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-
-
- 4.0.0
-
- com.pig4cloud
- pigx-common
- 4.3.0
-
-
- pigx-common-transaction
- jar
-
- pigx lcn transaction
-
-
-
- com.pig4cloud
- pigx-common-core
-
-
-
- com.codingapi
- tx-client
- ${lcn.version}
-
-
- org.slf4j
- *
-
-
-
-
- com.codingapi
- tx-plugins-db
- ${lcn.version}
-
-
- org.slf4j
- *
-
-
-
-
-
- org.springframework.cloud
- spring-cloud-starter-openfeign
-
-
-
-
diff --git a/pigx-common/pigx-common-transaction/src/main/java/com/pig4cloud/pigx/common/transaction/TransactionConfiguration.java b/pigx-common/pigx-common-transaction/src/main/java/com/pig4cloud/pigx/common/transaction/TransactionConfiguration.java
deleted file mode 100755
index cdec744b7..000000000
--- a/pigx-common/pigx-common-transaction/src/main/java/com/pig4cloud/pigx/common/transaction/TransactionConfiguration.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (c) 2018-2025, lengleng All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * Neither the name of the pig4cloud.com developer nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * Author: lengleng (wangiegie@gmail.com)
- */
-
-package com.pig4cloud.pigx.common.transaction;
-
-import org.springframework.context.annotation.ComponentScan;
-import org.springframework.context.annotation.Configuration;
-
-/**
- * @author LCN on 2017/6/26.
- * @author LCN
- * @since 4.1.0
- */
-
-@Configuration
-@ComponentScan({ "com.codingapi.tx", "com.pig4cloud.pigx.common.transaction" })
-public class TransactionConfiguration {
-
-}
diff --git a/pigx-common/pigx-common-transaction/src/main/java/com/pig4cloud/pigx/common/transaction/pack-info.md b/pigx-common/pigx-common-transaction/src/main/java/com/pig4cloud/pigx/common/transaction/pack-info.md
deleted file mode 100644
index d48381f67..000000000
--- a/pigx-common/pigx-common-transaction/src/main/java/com/pig4cloud/pigx/common/transaction/pack-info.md
+++ /dev/null
@@ -1,6 +0,0 @@
-由于LCN 暂未发布适配 2.0 版本
-当前包是根据TCN transaction-springcloud 模块修改而来
-解决LCN 不兼容 Spring Cloud Finchley 问题
-
-关于LCN
-https://github.com/codingapi/tx-lcn
diff --git a/pigx-common/pigx-common-transaction/src/main/java/com/pig4cloud/pigx/common/transaction/rewrite/TxManagerHttpRequestServiceImpl.java b/pigx-common/pigx-common-transaction/src/main/java/com/pig4cloud/pigx/common/transaction/rewrite/TxManagerHttpRequestServiceImpl.java
deleted file mode 100644
index 325594aac..000000000
--- a/pigx-common/pigx-common-transaction/src/main/java/com/pig4cloud/pigx/common/transaction/rewrite/TxManagerHttpRequestServiceImpl.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (c) 2018-2025, lengleng All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * Neither the name of the pig4cloud.com developer nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * Author: lengleng (wangiegie@gmail.com)
- */
-
-package com.pig4cloud.pigx.common.transaction.rewrite;
-
-import com.codingapi.tx.netty.service.TxManagerHttpRequestService;
-import com.lorne.core.framework.utils.http.HttpUtils;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.stereotype.Service;
-
-/**
- * @author lengleng
- * @date 2018/8/19 请求tx-manager接口实现
- */
-@Slf4j
-@Service
-public class TxManagerHttpRequestServiceImpl implements TxManagerHttpRequestService {
-
- @Override
- public String httpGet(String url) {
- String res = HttpUtils.get(url);
- log.debug("请求接口 {},响应报文:{}", url, res);
- return res;
- }
-
- @Override
- public String httpPost(String url, String params) {
- String res = HttpUtils.post(url, params);
- log.debug("请求接口 {},响应报文:{}", url, res);
- return res;
- }
-
-}
diff --git a/pigx-common/pigx-common-transaction/src/main/java/com/pig4cloud/pigx/common/transaction/rewrite/TxManagerTxUrlServiceImpl.java b/pigx-common/pigx-common-transaction/src/main/java/com/pig4cloud/pigx/common/transaction/rewrite/TxManagerTxUrlServiceImpl.java
deleted file mode 100644
index 84f2e1461..000000000
--- a/pigx-common/pigx-common-transaction/src/main/java/com/pig4cloud/pigx/common/transaction/rewrite/TxManagerTxUrlServiceImpl.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (c) 2018-2025, lengleng All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * Neither the name of the pig4cloud.com developer nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * Author: lengleng (wangiegie@gmail.com)
- */
-
-package com.pig4cloud.pigx.common.transaction.rewrite;
-
-import com.codingapi.tx.config.service.TxManagerTxUrlService;
-import com.pig4cloud.pigx.common.core.constant.ServiceNameConstants;
-import lombok.AllArgsConstructor;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.cloud.client.ServiceInstance;
-import org.springframework.cloud.client.loadbalancer.LoadBalancerClient;
-import org.springframework.stereotype.Service;
-
-/**
- * @author lengleng
- * @date 2018/8/19 使用服务发现重写 Txmanager 获取规则
- */
-@Slf4j
-@Service
-@AllArgsConstructor
-public class TxManagerTxUrlServiceImpl implements TxManagerTxUrlService {
-
- private final LoadBalancerClient loadBalancerClient;
-
- @Override
- public String getTxUrl() {
- ServiceInstance serviceInstance = loadBalancerClient.choose(ServiceNameConstants.TX_MANAGER);
- String host = serviceInstance.getHost();
- Integer port = serviceInstance.getPort();
- String url = String.format("http://%s:%s/tx/manager/", host, port);
- log.info("tm.manager.url -> {}", url);
- return url;
- }
-
-}
diff --git a/pigx-common/pigx-common-transaction/src/main/java/com/pig4cloud/pigx/common/transaction/tx/RequestInterceptorConfiguration.java b/pigx-common/pigx-common-transaction/src/main/java/com/pig4cloud/pigx/common/transaction/tx/RequestInterceptorConfiguration.java
deleted file mode 100755
index c61f3d0a1..000000000
--- a/pigx-common/pigx-common-transaction/src/main/java/com/pig4cloud/pigx/common/transaction/tx/RequestInterceptorConfiguration.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (c) 2018-2025, lengleng All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * Neither the name of the pig4cloud.com developer nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * Author: lengleng (wangiegie@gmail.com)
- */
-
-package com.pig4cloud.pigx.common.transaction.tx;
-
-import com.pig4cloud.pigx.common.transaction.tx.springcloud.feign.TransactionRestTemplateInterceptor;
-import feign.RequestInterceptor;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-
-/**
- * @author LCN on 2018/1/18
- * @author LCN
- * @since 4.1.0
- */
-@Configuration
-public class RequestInterceptorConfiguration {
-
- @Bean
- public RequestInterceptor requestInterceptor() {
- return new TransactionRestTemplateInterceptor();
- }
-
-}
diff --git a/pigx-common/pigx-common-transaction/src/main/java/com/pig4cloud/pigx/common/transaction/tx/init/ApplicationTxInitializer.java b/pigx-common/pigx-common-transaction/src/main/java/com/pig4cloud/pigx/common/transaction/tx/init/ApplicationTxInitializer.java
deleted file mode 100644
index 670a7ddd8..000000000
--- a/pigx-common/pigx-common-transaction/src/main/java/com/pig4cloud/pigx/common/transaction/tx/init/ApplicationTxInitializer.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package com.pig4cloud.pigx.common.transaction.tx.init;
-
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.env.EnvironmentPostProcessor;
-import org.springframework.core.Ordered;
-import org.springframework.core.env.ConfigurableEnvironment;
-
-/**
- * @author lengleng
- * @date 22022-02-17
- *
- * 通过环境变量的形式注入 允许循环依赖
- */
-public class ApplicationTxInitializer implements EnvironmentPostProcessor, Ordered {
-
- @Override
- public void postProcessEnvironment(ConfigurableEnvironment environment, SpringApplication application) {
- System.setProperty("spring.main.allow-circular-references", "true");
- }
-
- @Override
- public int getOrder() {
- return Ordered.LOWEST_PRECEDENCE;
- }
-
-}
diff --git a/pigx-common/pigx-common-transaction/src/main/java/com/pig4cloud/pigx/common/transaction/tx/springcloud/feign/TransactionRestTemplateInterceptor.java b/pigx-common/pigx-common-transaction/src/main/java/com/pig4cloud/pigx/common/transaction/tx/springcloud/feign/TransactionRestTemplateInterceptor.java
deleted file mode 100755
index 91985a294..000000000
--- a/pigx-common/pigx-common-transaction/src/main/java/com/pig4cloud/pigx/common/transaction/tx/springcloud/feign/TransactionRestTemplateInterceptor.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (c) 2018-2025, lengleng All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * Neither the name of the pig4cloud.com developer nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * Author: lengleng (wangiegie@gmail.com)
- */
-
-package com.pig4cloud.pigx.common.transaction.tx.springcloud.feign;
-
-import com.codingapi.tx.aop.bean.TxTransactionLocal;
-import feign.RequestInterceptor;
-import feign.RequestTemplate;
-import lombok.extern.slf4j.Slf4j;
-
-/**
- * @author LCN on 2017/6/26.
- * @author LCN
- * @since 4.1.0
- */
-@Slf4j
-public class TransactionRestTemplateInterceptor implements RequestInterceptor {
-
- @Override
- public void apply(RequestTemplate requestTemplate) {
-
- TxTransactionLocal txTransactionLocal = TxTransactionLocal.current();
- String groupId = txTransactionLocal == null ? null : txTransactionLocal.getGroupId();
-
- log.info("LCN-SpringCloud TxGroup info -> groupId:" + groupId);
-
- if (txTransactionLocal != null) {
- requestTemplate.header("tx-group", groupId);
- }
- }
-
-}
diff --git a/pigx-common/pigx-common-transaction/src/main/java/com/pig4cloud/pigx/common/transaction/tx/springcloud/http/TransactionHttpRequestInterceptor.java b/pigx-common/pigx-common-transaction/src/main/java/com/pig4cloud/pigx/common/transaction/tx/springcloud/http/TransactionHttpRequestInterceptor.java
deleted file mode 100755
index 5842f6d9d..000000000
--- a/pigx-common/pigx-common-transaction/src/main/java/com/pig4cloud/pigx/common/transaction/tx/springcloud/http/TransactionHttpRequestInterceptor.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 2018-2025, lengleng All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * Neither the name of the pig4cloud.com developer nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * Author: lengleng (wangiegie@gmail.com)
- */
-
-package com.pig4cloud.pigx.common.transaction.tx.springcloud.http;
-
-import com.codingapi.tx.aop.bean.TxTransactionLocal;
-import lombok.SneakyThrows;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.http.HttpRequest;
-import org.springframework.http.client.ClientHttpRequestExecution;
-import org.springframework.http.client.ClientHttpRequestInterceptor;
-import org.springframework.http.client.ClientHttpResponse;
-
-/**
- * @author LCN on 2017/7/3.
- * @author LCN
- * @since 4.1.0
- */
-@Slf4j
-public class TransactionHttpRequestInterceptor implements ClientHttpRequestInterceptor {
-
- @Override
- @SneakyThrows
- public ClientHttpResponse intercept(HttpRequest request, byte[] body, ClientHttpRequestExecution execution) {
-
- TxTransactionLocal txTransactionLocal = TxTransactionLocal.current();
- String groupId = txTransactionLocal == null ? null : txTransactionLocal.getGroupId();
-
- log.info("LCN-SpringCloud TxGroup info -> groupId:" + groupId);
-
- if (txTransactionLocal != null) {
- request.getHeaders().add("tx-group", groupId);
- }
- return execution.execute(request, body);
- }
-
-}
diff --git a/pigx-common/pigx-common-transaction/src/main/java/com/pig4cloud/pigx/common/transaction/tx/springcloud/interceptor/TransactionAspect.java b/pigx-common/pigx-common-transaction/src/main/java/com/pig4cloud/pigx/common/transaction/tx/springcloud/interceptor/TransactionAspect.java
deleted file mode 100755
index 4636d0d39..000000000
--- a/pigx-common/pigx-common-transaction/src/main/java/com/pig4cloud/pigx/common/transaction/tx/springcloud/interceptor/TransactionAspect.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (c) 2018-2025, lengleng All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * Neither the name of the pig4cloud.com developer nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * Author: lengleng (wangiegie@gmail.com)
- */
-
-package com.pig4cloud.pigx.common.transaction.tx.springcloud.interceptor;
-
-import lombok.SneakyThrows;
-import lombok.extern.slf4j.Slf4j;
-import org.aspectj.lang.ProceedingJoinPoint;
-import org.aspectj.lang.annotation.Around;
-import org.aspectj.lang.annotation.Aspect;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.core.Ordered;
-import org.springframework.stereotype.Component;
-
-/**
- * LCN 事务拦截器
- *
- * @author LCN on 2018/1/5
- * @author LCN
- * @since 4.1.0
- */
-
-@Slf4j
-@Aspect
-@Component
-public class TransactionAspect implements Ordered {
-
- @Autowired
- private TxManagerInterceptor txManagerInterceptor;
-
- @SneakyThrows
- @Around("@annotation(com.codingapi.tx.annotation.TxTransaction)")
- public Object transactionRunning(ProceedingJoinPoint point) {
- log.debug("annotation-TransactionRunning-start---->");
- Object obj = txManagerInterceptor.around(point);
- log.debug("annotation-TransactionRunning-end---->");
- return obj;
- }
-
- @SneakyThrows
- @Around("this(com.codingapi.tx.annotation.ITxTransaction) && execution( * *(..))")
- public Object around(ProceedingJoinPoint point) {
- log.debug("interface-ITransactionRunning-start---->");
- Object obj = txManagerInterceptor.around(point);
- log.debug("interface-ITransactionRunning-end---->");
- return obj;
- }
-
- @Override
- public int getOrder() {
- return HIGHEST_PRECEDENCE;
- }
-
-}
diff --git a/pigx-common/pigx-common-transaction/src/main/java/com/pig4cloud/pigx/common/transaction/tx/springcloud/interceptor/TxManagerInterceptor.java b/pigx-common/pigx-common-transaction/src/main/java/com/pig4cloud/pigx/common/transaction/tx/springcloud/interceptor/TxManagerInterceptor.java
deleted file mode 100755
index c7a5ffd77..000000000
--- a/pigx-common/pigx-common-transaction/src/main/java/com/pig4cloud/pigx/common/transaction/tx/springcloud/interceptor/TxManagerInterceptor.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2018-2025, lengleng All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * Neither the name of the pig4cloud.com developer nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * Author: lengleng (wangiegie@gmail.com)
- */
-
-package com.pig4cloud.pigx.common.transaction.tx.springcloud.interceptor;
-
-import com.codingapi.tx.aop.service.AspectBeforeService;
-import lombok.AllArgsConstructor;
-import lombok.SneakyThrows;
-import lombok.extern.slf4j.Slf4j;
-import org.aspectj.lang.ProceedingJoinPoint;
-import org.springframework.stereotype.Component;
-import org.springframework.web.context.request.RequestAttributes;
-import org.springframework.web.context.request.RequestContextHolder;
-import org.springframework.web.context.request.ServletRequestAttributes;
-
-import javax.servlet.http.HttpServletRequest;
-
-/**
- * @author LCN on 2017/6/7.
- * @author LCN
- * @since 4.1.0
- */
-
-@Slf4j
-@Component
-@AllArgsConstructor
-public class TxManagerInterceptor {
-
- private final AspectBeforeService aspectBeforeService;
-
- @SneakyThrows
- public Object around(ProceedingJoinPoint point) {
- RequestAttributes requestAttributes;
- String groupId = null;
- try {
- requestAttributes = RequestContextHolder.currentRequestAttributes();
- HttpServletRequest request = ((ServletRequestAttributes) requestAttributes).getRequest();
- groupId = request.getHeader("tx-group");
- }
- catch (IllegalStateException e) {
- log.info("非web 环境调用 不包含请求上下文");
- }
- return aspectBeforeService.around(groupId, point);
- }
-
-}
diff --git a/pigx-common/pigx-common-transaction/src/main/java/com/pig4cloud/pigx/common/transaction/tx/springcloud/listener/ServerListener.java b/pigx-common/pigx-common-transaction/src/main/java/com/pig4cloud/pigx/common/transaction/tx/springcloud/listener/ServerListener.java
deleted file mode 100755
index 0df8fbeeb..000000000
--- a/pigx-common/pigx-common-transaction/src/main/java/com/pig4cloud/pigx/common/transaction/tx/springcloud/listener/ServerListener.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2018-2025, lengleng All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * Neither the name of the pig4cloud.com developer nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * Author: lengleng (wangiegie@gmail.com)
- */
-
-package com.pig4cloud.pigx.common.transaction.tx.springcloud.listener;
-
-import com.codingapi.tx.listener.service.InitService;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.web.context.WebServerInitializedEvent;
-import org.springframework.context.ApplicationListener;
-import org.springframework.stereotype.Component;
-
-/**
- * @author LCN
- * @since 4.1.0
- */
-@Component
-public class ServerListener implements ApplicationListener {
-
- private Logger logger = LoggerFactory.getLogger(ServerListener.class);
-
- private int serverPort;
-
- @Autowired
- private InitService initService;
-
- @Override
- public void onApplicationEvent(WebServerInitializedEvent event) {
- logger.info("onApplicationEvent -> onApplicationEvent. " + event.getWebServer());
- this.serverPort = event.getWebServer().getPort();
- initService.start();
- }
-
- public int getPort() {
- return this.serverPort;
- }
-
-}
diff --git a/pigx-common/pigx-common-transaction/src/main/java/com/pig4cloud/pigx/common/transaction/tx/springcloud/service/impl/ModelNameServiceImpl.java b/pigx-common/pigx-common-transaction/src/main/java/com/pig4cloud/pigx/common/transaction/tx/springcloud/service/impl/ModelNameServiceImpl.java
deleted file mode 100755
index 11c0d268b..000000000
--- a/pigx-common/pigx-common-transaction/src/main/java/com/pig4cloud/pigx/common/transaction/tx/springcloud/service/impl/ModelNameServiceImpl.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Copyright (c) 2018-2025, lengleng All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * Neither the name of the pig4cloud.com developer nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * Author: lengleng (wangiegie@gmail.com)
- */
-
-package com.pig4cloud.pigx.common.transaction.tx.springcloud.service.impl;
-
-import com.codingapi.tx.listener.service.ModelNameService;
-import com.lorne.core.framework.utils.encode.MD5Util;
-import com.pig4cloud.pigx.common.transaction.tx.springcloud.listener.ServerListener;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.stereotype.Service;
-
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-
-/**
- * @author LCN on 2017/7/12.
- * @author LCN
- * @since 4.1.0
- */
-@Service
-@Configuration
-public class ModelNameServiceImpl implements ModelNameService {
-
- @Value("${spring.application.name}")
- private String modelName;
-
- @Autowired
- private ServerListener serverListener;
-
- private String host = null;
-
- @Override
- public String getModelName() {
- return modelName;
- }
-
- private String getIp() {
- if (host == null) {
- try {
- host = InetAddress.getLocalHost().getHostAddress();
- }
- catch (UnknownHostException e) {
- e.printStackTrace();
- }
- }
- return host;
- }
-
- private int getPort() {
- int port = serverListener.getPort();
- int count = 0;
- while (port == 0) {
- try {
- Thread.sleep(10);
- }
- catch (InterruptedException e) {
- e.printStackTrace();
- }
- port = serverListener.getPort();
- count++;
-
- if (count == 2000) {
- throw new RuntimeException("get server port error.");
- }
- }
-
- return port;
- }
-
- @Override
- public String getUniqueKey() {
- String address = getIp() + getPort();
- return MD5Util.md5(address.getBytes());
- }
-
- @Override
- public String getIpAddress() {
- String address = getIp() + ":" + getPort();
- return address;
- }
-
-}
diff --git a/pigx-common/pigx-common-transaction/src/main/resources/META-INF/spring.factories b/pigx-common/pigx-common-transaction/src/main/resources/META-INF/spring.factories
deleted file mode 100644
index b4aa57cf6..000000000
--- a/pigx-common/pigx-common-transaction/src/main/resources/META-INF/spring.factories
+++ /dev/null
@@ -1,3 +0,0 @@
-org.springframework.boot.autoconfigure.EnableAutoConfiguration=com.pig4cloud.pigx.common.transaction.TransactionConfiguration
-org.springframework.boot.env.EnvironmentPostProcessor=\
- com.pig4cloud.pigx.common.transaction.tx.init.ApplicationTxInitializer
diff --git a/pigx-common/pigx-common-websocket/pom.xml b/pigx-common/pigx-common-websocket/pom.xml
index 07983b659..9ac5ac93f 100755
--- a/pigx-common/pigx-common-websocket/pom.xml
+++ b/pigx-common/pigx-common-websocket/pom.xml
@@ -6,7 +6,7 @@
com.pig4cloud
pigx-common
- 4.3.0
+ 4.4.0
pigx-common-websocket
diff --git a/pigx-common/pigx-common-websocket/src/main/java/com/pig4cloud/pigx/common/websocket/config/WebSocketHandlerConfig.java b/pigx-common/pigx-common-websocket/src/main/java/com/pig4cloud/pigx/common/websocket/config/WebSocketHandlerConfig.java
index 4c7809709..7215097d8 100644
--- a/pigx-common/pigx-common-websocket/src/main/java/com/pig4cloud/pigx/common/websocket/config/WebSocketHandlerConfig.java
+++ b/pigx-common/pigx-common-websocket/src/main/java/com/pig4cloud/pigx/common/websocket/config/WebSocketHandlerConfig.java
@@ -14,7 +14,6 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
-import org.springframework.cloud.client.ServiceInstance;
import org.springframework.context.annotation.Bean;
import org.springframework.web.socket.WebSocketHandler;
import org.springframework.web.socket.handler.TextWebSocketHandler;
@@ -32,8 +31,8 @@ public class WebSocketHandlerConfig {
@Bean
@ConditionalOnMissingBean(SessionKeyGenerator.class)
- public SessionKeyGenerator sessionKeyGenerator(ServiceInstance serviceInstance) {
- return new PigxSessionKeyGenerator(serviceInstance);
+ public SessionKeyGenerator sessionKeyGenerator() {
+ return new PigxSessionKeyGenerator();
}
@Bean
diff --git a/pigx-common/pigx-common-websocket/src/main/java/com/pig4cloud/pigx/common/websocket/custom/PigxSessionKeyGenerator.java b/pigx-common/pigx-common-websocket/src/main/java/com/pig4cloud/pigx/common/websocket/custom/PigxSessionKeyGenerator.java
index 33c5dfb26..3aefc40a0 100644
--- a/pigx-common/pigx-common-websocket/src/main/java/com/pig4cloud/pigx/common/websocket/custom/PigxSessionKeyGenerator.java
+++ b/pigx-common/pigx-common-websocket/src/main/java/com/pig4cloud/pigx/common/websocket/custom/PigxSessionKeyGenerator.java
@@ -3,7 +3,6 @@ package com.pig4cloud.pigx.common.websocket.custom;
import com.pig4cloud.pigx.common.security.service.PigxUser;
import com.pig4cloud.pigx.common.websocket.holder.SessionKeyGenerator;
import lombok.RequiredArgsConstructor;
-import org.springframework.cloud.client.ServiceInstance;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.socket.WebSocketSession;
@@ -15,8 +14,6 @@ import org.springframework.web.socket.WebSocketSession;
@RequiredArgsConstructor
public class PigxSessionKeyGenerator implements SessionKeyGenerator {
- private final ServiceInstance instance;
-
/**
* 获取当前session的唯一标识
* @param webSocketSession 当前session
@@ -29,8 +26,8 @@ public class PigxSessionKeyGenerator implements SessionKeyGenerator {
if (obj instanceof PigxUser) {
PigxUser user = (PigxUser) obj;
- // IP:port:userId 作为唯一区分
- return String.format("%s:%s:%s", instance.getHost(), instance.getPort(), user.getId());
+ // userId 作为唯一区分
+ return String.valueOf(user.getId());
}
return null;
diff --git a/pigx-common/pigx-common-websocket/src/main/java/com/pig4cloud/pigx/common/websocket/distribute/RedisMessageDistributor.java b/pigx-common/pigx-common-websocket/src/main/java/com/pig4cloud/pigx/common/websocket/distribute/RedisMessageDistributor.java
index 3833c6716..7fcf30488 100644
--- a/pigx-common/pigx-common-websocket/src/main/java/com/pig4cloud/pigx/common/websocket/distribute/RedisMessageDistributor.java
+++ b/pigx-common/pigx-common-websocket/src/main/java/com/pig4cloud/pigx/common/websocket/distribute/RedisMessageDistributor.java
@@ -1,13 +1,11 @@
package com.pig4cloud.pigx.common.websocket.distribute;
import cn.hutool.json.JSONUtil;
-import com.pig4cloud.pigx.common.core.util.SpringContextHolder;
import lombok.RequiredArgsConstructor;
-import org.springframework.cloud.client.ServiceInstance;
import org.springframework.data.redis.core.StringRedisTemplate;
+import java.util.ArrayList;
import java.util.List;
-import java.util.stream.Collectors;
/**
* 消息分发器
@@ -27,10 +25,7 @@ public class RedisMessageDistributor implements MessageDistributor {
@Override
public void distribute(MessageDO messageDO) {
// 包装 sessionKey 适配分布式多环境
- ServiceInstance instance = SpringContextHolder.getBean(ServiceInstance.class);
- List