mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-08-25 01:14:36 +08:00
Merge remote-tracking branch 'wechat/develop' into develop
This commit is contained in:
commit
f0f21e1432
2
pom.xml
2
pom.xml
@ -134,7 +134,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.jodd</groupId>
|
<groupId>org.jodd</groupId>
|
||||||
<artifactId>jodd-http</artifactId>
|
<artifactId>jodd-http</artifactId>
|
||||||
<version>5.1.6</version>
|
<version>5.2.0</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
package cn.binarywang.wx.graal;
|
package com.github.binarywang.wx.graal;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@ -26,12 +26,12 @@ import java.util.TreeSet;
|
|||||||
* @author outersky
|
* @author outersky
|
||||||
*/
|
*/
|
||||||
@SupportedAnnotationTypes("lombok.Data")
|
@SupportedAnnotationTypes("lombok.Data")
|
||||||
@SupportedSourceVersion(SourceVersion.RELEASE_7)
|
@SupportedSourceVersion(SourceVersion.RELEASE_8)
|
||||||
public class GraalProcessor extends AbstractProcessor {
|
public class GraalProcessor extends AbstractProcessor {
|
||||||
private static final String REFLECTION_CONFIG_JSON = "reflection-config.json";
|
private static final String REFLECTION_CONFIG_JSON = "reflection-config.json";
|
||||||
private static final String NATIVE_IMAGE_PROPERTIES = "native-image.properties";
|
private static final String NATIVE_IMAGE_PROPERTIES = "native-image.properties";
|
||||||
|
|
||||||
private SortedSet<String> classSet = new TreeSet<>();
|
private final SortedSet<String> classSet = new TreeSet<>();
|
||||||
private String shortestPackageName = null;
|
private String shortestPackageName = null;
|
||||||
|
|
||||||
@Override
|
@Override
|
@ -1 +1 @@
|
|||||||
cn.binarywang.wx.graal.GraalProcessor
|
com.github.binarywang.wx.graal.GraalProcessor
|
||||||
|
@ -165,7 +165,7 @@
|
|||||||
<version>3.5.1</version>
|
<version>3.5.1</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<annotationProcessors>
|
<annotationProcessors>
|
||||||
cn.binarywang.wx.graal.GraalProcessor,lombok.launch.AnnotationProcessorHider$AnnotationProcessor,lombok.launch.AnnotationProcessorHider$ClaimingProcessor
|
com.github.binarywang.wx.graal.GraalProcessor,lombok.launch.AnnotationProcessorHider$AnnotationProcessor,lombok.launch.AnnotationProcessorHider$ClaimingProcessor
|
||||||
</annotationProcessors>
|
</annotationProcessors>
|
||||||
<annotationProcessorPaths>
|
<annotationProcessorPaths>
|
||||||
<path>
|
<path>
|
||||||
|
@ -3,10 +3,7 @@ package me.chanjar.weixin.common.util;
|
|||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
import com.google.common.collect.Sets;
|
import com.google.common.collect.Sets;
|
||||||
import org.dom4j.Document;
|
import org.dom4j.*;
|
||||||
import org.dom4j.DocumentException;
|
|
||||||
import org.dom4j.Element;
|
|
||||||
import org.dom4j.Node;
|
|
||||||
import org.dom4j.io.SAXReader;
|
import org.dom4j.io.SAXReader;
|
||||||
import org.dom4j.tree.DefaultText;
|
import org.dom4j.tree.DefaultText;
|
||||||
import org.xml.sax.SAXException;
|
import org.xml.sax.SAXException;
|
||||||
@ -50,14 +47,16 @@ public class XmlUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static Object element2MapOrString(Element element) {
|
private static Object element2MapOrString(Element element) {
|
||||||
Map<String, Object> result = Maps.newHashMap();
|
|
||||||
|
|
||||||
final List<Node> content = element.content();
|
final List<Node> content = element.content();
|
||||||
if (content.size() <= 1) {
|
final Set<String> names = names(content);
|
||||||
|
|
||||||
|
// 判断节点下有无非文本节点(非Text和CDATA),如无,直接取Text文本内容
|
||||||
|
if (names.size() < 1) {
|
||||||
return element.getText();
|
return element.getText();
|
||||||
}
|
}
|
||||||
|
|
||||||
final Set<String> names = names(content);
|
Map<String, Object> result = Maps.newHashMap();
|
||||||
if (names.size() == 1) {
|
if (names.size() == 1) {
|
||||||
// 说明是个列表,各个子对象是相同的name
|
// 说明是个列表,各个子对象是相同的name
|
||||||
List<Object> list = Lists.newArrayList();
|
List<Object> list = Lists.newArrayList();
|
||||||
@ -90,7 +89,8 @@ public class XmlUtils {
|
|||||||
private static Set<String> names(List<Node> nodes) {
|
private static Set<String> names(List<Node> nodes) {
|
||||||
Set<String> names = Sets.newHashSet();
|
Set<String> names = Sets.newHashSet();
|
||||||
for (Node node : nodes) {
|
for (Node node : nodes) {
|
||||||
if (node instanceof DefaultText) {
|
// 如果节点类型是Text或CDATA跳过
|
||||||
|
if (node instanceof DefaultText || node instanceof CDATA) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
names.add(node.getName());
|
names.add(node.getName());
|
||||||
|
@ -19,6 +19,7 @@ import java.io.ByteArrayInputStream;
|
|||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* .
|
* .
|
||||||
@ -47,7 +48,7 @@ public class JoddHttpMediaDownloadRequestExecutor extends BaseMediaDownloadReque
|
|||||||
request.withConnectionProvider(requestHttp.getRequestHttpClient());
|
request.withConnectionProvider(requestHttp.getRequestHttpClient());
|
||||||
|
|
||||||
HttpResponse response = request.send();
|
HttpResponse response = request.send();
|
||||||
response.charset(StringPool.UTF_8);
|
response.charset(StandardCharsets.UTF_8.name());
|
||||||
|
|
||||||
String contentType = response.header("Content-Type");
|
String contentType = response.header("Content-Type");
|
||||||
if (contentType != null && contentType.startsWith("application/json")) {
|
if (contentType != null && contentType.startsWith("application/json")) {
|
||||||
|
@ -14,6 +14,7 @@ import me.chanjar.weixin.common.util.http.RequestHttp;
|
|||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* .
|
* .
|
||||||
@ -35,7 +36,7 @@ public class JoddHttpMediaUploadRequestExecutor extends MediaUploadRequestExecut
|
|||||||
request.withConnectionProvider(requestHttp.getRequestHttpClient());
|
request.withConnectionProvider(requestHttp.getRequestHttpClient());
|
||||||
request.form("media", file);
|
request.form("media", file);
|
||||||
HttpResponse response = request.send();
|
HttpResponse response = request.send();
|
||||||
response.charset(StringPool.UTF_8);
|
response.charset(StandardCharsets.UTF_8.name());
|
||||||
|
|
||||||
String responseContent = response.bodyText();
|
String responseContent = response.bodyText();
|
||||||
WxError error = WxError.fromJson(responseContent, wxType);
|
WxError error = WxError.fromJson(responseContent, wxType);
|
||||||
|
@ -11,6 +11,7 @@ import me.chanjar.weixin.common.util.http.RequestHttp;
|
|||||||
import me.chanjar.weixin.common.util.http.SimpleGetRequestExecutor;
|
import me.chanjar.weixin.common.util.http.SimpleGetRequestExecutor;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* .
|
* .
|
||||||
@ -38,7 +39,7 @@ public class JoddHttpSimpleGetRequestExecutor extends SimpleGetRequestExecutor<H
|
|||||||
}
|
}
|
||||||
request.withConnectionProvider(requestHttp.getRequestHttpClient());
|
request.withConnectionProvider(requestHttp.getRequestHttpClient());
|
||||||
HttpResponse response = request.send();
|
HttpResponse response = request.send();
|
||||||
response.charset(StringPool.UTF_8);
|
response.charset(StandardCharsets.UTF_8.name());
|
||||||
|
|
||||||
return handleResponse(wxType, response.bodyText());
|
return handleResponse(wxType, response.bodyText());
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,7 @@ import me.chanjar.weixin.common.util.http.RequestHttp;
|
|||||||
import me.chanjar.weixin.common.util.http.SimplePostRequestExecutor;
|
import me.chanjar.weixin.common.util.http.SimplePostRequestExecutor;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* .
|
* .
|
||||||
@ -37,7 +38,7 @@ public class JoddHttpSimplePostRequestExecutor extends SimplePostRequestExecutor
|
|||||||
request.bodyText(postEntity);
|
request.bodyText(postEntity);
|
||||||
}
|
}
|
||||||
HttpResponse response = request.send();
|
HttpResponse response = request.send();
|
||||||
response.charset(StringPool.UTF_8);
|
response.charset(StandardCharsets.UTF_8.name());
|
||||||
|
|
||||||
return this.handleResponse(wxType, response.bodyText());
|
return this.handleResponse(wxType, response.bodyText());
|
||||||
}
|
}
|
||||||
|
@ -119,7 +119,7 @@
|
|||||||
<version>3.5.1</version>
|
<version>3.5.1</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<annotationProcessors>
|
<annotationProcessors>
|
||||||
cn.binarywang.wx.graal.GraalProcessor,lombok.launch.AnnotationProcessorHider$AnnotationProcessor,lombok.launch.AnnotationProcessorHider$ClaimingProcessor
|
com.github.binarywang.wx.graal.GraalProcessor,lombok.launch.AnnotationProcessorHider$AnnotationProcessor,lombok.launch.AnnotationProcessorHider$ClaimingProcessor
|
||||||
</annotationProcessors>
|
</annotationProcessors>
|
||||||
<annotationProcessorPaths>
|
<annotationProcessorPaths>
|
||||||
<path>
|
<path>
|
||||||
|
@ -126,7 +126,7 @@
|
|||||||
<version>3.5.1</version>
|
<version>3.5.1</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<annotationProcessors>
|
<annotationProcessors>
|
||||||
cn.binarywang.wx.graal.GraalProcessor,lombok.launch.AnnotationProcessorHider$AnnotationProcessor,lombok.launch.AnnotationProcessorHider$ClaimingProcessor
|
com.github.binarywang.wx.graal.GraalProcessor,lombok.launch.AnnotationProcessorHider$AnnotationProcessor,lombok.launch.AnnotationProcessorHider$ClaimingProcessor
|
||||||
</annotationProcessors>
|
</annotationProcessors>
|
||||||
<annotationProcessorPaths>
|
<annotationProcessorPaths>
|
||||||
<path>
|
<path>
|
||||||
|
@ -115,7 +115,7 @@
|
|||||||
<version>3.5.1</version>
|
<version>3.5.1</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<annotationProcessors>
|
<annotationProcessors>
|
||||||
cn.binarywang.wx.graal.GraalProcessor,lombok.launch.AnnotationProcessorHider$AnnotationProcessor,lombok.launch.AnnotationProcessorHider$ClaimingProcessor
|
com.github.binarywang.wx.graal.GraalProcessor,lombok.launch.AnnotationProcessorHider$AnnotationProcessor,lombok.launch.AnnotationProcessorHider$ClaimingProcessor
|
||||||
</annotationProcessors>
|
</annotationProcessors>
|
||||||
<annotationProcessorPaths>
|
<annotationProcessorPaths>
|
||||||
<path>
|
<path>
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package me.chanjar.weixin.mp.api;
|
package me.chanjar.weixin.mp.api;
|
||||||
|
|
||||||
import com.google.common.util.concurrent.ThreadFactoryBuilder;
|
import com.google.common.util.concurrent.ThreadFactoryBuilder;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
import me.chanjar.weixin.common.api.WxErrorExceptionHandler;
|
import me.chanjar.weixin.common.api.WxErrorExceptionHandler;
|
||||||
import me.chanjar.weixin.common.api.WxMessageDuplicateChecker;
|
import me.chanjar.weixin.common.api.WxMessageDuplicateChecker;
|
||||||
import me.chanjar.weixin.common.api.WxMessageInMemoryDuplicateChecker;
|
import me.chanjar.weixin.common.api.WxMessageInMemoryDuplicateChecker;
|
||||||
@ -49,6 +50,7 @@ import java.util.concurrent.*;
|
|||||||
*
|
*
|
||||||
* @author Daniel Qian
|
* @author Daniel Qian
|
||||||
*/
|
*/
|
||||||
|
@AllArgsConstructor
|
||||||
public class WxMpMessageRouter {
|
public class WxMpMessageRouter {
|
||||||
private static final int DEFAULT_THREAD_POOL_SIZE = 100;
|
private static final int DEFAULT_THREAD_POOL_SIZE = 100;
|
||||||
protected final Logger log = LoggerFactory.getLogger(WxMpMessageRouter.class);
|
protected final Logger log = LoggerFactory.getLogger(WxMpMessageRouter.class);
|
||||||
|
@ -12,6 +12,7 @@ import me.chanjar.weixin.common.error.WxErrorException;
|
|||||||
import me.chanjar.weixin.common.util.http.RequestHttp;
|
import me.chanjar.weixin.common.util.http.RequestHttp;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by ecoolper on 2017/5/5.
|
* Created by ecoolper on 2017/5/5.
|
||||||
@ -31,7 +32,7 @@ public class MaterialDeleteJoddHttpRequestExecutor extends MaterialDeleteRequest
|
|||||||
|
|
||||||
request.query("media_id", materialId);
|
request.query("media_id", materialId);
|
||||||
HttpResponse response = request.send();
|
HttpResponse response = request.send();
|
||||||
response.charset(StringPool.UTF_8);
|
response.charset(StandardCharsets.UTF_8.name());
|
||||||
String responseContent = response.bodyText();
|
String responseContent = response.bodyText();
|
||||||
WxError error = WxError.fromJson(responseContent, WxType.MP);
|
WxError error = WxError.fromJson(responseContent, WxType.MP);
|
||||||
if (error.getErrorCode() != 0) {
|
if (error.getErrorCode() != 0) {
|
||||||
|
@ -7,6 +7,7 @@ import jodd.http.HttpResponse;
|
|||||||
import jodd.http.ProxyInfo;
|
import jodd.http.ProxyInfo;
|
||||||
import jodd.util.StringPool;
|
import jodd.util.StringPool;
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import me.chanjar.weixin.common.enums.WxType;
|
import me.chanjar.weixin.common.enums.WxType;
|
||||||
import me.chanjar.weixin.common.error.WxError;
|
import me.chanjar.weixin.common.error.WxError;
|
||||||
import me.chanjar.weixin.common.error.WxErrorException;
|
import me.chanjar.weixin.common.error.WxErrorException;
|
||||||
@ -18,12 +19,13 @@ import org.slf4j.Logger;
|
|||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by ecoolper on 2017/5/5.
|
* Created by ecoolper on 2017/5/5.
|
||||||
*/
|
*/
|
||||||
|
@Slf4j
|
||||||
public class MaterialNewsInfoJoddHttpRequestExecutor extends MaterialNewsInfoRequestExecutor<HttpConnectionProvider, ProxyInfo> {
|
public class MaterialNewsInfoJoddHttpRequestExecutor extends MaterialNewsInfoRequestExecutor<HttpConnectionProvider, ProxyInfo> {
|
||||||
private final Logger logger = LoggerFactory.getLogger(this.getClass());
|
|
||||||
public MaterialNewsInfoJoddHttpRequestExecutor(RequestHttp requestHttp) {
|
public MaterialNewsInfoJoddHttpRequestExecutor(RequestHttp requestHttp) {
|
||||||
super(requestHttp);
|
super(requestHttp);
|
||||||
}
|
}
|
||||||
@ -38,10 +40,10 @@ public class MaterialNewsInfoJoddHttpRequestExecutor extends MaterialNewsInfoReq
|
|||||||
.withConnectionProvider(requestHttp.getRequestHttpClient())
|
.withConnectionProvider(requestHttp.getRequestHttpClient())
|
||||||
.body(WxGsonBuilder.create().toJson(ImmutableMap.of("media_id", materialId)));
|
.body(WxGsonBuilder.create().toJson(ImmutableMap.of("media_id", materialId)));
|
||||||
HttpResponse response = request.send();
|
HttpResponse response = request.send();
|
||||||
response.charset(StringPool.UTF_8);
|
response.charset(StandardCharsets.UTF_8.name());
|
||||||
|
|
||||||
String responseContent = response.bodyText();
|
String responseContent = response.bodyText();
|
||||||
this.logger.debug("响应原始数据:{}", responseContent);
|
log.debug("响应原始数据:{}", responseContent);
|
||||||
WxError error = WxError.fromJson(responseContent, WxType.MP);
|
WxError error = WxError.fromJson(responseContent, WxType.MP);
|
||||||
if (error.getErrorCode() != 0) {
|
if (error.getErrorCode() != 0) {
|
||||||
throw new WxErrorException(error);
|
throw new WxErrorException(error);
|
||||||
|
@ -17,6 +17,7 @@ import me.chanjar.weixin.mp.bean.material.WxMpMaterialUploadResult;
|
|||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileNotFoundException;
|
import java.io.FileNotFoundException;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -50,7 +51,7 @@ public class MaterialUploadJoddHttpRequestExecutor extends MaterialUploadRequest
|
|||||||
}
|
}
|
||||||
|
|
||||||
HttpResponse response = request.send();
|
HttpResponse response = request.send();
|
||||||
response.charset(StringPool.UTF_8);
|
response.charset(StandardCharsets.UTF_8.name());
|
||||||
String responseContent = response.bodyText();
|
String responseContent = response.bodyText();
|
||||||
WxError error = WxError.fromJson(responseContent, WxType.MP);
|
WxError error = WxError.fromJson(responseContent, WxType.MP);
|
||||||
if (error.getErrorCode() != 0) {
|
if (error.getErrorCode() != 0) {
|
||||||
|
@ -13,6 +13,7 @@ import me.chanjar.weixin.common.util.http.RequestHttp;
|
|||||||
import me.chanjar.weixin.mp.bean.material.WxMpMaterialVideoInfoResult;
|
import me.chanjar.weixin.mp.bean.material.WxMpMaterialVideoInfoResult;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by ecoolper on 2017/5/5.
|
* Created by ecoolper on 2017/5/5.
|
||||||
@ -32,7 +33,7 @@ public class MaterialVideoInfoJoddHttpRequestExecutor extends MaterialVideoInfoR
|
|||||||
|
|
||||||
request.query("media_id", materialId);
|
request.query("media_id", materialId);
|
||||||
HttpResponse response = request.send();
|
HttpResponse response = request.send();
|
||||||
response.charset(StringPool.UTF_8);
|
response.charset(StandardCharsets.UTF_8.name());
|
||||||
String responseContent = response.bodyText();
|
String responseContent = response.bodyText();
|
||||||
WxError error = WxError.fromJson(responseContent, WxType.MP);
|
WxError error = WxError.fromJson(responseContent, WxType.MP);
|
||||||
if (error.getErrorCode() != 0) {
|
if (error.getErrorCode() != 0) {
|
||||||
|
@ -37,7 +37,7 @@ public class MaterialVoiceAndImageDownloadJoddHttpRequestExecutor extends Materi
|
|||||||
|
|
||||||
request.query("media_id", materialId);
|
request.query("media_id", materialId);
|
||||||
HttpResponse response = request.send();
|
HttpResponse response = request.send();
|
||||||
response.charset(StringPool.UTF_8);
|
response.charset(StandardCharsets.UTF_8.name());
|
||||||
try (InputStream inputStream = new ByteArrayInputStream(response.bodyBytes())) {
|
try (InputStream inputStream = new ByteArrayInputStream(response.bodyBytes())) {
|
||||||
// 下载媒体文件出错
|
// 下载媒体文件出错
|
||||||
byte[] responseContent = IOUtils.toByteArray(inputStream);
|
byte[] responseContent = IOUtils.toByteArray(inputStream);
|
||||||
|
@ -14,6 +14,7 @@ import me.chanjar.weixin.mp.bean.material.WxMediaImgUploadResult;
|
|||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by ecoolper on 2017/5/5.
|
* Created by ecoolper on 2017/5/5.
|
||||||
@ -39,7 +40,7 @@ public class MediaImgUploadHttpRequestExecutor extends MediaImgUploadRequestExec
|
|||||||
|
|
||||||
request.form("media", data);
|
request.form("media", data);
|
||||||
HttpResponse response = request.send();
|
HttpResponse response = request.send();
|
||||||
response.charset(StringPool.UTF_8);
|
response.charset(StandardCharsets.UTF_8.name());
|
||||||
String responseContent = response.bodyText();
|
String responseContent = response.bodyText();
|
||||||
WxError error = WxError.fromJson(responseContent, WxType.MP);
|
WxError error = WxError.fromJson(responseContent, WxType.MP);
|
||||||
if (error.getErrorCode() != 0) {
|
if (error.getErrorCode() != 0) {
|
||||||
|
@ -19,6 +19,7 @@ import java.io.File;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.net.URLEncoder;
|
import java.net.URLEncoder;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -47,7 +48,7 @@ public class QrCodeJoddHttpRequestExecutor extends QrCodeRequestExecutor<HttpCon
|
|||||||
request.withConnectionProvider(requestHttp.getRequestHttpClient());
|
request.withConnectionProvider(requestHttp.getRequestHttpClient());
|
||||||
|
|
||||||
HttpResponse response = request.send();
|
HttpResponse response = request.send();
|
||||||
response.charset(StringPool.UTF_8);
|
response.charset(StandardCharsets.UTF_8.name());
|
||||||
String contentTypeHeader = response.header("Content-Type");
|
String contentTypeHeader = response.header("Content-Type");
|
||||||
if (MimeTypes.MIME_TEXT_PLAIN.equals(contentTypeHeader)) {
|
if (MimeTypes.MIME_TEXT_PLAIN.equals(contentTypeHeader)) {
|
||||||
String responseContent = response.bodyText();
|
String responseContent = response.bodyText();
|
||||||
|
@ -122,7 +122,7 @@
|
|||||||
<version>3.5.1</version>
|
<version>3.5.1</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<annotationProcessors>
|
<annotationProcessors>
|
||||||
cn.binarywang.wx.graal.GraalProcessor,lombok.launch.AnnotationProcessorHider$AnnotationProcessor,lombok.launch.AnnotationProcessorHider$ClaimingProcessor
|
com.github.binarywang.wx.graal.GraalProcessor,lombok.launch.AnnotationProcessorHider$AnnotationProcessor,lombok.launch.AnnotationProcessorHider$ClaimingProcessor
|
||||||
</annotationProcessors>
|
</annotationProcessors>
|
||||||
<annotationProcessorPaths>
|
<annotationProcessorPaths>
|
||||||
<path>
|
<path>
|
||||||
|
@ -19,6 +19,7 @@ import java.io.File;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.net.URLEncoder;
|
import java.net.URLEncoder;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -49,7 +50,7 @@ public class MaQrCodeJoddHttpRequestExecutor extends MaQrCodeRequestExecutor<Htt
|
|||||||
request.withConnectionProvider(requestHttp.getRequestHttpClient());
|
request.withConnectionProvider(requestHttp.getRequestHttpClient());
|
||||||
|
|
||||||
HttpResponse response = request.send();
|
HttpResponse response = request.send();
|
||||||
response.charset(StringPool.UTF_8);
|
response.charset(StandardCharsets.UTF_8.name());
|
||||||
String contentTypeHeader = response.header("Content-Type");
|
String contentTypeHeader = response.header("Content-Type");
|
||||||
if (MimeTypes.MIME_TEXT_PLAIN.equals(contentTypeHeader)) {
|
if (MimeTypes.MIME_TEXT_PLAIN.equals(contentTypeHeader)) {
|
||||||
String responseContent = response.bodyText();
|
String responseContent = response.bodyText();
|
||||||
|
@ -102,7 +102,7 @@
|
|||||||
<version>3.5.1</version>
|
<version>3.5.1</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<annotationProcessors>
|
<annotationProcessors>
|
||||||
cn.binarywang.wx.graal.GraalProcessor,lombok.launch.AnnotationProcessorHider$AnnotationProcessor,lombok.launch.AnnotationProcessorHider$ClaimingProcessor
|
com.github.binarywang.wx.graal.GraalProcessor,lombok.launch.AnnotationProcessorHider$AnnotationProcessor,lombok.launch.AnnotationProcessorHider$ClaimingProcessor
|
||||||
</annotationProcessors>
|
</annotationProcessors>
|
||||||
<annotationProcessorPaths>
|
<annotationProcessorPaths>
|
||||||
<path>
|
<path>
|
||||||
|
Loading…
Reference in New Issue
Block a user