(1)修复字段域导入时获取字典值失败原值被替换为空,影响验证的bug

(2)packet ip ratelimit 字段验证
(3)packet ip 滚动条修复
This commit is contained in:
wangxin
2018-10-19 12:46:15 +08:00
parent 5655f16c32
commit 777e78c167
3 changed files with 24 additions and 6 deletions

View File

@@ -825,6 +825,21 @@ public class BaseController {
StringBuffer errInfo = new StringBuffer();
IpPortCfg baseIpCfg = new IpPortCfg();
BeanUtils.copyProperties(list.get(i), baseIpCfg);
//特殊字段验证
//packet ip ratelimit
if(serviceDict.getFunctionId().intValue()==5&&serviceDict.getAction().intValue()==64) {
String userRegion1=baseIpCfg.getUserRegion1();
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));
}
} catch (Exception e) {
// TODO: handle exception
errInfo.append(String.format(prop.getProperty("not_number"), prop.getProperty("ratelimit")));
}
}
if (regionDict.getRegionType().equals(1)) {
// 校验必填的IP端口
for (String code : configIpPortShow.split(",")) {
@@ -1205,7 +1220,7 @@ public class BaseController {
}
}
if (!has) {
errInfo.append(String.format(prop.getProperty("is_incorrect"), prop.getProperty("direction")) + ","
errInfo.append(String.format(prop.getProperty("is_incorrect"), prop.getProperty("direction")) + "."
+ String.format(prop.getProperty("alternative_values"), directionPattern) + ";");
}
return has;
@@ -1233,7 +1248,7 @@ public class BaseController {
}
}
if (!has) {
errInfo.append(String.format(prop.getProperty("is_incorrect"), prop.getProperty("protocol")) + ","
errInfo.append(String.format(prop.getProperty("is_incorrect"), prop.getProperty("protocol")) + "."
+ String.format(prop.getProperty("alternative_values"), protocolPattern) + ";");
}
return has;