🎨 #3384 【公众号】为 starter 添加 HttpComponents (httpclient5) 支持
This commit is contained in:
@@ -44,6 +44,11 @@
|
|||||||
<artifactId>okhttp</artifactId>
|
<artifactId>okhttp</artifactId>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.httpcomponents.client5</groupId>
|
||||||
|
<artifactId>httpclient5</artifactId>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|||||||
@@ -39,6 +39,11 @@
|
|||||||
<artifactId>okhttp</artifactId>
|
<artifactId>okhttp</artifactId>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.httpcomponents.client5</groupId>
|
||||||
|
<artifactId>httpclient5</artifactId>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import com.binarywang.spring.starter.wxjava.mp.enums.HttpClientType;
|
|||||||
import com.binarywang.spring.starter.wxjava.mp.properties.WxMpProperties;
|
import com.binarywang.spring.starter.wxjava.mp.properties.WxMpProperties;
|
||||||
import me.chanjar.weixin.mp.api.WxMpService;
|
import me.chanjar.weixin.mp.api.WxMpService;
|
||||||
import me.chanjar.weixin.mp.api.impl.WxMpServiceHttpClientImpl;
|
import me.chanjar.weixin.mp.api.impl.WxMpServiceHttpClientImpl;
|
||||||
|
import me.chanjar.weixin.mp.api.impl.WxMpServiceHttpComponentsImpl;
|
||||||
import me.chanjar.weixin.mp.api.impl.WxMpServiceImpl;
|
import me.chanjar.weixin.mp.api.impl.WxMpServiceImpl;
|
||||||
import me.chanjar.weixin.mp.api.impl.WxMpServiceJoddHttpImpl;
|
import me.chanjar.weixin.mp.api.impl.WxMpServiceJoddHttpImpl;
|
||||||
import me.chanjar.weixin.mp.api.impl.WxMpServiceOkHttpImpl;
|
import me.chanjar.weixin.mp.api.impl.WxMpServiceOkHttpImpl;
|
||||||
@@ -35,6 +36,9 @@ public class WxMpServiceAutoConfiguration {
|
|||||||
case HttpClient:
|
case HttpClient:
|
||||||
wxMpService = newWxMpServiceHttpClientImpl();
|
wxMpService = newWxMpServiceHttpClientImpl();
|
||||||
break;
|
break;
|
||||||
|
case HttpComponents:
|
||||||
|
wxMpService = newWxMpServiceHttpComponentsImpl();
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
wxMpService = newWxMpServiceImpl();
|
wxMpService = newWxMpServiceImpl();
|
||||||
break;
|
break;
|
||||||
@@ -60,4 +64,8 @@ public class WxMpServiceAutoConfiguration {
|
|||||||
return new WxMpServiceJoddHttpImpl();
|
return new WxMpServiceJoddHttpImpl();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private WxMpService newWxMpServiceHttpComponentsImpl() {
|
||||||
|
return new WxMpServiceHttpComponentsImpl();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,4 +19,8 @@ public enum HttpClientType {
|
|||||||
* JoddHttp.
|
* JoddHttp.
|
||||||
*/
|
*/
|
||||||
JoddHttp,
|
JoddHttp,
|
||||||
|
/**
|
||||||
|
* HttpComponents (Apache HttpClient 5.x).
|
||||||
|
*/
|
||||||
|
HttpComponents,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user