1
0
mirror of synced 2025-12-10 00:10:57 +08:00

🎨 升级部分依赖版本,优化代码,部分代码增加泛型参数

This commit is contained in:
altusea
2025-05-13 15:56:14 +08:00
committed by GitHub
parent a7b007f853
commit 063fbb7f19
263 changed files with 559 additions and 607 deletions

View File

@@ -340,7 +340,7 @@ public interface WxQidianService extends WxService {
*
* @return RequestHttp对象 request http
*/
RequestHttp getRequestHttp();
RequestHttp<?, ?> getRequestHttp();
WxQidianDialService getDialService();

View File

@@ -56,7 +56,7 @@ public abstract class BaseWxQidianServiceImpl<H, P> implements WxQidianService,
try {
return SHA1.gen(this.getWxMpConfigStorage().getToken(), timestamp, nonce).equals(signature);
} catch (Exception e) {
log.error("Checking signature failed, and the reason is :" + e.getMessage());
log.error("Checking signature failed, and the reason is :{}", e.getMessage());
return false;
}
}
@@ -405,7 +405,7 @@ public abstract class BaseWxQidianServiceImpl<H, P> implements WxQidianService,
}
@Override
public RequestHttp getRequestHttp() {
public RequestHttp<H, P> getRequestHttp() {
return this;
}

View File

@@ -60,9 +60,7 @@ public class WxQidianServiceOkHttpImpl extends BaseWxQidianServiceImpl<OkHttpCli
Request request = new Request.Builder().url(url).get().build();
Response response = getRequestHttpClient().newCall(request).execute();
return this.extractAccessToken(Objects.requireNonNull(response.body()).string());
} catch (IOException e) {
throw new WxRuntimeException(e);
} catch (InterruptedException e) {
} catch (IOException | InterruptedException e) {
throw new WxRuntimeException(e);
} finally {
if (locked) {

View File

@@ -5,12 +5,7 @@ package me.chanjar.weixin.qidian.util;
* created on 2020年12月26日
*/
public class WxQidianConfigStorageHolder {
private static final ThreadLocal<String> THREAD_LOCAL = new ThreadLocal<String>() {
@Override
protected String initialValue() {
return "default";
}
};
private static final ThreadLocal<String> THREAD_LOCAL = ThreadLocal.withInitial(() -> "default");
public static String get() {
return THREAD_LOCAL.get();