From 1b6275afb3d03c4984bc5d6d009d2c26de5743ed Mon Sep 17 00:00:00 2001 From: Binary Wang Date: Tue, 28 Jun 2022 11:42:03 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E4=BC=98=E5=8C=96=E9=83=A8=E5=88=86?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E8=BE=93=E5=87=BA=EF=BC=8C=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E8=BE=93=E5=87=BA=E7=BA=A7=E5=88=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cp/api/impl/BaseWxCpServiceImpl.java | 4 +-- .../miniapp/api/impl/BaseWxMaServiceImpl.java | 4 +-- .../mp/api/impl/BaseWxMpServiceImpl.java | 4 +-- .../api/impl/WxOpenServiceAbstractImpl.java | 9 ++++--- .../service/CustomDeclarationService.java | 25 +++++++++++-------- 5 files changed, 25 insertions(+), 21 deletions(-) diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/BaseWxCpServiceImpl.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/BaseWxCpServiceImpl.java index b72f0f0fb..3f12961dd 100644 --- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/BaseWxCpServiceImpl.java +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/BaseWxCpServiceImpl.java @@ -333,12 +333,12 @@ public abstract class BaseWxCpServiceImpl implements WxCpService, RequestH } if (error.getErrorCode() != 0) { - log.error("\n【请求地址】: {}\n【请求参数】:{}\n【错误信息】:{}", uriWithAccessToken, dataForLog, error); + log.warn("\n【请求地址】: {}\n【请求参数】:{}\n【错误信息】:{}", uriWithAccessToken, dataForLog, error); throw new WxErrorException(error, e); } return null; } catch (IOException e) { - log.error("\n【请求地址】: {}\n【请求参数】:{}\n【异常信息】:{}", uriWithAccessToken, dataForLog, e.getMessage()); + log.warn("\n【请求地址】: {}\n【请求参数】:{}\n【异常信息】:{}", uriWithAccessToken, dataForLog, e.getMessage()); throw new WxRuntimeException(e); } } diff --git a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/impl/BaseWxMaServiceImpl.java b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/impl/BaseWxMaServiceImpl.java index 8151af88b..314f20de7 100644 --- a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/impl/BaseWxMaServiceImpl.java +++ b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/impl/BaseWxMaServiceImpl.java @@ -296,12 +296,12 @@ public abstract class BaseWxMaServiceImpl implements WxMaService, RequestH } if (error.getErrorCode() != 0) { - log.error("\n【请求地址】: {}\n【请求参数】:{}\n【错误信息】:{}", uriWithAccessToken, dataForLog, error); + log.warn("\n【请求地址】: {}\n【请求参数】:{}\n【错误信息】:{}", uriWithAccessToken, dataForLog, error); throw new WxErrorException(error, e); } return null; } catch (IOException e) { - log.error("\n【请求地址】: {}\n【请求参数】:{}\n【异常信息】:{}", uriWithAccessToken, dataForLog, e.getMessage()); + log.warn("\n【请求地址】: {}\n【请求参数】:{}\n【异常信息】:{}", uriWithAccessToken, dataForLog, e.getMessage()); throw new WxRuntimeException(e); } } diff --git a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/impl/BaseWxMpServiceImpl.java b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/impl/BaseWxMpServiceImpl.java index 2430f91f2..b8d1792c2 100644 --- a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/impl/BaseWxMpServiceImpl.java +++ b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/impl/BaseWxMpServiceImpl.java @@ -435,12 +435,12 @@ public abstract class BaseWxMpServiceImpl implements WxMpService, RequestH } if (error.getErrorCode() != 0) { - log.error("\n【请求地址】: {}\n【请求参数】:{}\n【错误信息】:{}", uriWithAccessToken, dataForLog, error); + log.warn("\n【请求地址】: {}\n【请求参数】:{}\n【错误信息】:{}", uriWithAccessToken, dataForLog, error); throw new WxErrorException(error, e); } return null; } catch (IOException e) { - log.error("\n【请求地址】: {}\n【请求参数】:{}\n【异常信息】:{}", uriWithAccessToken, dataForLog, e.getMessage()); + log.warn("\n【请求地址】: {}\n【请求参数】:{}\n【异常信息】:{}", uriWithAccessToken, dataForLog, e.getMessage()); throw new WxErrorException(e); } } diff --git a/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/impl/WxOpenServiceAbstractImpl.java b/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/impl/WxOpenServiceAbstractImpl.java index fa89d0937..845441c2d 100644 --- a/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/impl/WxOpenServiceAbstractImpl.java +++ b/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/impl/WxOpenServiceAbstractImpl.java @@ -1,5 +1,6 @@ package me.chanjar.weixin.open.api.impl; +import lombok.extern.slf4j.Slf4j; import me.chanjar.weixin.common.enums.WxType; import me.chanjar.weixin.common.error.WxError; import me.chanjar.weixin.common.error.WxErrorException; @@ -17,8 +18,8 @@ import java.io.IOException; /** * @author 007 */ +@Slf4j public abstract class WxOpenServiceAbstractImpl implements WxOpenService, RequestHttp { - private final Logger log = LoggerFactory.getLogger(this.getClass()); private WxOpenComponentService wxOpenComponentService = new WxOpenComponentServiceImpl(this); private WxOpenConfigStorage wxOpenConfigStorage; @@ -46,17 +47,17 @@ public abstract class WxOpenServiceAbstractImpl implements WxOpenService, protected T execute(RequestExecutor executor, String uri, E data) throws WxErrorException { try { T result = executor.execute(uri, data, WxType.Open); - this.log.debug("\n【请求地址】: {}\n【请求参数】:{}\n【响应数据】:{}", uri, data, result); + log.debug("\n【请求地址】: {}\n【请求参数】:{}\n【响应数据】:{}", uri, data, result); return result; } catch (WxErrorException e) { WxError error = e.getError(); if (error.getErrorCode() != 0) { - this.log.error("\n【请求地址】: {}\n【请求参数】:{}\n【错误信息】:{}", uri, data, error); + log.warn("\n【请求地址】: {}\n【请求参数】:{}\n【错误信息】:{}", uri, data, error); throw new WxErrorException(error, e); } return null; } catch (IOException e) { - this.log.error("\n【请求地址】: {}\n【请求参数】:{}\n【异常信息】:{}", uri, data, e.getMessage()); + log.warn("\n【请求地址】: {}\n【请求参数】:{}\n【异常信息】:{}", uri, data, e.getMessage()); throw new WxRuntimeException(e); } } diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/CustomDeclarationService.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/CustomDeclarationService.java index f2980fed4..98f55d51d 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/CustomDeclarationService.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/CustomDeclarationService.java @@ -13,15 +13,18 @@ import com.github.binarywang.wxpay.exception.WxPayException; */ public interface CustomDeclarationService { - static String DECLARATION_BASE_URL = "https://apihk.mch.weixin.qq.com/global/v3/customs"; + /** + * The constant DECLARATION_BASE_URL. + */ + String DECLARATION_BASE_URL = "https://apihk.mch.weixin.qq.com/global/v3/customs"; /** *
    * 报关API
-   * 文档地址: https://pay.weixin.qq.com/wiki/doc/api/wxpay/ch/declarecustom_ch/chapter3_1.shtml
+   * 文档地址: ...
    * 
* - * @param request + * @param request the request * @return 返回数据 declaration result * @throws WxPayException the wx pay exception */ @@ -30,10 +33,10 @@ public interface CustomDeclarationService { /** *
    * 报关查询API
-   * 文档地址: https://pay.weixin.qq.com/wiki/doc/api/wxpay/ch/declarecustom_ch/chapter3_3.shtml
+   * 文档地址: ...
    * 
* - * @param request + * @param request the request * @return 返回数据 declaration query result * @throws WxPayException the wx pay exception */ @@ -42,10 +45,10 @@ public interface CustomDeclarationService { /** *
    * 身份信息校验API
-   * 文档地址: https://pay.weixin.qq.com/wiki/doc/api/wxpay/ch/declarecustom_ch/chapter3_2.shtml
+   * 文档地址: ...
    * 
* - * @param request + * @param request the request * @return 返回数据 verify certification result * @throws WxPayException the wx pay exception */ @@ -54,10 +57,10 @@ public interface CustomDeclarationService { /** *
    * 报关信息修改API
-   * 文档地址: https://pay.weixin.qq.com/wiki/doc/api/wxpay/ch/declarecustom_ch/chapter3_5.shtml
+   * 文档地址: ...
    * 
* - * @param request + * @param request the request * @return 返回数据 declaration result * @throws WxPayException the wx pay exception */ @@ -66,10 +69,10 @@ public interface CustomDeclarationService { /** *
    * 报关重推API
-   * 文档地址: https://pay.weixin.qq.com/wiki/doc/api/wxpay/ch/declarecustom_ch/chapter3_4.shtml
+   * 文档地址: ...
    * 
* - * @param request + * @param request the request * @return 返回数据 redeclaration result * @throws WxPayException the wx pay exception */