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