perf:调整阿里云短信,移除官方sdk

This commit is contained in:
曾文豪
2023-01-10 17:20:42 +08:00
parent b28a99a767
commit 21c7344042
6 changed files with 91 additions and 66 deletions

View File

@@ -23,6 +23,12 @@
<groupId>com.tiesheng</groupId>
<artifactId>tiesheng-web</artifactId>
</dependency>
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>dysmsapi20170525</artifactId>
</dependency>
</dependencies>
<repositories>

View File

@@ -1,6 +1,8 @@
package com.tiesheng.demo.controller;
import cn.hutool.json.JSONUtil;
import com.tiesheng.annotation.token.TokenIgnore;
import com.tiesheng.message.config.aliyun.AliyunSmsConfig;
import com.tiesheng.message.pojos.MessageReqResp;
import com.tiesheng.util.config.GlobalConfig;
import com.tiesheng.util.pojos.ApiResp;
@@ -19,8 +21,8 @@ public class TestController {
@Autowired
GlobalConfig globalConfig;
// @Autowired
// AliyunSmsConfig aliyunSmsConfig;
@Autowired
AliyunSmsConfig aliyunSmsConfig;
@RequestMapping("/index")
@TokenIgnore
@@ -38,9 +40,9 @@ public class TestController {
@RequestMapping("/send")
@TokenIgnore
public ApiResp<MessageReqResp> sendMessage() {
// MessageReqResp reqResp = aliyunSmsConfig.sendSms("13567116463", "SMS_126361543",
// JSONUtil.createObj().putOpt("code", "123456"));
return ApiResp.respOK(new MessageReqResp());
MessageReqResp reqResp = aliyunSmsConfig.sendSms("13567116463", "SMS_154950909",
JSONUtil.createObj().putOpt("code", "123456"));
return ApiResp.respOK(reqResp);
}

View File

@@ -25,4 +25,4 @@ tiesheng:
aliyun:
access-key-id: LTAI5tJtbgBCnTY5eS4SmrTf
access-key-secret: JIHqpRUFffCHhXaJEVvWN31WcexWqG
sign-name: 智慧校园
sign-name: 阿里云短信测试