Visitar URL original
合并 Develop,发布3.1.0正式版 by binarywang · Pull Request #640 · binarywang/WxJava · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
996c806
#519 修复小程序客服消息 URL 被转义的问题
ztmark Mar 30, 2018
d619848
优化单元测试提示信息
binarywang Mar 30, 2018
45cc5cc
Merge branch 'master' into develop
binarywang Mar 30, 2018
608b59e
网页授权url增加&connect_redirect=1参数解决两次重定向跳转问题: https://blog.csdn.net/jian…
binarywang Apr 8, 2018
b69a0b9
修复错误的feeToYuan方法名为fenToYuan
binarywang Apr 8, 2018
5295b26
#529 EntPayBankRequest增加默认构造函数
binarywang Apr 9, 2018
ae5267d
#529 EntPayBankResult中cmmsAmount的数据类型改为Integer
binarywang Apr 9, 2018
e1d2748
#528 WxMpUser类增加三个属性:subscribe_scene、 qr_scene 和qr_scene_str
binarywang Apr 9, 2018
dce4f6f
修复代码
binarywang Apr 10, 2018
a6ee082
发布3.0.1.BETA测试版本
binarywang Apr 10, 2018
617f861
#533 微信刷卡支付请求类增加缺少的三个参数
binarywang Apr 12, 2018
a0240e7
#536 企业号模块增加获取企业号应用相关接口
huansinho Apr 13, 2018
558f4e7
#535 修复Tomcat 不能正常关闭的问题,增加线程池shutdown相关的操作
gtyang Apr 16, 2018
74faa2a
#541 企业号增加实现管理标签的(获取标签成员)接口
huansinho Apr 16, 2018
7d688a3
#534 公众号发送模版消息中的小程序path改回pagepath
binarywang Apr 16, 2018
728c795
发布3.0.2.BETA测试版本
binarywang Apr 16, 2018
1386107
#547 开放平台模块 componentAccessToken 增加过期自动刷新
007gzs Apr 19, 2018
66b02d0
createOrder方法增加H5支付的支持
binarywang Apr 21, 2018
94b2803
#551 文本卡片消息增加btntext字段
binarywang Apr 21, 2018
b5c3b5e
#550 企业微信删除标签成员接口增加部门列表参数
binarywang Apr 21, 2018
2063dcf
清理无用代码
binarywang Apr 21, 2018
8b30615
#530 微信支付申请退款接口结果类增加单个代金券相关参数 ,并根据官方文档整理其他参数
binarywang Apr 21, 2018
61e3163
#531 小程序WxMaMessage类增加小程序卡片消息相关的几个属性
binarywang Apr 21, 2018
5b69d91
#520 企业微信网页授权增加使用user_ticket获取成员详情的接口
binarywang Apr 22, 2018
06e3a9c
发布3.0.3.BETA测试版本
binarywang Apr 22, 2018
80cf632
优化代码
binarywang Apr 23, 2018
445b47b
完善测试
binarywang Apr 23, 2018
3481cca
#559 微信开放平台:1. WxOpenInRedisConfigStorage 支持 JedisPool/JedisSentinelP…
charmingoh Apr 26, 2018
75c038d
#560 微信开放平台:增加小程序代码模板库管理
charmingoh Apr 26, 2018
0247486
#562 小程序增加代码管理相关 API
charmingoh Apr 26, 2018
ba93544
#563 小程序增加修改服务器地址、成员管理 API
charmingoh Apr 27, 2018
3c2249e
#565 小程序增加数据分析相关 API
charmingoh Apr 29, 2018
04ec788
#567 微信开放平台增加 HTTP proxy 机制
charmingoh May 1, 2018
9ff53a5
#568 修复三方平台多次授权时,RefreshToken 没有刷新的问题
007gzs May 2, 2018
1cea48b
发布3.0.4.BETA测试版本
binarywang May 2, 2018
a21fdf2
fix code
binarywang May 6, 2018
499750b
#569 微信支付几个查询关闭对账下载相关接口增加重载方法,以方便客户端指定更多参数
binarywang May 6, 2018
9558378
#578 微信开放平台增加 WxMaUserService 的实现
charmingoh May 8, 2018
329847e
修复小程序码的相关方法命名:WxCode->WxaCode, WxCodeLimit -> WxaCodeUnlimit
binarywang May 8, 2018
75069ba
#556 日志信息中如果含有secret值的,将其值隐藏掉
binarywang May 8, 2018
26eba6a
#585 小程序二维码支持is_hyaline参数生成透明背景二维码
scott-z May 11, 2018
d4cf220
发布3.0.5.BETA测试版本
binarywang May 12, 2018
adf3685
#584 修复企业付款到银行卡接口签名失败的问题
binarywang May 12, 2018
71f97c0
简化代码
binarywang May 13, 2018
06c356b
#586 微信支付 WxPayConfig增加支持byte数组方式设置证书
binarywang May 13, 2018
b698806
#581 增加微信公众号错误信息枚举类WxMpErrorMsg,并提供方法,方便根据错误代码查询错误信息内容
binarywang May 13, 2018
936b40c
#555 修复微信支付服务商模式支付验证签名失败的问题
binarywang May 13, 2018
08250aa
#521 微信支付回调通知类WxPayOrderNotifyResult增加version参数
binarywang May 13, 2018
01b1be3
#583 企业微信新增人员接口新增字段to_invite
binarywang May 13, 2018
bdbd92b
#583 企业微信通讯录管理增加邀请成员接口
binarywang May 13, 2018
7435f2d
#587 企业微信几个接口增加个人二维码字段
binarywang May 13, 2018
0e81206
修复字符
binarywang May 13, 2018
1322228
修复单元测试
binarywang May 13, 2018
a9d5527
发布3.0.6.BETA测试版本
binarywang May 13, 2018
ef97a30
重构WxError相关代码,自动根据代码补充错误中文说明
binarywang May 14, 2018
f796bfd
优化微信支付代码
binarywang May 14, 2018
ad2a5d3
#584 修复企业付款queryEntPay签名失败问题
binarywang May 18, 2018
f574403
#591 文件上传接口不自动关闭inputStream,由调用方自己控制
binarywang May 18, 2018
5b0022b
#595 优化WxPayException
binarywang May 18, 2018
4d863ee
发布3.0.7.BETA测试版本
binarywang May 21, 2018
535dd55
更新pom
binarywang May 31, 2018
f704b1a
优化代码
binarywang May 31, 2018
96e7310
#615 公众号客服消息添加 "发送小程序卡片" 类型
borisbao Jun 6, 2018
030ab99
优化XStreamTransformer
binarywang Jun 7, 2018
7852a58
微信支付模块jodd-http修改scope
binarywang Jun 7, 2018
c0938ff
发布3.0.8.BETA测试版本
binarywang Jun 7, 2018
1b759ea
#623 群发接口增加clientmsgid
binarywang Jun 9, 2018
499d12e
add author for some files
binarywang Jun 9, 2018
b901f73
clean code
binarywang Jun 9, 2018
0daaa01
重构规范RequestExecuter代码
binarywang Jun 9, 2018
5b5dada
#532 实现微信AI开放接口的三个接口:语音上传、查询识别结果和微信翻译功能
binarywang Jun 10, 2018
fa6fe78
发布3.0.9.BETA测试版本
binarywang Jun 10, 2018
ba7905a
#516 增加获取Wi-Fi门店列表接口
binarywang Jun 10, 2018
a10007a
#629 修复WxPayOrderNotifyResult解析xml报错问题
binarywang Jun 19, 2018
edb15cc
#639 修复小程序代码模版库管理 access_token key 错误
007gzs Jun 22, 2018
0cbd354
发布3.1.0正式版本
binarywang Jun 22, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
重构规范RequestExecuter代码
  • Loading branch information
binarywang committed Jun 9, 2018
commit 0daaa011ef16cb1dab22d36b81d85a48c47c600a
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
import me.chanjar.weixin.mp.api.WxMpMaterialService;
import me.chanjar.weixin.mp.api.WxMpService;
import me.chanjar.weixin.mp.bean.material.*;
import me.chanjar.weixin.mp.util.http.*;
import me.chanjar.weixin.mp.util.requestexecuter.material.*;
import me.chanjar.weixin.mp.util.requestexecuter.media.MediaImgUploadRequestExecutor;
import me.chanjar.weixin.mp.util.json.WxMpGsonBuilder;

import java.io.File;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import me.chanjar.weixin.mp.api.WxMpQrcodeService;
import me.chanjar.weixin.mp.api.WxMpService;
import me.chanjar.weixin.mp.bean.result.WxMpQrCodeTicket;
import me.chanjar.weixin.mp.util.http.QrCodeRequestExecutor;
import me.chanjar.weixin.mp.util.requestexecuter.qrcode.QrCodeRequestExecutor;
import org.apache.commons.lang3.StringUtils;

import java.io.File;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
package me.chanjar.weixin.mp.util.http.apache;
package me.chanjar.weixin.mp.util.requestexecuter.material;

import me.chanjar.weixin.common.WxType;
import me.chanjar.weixin.common.error.WxError;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.common.util.http.RequestHttp;
import me.chanjar.weixin.common.util.http.apache.Utf8ResponseHandler;
import me.chanjar.weixin.common.util.json.WxGsonBuilder;
import me.chanjar.weixin.mp.util.http.MaterialDeleteRequestExecutor;
import org.apache.http.HttpHost;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.methods.CloseableHttpResponse;
Expand All @@ -21,8 +20,8 @@
/**
* Created by ecoolper on 2017/5/5.
*/
public class ApacheMaterialDeleteRequestExecutor extends MaterialDeleteRequestExecutor<CloseableHttpClient, HttpHost> {
public ApacheMaterialDeleteRequestExecutor(RequestHttp requestHttp) {
public class MaterialDeleteApacheHttpRequestExecutor extends MaterialDeleteRequestExecutor<CloseableHttpClient, HttpHost> {
public MaterialDeleteApacheHttpRequestExecutor(RequestHttp requestHttp) {
super(requestHttp);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package me.chanjar.weixin.mp.util.http.jodd;
package me.chanjar.weixin.mp.util.requestexecuter.material;

import jodd.http.HttpConnectionProvider;
import jodd.http.HttpRequest;
Expand All @@ -10,15 +10,14 @@
import me.chanjar.weixin.common.error.WxError;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.common.util.http.RequestHttp;
import me.chanjar.weixin.mp.util.http.MaterialDeleteRequestExecutor;

import java.io.IOException;

/**
* Created by ecoolper on 2017/5/5.
*/
public class JoddMaterialDeleteRequestExecutor extends MaterialDeleteRequestExecutor<HttpConnectionProvider, ProxyInfo> {
public JoddMaterialDeleteRequestExecutor(RequestHttp requestHttp) {
public class MaterialDeleteJoddHttpRequestExecutor extends MaterialDeleteRequestExecutor<HttpConnectionProvider, ProxyInfo> {
public MaterialDeleteJoddHttpRequestExecutor(RequestHttp requestHttp) {
super(requestHttp);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
package me.chanjar.weixin.mp.util.http.okhttp;
package me.chanjar.weixin.mp.util.requestexecuter.material;

import me.chanjar.weixin.common.WxType;
import me.chanjar.weixin.common.error.WxError;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.common.util.http.RequestHttp;
import me.chanjar.weixin.common.util.http.okhttp.OkHttpProxyInfo;
import me.chanjar.weixin.mp.util.http.MaterialDeleteRequestExecutor;
import okhttp3.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand All @@ -15,17 +14,17 @@
/**
* Created by ecoolper on 2017/5/5.
*/
public class OkhttpMaterialDeleteRequestExecutor extends MaterialDeleteRequestExecutor<OkHttpClient, OkHttpProxyInfo> {
public class MaterialDeleteOkhttpRequestExecutor extends MaterialDeleteRequestExecutor<OkHttpClient, OkHttpProxyInfo> {
private final Logger logger = LoggerFactory.getLogger(this.getClass());


public OkhttpMaterialDeleteRequestExecutor(RequestHttp requestHttp) {
public MaterialDeleteOkhttpRequestExecutor(RequestHttp requestHttp) {
super(requestHttp);
}

@Override
public Boolean execute(String uri, String materialId) throws WxErrorException, IOException {
logger.debug("OkhttpMaterialDeleteRequestExecutor is running");
logger.debug("MaterialDeleteOkhttpRequestExecutor is running");
//得到httpClient
OkHttpClient client = requestHttp.getRequestHttpClient();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
package me.chanjar.weixin.mp.util.http;
package me.chanjar.weixin.mp.util.requestexecuter.material;

import me.chanjar.weixin.common.util.http.RequestExecutor;
import me.chanjar.weixin.common.util.http.RequestHttp;
import me.chanjar.weixin.mp.util.http.apache.ApacheMaterialDeleteRequestExecutor;
import me.chanjar.weixin.mp.util.http.jodd.JoddMaterialDeleteRequestExecutor;
import me.chanjar.weixin.mp.util.http.okhttp.OkhttpMaterialDeleteRequestExecutor;

public abstract class MaterialDeleteRequestExecutor<H, P> implements RequestExecutor<Boolean, String> {
protected RequestHttp<H, P> requestHttp;
Expand All @@ -16,11 +13,11 @@ public MaterialDeleteRequestExecutor(RequestHttp requestHttp) {
public static RequestExecutor<Boolean, String> create(RequestHttp requestHttp) {
switch (requestHttp.getRequestType()) {
case APACHE_HTTP:
return new ApacheMaterialDeleteRequestExecutor(requestHttp);
return new MaterialDeleteApacheHttpRequestExecutor(requestHttp);
case JODD_HTTP:
return new JoddMaterialDeleteRequestExecutor(requestHttp);
return new MaterialDeleteJoddHttpRequestExecutor(requestHttp);
case OK_HTTP:
return new OkhttpMaterialDeleteRequestExecutor(requestHttp);
return new MaterialDeleteOkhttpRequestExecutor(requestHttp);
default:
return null;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package me.chanjar.weixin.mp.util.http.apache;
package me.chanjar.weixin.mp.util.requestexecuter.material;

import com.google.common.collect.ImmutableMap;
import me.chanjar.weixin.common.WxType;
Expand All @@ -8,7 +8,6 @@
import me.chanjar.weixin.common.util.http.apache.Utf8ResponseHandler;
import me.chanjar.weixin.common.util.json.WxGsonBuilder;
import me.chanjar.weixin.mp.bean.material.WxMpMaterialNews;
import me.chanjar.weixin.mp.util.http.MaterialNewsInfoRequestExecutor;
import me.chanjar.weixin.mp.util.json.WxMpGsonBuilder;
import org.apache.http.HttpHost;
import org.apache.http.client.config.RequestConfig;
Expand All @@ -27,11 +26,11 @@
* @author ecoolper
* @date 2017/5/5
*/
public class ApacheMaterialNewsInfoRequestExecutor
public class MaterialNewsInfoApacheHttpRequestExecutor
extends MaterialNewsInfoRequestExecutor<CloseableHttpClient, HttpHost> {
private final Logger logger = LoggerFactory.getLogger(this.getClass());

public ApacheMaterialNewsInfoRequestExecutor(RequestHttp requestHttp) {
public MaterialNewsInfoApacheHttpRequestExecutor(RequestHttp requestHttp) {
super(requestHttp);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package me.chanjar.weixin.mp.util.http.jodd;
package me.chanjar.weixin.mp.util.requestexecuter.material;

import com.google.common.collect.ImmutableMap;
import jodd.http.HttpConnectionProvider;
Expand All @@ -13,7 +13,6 @@
import me.chanjar.weixin.common.util.http.RequestHttp;
import me.chanjar.weixin.common.util.json.WxGsonBuilder;
import me.chanjar.weixin.mp.bean.material.WxMpMaterialNews;
import me.chanjar.weixin.mp.util.http.MaterialNewsInfoRequestExecutor;
import me.chanjar.weixin.mp.util.json.WxMpGsonBuilder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand All @@ -23,9 +22,9 @@
/**
* Created by ecoolper on 2017/5/5.
*/
public class JoddMaterialNewsInfoRequestExecutor extends MaterialNewsInfoRequestExecutor<HttpConnectionProvider, ProxyInfo> {
public class MaterialNewsInfoJoddHttpRequestExecutor extends MaterialNewsInfoRequestExecutor<HttpConnectionProvider, ProxyInfo> {
private final Logger logger = LoggerFactory.getLogger(this.getClass());
public JoddMaterialNewsInfoRequestExecutor(RequestHttp requestHttp) {
public MaterialNewsInfoJoddHttpRequestExecutor(RequestHttp requestHttp) {
super(requestHttp);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package me.chanjar.weixin.mp.util.http.okhttp;
package me.chanjar.weixin.mp.util.requestexecuter.material;

import com.google.common.collect.ImmutableMap;
import me.chanjar.weixin.common.WxType;
Expand All @@ -8,7 +8,6 @@
import me.chanjar.weixin.common.util.http.okhttp.OkHttpProxyInfo;
import me.chanjar.weixin.common.util.json.WxGsonBuilder;
import me.chanjar.weixin.mp.bean.material.WxMpMaterialNews;
import me.chanjar.weixin.mp.util.http.MaterialNewsInfoRequestExecutor;
import me.chanjar.weixin.mp.util.json.WxMpGsonBuilder;
import okhttp3.*;
import org.slf4j.Logger;
Expand All @@ -19,9 +18,9 @@
/**
* Created by ecoolper on 2017/5/5.
*/
public class OkhttpMaterialNewsInfoRequestExecutor extends MaterialNewsInfoRequestExecutor<OkHttpClient, OkHttpProxyInfo> {
public class MaterialNewsInfoOkhttpRequestExecutor extends MaterialNewsInfoRequestExecutor<OkHttpClient, OkHttpProxyInfo> {
private final Logger logger = LoggerFactory.getLogger(this.getClass());
public OkhttpMaterialNewsInfoRequestExecutor(RequestHttp requestHttp) {
public MaterialNewsInfoOkhttpRequestExecutor(RequestHttp requestHttp) {
super(requestHttp);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
package me.chanjar.weixin.mp.util.http;
package me.chanjar.weixin.mp.util.requestexecuter.material;

import me.chanjar.weixin.common.util.http.RequestExecutor;
import me.chanjar.weixin.common.util.http.RequestHttp;
import me.chanjar.weixin.mp.bean.material.WxMpMaterialNews;
import me.chanjar.weixin.mp.util.http.apache.ApacheMaterialNewsInfoRequestExecutor;
import me.chanjar.weixin.mp.util.http.jodd.JoddMaterialNewsInfoRequestExecutor;
import me.chanjar.weixin.mp.util.http.okhttp.OkhttpMaterialNewsInfoRequestExecutor;

public abstract class MaterialNewsInfoRequestExecutor<H, P> implements RequestExecutor<WxMpMaterialNews, String> {
protected RequestHttp<H, P> requestHttp;
Expand All @@ -17,11 +14,11 @@ public MaterialNewsInfoRequestExecutor(RequestHttp requestHttp) {
public static RequestExecutor<WxMpMaterialNews, String> create(RequestHttp requestHttp) {
switch (requestHttp.getRequestType()) {
case APACHE_HTTP:
return new ApacheMaterialNewsInfoRequestExecutor(requestHttp);
return new MaterialNewsInfoApacheHttpRequestExecutor(requestHttp);
case JODD_HTTP:
return new JoddMaterialNewsInfoRequestExecutor(requestHttp);
return new MaterialNewsInfoJoddHttpRequestExecutor(requestHttp);
case OK_HTTP:
return new OkhttpMaterialNewsInfoRequestExecutor(requestHttp);
return new MaterialNewsInfoOkhttpRequestExecutor(requestHttp);
default:
//TODO 需要优化抛出异常
return null;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package me.chanjar.weixin.mp.util.http.apache;
package me.chanjar.weixin.mp.util.requestexecuter.material;

import me.chanjar.weixin.common.WxType;
import me.chanjar.weixin.common.error.WxError;
Expand All @@ -8,7 +8,6 @@
import me.chanjar.weixin.common.util.json.WxGsonBuilder;
import me.chanjar.weixin.mp.bean.material.WxMpMaterial;
import me.chanjar.weixin.mp.bean.material.WxMpMaterialUploadResult;
import me.chanjar.weixin.mp.util.http.MaterialUploadRequestExecutor;
import org.apache.http.Consts;
import org.apache.http.HttpHost;
import org.apache.http.client.config.RequestConfig;
Expand All @@ -28,8 +27,8 @@
/**
* Created by ecoolper on 2017/5/5.
*/
public class ApacheMaterialUploadRequestExecutor extends MaterialUploadRequestExecutor<CloseableHttpClient, HttpHost> {
public ApacheMaterialUploadRequestExecutor(RequestHttp requestHttp) {
public class MaterialUploadApacheHttpRequestExecutor extends MaterialUploadRequestExecutor<CloseableHttpClient, HttpHost> {
public MaterialUploadApacheHttpRequestExecutor(RequestHttp requestHttp) {
super(requestHttp);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package me.chanjar.weixin.mp.util.http.jodd;
package me.chanjar.weixin.mp.util.requestexecuter.material;

import jodd.http.HttpConnectionProvider;
import jodd.http.HttpRequest;
Expand All @@ -13,7 +13,6 @@
import me.chanjar.weixin.common.util.json.WxGsonBuilder;
import me.chanjar.weixin.mp.bean.material.WxMpMaterial;
import me.chanjar.weixin.mp.bean.material.WxMpMaterialUploadResult;
import me.chanjar.weixin.mp.util.http.MaterialUploadRequestExecutor;

import java.io.File;
import java.io.FileNotFoundException;
Expand All @@ -23,8 +22,8 @@
/**
* Created by ecoolper on 2017/5/5.
*/
public class JoddMaterialUploadRequestExecutor extends MaterialUploadRequestExecutor<HttpConnectionProvider, ProxyInfo> {
public JoddMaterialUploadRequestExecutor(RequestHttp requestHttp) {
public class MaterialUploadJoddHttpRequestExecutor extends MaterialUploadRequestExecutor<HttpConnectionProvider, ProxyInfo> {
public MaterialUploadJoddHttpRequestExecutor(RequestHttp requestHttp) {
super(requestHttp);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package me.chanjar.weixin.mp.util.http.okhttp;
package me.chanjar.weixin.mp.util.requestexecuter.material;

import me.chanjar.weixin.common.WxType;
import me.chanjar.weixin.common.error.WxError;
Expand All @@ -8,7 +8,6 @@
import me.chanjar.weixin.common.util.json.WxGsonBuilder;
import me.chanjar.weixin.mp.bean.material.WxMpMaterial;
import me.chanjar.weixin.mp.bean.material.WxMpMaterialUploadResult;
import me.chanjar.weixin.mp.util.http.MaterialUploadRequestExecutor;
import okhttp3.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand All @@ -21,16 +20,16 @@
/**
* Created by ecoolper on 2017/5/5.
*/
public class OkhttpMaterialUploadRequestExecutor extends MaterialUploadRequestExecutor<OkHttpClient, OkHttpProxyInfo> {
public class MaterialUploadOkhttpRequestExecutor extends MaterialUploadRequestExecutor<OkHttpClient, OkHttpProxyInfo> {
private final Logger logger = LoggerFactory.getLogger(this.getClass());

public OkhttpMaterialUploadRequestExecutor(RequestHttp requestHttp) {
public MaterialUploadOkhttpRequestExecutor(RequestHttp requestHttp) {
super(requestHttp);
}

@Override
public WxMpMaterialUploadResult execute(String uri, WxMpMaterial material) throws WxErrorException, IOException {
logger.debug("OkhttpMaterialUploadRequestExecutor is running");
logger.debug("MaterialUploadOkhttpRequestExecutor is running");
if (material == null) {
throw new WxErrorException(WxError.builder().errorCode(-1).errorMsg("非法请求,material参数为空").build());
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
package me.chanjar.weixin.mp.util.http;
package me.chanjar.weixin.mp.util.requestexecuter.material;

import me.chanjar.weixin.common.util.http.RequestExecutor;
import me.chanjar.weixin.common.util.http.RequestHttp;
import me.chanjar.weixin.mp.bean.material.WxMpMaterial;
import me.chanjar.weixin.mp.bean.material.WxMpMaterialUploadResult;
import me.chanjar.weixin.mp.util.http.apache.ApacheMaterialUploadRequestExecutor;
import me.chanjar.weixin.mp.util.http.jodd.JoddMaterialUploadRequestExecutor;
import me.chanjar.weixin.mp.util.http.okhttp.OkhttpMaterialUploadRequestExecutor;

/**
* @author codepiano
Expand All @@ -21,11 +18,11 @@ public MaterialUploadRequestExecutor(RequestHttp requestHttp) {
public static RequestExecutor<WxMpMaterialUploadResult, WxMpMaterial> create(RequestHttp requestHttp) {
switch (requestHttp.getRequestType()) {
case APACHE_HTTP:
return new ApacheMaterialUploadRequestExecutor(requestHttp);
return new MaterialUploadApacheHttpRequestExecutor(requestHttp);
case JODD_HTTP:
return new JoddMaterialUploadRequestExecutor(requestHttp);
return new MaterialUploadJoddHttpRequestExecutor(requestHttp);
case OK_HTTP:
return new OkhttpMaterialUploadRequestExecutor(requestHttp);
return new MaterialUploadOkhttpRequestExecutor(requestHttp);
default:
return null;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package me.chanjar.weixin.mp.util.http.apache;
package me.chanjar.weixin.mp.util.requestexecuter.material;

import me.chanjar.weixin.common.WxType;
import me.chanjar.weixin.common.error.WxError;
Expand All @@ -7,7 +7,6 @@
import me.chanjar.weixin.common.util.http.apache.Utf8ResponseHandler;
import me.chanjar.weixin.common.util.json.WxGsonBuilder;
import me.chanjar.weixin.mp.bean.material.WxMpMaterialVideoInfoResult;
import me.chanjar.weixin.mp.util.http.MaterialVideoInfoRequestExecutor;
import org.apache.http.HttpHost;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.methods.CloseableHttpResponse;
Expand All @@ -22,8 +21,8 @@
/**
* Created by ecoolper on 2017/5/5.
*/
public class ApacheMaterialVideoInfoRequestExecutor extends MaterialVideoInfoRequestExecutor<CloseableHttpClient, HttpHost> {
public ApacheMaterialVideoInfoRequestExecutor(RequestHttp requestHttp) {
public class MaterialVideoInfoApacheHttpRequestExecutor extends MaterialVideoInfoRequestExecutor<CloseableHttpClient, HttpHost> {
public MaterialVideoInfoApacheHttpRequestExecutor(RequestHttp requestHttp) {
super(requestHttp);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package me.chanjar.weixin.mp.util.http.jodd;
package me.chanjar.weixin.mp.util.requestexecuter.material;

import jodd.http.HttpConnectionProvider;
import jodd.http.HttpRequest;
Expand All @@ -11,15 +11,14 @@
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.common.util.http.RequestHttp;
import me.chanjar.weixin.mp.bean.material.WxMpMaterialVideoInfoResult;
import me.chanjar.weixin.mp.util.http.MaterialVideoInfoRequestExecutor;

import java.io.IOException;

/**
* Created by ecoolper on 2017/5/5.
*/
public class JoddMaterialVideoInfoRequestExecutor extends MaterialVideoInfoRequestExecutor<HttpConnectionProvider, ProxyInfo> {
public JoddMaterialVideoInfoRequestExecutor(RequestHttp requestHttp) {
public class MaterialVideoInfoJoddHttpRequestExecutor extends MaterialVideoInfoRequestExecutor<HttpConnectionProvider, ProxyInfo> {
public MaterialVideoInfoJoddHttpRequestExecutor(RequestHttp requestHttp) {
super(requestHttp);
}

Expand Down
Loading