# 阿里云SMS
# 核心配置
# Yaml配置
# ========================= HaiChuang Settings =========================
haichuang:
sdk:
aliyunsms:
# AccessKeyId
access-key-id: xxx
# AccessKeySecret
access-key-secret: xxx
# 短信签名
default-sign-name: xxx
# 默认短信模板ID, 可为空
default-template-code: xxx
1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12
# 核心Service
# AliYunSmsService (opens new window)
全限定名:pro.haichuang.framework.sdk.aliyunsms.service.AliYunSmsService (opens new window)
阿里云SMS核心Service
该类为阿里云SMS核心Service,封装了常用的方法
警告
所有SMS相关操作必须使用AliYunSmsService接口
# DefaultAliYunSmsServiceImpl (opens new window)
全限定名:pro.haichuang.framework.sdk.aliyunsms.service.DefaultAliYunSmsServiceImpl (opens new window)
阿里云SMS核心Service默认实现
该类为阿里云SMS核心Service默认实现,已默认注入到Spring中,支持自定义实现(需要手动注入到Spring中)
# 核心工具类
# AliYunSmsUtils (opens new window)
全限定名:pro.haichuang.framework.sdk.aliyunsms.util.AliYunSmsUtils (opens new window)
阿里云SMS工具类
该类为阿里云SMS工具类,基于第三方二次封装,推荐使用AliYunSmsService进行操作
# 👇Example👇
@RestController
@RequestMapping("/test")
public class TestController {
@Autowired
private AliYunSmsService aliYunSmsService;
......
}
1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9