mirror of
https://gitee.com/dromara/sms4j.git
synced 2025-12-06 17:08:40 +08:00
!190 sms4j-solon-plugin: 优化适配,保持与 spring 的体验一致
Merge pull request !190 from 西东/dev-3.0.x
This commit is contained in:
commit
aeecaaa8f5
@ -22,7 +22,6 @@ import java.util.Map;
|
|||||||
/**
|
/**
|
||||||
* smsConfig 参数意义为确保注入时 smsConfig 已经存在
|
* smsConfig 参数意义为确保注入时 smsConfig 已经存在
|
||||||
*/
|
*/
|
||||||
@Condition(onProperty = "${sms.configType}=yaml")
|
|
||||||
@Configuration
|
@Configuration
|
||||||
public class SupplierConfigure {
|
public class SupplierConfigure {
|
||||||
@Inject
|
@Inject
|
||||||
@ -35,8 +34,8 @@ public class SupplierConfigure {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Bean("blends")
|
@Bean("blends")
|
||||||
@Condition(onProperty = "${sms.configType} = yaml")
|
|
||||||
public Map<String, Map<String, Object>> blends() {
|
public Map<String, Map<String, Object>> blends() {
|
||||||
|
//确保能产生(给下面用)//springboot 就算没产生,也会给个默认
|
||||||
return context.cfg().getProp("sms.blends").bindTo(new LinkedHashMap<>());
|
return context.cfg().getProp("sms.blends").bindTo(new LinkedHashMap<>());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -67,11 +66,7 @@ public class SupplierConfigure {
|
|||||||
public SmsBlendsInitializer smsBlendsInitializer(List<BaseProviderFactory<? extends SmsBlend, ? extends SupplierConfig>> factoryList,
|
public SmsBlendsInitializer smsBlendsInitializer(List<BaseProviderFactory<? extends SmsBlend, ? extends SupplierConfig>> factoryList,
|
||||||
SmsConfig smsConfig,
|
SmsConfig smsConfig,
|
||||||
@Inject("blends") Map<String, Map<String, Object>> blends,
|
@Inject("blends") Map<String, Map<String, Object>> blends,
|
||||||
@Inject(required = false) List<SmsReadConfig> extendsSmsConfigs) {
|
List<SmsReadConfig> extendsSmsConfigs) {
|
||||||
if (extendsSmsConfigs == null) {
|
|
||||||
extendsSmsConfigs = new ArrayList<>();
|
|
||||||
}
|
|
||||||
|
|
||||||
return new SmsBlendsInitializer(factoryList, smsConfig, blends, extendsSmsConfigs);
|
return new SmsBlendsInitializer(factoryList, smsConfig, blends, extendsSmsConfigs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user