mirror of
https://gitee.com/dromara/sms4j.git
synced 2025-12-07 01:18:33 +08:00
去除多余判断和日志
修复:当拦截未开启时,不在进行拦截
This commit is contained in:
parent
7865774b08
commit
0c1e1c5d62
@ -1,14 +1,13 @@
|
||||
package org.dromara.sms4j.core.proxy.processor;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.sms4j.api.proxy.CoreMethodProcessor;
|
||||
import org.dromara.sms4j.comm.exception.SmsBlendException;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@ -61,9 +61,13 @@ public class RestrictedProcessor implements CoreMethodProcessor, SmsDaoAware {
|
||||
|
||||
public void doRestricted(List<String> phones) {
|
||||
if (Objects.isNull(smsDao)) {
|
||||
throw new SmsBlendException("The dao tool could not be found");
|
||||
throw new SmsBlendException("The smsDao tool could not be found");
|
||||
}
|
||||
SmsConfig config = BeanFactory.getSmsConfig();
|
||||
// 如果未开始限制则不做处理
|
||||
if (!config.getRestricted()){
|
||||
return;
|
||||
}
|
||||
Integer accountMax = config.getAccountMax(); // 每日最大发送量
|
||||
Integer minuteMax = config.getMinuteMax(); // 每分钟最大发送量
|
||||
for (String phone : phones) {
|
||||
|
||||
@ -48,10 +48,6 @@ public class SingleBlendRestrictedProcessor implements SmsProcessor, SmsDaoAware
|
||||
String configId = smsBlend.getConfigId();
|
||||
Map targetConfig = (Map) smsBlendsConfig.get(configId);
|
||||
Object maximumObj = targetConfig.get("maximum");
|
||||
if (null == maximumObj) {
|
||||
log.info("配置信息未能加载到本拦截器,跳过渠道级上限前置拦截执行器");
|
||||
return param;
|
||||
}
|
||||
if (SmsUtils.isEmpty(maximumObj)) {
|
||||
return param;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user