短信提交 2021-03-28,增加发送日志
This commit is contained in:
@@ -55,7 +55,7 @@ public class SmsClientFactory {
|
||||
throw new ServiceException(INVALID_CHANNEL_CODE);
|
||||
}
|
||||
switch (channelEnum) {
|
||||
case ALI:
|
||||
case ALIYUN:
|
||||
return new AliyunSmsClient(channelVO);
|
||||
case YUN_PIAN:
|
||||
return new YunpianSmsClient(channelVO);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package cn.iocoder.dashboard.framework.sms.core.enums;
|
||||
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
@@ -13,22 +14,22 @@ import lombok.Getter;
|
||||
@AllArgsConstructor
|
||||
public enum SmsChannelEnum {
|
||||
|
||||
ALI("ALI", "阿里"),
|
||||
YUN_PIAN("YUN_PIAN", "云片"),
|
||||
HUA_WEI("HUA_WEI", "华为"),
|
||||
TENCENT("TENCENT", "腾讯");
|
||||
ALIYUN("ALIYUN", "阿里云"),
|
||||
TENCENT("TENCENT", "腾讯云"),
|
||||
HUA_WEI("HUA_WEI", "华为云"),;
|
||||
|
||||
/**
|
||||
* 编码
|
||||
*/
|
||||
private final String code;
|
||||
|
||||
/**
|
||||
* 名字
|
||||
*/
|
||||
private final String name;
|
||||
|
||||
public static SmsChannelEnum getByCode(String code) {
|
||||
for (SmsChannelEnum value : SmsChannelEnum.values()) {
|
||||
if (value.getCode().equals(code)) {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
return ArrayUtil.firstMatch(o -> o.getCode().equals(code), values());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
package cn.iocoder.dashboard.framework.sms.core.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 短信的发送失败类型的枚举
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum SmsSendFailureTypeEnum {
|
||||
|
||||
// ========== 模板相关(100 开头) ==========
|
||||
SMS_TEMPLATE_DISABLE(100), // 短信模板被禁用
|
||||
|
||||
// ========== 其它相关 ==========
|
||||
;
|
||||
|
||||
/**
|
||||
* 失败类型
|
||||
*/
|
||||
private final int type;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user