REM:
1.修改增加设备管理接口设备能力验证
This commit is contained in:
chenlinghy 2020-09-17 11:31:05 +08:00
parent 66b996b104
commit adb9c43c90
1 changed files with 8 additions and 2 deletions

View File

@ -60,6 +60,7 @@ public class ValidAddCapacityInfoImpl implements ConstraintValidator<ValidAddCap
*/
@Override
public boolean isValid(AddCapacityInfo addCapacityInfo, ConstraintValidatorContext ctx) {
int sum = 0;
boolean ret = true;
if (addCapacityInfo == null || addCapacityInfo.getCapacityType() == null) {
@ -92,9 +93,14 @@ public class ValidAddCapacityInfoImpl implements ConstraintValidator<ValidAddCap
for (String s : addCapacityInfo.getProtectIp().split(DisposeConfigValue.SPLIT_CHAR)) {
if (!Pattern.matches(ConstValue.IP_ADDR_SEGMENT_REG, s.replace(" ", ""))) {
errMsg.add("字段 protectIp 包含非法值: " + s);
sum += 1;
break;
}
}
if(sum > 0){
ret = false;
}
}
if (addCapacityInfo.getReserveNetflow() == null) {