YunaiV 2023-10-20 00:31:35 +08:00
parent 3590336b1c
commit 52ebcaaad7

View File

@ -5,7 +5,6 @@ import cn.hutool.core.util.StrUtil;
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.sms.core.client.SmsClient;
import cn.iocoder.yudao.framework.sms.core.client.SmsClientFactory;
import cn.iocoder.yudao.framework.sms.core.client.SmsCommonResult;
import cn.iocoder.yudao.framework.sms.core.client.dto.SmsTemplateRespDTO;
import cn.iocoder.yudao.module.system.controller.admin.sms.vo.template.SmsTemplateCreateReqVO;
@ -54,9 +53,6 @@ public class SmsTemplateServiceImpl implements SmsTemplateService {
@Resource
private SmsChannelService smsChannelService;
@Resource
private SmsClientFactory smsClientFactory;
@Override
public Long createSmsTemplate(SmsTemplateCreateReqVO createReqVO) {
// 校验短信渠道
@ -174,7 +170,7 @@ public class SmsTemplateServiceImpl implements SmsTemplateService {
@VisibleForTesting
void validateApiTemplate(Long channelId, String apiTemplateId) {
// 获得短信模板
SmsClient smsClient = smsClientFactory.getSmsClient(channelId);
SmsClient smsClient = smsChannelService.getSmsClient(channelId);
Assert.notNull(smsClient, String.format("短信客户端(%d) 不存在", channelId));
SmsCommonResult<SmsTemplateRespDTO> templateResult = smsClient.getSmsTemplate(apiTemplateId);
// 校验短信模板是否正确