mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-10-28 12:37:55 +08:00
fix some code
This commit is contained in:
@ -8,20 +8,15 @@ public interface RequestHttp<H, P> {
|
||||
/**
|
||||
* 返回httpClient
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
H getRequestHttpClient();
|
||||
|
||||
/**
|
||||
* 返回httpProxy
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
P getRequestHttpProxy();
|
||||
|
||||
/**
|
||||
* @return
|
||||
*/
|
||||
HttpType getRequestType();
|
||||
|
||||
}
|
||||
|
||||
@ -12,11 +12,10 @@ import me.chanjar.weixin.common.util.http.okhttp.OkHttpSimpleGetRequestExecutor;
|
||||
public abstract class SimpleGetRequestExecutor<H, P> implements RequestExecutor<String, String> {
|
||||
protected RequestHttp<H, P> requestHttp;
|
||||
|
||||
public SimpleGetRequestExecutor(RequestHttp requestHttp) {
|
||||
public SimpleGetRequestExecutor(RequestHttp<H, P> requestHttp) {
|
||||
this.requestHttp = requestHttp;
|
||||
}
|
||||
|
||||
|
||||
public static RequestExecutor<String, String> create(RequestHttp requestHttp) {
|
||||
switch (requestHttp.getRequestType()) {
|
||||
case APACHE_HTTP:
|
||||
@ -26,7 +25,7 @@ public abstract class SimpleGetRequestExecutor<H, P> implements RequestExecutor<
|
||||
case OK_HTTP:
|
||||
return new OkHttpSimpleGetRequestExecutor(requestHttp);
|
||||
default:
|
||||
return null;
|
||||
throw new IllegalArgumentException("非法请求参数");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user