aliyun-sms

Aliyun SMS

License

License

GroupId

GroupId

cn.javaer.aliyun
ArtifactId

ArtifactId

aliyun-sms
Last Version

Last Version

1.2.0
Release Date

Release Date

Type

Type

jar
Description

Description

aliyun-sms
Aliyun SMS
Project URL

Project URL

https://github.com/cn-src/aliyun-sms
Source Code Management

Source Code Management

https://github.com/cn-src/aliyun-sms.git

Download aliyun-sms

How to add to project

<!-- https://jarcasting.com/artifacts/cn.javaer.aliyun/aliyun-sms/ -->
<dependency>
    <groupId>cn.javaer.aliyun</groupId>
    <artifactId>aliyun-sms</artifactId>
    <version>1.2.0</version>
</dependency>
// https://jarcasting.com/artifacts/cn.javaer.aliyun/aliyun-sms/
implementation 'cn.javaer.aliyun:aliyun-sms:1.2.0'
// https://jarcasting.com/artifacts/cn.javaer.aliyun/aliyun-sms/
implementation ("cn.javaer.aliyun:aliyun-sms:1.2.0")
'cn.javaer.aliyun:aliyun-sms:jar:1.2.0'
<dependency org="cn.javaer.aliyun" name="aliyun-sms" rev="1.2.0">
  <artifact name="aliyun-sms" type="jar" />
</dependency>
@Grapes(
@Grab(group='cn.javaer.aliyun', module='aliyun-sms', version='1.2.0')
)
libraryDependencies += "cn.javaer.aliyun" % "aliyun-sms" % "1.2.0"
[cn.javaer.aliyun/aliyun-sms "1.2.0"]

Dependencies

compile (2)

Group / Artifact Type Version
com.aliyun : aliyun-java-sdk-core jar 4.3.8
org.slf4j : jcl-over-slf4j jar

provided (1)

Group / Artifact Type Version
org.projectlombok : lombok Optional jar

test (1)

Group / Artifact Type Version
junit : junit jar

Project Modules

There are no modules declared in this project.

License Maven Central Build Status

aliyun-sms

阿里云 SMS 短信 Java SDK 封装

Github & Issues: https://github.com/cn-src/aliyun-sms

使用

  1. 添加依赖
<dependency>
    <groupId>cn.javaer.aliyun</groupId>
    <artifactId>aliyun-sms</artifactId>
    <version>1.2.0</version>
</dependency>
  1. 样例
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. 添加依赖
<dependency>
    <groupId>cn.javaer.aliyun</groupId>
    <artifactId>aliyun-spring-boot-starter-sms</artifactId>
    <version>1.2.0</version>
</dependency>
  1. 配置
aliyun.sms.accessKeyId=
aliyun.sms.accessKeySecret=
aliyun.sms.signName=
aliyun.sms.templates.key1.templateCode=
  1. 样例
    @Autowired
    private SmsClient smsClient;

官方文档:https://help.aliyun.com/document_detail/55284.html?spm=5176.8195934.1001856.3.5cd64183fNqodO

Versions

Version
1.2.0
1.1.1
1.1.0