mirror of
https://gitee.com/dromara/sms4j.git
synced 2025-12-06 08:58:38 +08:00
替换sql配置源获取数据的方式
This commit is contained in:
parent
d93b8b38a8
commit
aa6e30dce8
@ -65,7 +65,7 @@ public class SmsAutowiredConfig {
|
||||
@Bean
|
||||
@ConditionalOnProperty(prefix = "sms", name = "config-type", havingValue = "sql_config")
|
||||
protected void supplierSqlConfig(){
|
||||
SupplierSqlConfig.newSupplierSqlConfig();
|
||||
SupplierSqlConfig.refreshSqlConfig();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -24,16 +24,22 @@ import java.util.Map;
|
||||
public class SupplierSqlConfig {
|
||||
private static Map<String, String> select;
|
||||
|
||||
static {
|
||||
/**
|
||||
* readSqlConfig
|
||||
* <p>读取数据库配置信息
|
||||
* @author :Wind
|
||||
*/
|
||||
public static void readSqlConfig(){
|
||||
select = JDBCTool.selectConfig();
|
||||
}
|
||||
|
||||
/**
|
||||
* SupplierSqlConfig
|
||||
* <p>在类初始化是完成方法调用
|
||||
* refreshSqlConfig
|
||||
* <p>读取并刷新数据库配置
|
||||
* @author :Wind
|
||||
*/
|
||||
private SupplierSqlConfig() {
|
||||
public static void refreshSqlConfig(){
|
||||
readSqlConfig();
|
||||
alibaba();
|
||||
huawei();
|
||||
jingdong();
|
||||
|
||||
@ -1,5 +1,8 @@
|
||||
package org.dromara.sms4j.core.factory;
|
||||
|
||||
import org.dromara.sms4j.comm.config.SmsConfig;
|
||||
import org.dromara.sms4j.comm.enumerate.ConfigType;
|
||||
import org.dromara.sms4j.comm.factory.BeanFactory;
|
||||
import org.dromara.sms4j.core.SupplierSqlConfig;
|
||||
import org.dromara.sms4j.emay.config.EmaySmsConfig;
|
||||
import org.dromara.sms4j.aliyun.config.AlibabaSmsConfig;
|
||||
@ -101,6 +104,6 @@ public class SmsFactory {
|
||||
* @author :Wind
|
||||
*/
|
||||
public static void refreshSqlConfig() {
|
||||
SupplierSqlConfig.newSupplierSqlConfig();
|
||||
SupplierSqlConfig.refreshSqlConfig();
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user