liujie
5 天以前 dda9ffb76b585bb5bcf5282def424999448fa915
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
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;
    /**
     * 证书
     */
    private String cer;
    /**
     * 证书
     */
    private String sm2;
    /**
     *
     */
    private String password;
    
    /**
     * 获取不同环境的配置
     * @return
     */
    public ZhengLianConfig getZhengLianConfig() {
        if("dev".equals(activeProfile)){
            this.url = "https://gatewaytest.zqpay.com";
            this.appid = "F9BFEEA567196A92E053376010ACF004";
            this.merchNo = "B00000871";
            this.encrpNo = "1055490595";
            this.signNo = "1066348524";
            this.cer = "C:\\Users\\39373\\Desktop\\UAT-demo-公用\\1055490595.cer";
            this.sm2 = "C:\\Users\\39373\\Desktop\\UAT-demo-公用\\871_111111.sm2";
            this.password = "111111";
        }
        if("test".equals(activeProfile)){
            this.url = "https://gatewaytest.zqpay.com";
            this.appid = "F9BFEEA567196A92E053376010ACF004";
            this.merchNo = "B00000871";
            this.encrpNo = "1055490595";
            this.signNo = "1066348524";
            this.cer = "C:\\Users\\39373\\Desktop\\UAT-demo-公用\\1055490595.cer";
            this.sm2 = "C:\\Users\\39373\\Desktop\\UAT-demo-公用\\871_111111.sm2";
            this.password = "111111";
        }
        if("prod".equals(activeProfile)){
            this.url = "https://gateway.zqpay.com";
            this.appid = "";
            this.merchNo = "";
            this.encrpNo = "";
            this.signNo = "";
            this.cer = "";
            this.sm2 = "";
            this.password = "";
        }
        return this;
    }
    
}