From 2f5cbf6e5cf3f413921292fe3d2739f42a17c39b Mon Sep 17 00:00:00 2001 From: heng <835217326@qq.com> Date: Mon, 18 Sep 2023 23:49:59 +0800 Subject: [PATCH] =?UTF-8?q?SE=E9=BB=98=E8=AE=A4=E4=BD=BF=E7=94=A8SmsDaoDef?= =?UTF-8?q?aultImpl?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/dromara/sms4j/javase/config/SEInitializer.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sms4j-javase-plugin/src/main/java/org/dromara/sms4j/javase/config/SEInitializer.java b/sms4j-javase-plugin/src/main/java/org/dromara/sms4j/javase/config/SEInitializer.java index ba1b3bb7..149c1a3b 100644 --- a/sms4j-javase-plugin/src/main/java/org/dromara/sms4j/javase/config/SEInitializer.java +++ b/sms4j-javase-plugin/src/main/java/org/dromara/sms4j/javase/config/SEInitializer.java @@ -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();