Commit a8df588c by fanjiaxin

代码初始化

parent a59e74b5
Pipeline #71451 passed with stages
in 1 minute 10 seconds
......@@ -6,6 +6,8 @@ package com.netease.yanxuan.wx.store.sharer.integration.constant;
* @Date 2025/3/11 11:59
*/
public class WeChatApi {
public static final String WECHAT_REQUEST_SUCCESS_CODE = "0";
/**
* 获取用户认证信息
*/
......
......@@ -2,6 +2,7 @@ package com.netease.yanxuan.wx.store.sharer.integration.handler;
import com.netease.yanxuan.wx.store.sharer.common.exception.BizException;
import com.netease.yanxuan.wx.store.sharer.common.handler.RestTemplateClient;
import com.netease.yanxuan.wx.store.sharer.integration.constant.WeChatApi;
import com.netease.yanxuan.wx.store.sharer.integration.meta.model.vo.WeChatCoreVO;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
......@@ -21,7 +22,7 @@ public class WeChatRestTemplateHandler {
public <T, R extends WeChatCoreVO> R execute(String url, HttpMethod method, T params, Class<R> resType) {
R result = restTemplateClient.execute(url, method, params, resType);
if (!"0".equals(result.getErrcode())) {
if (!WeChatApi.WECHAT_REQUEST_SUCCESS_CODE.equals(result.getErrcode())) {
throw new BizException("调用微信接口失败," + result.getErrmsg());
}
return result;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment