mirror of
https://gitee.com/dromara/sms4j.git
synced 2025-12-06 17:08:40 +08:00
SE默认使用SmsDaoDefaultImpl
This commit is contained in:
parent
e105cd30f1
commit
2f5cbf6e5c
@ -13,6 +13,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.sms4j.aliyun.config.AlibabaFactory;
|
||||
import org.dromara.sms4j.api.SmsBlend;
|
||||
import org.dromara.sms4j.api.dao.SmsDao;
|
||||
import org.dromara.sms4j.api.dao.SmsDaoDefaultImpl;
|
||||
import org.dromara.sms4j.api.universal.SupplierConfig;
|
||||
import org.dromara.sms4j.cloopen.config.CloopenFactory;
|
||||
import org.dromara.sms4j.comm.constant.Constant;
|
||||
@ -51,6 +52,8 @@ public class SEInitializer {
|
||||
return INSTANCE;
|
||||
}
|
||||
|
||||
private SmsDao smsDao;
|
||||
|
||||
/**
|
||||
* 默认从sms4j.yml文件中读取配置
|
||||
*/
|
||||
@ -123,6 +126,7 @@ public class SEInitializer {
|
||||
RestrictedProcessDefaultImpl process = new RestrictedProcessDefaultImpl();
|
||||
process.setSmsDao(smsDao);
|
||||
SmsInvocationHandler.setRestrictedProcess(process);
|
||||
this.smsDao = smsDao;
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -137,6 +141,11 @@ public class SEInitializer {
|
||||
throw new SmsBlendException("初始化配置失败");
|
||||
}
|
||||
|
||||
//注册默认DAO实例
|
||||
if(this.smsDao == null) {
|
||||
this.registerSmsDao(SmsDaoDefaultImpl.getInstance());
|
||||
}
|
||||
|
||||
//注册默认工厂
|
||||
registerDefaultFactory();
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user