New file |
| | |
| | | package com.stylefeng.guns.modular.system.util.zhenglian; |
| | | |
| | | import lombok.Data; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/7/8 11:31 |
| | | */ |
| | | @Data |
| | | @Component |
| | | public class ZhengLianConfig { |
| | | |
| | | @Value("${spring.profiles.active}") |
| | | private String activeProfile; |
| | | /** |
| | | * 接口地址 |
| | | */ |
| | | private String url; |
| | | /** |
| | | * appid |
| | | */ |
| | | private String appid; |
| | | /** |
| | | * 商户号 |
| | | */ |
| | | private String merchNo; |
| | | /** |
| | | * 加密证书序列号 |
| | | */ |
| | | private String encrpNo; |
| | | /** |
| | | * 签名证书序列号 |
| | | */ |
| | | private String signNo; |
| | | |
| | | /** |
| | | * 获取不同环境的配置 |
| | | * @return |
| | | */ |
| | | public ZhengLianConfig getZhengLianConfig() { |
| | | if("dev".equals(activeProfile)){ |
| | | this.url = "https://gatewaytest.zqpay.com"; |
| | | this.appid = "F9BFEEA567196A92E053376010ACF004"; |
| | | this.merchNo = "B00000871"; |
| | | this.encrpNo = "123456"; |
| | | this.signNo = "123456"; |
| | | } |
| | | if("test".equals(activeProfile)){ |
| | | this.url = "https://gatewaytest.zqpay.com"; |
| | | this.appid = "F9BFEEA567196A92E053376010ACF004"; |
| | | this.merchNo = "B00000871"; |
| | | this.encrpNo = "123456"; |
| | | this.signNo = "123456"; |
| | | } |
| | | if("prod".equals(activeProfile)){ |
| | | this.url = "https://gateway.zqpay.com"; |
| | | this.appid = ""; |
| | | this.merchNo = ""; |
| | | this.encrpNo = ""; |
| | | this.signNo = ""; |
| | | } |
| | | return this; |
| | | } |
| | | |
| | | } |