Commit f529ad6b by fanjiaxin

推客短信发送调试

parent 6d8287bc
Pipeline #75536 passed with stages
in 1 minute 20 seconds
...@@ -7,15 +7,12 @@ ...@@ -7,15 +7,12 @@
package com.netease.yanxuan.wx.store.sharer.integration.client.impl; package com.netease.yanxuan.wx.store.sharer.integration.client.impl;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.netease.yanxuan.wx.store.sharer.common.exception.BizException; import com.netease.yanxuan.missa.specs.interfaces.response.MissaResponse;
import com.netease.yanxuan.wx.store.sharer.integration.client.IUasClient; import com.netease.yanxuan.wx.store.sharer.integration.client.IUasClient;
import com.netease.yanxuan.wx.store.sharer.integration.facade.UasFacade; import com.netease.yanxuan.wx.store.sharer.integration.facade.UasFacade;
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 com.netease.yanxuan.wx.store.sharer.integration.meta.model.bo.SmsCodeScenesConfigBO;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.HashMap; import java.util.HashMap;
...@@ -45,17 +42,14 @@ public class UasClientImpl implements IUasClient { ...@@ -45,17 +42,14 @@ public class UasClientImpl implements IUasClient {
Map<String, Object> params = assembleSmsArg(uid, phone, code, scenes, scenesConfigBO); Map<String, Object> params = assembleSmsArg(uid, phone, code, scenes, scenesConfigBO);
log.error("[op:UasClientImpl:sendSmsCode] params:{}", JSON.toJSONString(params)); log.error("[op:UasClientImpl:sendSmsCode] params:{}", JSON.toJSONString(params));
try { try {
SendSmsCodeBO rpcResult = uasFacade.pushSmsCode(params); MissaResponse<Void> missaResponse = uasFacade.pushSmsCode(params);
log.error("[op:UasClientImpl:sendSmsCode] rpcResult:{}", JSON.toJSONString(rpcResult)); log.error("[op:UasClientImpl:sendSmsCode] rpcResult:{}", JSON.toJSONString(missaResponse));
if (null == rpcResult) { if (null == missaResponse) {
return false; return false;
} }
if (HttpStatus.OK.value() == rpcResult.getCode()) { if (missaResponse.isOK()) {
return true; return true;
} }
if (StringUtils.isNotBlank(rpcResult.getErrorCode())) {
throw new BizException(rpcResult.getErrorCode());
}
} catch (Exception e) { } catch (Exception e) {
log.error("[op:UasClientImpl:sendSmsCode] is error", e); log.error("[op:UasClientImpl:sendSmsCode] is error", e);
} }
......
package com.netease.yanxuan.wx.store.sharer.integration.facade; package com.netease.yanxuan.wx.store.sharer.integration.facade;
import com.netease.yanxuan.missa.client.annotation.MissaClient; import com.netease.yanxuan.missa.client.annotation.MissaClient;
import com.netease.yanxuan.wx.store.sharer.integration.meta.model.bo.SendSmsCodeBO; import com.netease.yanxuan.missa.specs.interfaces.response.MissaResponse;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import java.util.Map; import java.util.Map;
@MissaClient(serviceCode = "logistics-uas") @MissaClient(serviceCode = "logistics-uas")
public interface UasFacade { public interface UasFacade {
@RequestMapping(value = "/push/sms/yanxuan-wx-store-sharer", method = RequestMethod.POST, produces = MediaType.APPLICATION_FORM_URLENCODED_VALUE) @PostMapping(value = "/push/sms/yanxuan-wx-store-sharer", produces= MediaType.APPLICATION_FORM_URLENCODED_VALUE)
SendSmsCodeBO pushSmsCode(@RequestBody Map<String, Object> param); MissaResponse<Void> pushSmsCode(@RequestBody Map<String, Object> param);
} }
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