public class SMSUtil extends Object
| 限定符和类型 | 类和说明 |
|---|---|
class |
SMSUtil.Sign |
class |
SMSUtil.Template |
| 限定符和类型 | 字段和说明 |
|---|---|
SMSUtil.Template |
template |
| 构造器和说明 |
|---|
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 |
send(String sign,
String template,
String extend,
String out,
String mobile,
Map<String,String> params)
发送短信
|
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 SMSUtil.Template template
public static SMSUtil getInstance()
public SMSResult send(String sign, String template, String extend, String out, String mobile, Map<String,String> params)
sign - 签名(如果不指定则使用配置文件中默认签名)template - 模板code(SMS_88550009,注意不要写成工单号)mobile - 手机号,多个以逗号分隔params - 参数extend - 上行短信扩展码。上行短信指发送给通信服务提供商的短信,用于定制某种服务、完成查询,或是办理某种业务等,需要收费,按运营商普通短信资费进行扣费。out - 外部流水扩展字段。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 RuntimeException
mobile - 手机号biz - 回执号date - 发送日期(yyyyMMdd) 不传默认当天 支持查询最近30天的记录。vol - 每页多少条page - 当前第几页RuntimeException - RuntimeExceptionpublic SMSResult status(String mobile, String biz, String date)
mobile - 手机号biz - 回执号date - 发送日期public SMSConfig getConfig()
Copyright © 2022. All rights reserved.