添加了注释

This commit is contained in:
ecoolper 2017-04-22 20:11:57 +08:00
parent 9ac1aad0e4
commit b03cb4b783
6 changed files with 88 additions and 3 deletions

View File

@ -39,6 +39,11 @@
<artifactId>jetty-servlet</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jodd</groupId>
<artifactId>jodd-http</artifactId>
<version>3.7</version>
</dependency>
</dependencies>
<build>

View File

@ -85,6 +85,16 @@ public class MediaDownloadRequestExecutor implements RequestExecutor<File, Strin
}
/**
* apache-http实现方式
* @param httpclient
* @param httpProxy
* @param uri
* @param queryParam
* @return
* @throws WxErrorException
* @throws IOException
*/
private File executeApache(CloseableHttpClient httpclient, HttpHost httpProxy, String uri, String queryParam) throws WxErrorException, IOException {
if (queryParam != null) {
if (uri.indexOf('?') == -1) {
@ -127,6 +137,16 @@ public class MediaDownloadRequestExecutor implements RequestExecutor<File, Strin
}
/**
* jodd-http实现方式
* @param provider
* @param proxyInfo
* @param uri
* @param queryParam
* @return
* @throws WxErrorException
* @throws IOException
*/
private File executeJodd(HttpConnectionProvider provider, ProxyInfo proxyInfo, String uri, String queryParam) throws WxErrorException, IOException {
if (queryParam != null) {
if (uri.indexOf('?') == -1) {
@ -135,7 +155,7 @@ public class MediaDownloadRequestExecutor implements RequestExecutor<File, Strin
uri += uri.endsWith("?") ? queryParam : '&' + queryParam;
}
HttpRequest request = HttpRequest.post(uri);
HttpRequest request = HttpRequest.get(uri);
if (proxyInfo != null) {
provider.useProxy(proxyInfo);
}

View File

@ -47,6 +47,16 @@ public class MediaUploadRequestExecutor implements RequestExecutor<WxMediaUpload
}
/**
* apache-http实现方式
* @param httpclient
* @param httpProxy
* @param uri
* @param file
* @return
* @throws WxErrorException
* @throws IOException
*/
private WxMediaUploadResult executeApache(CloseableHttpClient httpclient, HttpHost httpProxy, String uri, File file) throws WxErrorException, IOException {
HttpPost httpPost = new HttpPost(uri);
if (httpProxy != null) {
@ -75,6 +85,16 @@ public class MediaUploadRequestExecutor implements RequestExecutor<WxMediaUpload
}
/**
* jodd-http实现方式
* @param provider
* @param proxyInfo
* @param uri
* @param file
* @return
* @throws WxErrorException
* @throws IOException
*/
private WxMediaUploadResult executeJodd(HttpConnectionProvider provider, ProxyInfo proxyInfo, String uri, File file) throws WxErrorException, IOException {
HttpRequest request = HttpRequest.post(uri);
if (proxyInfo != null) {

View File

@ -6,13 +6,13 @@ package me.chanjar.weixin.common.util.http;
public interface RequestHttp {
/**
* httpClient
* 返回httpClient
* @return
*/
Object getRequestHttpClient();
/**
* httpProxy
* 返回httpProxy
* @return
*/
Object getRequestHttpProxy();

View File

@ -40,6 +40,16 @@ public class SimpleGetRequestExecutor implements RequestExecutor<String, String>
}
/**
* apache-http实现方式
* @param httpclient
* @param httpProxy
* @param uri
* @param queryParam
* @return
* @throws WxErrorException
* @throws IOException
*/
private String executeApache(CloseableHttpClient httpclient, HttpHost httpProxy, String uri, String queryParam) throws WxErrorException, IOException {
if (queryParam != null) {
if (uri.indexOf('?') == -1) {
@ -66,6 +76,16 @@ public class SimpleGetRequestExecutor implements RequestExecutor<String, String>
}
/**
* jodd-http实现方式
* @param provider
* @param proxyInfo
* @param uri
* @param queryParam
* @return
* @throws WxErrorException
* @throws IOException
*/
private String executeJodd(HttpConnectionProvider provider, ProxyInfo proxyInfo, String uri, String queryParam) throws WxErrorException, IOException {
if (queryParam != null) {
if (uri.indexOf('?') == -1) {

View File

@ -42,6 +42,16 @@ public class SimplePostRequestExecutor implements RequestExecutor<String, String
}
}
/**
* apache-http实现方式
* @param httpclient
* @param httpProxy
* @param uri
* @param postEntity
* @return
* @throws WxErrorException
* @throws IOException
*/
private String executeApache(CloseableHttpClient httpclient, HttpHost httpProxy, String uri, String postEntity) throws WxErrorException, IOException {
HttpPost httpPost = new HttpPost(uri);
if (httpProxy != null) {
@ -78,6 +88,16 @@ public class SimplePostRequestExecutor implements RequestExecutor<String, String
}
/**
* jodd-http实现方式
* @param provider
* @param proxyInfo
* @param uri
* @param postEntity
* @return
* @throws WxErrorException
* @throws IOException
*/
private String executeJodd(HttpConnectionProvider provider, ProxyInfo proxyInfo, String uri, String postEntity) throws WxErrorException, IOException {
HttpRequest request = HttpRequest.post(uri);
if (proxyInfo != null) {