1
0
mirror of synced 2025-12-19 06:37:59 +08:00

Merge branch 'develop' into develop

This commit is contained in:
crskyp
2017-04-27 19:22:57 +08:00
committed by GitHub
28 changed files with 111 additions and 24 deletions

View File

@@ -6,7 +6,7 @@
<parent>
<groupId>com.github.binarywang</groupId>
<artifactId>weixin-java-parent</artifactId>
<version>2.6.0</version>
<version>2.7.0-SNAPSHOT</version>
</parent>
<artifactId>weixin-java-cp</artifactId>

View File

@@ -1,6 +1,5 @@
package me.chanjar.weixin.cp.api.impl.apache;
import me.chanjar.weixin.common.bean.WxAccessToken;
import me.chanjar.weixin.common.bean.result.WxError;
import me.chanjar.weixin.common.exception.WxErrorException;
@@ -8,6 +7,7 @@ import me.chanjar.weixin.common.util.http.apache.ApacheHttpClientBuilder;
import me.chanjar.weixin.common.util.http.apache.DefaultApacheHttpClientBuilder;
import me.chanjar.weixin.cp.api.impl.AbstractWxCpService;
import org.apache.http.HttpHost;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.methods.CloseableHttpResponse;
@@ -73,6 +73,7 @@ public class WxCpServiceImpl extends AbstractWxCpService<CloseableHttpClient, Ht
}
@Override
public void initHttp() {
ApacheHttpClientBuilder apacheHttpClientBuilder = this.configStorage
.getApacheHttpClientBuilder();
@@ -91,4 +92,5 @@ public class WxCpServiceImpl extends AbstractWxCpService<CloseableHttpClient, Ht
this.httpClient = apacheHttpClientBuilder.build();
}
}

View File

@@ -19,6 +19,7 @@ public class WxCpServiceImpl extends AbstractWxCpService<HttpConnectionProvider,
@Override
public ProxyInfo getRequestHttpProxy() {
return httpProxy;
}
@Override
@@ -56,10 +57,12 @@ public class WxCpServiceImpl extends AbstractWxCpService<HttpConnectionProvider,
@Override
public void initHttp() {
if (this.configStorage.getHttpProxyHost() != null && this.configStorage.getHttpProxyPort() > 0) {
httpProxy = new ProxyInfo(ProxyInfo.ProxyType.HTTP, configStorage.getHttpProxyHost(), configStorage.getHttpProxyPort(), configStorage.getHttpProxyUsername(), configStorage.getHttpProxyPassword());
}
httpClient = JoddHttp.httpConnectionProvider;
}
}

View File

@@ -61,6 +61,10 @@ public class WxCpMessageGsonAdapter implements JsonSerializer<WxCpMessage> {
messageJson.add("voice", voice);
}
if (StringUtils.isNotBlank(message.getSafe())) {
messageJson.addProperty("safe", message.getSafe());
}
if (WxConsts.CUSTOM_MSG_VIDEO.equals(message.getMsgType())) {
JsonObject video = new JsonObject();
video.addProperty("media_id", message.getMediaId());