修复企业号proxy为空的bug,并重构规范若干变量的命名

This commit is contained in:
BinaryWang 2016-09-14 11:07:43 +08:00
parent 5aa51e2f95
commit 023ed9a2a1
4 changed files with 50 additions and 48 deletions

View File

@ -55,13 +55,13 @@ public interface WxCpConfigStorage {
String getOauth2redirectUri(); String getOauth2redirectUri();
String getHttp_proxy_host(); String getHttpProxyHost();
int getHttp_proxy_port(); int getHttpProxyPort();
String getHttp_proxy_username(); String getHttpProxyUsername();
String getHttp_proxy_password(); String getHttpProxyPassword();
File getTmpDirFile(); File getTmpDirFile();

View File

@ -26,10 +26,10 @@ public class WxCpInMemoryConfigStorage implements WxCpConfigStorage {
protected volatile String oauth2redirectUri; protected volatile String oauth2redirectUri;
protected volatile String http_proxy_host; protected volatile String httpProxyHost;
protected volatile int http_proxy_port; protected volatile int httpProxyPort;
protected volatile String http_proxy_username; protected volatile String httpProxyUsername;
protected volatile String http_proxy_password; protected volatile String httpProxyPassword;
protected volatile String jsapiTicket; protected volatile String jsapiTicket;
protected volatile long jsapiTicketExpiresTime; protected volatile long jsapiTicketExpiresTime;
@ -166,39 +166,39 @@ public class WxCpInMemoryConfigStorage implements WxCpConfigStorage {
} }
@Override @Override
public String getHttp_proxy_host() { public String getHttpProxyHost() {
return this.http_proxy_host; return this.httpProxyHost;
} }
public void setHttp_proxy_host(String http_proxy_host) { public void setHttpProxyHost(String httpProxyHost) {
this.http_proxy_host = http_proxy_host; this.httpProxyHost = httpProxyHost;
} }
@Override @Override
public int getHttp_proxy_port() { public int getHttpProxyPort() {
return this.http_proxy_port; return this.httpProxyPort;
} }
public void setHttp_proxy_port(int http_proxy_port) { public void setHttpProxyPort(int httpProxyPort) {
this.http_proxy_port = http_proxy_port; this.httpProxyPort = httpProxyPort;
} }
@Override @Override
public String getHttp_proxy_username() { public String getHttpProxyUsername() {
return this.http_proxy_username; return this.httpProxyUsername;
} }
public void setHttp_proxy_username(String http_proxy_username) { public void setHttpProxyUsername(String httpProxyUsername) {
this.http_proxy_username = http_proxy_username; this.httpProxyUsername = httpProxyUsername;
} }
@Override @Override
public String getHttp_proxy_password() { public String getHttpProxyPassword() {
return this.http_proxy_password; return this.httpProxyPassword;
} }
public void setHttp_proxy_password(String http_proxy_password) { public void setHttpProxyPassword(String httpProxyPassword) {
this.http_proxy_password = http_proxy_password; this.httpProxyPassword = httpProxyPassword;
} }
@Override @Override

View File

@ -29,10 +29,10 @@ public class WxCpJedisConfigStorage implements WxCpConfigStorage {
private volatile String oauth2redirectUri; private volatile String oauth2redirectUri;
private volatile String http_proxy_host; private volatile String httpProxyHost;
private volatile int http_proxy_port; private volatile int httpProxyPort;
private volatile String http_proxy_username; private volatile String httpProxyUsername;
private volatile String http_proxy_password; private volatile String httpProxyPassword;
private volatile File tmpDirFile; private volatile File tmpDirFile;
@ -185,23 +185,23 @@ public class WxCpJedisConfigStorage implements WxCpConfigStorage {
} }
@Override @Override
public String getHttp_proxy_host() { public String getHttpProxyHost() {
return this.http_proxy_host; return this.httpProxyHost;
} }
@Override @Override
public int getHttp_proxy_port() { public int getHttpProxyPort() {
return this.http_proxy_port; return this.httpProxyPort;
} }
@Override @Override
public String getHttp_proxy_username() { public String getHttpProxyUsername() {
return this.http_proxy_username; return this.httpProxyUsername;
} }
@Override @Override
public String getHttp_proxy_password() { public String getHttpProxyPassword() {
return this.http_proxy_password; return this.httpProxyPassword;
} }
@Override @Override
@ -240,20 +240,20 @@ public class WxCpJedisConfigStorage implements WxCpConfigStorage {
this.oauth2redirectUri = oauth2redirectUri; this.oauth2redirectUri = oauth2redirectUri;
} }
public void setHttp_proxy_host(String http_proxy_host) { public void setHttpProxyHost(String httpProxyHost) {
this.http_proxy_host = http_proxy_host; this.httpProxyHost = httpProxyHost;
} }
public void setHttp_proxy_port(int http_proxy_port) { public void setHttpProxyPort(int httpProxyPort) {
this.http_proxy_port = http_proxy_port; this.httpProxyPort = httpProxyPort;
} }
public void setHttp_proxy_username(String http_proxy_username) { public void setHttpProxyUsername(String httpProxyUsername) {
this.http_proxy_username = http_proxy_username; this.httpProxyUsername = httpProxyUsername;
} }
public void setHttp_proxy_password(String http_proxy_password) { public void setHttpProxyPassword(String httpProxyPassword) {
this.http_proxy_password = http_proxy_password; this.httpProxyPassword = httpProxyPassword;
} }
public void setTmpDirFile(File tmpDirFile) { public void setTmpDirFile(File tmpDirFile) {

View File

@ -626,11 +626,13 @@ public class WxCpServiceImpl implements WxCpService {
apacheHttpClientBuilder = DefaultApacheHttpClientBuilder.get(); apacheHttpClientBuilder = DefaultApacheHttpClientBuilder.get();
} }
apacheHttpClientBuilder apacheHttpClientBuilder
.httpProxyHost(this.wxCpConfigStorage.getHttp_proxy_host()) .httpProxyHost(this.wxCpConfigStorage.getHttpProxyHost())
.httpProxyPort(this.wxCpConfigStorage.getHttp_proxy_port()) .httpProxyPort(this.wxCpConfigStorage.getHttpProxyPort())
.httpProxyUsername(this.wxCpConfigStorage.getHttp_proxy_username()) .httpProxyUsername(this.wxCpConfigStorage.getHttpProxyUsername())
.httpProxyPassword(this.wxCpConfigStorage.getHttp_proxy_password()); .httpProxyPassword(this.wxCpConfigStorage.getHttpProxyPassword());
this.httpProxy = new HttpHost(this.wxCpConfigStorage.getHttpProxyHost(),
this.wxCpConfigStorage.getHttpProxyPort());
this.httpClient = apacheHttpClientBuilder.build(); this.httpClient = apacheHttpClientBuilder.build();
} }