mirror of
https://gitee.com/dromara/sms4j.git
synced 2025-12-07 01:18:33 +08:00
修改不引入京东依赖加载失败错误问题
This commit is contained in:
parent
cff4e79afc
commit
39dc0f94d6
@ -14,32 +14,141 @@ import java.util.List;
|
|||||||
**/
|
**/
|
||||||
public interface SmsBlend {
|
public interface SmsBlend {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取短信实例唯一标识
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
String getConfigId();
|
String getConfigId();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取供应商标识
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
String getSupplier();
|
String getSupplier();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>说明:发送固定消息模板短信
|
||||||
|
* <p>此方法将使用配置文件中预设的短信模板进行短信发送
|
||||||
|
* <p>该方法指定的模板变量只能存在一个(配置文件中)
|
||||||
|
* <p>如使用的是腾讯的短信,参数字符串中可以同时存在多个参数,使用 & 分隔例如:您的验证码为{1}在{2}分钟内有效,可以传为 message="xxxx"+"&"+"5"
|
||||||
|
* sendMessage
|
||||||
|
*
|
||||||
|
* @param phone 接收短信的手机号
|
||||||
|
* message 消息内容
|
||||||
|
* @author :Wind
|
||||||
|
*/
|
||||||
SmsResponse sendMessage(String phone, String message);
|
SmsResponse sendMessage(String phone, String message);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>说明:使用自定义模板发送短信
|
||||||
|
* sendMessage
|
||||||
|
*
|
||||||
|
* @param templateId 模板id
|
||||||
|
* @param messages key为模板变量名称 value为模板变量值
|
||||||
|
* @author :Wind
|
||||||
|
*/
|
||||||
SmsResponse sendMessage(String phone, String templateId, LinkedHashMap<String, String> messages);
|
SmsResponse sendMessage(String phone, String templateId, LinkedHashMap<String, String> messages);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>说明:群发固定模板短信
|
||||||
|
* massTexting
|
||||||
|
*
|
||||||
|
* @author :Wind
|
||||||
|
*/
|
||||||
SmsResponse massTexting(List<String> phones, String message);
|
SmsResponse massTexting(List<String> phones, String message);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>说明:使用自定义模板群发短信
|
||||||
|
* massTexting
|
||||||
|
*
|
||||||
|
* @author :Wind
|
||||||
|
*/
|
||||||
SmsResponse massTexting(List<String> phones, String templateId, LinkedHashMap<String, String> messages);
|
SmsResponse massTexting(List<String> phones, String templateId, LinkedHashMap<String, String> messages);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>说明:异步短信发送,固定消息模板短信
|
||||||
|
* sendMessageAsync
|
||||||
|
*
|
||||||
|
* @param phone 要发送的号码
|
||||||
|
* @param message 发送内容
|
||||||
|
* @param callBack 回调
|
||||||
|
* @author :Wind
|
||||||
|
*/
|
||||||
void sendMessageAsync(String phone, String message, CallBack callBack);
|
void sendMessageAsync(String phone, String message, CallBack callBack);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>说明:异步发送短信,不关注发送结果
|
||||||
|
* sendMessageAsync
|
||||||
|
*
|
||||||
|
* @param phone 要发送的号码
|
||||||
|
* @param message 发送内容
|
||||||
|
* @author :Wind
|
||||||
|
*/
|
||||||
void sendMessageAsync(String phone, String message);
|
void sendMessageAsync(String phone, String message);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>说明:异步短信发送,使用自定义模板发送短信
|
||||||
|
* sendMessage
|
||||||
|
*
|
||||||
|
* @param templateId 模板id
|
||||||
|
* @param messages key为模板变量名称 value为模板变量值
|
||||||
|
* @param callBack 回调
|
||||||
|
* @author :Wind
|
||||||
|
*/
|
||||||
void sendMessageAsync(String phone, String templateId, LinkedHashMap<String, String> messages, CallBack callBack);
|
void sendMessageAsync(String phone, String templateId, LinkedHashMap<String, String> messages, CallBack callBack);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>说明:异步短信发送,使用自定义模板发送短信,不关注发送结果
|
||||||
|
* sendMessageAsync
|
||||||
|
*
|
||||||
|
* @param templateId 模板id
|
||||||
|
* @param messages key为模板变量名称 value为模板变量值
|
||||||
|
* @author :Wind
|
||||||
|
*/
|
||||||
void sendMessageAsync(String phone, String templateId, LinkedHashMap<String, String> messages);
|
void sendMessageAsync(String phone, String templateId, LinkedHashMap<String, String> messages);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>说明:使用固定模板发送延时短信
|
||||||
|
* delayedMessage
|
||||||
|
*
|
||||||
|
* @param phone 接收短信的手机号
|
||||||
|
* @param message 要发送的短信
|
||||||
|
* @param delayedTime 延迟时间
|
||||||
|
* @author :Wind
|
||||||
|
*/
|
||||||
void delayedMessage(String phone, String message, Long delayedTime);
|
void delayedMessage(String phone, String message, Long delayedTime);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>说明:使用自定义模板发送定时短信 sendMessage
|
||||||
|
* delayedMessage
|
||||||
|
*
|
||||||
|
* @param templateId 模板id
|
||||||
|
* @param messages key为模板变量名称 value为模板变量值
|
||||||
|
* @param phone 要发送的手机号
|
||||||
|
* @param delayedTime 延迟的时间
|
||||||
|
* @author :Wind
|
||||||
|
*/
|
||||||
void delayedMessage(String phone, String templateId, LinkedHashMap<String, String> messages, Long delayedTime);
|
void delayedMessage(String phone, String templateId, LinkedHashMap<String, String> messages, Long delayedTime);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>说明:群发延迟短信
|
||||||
|
* delayMassTexting
|
||||||
|
*
|
||||||
|
* @param phones 要群体发送的手机号码
|
||||||
|
* @author :Wind
|
||||||
|
*/
|
||||||
void delayMassTexting(List<String> phones, String message, Long delayedTime);
|
void delayMassTexting(List<String> phones, String message, Long delayedTime);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>说明:使用自定义模板发送群体延迟短信
|
||||||
|
* delayMassTexting
|
||||||
|
*
|
||||||
|
* @param phones 要群体发送的手机号码
|
||||||
|
* @param templateId 模板id
|
||||||
|
* @param messages key为模板变量名称 value为模板变量值
|
||||||
|
* @param delayedTime 延迟的时间
|
||||||
|
* @author :Wind
|
||||||
|
*/
|
||||||
void delayMassTexting(List<String> phones, String templateId, LinkedHashMap<String, String> messages, Long delayedTime);
|
void delayMassTexting(List<String> phones, String templateId, LinkedHashMap<String, String> messages, Long delayedTime);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -163,4 +163,13 @@ public class SmsUtils {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean isClassExists(String className) {
|
||||||
|
try {
|
||||||
|
Class.forName(className);
|
||||||
|
return true;
|
||||||
|
} catch (ClassNotFoundException e) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -175,12 +175,14 @@ public class SEInitializer {
|
|||||||
ProviderFactoryHolder.registerFactory(CtyunFactory.instance());
|
ProviderFactoryHolder.registerFactory(CtyunFactory.instance());
|
||||||
ProviderFactoryHolder.registerFactory(EmayFactory.instance());
|
ProviderFactoryHolder.registerFactory(EmayFactory.instance());
|
||||||
ProviderFactoryHolder.registerFactory(HuaweiFactory.instance());
|
ProviderFactoryHolder.registerFactory(HuaweiFactory.instance());
|
||||||
ProviderFactoryHolder.registerFactory(JdCloudFactory.instance());
|
|
||||||
ProviderFactoryHolder.registerFactory(NeteaseFactory.instance());
|
ProviderFactoryHolder.registerFactory(NeteaseFactory.instance());
|
||||||
ProviderFactoryHolder.registerFactory(TencentFactory.instance());
|
ProviderFactoryHolder.registerFactory(TencentFactory.instance());
|
||||||
ProviderFactoryHolder.registerFactory(UniFactory.instance());
|
ProviderFactoryHolder.registerFactory(UniFactory.instance());
|
||||||
ProviderFactoryHolder.registerFactory(YunPianFactory.instance());
|
ProviderFactoryHolder.registerFactory(YunPianFactory.instance());
|
||||||
ProviderFactoryHolder.registerFactory(ZhutongFactory.instance());
|
ProviderFactoryHolder.registerFactory(ZhutongFactory.instance());
|
||||||
|
if(SmsUtils.isClassExists("com.jdcloud.sdk.auth.CredentialsProvider")) {
|
||||||
|
ProviderFactoryHolder.registerFactory(JdCloudFactory.instance());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -88,12 +88,15 @@ public class SmsBlendsInitializer implements ApplicationListener<ContextRefreshe
|
|||||||
ProviderFactoryHolder.registerFactory(UniFactory.instance());
|
ProviderFactoryHolder.registerFactory(UniFactory.instance());
|
||||||
ProviderFactoryHolder.registerFactory(YunPianFactory.instance());
|
ProviderFactoryHolder.registerFactory(YunPianFactory.instance());
|
||||||
ProviderFactoryHolder.registerFactory(ZhutongFactory.instance());
|
ProviderFactoryHolder.registerFactory(ZhutongFactory.instance());
|
||||||
try {
|
if(SmsUtils.isClassExists("com.jdcloud.sdk.auth.CredentialsProvider")) {
|
||||||
ProviderFactoryHolder.registerFactory(JdCloudFactory.instance());
|
ProviderFactoryHolder.registerFactory(JdCloudFactory.instance());
|
||||||
}catch (Exception e){
|
|
||||||
log.warn(e.getMessage());
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
// try {
|
||||||
|
// ProviderFactoryHolder.registerFactory(JdCloudFactory.instance());
|
||||||
|
// }catch (Exception e){
|
||||||
|
// log.warn(e.getMessage());
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
|
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
|
||||||
org.dromara.sms4j.starter.config.SmsMainConfig,\
|
org.dromara.sms4j.starter.config.SmsMainConfig,\
|
||||||
org.dromara.sms4j.starter.config.SupplierConfig,\
|
org.dromara.sms4j.starter.config.SupplierConfig,\
|
||||||
org.dromara.sms4j.provider.config.SmsConfig
|
org.dromara.sms4j.provider.config.SmsConfig,\
|
||||||
|
org.dromara.sms4j.starter.config.SmsAutowiredConfig
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
org.dromara.sms4j.starter.config.SmsMainConfig
|
org.dromara.sms4j.starter.config.SmsMainConfig
|
||||||
org.dromara.sms4j.starter.config.SupplierConfig
|
org.dromara.sms4j.starter.config.SupplierConfig
|
||||||
org.dromara.sms4j.provider.config.SmsConfig
|
org.dromara.sms4j.provider.config.SmsConfig
|
||||||
|
org.dromara.sms4j.starter.config.SmsAutowiredConfig
|
||||||
Loading…
x
Reference in New Issue
Block a user