From 2ef232d9ff6c51a9d93f7dac764a13c7552454e1 Mon Sep 17 00:00:00 2001 From: noear Date: Sun, 5 Jan 2025 08:15:05 +0800 Subject: [PATCH] =?UTF-8?q?sms4j-solon-plugin:=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E9=80=82=E9=85=8D=EF=BC=8C=E4=BF=9D=E6=8C=81=E4=B8=8E=20spring?= =?UTF-8?q?=20=E7=9A=84=E4=BD=93=E9=AA=8C=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dromara/sms4j/solon/config/SupplierConfigure.java | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/sms4j-solon-plugin/src/main/java/org/dromara/sms4j/solon/config/SupplierConfigure.java b/sms4j-solon-plugin/src/main/java/org/dromara/sms4j/solon/config/SupplierConfigure.java index 9aa0c06b..d4568950 100644 --- a/sms4j-solon-plugin/src/main/java/org/dromara/sms4j/solon/config/SupplierConfigure.java +++ b/sms4j-solon-plugin/src/main/java/org/dromara/sms4j/solon/config/SupplierConfigure.java @@ -22,7 +22,6 @@ import java.util.Map; /** * smsConfig 参数意义为确保注入时 smsConfig 已经存在 */ -@Condition(onProperty = "${sms.configType}=yaml") @Configuration public class SupplierConfigure { @Inject @@ -35,8 +34,8 @@ public class SupplierConfigure { } @Bean("blends") - @Condition(onProperty = "${sms.configType} = yaml") public Map> blends() { + //确保能产生(给下面用)//springboot 就算没产生,也会给个默认 return context.cfg().getProp("sms.blends").bindTo(new LinkedHashMap<>()); } @@ -67,11 +66,7 @@ public class SupplierConfigure { public SmsBlendsInitializer smsBlendsInitializer(List> factoryList, SmsConfig smsConfig, @Inject("blends") Map> blends, - @Inject(required = false) List extendsSmsConfigs) { - if (extendsSmsConfigs == null) { - extendsSmsConfigs = new ArrayList<>(); - } - + List extendsSmsConfigs) { return new SmsBlendsInitializer(factoryList, smsConfig, blends, extendsSmsConfigs); } }