(1)修复审核时json未携带tableName,userRegion的bug
(2)packet ip 限速修改导入模板 (3)packet ip 限速导入逻辑修改 (4)IP白名单导入添加
This commit is contained in:
@@ -1311,25 +1311,44 @@ public class BaseController {
|
||||
// 特殊字段验证
|
||||
// packet ip ratelimit
|
||||
if (serviceDict!=null&&serviceDict.getFunctionId().intValue() == 5 && serviceDict.getAction().intValue() == 64) {
|
||||
String userRegion1 = baseIpCfg.getUserRegion1();
|
||||
try {
|
||||
// Double ratelimt= Double.parseDouble(userRegion1);
|
||||
List<SysDataDictionaryItem> ratelimtList = DictUtils.getDictList("RATE_LIMIT");
|
||||
boolean has = false;
|
||||
for (SysDataDictionaryItem ratelimit : ratelimtList) {
|
||||
if (ratelimit.getItemCode().equals(userRegion1)) {
|
||||
has = true;
|
||||
break;
|
||||
String userRegion1 = IpRateLimitTemplate.userRegion1;
|
||||
baseIpCfg.setUserRegion1(userRegion1);
|
||||
if("0".equals(userRegion1)) {
|
||||
String userRegion2 = baseIpCfg.getUserRegion2();
|
||||
try {
|
||||
// Double ratelimt= Double.parseDouble(userRegion2);
|
||||
List<SysDataDictionaryItem> ratelimtList = DictUtils.getDictList("RATE_LIMIT");
|
||||
boolean has = false;
|
||||
for (SysDataDictionaryItem ratelimit : ratelimtList) {
|
||||
if (ratelimit.getItemCode().equals(userRegion2)) {
|
||||
has = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!has) {
|
||||
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 (!has) {
|
||||
errInfo.append(prop.getProperty("ratelimit") + "."
|
||||
+ String.format(prop.getProperty("must_between"), 0.001, 0.009) + ";");
|
||||
}else if("1".equals(userRegion1)) {
|
||||
String userRegion3 = baseIpCfg.getUserRegion3();
|
||||
if (StringUtils.isNotBlank(userRegion3)) {
|
||||
try {
|
||||
Integer ratelimt=Integer.parseInt(userRegion3);
|
||||
} catch (Exception e) {
|
||||
// TODO: handle exception
|
||||
errInfo.append(String.format(prop.getProperty("not_number"), prop.getProperty("bandwith")) + ";");
|
||||
}
|
||||
}else {
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("can_not_null"), prop.getProperty("bandwith")) + ";");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// TODO: handle exception
|
||||
errInfo.append(String.format(prop.getProperty("not_number"), prop.getProperty("ratelimit")) + ";");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
// payload ip
|
||||
if (regionDict.getFunctionId().equals(212)) {
|
||||
@@ -3150,7 +3169,7 @@ public class BaseController {
|
||||
_cfg.setTableName(AsnIpCfg.getTablename());
|
||||
_cfg.setAction(0);
|
||||
_cfg.setCfgRegionCode(regionDict.getConfigRegionCode());
|
||||
_cfg.setCfgRegionCode(regionDict.getConfigRegionCode());
|
||||
// _cfg.setCfgRegionCode(regionDict.getConfigRegionCode());
|
||||
_cfg.setCfgType(regionDict.getConfigRegionValue());
|
||||
_cfg.setCreateTime(date);
|
||||
_cfg.setCreatorId(UserUtils.getUser().getId());
|
||||
|
||||
Reference in New Issue
Block a user