java110
2023-01-30 a31e79f8a020cdcfa7105a11d907abe7e4e3cfff
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
package com.java110.boot.properties;
 
 
import com.java110.utils.cache.MappingCache;
import com.java110.utils.constant.MappingConstant;
import com.java110.utils.constant.WechatConstant;
import com.java110.utils.util.StringUtil;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;
 
@Component
@ConfigurationProperties(prefix = "java110.auth.wechat")
@PropertySource("classpath:wechatAuth.properties")
public class WechatAuthProperties {
 
    //微信支付类型
//NATIVE--原生支付
//JSAPI--公众号支付-小程序支付
//MWEB--H5支付
//APP -- app支付
    public static final String TRADE_TYPE_NATIVE = "NATIVE";
    public static final String TRADE_TYPE_JSAPI = "JSAPI";
    public static final String TRADE_TYPE_MWEB = "MWEB";
    public static final String TRADE_TYPE_APP = "APP";
 
    private String sessionHost;
    private String appId;
    private String secret;
    private String grantType;
    private String key;
    private String mchId;
    private String wxPayUnifiedOrder;
    private String wxNotifyUrl;
    private String rentingNotifyUrl;
    private String goodsNotifyUrl;
    private String oweFeeNotifyUrl;
    private String tempCarFeeNotifyUrl;
 
 
    private String wechatAppId;//微信公众号ID
    private String wechatAppSecret;//微信公众号秘钥
 
    private String sendMsgUrl;//微信公众号推送模板信息链接
 
    public String getSessionHost() {
        return sessionHost;
    }
 
    public void setSessionHost(String sessionHost) {
        this.sessionHost = sessionHost;
    }
 
    public String getAppId() {
        String appIdCache = MappingCache.getValue(WechatConstant.WECHAT_DOMAIN, "appId");
        if (!StringUtil.isEmpty(appIdCache)) {
            return appIdCache;
        }
        return appId;
    }
 
    public void setAppId(String appId) {
        this.appId = appId;
    }
 
    public String getSecret() {
 
        String appSecretCache = MappingCache.getValue(WechatConstant.WECHAT_DOMAIN, "appSecret");
        if (!StringUtil.isEmpty(appSecretCache)) {
            return appSecretCache;
        }
        return secret;
    }
 
    public void setSecret(String secret) {
        this.secret = secret;
    }
 
    public String getGrantType() {
        return grantType;
    }
 
    public void setGrantType(String grantType) {
        this.grantType = grantType;
    }
 
    public String getKey() {
        String keyCache = MappingCache.getValue(MappingConstant.WECHAT_STORE_DOMAIN, "key");
        if (!StringUtil.isEmpty(keyCache)) {
            return keyCache;
        }
        return key;
    }
 
    public void setKey(String key) {
 
        this.key = key;
    }
 
    public String getMchId() {
        String mchIdCache = MappingCache.getValue(MappingConstant.WECHAT_STORE_DOMAIN, "mchId");
        if (!StringUtil.isEmpty(mchIdCache)) {
            return mchIdCache;
        }
        return mchId;
    }
 
    public void setMchId(String mchId) {
        this.mchId = mchId;
    }
 
    public String getWxPayUnifiedOrder() {
        return wxPayUnifiedOrder;
    }
 
    public void setWxPayUnifiedOrder(String wxPayUnifiedOrder) {
        this.wxPayUnifiedOrder = wxPayUnifiedOrder;
    }
 
    public String getWxNotifyUrl() {
        String wxNotifyUrlCache = MappingCache.getValue(WechatConstant.WECHAT_DOMAIN, "wxNotifyUrl");
        if (!StringUtil.isEmpty(wxNotifyUrlCache)) {
            return wxNotifyUrlCache;
        }
        return wxNotifyUrl;
    }
 
    public void setWxNotifyUrl(String wxNotifyUrl) {
        this.wxNotifyUrl = wxNotifyUrl;
    }
 
    public String getWechatAppId() {
        String wechatAppIdCache = MappingCache.getValue(WechatConstant.WECHAT_DOMAIN, "wechatAppId");
        if (!StringUtil.isEmpty(wechatAppIdCache)) {
            return wechatAppIdCache;
        }
        return wechatAppId;
    }
 
    public void setWechatAppId(String wechatAppId) {
        this.wechatAppId = wechatAppId;
    }
 
    public String getWechatAppSecret() {
        String wechatAppSecretCache = MappingCache.getValue(WechatConstant.WECHAT_DOMAIN, "wechatAppSecret");
        if (!StringUtil.isEmpty(wechatAppSecretCache)) {
            return wechatAppSecretCache;
        }
        return wechatAppSecret;
    }
 
    public void setWechatAppSecret(String wechatAppSecret) {
        this.wechatAppSecret = wechatAppSecret;
    }
 
    public String getSendMsgUrl() {
        return sendMsgUrl;
    }
 
    public void setSendMsgUrl(String sendMsgUrl) {
        this.sendMsgUrl = sendMsgUrl;
    }
 
    public String getRentingNotifyUrl() {
        String rentingNotifyUrlCache = MappingCache.getValue(WechatConstant.WECHAT_DOMAIN, "rentingNotifyUrl");
        if (!StringUtil.isEmpty(rentingNotifyUrlCache)) {
            return rentingNotifyUrlCache;
        }
        return rentingNotifyUrl;
    }
 
    public void setRentingNotifyUrl(String rentingNotifyUrl) {
        this.rentingNotifyUrl = rentingNotifyUrl;
    }
 
    public String getOweFeeNotifyUrl() {
        String oweFeeNotifyUrlCache = MappingCache.getValue(WechatConstant.WECHAT_DOMAIN, "oweFeeNotifyUrl");
        if (!StringUtil.isEmpty(oweFeeNotifyUrlCache)) {
            return oweFeeNotifyUrlCache;
        }
        return oweFeeNotifyUrl;
    }
 
    public void setOweFeeNotifyUrl(String oweFeeNotifyUrl) {
        this.oweFeeNotifyUrl = oweFeeNotifyUrl;
    }
 
    public String getGoodsNotifyUrl() {
        String goodsNotifyUrlCache = MappingCache.getValue(WechatConstant.WECHAT_DOMAIN, "goodsNotifyUrl");
        if (!StringUtil.isEmpty(goodsNotifyUrlCache)) {
            return goodsNotifyUrlCache;
        }
        return goodsNotifyUrl;
    }
 
    public void setGoodsNotifyUrl(String goodsNotifyUrl) {
        this.goodsNotifyUrl = goodsNotifyUrl;
    }
 
    public String getTempCarFeeNotifyUrl() {
        String tempCarFeeNotifyUrlCache = MappingCache.getValue(WechatConstant.WECHAT_DOMAIN, "tempCarFeeNotifyUrl");
        if (!StringUtil.isEmpty(tempCarFeeNotifyUrlCache)) {
            return tempCarFeeNotifyUrlCache;
        }
        return tempCarFeeNotifyUrl;
    }
 
    public void setTempCarFeeNotifyUrl(String tempCarFeeNotifyUrl) {
        this.tempCarFeeNotifyUrl = tempCarFeeNotifyUrl;
    }
}