好记性不如烂笔头,记录一下集成阿里云短信平台的过程。
平台申请的过程略过,只讲代码有关的内容,首先是配置需要的依赖包:
<!-- begin of aliyun sms -->
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>aliyun-java-sdk-core</artifactId>
<version>4.0.6</version>
</dependency>
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>aliyun-java-sdk-dysmsapi</artifactId>
<version>1.1.0</version>
</dependency>
<!-- end of aliyun sms -->
发送短信的方法:
/**
*
* @date 2018年8月7日下午3:20:30
* @author key_artist
* @todo TODO 提醒短信
*/
public void sendMsg(String mobilephone) {
String accessKeyId = null;
String accessKeySecret = null;
String signName = null;
String templateCode = null;
PropertiesUtils.lo