IP拦截、域名拦截导入提交.
This commit is contained in:
@@ -93,6 +93,10 @@ public class CheckIpFormatThread implements Callable<String>{
|
||||
String protocol = regionDict.getConfigProtocol();
|
||||
String direction = regionDict.getConfigDirection();
|
||||
StringBuffer errTip = new StringBuffer();
|
||||
// 因IP拦截 监测
|
||||
if(regionDict.getFunctionId().equals(200) && serviceDict.getAction().equals(1)){
|
||||
protocol="6";
|
||||
}
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
StringBuffer errInfo = new StringBuffer();
|
||||
IpPortCfg baseIpCfg = new IpPortCfg();
|
||||
|
||||
@@ -105,8 +105,41 @@ public class CheckStringFormatThread implements Callable<String>{
|
||||
}
|
||||
}
|
||||
}
|
||||
// 代理-域名拦截
|
||||
if (regionDict.getFunctionId().equals(201) && "intercept_domain".equals(regionDict.getConfigServiceType())) {
|
||||
String userRegion5 = baseStringCfg.getUserRegion5();// 拦截强度
|
||||
String userRegion2 = baseStringCfg.getUserRegion2();// 丢包率
|
||||
if (StringUtils.isNotBlank(userRegion5)) {
|
||||
List<SysDataDictionaryItem> dicts = DictUtils.getDictList("INTERCEPT_DOMAIN_INTENSITY");
|
||||
boolean has = false;
|
||||
for (SysDataDictionaryItem dict : dicts) {
|
||||
if (dict.getItemCode().equals(userRegion5)) {
|
||||
has = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!has) {
|
||||
errInfo.append(String.format(prop.getProperty("is_incorrect"),
|
||||
prop.getProperty("intercept_intensity") + " ") + ";");
|
||||
}
|
||||
}
|
||||
if (StringUtils.isNotBlank(userRegion2)) {
|
||||
List<SysDataDictionaryItem> dicts = DictUtils.getDictList("RATE_LIMIT");
|
||||
boolean has = false;
|
||||
for (SysDataDictionaryItem dict : dicts) {
|
||||
if (dict.getItemCode().equals(userRegion2)) {
|
||||
has = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!has) {
|
||||
errInfo.append(String.format(prop.getProperty("is_incorrect"),
|
||||
prop.getProperty("ratelimit") + " ") + ";");
|
||||
}
|
||||
}
|
||||
}
|
||||
String keyword = baseStringCfg.getCfgKeywords();
|
||||
if (!regionDict.getFunctionId().equals(403)) {
|
||||
if (!regionDict.getFunctionId().equals(403) && !regionDict.getFunctionId().equals(201)) {// 201域名拦截
|
||||
if (StringUtils.isBlank(keyword)) {
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("can_not_null"), prop.getProperty("key_word") + " ") + ";");
|
||||
|
||||
Reference in New Issue
Block a user