public class SMSUtil extends Object
| 构造器和说明 |
|---|
SMSUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
SMSConfig |
getConfig() |
static SMSUtil |
getInstance() |
static SMSUtil |
getInstance(String key) |
SMSResult |
send(String template,
List<String> mobiles,
Map<String,String> params)
发送短信(使用配置文件中的默认签名)
|
SMSResult |
send(String template,
List<String> mobiles,
Object entity,
List<String> keys) |
SMSResult |
send(String template,
List<String> mobiles,
Object entity,
String... keys) |
SMSResult |
send(String sign,
String template,
List<String> mobiles,
Map<String,String> params)
发送短信
|
SMSResult |
send(String sign,
String template,
List<String> mobiles,
Object entity,
List<String> keys) |
SMSResult |
send(String sign,
String template,
List<String> mobiles,
Object entity,
String... keys) |
SMSResult |
send(String template,
String mobile,
Map<String,String> params)
发送短信(使用配置文件中的默认签名)
|
SMSResult |
send(String template,
String mobile,
Object entity,
List<String> keys) |
SMSResult |
send(String template,
String mobile,
Object entity,
String... keys) |
SMSResult |
send(String sign,
String template,
String mobile,
Map<String,String> params)
发送短信
|
SMSResult |
send(String sign,
String template,
String mobile,
Object entity,
List<String> keys)
发送短信
send("sign","SMS_000000","15800000000", new User()/new DataRow(), ["id","name:userNmae","age:userAge"])
|
SMSResult |
send(String sign,
String template,
String mobile,
Object entity,
String... keys) |
SMSResult |
status(String mobile) |
SMSResult |
status(String mobile,
String biz) |
SMSResult |
status(String mobile,
String biz,
String date)
最后一次发送状态
|
List<SMSResult> |
status(String mobile,
String biz,
String date,
int vol,
int page)
查询发送状态,有可能查出多个发送记录,按时间倒序
|
public static SMSUtil getInstance()
public SMSResult send(String sign, String template, String mobile, Map<String,String> params)
sign - 签名(如果不指定则使用配置文件中默认签名)template - 模板code(SMS_88550009,注意不要写成工单号)mobile - 手机号,多个以逗号分隔params - 参数public SMSResult send(String sign, String template, String mobile, Object entity, List<String> keys)
sign - 签名(如果不指定则使用配置文件中默认签名)template - 模板code(SMS_88550009,注意不要写成工单号)mobile - 手机号,多个以逗号分隔entity - 实体对象keys - 对象属性(根据keys从entity中取值生成短信参数),如果参数名与属性名不一致通过 短信参数名:属性名 转换public SMSResult send(String sign, String template, String mobile, Object entity, String... keys)
public SMSResult send(String sign, String template, List<String> mobiles, Map<String,String> params)
sign - 签名(如果不指定则使用配置文件中默认签名)template - 模板code(SMS_88550009,注意不要写成工单号)mobiles - 手机号params - 参数public SMSResult send(String sign, String template, List<String> mobiles, Object entity, List<String> keys)
public SMSResult send(String sign, String template, List<String> mobiles, Object entity, String... keys)
public SMSResult send(String template, String mobile, Map<String,String> params)
template - 模板code(SMS_88550009,注意不要写成工单号)mobile - 手机号params - 参数public SMSResult send(String template, List<String> mobiles, Map<String,String> params)
template - 模板code(SMS_88550009,注意不要写成工单号)mobiles - 手机号params - 参数public List<SMSResult> status(String mobile, String biz, String date, int vol, int page) throws Exception
mobile - 手机号biz - 回执号date - 发送日期vol - 每页多少条page - 当前第几页Exception - Exceptionpublic SMSResult status(String mobile, String biz, String date) throws Exception
mobile - 手机号biz - 回执号date - 发送日期Exception - Exceptionpublic SMSConfig getConfig()
Copyright © 2022. All rights reserved.