(1)端口验证修改,端口必须为数字,不再限制大小小于65535,同时加入限制,非0数字不能以0开头
(2)Maat相关bean加入@Expose注解
This commit is contained in:
@@ -27,44 +27,72 @@ import com.nis.domain.configuration.NumBoundaryCfg;
|
||||
* @version V1.0
|
||||
*/
|
||||
public class MaatCfg implements Serializable {
|
||||
|
||||
@Expose
|
||||
private Integer compileId;
|
||||
@Expose
|
||||
private Integer action;
|
||||
@Expose
|
||||
@SerializedName("service")
|
||||
private Integer serviceId;
|
||||
@Expose
|
||||
@SerializedName("contType")
|
||||
private String classify;//分类
|
||||
@Expose
|
||||
@SerializedName("attrType")
|
||||
private String attribute;//性质
|
||||
@Expose
|
||||
@SerializedName("contLabel")
|
||||
private String lable;//标签
|
||||
@Expose
|
||||
private Integer taskId;
|
||||
@Expose
|
||||
@SerializedName("guaranteeId")
|
||||
private Integer functionId;
|
||||
@Expose
|
||||
@SerializedName("effectiveRange")
|
||||
private String areaEffectiveIds ;
|
||||
@Expose
|
||||
private Integer doBlackList;
|
||||
@Expose
|
||||
private Integer doLog;
|
||||
@Expose
|
||||
private Integer activeSys;
|
||||
@Expose
|
||||
private Integer configPercent;
|
||||
@Expose
|
||||
private Integer configOption;
|
||||
@Expose
|
||||
private Date startTime;
|
||||
@Expose
|
||||
private Date endTime;
|
||||
@Expose
|
||||
private String userRegion;
|
||||
@Expose
|
||||
private Integer groupNum;
|
||||
@Expose
|
||||
private Integer fatherCfgId;
|
||||
@Expose
|
||||
@SerializedName("opTime")
|
||||
private Date auditTime;
|
||||
@Expose
|
||||
private List<GroupCfg> groupRelationList;
|
||||
@Expose
|
||||
private List<StringCfg> strRegionList;
|
||||
@Expose
|
||||
private List<IpCfg> ipRegionList;
|
||||
@Expose
|
||||
private List<NumBoundaryCfg> numRegionList;
|
||||
@Expose
|
||||
private List<DigestCfg> digestRegionList;
|
||||
|
||||
public static class GroupCfg{
|
||||
@Expose
|
||||
private Integer groupId;
|
||||
@Expose
|
||||
private Integer compileId;
|
||||
@Expose
|
||||
private Integer isValid;
|
||||
@Expose
|
||||
private Date opTime;
|
||||
public Integer getGroupId() {
|
||||
return groupId;
|
||||
@@ -93,17 +121,27 @@ public class MaatCfg implements Serializable {
|
||||
|
||||
}
|
||||
public static class StringCfg{
|
||||
@Expose
|
||||
private Integer regionId;
|
||||
@Expose
|
||||
private Integer groupId;
|
||||
@Expose
|
||||
@SerializedName("tableName")
|
||||
private String cfgType;
|
||||
@Expose
|
||||
private String district;
|
||||
@Expose
|
||||
@SerializedName("keywords")
|
||||
private String cfgKeywords;
|
||||
@Expose
|
||||
private Integer exprType;
|
||||
@Expose
|
||||
private Integer matchMethod;
|
||||
@Expose
|
||||
private Integer isHexbin;
|
||||
@Expose
|
||||
private Integer isValid;
|
||||
@Expose
|
||||
private Date opTime;
|
||||
public Integer getRegionId() {
|
||||
return regionId;
|
||||
@@ -168,22 +206,38 @@ public class MaatCfg implements Serializable {
|
||||
|
||||
}
|
||||
public static class IpCfg{
|
||||
@Expose
|
||||
private Integer regionId;
|
||||
@Expose
|
||||
private Integer groupId;
|
||||
@Expose
|
||||
@SerializedName("tableName")
|
||||
private String cfgType;
|
||||
@Expose
|
||||
private Integer ipType;
|
||||
@Expose
|
||||
private String srcIp;
|
||||
@Expose
|
||||
private String srcIpMask ;
|
||||
@Expose
|
||||
private String srcPort ;
|
||||
@Expose
|
||||
private String srcPortMask ;
|
||||
@Expose
|
||||
private String dstIp ;
|
||||
@Expose
|
||||
private String dstIpMask ;
|
||||
@Expose
|
||||
private String dstPort ;
|
||||
@Expose
|
||||
private String dstPortMask ;
|
||||
@Expose
|
||||
private Integer direction ;
|
||||
@Expose
|
||||
private Integer protocol ;
|
||||
@Expose
|
||||
private Integer isValid;
|
||||
@Expose
|
||||
private Date opTime;
|
||||
public Integer getRegionId() {
|
||||
return regionId;
|
||||
@@ -283,13 +337,20 @@ public class MaatCfg implements Serializable {
|
||||
}
|
||||
}
|
||||
public static class NumBoundaryCfg{
|
||||
@Expose
|
||||
private Integer regionId;
|
||||
@Expose
|
||||
private Integer groupId;
|
||||
@Expose
|
||||
@SerializedName("tableName")
|
||||
private String cfgType;
|
||||
@Expose
|
||||
private Integer lowBoundary;
|
||||
@Expose
|
||||
private Integer upBoundary;
|
||||
@Expose
|
||||
private Integer isValid;
|
||||
@Expose
|
||||
private Date opTime;
|
||||
public Integer getRegionId() {
|
||||
return regionId;
|
||||
@@ -334,14 +395,22 @@ public class MaatCfg implements Serializable {
|
||||
this.opTime = opTime;
|
||||
}
|
||||
}public static class DigestCfg{
|
||||
@Expose
|
||||
private Integer regionId;
|
||||
@Expose
|
||||
private Integer groupId;
|
||||
@Expose
|
||||
@SerializedName("tableName")
|
||||
private String cfgType;
|
||||
@Expose
|
||||
private Integer rawLen;
|
||||
@Expose
|
||||
private String digest;
|
||||
@Expose
|
||||
private Integer cfdsLevel;
|
||||
@Expose
|
||||
private Integer isValid;
|
||||
@Expose
|
||||
private Date opTime;
|
||||
public Integer getRegionId() {
|
||||
return regionId;
|
||||
|
||||
@@ -13,6 +13,7 @@ import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.gson.annotations.Expose;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
/**
|
||||
@@ -33,11 +34,15 @@ public class ToMaatBean implements Serializable{
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Expose
|
||||
private String version;
|
||||
@Expose
|
||||
@SerializedName("operator")
|
||||
private String creatorName;
|
||||
@Expose
|
||||
@SerializedName("opTime")
|
||||
private Date auditTime;
|
||||
@Expose
|
||||
private List<MaatCfg> configCompileList;
|
||||
|
||||
public String getVersion() {
|
||||
|
||||
@@ -82,7 +82,7 @@ $(function(){
|
||||
<div class="portlet-body form">
|
||||
<!-- BEGIN FORM-->
|
||||
<form id="ipCfgFrom" action="${ctx}/ntc/whitelist/saveOrUpdateIp" method="post" class="form-horizontal">
|
||||
<div class="form-body">
|
||||
<div class="form-body row">
|
||||
<input type="hidden" name="cfgId" value="${_cfg.cfgId}">
|
||||
<input type="hidden" name="compileId" value="${_cfg.compileId}">
|
||||
<input type="hidden" name="protocolId" value="${_cfg.protocolId}">
|
||||
|
||||
@@ -272,14 +272,14 @@ jQuery.validator.addMethod("portCheck",function(value, element) {
|
||||
typeInt=$(element).parents(".row").find("select[name$='portPattern']").val();
|
||||
}
|
||||
if(typeInt==1){//port 0~65535
|
||||
if(this.optional(element)||(/^([0-9]+)$/.test(value) && (RegExp.$1 <=65535 && RegExp.$1 >=0))){
|
||||
if(this.optional(element)||(/^(0|[1-9]+)$/.test(value))){
|
||||
return true;
|
||||
}else{
|
||||
$.validator.messages.portCheck=$.validator.messages.portRange
|
||||
return false;
|
||||
}
|
||||
}else if(typeInt==2){// port -mask 0~65535/0~65535
|
||||
if(this.optional(element)||(/^([0-9]+)\/([0-9]+)$/.test(value) && (RegExp.$1 <=65535 && RegExp.$2 <=65535))){
|
||||
if(this.optional(element)||(/^(0|[1-9]+)\/(0|[1-9]{1,5})$/.test(value) && RegExp.$2 <=65535)){
|
||||
return true;
|
||||
}else{
|
||||
$.validator.messages.portCheck=$.validator.messages.portMaskRange
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
ipRange1:"start IP should smaller than end IP",
|
||||
portCheck:"Please enter a correct port",
|
||||
notStartZero:"Please enter a valid Integer",
|
||||
portRange:"Port must between 0 and 65535",
|
||||
portMaskRange:"Port and mask must between 0 and 65535.The right pattern is \"port/mask\"."
|
||||
portRange:"Please enter a valid Integer",
|
||||
portMaskRange:"Port must be a valid Integer and mask must between 0 and 65535.The correct pattern is \"port/mask\"."
|
||||
});
|
||||
}(jQuery));
|
||||
|
||||
@@ -22,6 +22,12 @@
|
||||
max: $.validator.format("Пожалуйста, введите число, меньшее или равное {0}."),
|
||||
min: $.validator.format("Пожалуйста, введите число, большее или равное {0}."),
|
||||
ipCheck: $.validator.format(" Пожалуйста, введите правильный IP - адрес."),
|
||||
portCheck: $.validator.format(" Пожалуйста, введите правильный порт.")
|
||||
ipMask:"Please enter a correct IP/mask",
|
||||
ipMaskRange:"IP mask must between 0 and 32",
|
||||
ipRange:"Wrong IP format or start IP and end IP in two subnet",
|
||||
ipRange1:"start IP should smaller than end IP",
|
||||
portCheck: " Пожалуйста, введите правильный порт.",
|
||||
portRange:"Please enter a valid Integer",
|
||||
portMaskRange:"Port must be a valid Integer and mask must between 0 and 65535.The correct pattern is \"port/mask\"."
|
||||
});
|
||||
}(jQuery));
|
||||
@@ -30,7 +30,7 @@
|
||||
ipMaskRange:"掩码范围0到32",
|
||||
ipRange:"IP范围格式错误或者起始IP与结束IP不在同一网段",
|
||||
ipRange1:"起始IP值应小于结束IP值",
|
||||
portRange:"端口范围0 到 65535",
|
||||
portMaskRange:"端口和掩码均为0-65535,格式为\"端口/掩码\""
|
||||
portRange:"端口必须为整数,非0数字不能以0开头",
|
||||
portMaskRange:"端口必须为整数,掩码范围0-65535,非0数字不能以0开头。格式为\"端口/掩码\"",
|
||||
});
|
||||
}(jQuery));
|
||||
|
||||
Reference in New Issue
Block a user