调整SE的各厂商配置属性与springboot相同,增加SE天翼云配置

This commit is contained in:
heng 2023-07-07 16:48:36 +08:00
parent 70d2349a8e
commit f8e109e5a9

View File

@ -13,6 +13,7 @@ import org.dromara.sms4j.comm.config.SmsConfig;
import org.dromara.sms4j.comm.exception.SmsBlendException; import org.dromara.sms4j.comm.exception.SmsBlendException;
import org.dromara.sms4j.comm.factory.BeanFactory; import org.dromara.sms4j.comm.factory.BeanFactory;
import org.dromara.sms4j.core.config.SupplierFactory; import org.dromara.sms4j.core.config.SupplierFactory;
import org.dromara.sms4j.ctyun.config.CtyunConfig;
import org.dromara.sms4j.emay.config.EmayConfig; import org.dromara.sms4j.emay.config.EmayConfig;
import org.dromara.sms4j.huawei.config.HuaweiConfig; import org.dromara.sms4j.huawei.config.HuaweiConfig;
import org.dromara.sms4j.javase.util.YamlUtil; import org.dromara.sms4j.javase.util.YamlUtil;
@ -158,6 +159,17 @@ public class SEInitializer {
return this; return this;
} }
/**
* 初始化天翼云配置
*
* @param ctyunConfig 云片配置
* @return 当前初始化类实例
*/
public SEInitializer initCtyun(CtyunConfig ctyunConfig) {
BeanUtil.copyProperties(ctyunConfig, SupplierFactory.getCtyunConfig());
return this;
}
/** /**
* 默认从sms-aggregation.yml文件中读取配置 * 默认从sms-aggregation.yml文件中读取配置
* *
@ -216,7 +228,7 @@ public class SEInitializer {
if (huaweiConfig != null) { if (huaweiConfig != null) {
this.initHuawei(huaweiConfig); this.initHuawei(huaweiConfig);
} }
JdCloudConfig jdCloudConfig = smsConfig.getJdCloud(); JdCloudConfig jdCloudConfig = smsConfig.getJdcloud();
if (jdCloudConfig != null) { if (jdCloudConfig != null) {
this.initJdCloud(jdCloudConfig); this.initJdCloud(jdCloudConfig);
} }
@ -232,14 +244,18 @@ public class SEInitializer {
if (yunpianConfig != null) { if (yunpianConfig != null) {
this.initYunpian(yunpianConfig); this.initYunpian(yunpianConfig);
} }
NeteaseConfig neteaseConfig = smsConfig.getNeteaseConfig(); NeteaseConfig neteaseConfig = smsConfig.getNetease();
if (neteaseConfig != null){ if (neteaseConfig != null){
this.initNetase(neteaseConfig); this.initNetase(neteaseConfig);
} }
ZhutongConfig zhutongConfig = smsConfig.getZhutongConfig(); ZhutongConfig zhutongConfig = smsConfig.getZhutong();
if (zhutongConfig != null){ if (zhutongConfig != null){
this.initZhuTong(zhutongConfig); this.initZhuTong(zhutongConfig);
} }
CtyunConfig ctyunConfig = smsConfig.getCtyun();
if (ctyunConfig != null){
this.initCtyun(ctyunConfig);
}
} }
/** /**
@ -263,12 +279,13 @@ public class SEInitializer {
private CloopenConfig cloopen; private CloopenConfig cloopen;
private EmayConfig emay; private EmayConfig emay;
private HuaweiConfig huawei; private HuaweiConfig huawei;
private JdCloudConfig jdCloud; private JdCloudConfig jdcloud;
private TencentConfig tencent; private TencentConfig tencent;
private UniConfig uni; private UniConfig uni;
private YunpianConfig yunpian; private YunpianConfig yunpian;
private NeteaseConfig neteaseConfig; private NeteaseConfig netease;
private ZhutongConfig zhutongConfig; private ZhutongConfig zhutong;
private CtyunConfig ctyun;
} }
} }