(1)IP payload模板修改
(2)IP导入方法加入参数path,functionId (3)IP payload导入提交
This commit is contained in:
@@ -50,6 +50,7 @@ import com.nis.domain.configuration.RequestInfo;
|
||||
import com.nis.domain.configuration.StringCfgTemplate;
|
||||
import com.nis.domain.configuration.template.IpAllTemplate;
|
||||
import com.nis.domain.configuration.template.IpCfgTemplate;
|
||||
import com.nis.domain.configuration.template.IpPayloadTemplate;
|
||||
import com.nis.domain.configuration.template.IpRateLimitTemplate;
|
||||
import com.nis.domain.log.BaseLogEntity;
|
||||
import com.nis.domain.log.SearchReport;
|
||||
@@ -832,14 +833,37 @@ public class BaseController {
|
||||
try {
|
||||
Double ratelimt= Double.parseDouble(userRegion1);
|
||||
if(ratelimt>0.009||ratelimt<0.001) {
|
||||
errInfo.append(prop.getProperty("ratelimit")+"."+String.format(prop.getProperty("must_between"),0.001,0.009));
|
||||
errInfo.append(prop.getProperty("ratelimit")+"."+String.format(prop.getProperty("must_between"),0.001,0.009)+";");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// TODO: handle exception
|
||||
errInfo.append(String.format(prop.getProperty("not_number"), prop.getProperty("ratelimit")));
|
||||
errInfo.append(String.format(prop.getProperty("not_number"), prop.getProperty("ratelimit"))+";");
|
||||
}
|
||||
}
|
||||
//payload ip
|
||||
if(regionDict.getFunctionId().equals(212)) {
|
||||
//replace_zone
|
||||
String userRegion1=baseIpCfg.getUserRegion1();
|
||||
if(StringUtils.isNotBlank(userRegion1)) {
|
||||
Object val = DictUtils.getDictLabel("INTERCEPT_REPLACE_ZONE", userRegion1);
|
||||
if(StringUtils.isBlank(val.toString())) {
|
||||
errInfo.append(String.format(prop.getProperty("is_incorrect"), prop.getProperty("replace_zone"))+";");
|
||||
}
|
||||
}else {
|
||||
errInfo.append(String.format(prop.getProperty("can_not_null"), prop.getProperty("replace_zone"))+";");
|
||||
}
|
||||
|
||||
//replaced_content
|
||||
String userRegion2=baseIpCfg.getUserRegion2();
|
||||
if(StringUtils.isBlank(userRegion2)) {
|
||||
errInfo.append(String.format(prop.getProperty("can_not_null"), prop.getProperty("replaced_content"))+";");
|
||||
}
|
||||
//replace_content
|
||||
String userRegion3=baseIpCfg.getUserRegion3();
|
||||
if(StringUtils.isBlank(userRegion2)) {
|
||||
errInfo.append(String.format(prop.getProperty("can_not_null"), prop.getProperty("replace_content"))+";");
|
||||
}
|
||||
}
|
||||
|
||||
if (regionDict.getRegionType().equals(1)) {
|
||||
// 校验必填的IP,端口
|
||||
for (String code : configIpPortShow.split(",")) {
|
||||
@@ -2430,6 +2454,11 @@ public class BaseController {
|
||||
ipPortCfgs = this.checkIpCfg(serviceDict, regionDict, list);
|
||||
}
|
||||
}
|
||||
}else if(regionDict.getFunctionId().equals(212)) {
|
||||
if (regionDict.getRegionType().equals(1)) {
|
||||
List<IpPayloadTemplate> list = ei.getDataList(IpPayloadTemplate.class);
|
||||
ipPortCfgs = this.checkIpCfg(serviceDict, regionDict, list);
|
||||
}
|
||||
} else if (regionDict.getRegionType().equals(1)) {
|
||||
List<IpAllTemplate> list = ei.getDataList(IpAllTemplate.class);
|
||||
ipPortCfgs = this.checkIpCfg(serviceDict, regionDict, list);
|
||||
|
||||
Reference in New Issue
Block a user