Merge branch 'develop' into develop
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user