mirror of
https://gitee.com/dromara/RuoYi-Vue-Plus.git
synced 2026-09-21 18:45:57 +08:00
腾讯短信引入的包优化。
Signed-off-by: scmiot <scmiot@qq.com>
This commit is contained in:
parent
fe8db721d7
commit
d259185264
4
pom.xml
4
pom.xml
@ -46,7 +46,7 @@
|
||||
<aws-java-sdk-s3.version>1.12.324</aws-java-sdk-s3.version>
|
||||
<!-- SMS 配置 -->
|
||||
<aliyun.sms.version>2.0.22</aliyun.sms.version>
|
||||
<tencent.sms.version>3.1.611</tencent.sms.version>
|
||||
<tencent.sms.version>3.1.635</tencent.sms.version>
|
||||
</properties>
|
||||
|
||||
<!-- 依赖声明 -->
|
||||
@ -181,7 +181,7 @@
|
||||
|
||||
<dependency>
|
||||
<groupId>com.tencentcloudapi</groupId>
|
||||
<artifactId>tencentcloud-sdk-java</artifactId>
|
||||
<artifactId>tencentcloud-sdk-java-sms</artifactId>
|
||||
<version>${tencent.sms.version}</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
@ -36,7 +36,7 @@
|
||||
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.tencentcloudapi</groupId>-->
|
||||
<!-- <artifactId>tencentcloud-sdk-java</artifactId>-->
|
||||
<!-- <artifactId>tencentcloud-sdk-java-sms</artifactId>-->
|
||||
<!-- </dependency>-->
|
||||
|
||||
</dependencies>
|
||||
|
||||
@ -4,6 +4,8 @@ import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.utils.spring.SpringUtils;
|
||||
import com.ruoyi.sms.config.properties.SmsProperties;
|
||||
import com.ruoyi.sms.core.SmsTemplate;
|
||||
import com.ruoyi.sms.core.AliyunSmsTemplate;
|
||||
import com.ruoyi.sms.core.TencentSmsTemplate;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@ -44,7 +46,7 @@ public class SmsController {
|
||||
if (!SpringUtils.containsBean("aliyunSmsTemplate")) {
|
||||
return R.fail("阿里云依赖未引入!");
|
||||
}
|
||||
SmsTemplate smsTemplate = SpringUtils.getBean(SmsTemplate.class);
|
||||
SmsTemplate smsTemplate = SpringUtils.getBean(AliyunSmsTemplate.class);
|
||||
Map<String, String> map = new HashMap<>(1);
|
||||
map.put("code", "1234");
|
||||
Object send = smsTemplate.send(phones, templateId, map);
|
||||
@ -65,7 +67,7 @@ public class SmsController {
|
||||
if (!SpringUtils.containsBean("tencentSmsTemplate")) {
|
||||
return R.fail("腾讯云依赖未引入!");
|
||||
}
|
||||
SmsTemplate smsTemplate = SpringUtils.getBean(SmsTemplate.class);
|
||||
SmsTemplate smsTemplate = SpringUtils.getBean(TencentSmsTemplate.class);
|
||||
Map<String, String> map = new HashMap<>(1);
|
||||
// map.put("2", "测试测试");
|
||||
map.put("1", "1234");
|
||||
|
||||
@ -31,7 +31,7 @@
|
||||
|
||||
<dependency>
|
||||
<groupId>com.tencentcloudapi</groupId>
|
||||
<artifactId>tencentcloud-sdk-java</artifactId>
|
||||
<artifactId>tencentcloud-sdk-java-sms</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user