Commit 7bd0d4fb by fanjiaxin

推客分佣单阿波罗配置调整

parent 169ef3ce
Pipeline #75528 passed with stages
in 1 minute 7 seconds
......@@ -7,14 +7,17 @@
package com.netease.yanxuan.wx.store.sharer.integration.client.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.netease.yanxuan.wx.store.sharer.common.exception.BizException;
import com.netease.yanxuan.wx.store.sharer.integration.client.IUasClient;
import com.netease.yanxuan.wx.store.sharer.integration.config.RpcConfig;
import com.netease.yanxuan.wx.store.sharer.integration.handler.RestTemplateHandler;
import com.netease.yanxuan.wx.store.sharer.integration.meta.model.bo.SendSmsCodeBO;
import com.netease.yanxuan.wx.store.sharer.integration.meta.model.bo.SmsCodeScenesConfigBO;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Service;
import java.util.HashMap;
......@@ -50,13 +53,21 @@ public class UasClientImpl implements IUasClient {
String httpUrl = rpcConfig.getUasUrl() + SMS_SEND_PATH + PRODUCT;
try {
log.error("[op:UasClientImpl:sendSmsCode] httpUrl:{}", httpUrl);
JSONObject rpcResult = restTemplateHandler.execute(httpUrl, HttpMethod.POST, params, JSONObject.class);
SendSmsCodeBO rpcResult = restTemplateHandler.execute(httpUrl, HttpMethod.POST, params, SendSmsCodeBO.class);
log.error("[op:UasClientImpl:sendSmsCode] rpcResult:{}", JSON.toJSONString(rpcResult));
return rpcResult.getIntValue("code") == 200;
if(null == rpcResult){
return false;
}
if(HttpStatus.OK.value() == rpcResult.getCode()){
return true;
}
if(StringUtils.isNotBlank(rpcResult.getErrorCode())){
throw new BizException(rpcResult.getErrorCode());
}
} catch (Exception e) {
log.error("[op:UasClientImpl:sendSmsCode] is error", e);
return false;
}
return false;
}
......
package com.netease.yanxuan.wx.store.sharer.integration.meta.model.bo;
import lombok.Data;
import java.io.Serializable;
/**
* @Description 微信凭证-核心对象
* @Author fanjiaxin
* @Date 2025/3/11 19:05
*/
@Data
public class SendSmsCodeBO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 响应码
*/
private Integer code;
/**
* 错误编码
*/
private String errorCode;
}
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