类 SMSUtil
java.lang.Object
org.anyline.aliyun.sms.util.SMSUtil
短信服务
- 作者:
- zh
-
嵌套类概要
嵌套类 -
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static SMSUtilstatic SMSUtilgetInstance(String key) 发送短信 send("sign","SMS_000000","15800000000", new User()/new DataRow(), ["id","name:userNmae","age:userAge"])send(String sign, String template, String extend, String out, String mobile, Map<String, String> params) 发送短信发送短信发送短信(使用配置文件中的默认签名)发送短信(使用配置文件中的默认签名)最后一次发送状态查询发送状态,有可能查出多个发送记录,按时间倒序
-
字段详细资料
-
template
-
-
构造器详细资料
-
SMSUtil
public SMSUtil()
-
-
方法详细资料
-
getInstances
-
getInstance
-
getInstance
-
send
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- 外部流水扩展字段。- 返回:
- SMSResult
-
send
-
send
public 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"])- 参数:
sign- 签名(如果不指定则使用配置文件中默认签名)template- 模板code(SMS_88550009,注意不要写成工单号)mobile- 手机号,多个以逗号分隔entity- 实体对象keys- 对象属性(根据keys从entity中取值生成短信参数),如果参数名与属性名不一致通过 短信参数名:属性名 转换- 返回:
- SMSResult
-
send
-
send
public SMSResult send(String sign, String template, List<String> mobiles, Map<String, String> params) 发送短信- 参数:
sign- 签名(如果不指定则使用配置文件中默认签名)template- 模板code(SMS_88550009,注意不要写成工单号)mobiles- 手机号params- 参数- 返回:
- SMSResult
-
send
-
send
-
send
发送短信(使用配置文件中的默认签名)- 参数:
template- 模板code(SMS_88550009,注意不要写成工单号)mobile- 手机号params- 参数- 返回:
- SMSResult
-
send
-
send
-
send
发送短信(使用配置文件中的默认签名)- 参数:
template- 模板code(SMS_88550009,注意不要写成工单号)mobiles- 手机号params- 参数- 返回:
- SMSResult
-
send
-
send
-
status
public List<SMSResult> status(String mobile, String biz, String date, int vol, int page) throws RuntimeException 查询发送状态,有可能查出多个发送记录,按时间倒序- 参数:
mobile- 手机号biz- 回执号date- 发送日期(yyyyMMdd) 不传默认当天 支持查询最近30天的记录。vol- 每页多少条page- 当前第几页- 返回:
- List 根据 SMSMResult.status 1:等待回执 2:发送失败 3:发送成功。
- 抛出:
RuntimeException- RuntimeException
-
status
最后一次发送状态- 参数:
mobile- 手机号biz- 回执号date- 发送日期- 返回:
- SMSResult 根据 SMSMResult.status 1:等待回执 2:发送失败 3:发送成功。
-
status
-
status
-
getConfig
-