From 469607fef066aa8c3363f124405588e4a2368a7e Mon Sep 17 00:00:00 2001 From: caiyuchao Date: Fri, 10 Jan 2025 15:46:39 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=94=AF=E4=BB=98=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wfc/payment/WfcPaymentApplication.java | 2 - .../config/UnionPayServiceConfig.java | 2 +- .../controller/UnionPayController.java | 2 +- .../payment/wxpay/config/SwaggerConfig.java | 49 ------ .../src/main/resources/application.yml | 159 ++++++++---------- 5 files changed, 69 insertions(+), 145 deletions(-) delete mode 100644 wfc-modules/wfc-payment/src/main/java/org/wfc/payment/wxpay/config/SwaggerConfig.java diff --git a/wfc-modules/wfc-payment/src/main/java/org/wfc/payment/WfcPaymentApplication.java b/wfc-modules/wfc-payment/src/main/java/org/wfc/payment/WfcPaymentApplication.java index 9478241..09226d8 100644 --- a/wfc-modules/wfc-payment/src/main/java/org/wfc/payment/WfcPaymentApplication.java +++ b/wfc-modules/wfc-payment/src/main/java/org/wfc/payment/WfcPaymentApplication.java @@ -22,8 +22,6 @@ import org.wfc.payment.ccpay.config.CcpayConfig; @EnableCustomConfig @EnableRyFeignClients @SpringBootApplication -@ComponentScan(basePackages = {"org.wfc.payment"}) -@ConfigurationPropertiesScan("org.wfc.payment") public class WfcPaymentApplication { private static final Logger logger = LoggerFactory.getLogger(WfcPaymentApplication.class); diff --git a/wfc-modules/wfc-payment/src/main/java/org/wfc/payment/unionpay/config/UnionPayServiceConfig.java b/wfc-modules/wfc-payment/src/main/java/org/wfc/payment/unionpay/config/UnionPayServiceConfig.java index 1d078b8..d34c275 100644 --- a/wfc-modules/wfc-payment/src/main/java/org/wfc/payment/unionpay/config/UnionPayServiceConfig.java +++ b/wfc-modules/wfc-payment/src/main/java/org/wfc/payment/unionpay/config/UnionPayServiceConfig.java @@ -7,7 +7,7 @@ import org.springframework.context.annotation.Configuration; import com.egzosn.pay.common.util.sign.SignUtils; import com.egzosn.pay.common.bean.CertStoreType; -@Configuration +//@Configuration public class UnionPayServiceConfig { private final UnionPayConfig unionPayConfig; diff --git a/wfc-modules/wfc-payment/src/main/java/org/wfc/payment/unionpay/controller/UnionPayController.java b/wfc-modules/wfc-payment/src/main/java/org/wfc/payment/unionpay/controller/UnionPayController.java index 9ccc74a..d879ec8 100644 --- a/wfc-modules/wfc-payment/src/main/java/org/wfc/payment/unionpay/controller/UnionPayController.java +++ b/wfc-modules/wfc-payment/src/main/java/org/wfc/payment/unionpay/controller/UnionPayController.java @@ -37,7 +37,7 @@ import org.wfc.payment.unionpay.config.UnionPayConfig; * Union pay controller * */ -@RestController +//@RestController @RequestMapping("unionpay") public class UnionPayController { diff --git a/wfc-modules/wfc-payment/src/main/java/org/wfc/payment/wxpay/config/SwaggerConfig.java b/wfc-modules/wfc-payment/src/main/java/org/wfc/payment/wxpay/config/SwaggerConfig.java deleted file mode 100644 index 4cbff23..0000000 --- a/wfc-modules/wfc-payment/src/main/java/org/wfc/payment/wxpay/config/SwaggerConfig.java +++ /dev/null @@ -1,49 +0,0 @@ -package org.wfc.payment.wxpay.config; - -import lombok.extern.slf4j.Slf4j; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport; -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.info.Contact; -import io.swagger.v3.oas.models.info.Info; -import io.swagger.v3.oas.models.info.License; - -import org.springdoc.core.GroupedOpenApi; - -@Configuration -@Slf4j -public class SwaggerConfig extends WebMvcConfigurationSupport { - @Override - public void addResourceHandlers(ResourceHandlerRegistry registry) { - registry.addResourceHandler("swagger-ui.html") - .addResourceLocations("classpath:/META-INF/resources/"); - - registry.addResourceHandler("/webjars/**") - .addResourceLocations("classpath:/META-INF/resources/webjars/"); - super.addResourceHandlers(registry); - } - - @Bean - public GroupedOpenApi publicApi() { - return GroupedOpenApi.builder() - .group("public") - .pathsToMatch("/payment/**") - .packagesToScan("org.wfc.payment.wxpay.controller") - .build(); - } - - @Bean - public OpenAPI customOpenAPI() { - return new OpenAPI() - .openapi("3.0.0") - .info(new Info() - .title("WeChat Pay API") - .version("1.0.0") - .description("WeChat Pay API for Java") - .termsOfService("http://swagger.io/terms/") - .contact(new Contact().name("API Support").url("http://www.wfc.vip/support").email("support@wfc.com")) - .license(new License().name("wfc 1.0").url("http://springdoc.org"))); - } -} \ No newline at end of file diff --git a/wfc-modules/wfc-payment/src/main/resources/application.yml b/wfc-modules/wfc-payment/src/main/resources/application.yml index 4dee56b..ef29c56 100644 --- a/wfc-modules/wfc-payment/src/main/resources/application.yml +++ b/wfc-modules/wfc-payment/src/main/resources/application.yml @@ -1,14 +1,5 @@ # spring配置 spring: - application: - name: wfc-payment - cloud: - nacos: - discovery: - server-addr: ${NACOS_SERVER_ADDR:wfc-nacos}:${NACOS_SERVER_PORT:8848} - namespace: ${NACOS_NAME_SPACE:wfc-prod} - main: - allow-bean-definition-overriding: true redis: host: wfc-redis @@ -55,7 +46,7 @@ spring: # mybatis-plus配置 mybatis-plus: # 搜索指定包别名 - type-aliases-package: org.wfc.payment.*.model + type-aliases-package: org.wfc.payment # 配置mapper的扫描,找到所有的mapper.xml映射文件 mapper-locations: classpath:mapper/**/*.xml global-config: @@ -64,92 +55,76 @@ mybatis-plus: logic-delete-value: 1 logic-not-delete-value: 0 -# swagger configuration -swagger: - title: payment modules api - license: Powered By wfc - licenseUrl: https://wfc.vip - -logging: - level: - root: info - org.springframework.web: info - org.mybatis.mapper: debug - com.github.binarywang: debug - org.wfc.payment.wxpay: debug - org.wfc.payment.alipay: debug - org.wfc.payment.ccpay: debug - wxpay: - appId: 121412414112 - mchId: 1131412414 - mchKey: 1525342aa - subAppId: #服务商模式下的子商户公众账号ID - subMchId: #服务商模式下的子商户号 - keyPath: /opt/wfc/conf/wxpay/wxpay_key.pem - useSandboxEnv: false + appId: 121412414112 + mchId: 1131412414 + mchKey: 1525342aa + subAppId: #服务商模式下的子商户公众账号ID + subMchId: #服务商模式下的子商户号 + keyPath: /opt/wfc/conf/wxpay/wxpay_key.pem + useSandboxEnv: false alipay: - appId: 121412414112 - privateKey: 1131412414 - publicKey: 1525342aa - notifyUrl: http://wfc-gateway:${GATEWAY_SERVER_PORT:8080}/alipay/notify - returnUrl: http://wfc-gateway:${GATEWAY_SERVER_PORT:8080}/alipay/return - signType: RSA2 - charset: utf-8 - gatewayUrl: https://openapi.alipaydev.com/gateway.do - logPath: /opt/wfc/logs/alipay/alipay.log - maxQueryRetry: 5 - queryDuration: 5 - maxCancelRetry: 3 - cancelDuration: 2 - heartbeatDelay: 5 - heartbeatDuration: 5 - storeId: - storeName: - supportEmail: - supportPhone: + appId: 121412414112 + privateKey: 1131412414 + publicKey: 1525342aa + notifyUrl: http://wfc-gateway:${GATEWAY_SERVER_PORT:8080}/alipay/notify + returnUrl: http://wfc-gateway:${GATEWAY_SERVER_PORT:8080}/alipay/return + signType: RSA2 + charset: utf-8 + gatewayUrl: https://openapi.alipaydev.com/gateway.do + logPath: /opt/wfc/logs/alipay/alipay.log + maxQueryRetry: 5 + queryDuration: 5 + maxCancelRetry: 3 + cancelDuration: 2 + heartbeatDelay: 5 + heartbeatDuration: 5 + storeId: + storeName: + supportEmail: + supportPhone: ccpay: - paymentUrl: https://api.paymentgateway.com/v1/payment - tokenUrl: https://api.paymentgateway.com/v1/token - queryUrl: https://api.paymentgateway.com/v1/query - refundUrl: https://api.paymentgateway.com/v1/refund - apiKey: api-key - merchantId: merchant-id - currency: USD - timeout: 30 - callbackUrl: https://wfc-gateway:${GATEWAY_SERVER_PORT:8080}/payment/callback + paymentUrl: https://api.paymentgateway.com/v1/payment + tokenUrl: https://api.paymentgateway.com/v1/token + queryUrl: https://api.paymentgateway.com/v1/query + refundUrl: https://api.paymentgateway.com/v1/refund + apiKey: api-key + merchantId: merchant-id + currency: USD + timeout: 30 + callbackUrl: https://wfc-gateway:${GATEWAY_SERVER_PORT:8080}/payment/callback unionpay: - merId: 700000000000001 - keyPrivateCert: /opt/wfc/conf/cert/unionpay/wfc-union.pfx - keyPrivateCertPwd: 123456 - signCertType: PKCS12 - encryptCertPath: /opt/wfc/conf/cert/unionpay/wfc-union.cer - acpMiddleCert: /opt/wfc/conf/cert/unionpay/wfc-middle.cer - acpRootCert: /opt/wfc/conf/cert/unionpay/wfc-root.cer - frontUrl: https://gateway.test.95516.com/gateway/api/frontTransReq.do - backUrl: http://wfc-gateway:${GATEWAY_SERVER_PORT:8080}/unionpay/notify - signMethod: 01 - version: 5.1.0 - channelType: 07 - accessType: 0 - currencyCode: 156 - bizType: 000201 - txnType: 01 - txnSubType: 01 - payTimeout: 30 - queryTimeout: 30 - refundTimeout: 30 - frontFailUrl: http://wfc-gateway:${GATEWAY_SERVER_PORT:8080}/unionpay/fail - frontSuccessUrl: http://wfc-gateway:${GATEWAY_SERVER_PORT:8080}/unionpay/success - frontBackUrl: http://wfc-gateway:${GATEWAY_SERVER_PORT:8080}/unionpay/front - backBackUrl: http://wfc-gateway:${GATEWAY_SERVER_PORT:8080}/unionpay/back - frontNotifyUrl: http://wfc-gateway:${GATEWAY_SERVER_PORT:8080}/unionpay/front/notify - backNotifyUrl: http://wfc-gateway:${GATEWAY_SERVER_PORT:8080}/unionpay/back/notify - refundNotifyUrl: http://wfc-gateway:${GATEWAY_SERVER_PORT:8080}/unionpay/refund/notify - queryNotifyUrl: http://wfc-gateway:${GATEWAY_SERVER_PORT:8080}/unionpay/query/notify - refundSuccessUrl: http://wfc-gateway:${GATEWAY_SERVER_PORT:8080}/unionpay/refund/success - refundFailUrl: http://wfc-gateway:${GATEWAY_SERVER_PORT:8080}/unionpay/refund/fail - querySuccessUrl: \ No newline at end of file + merId: 700000000000001 + keyPrivateCert: /opt/wfc/conf/cert/unionpay/wfc-union.pfx + keyPrivateCertPwd: 123456 + signCertType: PKCS12 + encryptCertPath: /opt/wfc/conf/cert/unionpay/wfc-union.cer + acpMiddleCert: /opt/wfc/conf/cert/unionpay/wfc-middle.cer + acpRootCert: /opt/wfc/conf/cert/unionpay/wfc-root.cer + frontUrl: https://gateway.test.95516.com/gateway/api/frontTransReq.do + backUrl: http://wfc-gateway:${GATEWAY_SERVER_PORT:8080}/unionpay/notify + signMethod: 01 + version: 5.1.0 + channelType: 07 + accessType: 0 + currencyCode: 156 + bizType: 000201 + txnType: 01 + txnSubType: 01 + payTimeout: 30 + queryTimeout: 30 + refundTimeout: 30 + frontFailUrl: http://wfc-gateway:${GATEWAY_SERVER_PORT:8080}/unionpay/fail + frontSuccessUrl: http://wfc-gateway:${GATEWAY_SERVER_PORT:8080}/unionpay/success + frontBackUrl: http://wfc-gateway:${GATEWAY_SERVER_PORT:8080}/unionpay/front + backBackUrl: http://wfc-gateway:${GATEWAY_SERVER_PORT:8080}/unionpay/back + frontNotifyUrl: http://wfc-gateway:${GATEWAY_SERVER_PORT:8080}/unionpay/front/notify + backNotifyUrl: http://wfc-gateway:${GATEWAY_SERVER_PORT:8080}/unionpay/back/notify + refundNotifyUrl: http://wfc-gateway:${GATEWAY_SERVER_PORT:8080}/unionpay/refund/notify + queryNotifyUrl: http://wfc-gateway:${GATEWAY_SERVER_PORT:8080}/unionpay/query/notify + refundSuccessUrl: http://wfc-gateway:${GATEWAY_SERVER_PORT:8080}/unionpay/refund/success + refundFailUrl: http://wfc-gateway:${GATEWAY_SERVER_PORT:8080}/unionpay/refund/fail + querySuccessUrl: \ No newline at end of file