Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cn-src/aliyun-sms
阿里云 SMS 短信 Java SDK 封装
https://github.com/cn-src/aliyun-sms
aliyun sms springboot
Last synced: about 1 month ago
JSON representation
阿里云 SMS 短信 Java SDK 封装
- Host: GitHub
- URL: https://github.com/cn-src/aliyun-sms
- Owner: cn-src
- License: apache-2.0
- Created: 2018-02-07T07:38:25.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-04-22T07:00:35.000Z (over 5 years ago)
- Last Synced: 2024-10-01T17:06:55.082Z (about 2 months ago)
- Topics: aliyun, sms, springboot
- Language: Java
- Homepage:
- Size: 101 KB
- Stars: 79
- Watchers: 4
- Forks: 35
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
![Maven Central](https://img.shields.io/maven-central/v/cn.javaer.aliyun/aliyun-sms.svg)
[![Build Status](https://travis-ci.org/cn-src/aliyun-sms.svg?branch=master)](https://travis-ci.org/cn-src/aliyun-sms)
# aliyun-sms
阿里云 SMS 短信 Java SDK 封装Github & Issues: [https://github.com/cn-src/aliyun-sms](https://github.com/cn-src/aliyun-sms)
# 使用
1. 添加依赖
``` xmlcn.javaer.aliyun
aliyun-sms
1.2.0```
2. 样例
```java
SmsClient smsClient = new SmsClient(accessKeyId, accessKeySecret);
SmsTemplate smsTemplate = SmsTemplate.builder()
.signName(signName)
.templateCode(templateCode)
.addTemplateParam("code", "123456")
.phoneNumbers(phoneNumber)
.build();
smsClient.send(smsTemplate);
```# spring boot 集成
1. 添加依赖
``` xmlcn.javaer.aliyun
aliyun-spring-boot-starter-sms
1.2.0```
2. 配置
```
aliyun.sms.accessKeyId=
aliyun.sms.accessKeySecret=
aliyun.sms.signName=
aliyun.sms.templates.key1.templateCode=
```3. 样例
```java
@Autowired
private SmsClient smsClient;
```[官方文档:https://help.aliyun.com/document_detail/55284.html?spm=5176.8195934.1001856.3.5cd64183fNqodO](https://help.aliyun.com/document_detail/55284.html?spm=5176.8195934.1001856.3.5cd64183fNqodO)