Package org.dromara.sms4j.lianlu.service
Class LianLuSmsImpl
- java.lang.Object
-
- org.dromara.sms4j.provider.service.AbstractSmsBlend<LianLuConfig>
-
- org.dromara.sms4j.lianlu.service.LianLuSmsImpl
-
- All Implemented Interfaces:
SmsBlend
public class LianLuSmsImpl extends AbstractSmsBlend<LianLuConfig>
-
-
Field Summary
Fields Modifier and Type Field Description private static StringNORMAL_MSGprivate intretryprivate static StringTEMPLATE_MSG-
Fields inherited from class org.dromara.sms4j.provider.service.AbstractSmsBlend
delayed, http, pool
-
-
Constructor Summary
Constructors Constructor Description LianLuSmsImpl(LianLuConfig config)LianLuSmsImpl(LianLuConfig config, Executor pool, DelayedTime delayedTime)
-
Method Summary
-
Methods inherited from class org.dromara.sms4j.provider.service.AbstractSmsBlend
delayedMessage, delayedMessage, delayMassTexting, delayMassTexting, errorResp, getConfig, sendMessageAsync, sendMessageAsync, sendMessageAsync, sendMessageAsync
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.dromara.sms4j.api.SmsBlend
batchJoinBlacklist, batchRemovalFromBlacklist, getConfigId, joinInBlacklist, removeFromBlacklist
-
-
-
-
Field Detail
-
retry
private int retry
-
NORMAL_MSG
private static final String NORMAL_MSG
- See Also:
- Constant Field Values
-
TEMPLATE_MSG
private static final String TEMPLATE_MSG
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
LianLuSmsImpl
public LianLuSmsImpl(LianLuConfig config, Executor pool, DelayedTime delayedTime)
-
LianLuSmsImpl
public LianLuSmsImpl(LianLuConfig config)
-
-
Method Detail
-
getSupplier
public String getSupplier()
Description copied from interface:SmsBlend获取供应商标识- Returns:
-
sendMessage
public SmsResponse sendMessage(String phone, String templateParam)
说明:发送固定消息模板短信
此方法将使用配置文件中预设的短信模板进行短信发送
该方法指定的模板变量只能存在一个(配置文件中)
- Specified by:
sendMessagein interfaceSmsBlend- Specified by:
sendMessagein classAbstractSmsBlend<LianLuConfig>- Parameters:
phone- 接收短信的手机号templateParam- 模板变量- Returns:
-
sendMessage
public SmsResponse sendMessage(String phone, LinkedHashMap<String,String> messages)
Description copied from class:AbstractSmsBlendsendMessage说明:发送固定消息模板多模板参数短信
- Specified by:
sendMessagein interfaceSmsBlend- Specified by:
sendMessagein classAbstractSmsBlend<LianLuConfig>- Parameters:
phone- 接收短信的手机号messages- 模板内容
-
sendMessage
public SmsResponse sendMessage(String phone, String templateId, LinkedHashMap<String,String> messages)
模板信息- Specified by:
sendMessagein interfaceSmsBlend- Specified by:
sendMessagein classAbstractSmsBlend<LianLuConfig>- Parameters:
phone-templateId- 模板idmessages- key无实际意义,value为模板变量值- Returns:
-
massTexting
public SmsResponse massTexting(List<String> phones, String templateParam)
Description copied from class:AbstractSmsBlend说明:群发固定模板短信 massTexting
- Specified by:
massTextingin interfaceSmsBlend- Specified by:
massTextingin classAbstractSmsBlend<LianLuConfig>
-
massTexting
public SmsResponse massTexting(List<String> phones, String templateId, LinkedHashMap<String,String> messages)
Description copied from class:AbstractSmsBlend说明:使用自定义模板群发短信 massTexting
- Specified by:
massTextingin interfaceSmsBlend- Specified by:
massTextingin classAbstractSmsBlend<LianLuConfig>
-
getRequest
private LianLuRequest getRequest()
-
sendNormalMessage
public SmsResponse sendNormalMessage(String phone, String message)
不使用模板,直接发送短信- Parameters:
phone-message- 短信内容- Returns:
-
sendNormalMessage
public SmsResponse sendNormalMessage(String phone, String message, String signName)
不使用模板,直接发送短信- Parameters:
phone-message- 短信内容signName- 短信签名- Returns:
-
sendNormalMessage
public SmsResponse sendNormalMessage(List<String> phones, String message)
不使用模板,群发短信- Parameters:
phones-message- 短信内容- Returns:
-
sendNormalMessage
public SmsResponse sendNormalMessage(List<String> phones, String message, String signName)
不使用模板,群发短信- Parameters:
phones-message- 短信内容signName- 短信签名- Returns:
-
getSmsResponse
private SmsResponse getSmsResponse(LianLuRequest req)
-
requestRetry
private SmsResponse requestRetry(LianLuRequest req)
-
getResponse
private SmsResponse getResponse(cn.hutool.json.JSONObject resJson)
-
-