malei05 4 هفته پیش
والد
کامیت
e297a4e2d5
27فایلهای تغییر یافته به همراه1 افزوده شده و 1004 حذف شده
  1. 1 3
      pom.xml
  2. 0 10
      yyc-common-bom/pom.xml
  3. BIN
      yyc-common-feign/target/classes/org/springframework/cloud/openfeign/HnqzFeignClientsRegistrar.class
  4. 0 50
      yyc-common-swagger/pom.xml
  5. 0 36
      yyc-common-swagger/src/main/java/com/qunzhixinxi/hnqz/common/swagger/annotation/EnableHnqzSwagger2.java
  6. 0 143
      yyc-common-swagger/src/main/java/com/qunzhixinxi/hnqz/common/swagger/config/SwaggerAutoConfiguration.java
  7. 0 161
      yyc-common-swagger/src/main/java/com/qunzhixinxi/hnqz/common/swagger/config/SwaggerProperties.java
  8. BIN
      yyc-common-taxhelper/target/classes/com/logosdata/security/SM2.class
  9. BIN
      yyc-common-taxhelper/target/classes/com/logosdata/security/SM3.class
  10. BIN
      yyc-common-taxhelper/target/classes/com/logosdata/security/SM4.class
  11. BIN
      yyc-common-taxhelper/target/classes/com/logosdata/security/util/NumberTool.class
  12. BIN
      yyc-common-taxhelper/target/classes/com/logosdata/security/util/SM4Base.class
  13. BIN
      yyc-common-taxhelper/target/classes/com/logosdata/security/util/SignUtils.class
  14. BIN
      yyc-common-taxhelper/target/classes/com/logosdata/security/util/StreamTool.class
  15. 0 51
      yyc-common-transaction/pom.xml
  16. 0 33
      yyc-common-transaction/src/main/java/com/qunzhixinxi/hnqz/common/transaction/TransactionConfiguration.java
  17. 0 6
      yyc-common-transaction/src/main/java/com/qunzhixinxi/hnqz/common/transaction/pack-info.md
  18. 0 47
      yyc-common-transaction/src/main/java/com/qunzhixinxi/hnqz/common/transaction/rewrite/TxManagerHttpRequestServiceImpl.java
  19. 0 49
      yyc-common-transaction/src/main/java/com/qunzhixinxi/hnqz/common/transaction/rewrite/TxManagerTxUrlServiceImpl.java
  20. 0 38
      yyc-common-transaction/src/main/java/com/qunzhixinxi/hnqz/common/transaction/tx/RequestInterceptorConfiguration.java
  21. 0 46
      yyc-common-transaction/src/main/java/com/qunzhixinxi/hnqz/common/transaction/tx/springcloud/feign/TransactionRestTemplateInterceptor.java
  22. 0 51
      yyc-common-transaction/src/main/java/com/qunzhixinxi/hnqz/common/transaction/tx/springcloud/http/TransactionHttpRequestInterceptor.java
  23. 0 68
      yyc-common-transaction/src/main/java/com/qunzhixinxi/hnqz/common/transaction/tx/springcloud/interceptor/TransactionAspect.java
  24. 0 60
      yyc-common-transaction/src/main/java/com/qunzhixinxi/hnqz/common/transaction/tx/springcloud/interceptor/TxManagerInterceptor.java
  25. 0 53
      yyc-common-transaction/src/main/java/com/qunzhixinxi/hnqz/common/transaction/tx/springcloud/listener/ServerListener.java
  26. 0 98
      yyc-common-transaction/src/main/java/com/qunzhixinxi/hnqz/common/transaction/tx/springcloud/service/impl/ModelNameServiceImpl.java
  27. 0 1
      yyc-common-transaction/src/main/resources/META-INF/spring.factories

+ 1 - 3
pom.xml

@@ -59,8 +59,6 @@
 		<module>yyc-common-security</module>
 		<module>yyc-common-sentinel</module>
 		<module>yyc-common-sequence</module>
-		<!--<module>yyc-common-swagger</module>-->
-		<!--<module>yyc-common-transaction</module>-->
 		<module>yyc-common-ding</module>
 		<module>yyc-common-taxhelper</module>
 		<module>yyc-common-qcc</module>
@@ -117,7 +115,7 @@
 			<dependency>
 				<groupId>net.yyc.common</groupId>
 				<artifactId>yyc-common-bom</artifactId>
-				<version>${project.version}</version>
+				<version>1.0.0-SNAPSHOT</version>
 				<type>pom</type>
 				<scope>import</scope>
 			</dependency>

+ 0 - 10
yyc-common-bom/pom.xml

@@ -95,11 +95,6 @@
 				<artifactId>yyc-common-sequence</artifactId>
 				<version>${yyc.common.version}</version>
 			</dependency>
-			<!--<dependency>-->
-			<!--	<groupId>net.yyc.common</groupId>-->
-			<!--	<artifactId>yyc-common-swagger</artifactId>-->
-			<!--	<version>${yyc.common.version}</version>-->
-			<!--</dependency>-->
 			<dependency>
 				<groupId>net.yyc.common</groupId>
 				<artifactId>yyc-common-taxhelper</artifactId>
@@ -110,11 +105,6 @@
 				<artifactId>yyc-common-mq</artifactId>
 				<version>${yyc.common.version}</version>
 			</dependency>
-			<!--<dependency>-->
-			<!--	<groupId>net.yyc.common</groupId>-->
-			<!--	<artifactId>yyc-common-transaction</artifactId>-->
-			<!--	<version>${yyc.common.version}</version>-->
-			<!--mybatis plus extension,包含了mybatis plus core-->
 			<dependency>
 				<groupId>com.baomidou</groupId>
 				<artifactId>mybatis-plus-extension</artifactId>

BIN
yyc-common-feign/target/classes/org/springframework/cloud/openfeign/HnqzFeignClientsRegistrar.class


+ 0 - 50
yyc-common-swagger/pom.xml

@@ -1,50 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  ~
-  ~      Copyright (c) 2018-2025, hnqz 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: hnqz
-  ~
-  -->
-
-<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
-		 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-	<modelVersion>4.0.0</modelVersion>
-	<parent>
-		<groupId>net.yyc.common</groupId>
-		<artifactId>yyc-common-parent</artifactId>
-		<version>1.0.0-SNAPSHOT</version>
-	</parent>
-
-	<artifactId>yyc-common-swagger</artifactId>
-	<packaging>jar</packaging>
-
-	<description>hnqz 接口文档</description>
-
-
-	<dependencies>
-		<!--swagger 依赖-->
-		<dependency>
-			<groupId>io.springfox</groupId>
-			<artifactId>springfox-swagger2</artifactId>
-			<version>${swagger.fox.version}</version>
-		</dependency>
-		<!--knife4j是为Java MVC框架集成Swagger生成Api文档的增强-->
-		<dependency>
-			<groupId>com.github.xiaoymin</groupId>
-			<artifactId>knife4j-micro-spring-boot-starter</artifactId>
-			<version>${knife4j.version}</version>
-		</dependency>
-	</dependencies>
-</project>

+ 0 - 36
yyc-common-swagger/src/main/java/com/qunzhixinxi/hnqz/common/swagger/annotation/EnableHnqzSwagger2.java

@@ -1,36 +0,0 @@
-/*
- *    Copyright (c) 2018-2025, hnqz 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: hnqz
- */
-
-package net.yyc.common.swagger.annotation;
-
-import net.yyc.common.swagger.config.SwaggerAutoConfiguration;
-import org.springframework.context.annotation.Import;
-
-import java.lang.annotation.*;
-
-/**
- * @author hnqz
- * @date 2018/7/21 开启hnqz swagger
- */
-@Target({ ElementType.TYPE })
-@Retention(RetentionPolicy.RUNTIME)
-@Documented
-@Inherited
-@Import({ SwaggerAutoConfiguration.class })
-public @interface EnableHnqzSwagger2 {
-
-}

+ 0 - 143
yyc-common-swagger/src/main/java/com/qunzhixinxi/hnqz/common/swagger/config/SwaggerAutoConfiguration.java

@@ -1,143 +0,0 @@
-/*
- *    Copyright (c) 2018-2025, hnqz 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: hnqz
- */
-package net.yyc.common.swagger.config;
-
-import com.google.common.base.Predicate;
-import com.google.common.base.Predicates;
-import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import springfox.documentation.builders.ApiInfoBuilder;
-import springfox.documentation.builders.ParameterBuilder;
-import springfox.documentation.builders.PathSelectors;
-import springfox.documentation.builders.RequestHandlerSelectors;
-import springfox.documentation.schema.ModelRef;
-import springfox.documentation.service.*;
-import springfox.documentation.spi.DocumentationType;
-import springfox.documentation.spi.service.contexts.SecurityContext;
-import springfox.documentation.spring.web.plugins.Docket;
-import springfox.documentation.swagger2.annotations.EnableSwagger2;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-
-/**
- * @author hnqz swagger配置 禁用方法1:使用注解@Profile({"dev","test"})
- * 表示在开发或测试环境开启,而在生产关闭。(推荐使用) 禁用方法2:使用注解@ConditionalOnProperty(name = "swagger.enable",
- * havingValue = "true") 然后在测试配置或者开发配置中添加swagger.enable=true即可开启,生产环境不填则默认关闭Swagger.
- */
-@Configuration
-@EnableSwagger2
-@EnableAutoConfiguration
-@ConditionalOnProperty(name = "swagger.enabled", matchIfMissing = true)
-public class SwaggerAutoConfiguration {
-
-	/**
-	 * 默认的排除路径,排除Spring Boot默认的错误处理路径和端点
-	 */
-	private static final List<String> DEFAULT_EXCLUDE_PATH = Arrays.asList("/error", "/actuator/**");
-
-	private static final String BASE_PATH = "/**";
-
-	@Bean
-	@ConditionalOnMissingBean
-	public SwaggerProperties swaggerProperties() {
-		return new SwaggerProperties();
-	}
-
-	@Bean
-	public Docket api(SwaggerProperties swaggerProperties) {
-		// base-path处理
-		if (swaggerProperties.getBasePath().isEmpty()) {
-			swaggerProperties.getBasePath().add(BASE_PATH);
-		}
-		// noinspection unchecked
-		List<Predicate<String>> basePath = new ArrayList();
-		swaggerProperties.getBasePath().forEach(path -> basePath.add(PathSelectors.ant(path)));
-
-		// exclude-path处理
-		if (swaggerProperties.getExcludePath().isEmpty()) {
-			swaggerProperties.getExcludePath().addAll(DEFAULT_EXCLUDE_PATH);
-		}
-		List<Predicate<String>> excludePath = new ArrayList<>();
-		swaggerProperties.getExcludePath().forEach(path -> excludePath.add(PathSelectors.ant(path)));
-
-		// 版本请求头处理
-		ParameterBuilder versionPar = new ParameterBuilder();
-		List<Parameter> pars = new ArrayList<>();
-		versionPar.name("VERSION").description("灰度路由版本信息").modelRef(new ModelRef("string")).parameterType("header")
-				.required(false).build();
-		pars.add(versionPar.build());
-
-		// noinspection Guava
-		return new Docket(DocumentationType.SWAGGER_2).host(swaggerProperties.getHost())
-				.apiInfo(apiInfo(swaggerProperties)).globalOperationParameters(pars).select()
-				.apis(RequestHandlerSelectors.basePackage(swaggerProperties.getBasePackage()))
-				.paths(Predicates.and(Predicates.not(Predicates.or(excludePath)), Predicates.or(basePath))).build()
-				.securitySchemes(Collections.singletonList(securitySchema()))
-				.securityContexts(Collections.singletonList(securityContext())).pathMapping("/");
-	}
-
-	/**
-	 * 配置默认的全局鉴权策略的开关,通过正则表达式进行匹配;默认匹配所有URL
-	 * @return
-	 */
-	private SecurityContext securityContext() {
-		return SecurityContext.builder().securityReferences(defaultAuth())
-				.forPaths(PathSelectors.regex(swaggerProperties().getAuthorization().getAuthRegex())).build();
-	}
-
-	/**
-	 * 默认的全局鉴权策略
-	 * @return
-	 */
-	private List<SecurityReference> defaultAuth() {
-		ArrayList<AuthorizationScope> authorizationScopeList = new ArrayList<>();
-		swaggerProperties().getAuthorization().getAuthorizationScopeList()
-				.forEach(authorizationScope -> authorizationScopeList.add(
-						new AuthorizationScope(authorizationScope.getScope(), authorizationScope.getDescription())));
-		AuthorizationScope[] authorizationScopes = new AuthorizationScope[authorizationScopeList.size()];
-		return Collections
-				.singletonList(SecurityReference.builder().reference(swaggerProperties().getAuthorization().getName())
-						.scopes(authorizationScopeList.toArray(authorizationScopes)).build());
-	}
-
-	private OAuth securitySchema() {
-		ArrayList<AuthorizationScope> authorizationScopeList = new ArrayList<>();
-		swaggerProperties().getAuthorization().getAuthorizationScopeList()
-				.forEach(authorizationScope -> authorizationScopeList.add(
-						new AuthorizationScope(authorizationScope.getScope(), authorizationScope.getDescription())));
-		ArrayList<GrantType> grantTypes = new ArrayList<>();
-		swaggerProperties().getAuthorization().getTokenUrlList()
-				.forEach(tokenUrl -> grantTypes.add(new ResourceOwnerPasswordCredentialsGrant(tokenUrl)));
-		return new OAuth(swaggerProperties().getAuthorization().getName(), authorizationScopeList, grantTypes);
-	}
-
-	private ApiInfo apiInfo(SwaggerProperties swaggerProperties) {
-		return new ApiInfoBuilder().title(swaggerProperties.getTitle()).description(swaggerProperties.getDescription())
-				.license(swaggerProperties.getLicense()).licenseUrl(swaggerProperties.getLicenseUrl())
-				.termsOfServiceUrl(swaggerProperties.getTermsOfServiceUrl())
-				.contact(new Contact(swaggerProperties.getContact().getName(), swaggerProperties.getContact().getUrl(),
-						swaggerProperties.getContact().getEmail()))
-				.version(swaggerProperties.getVersion()).build();
-	}
-
-}

+ 0 - 161
yyc-common-swagger/src/main/java/com/qunzhixinxi/hnqz/common/swagger/config/SwaggerProperties.java

@@ -1,161 +0,0 @@
-/*
- *    Copyright (c) 2018-2025, hnqz 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: hnqz
- */
-package net.yyc.common.swagger.config;
-
-import lombok.Data;
-import lombok.NoArgsConstructor;
-import org.springframework.boot.context.properties.ConfigurationProperties;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * SwaggerProperties
- *
- * @author: hnqz
- * @date: 2018/7/25 14:00
- */
-@Data
-@ConfigurationProperties("swagger")
-public class SwaggerProperties {
-
-	/**
-	 * 是否开启swagger
-	 */
-	private Boolean enabled;
-
-	/**
-	 * swagger会解析的包路径
-	 **/
-	private String basePackage = "";
-
-	/**
-	 * swagger会解析的url规则
-	 **/
-	private List<String> basePath = new ArrayList<>();
-
-	/**
-	 * 在basePath基础上需要排除的url规则
-	 **/
-	private List<String> excludePath = new ArrayList<>();
-
-	/**
-	 * 标题
-	 **/
-	private String title = "";
-
-	/**
-	 * 描述
-	 **/
-	private String description = "";
-
-	/**
-	 * 版本
-	 **/
-	private String version = "";
-
-	/**
-	 * 许可证
-	 **/
-	private String license = "";
-
-	/**
-	 * 许可证URL
-	 **/
-	private String licenseUrl = "";
-
-	/**
-	 * 服务条款URL
-	 **/
-	private String termsOfServiceUrl = "";
-
-	/**
-	 * host信息
-	 **/
-	private String host = "";
-
-	/**
-	 * 联系人信息
-	 */
-	private Contact contact = new Contact();
-
-	/**
-	 * 全局统一鉴权配置
-	 **/
-	private Authorization authorization = new Authorization();
-
-	@Data
-	@NoArgsConstructor
-	public static class Contact {
-
-		/**
-		 * 联系人
-		 **/
-		private String name = "";
-
-		/**
-		 * 联系人url
-		 **/
-		private String url = "";
-
-		/**
-		 * 联系人email
-		 **/
-		private String email = "";
-
-	}
-
-	@Data
-	@NoArgsConstructor
-	public static class Authorization {
-
-		/**
-		 * 鉴权策略ID,需要和SecurityReferences ID保持一致
-		 */
-		private String name = "";
-
-		/**
-		 * 需要开启鉴权URL的正则
-		 */
-		private String authRegex = "^.*$";
-
-		/**
-		 * 鉴权作用域列表
-		 */
-		private List<AuthorizationScope> authorizationScopeList = new ArrayList<>();
-
-		private List<String> tokenUrlList = new ArrayList<>();
-
-	}
-
-	@Data
-	@NoArgsConstructor
-	public static class AuthorizationScope {
-
-		/**
-		 * 作用域名称
-		 */
-		private String scope = "";
-
-		/**
-		 * 作用域描述
-		 */
-		private String description = "";
-
-	}
-
-}

BIN
yyc-common-taxhelper/target/classes/com/logosdata/security/SM2.class


BIN
yyc-common-taxhelper/target/classes/com/logosdata/security/SM3.class


BIN
yyc-common-taxhelper/target/classes/com/logosdata/security/SM4.class


BIN
yyc-common-taxhelper/target/classes/com/logosdata/security/util/NumberTool.class


BIN
yyc-common-taxhelper/target/classes/com/logosdata/security/util/SM4Base.class


BIN
yyc-common-taxhelper/target/classes/com/logosdata/security/util/SignUtils.class


BIN
yyc-common-taxhelper/target/classes/com/logosdata/security/util/StreamTool.class


+ 0 - 51
yyc-common-transaction/pom.xml

@@ -1,51 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-		 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-	<modelVersion>4.0.0</modelVersion>
-	<parent>
-		<groupId>net.yyc.common</groupId>
-		<artifactId>yyc-common-parent</artifactId>
-		<version>1.0.0-SNAPSHOT</version>
-	</parent>
-
-	<artifactId>yyc-common-transaction</artifactId>
-	<packaging>jar</packaging>
-
-	<description>hnqz lcn transaction</description>
-
-	<dependencies>
-		<dependency>
-			<groupId>net.yyc.common</groupId>
-			<artifactId>yyc-common-core</artifactId>
-		</dependency>
-		<!--lcn 模块端控制依赖-->
-		<dependency>
-			<groupId>com.codingapi</groupId>
-			<artifactId>tx-client</artifactId>
-			<version>${lcn.version}</version>
-			<exclusions>
-				<exclusion>
-					<groupId>org.slf4j</groupId>
-					<artifactId>*</artifactId>
-				</exclusion>
-			</exclusions>
-		</dependency>
-		<dependency>
-			<groupId>com.codingapi</groupId>
-			<artifactId>tx-plugins-db</artifactId>
-			<version>${lcn.version}</version>
-			<exclusions>
-				<exclusion>
-					<groupId>org.slf4j</groupId>
-					<artifactId>*</artifactId>
-				</exclusion>
-			</exclusions>
-		</dependency>
-		<!--feign 依赖-->
-		<dependency>
-			<groupId>org.springframework.cloud</groupId>
-			<artifactId>spring-cloud-starter-openfeign</artifactId>
-		</dependency>
-
-	</dependencies>
-</project>

+ 0 - 33
yyc-common-transaction/src/main/java/com/qunzhixinxi/hnqz/common/transaction/TransactionConfiguration.java

@@ -1,33 +0,0 @@
-/*
- *    Copyright (c) 2018-2025, hnqz 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: hnqz
- */
-
-package net.yyc.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", "net.yyc.common.transaction" })
-public class TransactionConfiguration {
-
-}

+ 0 - 6
yyc-common-transaction/src/main/java/com/qunzhixinxi/hnqz/common/transaction/pack-info.md

@@ -1,6 +0,0 @@
-由于LCN 暂未发布适配 2.0 版本  
-当前包是根据TCN transaction-springcloud 模块修改而来  
-解决LCN 不兼容 Spring Cloud Finchley 问题
-
-关于LCN  
-https://github.com/codingapi/tx-lcn

+ 0 - 47
yyc-common-transaction/src/main/java/com/qunzhixinxi/hnqz/common/transaction/rewrite/TxManagerHttpRequestServiceImpl.java

@@ -1,47 +0,0 @@
-/*
- *    Copyright (c) 2018-2025, hnqz 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: hnqz
- */
-
-package net.yyc.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 hnqz
- * @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;
-	}
-
-}

+ 0 - 49
yyc-common-transaction/src/main/java/com/qunzhixinxi/hnqz/common/transaction/rewrite/TxManagerTxUrlServiceImpl.java

@@ -1,49 +0,0 @@
-/*
- *    Copyright (c) 2018-2025, hnqz 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: hnqz
- */
-
-package net.yyc.common.transaction.rewrite;
-
-import com.codingapi.tx.config.service.TxManagerTxUrlService;
-import net.yyc.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 hnqz
- * @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;
-	}
-
-}

+ 0 - 38
yyc-common-transaction/src/main/java/com/qunzhixinxi/hnqz/common/transaction/tx/RequestInterceptorConfiguration.java

@@ -1,38 +0,0 @@
-/*
- *    Copyright (c) 2018-2025, hnqz 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: hnqz
- */
-
-package net.yyc.common.transaction.tx;
-
-import net.yyc.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();
-	}
-
-}

+ 0 - 46
yyc-common-transaction/src/main/java/com/qunzhixinxi/hnqz/common/transaction/tx/springcloud/feign/TransactionRestTemplateInterceptor.java

@@ -1,46 +0,0 @@
-/*
- *    Copyright (c) 2018-2025, hnqz 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: hnqz
- */
-
-package net.yyc.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);
-		}
-	}
-
-}

+ 0 - 51
yyc-common-transaction/src/main/java/com/qunzhixinxi/hnqz/common/transaction/tx/springcloud/http/TransactionHttpRequestInterceptor.java

@@ -1,51 +0,0 @@
-/*
- *    Copyright (c) 2018-2025, hnqz 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: hnqz
- */
-
-package net.yyc.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);
-	}
-
-}

+ 0 - 68
yyc-common-transaction/src/main/java/com/qunzhixinxi/hnqz/common/transaction/tx/springcloud/interceptor/TransactionAspect.java

@@ -1,68 +0,0 @@
-/*
- *    Copyright (c) 2018-2025, hnqz 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: hnqz
- */
-
-package net.yyc.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;
-	}
-
-}

+ 0 - 60
yyc-common-transaction/src/main/java/com/qunzhixinxi/hnqz/common/transaction/tx/springcloud/interceptor/TxManagerInterceptor.java

@@ -1,60 +0,0 @@
-/*
- *    Copyright (c) 2018-2025, hnqz 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: hnqz
- */
-
-package net.yyc.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);
-	}
-
-}

+ 0 - 53
yyc-common-transaction/src/main/java/com/qunzhixinxi/hnqz/common/transaction/tx/springcloud/listener/ServerListener.java

@@ -1,53 +0,0 @@
-/*
- *    Copyright (c) 2018-2025, hnqz 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: hnqz
- */
-
-package net.yyc.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<WebServerInitializedEvent> {
-
-	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;
-	}
-
-}

+ 0 - 98
yyc-common-transaction/src/main/java/com/qunzhixinxi/hnqz/common/transaction/tx/springcloud/service/impl/ModelNameServiceImpl.java

@@ -1,98 +0,0 @@
-/*
- *    Copyright (c) 2018-2025, hnqz 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: hnqz
- */
-
-package net.yyc.common.transaction.tx.springcloud.service.impl;
-
-import com.codingapi.tx.listener.service.ModelNameService;
-import com.lorne.core.framework.utils.encode.MD5Util;
-import net.yyc.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;
-	}
-
-}

+ 0 - 1
yyc-common-transaction/src/main/resources/META-INF/spring.factories

@@ -1 +0,0 @@
-org.springframework.boot.autoconfigure.EnableAutoConfiguration=net.yyc.common.transaction.TransactionConfiguration