修改调用service

This commit is contained in:
刘才福 2023-07-10 16:26:37 +08:00
parent ba3d8e7eee
commit d5d73bfd71

View File

@ -5,11 +5,11 @@ import cn.axzo.basics.common.constant.ConstStringPool;
import cn.axzo.basics.common.exception.ServiceException;
import cn.axzo.core.constant.RedisNameConstants;
import cn.axzo.msg.center.common.redis.IAxzoJedisManager;
import cn.axzo.msg.center.domain.enums.MnsTemplateEnum;
import cn.axzo.msg.center.domain.enums.InsideSmsCodeEnum;
import cn.axzo.msg.center.domain.enums.MnsTemplateEnum;
import cn.axzo.msg.center.notices.common.properties.SmsProperties;
import cn.axzo.msg.center.notices.http.api.api.MessageNotifyApi;
import cn.axzo.msg.center.notices.http.api.request.SendMobileMessageRequest;
import cn.axzo.msg.center.notices.manager.api.dto.request.MnsRequestDto;
import cn.axzo.msg.center.notices.service.api.MessageService;
import cn.axzo.msg.center.notices.service.gateway.SmsGateway;
import cn.axzo.msg.center.notices.service.request.CaptchaParam;
import cn.axzo.msg.center.notices.service.response.SmsCodeInfoRes;
@ -50,7 +50,7 @@ public class SmsManager extends BaseManager implements SmsGateway {
@Resource
private SmsProperties smsProperties;
@Resource
private MessageNotifyApi messageNotifyApi;
private MessageService messageService;
@Value("${phone.isSendMnsCode}")
private boolean isSendMnsCode;
@ -197,18 +197,12 @@ public class SmsManager extends BaseManager implements SmsGateway {
if (!isSendMnsCode) {
return;
}
SendMobileMessageRequest request = new SendMobileMessageRequest();
MnsRequestDto request = new MnsRequestDto();
request.setAppCode(mns.appCode);
request.setPhoneNo(phoneNumber);
request.setTemplateNo(mns.templateNo);
request.setParams(param);
request.setRequestNo(UUID.randomUUID().toString());
cn.azxo.framework.common.model.CommonResponse commonResponse = messageNotifyApi
.sendMobileMessage(request);
if (!commonResponse.getCode().equals(SUCCESS)) {
log.warn("发送验证码失败 request:{},commonResponse:{}",
JSON.toJSONString(request), JSON.toJSONString(commonResponse));
// throw new ServiceException(commonResponse.getMsg());
}
messageService.sendMessage(request);
}
}