Skip to content

Commit 023ed9a

Browse files
committed
修复企业号proxy为空的bug,并重构规范若干变量的命名
1 parent 5aa51e2 commit 023ed9a

File tree

4 files changed

+50
-48
lines changed

4 files changed

+50
-48
lines changed

weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpConfigStorage.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,13 @@ public interface WxCpConfigStorage {
5555

5656
String getOauth2redirectUri();
5757

58-
String getHttp_proxy_host();
58+
String getHttpProxyHost();
5959

60-
int getHttp_proxy_port();
60+
int getHttpProxyPort();
6161

62-
String getHttp_proxy_username();
62+
String getHttpProxyUsername();
6363

64-
String getHttp_proxy_password();
64+
String getHttpProxyPassword();
6565

6666
File getTmpDirFile();
6767

weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpInMemoryConfigStorage.java

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ public class WxCpInMemoryConfigStorage implements WxCpConfigStorage {
2626

2727
protected volatile String oauth2redirectUri;
2828

29-
protected volatile String http_proxy_host;
30-
protected volatile int http_proxy_port;
31-
protected volatile String http_proxy_username;
32-
protected volatile String http_proxy_password;
29+
protected volatile String httpProxyHost;
30+
protected volatile int httpProxyPort;
31+
protected volatile String httpProxyUsername;
32+
protected volatile String httpProxyPassword;
3333

3434
protected volatile String jsapiTicket;
3535
protected volatile long jsapiTicketExpiresTime;
@@ -166,39 +166,39 @@ public void setOauth2redirectUri(String oauth2redirectUri) {
166166
}
167167

168168
@Override
169-
public String getHttp_proxy_host() {
170-
return this.http_proxy_host;
169+
public String getHttpProxyHost() {
170+
return this.httpProxyHost;
171171
}
172172

173-
public void setHttp_proxy_host(String http_proxy_host) {
174-
this.http_proxy_host = http_proxy_host;
173+
public void setHttpProxyHost(String httpProxyHost) {
174+
this.httpProxyHost = httpProxyHost;
175175
}
176176

177177
@Override
178-
public int getHttp_proxy_port() {
179-
return this.http_proxy_port;
178+
public int getHttpProxyPort() {
179+
return this.httpProxyPort;
180180
}
181181

182-
public void setHttp_proxy_port(int http_proxy_port) {
183-
this.http_proxy_port = http_proxy_port;
182+
public void setHttpProxyPort(int httpProxyPort) {
183+
this.httpProxyPort = httpProxyPort;
184184
}
185185

186186
@Override
187-
public String getHttp_proxy_username() {
188-
return this.http_proxy_username;
187+
public String getHttpProxyUsername() {
188+
return this.httpProxyUsername;
189189
}
190190

191-
public void setHttp_proxy_username(String http_proxy_username) {
192-
this.http_proxy_username = http_proxy_username;
191+
public void setHttpProxyUsername(String httpProxyUsername) {
192+
this.httpProxyUsername = httpProxyUsername;
193193
}
194194

195195
@Override
196-
public String getHttp_proxy_password() {
197-
return this.http_proxy_password;
196+
public String getHttpProxyPassword() {
197+
return this.httpProxyPassword;
198198
}
199199

200-
public void setHttp_proxy_password(String http_proxy_password) {
201-
this.http_proxy_password = http_proxy_password;
200+
public void setHttpProxyPassword(String httpProxyPassword) {
201+
this.httpProxyPassword = httpProxyPassword;
202202
}
203203

204204
@Override

weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpJedisConfigStorage.java

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ public class WxCpJedisConfigStorage implements WxCpConfigStorage {
2929

3030
private volatile String oauth2redirectUri;
3131

32-
private volatile String http_proxy_host;
33-
private volatile int http_proxy_port;
34-
private volatile String http_proxy_username;
35-
private volatile String http_proxy_password;
32+
private volatile String httpProxyHost;
33+
private volatile int httpProxyPort;
34+
private volatile String httpProxyUsername;
35+
private volatile String httpProxyPassword;
3636

3737
private volatile File tmpDirFile;
3838

@@ -185,23 +185,23 @@ public String getOauth2redirectUri() {
185185
}
186186

187187
@Override
188-
public String getHttp_proxy_host() {
189-
return this.http_proxy_host;
188+
public String getHttpProxyHost() {
189+
return this.httpProxyHost;
190190
}
191191

192192
@Override
193-
public int getHttp_proxy_port() {
194-
return this.http_proxy_port;
193+
public int getHttpProxyPort() {
194+
return this.httpProxyPort;
195195
}
196196

197197
@Override
198-
public String getHttp_proxy_username() {
199-
return this.http_proxy_username;
198+
public String getHttpProxyUsername() {
199+
return this.httpProxyUsername;
200200
}
201201

202202
@Override
203-
public String getHttp_proxy_password() {
204-
return this.http_proxy_password;
203+
public String getHttpProxyPassword() {
204+
return this.httpProxyPassword;
205205
}
206206

207207
@Override
@@ -240,20 +240,20 @@ public void setOauth2redirectUri(String oauth2redirectUri) {
240240
this.oauth2redirectUri = oauth2redirectUri;
241241
}
242242

243-
public void setHttp_proxy_host(String http_proxy_host) {
244-
this.http_proxy_host = http_proxy_host;
243+
public void setHttpProxyHost(String httpProxyHost) {
244+
this.httpProxyHost = httpProxyHost;
245245
}
246246

247-
public void setHttp_proxy_port(int http_proxy_port) {
248-
this.http_proxy_port = http_proxy_port;
247+
public void setHttpProxyPort(int httpProxyPort) {
248+
this.httpProxyPort = httpProxyPort;
249249
}
250250

251-
public void setHttp_proxy_username(String http_proxy_username) {
252-
this.http_proxy_username = http_proxy_username;
251+
public void setHttpProxyUsername(String httpProxyUsername) {
252+
this.httpProxyUsername = httpProxyUsername;
253253
}
254254

255-
public void setHttp_proxy_password(String http_proxy_password) {
256-
this.http_proxy_password = http_proxy_password;
255+
public void setHttpProxyPassword(String httpProxyPassword) {
256+
this.httpProxyPassword = httpProxyPassword;
257257
}
258258

259259
public void setTmpDirFile(File tmpDirFile) {

weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpServiceImpl.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -626,11 +626,13 @@ public void setWxCpConfigStorage(WxCpConfigStorage wxConfigProvider) {
626626
apacheHttpClientBuilder = DefaultApacheHttpClientBuilder.get();
627627
}
628628
apacheHttpClientBuilder
629-
.httpProxyHost(this.wxCpConfigStorage.getHttp_proxy_host())
630-
.httpProxyPort(this.wxCpConfigStorage.getHttp_proxy_port())
631-
.httpProxyUsername(this.wxCpConfigStorage.getHttp_proxy_username())
632-
.httpProxyPassword(this.wxCpConfigStorage.getHttp_proxy_password());
629+
.httpProxyHost(this.wxCpConfigStorage.getHttpProxyHost())
630+
.httpProxyPort(this.wxCpConfigStorage.getHttpProxyPort())
631+
.httpProxyUsername(this.wxCpConfigStorage.getHttpProxyUsername())
632+
.httpProxyPassword(this.wxCpConfigStorage.getHttpProxyPassword());
633633

634+
this.httpProxy = new HttpHost(this.wxCpConfigStorage.getHttpProxyHost(),
635+
this.wxCpConfigStorage.getHttpProxyPort());
634636
this.httpClient = apacheHttpClientBuilder.build();
635637
}
636638

0 commit comments

Comments
 (0)