mirror of
https://gitee.com/dromara/sms4j.git
synced 2025-12-06 08:58:38 +08:00
文档修改
This commit is contained in:
parent
2ffe43a4b6
commit
41e6cd916b
110
README.md
110
README.md
@ -1,37 +1,93 @@
|
||||
# sms_aggregation
|
||||
<h1 align="center" style="margin: 30px 0 30px; font-weight: bold;">sms-aggregation v1.0.0</h1>
|
||||
<h2 align="center" style="margin: 30px 0 30px; font-weight: bold;">短信聚合工具</h2>
|
||||
<h4 align="center" style="margin: 30px 0 30px; font-weight: bold;">让发送短信变动更简单</h4>
|
||||
<p align="center">
|
||||
<a href="https://gitee.com/the-wind-is-like-a-song/sms_aggregation/stargazers"><img src="https://gitee.com/the-wind-is-like-a-song/sms_aggregation/badge/star.svg?theme=gvp"></a>
|
||||
<a href="https://gitee.com/the-wind-is-like-a-song/sms_aggregation/master/LICENSE"><img src="https://img.shields.io/badge/license-Apache--2.0-green"></a>
|
||||
<a href="https://gitee.com/the-wind-is-like-a-song/sms_aggregation"><img src="https://img.shields.io/badge/version-v1.0.0-blue"></a>
|
||||
</p>
|
||||
|
||||
#### 介绍
|
||||
聚合短信工具
|
||||
## 前言
|
||||
在日常的开发过程中,短信的发送经常使用(尤其是中小型的外包公司),毕竟不是每个公司都有阿里腾讯一样的实力,
|
||||
也不是每个都像银行联通等公司一样有内部的短信规程。第三方的短信往往是最常见的解决方案,但是市面上第三方短信服务商众多,
|
||||
各家都有不同的方式和标准,每次需要使用时候,都需要花费时间去阅读文档和编写相应的工具,为一个短信浪费了太多的精力和时间。
|
||||
这个工具的目的就是为了统一下各个厂商的短信发送工具的标准,甚至于更换短信厂商只需要更改yml配置文件即可。
|
||||
新人上路,还望各位大佬多多支持,如果你觉得还算值得鼓励,请用你发财的小手帮助点上一个start
|
||||
[gitee](https://gitee.com/the-wind-is-like-a-song/sms_aggregation)
|
||||
[github](https://github.com/fengruge/sms_aggregation)
|
||||
|
||||
#### 软件架构
|
||||
软件架构说明
|
||||
#### [在线文档](https://apidoc.gitee.com/the-wind-is-like-a-song/sms_aggregation)
|
||||
|
||||
## 支持厂商一览
|
||||
目前刚刚发布第一版本,支持尚少,后续会集成更多的厂商
|
||||
- **阿里云国内短信**
|
||||
- **腾讯云国内短信**
|
||||
- **合一短信**
|
||||
- **云片短信**
|
||||
|
||||
#### 安装教程
|
||||
## 在SpringBoot环境集成
|
||||
1. maven引入
|
||||
```xml
|
||||
<dependency>
|
||||
<groupId>kim.wind</groupId>
|
||||
<artifactId>sms-aggregation-spring-boot-starter</artifactId>
|
||||
<version> version </version>
|
||||
</dependency>
|
||||
```
|
||||
2. 设置配置文件
|
||||
```yaml
|
||||
sms:
|
||||
# 短信服务商
|
||||
supplier: alibaba
|
||||
# 是否开启短信发送限制 默认false
|
||||
restricted: true
|
||||
# 以下设置仅在开启短信发送限制后生效
|
||||
# 是否使用redis进行缓存 默认false
|
||||
redisCache: true
|
||||
# 单账号每日最大发送量
|
||||
accountMax: 20
|
||||
# 单账号每分钟最大发送
|
||||
minuteMax: 2
|
||||
|
||||
```
|
||||
阿里云配置示意
|
||||
```yaml
|
||||
sms:
|
||||
# 短信服务商
|
||||
supplier: alibaba
|
||||
alibaba:
|
||||
#阿里云的accessKey
|
||||
accessKeyId: 您的accessKey
|
||||
#阿里云的accessKeySecret
|
||||
accessKeySecret: 您的accessKeySecret
|
||||
#短信签名
|
||||
signature: 测试签名
|
||||
#模板ID 用于发送固定模板短信使用
|
||||
templateId: SMS_215125134
|
||||
#模板变量 上述模板的变量
|
||||
templateName: code
|
||||
#请求地址 默认为dysmsapi.aliyuncs.com 如无特殊改变可以不用设置
|
||||
requestUrl: dysmsapi.aliyuncs.com
|
||||
```
|
||||
3. 方法使用
|
||||
```java
|
||||
public class Demo{
|
||||
//此处作为演示使用,推荐使用构造注入或set注入
|
||||
@Autowired
|
||||
private final SmsBlend sms;
|
||||
|
||||
public void test() {
|
||||
//发送固定模板短信
|
||||
SmsResponse smsResponse = sms.sendMessage("18888888888","测试固定模板短信");
|
||||
System.out.println(smsResponse);
|
||||
}
|
||||
|
||||
}
|
||||
```
|
||||
|
||||
1. maven引入
|
||||
2. xxxx
|
||||
3. xxxx
|
||||
|
||||
#### 使用说明
|
||||
|
||||
1. xxxx
|
||||
2. xxxx
|
||||
3. xxxx
|
||||
|
||||
#### 参与贡献
|
||||
## 参与贡献
|
||||
|
||||
1. Fork 本仓库
|
||||
2. 新建 Feat_xxx 分支
|
||||
3. 提交代码
|
||||
4. 新建 Pull Request
|
||||
|
||||
|
||||
#### 特技
|
||||
|
||||
1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md
|
||||
2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com)
|
||||
3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目
|
||||
4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目
|
||||
5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help)
|
||||
6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)
|
||||
|
||||
@ -17,6 +17,7 @@ import org.springframework.context.annotation.Configuration;
|
||||
@ConditionalOnProperty(prefix = "sms", name = "supplier", havingValue = "alibaba")
|
||||
public class AlibabaSmsConfig {
|
||||
|
||||
/** accessKey*/
|
||||
private String accessKeyId;
|
||||
/** 访问键秘钥 */
|
||||
private String accessKeySecret;
|
||||
@ -26,7 +27,7 @@ public class AlibabaSmsConfig {
|
||||
private String templateId;
|
||||
/** 模板变量名称*/
|
||||
private String templateName;
|
||||
|
||||
/** 请求地址*/
|
||||
private String requestUrl = "dysmsapi.aliyuncs.com";
|
||||
|
||||
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
package kim.wind.sms.api;
|
||||
|
||||
import kim.wind.sms.api.callback.CallBack;
|
||||
import kim.wind.sms.comm.annotation.Restricted;
|
||||
import kim.wind.sms.comm.entity.SmsResponse;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user