🎨 升级部分依赖版本,优化代码,部分代码增加泛型参数
This commit is contained in:
@@ -340,7 +340,7 @@ public interface WxQidianService extends WxService {
|
||||
*
|
||||
* @return RequestHttp对象 request http
|
||||
*/
|
||||
RequestHttp getRequestHttp();
|
||||
RequestHttp<?, ?> getRequestHttp();
|
||||
|
||||
WxQidianDialService getDialService();
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user