🎨 #3834 【基础架构】小程序和开放平台两个模块补充了 Apache HttpClient 5.x 实现,同时并将多个模块的默认服务实现迁移至 Apache HttpClient 5.x 客户端

This commit is contained in:
buaazyl
2026-01-08 15:08:58 +08:00
committed by GitHub
parent e572ddfba6
commit 2c5a33917e
21 changed files with 233 additions and 22 deletions

View File

@@ -55,7 +55,7 @@ public class WxChannelMultiProperties implements Serializable {
/**
* http客户端类型.
*/
private HttpClientType httpClientType = HttpClientType.HTTP_CLIENT;
private HttpClientType httpClientType = HttpClientType.HTTP_COMPONENTS;
/**
* http代理主机.

View File

@@ -52,7 +52,7 @@ public class WxCpMultiProperties implements Serializable {
/**
* http客户端类型.
*/
private HttpClientType httpClientType = HttpClientType.HTTP_CLIENT;
private HttpClientType httpClientType = HttpClientType.HTTP_COMPONENTS;
/**
* http代理主机

View File

@@ -2,6 +2,7 @@ package com.binarywang.solon.wxjava.miniapp.configuration.services;
import cn.binarywang.wx.miniapp.api.WxMaService;
import cn.binarywang.wx.miniapp.api.impl.WxMaServiceHttpClientImpl;
import cn.binarywang.wx.miniapp.api.impl.WxMaServiceHttpComponentsImpl;
import cn.binarywang.wx.miniapp.api.impl.WxMaServiceImpl;
import cn.binarywang.wx.miniapp.api.impl.WxMaServiceJoddHttpImpl;
import cn.binarywang.wx.miniapp.api.impl.WxMaServiceOkHttpImpl;
@@ -89,6 +90,9 @@ public abstract class AbstractWxMaConfiguration {
case HTTP_CLIENT:
wxMaService = new WxMaServiceHttpClientImpl();
break;
case HTTP_COMPONENTS:
wxMaService = new WxMaServiceHttpComponentsImpl();
break;
default:
wxMaService = new WxMaServiceImpl();
break;

View File

@@ -77,7 +77,7 @@ public class WxMaMultiProperties implements Serializable {
/**
* http客户端类型.
*/
private HttpClientType httpClientType = HttpClientType.HTTP_CLIENT;
private HttpClientType httpClientType = HttpClientType.HTTP_COMPONENTS;
/**
* http代理主机.
@@ -149,6 +149,10 @@ public class WxMaMultiProperties implements Serializable {
/**
* JoddHttp
*/
JODD_HTTP
JODD_HTTP,
/**
* HttpComponents
*/
HTTP_COMPONENTS
}
}

View File

@@ -2,6 +2,7 @@ package com.binarywang.solon.wxjava.miniapp.config;
import cn.binarywang.wx.miniapp.api.WxMaService;
import cn.binarywang.wx.miniapp.api.impl.WxMaServiceHttpClientImpl;
import cn.binarywang.wx.miniapp.api.impl.WxMaServiceHttpComponentsImpl;
import cn.binarywang.wx.miniapp.api.impl.WxMaServiceImpl;
import cn.binarywang.wx.miniapp.api.impl.WxMaServiceJoddHttpImpl;
import cn.binarywang.wx.miniapp.api.impl.WxMaServiceOkHttpImpl;
@@ -44,6 +45,9 @@ public class WxMaServiceAutoConfiguration {
case HttpClient:
wxMaService = new WxMaServiceHttpClientImpl();
break;
case HttpComponents:
wxMaService = new WxMaServiceHttpComponentsImpl();
break;
default:
wxMaService = new WxMaServiceImpl();
break;

View File

@@ -76,7 +76,7 @@ public class WxMaProperties {
/**
* http客户端类型.
*/
private HttpClientType httpClientType = HttpClientType.HttpClient;
private HttpClientType httpClientType = HttpClientType.HttpComponents;
/**
* http代理主机.

View File

@@ -8,6 +8,7 @@ import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import me.chanjar.weixin.mp.api.WxMpService;
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.WxMpServiceJoddHttpImpl;
import me.chanjar.weixin.mp.api.impl.WxMpServiceOkHttpImpl;
@@ -91,6 +92,9 @@ public abstract class AbstractWxMpConfiguration {
case HTTP_CLIENT:
wxMpService = new WxMpServiceHttpClientImpl();
break;
case HTTP_COMPONENTS:
wxMpService = new WxMpServiceHttpComponentsImpl();
break;
default:
wxMpService = new WxMpServiceImpl();
break;

View File

@@ -77,7 +77,7 @@ public class WxMpMultiProperties implements Serializable {
/**
* http客户端类型.
*/
private HttpClientType httpClientType = HttpClientType.HTTP_CLIENT;
private HttpClientType httpClientType = HttpClientType.HTTP_COMPONENTS;
/**
* http代理主机.
@@ -149,6 +149,10 @@ public class WxMpMultiProperties implements Serializable {
/**
* JoddHttp
*/
JODD_HTTP
JODD_HTTP,
/**
* HttpComponents
*/
HTTP_COMPONENTS
}
}

View File

@@ -4,6 +4,7 @@ import com.binarywang.solon.wxjava.mp.enums.HttpClientType;
import com.binarywang.solon.wxjava.mp.properties.WxMpProperties;
import me.chanjar.weixin.mp.api.WxMpService;
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.WxMpServiceJoddHttpImpl;
import me.chanjar.weixin.mp.api.impl.WxMpServiceOkHttpImpl;
@@ -35,6 +36,9 @@ public class WxMpServiceAutoConfiguration {
case HttpClient:
wxMpService = newWxMpServiceHttpClientImpl();
break;
case HttpComponents:
wxMpService = newWxMpServiceHttpComponentsImpl();
break;
default:
wxMpService = newWxMpServiceImpl();
break;
@@ -60,4 +64,8 @@ public class WxMpServiceAutoConfiguration {
return new WxMpServiceJoddHttpImpl();
}
private WxMpService newWxMpServiceHttpComponentsImpl() {
return new WxMpServiceHttpComponentsImpl();
}
}

View File

@@ -4,6 +4,7 @@ import com.binarywang.solon.wxjava.qidian.enums.HttpClientType;
import com.binarywang.solon.wxjava.qidian.properties.WxQidianProperties;
import me.chanjar.weixin.qidian.api.WxQidianService;
import me.chanjar.weixin.qidian.api.impl.WxQidianServiceHttpClientImpl;
import me.chanjar.weixin.qidian.api.impl.WxQidianServiceHttpComponentsImpl;
import me.chanjar.weixin.qidian.api.impl.WxQidianServiceImpl;
import me.chanjar.weixin.qidian.api.impl.WxQidianServiceJoddHttpImpl;
import me.chanjar.weixin.qidian.api.impl.WxQidianServiceOkHttpImpl;
@@ -35,6 +36,9 @@ public class WxQidianServiceAutoConfiguration {
case HttpClient:
wxQidianService = newWxQidianServiceHttpClientImpl();
break;
case HttpComponents:
wxQidianService = newWxQidianServiceHttpComponentsImpl();
break;
default:
wxQidianService = newWxQidianServiceImpl();
break;
@@ -60,4 +64,8 @@ public class WxQidianServiceAutoConfiguration {
return new WxQidianServiceJoddHttpImpl();
}
private WxQidianService newWxQidianServiceHttpComponentsImpl() {
return new WxQidianServiceHttpComponentsImpl();
}
}