mirror of
https://gitee.com/dromara/sms4j.git
synced 2025-12-07 17:38:38 +08:00
添加一个刷新数据库的方法,SupplierSqlConfig创建方式改为静态工厂获取实例
This commit is contained in:
parent
d5fa888919
commit
afd4a0536f
@ -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(){
|
||||||
new SupplierSqlConfig();
|
SupplierSqlConfig.newSupplierSqlConfig();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -81,7 +81,7 @@ public class SmsAutowiredConfig {
|
|||||||
log.debug("SMS restriction is enabled");
|
log.debug("SMS restriction is enabled");
|
||||||
}
|
}
|
||||||
if (BeanFactory.getSmsConfig().getIsPrint()){
|
if (BeanFactory.getSmsConfig().getIsPrint()){
|
||||||
SmsBanner.PrintBanner("V 1.0.5");
|
SmsBanner.PrintBanner("V 2.0.1");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -72,9 +72,4 @@ public class SupplierConfig {
|
|||||||
protected EmayConfig emayConfig(){
|
protected EmayConfig emayConfig(){
|
||||||
return SupplierFactory.getEmayConfig();
|
return SupplierFactory.getEmayConfig();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 为的是延后执行*/
|
|
||||||
protected void init(){
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -33,7 +33,7 @@ public class SupplierSqlConfig {
|
|||||||
* <p>在类初始化是完成方法调用
|
* <p>在类初始化是完成方法调用
|
||||||
* @author :Wind
|
* @author :Wind
|
||||||
*/
|
*/
|
||||||
public SupplierSqlConfig() {
|
private SupplierSqlConfig() {
|
||||||
alibaba();
|
alibaba();
|
||||||
huawei();
|
huawei();
|
||||||
jingdong();
|
jingdong();
|
||||||
@ -44,6 +44,10 @@ public class SupplierSqlConfig {
|
|||||||
emay();
|
emay();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static SupplierSqlConfig newSupplierSqlConfig(){
|
||||||
|
return new SupplierSqlConfig();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* alibaba
|
* alibaba
|
||||||
* <p>数据库读取并设置阿里云短信
|
* <p>数据库读取并设置阿里云短信
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
package org.dromara.sms4j.core.factory;
|
package org.dromara.sms4j.core.factory;
|
||||||
|
|
||||||
|
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;
|
||||||
import org.dromara.sms4j.api.SmsBlend;
|
import org.dromara.sms4j.api.SmsBlend;
|
||||||
@ -93,4 +94,13 @@ public class SmsFactory {
|
|||||||
}
|
}
|
||||||
throw new SmsBlendException("An attempt to construct a SmsBlend object failed. Please check that the enumeration is valid");
|
throw new SmsBlendException("An attempt to construct a SmsBlend object failed. Please check that the enumeration is valid");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* refreshSqlConfig
|
||||||
|
* <p>重新读取sql配置
|
||||||
|
* @author :Wind
|
||||||
|
*/
|
||||||
|
public static void refreshSqlConfig() {
|
||||||
|
SupplierSqlConfig.newSupplierSqlConfig();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user