Compare commits
66 Commits
develop_co
...
develop_20
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0d6dd1352d | ||
|
|
883a7e46f1 | ||
|
|
a4d8bd11e8 | ||
|
|
a941afae72 | ||
|
|
04c12c67ae | ||
|
|
06d08fce4e | ||
|
|
af926a7a37 | ||
|
|
4845198a76 | ||
|
|
1060a5f85e | ||
|
|
148c18e943 | ||
|
|
e0d7ad06ef | ||
|
|
516ea7e653 | ||
|
|
beb45e5059 | ||
|
|
6af0b7b3b6 | ||
|
|
9f4eb23b8c | ||
|
|
0704e85a9f | ||
|
|
d6866b7407 | ||
|
|
f7f2d5ad1b | ||
|
|
d5b790f3a3 | ||
|
|
37c032d7a4 | ||
|
|
8f524daa01 | ||
|
|
89c8dbefc7 | ||
|
|
8828d88584 | ||
|
|
8c5b78d165 | ||
|
|
92605e323e | ||
|
|
38d1fb5a82 | ||
|
|
3910bcb4e1 | ||
|
|
ad5e517f23 | ||
|
|
5f36272250 | ||
|
|
ac524ee76f | ||
|
|
f5a4d31498 | ||
|
|
6b55ae266f | ||
|
|
8b1258e06e | ||
|
|
cb98f7c7fb | ||
|
|
754d82e9f4 | ||
|
|
fdb270e0ff | ||
|
|
8c199d8be4 | ||
|
|
3ae64f6645 | ||
|
|
b12a74e27f | ||
|
|
627dc7661c | ||
|
|
826543d5ba | ||
|
|
d7ceba7e5c | ||
|
|
2c19901ef8 | ||
|
|
a540ad577e | ||
|
|
c2f07c514f | ||
|
|
ba141e1a5d | ||
|
|
aa465f5fd5 | ||
|
|
752386dd28 | ||
|
|
b76dc62cbb | ||
|
|
001b8948bd | ||
|
|
cd114c263d | ||
|
|
cd4bd32b3f | ||
|
|
6f83f45d6e | ||
|
|
ba151692c0 | ||
|
|
3b98511c29 | ||
|
|
007416034f | ||
|
|
db040c2752 | ||
|
|
45a99aa7ab | ||
|
|
9cc00beaae | ||
|
|
3016a82c17 | ||
|
|
7fdd0f7568 | ||
|
|
6bcb9d6fd6 | ||
|
|
bf3921c9e0 | ||
|
|
00acc9c94a | ||
|
|
c982b506a4 | ||
|
|
aaa0028cbb |
19
README.md
19
README.md
@@ -1 +1,18 @@
|
||||
在公共分组功能逻辑完善之前,此分支为ntc界面系统的全集上线升级分支合并版。
|
||||
5.8号升级版本。
|
||||
|
||||
1、系统支持单独配置 SubscribeID,即仅使用SubscribeID作为配置条件进行监测或者封堵,无需与其它条件组合;
|
||||
|
||||
|
||||
2、系统增加配置30个用户并发进行导入,每次导入不超过2w条 。
|
||||
|
||||
|
||||
3、系统增加saveAndAudit角色,拥有该角色的用户新增配置,配置不经过审核流程直接生效。
|
||||
|
||||
4、日志页面单次可以下载2万条以内的日志;
|
||||
|
||||
|
||||
5、支持监测、统计志查询条件扩展到1个月 (通联日志只能是1天)。
|
||||
|
||||
|
||||
6、配置 页面支持按照配置 id进行查询,支持配置 id输入方式为 10-15;10,13,15;
|
||||
|
||||
|
||||
@@ -20,14 +20,12 @@ public class AsnIpCfg extends BaseCfg<AsnIpCfg> {
|
||||
@ExcelField(title="ip_type",dictType="IP_TYPE",sort=6)
|
||||
@SerializedName("ipType")
|
||||
private Integer ipType;
|
||||
private Integer srcIpPattern;
|
||||
@ExcelField(title="dest_ip_pattern",dictType="IP_PATTERN",sort=8)
|
||||
private Integer destIpPattern;
|
||||
@ExcelField(title="ip_pattern",dictType="IP_PATTERN",sort=8)
|
||||
private Integer ipPattern;
|
||||
private String srcIpAddress;
|
||||
@ExcelField(title="ip",sort=7)
|
||||
private String destIpAddress;
|
||||
private Integer srcPortPattern;
|
||||
private Integer destPortPattern;
|
||||
private Integer portPattern;
|
||||
private String srcPort;
|
||||
private String destPort;
|
||||
//@ExcelField(title="group",sort=2)
|
||||
@@ -119,30 +117,11 @@ public class AsnIpCfg extends BaseCfg<AsnIpCfg> {
|
||||
public void setIpType(Integer ipType) {
|
||||
this.ipType = ipType;
|
||||
}
|
||||
|
||||
public Integer getSrcIpPattern() {
|
||||
return srcIpPattern;
|
||||
public Integer getIpPattern() {
|
||||
return ipPattern;
|
||||
}
|
||||
public void setSrcIpPattern(Integer srcIpPattern) {
|
||||
this.srcIpPattern = srcIpPattern;
|
||||
}
|
||||
public Integer getDestIpPattern() {
|
||||
return destIpPattern;
|
||||
}
|
||||
public void setDestIpPattern(Integer destIpPattern) {
|
||||
this.destIpPattern = destIpPattern;
|
||||
}
|
||||
public Integer getSrcPortPattern() {
|
||||
return srcPortPattern;
|
||||
}
|
||||
public void setSrcPortPattern(Integer srcPortPattern) {
|
||||
this.srcPortPattern = srcPortPattern;
|
||||
}
|
||||
public Integer getDestPortPattern() {
|
||||
return destPortPattern;
|
||||
}
|
||||
public void setDestPortPattern(Integer destPortPattern) {
|
||||
this.destPortPattern = destPortPattern;
|
||||
public void setIpPattern(Integer ipPattern) {
|
||||
this.ipPattern = ipPattern;
|
||||
}
|
||||
public String getSrcIpAddress() {
|
||||
return srcIpAddress;
|
||||
@@ -156,6 +135,12 @@ public class AsnIpCfg extends BaseCfg<AsnIpCfg> {
|
||||
public void setDestIpAddress(String destIpAddress) {
|
||||
this.destIpAddress = destIpAddress;
|
||||
}
|
||||
public Integer getPortPattern() {
|
||||
return portPattern;
|
||||
}
|
||||
public void setPortPattern(Integer portPattern) {
|
||||
this.portPattern = portPattern;
|
||||
}
|
||||
public String getSrcPort() {
|
||||
return srcPort;
|
||||
}
|
||||
@@ -191,10 +176,9 @@ public class AsnIpCfg extends BaseCfg<AsnIpCfg> {
|
||||
}
|
||||
@Override
|
||||
public String toString() {
|
||||
return "AsnIpCfg [regionId=" + regionId + ", ratelimit=" + ratelimit + ", ipType=" + ipType + ", srcIpPattern="
|
||||
+ srcIpPattern + ", destIpPattern="+ destIpPattern+ ", srcIpAddress=" + srcIpAddress + ", destIpAddress="
|
||||
+ destIpAddress + ", srcPortPattern="+ srcPortPattern+", destPortPattern="+ destPortPattern + ", srcPort="
|
||||
+ srcPort + ", destPort=" + destPort + ", asnIpGroupName=" + asnIpGroupName
|
||||
return "AsnIpCfg [regionId=" + regionId + ", ratelimit=" + ratelimit + ", ipType=" + ipType + ", ipPattern="
|
||||
+ ipPattern + ", srcIpAddress=" + srcIpAddress + ", destIpAddress=" + destIpAddress + ", portPattern="
|
||||
+ portPattern + ", srcPort=" + srcPort + ", destPort=" + destPort + ", asnIpGroupName=" + asnIpGroupName
|
||||
+ ", asnIpGroup=" + asnIpGroup + ", direction=" + direction + ", protocol=" + protocol + ", protocolId="
|
||||
+ protocolId + ", compileId=" + compileId + ", isValid=" + isValid + ", userRegion1=" + userRegion1
|
||||
+ ", userRegion2=" + userRegion2 + ", userRegion3=" + userRegion3 + ", userRegion4=" + userRegion4
|
||||
|
||||
@@ -1,315 +0,0 @@
|
||||
package com.nis.domain.basics;
|
||||
|
||||
import com.google.gson.annotations.Expose;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.nis.domain.configuration.BaseCfg;
|
||||
import com.nis.util.excel.ExcelField;
|
||||
|
||||
public class IpCommCfg extends BaseCfg<IpCommCfg> {
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 4218856118489784060L;
|
||||
|
||||
/**
|
||||
* 创建一个新的实例 BaseIpCfg.
|
||||
*
|
||||
*/
|
||||
public IpCommCfg() {
|
||||
super();
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
private String indexTable="ip_comm_cfg";
|
||||
/**
|
||||
* ip类型
|
||||
*/
|
||||
@Expose
|
||||
@SerializedName("ipType")
|
||||
@ExcelField(title="ip_type",dictType="IP_TYPE",sort=50)
|
||||
protected Integer ipType;
|
||||
@ExcelField(title="src_ip_pattern",dictType="IP_PATTERN",sort=51)
|
||||
protected Integer srcIpPattern;
|
||||
@ExcelField(title="client_ip",sort=52)
|
||||
protected String srcIpAddress;
|
||||
@ExcelField(title="dest_ip_pattern",dictType="IP_PATTERN",sort=53)
|
||||
protected Integer destIpPattern;
|
||||
@ExcelField(title="server_ip",sort=54)
|
||||
protected String destIpAddress;
|
||||
@ExcelField(title="src_port_pattern",dictType="PORT_PATTERN",sort=54)
|
||||
protected Integer srcPortPattern;
|
||||
@ExcelField(title="dest_port_pattern",dictType="PORT_PATTERN",sort=54)
|
||||
protected Integer destPortPattern;
|
||||
@ExcelField(title="client_port",sort=55)
|
||||
protected String srcPort;
|
||||
@ExcelField(title="server_port",sort=56)
|
||||
protected String destPort;
|
||||
protected Integer dnsStrategyId;
|
||||
@ExcelField(title="ir_type",dictType="IR_TYPE",sort=57)
|
||||
protected Integer irType;
|
||||
@ExcelField(title="group_name",sort=58)
|
||||
protected String groupName;
|
||||
// @ExcelField(title="log_total",sort=42)
|
||||
private Long totalLogs;
|
||||
private Integer regionId;
|
||||
private Integer groupId;
|
||||
|
||||
public Integer getRegionId() {
|
||||
return regionId;
|
||||
}
|
||||
public void setRegionId(Integer regionId) {
|
||||
this.regionId = regionId;
|
||||
}
|
||||
public Integer getGroupId() {
|
||||
return groupId;
|
||||
}
|
||||
public void setGroupId(Integer groupId) {
|
||||
this.groupId = groupId;
|
||||
}
|
||||
public Long getTotalLogs() {
|
||||
return totalLogs;
|
||||
}
|
||||
public void setTotalLogs(Long totalLogs) {
|
||||
this.totalLogs = totalLogs;
|
||||
}
|
||||
/**
|
||||
* irType
|
||||
* @return irType
|
||||
*/
|
||||
|
||||
public Integer getIrType() {
|
||||
return irType;
|
||||
}
|
||||
/**
|
||||
* @param irType the irType to set
|
||||
*/
|
||||
public void setIrType(Integer irType) {
|
||||
this.irType = irType;
|
||||
}
|
||||
/**
|
||||
* groupName
|
||||
* @return groupName
|
||||
*/
|
||||
|
||||
public String getGroupName() {
|
||||
return groupName;
|
||||
}
|
||||
/**
|
||||
* @param groupName the groupName to set
|
||||
*/
|
||||
public void setGroupName(String groupName) {
|
||||
this.groupName = groupName;
|
||||
}
|
||||
/**
|
||||
* 方向
|
||||
*/
|
||||
@Expose
|
||||
@SerializedName("direction")
|
||||
@ExcelField(title="direction",dictType="DIRECTION",sort=58)
|
||||
protected Integer direction ;
|
||||
/**
|
||||
* 协议
|
||||
*/
|
||||
@Expose
|
||||
@SerializedName("protocol")
|
||||
@ExcelField(title="protocol",dictType="PROTOCOL",sort=59)
|
||||
protected Integer protocol ;
|
||||
/**
|
||||
* 协议ID
|
||||
*/
|
||||
@Expose
|
||||
@SerializedName("protocolId")
|
||||
protected Integer protocolId ;
|
||||
/**
|
||||
* 限速比例
|
||||
*/
|
||||
protected String ratelimit ;
|
||||
|
||||
/**
|
||||
* ratelimit
|
||||
* @return ratelimit
|
||||
*/
|
||||
|
||||
public String getRatelimit() {
|
||||
return ratelimit;
|
||||
}
|
||||
/**
|
||||
* @param ratelimit the ratelimit to set
|
||||
*/
|
||||
public void setRatelimit(String ratelimit) {
|
||||
this.ratelimit = ratelimit;
|
||||
}
|
||||
/**
|
||||
* ipType
|
||||
* @return ipType
|
||||
*/
|
||||
|
||||
public Integer getIpType() {
|
||||
return ipType;
|
||||
}
|
||||
/**
|
||||
* @param ipType the ipType to set
|
||||
*/
|
||||
public void setIpType(Integer ipType) {
|
||||
this.ipType = ipType;
|
||||
}
|
||||
|
||||
/**
|
||||
* direction
|
||||
* @return direction
|
||||
*/
|
||||
|
||||
public Integer getDirection() {
|
||||
return direction;
|
||||
}
|
||||
/**
|
||||
* @param direction the direction to set
|
||||
*/
|
||||
public void setDirection(Integer direction) {
|
||||
this.direction = direction;
|
||||
}
|
||||
/**
|
||||
* protocol
|
||||
* @return protocol
|
||||
*/
|
||||
|
||||
public Integer getProtocol() {
|
||||
return protocol;
|
||||
}
|
||||
/**
|
||||
* @param protocol the protocol to set
|
||||
*/
|
||||
public void setProtocol(Integer protocol) {
|
||||
this.protocol = protocol;
|
||||
}
|
||||
/**
|
||||
* protocolId
|
||||
* @return protocolId
|
||||
*/
|
||||
|
||||
public Integer getProtocolId() {
|
||||
return protocolId;
|
||||
}
|
||||
/**
|
||||
* @param protocolId the protocolId to set
|
||||
*/
|
||||
public void setProtocolId(Integer protocolId) {
|
||||
this.protocolId = protocolId;
|
||||
}
|
||||
|
||||
|
||||
public Integer getSrcIpPattern() {
|
||||
return srcIpPattern;
|
||||
}
|
||||
public void setSrcIpPattern(Integer srcIpPattern) {
|
||||
this.srcIpPattern = srcIpPattern;
|
||||
}
|
||||
public Integer getDestIpPattern() {
|
||||
return destIpPattern;
|
||||
}
|
||||
public void setDestIpPattern(Integer destIpPattern) {
|
||||
this.destIpPattern = destIpPattern;
|
||||
}
|
||||
public Integer getSrcPortPattern() {
|
||||
return srcPortPattern;
|
||||
}
|
||||
public void setSrcPortPattern(Integer srcPortPattern) {
|
||||
this.srcPortPattern = srcPortPattern;
|
||||
}
|
||||
public Integer getDestPortPattern() {
|
||||
return destPortPattern;
|
||||
}
|
||||
public void setDestPortPattern(Integer destPortPattern) {
|
||||
this.destPortPattern = destPortPattern;
|
||||
}
|
||||
/**
|
||||
* srcIpAddress
|
||||
* @return srcIpAddress
|
||||
*/
|
||||
|
||||
public String getSrcIpAddress() {
|
||||
return srcIpAddress;
|
||||
}
|
||||
/**
|
||||
* @param srcIpAddress the srcIpAddress to set
|
||||
*/
|
||||
public void setSrcIpAddress(String srcIpAddress) {
|
||||
this.srcIpAddress = srcIpAddress;
|
||||
}
|
||||
/**
|
||||
* destIpAddress
|
||||
* @return destIpAddress
|
||||
*/
|
||||
|
||||
public String getDestIpAddress() {
|
||||
return destIpAddress;
|
||||
}
|
||||
/**
|
||||
* @param destIpAddress the destIpAddress to set
|
||||
*/
|
||||
public void setDestIpAddress(String destIpAddress) {
|
||||
this.destIpAddress = destIpAddress;
|
||||
}
|
||||
/**
|
||||
* srcPort
|
||||
* @return srcPort
|
||||
*/
|
||||
|
||||
public String getSrcPort() {
|
||||
return srcPort;
|
||||
}
|
||||
/**
|
||||
* @param srcPort the srcPort to set
|
||||
*/
|
||||
public void setSrcPort(String srcPort) {
|
||||
this.srcPort = srcPort;
|
||||
}
|
||||
/**
|
||||
* destPort
|
||||
* @return destPort
|
||||
*/
|
||||
|
||||
public String getDestPort() {
|
||||
return destPort;
|
||||
}
|
||||
/**
|
||||
* @param destPort the destPort to set
|
||||
*/
|
||||
public void setDestPort(String destPort) {
|
||||
this.destPort = destPort;
|
||||
}
|
||||
|
||||
/**
|
||||
* dnsStrategyId
|
||||
* @return dnsStrategyId
|
||||
*/
|
||||
|
||||
public Integer getDnsStrategyId() {
|
||||
return dnsStrategyId;
|
||||
}
|
||||
/**
|
||||
* @param dnsStrategyId the dnsStrategyId to set
|
||||
*/
|
||||
public void setDnsStrategyId(Integer dnsStrategyId) {
|
||||
this.dnsStrategyId = dnsStrategyId;
|
||||
}
|
||||
@Override
|
||||
public void initDefaultValue(){
|
||||
super.initDefaultValue();
|
||||
this.direction = 0;
|
||||
}
|
||||
|
||||
public String getIndexTable() {
|
||||
return indexTable;
|
||||
}
|
||||
public void setIndexTable(String indexTable) {
|
||||
this.indexTable = indexTable;
|
||||
}
|
||||
public Integer getIndex() {
|
||||
return index;
|
||||
}
|
||||
public void setIndex(Integer index) {
|
||||
this.index = index;
|
||||
}
|
||||
}
|
||||
@@ -1,64 +0,0 @@
|
||||
package com.nis.domain.basics;
|
||||
|
||||
import com.nis.domain.configuration.BaseStringCfg;
|
||||
import com.nis.util.excel.ExcelField;
|
||||
|
||||
public class UrlCommCfg extends BaseStringCfg<UrlCommCfg>{
|
||||
|
||||
private static final long serialVersionUID = 398247881810945300L;
|
||||
private static final String tableName="http_url_cfg";
|
||||
|
||||
@ExcelField(title="key_word",sort=3)
|
||||
protected String cfgKeywords;//url关键字配置
|
||||
|
||||
// protected Integer exprType;//表达式类型
|
||||
// protected Integer matchMethod;//匹配类型
|
||||
protected Integer isHexbin;//是否大小写敏感
|
||||
protected String ratelimit;//限速比例,0到1之间
|
||||
@ExcelField(title="group_name",sort=108)
|
||||
protected String groupName;//公共组名称
|
||||
|
||||
|
||||
|
||||
public String getCfgKeywords() {
|
||||
return cfgKeywords;
|
||||
}
|
||||
public void setCfgKeywords(String cfgKeywords) {
|
||||
this.cfgKeywords = cfgKeywords;
|
||||
}
|
||||
// public Integer getExprType() {
|
||||
// return exprType;
|
||||
// }
|
||||
// public void setExprType(Integer exprType) {
|
||||
// this.exprType = exprType;
|
||||
// }
|
||||
// public Integer getMatchMethod() {
|
||||
// return matchMethod;
|
||||
// }
|
||||
// public void setMatchMethod(Integer matchMethod) {
|
||||
// this.matchMethod = matchMethod;
|
||||
// }
|
||||
public Integer getIsHexbin() {
|
||||
return isHexbin;
|
||||
}
|
||||
public void setIsHexbin(Integer isHexbin) {
|
||||
this.isHexbin = isHexbin;
|
||||
}
|
||||
public String getRatelimit() {
|
||||
return ratelimit;
|
||||
}
|
||||
public void setRatelimit(String ratelimit) {
|
||||
this.ratelimit = ratelimit;
|
||||
}
|
||||
public static String getTablename() {
|
||||
return tableName;
|
||||
}
|
||||
|
||||
public String getGroupName() {
|
||||
return groupName;
|
||||
}
|
||||
public void setGroupName(String groupName) {
|
||||
this.groupName = groupName;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
|
||||
package com.nis.domain.configuration;
|
||||
|
||||
import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
|
||||
|
||||
import com.google.gson.annotations.Expose;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.nis.util.excel.ExcelField;
|
||||
@@ -32,13 +34,11 @@ public class AppIpCfg extends BaseCfg<AppIpCfg> {
|
||||
@ExcelField(title="ip_type",dictType="IP_TYPE",sort=3)
|
||||
@SerializedName("ipType")
|
||||
protected Integer ipType;
|
||||
protected Integer srcIpPattern;
|
||||
protected Integer destIpPattern;
|
||||
protected Integer ipPattern;
|
||||
protected String srcIpAddress;
|
||||
@ExcelField(title="server_ip",sort=4)
|
||||
protected String destIpAddress;
|
||||
protected Integer srcPortPattern;
|
||||
protected Integer destPortPattern;
|
||||
protected Integer portPattern;
|
||||
protected String srcPort;
|
||||
@ExcelField(title="server_port",sort=5)
|
||||
protected String destPort;
|
||||
@@ -121,7 +121,34 @@ public class AppIpCfg extends BaseCfg<AppIpCfg> {
|
||||
// this.protocolId = protocolId;
|
||||
// }
|
||||
|
||||
/**
|
||||
* ipPattern
|
||||
* @return ipPattern
|
||||
*/
|
||||
|
||||
public Integer getIpPattern() {
|
||||
return ipPattern;
|
||||
}
|
||||
/**
|
||||
* @param ipPattern the ipPattern to set
|
||||
*/
|
||||
public void setIpPattern(Integer ipPattern) {
|
||||
this.ipPattern = ipPattern;
|
||||
}
|
||||
/**
|
||||
* portPattern
|
||||
* @return portPattern
|
||||
*/
|
||||
|
||||
public Integer getPortPattern() {
|
||||
return portPattern;
|
||||
}
|
||||
/**
|
||||
* @param portPattern the portPattern to set
|
||||
*/
|
||||
public void setPortPattern(Integer portPattern) {
|
||||
this.portPattern = portPattern;
|
||||
}
|
||||
|
||||
/**
|
||||
* srcIpAddress
|
||||
@@ -131,30 +158,6 @@ public class AppIpCfg extends BaseCfg<AppIpCfg> {
|
||||
public String getSrcIpAddress() {
|
||||
return srcIpAddress;
|
||||
}
|
||||
public Integer getSrcIpPattern() {
|
||||
return srcIpPattern;
|
||||
}
|
||||
public void setSrcIpPattern(Integer srcIpPattern) {
|
||||
this.srcIpPattern = srcIpPattern;
|
||||
}
|
||||
public Integer getDestIpPattern() {
|
||||
return destIpPattern;
|
||||
}
|
||||
public void setDestIpPattern(Integer destIpPattern) {
|
||||
this.destIpPattern = destIpPattern;
|
||||
}
|
||||
public Integer getSrcPortPattern() {
|
||||
return srcPortPattern;
|
||||
}
|
||||
public void setSrcPortPattern(Integer srcPortPattern) {
|
||||
this.srcPortPattern = srcPortPattern;
|
||||
}
|
||||
public Integer getDestPortPattern() {
|
||||
return destPortPattern;
|
||||
}
|
||||
public void setDestPortPattern(Integer destPortPattern) {
|
||||
this.destPortPattern = destPortPattern;
|
||||
}
|
||||
/**
|
||||
* @param srcIpAddress the srcIpAddress to set
|
||||
*/
|
||||
@@ -254,10 +257,16 @@ public class AppIpCfg extends BaseCfg<AppIpCfg> {
|
||||
public String toString() {
|
||||
return "AppIpCfg [compileId=" + compileId + ", ratelimit=" + ratelimit + ", appCode=" + appCode + ", behavCode="
|
||||
+ behavCode + ", specServiceId=" + specServiceId + ", appName=" + appName + ", ipType=" + ipType
|
||||
+ ", srcIpPattern=" + srcIpPattern + ", destIpPattern=" + destIpPattern + ", srcIpAddress="
|
||||
+ srcIpAddress + ", destIpAddress=" + destIpAddress + ", srcPortPattern=" + srcPortPattern
|
||||
+ ", destPortPattern=" + destPortPattern + ", srcPort=" + srcPort + ", destPort=" + destPort
|
||||
+ ", direction=" + direction + ", protocol=" + protocol + "]";
|
||||
+ ", ipPattern=" + ipPattern + ", srcIpAddress=" + srcIpAddress + ", destIpAddress=" + destIpAddress
|
||||
+ ", portPattern=" + portPattern + ", srcPort=" + srcPort + ", destPort=" + destPort + ", direction="
|
||||
+ direction + ", protocol=" + protocol + ", userRegion1=" + userRegion1 + ", userRegion2=" + userRegion2
|
||||
+ ", userRegion3=" + userRegion3 + ", userRegion4=" + userRegion4 + ", userRegion5=" + userRegion5
|
||||
+ ", cfgId=" + cfgId + ", cfgDesc=" + cfgDesc + ", action=" + action + ", isValid=" + isValid
|
||||
+ ", isAudit=" + isAudit + ", creatorId=" + creatorId + ", createTime=" + createTime + ", editorId="
|
||||
+ editorId + ", editTime=" + editTime + ", auditorId=" + auditorId + ", auditTime=" + auditTime
|
||||
+ ", serviceId=" + serviceId + ", requestId=" + requestId + ", cancelRequestId=" + cancelRequestId
|
||||
+ ", isAreaEffective=" + isAreaEffective + ", classify=" + classify + ", attribute=" + attribute
|
||||
+ ", lable=" + lable + ", areaEffectiveIds=" + areaEffectiveIds + ", cfgRegionCode=" + cfgRegionCode
|
||||
+ ", cfgType=" + cfgType + ", functionId=" + functionId + ", doLog=" + doLog + "]";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -59,8 +59,7 @@ public class AreaIpCfg extends BaseIpCfg {
|
||||
this.cfgType=Constants.AREA_REGION;
|
||||
this.cfgRegionCode=1;
|
||||
this.protocol=0;
|
||||
this.srcPortPattern=1;
|
||||
this.destPortPattern=1;
|
||||
this.portPattern=1;
|
||||
this.srcPort="0";
|
||||
this.destPort="0";
|
||||
this.direction=0;
|
||||
|
||||
@@ -72,15 +72,8 @@ public class BaseCfg<T> extends BaseEntity<T> implements Cloneable{
|
||||
* 定时任务信息,2019年1月18日18:54:53 修改
|
||||
*/
|
||||
protected ScheduleCfg schedule;
|
||||
|
||||
private String commonGroupIds; //公共组织id(考虑一个compile存在多个asn组织的情况)
|
||||
protected Integer groupType; //url组以及dns组相关功能使用
|
||||
protected Integer udFlag; //url组以及dns组相关功能使用 过滤数据库数据标记
|
||||
public Integer getGroupType() {
|
||||
return groupType;
|
||||
}
|
||||
public void setGroupType(Integer groupType) {
|
||||
this.groupType = groupType;
|
||||
}
|
||||
public String getCommonGroupIds() {
|
||||
return commonGroupIds;
|
||||
}
|
||||
@@ -88,12 +81,8 @@ public class BaseCfg<T> extends BaseEntity<T> implements Cloneable{
|
||||
public void setCommonGroupIds(String commonGroupIds) {
|
||||
this.commonGroupIds = commonGroupIds;
|
||||
}
|
||||
public Integer getUdFlag() {
|
||||
return udFlag;
|
||||
}
|
||||
public void setUdFlag(Integer udFlag) {
|
||||
this.udFlag = udFlag;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public String getExType() {
|
||||
return exType;
|
||||
|
||||
@@ -45,18 +45,14 @@ public class BaseIpCfg extends BaseCfg<BaseIpCfg> {
|
||||
@SerializedName("ipType")
|
||||
@ExcelField(title="ip_type",dictType="IP_TYPE",sort=50)
|
||||
protected Integer ipType;
|
||||
@ExcelField(title="src_ip_pattern",dictType="IP_PATTERN",sort=51)
|
||||
protected Integer srcIpPattern;
|
||||
@ExcelField(title="client_ip",sort=52)
|
||||
@ExcelField(title="ip_pattern",dictType="IP_PATTERN",sort=51)
|
||||
protected Integer ipPattern;
|
||||
@ExcelField(title="client_ip",sort=53)
|
||||
protected String srcIpAddress;
|
||||
@ExcelField(title="dest_ip_pattern",dictType="IP_PATTERN",sort=53)
|
||||
protected Integer destIpPattern;
|
||||
@ExcelField(title="server_ip",sort=54)
|
||||
@ExcelField(title="server_ip",sort=52)
|
||||
protected String destIpAddress;
|
||||
@ExcelField(title="src_port_pattern",dictType="PORT_PATTERN",sort=54)
|
||||
protected Integer srcPortPattern;
|
||||
@ExcelField(title="dest_port_pattern",dictType="PORT_PATTERN",sort=54)
|
||||
protected Integer destPortPattern;
|
||||
@ExcelField(title="port_pattern",dictType="PORT_PATTERN",sort=54)
|
||||
protected Integer portPattern;
|
||||
@ExcelField(title="client_port",sort=55)
|
||||
protected String srcPort;
|
||||
@ExcelField(title="server_port",sort=56)
|
||||
@@ -79,16 +75,9 @@ public class BaseIpCfg extends BaseCfg<BaseIpCfg> {
|
||||
protected String organization; //仅用于copy属性使用
|
||||
protected String country; //仅用于copy属性使用
|
||||
protected String detail; //仅用于copy属性使用
|
||||
protected Integer groupId; //仅用于copy属性使用
|
||||
// @ExcelField(title="log_total",sort=42)
|
||||
private Long totalLogs;
|
||||
|
||||
public Integer getGroupId() {
|
||||
return groupId;
|
||||
}
|
||||
public void setGroupId(Integer groupId) {
|
||||
this.groupId = groupId;
|
||||
}
|
||||
public String getOrganization() {
|
||||
return organization;
|
||||
}
|
||||
@@ -280,31 +269,35 @@ public class BaseIpCfg extends BaseCfg<BaseIpCfg> {
|
||||
this.protocolId = protocolId;
|
||||
}
|
||||
|
||||
/**
|
||||
* ipPattern
|
||||
* @return ipPattern
|
||||
*/
|
||||
|
||||
public Integer getSrcIpPattern() {
|
||||
return srcIpPattern;
|
||||
public Integer getIpPattern() {
|
||||
return ipPattern;
|
||||
}
|
||||
public void setSrcIpPattern(Integer srcIpPattern) {
|
||||
this.srcIpPattern = srcIpPattern;
|
||||
/**
|
||||
* @param ipPattern the ipPattern to set
|
||||
*/
|
||||
public void setIpPattern(Integer ipPattern) {
|
||||
this.ipPattern = ipPattern;
|
||||
}
|
||||
public Integer getDestIpPattern() {
|
||||
return destIpPattern;
|
||||
/**
|
||||
* portPattern
|
||||
* @return portPattern
|
||||
*/
|
||||
|
||||
public Integer getPortPattern() {
|
||||
return portPattern;
|
||||
}
|
||||
public void setDestIpPattern(Integer destIpPattern) {
|
||||
this.destIpPattern = destIpPattern;
|
||||
}
|
||||
public Integer getSrcPortPattern() {
|
||||
return srcPortPattern;
|
||||
}
|
||||
public void setSrcPortPattern(Integer srcPortPattern) {
|
||||
this.srcPortPattern = srcPortPattern;
|
||||
}
|
||||
public Integer getDestPortPattern() {
|
||||
return destPortPattern;
|
||||
}
|
||||
public void setDestPortPattern(Integer destPortPattern) {
|
||||
this.destPortPattern = destPortPattern;
|
||||
/**
|
||||
* @param portPattern the portPattern to set
|
||||
*/
|
||||
public void setPortPattern(Integer portPattern) {
|
||||
this.portPattern = portPattern;
|
||||
}
|
||||
|
||||
/**
|
||||
* srcIpAddress
|
||||
* @return srcIpAddress
|
||||
|
||||
@@ -14,9 +14,7 @@ import java.util.Map;
|
||||
import com.google.gson.annotations.Expose;
|
||||
import com.nis.domain.basics.AsnGroupInfo;
|
||||
import com.nis.domain.basics.AsnIpCfg;
|
||||
import com.nis.domain.basics.IpCommCfg;
|
||||
import com.nis.domain.basics.IpReuseIpCfg;
|
||||
import com.nis.domain.basics.UrlCommCfg;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.excel.ExcelField;
|
||||
|
||||
@@ -79,6 +77,7 @@ public class CfgIndexInfo extends BaseCfg<CfgIndexInfo> {
|
||||
private P2pKeywordCfg p2pKeyword;
|
||||
private List<P2pHashCfg> p2pHashList;
|
||||
private List<P2pKeywordCfg> p2pKeywordList;
|
||||
|
||||
private Integer sourceCompileId;
|
||||
private String searchKeywords;// 列表关键字查询字段
|
||||
|
||||
@@ -89,8 +88,8 @@ public class CfgIndexInfo extends BaseCfg<CfgIndexInfo> {
|
||||
private List<AsnKeywordCfg> asnKeywords;
|
||||
@ExcelField(title="log_total",sort=42)
|
||||
private Long totalLogs;
|
||||
private List<UrlCommCfg> urlCommGroupList;
|
||||
private List<IpCommCfg> ipCommGroupCfgList;
|
||||
|
||||
|
||||
/*private CachePolicyUserRegion cachePolicyUserRegion;//缓存策略用户自定义域参数
|
||||
|
||||
public static class CachePolicyUserRegion{
|
||||
@@ -99,16 +98,9 @@ public class CfgIndexInfo extends BaseCfg<CfgIndexInfo> {
|
||||
|
||||
}
|
||||
}*/
|
||||
|
||||
public String getOrganization() {
|
||||
return organization;
|
||||
}
|
||||
public List<IpCommCfg> getIpCommGroupCfgList() {
|
||||
return ipCommGroupCfgList;
|
||||
}
|
||||
public void setIpCommGroupCfgList(List<IpCommCfg> ipCommGroupCfgList) {
|
||||
this.ipCommGroupCfgList = ipCommGroupCfgList;
|
||||
}
|
||||
public List<AsnKeywordCfg> getAsnKeywords() {
|
||||
return asnKeywords;
|
||||
}
|
||||
@@ -419,11 +411,4 @@ public class CfgIndexInfo extends BaseCfg<CfgIndexInfo> {
|
||||
public void setTotalLogs(Long totalLogs) {
|
||||
this.totalLogs = totalLogs;
|
||||
}
|
||||
public List<UrlCommCfg> getUrlCommGroupList() {
|
||||
return urlCommGroupList;
|
||||
}
|
||||
public void setUrlCommGroupList(List<UrlCommCfg> urlCommGroupList) {
|
||||
this.urlCommGroupList = urlCommGroupList;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.nis.domain.configuration.template;
|
||||
|
||||
/**
|
||||
* wx 将部分字段的标题改变,或者不需要的字段隐藏
|
||||
* 隐藏方法,对于不需要的字段或者方法,Override该字段方法,但是@ExcelField注解不需要加上了
|
||||
* @author dell
|
||||
*
|
||||
*/
|
||||
@Deprecated
|
||||
public class IpAddrTemplate extends IpCfgTemplate {
|
||||
|
||||
|
||||
@Override
|
||||
public Integer getIrType() {
|
||||
// TODO Auto-generated method stub
|
||||
return super.getIrType();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getDnsStrategyId() {
|
||||
// TODO Auto-generated method stub
|
||||
return super.getDnsStrategyId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRatelimit() {
|
||||
// TODO Auto-generated method stub
|
||||
return super.getRatelimit();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
package com.nis.domain.configuration.template;
|
||||
|
||||
import com.google.gson.JsonObject;
|
||||
import com.nis.util.excel.ExcelField;
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,310 @@
|
||||
/**
|
||||
*@Title: BaseStringConfig.java
|
||||
*@Package com.nis.domain.restful
|
||||
*@Description TODO
|
||||
*@author dell
|
||||
*@date 2018年2月5日 下午5:26:02
|
||||
*@version 版本号
|
||||
*/
|
||||
package com.nis.domain.configuration.template;
|
||||
|
||||
import com.nis.util.excel.ExcelField;
|
||||
|
||||
/**
|
||||
* @Description: excel导入IP类配置
|
||||
*/
|
||||
@Deprecated
|
||||
public class IpCfgTemplate {
|
||||
|
||||
/**
|
||||
* @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么)
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
||||
|
||||
|
||||
private Long cfgId;
|
||||
private Integer ipType;//1
|
||||
private Integer ipPattern;//2
|
||||
private String srcIpAddress; //3
|
||||
private String destIpAddress; //4
|
||||
private Integer portPattern; //5
|
||||
private String srcPort; //6
|
||||
private String destPort;//7
|
||||
private Integer protocol;//8
|
||||
protected Integer direction;//9
|
||||
private String cfgDesc;//10
|
||||
private Integer requestId;//11
|
||||
private String requestName;//12
|
||||
private Integer isAreaEffective;//13
|
||||
private String classify;//14
|
||||
private String attribute;//15
|
||||
private String lable;//16
|
||||
private String classifyName;//17
|
||||
private String attributeName;//18
|
||||
private String lableName;//19
|
||||
private String areaEffectiveIds;//20
|
||||
private String ratelimit;//21
|
||||
private Integer dnsStrategyId;//22
|
||||
private Integer irType;//23
|
||||
private String userRegion1;//77
|
||||
private String userRegion2;//78
|
||||
private String userRegion3;//79
|
||||
private String userRegion4;//80
|
||||
private String userRegion5;//81
|
||||
|
||||
/**
|
||||
* userRegion1
|
||||
* @return userRegion1
|
||||
*/
|
||||
// @ExcelField(title="userregion1",align=2,sort=77)
|
||||
public String getUserRegion1() {
|
||||
return userRegion1;
|
||||
}
|
||||
/**
|
||||
* @param userRegion1 the userRegion1 to set
|
||||
*/
|
||||
public void setUserRegion1(String userRegion1) {
|
||||
this.userRegion1 = userRegion1;
|
||||
}
|
||||
/**
|
||||
* userRegion2
|
||||
* @return userRegion2
|
||||
*/
|
||||
// @ExcelField(title="userregion2",align=2,sort=78)
|
||||
public String getUserRegion2() {
|
||||
return userRegion2;
|
||||
}
|
||||
/**
|
||||
* @param userRegion2 the userRegion2 to set
|
||||
*/
|
||||
public void setUserRegion2(String userRegion2) {
|
||||
this.userRegion2 = userRegion2;
|
||||
}
|
||||
/**
|
||||
* userRegion3
|
||||
* @return userRegion3
|
||||
*/
|
||||
// @ExcelField(title="userregion3",align=2,sort=79)
|
||||
public String getUserRegion3() {
|
||||
return userRegion3;
|
||||
}
|
||||
/**
|
||||
* @param userRegion3 the userRegion3 to set
|
||||
*/
|
||||
public void setUserRegion3(String userRegion3) {
|
||||
this.userRegion3 = userRegion3;
|
||||
}
|
||||
/**
|
||||
* userRegion4
|
||||
* @return userRegion4
|
||||
*/
|
||||
// @ExcelField(title="userregion4",align=2,sort=80)
|
||||
public String getUserRegion4() {
|
||||
return userRegion4;
|
||||
}
|
||||
/**
|
||||
* @param userRegion4 the userRegion4 to set
|
||||
*/
|
||||
public void setUserRegion4(String userRegion4) {
|
||||
this.userRegion4 = userRegion4;
|
||||
}
|
||||
/**
|
||||
* userRegion5
|
||||
* @return userRegion5
|
||||
*/
|
||||
// @ExcelField(title="userregion5",align=2,sort=81)
|
||||
public String getUserRegion5() {
|
||||
return userRegion5;
|
||||
}
|
||||
/**
|
||||
* @param userRegion5 the userRegion5 to set
|
||||
*/
|
||||
public void setUserRegion5(String userRegion5) {
|
||||
this.userRegion5 = userRegion5;
|
||||
}
|
||||
/**
|
||||
* ratelimit
|
||||
* @return ratelimit
|
||||
*/
|
||||
@ExcelField(title="ratelimit",align=2,sort=74)
|
||||
public String getRatelimit() {
|
||||
return ratelimit;
|
||||
}
|
||||
/**
|
||||
* @param ratelimit the ratelimit to set
|
||||
*/
|
||||
public void setRatelimit(String ratelimit) {
|
||||
this.ratelimit = ratelimit;
|
||||
}
|
||||
/**
|
||||
* irType
|
||||
* @return irType
|
||||
*/
|
||||
@ExcelField(title="ir_type",align=2,sort=76)
|
||||
public Integer getIrType() {
|
||||
return irType;
|
||||
}
|
||||
/**
|
||||
* @param irType the irType to set
|
||||
*/
|
||||
public void setIrType(Integer irType) {
|
||||
this.irType = irType;
|
||||
}
|
||||
/**
|
||||
* dnsStrategyId
|
||||
* @return dnsStrategyId
|
||||
*/
|
||||
@ExcelField(title="dns_strategy_id",align=2,sort=75)
|
||||
public Integer getDnsStrategyId() {
|
||||
return dnsStrategyId;
|
||||
}
|
||||
/**
|
||||
* @param dnsStrategyId the dnsStrategyId to set
|
||||
*/
|
||||
public void setDnsStrategyId(Integer dnsStrategyId) {
|
||||
this.dnsStrategyId = dnsStrategyId;
|
||||
}
|
||||
@ExcelField(title="ip_type",align=2,sort=1)
|
||||
public Integer getIpType() {
|
||||
return ipType;
|
||||
}
|
||||
public void setIpType(Integer ipType) {
|
||||
this.ipType = ipType;
|
||||
}
|
||||
@ExcelField(title="ip_pattern",align=2,sort=2)
|
||||
public Integer getIpPattern() {
|
||||
return ipPattern;
|
||||
}
|
||||
public void setIpPattern(Integer ipPattern) {
|
||||
this.ipPattern = ipPattern;
|
||||
}
|
||||
@ExcelField(title="client_ip",align=2,sort=3)
|
||||
public String getSrcIpAddress() {
|
||||
return srcIpAddress;
|
||||
}
|
||||
public void setSrcIpAddress(String srcIpAddress) {
|
||||
this.srcIpAddress = srcIpAddress;
|
||||
}
|
||||
@ExcelField(title="server_ip",align=2,sort=4)
|
||||
public String getDestIpAddress() {
|
||||
return destIpAddress;
|
||||
}
|
||||
public void setDestIpAddress(String destIpAddress) {
|
||||
this.destIpAddress = destIpAddress;
|
||||
}
|
||||
@ExcelField(title="port_pattern",align=2,sort=5)
|
||||
public Integer getPortPattern() {
|
||||
return portPattern;
|
||||
}
|
||||
public void setPortPattern(Integer portPattern) {
|
||||
this.portPattern = portPattern;
|
||||
}
|
||||
@ExcelField(title="client_port",align=2,sort=6)
|
||||
public String getSrcPort() {
|
||||
return srcPort;
|
||||
}
|
||||
public void setSrcPort(String srcPort) {
|
||||
this.srcPort = srcPort;
|
||||
}
|
||||
@ExcelField(title="server_port",align=2,sort=7)
|
||||
public String getDestPort() {
|
||||
return destPort;
|
||||
}
|
||||
public void setDestPort(String destPort) {
|
||||
this.destPort = destPort;
|
||||
}
|
||||
public Long getCfgId() {
|
||||
return cfgId;
|
||||
}
|
||||
public void setCfgId(Long cfgId) {
|
||||
this.cfgId = cfgId;
|
||||
}
|
||||
@ExcelField(title="direction",align=2,sort=8)
|
||||
public Integer getDirection() {
|
||||
return direction;
|
||||
}
|
||||
public void setDirection(Integer direction) {
|
||||
this.direction = direction;
|
||||
}
|
||||
@ExcelField(title="config_describe",align=2,sort=11)
|
||||
public String getCfgDesc() {
|
||||
return cfgDesc;
|
||||
}
|
||||
public void setCfgDesc(String cfgDesc) {
|
||||
this.cfgDesc = cfgDesc;
|
||||
}
|
||||
@ExcelField(title="letter",align=2,sort=13)
|
||||
public Integer getRequestId() {
|
||||
return requestId;
|
||||
}
|
||||
public void setRequestId(Integer requestId) {
|
||||
this.requestId = requestId;
|
||||
}
|
||||
public String getRequestName() {
|
||||
return requestName;
|
||||
}
|
||||
public void setRequestName(String requestName) {
|
||||
this.requestName = requestName;
|
||||
}
|
||||
public Integer getIsAreaEffective() {
|
||||
return isAreaEffective;
|
||||
}
|
||||
public void setIsAreaEffective(Integer isAreaEffective) {
|
||||
this.isAreaEffective = isAreaEffective;
|
||||
}
|
||||
@ExcelField(title="classification",align=2,sort=71)
|
||||
public String getClassify() {
|
||||
return classify;
|
||||
}
|
||||
public void setClassify(String classify) {
|
||||
this.classify = classify;
|
||||
}
|
||||
@ExcelField(title="attribute",align=2,sort=72)
|
||||
public String getAttribute() {
|
||||
return attribute;
|
||||
}
|
||||
public void setAttribute(String attribute) {
|
||||
this.attribute = attribute;
|
||||
}
|
||||
@ExcelField(title="label",align=2,sort=73)
|
||||
public String getLable() {
|
||||
return lable;
|
||||
}
|
||||
public void setLable(String lable) {
|
||||
this.lable = lable;
|
||||
}
|
||||
public String getClassifyName() {
|
||||
return classifyName;
|
||||
}
|
||||
public void setClassifyName(String classifyName) {
|
||||
this.classifyName = classifyName;
|
||||
}
|
||||
public String getAttributeName() {
|
||||
return attributeName;
|
||||
}
|
||||
public void setAttributeName(String attributeName) {
|
||||
this.attributeName = attributeName;
|
||||
}
|
||||
public String getLableName() {
|
||||
return lableName;
|
||||
}
|
||||
public void setLableName(String lableName) {
|
||||
this.lableName = lableName;
|
||||
}
|
||||
// @ExcelField(title="area_effective",align=2,sort=70)
|
||||
public String getAreaEffectiveIds() {
|
||||
return areaEffectiveIds;
|
||||
}
|
||||
public void setAreaEffectiveIds(String areaEffectiveIds) {
|
||||
this.areaEffectiveIds = areaEffectiveIds;
|
||||
}
|
||||
@ExcelField(title="protocol",align=2,sort=9)
|
||||
public Integer getProtocol() {
|
||||
return protocol;
|
||||
}
|
||||
public void setProtocol(Integer protocol) {
|
||||
this.protocol = protocol;
|
||||
}
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
package com.nis.domain.configuration.template;
|
||||
|
||||
import com.nis.util.excel.ExcelField;
|
||||
|
||||
public class IpCommCfgTemplate extends IpAllTemplate{
|
||||
@ExcelField(title="ip_group",align=2,sort=10)
|
||||
private Integer groupId;
|
||||
|
||||
public Integer getGroupId() {
|
||||
return groupId;
|
||||
}
|
||||
|
||||
public void setGroupId(Integer groupId) {
|
||||
this.groupId = groupId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSrcIpAddress() {
|
||||
// TODO Auto-generated method stub
|
||||
return super.getSrcIpAddress();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSrcPort() {
|
||||
// TODO Auto-generated method stub
|
||||
return super.getSrcPort();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDestPort() {
|
||||
// TODO Auto-generated method stub
|
||||
return super.getDestPort();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getProtocol() {
|
||||
// TODO Auto-generated method stub
|
||||
return super.getProtocol();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getDirection() {
|
||||
// TODO Auto-generated method stub
|
||||
return super.getDirection();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getDoLog() {
|
||||
// TODO Auto-generated method stub
|
||||
return super.getDoLog();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.nis.domain.configuration.template;
|
||||
|
||||
import com.nis.util.excel.ExcelField;
|
||||
/**
|
||||
* wx 将部分字段的标题改变,或者不需要的字段隐藏
|
||||
* 隐藏方法,对于不需要的字段或者方法,Override该字段方法,但是@ExcelField注解不需要加上了
|
||||
* @author dell
|
||||
*
|
||||
*/
|
||||
@Deprecated
|
||||
public class IpMultiplexPolicyTemplate extends IpCfgTemplate {
|
||||
@Override
|
||||
@ExcelField(title="IP",align=2,sort=3)
|
||||
public String getSrcIpAddress() {
|
||||
return super.getSrcIpAddress();
|
||||
}
|
||||
@ExcelField(title="port",align=2,sort=6)
|
||||
@Override
|
||||
public String getSrcPort() {
|
||||
// TODO Auto-generated method stub
|
||||
return super.getSrcPort();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ExcelField(title="group_name",align=2,sort=75)
|
||||
public Integer getDnsStrategyId() {
|
||||
// TODO Auto-generated method stub
|
||||
return super.getDnsStrategyId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRatelimit() {
|
||||
// TODO Auto-generated method stub
|
||||
return super.getRatelimit();
|
||||
}
|
||||
@Override
|
||||
public String getDestPort() {
|
||||
// TODO Auto-generated method stub
|
||||
return super.getDestPort();
|
||||
}
|
||||
@Override
|
||||
public String getDestIpAddress() {
|
||||
// TODO Auto-generated method stub
|
||||
return super.getDestIpAddress();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.nis.domain.configuration.template;
|
||||
|
||||
/**
|
||||
* wx 将部分字段的标题改变,或者不需要的字段隐藏
|
||||
* 隐藏方法,对于不需要的字段或者方法,Override该字段方法,但是@ExcelField注解不需要加上了
|
||||
* @author dell
|
||||
*
|
||||
*/
|
||||
@Deprecated
|
||||
public class IpsecTemplate extends IpCfgTemplate {
|
||||
|
||||
|
||||
@Override
|
||||
public Integer getIrType() {
|
||||
// TODO Auto-generated method stub
|
||||
return super.getIrType();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getDnsStrategyId() {
|
||||
// TODO Auto-generated method stub
|
||||
return super.getDnsStrategyId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRatelimit() {
|
||||
// TODO Auto-generated method stub
|
||||
return super.getRatelimit();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.nis.domain.configuration.template;
|
||||
|
||||
/**
|
||||
* wx 将部分字段的标题改变,或者不需要的字段隐藏
|
||||
* 隐藏方法,对于不需要的字段或者方法,Override该字段方法,但是@ExcelField注解不需要加上了
|
||||
* @author dell
|
||||
*
|
||||
*/
|
||||
@Deprecated
|
||||
public class TunnelIpTemplate extends IpCfgTemplate {
|
||||
|
||||
|
||||
@Override
|
||||
public Integer getIrType() {
|
||||
// TODO Auto-generated method stub
|
||||
return super.getIrType();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getDnsStrategyId() {
|
||||
// TODO Auto-generated method stub
|
||||
return super.getDnsStrategyId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRatelimit() {
|
||||
// TODO Auto-generated method stub
|
||||
return super.getRatelimit();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getProtocol() {
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package com.nis.domain.configuration.template;
|
||||
|
||||
/**
|
||||
* wx 将部分字段的标题改变,或者不需要的字段隐藏
|
||||
* 隐藏方法,对于不需要的字段或者方法,Override该字段方法,但是@ExcelField注解不需要加上了
|
||||
* @author dell
|
||||
*
|
||||
*/
|
||||
@Deprecated
|
||||
public class WhiteListIpTemplate extends IpCfgTemplate {
|
||||
|
||||
@Override
|
||||
public Integer getDirection() {
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getProtocol() {
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getIrType() {
|
||||
// TODO Auto-generated method stub
|
||||
return super.getIrType();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getDnsStrategyId() {
|
||||
// TODO Auto-generated method stub
|
||||
return super.getDnsStrategyId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getRequestId() {
|
||||
// TODO Auto-generated method stub
|
||||
return super.getRequestId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getClassify() {
|
||||
// TODO Auto-generated method stub
|
||||
return super.getClassify();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAttribute() {
|
||||
// TODO Auto-generated method stub
|
||||
return super.getAttribute();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLable() {
|
||||
// TODO Auto-generated method stub
|
||||
return super.getLable();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRatelimit() {
|
||||
// TODO Auto-generated method stub
|
||||
return super.getRatelimit();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -30,15 +30,13 @@ public class SpecificServiceHostCfg extends BaseEntity<SpecificServiceHostCfg>{
|
||||
@Expose
|
||||
private Integer protocol; //protocol 协议 int N 6表示tcp,17表示udp,0表示任意
|
||||
@Expose
|
||||
private Integer srcIpPattern; //ip格式
|
||||
private Integer destIpPattern; //ip格式
|
||||
private Integer ipPattern; //ip格式
|
||||
@Expose
|
||||
private String srcIpAddress; //源(客户端)IP地址
|
||||
@Expose
|
||||
private String destIpAddress; //目的(服务器)IP地址
|
||||
@Expose
|
||||
private Integer srcPortPattern; //端口格式
|
||||
private Integer destPortPattern; //端口格式
|
||||
private Integer portPattern; //端口格式
|
||||
@Expose
|
||||
private String srcPort; //源(客户端)端口
|
||||
@Expose
|
||||
@@ -116,33 +114,19 @@ public class SpecificServiceHostCfg extends BaseEntity<SpecificServiceHostCfg>{
|
||||
public void setDestPort(String destPort) {
|
||||
this.destPort = destPort;
|
||||
}
|
||||
@ExcelField(title="src_ip_pattern",align=2,sort=21,fieldType=Integer.class)
|
||||
public Integer getSrcIpPattern() {
|
||||
return srcIpPattern;
|
||||
@ExcelField(title="ip_pattern",align=2,sort=21,fieldType=Integer.class)
|
||||
public Integer getIpPattern() {
|
||||
return ipPattern;
|
||||
}
|
||||
public void setSrcIpPattern(Integer srcIpPattern) {
|
||||
this.srcIpPattern = srcIpPattern;
|
||||
public void setIpPattern(Integer ipPattern) {
|
||||
this.ipPattern = ipPattern;
|
||||
}
|
||||
@ExcelField(title="dest_ip_pattern",align=2,sort=22,fieldType=Integer.class)
|
||||
public Integer getDestIpPattern() {
|
||||
return destIpPattern;
|
||||
@ExcelField(title="port_pattern",align=2,sort=40,fieldType=Integer.class)
|
||||
public Integer getPortPattern() {
|
||||
return portPattern;
|
||||
}
|
||||
public void setDestIpPattern(Integer destIpPattern) {
|
||||
this.destIpPattern = destIpPattern;
|
||||
}
|
||||
@ExcelField(title="src_port_pattern",align=2,sort=40,fieldType=Integer.class)
|
||||
public Integer getSrcPortPattern() {
|
||||
return srcPortPattern;
|
||||
}
|
||||
public void setSrcPortPattern(Integer srcPortPattern) {
|
||||
this.srcPortPattern = srcPortPattern;
|
||||
}
|
||||
@ExcelField(title="dest_port_pattern",align=2,sort=41,fieldType=Integer.class)
|
||||
public Integer getDestPortPattern() {
|
||||
return destPortPattern;
|
||||
}
|
||||
public void setDestPortPattern(Integer destPortPattern) {
|
||||
this.destPortPattern = destPortPattern;
|
||||
public void setPortPattern(Integer portPattern) {
|
||||
this.portPattern = portPattern;
|
||||
}
|
||||
@ExcelField(title="direction",align=2,sort=110)
|
||||
public Integer getDirection() {
|
||||
|
||||
@@ -395,10 +395,13 @@ public class ConfigConvertUtil {
|
||||
*/
|
||||
public static List<IpCfg> ipConvert(IpCfg dstIp, BaseIpCfg srcIp) {
|
||||
List<IpCfg> ipConvertList = Lists.newArrayList();
|
||||
boolean isRange = ((srcIp.getIpPattern() != null && srcIp.getIpPattern() == 2)
|
||||
|| (srcIp.getSrcIpAddress() != null && srcIp.getSrcIpAddress().indexOf("-") > -1)
|
||||
|| (srcIp.getDestIpAddress() != null && srcIp.getDestIpAddress().indexOf("-") > -1));
|
||||
if (isRange) {
|
||||
List<IpCfg> tempList = Lists.newArrayList();
|
||||
List<IpCfg> tempList1 = Lists.newArrayList();
|
||||
if (srcIp.getIpType().equals(4)) {// IP V4
|
||||
if(srcIp.getSrcIpPattern().equals(2)) {//源IP范围
|
||||
if (srcIp.getIpType().intValue() == 4) {
|
||||
if (srcIp.getSrcIpAddress() != null) {
|
||||
String startIpPart = srcIp.getSrcIpAddress().split("-")[0];
|
||||
String endIpPart = srcIp.getSrcIpAddress().split("-")[1];
|
||||
@@ -416,24 +419,7 @@ public class ConfigConvertUtil {
|
||||
dstIp.setSrcIpMask("255.255.255.255");
|
||||
tempList.add(dstIp);
|
||||
}
|
||||
}else if(srcIp.getSrcIpPattern().equals(1)){
|
||||
Integer srcMaskNum = Integer.parseInt(srcIp.getSrcIpAddress().split("/")[1]);
|
||||
if (srcMaskNum == 0) {
|
||||
dstIp.setSrcIpMask("0.0.0.0");
|
||||
} else {
|
||||
dstIp.setSrcIpMask(IpUtil.convertMask(srcMaskNum));
|
||||
}
|
||||
dstIp.setSrcIp(srcIp.getSrcIpAddress().split("/")[0]);
|
||||
tempList.add(dstIp);
|
||||
}else if(srcIp.getSrcIpPattern().equals(3)){
|
||||
dstIp.setSrcIp(srcIp.getSrcIpAddress());
|
||||
dstIp.setSrcIpMask("255.255.255.255");
|
||||
tempList.add(dstIp);
|
||||
}else {
|
||||
throw new RuntimeException("Unsupported IP Pattern " + srcIp.getSrcIpPattern());
|
||||
}
|
||||
if (srcIp.getDestIpAddress() != null) {
|
||||
if(srcIp.getDestIpPattern().equals(2)) {
|
||||
String startIpPart = srcIp.getDestIpAddress().split("-")[0];
|
||||
String endIpPart = srcIp.getDestIpAddress().split("-")[1];
|
||||
Integer startNum = Integer.parseInt(startIpPart.split("\\.")[3]);
|
||||
@@ -453,38 +439,6 @@ public class ConfigConvertUtil {
|
||||
}
|
||||
}
|
||||
tempList.clear();
|
||||
}else if(srcIp.getDestIpPattern().equals(1)) {
|
||||
Integer dstMaskNum = Integer.parseInt(srcIp.getDestIpAddress().split("/")[1]);
|
||||
for (IpCfg _cfg : tempList) {
|
||||
IpCfg tempIp = new IpCfg();
|
||||
BeanUtils.copyProperties(_cfg, tempIp);
|
||||
if (dstMaskNum == 0) {
|
||||
tempIp.setDstIpMask("0.0.0.0");
|
||||
} else {
|
||||
tempIp.setDstIpMask(IpUtil.convertMask(dstMaskNum));
|
||||
}
|
||||
tempIp.setDstIp(srcIp.getDestIpAddress().split("/")[0]);
|
||||
if (!tempIp.getSrcIp().equals(tempIp.getDstIp())) {
|
||||
// 处理
|
||||
convertPortValues(tempIp, srcIp);
|
||||
tempList1.add(tempIp);
|
||||
}
|
||||
}
|
||||
tempList.clear();
|
||||
}else {
|
||||
for (IpCfg _cfg : tempList) {
|
||||
IpCfg tempIp = new IpCfg();
|
||||
BeanUtils.copyProperties(_cfg, tempIp);
|
||||
tempIp.setDstIp(srcIp.getDestIpAddress());
|
||||
if (!tempIp.getSrcIp().equals(tempIp.getDstIp())) {
|
||||
tempIp.setDstIpMask("255.255.255.255");
|
||||
// 处理
|
||||
convertPortValues(tempIp, srcIp);
|
||||
tempList1.add(tempIp);
|
||||
}
|
||||
}
|
||||
tempList.clear();
|
||||
}
|
||||
} else {
|
||||
for (IpCfg _cfg : tempList) {
|
||||
_cfg.setDstIp("0.0.0.0");
|
||||
@@ -497,50 +451,206 @@ public class ConfigConvertUtil {
|
||||
} else {
|
||||
ipConvertList.addAll(tempList);
|
||||
}
|
||||
}else if(srcIp.getIpType().equals(6)){// IP V6
|
||||
} else if (srcIp.getIpType().intValue() == 6) {
|
||||
if (srcIp.getSrcIpAddress() != null) {
|
||||
if(srcIp.getSrcIpPattern().equals(2)) {
|
||||
IPv6Address address1 = IPv6Address.fromString(srcIp.getSrcIpAddress().split("-")[0]);
|
||||
IPv6Address address2 = IPv6Address.fromString(srcIp.getSrcIpAddress().split("-")[1]);
|
||||
IPv6Network network = IPv6Network.fromTwoAddresses(address1, address2);
|
||||
dstIp.setSrcIp(address1.toString());
|
||||
dstIp.setSrcIpMask(network.getNetmask().asAddress().toString());
|
||||
}else if(srcIp.getSrcIpPattern().equals(1)){// IP/掩码
|
||||
IPv6Network strangeNetwork = IPv6Network.fromString(srcIp.getSrcIpAddress());
|
||||
dstIp.setSrcIp(srcIp.getSrcIpAddress().split("/")[0]);
|
||||
dstIp.setSrcIpMask(strangeNetwork.getNetmask().asAddress().toString());
|
||||
}else {// IP
|
||||
dstIp.setSrcIp(srcIp.getSrcIpAddress());
|
||||
dstIp.setSrcIpMask("FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF");
|
||||
}
|
||||
} else {
|
||||
dstIp.setSrcIp("::");
|
||||
dstIp.setSrcIpMask("FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF");
|
||||
}
|
||||
if (srcIp.getDestIpAddress() != null) {
|
||||
if(srcIp.getDestIpPattern().equals(2)) {
|
||||
IPv6Address address1 = IPv6Address.fromString(srcIp.getDestIpAddress().split("-")[0]);
|
||||
IPv6Address address2 = IPv6Address.fromString(srcIp.getDestIpAddress().split("-")[1]);
|
||||
IPv6Network network = IPv6Network.fromTwoAddresses(address1, address2);
|
||||
dstIp.setDstIp(address1.toString());
|
||||
dstIp.setDstIpMask(network.getNetmask().asAddress().toString());
|
||||
}else if(srcIp.getDestIpPattern().equals(1)) {// IP/掩码
|
||||
IPv6Network strangeNetwork = IPv6Network.fromString(srcIp.getDestIpAddress());
|
||||
dstIp.setDstIp(srcIp.getDestIpAddress().split("/")[0]);
|
||||
dstIp.setDstIpMask(strangeNetwork.getNetmask().asAddress().toString());
|
||||
}else {// IP
|
||||
dstIp.setDstIp(srcIp.getDestIpAddress());
|
||||
dstIp.setDstIpMask("FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF");
|
||||
}
|
||||
} else {
|
||||
dstIp.setDstIp("::");
|
||||
dstIp.setDstIpMask("FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF");
|
||||
}
|
||||
convertPortValues(dstIp, srcIp);
|
||||
|
||||
ipConvertList.add(dstIp);
|
||||
} else {
|
||||
throw new RuntimeException("Unsupported IP type " + srcIp.getIpType());
|
||||
}
|
||||
} else {
|
||||
if (srcIp.getSrcIpAddress() != null) {
|
||||
if (srcIp.getSrcIpAddress().indexOf("/") != -1) {
|
||||
if (srcIp.getIpType() == 4 /* || srcIp.getIpType()==46 */) {// 46表示源ip为ipv4,目的ip为ipv6
|
||||
Integer srcMaskNum = Integer.parseInt(srcIp.getSrcIpAddress().split("/")[1]);
|
||||
if (srcMaskNum == 0) {
|
||||
dstIp.setSrcIpMask("0.0.0.0");
|
||||
} else {
|
||||
dstIp.setSrcIpMask(IpUtil.convertMask(srcMaskNum));
|
||||
}
|
||||
|
||||
dstIp.setSrcIp(srcIp.getSrcIpAddress().split("/")[0]);
|
||||
} else if (srcIp.getIpType() == 6/* || srcIp.getIpType()==64 */) {// 64表示源ip为ipv6,目的ip为ipv4
|
||||
IPv6Network strangeNetwork = IPv6Network.fromString(srcIp.getSrcIpAddress());
|
||||
dstIp.setSrcIp(srcIp.getSrcIpAddress().split("/")[0]);
|
||||
dstIp.setSrcIpMask(strangeNetwork.getNetmask().asAddress().toString());
|
||||
} /*
|
||||
* else { Pattern
|
||||
* patternV4Subnet=Pattern.compile(Constants.IPV4_IP_SUBNET_REGEXP); Pattern
|
||||
* patternV6Subnet=Pattern.compile(Constants.IPV6_IP_SUBNET_REGEXP); Matcher
|
||||
* matchernV4Subnet=patternV4Subnet.matcher(srcIp.getSrcIpAddress()); Matcher
|
||||
* matcherV6Subnet=patternV6Subnet.matcher(srcIp.getSrcIpAddress());
|
||||
* if(matchernV4Subnet.matches()) { Integer srcMaskNum =
|
||||
* Integer.parseInt(srcIp.getSrcIpAddress().split("/")[1]); if(srcMaskNum==0){
|
||||
* dstIp.setSrcIpMask("0.0.0.0"); }else{
|
||||
* dstIp.setSrcIpMask(IpUtil.convertMask(srcMaskNum)); }
|
||||
* dstIp.setSrcIp(srcIp.getSrcIpAddress().split("/")[0]); }else
|
||||
* if(matcherV6Subnet.matches()){ IPv6Network strangeNetwork =
|
||||
* IPv6Network.fromString(srcIp.getSrcIpAddress());
|
||||
* dstIp.setSrcIp(srcIp.getSrcIpAddress().split("/")[0]);
|
||||
* dstIp.setSrcIpMask(strangeNetwork.getNetmask().asAddress().toString()); }else
|
||||
* { throw new RuntimeException("Invalid IP/subnet mask format"); } }
|
||||
*/
|
||||
else {
|
||||
throw new RuntimeException("Unsupported IP type " + srcIp.getIpType());
|
||||
}
|
||||
} else {
|
||||
if (srcIp.getIpType() == 4/* || srcIp.getIpType()==46 */) {// 46表示源ip为ipv4,目的ip为ipv6
|
||||
dstIp.setSrcIp(srcIp.getSrcIpAddress());
|
||||
dstIp.setSrcIpMask("255.255.255.255");
|
||||
} else if (srcIp.getIpType() == 6/* || srcIp.getIpType()==64 */) {// 64表示源ip为ipv6,目的ip为ipv4
|
||||
dstIp.setSrcIp(srcIp.getSrcIpAddress());
|
||||
dstIp.setSrcIpMask("FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF");
|
||||
} /*
|
||||
* else {//all Pattern patternV4=Pattern.compile(Constants.IPV4_IP_REGEXP);
|
||||
* Pattern patternV6=Pattern.compile(Constants.IPV6_IP_REGEXP); Matcher
|
||||
* matcherV4=patternV4.matcher(srcIp.getSrcIpAddress()); Matcher
|
||||
* matcherV6=patternV6.matcher(srcIp.getSrcIpAddress()); if(matcherV4.matches())
|
||||
* { dstIp.setSrcIp(srcIp.getSrcIpAddress());
|
||||
* dstIp.setSrcIpMask("255.255.255.255"); }else if(matcherV6.matches()) {
|
||||
* dstIp.setSrcIp(srcIp.getSrcIpAddress());
|
||||
* dstIp.setSrcIpMask("FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF"); }else { throw
|
||||
* new RuntimeException("Invalid IP format"); } }
|
||||
*/
|
||||
else {
|
||||
throw new RuntimeException("Unsupported IP type " + srcIp.getIpType());
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (srcIp.getIpType() == 4/* || srcIp.getIpType()==46 */) {// 46表示源ip为ipv4,目的ip为ipv6
|
||||
dstIp.setSrcIp(srcIp.getSrcIpAddress());
|
||||
dstIp.setSrcIpMask("255.255.255.255");
|
||||
} else if (srcIp.getIpType() == 6/* || srcIp.getIpType()==64 */) {// 64表示源ip为ipv6,目的ip为ipv4
|
||||
dstIp.setSrcIp(srcIp.getSrcIpAddress());
|
||||
dstIp.setSrcIpMask("FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF");
|
||||
} /*
|
||||
* else {//all dstIp.setSrcIp(srcIp.getSrcIpAddress());
|
||||
* dstIp.setSrcIpMask("255.255.255.255"); }
|
||||
*/
|
||||
else {
|
||||
throw new RuntimeException("Unsupported IP type " + srcIp.getIpType());
|
||||
}
|
||||
}
|
||||
if (srcIp.getDestIpAddress() != null) {
|
||||
if (srcIp.getDestIpAddress().indexOf("/") != -1) {
|
||||
if (srcIp.getIpType() == 4/* || srcIp.getIpType()==64 */) {// 64表示源ip为ipv6,目的ip为ipv4
|
||||
Integer dstMaskNum = Integer.parseInt(srcIp.getDestIpAddress().split("/")[1]);
|
||||
if (dstMaskNum == 0) {
|
||||
dstIp.setDstIpMask("0.0.0.0");
|
||||
} else {
|
||||
dstIp.setDstIpMask(IpUtil.convertMask(dstMaskNum));
|
||||
;
|
||||
}
|
||||
dstIp.setDstIp(srcIp.getDestIpAddress().split("/")[0]);
|
||||
} else if (srcIp.getIpType() == 6/* || srcIp.getIpType()==46 */) {// 46表示源ip为ipv4,目的ip为ipv6
|
||||
IPv6Network strangeNetwork = IPv6Network.fromString(srcIp.getDestIpAddress());
|
||||
dstIp.setDstIp(srcIp.getDestIpAddress().split("/")[0]);
|
||||
dstIp.setDstIpMask(strangeNetwork.getNetmask().asAddress().toString());
|
||||
} /*
|
||||
* else { Pattern
|
||||
* patternV4Subnet=Pattern.compile(Constants.IPV4_IP_SUBNET_REGEXP); Pattern
|
||||
* patternV6Subnet=Pattern.compile(Constants.IPV6_IP_SUBNET_REGEXP); Matcher
|
||||
* matchernV4Subnet=patternV4Subnet.matcher(srcIp.getDestIpAddress()); Matcher
|
||||
* matcherV6Subnet=patternV6Subnet.matcher(srcIp.getDestIpAddress());
|
||||
* if(matchernV4Subnet.matches()) { Integer dstMaskNum =
|
||||
* Integer.parseInt(srcIp.getDestIpAddress().split("/")[1]); if(dstMaskNum==0){
|
||||
* dstIp.setDstIpMask("0.0.0.0"); }else{
|
||||
* dstIp.setDstIpMask(IpUtil.convertMask(dstMaskNum));; }
|
||||
* dstIp.setDstIp(srcIp.getDestIpAddress().split("/")[0]); }else
|
||||
* if(matcherV6Subnet.matches()){ IPv6Network strangeNetwork =
|
||||
* IPv6Network.fromString(srcIp.getDestIpAddress());
|
||||
* dstIp.setDstIp(srcIp.getDestIpAddress().split("/")[0]);
|
||||
* dstIp.setDstIpMask(strangeNetwork.getNetmask().asAddress().toString()); }else
|
||||
* { throw new RuntimeException("Invalid IP/subnet mask format"); } }
|
||||
*/
|
||||
else {
|
||||
throw new RuntimeException("Unsupported IP type " + srcIp.getIpType());
|
||||
}
|
||||
|
||||
} else {
|
||||
if (srcIp.getIpType() == 4/* || srcIp.getIpType()==64 */) {// 64表示源ip为ipv6,目的ip为ipv4
|
||||
dstIp.setDstIp(srcIp.getDestIpAddress());
|
||||
dstIp.setDstIpMask("255.255.255.255");
|
||||
} else if (srcIp.getIpType() == 6/* || srcIp.getIpType()==46 */) {// 46表示源ip为ipv4,目的ip为ipv6
|
||||
dstIp.setDstIp(srcIp.getDestIpAddress());
|
||||
dstIp.setDstIpMask("FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF");
|
||||
} /*
|
||||
* else {//all Pattern patternV4=Pattern.compile(Constants.IPV4_IP_REGEXP);
|
||||
* Pattern patternV6=Pattern.compile(Constants.IPV6_IP_REGEXP); Matcher
|
||||
* matcherV4=patternV4.matcher(srcIp.getDestIpAddress()); Matcher
|
||||
* matcherV6=patternV6.matcher(srcIp.getDestIpAddress());
|
||||
* if(matcherV4.matches()) { dstIp.setDstIp(srcIp.getDestIpAddress());
|
||||
* dstIp.setDstIpMask("255.255.255.255"); }else if(matcherV6.matches()) {
|
||||
* dstIp.setDstIp(srcIp.getDestIpAddress());
|
||||
* dstIp.setDstIpMask("FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF"); }else { throw
|
||||
* new RuntimeException("invalid ip format"); } }
|
||||
*/
|
||||
else {
|
||||
throw new RuntimeException("Unsupported IP type " + srcIp.getIpType());
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (srcIp.getIpType() == 4/* || srcIp.getIpType()==64 */) {// 64表示源ip为ipv6,目的ip为ipv4
|
||||
dstIp.setDstIp(srcIp.getDestIpAddress());
|
||||
dstIp.setDstIpMask("255.255.255.255");
|
||||
} else if (srcIp.getIpType() == 6/* || srcIp.getIpType()==46 */) {// 46表示源ip为ipv4,目的ip为ipv6
|
||||
dstIp.setDstIp(srcIp.getDestIpAddress());
|
||||
dstIp.setDstIpMask("FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF");
|
||||
} /*
|
||||
* else {//all dstIp.setDstIp(srcIp.getDestIpAddress());
|
||||
* dstIp.setDstIpMask("255.255.255.255"); }
|
||||
*/
|
||||
else {
|
||||
throw new RuntimeException("Unsupported IP type " + srcIp.getIpType());
|
||||
}
|
||||
}
|
||||
if (srcIp.getSrcPort() != null) {
|
||||
if (srcIp.getSrcPort().indexOf("/") != -1) {
|
||||
String srcMaskNum = srcIp.getSrcPort().split("/")[1];
|
||||
dstIp.setSrcPortMask(srcMaskNum);
|
||||
dstIp.setSrcPort(srcIp.getSrcPort().split("/")[0]);
|
||||
} else {
|
||||
dstIp.setSrcPort(srcIp.getSrcPort());
|
||||
dstIp.setSrcPortMask("65535");
|
||||
}
|
||||
} else {
|
||||
dstIp.setSrcPort("0");
|
||||
dstIp.setSrcPortMask("65535");
|
||||
}
|
||||
if (srcIp.getDestPort() != null) {
|
||||
if (srcIp.getDestPort().indexOf("/") != -1) {
|
||||
String dstMaskNum = srcIp.getDestPort().split("/")[1];
|
||||
dstIp.setDstPortMask(dstMaskNum);
|
||||
dstIp.setDstPort(srcIp.getDestPort().split("/")[0]);
|
||||
} else {
|
||||
dstIp.setDstPort(srcIp.getDestPort());
|
||||
dstIp.setDstPortMask("65535");
|
||||
}
|
||||
} else {
|
||||
dstIp.setDstPort("0");
|
||||
dstIp.setDstPortMask("65535");
|
||||
}
|
||||
ipConvertList.add(dstIp);
|
||||
}
|
||||
return ipConvertList;
|
||||
}
|
||||
/**
|
||||
|
||||
@@ -133,7 +133,6 @@ public class ConfigServiceUtil {
|
||||
result=response.readEntity(String.class);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("request_service_failed",e);
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>");
|
||||
}
|
||||
if(response != null && response.getStatus() == 200){
|
||||
|
||||
@@ -185,10 +185,6 @@ public final class Constants {
|
||||
* DNS 策略组KEY
|
||||
*/
|
||||
public static final String CACHE_DNSGROUP_DICT = "dnsGroupDict";
|
||||
/**
|
||||
* IP 公共策略组KEY
|
||||
*/
|
||||
public static final String CACHE_IP_COMM_GROUP_DICT = "ipCommGroupDict";
|
||||
/**
|
||||
* 词典数据分类
|
||||
*/
|
||||
@@ -326,18 +322,56 @@ public final class Constants {
|
||||
// public static final boolean IS_USE_HIVE_DB =
|
||||
// Configurations.getBooleanProperty("isUseHiveDb", true);
|
||||
|
||||
/**
|
||||
* 是否获取数据中心查询记录的总条数
|
||||
*/
|
||||
|
||||
public static final boolean IS_GET_HIVECOUNT = Configurations.getBooleanProperty("isGetHiveCount", true);
|
||||
/**
|
||||
* 是否获取数据中心[神通]查询记录的总条数
|
||||
*/
|
||||
|
||||
public static final boolean IS_SELECT_CLUSTER = Configurations.getBooleanProperty("isSelectCluster", false);
|
||||
|
||||
/**
|
||||
* 神通数据库A的数据最早时间
|
||||
*/
|
||||
public static final Long CLUSTER_A_START_TIME = Configurations.getLongProperty("clusterAStartTime", new Date().getTime());
|
||||
|
||||
/**
|
||||
* 神通数据库B的数据最早时间
|
||||
*/
|
||||
public static final Long CLUSTER_B_START_TIME = Configurations.getLongProperty("clusterBStartTime", new Date().getTime());
|
||||
|
||||
/**
|
||||
* 每次获取数据中心多少条数据,咱们在对获取的数据进行分页处理
|
||||
*/
|
||||
public static final Long EVERY_GETHIVEDATANUM = Configurations.getLongProperty("everyGetHiveDataNum", 10000);
|
||||
|
||||
/**
|
||||
* 是否开启基础校验
|
||||
*/
|
||||
public static final boolean BASE_VALIDATE = Configurations.getBooleanProperty("baseValidate", true);
|
||||
|
||||
public static final Long DATACENTER_TIME = Configurations.getLongProperty("dataCenterTime", 48);
|
||||
|
||||
/**
|
||||
* 是否开启业务校验
|
||||
*/
|
||||
public static final boolean SERVICE_VALIDATE = Configurations.getBooleanProperty("serviceValidate", true);
|
||||
/**
|
||||
* 日志本地存储时间
|
||||
*/
|
||||
public static final Long LOG_LOCAL_TIME = Configurations.getLongProperty("logLocalTime", 48);
|
||||
/**
|
||||
* 实时统计默认时间
|
||||
*/
|
||||
public static final Long REPORT_LOCAL_TIME = Configurations.getLongProperty("reportLocalTime", 1);
|
||||
|
||||
/**
|
||||
* 日志是否从hive中查询
|
||||
*/
|
||||
public static final boolean SEL_FROM_HIVE = Configurations.getBooleanProperty("selFromHive", true);
|
||||
public static final boolean ONLY_SEL_FROM_HIVE = Configurations.getBooleanProperty("onlySelFromHive", true);
|
||||
|
||||
/**
|
||||
@@ -351,6 +385,12 @@ public final class Constants {
|
||||
*/
|
||||
public static final String SEARCH_DATEFORMAT = Configurations.getStringProperty("search.dateformat",
|
||||
"yyyy-MM-dd HH:mm:ss");
|
||||
public static final String SEARCH_ES_HOSTANDPORT_A = Configurations.getStringProperty("search.eshostandport_A",
|
||||
null);
|
||||
public static final String SEARCH_ES_HOSTANDPORT_B = Configurations.getStringProperty("search.eshostandport_B",
|
||||
null);
|
||||
public static final String SEARCH_ES_HOSTANDPORT_C = Configurations.getStringProperty("search.eshostandport_C",
|
||||
null);
|
||||
/**
|
||||
* 数据中心A版数据库名称,程序中每次查询时使用的数据库名称 use HIVEADBNAME
|
||||
*/
|
||||
|
||||
@@ -401,24 +401,4 @@ public class DictUtils {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public static List<PolicyGroupInfo> getIpCommGroups(){
|
||||
List<PolicyGroupInfo> allDictList = (List<PolicyGroupInfo>)CacheUtils.get(Constants.CACHE_IP_COMM_GROUP_DICT);
|
||||
if(StringUtil.isEmpty(allDictList)){
|
||||
allDictList = policyGroupInfoDao.findPolicyGroupInfosByType(5);
|
||||
CacheUtils.put(Constants.CACHE_IP_COMM_GROUP_DICT, allDictList);
|
||||
}
|
||||
return allDictList;
|
||||
}
|
||||
public static PolicyGroupInfo getIpCommGroup(int groupId){
|
||||
List<PolicyGroupInfo> allDictList = getIpCommGroups();
|
||||
if(StringUtil.isEmpty(allDictList)){
|
||||
}else {
|
||||
for(PolicyGroupInfo group:allDictList) {
|
||||
if(group.getServiceGroupId().intValue()==groupId) {
|
||||
return group;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,7 +39,6 @@ import org.apache.poi.xssf.usermodel.XSSFClientAnchor;
|
||||
import org.apache.poi.xssf.usermodel.XSSFRichTextString;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
@@ -598,28 +597,25 @@ public class ExportExcel {
|
||||
commentStr="";
|
||||
}
|
||||
}else{
|
||||
String[] ipPatterns=region.getConfigIpPattern().split(";");
|
||||
if("client_ip".equals(headerStr)){
|
||||
Assert.isTrue(ipPatterns.length==2);
|
||||
String srcIpPattern=ipPatterns[0];
|
||||
if(((","+region.getConfigIpPortShow()+",").indexOf(",1,") > -1) ){
|
||||
commentStr="";
|
||||
if((","+region.getConfigIpType()+",").indexOf(",4,") > -1){
|
||||
if((","+srcIpPattern+",").indexOf(",3,") > -1){
|
||||
if((","+region.getConfigIpPattern()+",").indexOf(",3,") > -1){
|
||||
commentStr=commentStr+Constants.IPV4_DEFAULT_IP_VALUE+"(IPv4)"+"\n";
|
||||
if(StringUtil.isEmpty(defaultValue)){
|
||||
defaultValue=Constants.IPV4_DEFAULT_IP_VALUE;
|
||||
}
|
||||
index++;
|
||||
}
|
||||
if((","+srcIpPattern+",").indexOf(",2,") > -1){
|
||||
if((","+region.getConfigIpPattern()+",").indexOf(",2,") > -1){
|
||||
commentStr=commentStr+Constants.IPV4_DEFAULT_IP_RANGE_VALUE+"("+msgProp.getProperty("ipv4_range_tip")+")"+"\n";
|
||||
if(StringUtil.isEmpty(defaultValue)){
|
||||
defaultValue=Constants.IPV4_DEFAULT_IP_RANGE_VALUE;
|
||||
}
|
||||
index++;
|
||||
}
|
||||
if((","+srcIpPattern+",").indexOf(",1,") > -1){
|
||||
if((","+region.getConfigIpPattern()+",").indexOf(",1,") > -1){
|
||||
commentStr=commentStr+Constants.IPV4_DEFAULT_IP_SUBNET_VALUE+"("+msgProp.getProperty("ipv4_subnet_tip")+")"+"\n";
|
||||
if(StringUtil.isEmpty(defaultValue)){
|
||||
defaultValue=Constants.IPV4_DEFAULT_IP_SUBNET_VALUE;
|
||||
@@ -628,21 +624,21 @@ public class ExportExcel {
|
||||
}
|
||||
}
|
||||
if((","+region.getConfigIpType()+",").indexOf(",6,") > -1){
|
||||
if((","+srcIpPattern+",").indexOf(",3,") > -1){
|
||||
if((","+region.getConfigIpPattern()+",").indexOf(",3,") > -1){
|
||||
commentStr=commentStr+Constants.IPV6_DEFAULT_IP_VALUE+"(IPv6)"+"\n";
|
||||
if(StringUtil.isEmpty(defaultValue)){
|
||||
defaultValue=Constants.IPV6_DEFAULT_IP_VALUE;
|
||||
}
|
||||
index++;
|
||||
}
|
||||
if((","+srcIpPattern+",").indexOf(",2,") > -1){
|
||||
if((","+region.getConfigIpPattern()+",").indexOf(",2,") > -1){
|
||||
commentStr=commentStr+Constants.IPV6_DEFAULT_IP_RANGE_VALUE+"("+msgProp.getProperty("ipv6_range_tip")+")"+"\n";
|
||||
if(StringUtil.isEmpty(defaultValue)){
|
||||
defaultValue=Constants.IPV6_DEFAULT_IP_RANGE_VALUE;
|
||||
}
|
||||
index++;
|
||||
}
|
||||
if((","+srcIpPattern+",").indexOf(",1,") > -1){
|
||||
if((","+region.getConfigIpPattern()+",").indexOf(",1,") > -1){
|
||||
commentStr=commentStr+Constants.IPV6_DEFAULT_IP_SUBNET_VALUE+"("+msgProp.getProperty("ipv6_subnet_tip")+")"+"\n\n";
|
||||
if(StringUtil.isEmpty(defaultValue)){
|
||||
defaultValue=Constants.IPV6_DEFAULT_IP_SUBNET_VALUE;
|
||||
@@ -691,12 +687,12 @@ public class ExportExcel {
|
||||
,msgProp.getProperty("serverip"))+"\n";
|
||||
index++;
|
||||
index++;
|
||||
commentStr=commentStr+"▶"+String.format(msgProp.getProperty("the_same_ip_type"))+"\n";
|
||||
commentStr=commentStr+"▶"+String.format(msgProp.getProperty("the_same_ip_type_pattern"))+"\n";
|
||||
index++;
|
||||
index++;
|
||||
}
|
||||
//4、IP Range 开始IP和结束IP必须在同一网段
|
||||
if(((","+srcIpPattern+",").indexOf(",2,") > -1)){
|
||||
if(((","+region.getConfigIpPattern()+",").indexOf(",2,") > -1)){
|
||||
commentStr=commentStr+"▶"+msgProp.getProperty("ip_range")+","+msgProp.getProperty("ip_range_bit_field")+"\n";
|
||||
index++;
|
||||
index++;
|
||||
@@ -707,7 +703,7 @@ public class ExportExcel {
|
||||
}
|
||||
|
||||
//6、IPv4 Mask 掩码范围16-32
|
||||
if(((","+srcIpPattern+",").indexOf(",1,") > -1)){
|
||||
if(((","+region.getConfigIpPattern()+",").indexOf(",1,") > -1)){
|
||||
if(((","+region.getConfigIpType()+",").indexOf(",4,") > -1)){
|
||||
commentStr=commentStr+"▶"+msgProp.getProperty("ipv4_subnet_tip")+","+msgProp.getProperty("ipv4_mask_range_tip")+"\n";
|
||||
index++;
|
||||
@@ -723,25 +719,24 @@ public class ExportExcel {
|
||||
|
||||
}
|
||||
if("server_ip".equals(headerStr)){
|
||||
String destIpPattern=ipPatterns[1];
|
||||
if((","+region.getConfigIpPortShow()+",").indexOf(",3,") > -1){
|
||||
commentStr="";
|
||||
if((","+region.getConfigIpType()+",").indexOf(",4,") > -1){
|
||||
if((","+destIpPattern+",").indexOf(",3,") > -1){
|
||||
if((","+region.getConfigIpPattern()+",").indexOf(",3,") > -1){
|
||||
commentStr=commentStr+Constants.IPV4_DEFAULT_IP_VALUE+"(IPv4)"+"\n";
|
||||
if(StringUtil.isEmpty(defaultValue)){
|
||||
defaultValue=Constants.IPV4_DEFAULT_IP_VALUE;
|
||||
}
|
||||
index++;
|
||||
}
|
||||
if((","+destIpPattern+",").indexOf(",2,") > -1){
|
||||
if((","+region.getConfigIpPattern()+",").indexOf(",2,") > -1){
|
||||
commentStr=commentStr+Constants.IPV4_DEFAULT_IP_RANGE_VALUE+"("+msgProp.getProperty("ipv4_range_tip")+")"+"\n";
|
||||
if(StringUtil.isEmpty(defaultValue)){
|
||||
defaultValue=Constants.IPV4_DEFAULT_IP_RANGE_VALUE;
|
||||
}
|
||||
index++;
|
||||
}
|
||||
if((","+destIpPattern+",").indexOf(",1,") > -1){
|
||||
if((","+region.getConfigIpPattern()+",").indexOf(",1,") > -1){
|
||||
commentStr=commentStr+Constants.IPV4_DEFAULT_IP_SUBNET_VALUE+"("+msgProp.getProperty("ipv4_subnet_tip")+")"+"\n";
|
||||
if(StringUtil.isEmpty(defaultValue)){
|
||||
defaultValue=Constants.IPV4_DEFAULT_IP_SUBNET_VALUE;
|
||||
@@ -750,21 +745,21 @@ public class ExportExcel {
|
||||
}
|
||||
}
|
||||
if((","+region.getConfigIpType()+",").indexOf(",6,") > -1){
|
||||
if((","+destIpPattern+",").indexOf(",3,") > -1){
|
||||
if((","+region.getConfigIpPattern()+",").indexOf(",3,") > -1){
|
||||
commentStr=commentStr+Constants.IPV6_DEFAULT_IP_VALUE+"(IPv6)"+"\n";
|
||||
if(StringUtil.isEmpty(defaultValue)){
|
||||
defaultValue=Constants.IPV6_DEFAULT_IP_VALUE;
|
||||
}
|
||||
index++;
|
||||
}
|
||||
if((","+destIpPattern+",").indexOf(",2,") > -1){
|
||||
if((","+region.getConfigIpPattern()+",").indexOf(",2,") > -1){
|
||||
commentStr=commentStr+Constants.IPV6_DEFAULT_IP_RANGE_VALUE+"("+msgProp.getProperty("ipv6_range_tip")+")"+"\n";
|
||||
if(StringUtil.isEmpty(defaultValue)){
|
||||
defaultValue=Constants.IPV6_DEFAULT_IP_RANGE_VALUE;
|
||||
}
|
||||
index++;
|
||||
}
|
||||
if((","+destIpPattern+",").indexOf(",1,") > -1){
|
||||
if((","+region.getConfigIpPattern()+",").indexOf(",1,") > -1){
|
||||
commentStr=commentStr+Constants.IPV6_DEFAULT_IP_SUBNET_VALUE+"("+msgProp.getProperty("ipv6_subnet_tip")+")"+"\n\n";
|
||||
if(StringUtil.isEmpty(defaultValue)){
|
||||
defaultValue=Constants.IPV6_DEFAULT_IP_SUBNET_VALUE;
|
||||
@@ -797,12 +792,12 @@ public class ExportExcel {
|
||||
,msgProp.getProperty("serverip"))+"\n";
|
||||
index++;
|
||||
index++;
|
||||
commentStr=commentStr+"▶"+String.format(msgProp.getProperty("the_same_ip_type"))+"\n";
|
||||
commentStr=commentStr+"▶"+String.format(msgProp.getProperty("the_same_ip_type_pattern"))+"\n";
|
||||
index++;
|
||||
index++;
|
||||
}
|
||||
//4、IP Range 开始IP和结束IP必须在同一网段
|
||||
if(((","+destIpPattern+",").indexOf(",2,") > -1)){
|
||||
if(((","+region.getConfigIpPattern()+",").indexOf(",2,") > -1)){
|
||||
commentStr=commentStr+"▶"+msgProp.getProperty("ip_range")+","+msgProp.getProperty("ip_range_bit_field")+"\n";
|
||||
index++;
|
||||
index++;
|
||||
@@ -813,7 +808,7 @@ public class ExportExcel {
|
||||
}
|
||||
|
||||
//6、IPv4 Mask 掩码范围16-32
|
||||
if(((","+destIpPattern+",").indexOf(",1,") > -1)){
|
||||
if(((","+region.getConfigIpPattern()+",").indexOf(",1,") > -1)){
|
||||
if(((","+region.getConfigIpType()+",").indexOf(",4,") > -1)){
|
||||
commentStr=commentStr+"▶"+msgProp.getProperty("ipv4_subnet_tip")+","+msgProp.getProperty("ipv4_mask_range_tip")+"\n";
|
||||
index++;
|
||||
@@ -839,20 +834,17 @@ public class ExportExcel {
|
||||
}else{
|
||||
protocol=region.getConfigProtocol();
|
||||
}
|
||||
String[] portPatterns=region.getConfigPortPattern().split(";");
|
||||
Assert.isTrue(portPatterns.length==2);
|
||||
if("client_port".equals(headerStr)){
|
||||
String srcPortPattern=portPatterns[0];
|
||||
if(((","+region.getConfigIpPortShow()+",").indexOf(",2,") > -1)){
|
||||
commentStr="";
|
||||
if((","+srcPortPattern+",").indexOf(",1,") > -1){
|
||||
if((","+region.getConfigPortPattern()+",").indexOf(",1,") > -1){
|
||||
commentStr=commentStr+Constants.PORT_DEFAULT+"(Port)"+"\n";
|
||||
if(StringUtil.isEmpty(defaultValue)){
|
||||
defaultValue=Constants.PORT_DEFAULT;
|
||||
}
|
||||
index++;
|
||||
}
|
||||
if((","+srcPortPattern+",").indexOf(",2,") > -1){
|
||||
if((","+region.getConfigPortPattern()+",").indexOf(",2,") > -1){
|
||||
commentStr=commentStr+Constants.PORT_MASK_DEFAULT+"(Port/"+msgProp.getProperty("port_mask")+")"+"\n\n";
|
||||
if(StringUtil.isEmpty(defaultValue)){
|
||||
defaultValue=Constants.PORT_MASK_DEFAULT;
|
||||
@@ -878,11 +870,11 @@ public class ExportExcel {
|
||||
index++;
|
||||
}
|
||||
//2、源端口、目的端口格式必须一致
|
||||
// if(((","+region.getConfigIpPortShow()+",").indexOf(",2,") > -1) && ((","+region.getConfigIpPortShow()+",").indexOf(",4,") > -1)){
|
||||
// commentStr=commentStr+"▶"+msgProp.getProperty("the_same_port_pattern")+"\n";
|
||||
// index++;
|
||||
// index++;
|
||||
// }
|
||||
if(((","+region.getConfigIpPortShow()+",").indexOf(",2,") > -1) && ((","+region.getConfigIpPortShow()+",").indexOf(",4,") > -1)){
|
||||
commentStr=commentStr+"▶"+msgProp.getProperty("the_same_port_pattern")+"\n";
|
||||
index++;
|
||||
index++;
|
||||
}
|
||||
//3、端口和端口掩码范围0-65535
|
||||
commentStr=commentStr+"▶"+msgProp.getProperty("port_mask_comment_tip")+"\n";
|
||||
index++;
|
||||
@@ -917,17 +909,16 @@ public class ExportExcel {
|
||||
}
|
||||
}
|
||||
if("server_port".equals(headerStr)){
|
||||
String destPortPattern=portPatterns[1];
|
||||
if((","+region.getConfigIpPortShow()+",").indexOf(",4,") > -1){
|
||||
commentStr="";
|
||||
if((","+destPortPattern+",").indexOf(",1,") > -1){
|
||||
if((","+region.getConfigPortPattern()+",").indexOf(",1,") > -1){
|
||||
commentStr=commentStr+Constants.PORT_DEFAULT+"(Port)"+"\n";
|
||||
if(StringUtil.isEmpty(defaultValue)){
|
||||
defaultValue=Constants.PORT_DEFAULT;
|
||||
}
|
||||
index++;
|
||||
}
|
||||
if((","+destPortPattern+",").indexOf(",2,") > -1){
|
||||
if((","+region.getConfigPortPattern()+",").indexOf(",2,") > -1){
|
||||
commentStr=commentStr+Constants.PORT_MASK_DEFAULT+"(Port/"+msgProp.getProperty("port_mask")+")"+"\n\n";
|
||||
if(StringUtil.isEmpty(defaultValue)){
|
||||
defaultValue=Constants.PORT_MASK_DEFAULT;
|
||||
@@ -953,11 +944,11 @@ public class ExportExcel {
|
||||
index++;
|
||||
}
|
||||
//2、源端口、目的端口格式必须一致
|
||||
// if(((","+region.getConfigIpPortShow()+",").indexOf(",2,") > -1) && ((","+region.getConfigIpPortShow()+",").indexOf(",4,") > -1)){
|
||||
// commentStr=commentStr+"▶"+msgProp.getProperty("the_same_port_pattern")+"\n";
|
||||
// index++;
|
||||
// index++;
|
||||
// }
|
||||
if(((","+region.getConfigIpPortShow()+",").indexOf(",2,") > -1) && ((","+region.getConfigIpPortShow()+",").indexOf(",4,") > -1)){
|
||||
commentStr=commentStr+"▶"+msgProp.getProperty("the_same_port_pattern")+"\n";
|
||||
index++;
|
||||
index++;
|
||||
}
|
||||
//3、端口和端口掩码范围0-65535
|
||||
commentStr=commentStr+"▶"+msgProp.getProperty("port_mask_comment_tip")+"\n";
|
||||
index++;
|
||||
@@ -2367,7 +2358,7 @@ public class ExportExcel {
|
||||
}
|
||||
}
|
||||
end=System.currentTimeMillis();
|
||||
System.err.println("setDataList cost:"+(end-start));
|
||||
log.info("setDataList cost:"+(end-start));
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
|
||||
@@ -13,7 +13,6 @@ import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.jets3t.service.ServiceException;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
import com.beust.jcommander.internal.Lists;
|
||||
import com.nis.domain.FunctionRegionDict;
|
||||
@@ -28,7 +27,6 @@ import com.nis.domain.configuration.template.IpRateLimitTemplate;
|
||||
//import com.nis.util.AsnCacheUtils;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.DictUtils;
|
||||
import com.nis.util.IPUtil;
|
||||
import com.nis.util.StringUtil;
|
||||
|
||||
public class CheckIpFormatThread implements Callable<String>{
|
||||
@@ -94,20 +92,14 @@ public class CheckIpFormatThread implements Callable<String>{
|
||||
}
|
||||
boolean canIPv4 = ipType.indexOf("4") > -1;
|
||||
boolean canIPv6 = ipType.indexOf("6") > -1;
|
||||
String[] ipPattern = regionDict.getConfigIpPattern().split(";");
|
||||
Assert.isTrue(ipPattern!=null&&ipPattern.length==2);
|
||||
String srcIpPattern = ipPattern[0];
|
||||
String destIpPattern = ipPattern[1];
|
||||
if (StringUtils.isBlank(srcIpPattern)||StringUtils.isBlank(destIpPattern)) {
|
||||
String ipPattern = regionDict.getConfigIpPattern();
|
||||
if (StringUtils.isBlank(ipPattern)) {
|
||||
throw new RuntimeException("Found IP region,but ipPattern is Empty");
|
||||
}
|
||||
boolean canIPFormat = ipType.indexOf("3") > -1;
|
||||
boolean canIPSubnetFormat = ipType.indexOf("1") > -1;
|
||||
boolean canIPRangeFormat = ipType.indexOf("2") > -1;
|
||||
String[] portPattern = regionDict.getConfigPortPattern().split(";");
|
||||
Assert.isTrue(ipPattern!=null&&ipPattern.length==2);
|
||||
String srcPortPattern=portPattern[0];
|
||||
String destPortPattern=portPattern[1];
|
||||
String portPattern = regionDict.getConfigPortPattern();
|
||||
String protocol = regionDict.getConfigProtocol();
|
||||
String direction = regionDict.getConfigDirection();
|
||||
StringBuffer errTip = new StringBuffer();
|
||||
@@ -577,26 +569,7 @@ public class CheckIpFormatThread implements Callable<String>{
|
||||
}
|
||||
}
|
||||
}
|
||||
if (regionDict.getFunctionId().equals(110)) {
|
||||
if(baseIpCfg.getGroupId()==null) {
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("can_not_null"),prop.getProperty("ip_group","IP Group") + " ") + ";");
|
||||
}else {
|
||||
try {
|
||||
Integer groupId=baseIpCfg.getGroupId();
|
||||
PolicyGroupInfo group = DictUtils.getIpCommGroup(groupId);
|
||||
if (group == null ) {
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("is_incorrect"), prop.getProperty("ip_group","IP Group"))
|
||||
+ ";");
|
||||
}
|
||||
}catch (Exception e) {
|
||||
// TODO: handle exception
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("is_in_wrong_format"),prop.getProperty("ip_group","IP Group") + " ") + ";");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (regionDict.getRegionType().equals(1)) {
|
||||
boolean srcIpEmpty = false;
|
||||
boolean destIpEmpty = false;
|
||||
@@ -648,40 +621,74 @@ public class CheckIpFormatThread implements Callable<String>{
|
||||
prop.getProperty("server_ip", "Server IP")) + ";");
|
||||
} else if (configIpPortShow.indexOf("1") > -1) {
|
||||
String matchType = this.validIPAddress("client_ip", errInfo, baseIpCfg.getSrcIpAddress(),
|
||||
ipType, srcIpPattern);
|
||||
//设置源IP pattern
|
||||
if (matchType.endsWith("RANGE")) {
|
||||
baseIpCfg.setSrcIpPattern(2);
|
||||
} else if (matchType.endsWith("SUBNET")) {
|
||||
baseIpCfg.setSrcIpPattern(1);
|
||||
}else {
|
||||
baseIpCfg.setSrcIpPattern(3);
|
||||
}
|
||||
ipType, ipPattern);
|
||||
if (matchType.startsWith("IPV6")) {
|
||||
//设置dest ip值
|
||||
if(destIpPattern.indexOf("3")>-1) {//优先设置IP类型,因为拆分的IP较少
|
||||
baseIpCfg.setDestIpAddress(Constants.IPV6_DEFAULT_IP_VALUE);
|
||||
baseIpCfg.setDestIpPattern(3);
|
||||
}else if(destIpPattern.indexOf("1")>-1) {
|
||||
baseIpCfg.setDestIpAddress(Constants.IPV6_DEFAULT_IP_SUBNET_VALUE);
|
||||
baseIpCfg.setDestIpPattern(1);
|
||||
}else {
|
||||
if (matchType.endsWith("RANGE")) {
|
||||
// baseIpCfg.setSrcIpAddress(baseIpCfg.getSrcIpAddress());
|
||||
baseIpCfg.setDestIpAddress(Constants.IPV6_DEFAULT_IP_RANGE_VALUE);
|
||||
baseIpCfg.setDestIpPattern(2);
|
||||
baseIpCfg.setIpPattern(2);
|
||||
if (baseIpCfg.getSrcIpAddress()
|
||||
.startsWith(Constants.IPV6_DEFAULT_IP_RANGE_VALUE.split("-")[0])) {
|
||||
errInfo.append(prop.getProperty("client_ip")+" "
|
||||
+ String.format(prop.getProperty("can_not_be"),
|
||||
Constants.IPV6_DEFAULT_IP_RANGE_VALUE.split("-")[0])
|
||||
+ ";");
|
||||
}
|
||||
} else if (matchType.endsWith("SUBNET")) {
|
||||
// baseIpCfg.setSrcIpAddress(baseIpCfg.getSrcIpAddress());
|
||||
baseIpCfg.setDestIpAddress(Constants.IPV6_DEFAULT_IP_SUBNET_VALUE);
|
||||
baseIpCfg.setIpPattern(1);
|
||||
if (baseIpCfg.getSrcIpAddress()
|
||||
.startsWith(Constants.IPV6_DEFAULT_IP_SUBNET_VALUE.split("/")[0])) {
|
||||
errInfo.append(
|
||||
prop.getProperty("client_ip")+" "
|
||||
+ String.format(prop.getProperty("can_not_be"),
|
||||
Constants.IPV6_DEFAULT_IP_SUBNET_VALUE.split("/")[0])
|
||||
+ ";");
|
||||
}
|
||||
} else {
|
||||
// baseIpCfg.setSrcIpAddress(baseIpCfg.getSrcIpAddress());
|
||||
baseIpCfg.setDestIpAddress(Constants.IPV6_DEFAULT_IP_VALUE);
|
||||
baseIpCfg.setIpPattern(3);
|
||||
if (baseIpCfg.getSrcIpAddress().equals(Constants.IPV6_DEFAULT_IP_VALUE)) {
|
||||
errInfo.append(prop.getProperty("client_ip")+" " + String.format(
|
||||
prop.getProperty("can_not_be"), Constants.IPV6_DEFAULT_IP_VALUE) + ";");
|
||||
}
|
||||
}
|
||||
//设置IP类型
|
||||
baseIpCfg.setIpType(6);
|
||||
} else {
|
||||
//设置dest ip值
|
||||
if(destIpPattern.indexOf("3")>-1) {//优先设置IP类型,因为拆分的IP较少
|
||||
baseIpCfg.setDestIpAddress(Constants.IPV4_DEFAULT_IP_VALUE);
|
||||
baseIpCfg.setDestIpPattern(3);
|
||||
}else if(destIpPattern.indexOf("1")>-1) {
|
||||
baseIpCfg.setDestIpAddress(Constants.IPV4_DEFAULT_IP_SUBNET_VALUE);
|
||||
baseIpCfg.setDestIpPattern(1);
|
||||
}else {
|
||||
if (matchType.endsWith("RANGE")) {
|
||||
this.validIPv4Range("client_ip", errInfo, baseIpCfg.getSrcIpAddress());
|
||||
// baseIpCfg.setSrcIpAddress("0.0.0.0-"+baseIpCfg.getSrcIpAddress().split("-")[0].substring(0,baseIpCfg.getSrcIpAddress().indexOf("-")+1)+baseIpCfg.getSrcIpAddress().split("-")[1]);
|
||||
baseIpCfg.setDestIpAddress(Constants.IPV4_DEFAULT_IP_RANGE_VALUE);
|
||||
baseIpCfg.setDestIpPattern(2);
|
||||
baseIpCfg.setIpPattern(2);
|
||||
if (baseIpCfg.getSrcIpAddress()
|
||||
.startsWith(Constants.IPV4_DEFAULT_IP_RANGE_VALUE.split("-")[0])) {
|
||||
errInfo.append(prop.getProperty("client_ip")+" "
|
||||
+ String.format(prop.getProperty("can_not_be"),
|
||||
Constants.IPV4_DEFAULT_IP_RANGE_VALUE.split("-")[0])
|
||||
+ ";");
|
||||
}
|
||||
} else if (matchType.endsWith("SUBNET")) {
|
||||
// baseIpCfg.setSrcIpAddress(baseIpCfg.getSrcIpAddress());
|
||||
baseIpCfg.setDestIpAddress(Constants.IPV4_DEFAULT_IP_SUBNET_VALUE);
|
||||
baseIpCfg.setIpPattern(1);
|
||||
if (baseIpCfg.getSrcIpAddress()
|
||||
.startsWith(Constants.IPV4_DEFAULT_IP_SUBNET_VALUE.split("/")[0])) {
|
||||
errInfo.append(
|
||||
prop.getProperty("client_ip")+" "
|
||||
+ String.format(prop.getProperty("can_not_be"),
|
||||
Constants.IPV4_DEFAULT_IP_SUBNET_VALUE.split("/")[0])
|
||||
+ ";");
|
||||
}
|
||||
} else {
|
||||
baseIpCfg.setSrcIpAddress(baseIpCfg.getSrcIpAddress());
|
||||
baseIpCfg.setDestIpAddress(Constants.IPV4_DEFAULT_IP_VALUE);
|
||||
baseIpCfg.setIpPattern(3);
|
||||
if (baseIpCfg.getSrcIpAddress().equals(Constants.IPV4_DEFAULT_IP_VALUE)) {
|
||||
errInfo.append(prop.getProperty("client_ip")+" " + String.format(
|
||||
prop.getProperty("can_not_be"), Constants.IPV4_DEFAULT_IP_VALUE) + ";");
|
||||
}
|
||||
}
|
||||
baseIpCfg.setIpType(4);
|
||||
}
|
||||
@@ -693,169 +700,166 @@ public class CheckIpFormatThread implements Callable<String>{
|
||||
prop.getProperty("client_ip", "Client IP")) + ";");
|
||||
} else if (configIpPortShow.indexOf("3") > -1) {
|
||||
String matchType = this.validIPAddress("server_ip", errInfo, baseIpCfg.getDestIpAddress(),
|
||||
ipType, destIpPattern);
|
||||
if (matchType.endsWith("RANGE")) {
|
||||
baseIpCfg.setDestIpPattern(2);
|
||||
} else if (matchType.endsWith("SUBNET")) {
|
||||
baseIpCfg.setDestIpPattern(1);
|
||||
}else {
|
||||
baseIpCfg.setDestIpPattern(3);
|
||||
}
|
||||
ipType, ipPattern);
|
||||
if (matchType.startsWith("IPV6")) {
|
||||
if(srcIpPattern.indexOf("3")>-1) {
|
||||
baseIpCfg.setSrcIpAddress(Constants.IPV6_DEFAULT_IP_VALUE);
|
||||
baseIpCfg.setSrcIpPattern(3);
|
||||
}else if(srcIpPattern.indexOf("1")>-1) {
|
||||
baseIpCfg.setSrcIpAddress(Constants.IPV6_DEFAULT_IP_SUBNET_VALUE);
|
||||
baseIpCfg.setSrcIpPattern(1);
|
||||
}else {
|
||||
if (matchType.endsWith("RANGE")) {
|
||||
// baseIpCfg.setDestIpAddress(baseIpCfg.getDestIpAddress());
|
||||
baseIpCfg.setSrcIpAddress(Constants.IPV6_DEFAULT_IP_RANGE_VALUE);
|
||||
baseIpCfg.setSrcIpPattern(2);
|
||||
baseIpCfg.setIpPattern(2);
|
||||
if (baseIpCfg.getDestIpAddress()
|
||||
.startsWith(Constants.IPV6_DEFAULT_IP_RANGE_VALUE.split("-")[0])) {
|
||||
errInfo.append(prop.getProperty("server_ip")+" "
|
||||
+ String.format(prop.getProperty("can_not_be"),
|
||||
Constants.IPV6_DEFAULT_IP_RANGE_VALUE.split("-")[0])
|
||||
+ ";");
|
||||
}
|
||||
} else if (matchType.endsWith("SUBNET")) {
|
||||
// baseIpCfg.setDestIpAddress(baseIpCfg.getDestIpAddress());
|
||||
baseIpCfg.setSrcIpAddress(Constants.IPV6_DEFAULT_IP_SUBNET_VALUE);
|
||||
baseIpCfg.setIpPattern(1);
|
||||
if (baseIpCfg.getDestIpAddress()
|
||||
.startsWith(Constants.IPV6_DEFAULT_IP_SUBNET_VALUE.split("/")[0])) {
|
||||
errInfo.append(
|
||||
prop.getProperty("server_ip")+" "
|
||||
+ String.format(prop.getProperty("can_not_be"),
|
||||
Constants.IPV6_DEFAULT_IP_SUBNET_VALUE.split("/")[0])
|
||||
+ ";");
|
||||
}
|
||||
} else {
|
||||
// baseIpCfg.setDestIpAddress(baseIpCfg.getDestIpAddress());
|
||||
baseIpCfg.setSrcIpAddress(Constants.IPV6_DEFAULT_IP_VALUE);
|
||||
baseIpCfg.setIpPattern(3);
|
||||
if (baseIpCfg.getDestIpAddress().equals(Constants.IPV6_DEFAULT_IP_VALUE)) {
|
||||
errInfo.append(prop.getProperty("server_ip")+" " + String.format(
|
||||
prop.getProperty("can_not_be"), Constants.IPV6_DEFAULT_IP_VALUE) + ";");
|
||||
}
|
||||
}
|
||||
baseIpCfg.setIpType(6);
|
||||
} else {
|
||||
if(srcIpPattern.indexOf("3")>-1) {
|
||||
baseIpCfg.setSrcIpAddress(Constants.IPV4_DEFAULT_IP_VALUE);
|
||||
baseIpCfg.setSrcIpPattern(3);
|
||||
}else if(srcIpPattern.indexOf("1")>-1) {
|
||||
baseIpCfg.setSrcIpAddress(Constants.IPV4_DEFAULT_IP_SUBNET_VALUE);
|
||||
baseIpCfg.setSrcIpPattern(1);
|
||||
}else {
|
||||
if (matchType.endsWith("RANGE")) {
|
||||
this.validIPv4Range("server_ip", errInfo, baseIpCfg.getDestIpAddress());
|
||||
// baseIpCfg.setDestIpAddress("0.0.0.0-"+baseIpCfg.getDestIpAddress().split("-")[0]
|
||||
// .substring(0,baseIpCfg.getDestIpAddress().indexOf("-")+1)
|
||||
// +baseIpCfg.getDestIpAddress().split("-")[1]);
|
||||
baseIpCfg.setSrcIpAddress(Constants.IPV4_DEFAULT_IP_RANGE_VALUE);
|
||||
baseIpCfg.setSrcIpPattern(2);
|
||||
baseIpCfg.setIpPattern(2);
|
||||
if (baseIpCfg.getDestIpAddress()
|
||||
.startsWith(Constants.IPV4_DEFAULT_IP_RANGE_VALUE.split("-")[0])) {
|
||||
errInfo.append(prop.getProperty("server_ip")+" "
|
||||
+ String.format(prop.getProperty("can_not_be"),
|
||||
Constants.IPV4_DEFAULT_IP_RANGE_VALUE.split("-")[0])
|
||||
+ ";");
|
||||
}
|
||||
} else if (matchType.endsWith("SUBNET")) {
|
||||
// baseIpCfg.setDestIpAddress(baseIpCfg.getDestIpAddress());
|
||||
baseIpCfg.setSrcIpAddress(Constants.IPV4_DEFAULT_IP_SUBNET_VALUE);
|
||||
baseIpCfg.setIpPattern(1);
|
||||
if (baseIpCfg.getDestIpAddress()
|
||||
.startsWith(Constants.IPV4_DEFAULT_IP_SUBNET_VALUE.split("/")[0])) {
|
||||
errInfo.append(
|
||||
prop.getProperty("server_ip")+" "
|
||||
+ String.format(prop.getProperty("can_not_be"),
|
||||
Constants.IPV4_DEFAULT_IP_SUBNET_VALUE.split("/")[0])
|
||||
+ ";");
|
||||
}
|
||||
} else {
|
||||
// baseIpCfg.setDestIpAddress(baseIpCfg.getDestIpAddress());
|
||||
baseIpCfg.setSrcIpAddress(Constants.IPV4_DEFAULT_IP_VALUE);
|
||||
baseIpCfg.setIpPattern(3);
|
||||
if (baseIpCfg.getDestIpAddress().equals(Constants.IPV4_DEFAULT_IP_VALUE)) {
|
||||
errInfo.append(prop.getProperty("server_ip")+" " + String.format(
|
||||
prop.getProperty("can_not_be"), Constants.IPV4_DEFAULT_IP_VALUE) + ";");
|
||||
}
|
||||
}
|
||||
baseIpCfg.setIpType(4);
|
||||
}
|
||||
}
|
||||
} else {// 全不为空
|
||||
String srcMatchType = this.validIPAddress("client_ip", errInfo, baseIpCfg.getSrcIpAddress(), ipType,
|
||||
srcIpPattern);
|
||||
String destMatchType = this.validIPAddress("server_ip", errInfo, baseIpCfg.getDestIpAddress(), ipType,
|
||||
destIpPattern);
|
||||
if (StringUtils.isNotBlank(srcMatchType) && StringUtils.isNotBlank(destMatchType)
|
||||
&& ((srcMatchType.startsWith("IPV6")&&destMatchType.startsWith("IPV4"))
|
||||
||(srcMatchType.startsWith("IPV4")&&destMatchType.startsWith("IPV6")))) {
|
||||
errInfo.append(prop.get("the_same_ip_type") + ";");
|
||||
String matchType = this.validIPAddress("client_ip", errInfo, baseIpCfg.getSrcIpAddress(), ipType,
|
||||
ipPattern);
|
||||
String matchType1 = this.validIPAddress("server_ip", errInfo, baseIpCfg.getDestIpAddress(), ipType,
|
||||
ipPattern);
|
||||
if (StringUtils.isNotBlank(matchType) && StringUtils.isNotBlank(matchType1)
|
||||
&& !matchType.equals(matchType1)) {
|
||||
errInfo.append(prop.get("the_same_ip_type_pattern") + ";");
|
||||
}
|
||||
// baseIpCfg.setSrcIpAddress(baseIpCfg.getSrcIpAddress());
|
||||
// baseIpCfg.setDestIpAddress(baseIpCfg.getDestIpAddress());
|
||||
if (srcMatchType.startsWith("IPV6")) {
|
||||
if (matchType.startsWith("IPV6")) {
|
||||
baseIpCfg.setIpType(6);
|
||||
} else {
|
||||
baseIpCfg.setIpType(4);
|
||||
}
|
||||
if (srcMatchType.endsWith("RANGE")) {
|
||||
baseIpCfg.setSrcIpPattern(2);
|
||||
}else if(srcMatchType.endsWith("SUBNET")) {
|
||||
baseIpCfg.setSrcIpPattern(1);
|
||||
}else {
|
||||
baseIpCfg.setSrcIpPattern(3);
|
||||
}
|
||||
if (destMatchType.endsWith("RANGE")) {
|
||||
baseIpCfg.setDestIpPattern(2);
|
||||
}else if(destMatchType.endsWith("SUBNET")) {
|
||||
baseIpCfg.setDestIpPattern(1);
|
||||
}else {
|
||||
baseIpCfg.setDestIpPattern(3);
|
||||
}
|
||||
if(baseIpCfg.getIpType().equals(4)) {
|
||||
if (srcMatchType.endsWith("RANGE")) {
|
||||
if (matchType.endsWith("RANGE")) {
|
||||
if (matchType.startsWith("IPV4")) {
|
||||
this.validIPv4Range("client_ip", errInfo, baseIpCfg.getSrcIpAddress());
|
||||
}
|
||||
if (destMatchType.endsWith("RANGE")) {
|
||||
this.validIPv4Range("server_ip", errInfo, baseIpCfg.getDestIpAddress());
|
||||
}
|
||||
//验证Ip范围
|
||||
if(StringUtils.isEmpty(errInfo)&&(srcMatchType.endsWith("RANGE")||destMatchType.endsWith("RANGE"))) {
|
||||
this.ValidateRangeCross(baseIpCfg.getSrcIpAddress(),baseIpCfg.getDestIpAddress(), errInfo);
|
||||
}
|
||||
}
|
||||
boolean same=false;
|
||||
if(baseIpCfg.getSrcIpAddress().indexOf("-")>-1) {
|
||||
if(baseIpCfg.getDestIpAddress().indexOf("-")>-1) {
|
||||
if(baseIpCfg.getSrcIpAddress().split("-")[0].equals(baseIpCfg.getDestIpAddress().split("-")[0])) {
|
||||
same=true;
|
||||
}
|
||||
}else if(baseIpCfg.getDestIpAddress().indexOf("/")>-1) {
|
||||
if(baseIpCfg.getSrcIpAddress().split("-")[0].equals(baseIpCfg.getDestIpAddress().split("/")[0])) {
|
||||
same=true;
|
||||
}
|
||||
}else {
|
||||
if(baseIpCfg.getSrcIpAddress().split("-")[0].equals(baseIpCfg.getDestIpAddress())) {
|
||||
same=true;
|
||||
}
|
||||
}
|
||||
}else if(baseIpCfg.getSrcIpAddress().indexOf("/")>-1){
|
||||
if(baseIpCfg.getDestIpAddress().indexOf("-")>-1) {
|
||||
if(baseIpCfg.getSrcIpAddress().split("/")[0].equals(baseIpCfg.getDestIpAddress().split("-")[0])) {
|
||||
same=true;
|
||||
}
|
||||
}else if(baseIpCfg.getDestIpAddress().indexOf("/")>-1) {
|
||||
if(baseIpCfg.getSrcIpAddress().split("/")[0].equals(baseIpCfg.getDestIpAddress().split("/")[0])) {
|
||||
same=true;
|
||||
}
|
||||
}else {
|
||||
if(baseIpCfg.getSrcIpAddress().split("/")[0].equals(baseIpCfg.getDestIpAddress())) {
|
||||
same=true;
|
||||
}
|
||||
}
|
||||
}else {
|
||||
if(baseIpCfg.getDestIpAddress().indexOf("-")>-1) {
|
||||
if(baseIpCfg.getSrcIpAddress().equals(baseIpCfg.getDestIpAddress().split("-")[0])) {
|
||||
same=true;
|
||||
}
|
||||
}else if(baseIpCfg.getDestIpAddress().indexOf("/")>-1) {
|
||||
if(baseIpCfg.getSrcIpAddress().equals(baseIpCfg.getDestIpAddress().split("/")[0])) {
|
||||
same=true;
|
||||
}
|
||||
}else {
|
||||
if(baseIpCfg.getSrcIpAddress().equals(baseIpCfg.getDestIpAddress())) {
|
||||
same=true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(same) {
|
||||
|
||||
if (baseIpCfg.getSrcIpAddress().split("-")[0]
|
||||
.equals(baseIpCfg.getDestIpAddress().split("-")[0])) {
|
||||
errInfo.append(String.format(prop.getProperty("are_the_same"),
|
||||
baseIpCfg.getSrcIpAddress().split("-")[0],
|
||||
baseIpCfg.getDestIpAddress().split("-")[0]) + ";");
|
||||
}
|
||||
baseIpCfg.setIpPattern(2);
|
||||
} else if (matchType.endsWith("SUBNET")) {
|
||||
if (baseIpCfg.getSrcIpAddress().split("/")[0]
|
||||
.equals(baseIpCfg.getDestIpAddress().split("/")[0])) {
|
||||
errInfo.append(String.format(prop.getProperty("are_the_same"),
|
||||
baseIpCfg.getSrcIpAddress().split("/")[0],
|
||||
baseIpCfg.getDestIpAddress().split("/")[0]) + ";");
|
||||
}
|
||||
baseIpCfg.setIpPattern(1);
|
||||
} else {
|
||||
if (baseIpCfg.getSrcIpAddress().equals(baseIpCfg.getDestIpAddress())) {
|
||||
errInfo.append(String.format(prop.getProperty("are_the_same"),
|
||||
prop.getProperty("client_ip"), prop.getProperty("server_ip")) + ";");
|
||||
}
|
||||
baseIpCfg.setIpPattern(3);
|
||||
}
|
||||
}
|
||||
|
||||
// TODO 判断源IP和目的IP的值
|
||||
// TODO 判断源IP和目的IP格式
|
||||
if (destPortEmpty) {
|
||||
if (srcPortEmpty) {
|
||||
if(srcPortPattern.indexOf("1")>-1) {
|
||||
baseIpCfg.setSrcPort("0");
|
||||
baseIpCfg.setSrcPortPattern(1);
|
||||
baseIpCfg.setDestPort("0");
|
||||
baseIpCfg.setPortPattern(1);
|
||||
} else {
|
||||
baseIpCfg.setSrcPort("0/0");
|
||||
baseIpCfg.setSrcPortPattern(2);
|
||||
}
|
||||
}else if(baseIpCfg.getSrcPort().indexOf("/")>-1) {
|
||||
baseIpCfg.setSrcPortPattern(2);
|
||||
if (baseIpCfg.getSrcPort().indexOf("/") > -1) {
|
||||
baseIpCfg.setDestPort("0/0");
|
||||
baseIpCfg.setPortPattern(2);
|
||||
} else {
|
||||
baseIpCfg.setSrcPortPattern(1);
|
||||
baseIpCfg.setDestPort("0");
|
||||
baseIpCfg.setPortPattern(1);
|
||||
}
|
||||
baseIpCfg.setSrcPort(baseIpCfg.getSrcPort().trim());
|
||||
boolean validSrcPort = this.validPort(errInfo, baseIpCfg.getSrcPort(),
|
||||
srcPortPattern,"client_port");
|
||||
if (destPortEmpty) {
|
||||
if(destPortPattern.indexOf("1")>-1) {
|
||||
baseIpCfg.setDestPort("0");
|
||||
baseIpCfg.setDestPortPattern(1);
|
||||
}else {
|
||||
baseIpCfg.setDestPort("0/0");
|
||||
baseIpCfg.setDestPortPattern(2);
|
||||
}
|
||||
}else if(baseIpCfg.getDestPort().indexOf("/")>-1) {
|
||||
baseIpCfg.setDestPortPattern(2);
|
||||
} else {
|
||||
baseIpCfg.setDestPortPattern(1);
|
||||
if (srcPortEmpty) {
|
||||
if (baseIpCfg.getDestPort().indexOf("/") > -1) {
|
||||
baseIpCfg.setSrcPort("0/0");
|
||||
baseIpCfg.setPortPattern(2);
|
||||
} else {
|
||||
baseIpCfg.setSrcPort("0");
|
||||
baseIpCfg.setPortPattern(1);
|
||||
}
|
||||
} else {
|
||||
if (baseIpCfg.getSrcPort().indexOf("/") > -1) {
|
||||
baseIpCfg.setPortPattern(2);
|
||||
} else {
|
||||
baseIpCfg.setPortPattern(1);
|
||||
}
|
||||
baseIpCfg.setSrcPort(baseIpCfg.getSrcPort().trim());
|
||||
}
|
||||
baseIpCfg.setDestPort(baseIpCfg.getDestPort().trim());
|
||||
boolean validDestPort = this.validPort(errInfo, baseIpCfg.getSrcPort(),
|
||||
srcPortPattern,"server_port");
|
||||
|
||||
}
|
||||
// TODO 判断源端口和目的端口格式
|
||||
// TODO 判断源和目的端口的值
|
||||
boolean validPort = this.validPort(errInfo, baseIpCfg.getSrcPort(), baseIpCfg.getDestPort(),
|
||||
portPattern);
|
||||
if (baseIpCfg.getProtocol()==null) {
|
||||
//packet ip reject
|
||||
if(regionDict.getFunctionId().equals(5)&&serviceDict!=null&&serviceDict.getServiceId().equals(16)) {
|
||||
@@ -897,7 +901,7 @@ public class CheckIpFormatThread implements Callable<String>{
|
||||
}
|
||||
boolean validProtocol = this.validProtocol(errInfo, baseIpCfg.getProtocol(), protocol);
|
||||
// 验证protocol与port是否符合逻辑
|
||||
if (validProtocol && validSrcPort&&validDestPort) {
|
||||
if (validProtocol && validPort) {
|
||||
validProtocolAndPort(errInfo, baseIpCfg.getProtocol(), baseIpCfg.getSrcPort(),
|
||||
baseIpCfg.getDestPort());
|
||||
}
|
||||
@@ -1026,85 +1030,153 @@ public class CheckIpFormatThread implements Callable<String>{
|
||||
* @param portPattern
|
||||
* @throws ServiceException
|
||||
*/
|
||||
public boolean validPort(StringBuffer errInfo, String portStr, String portPattern,String portName)
|
||||
public boolean validPort(StringBuffer errInfo, String srcPortStr, String destPortStr, String portPattern)
|
||||
throws ServiceException {
|
||||
boolean valid = true;
|
||||
if (portPattern.equals("1")) {
|
||||
try {
|
||||
Integer srcPort = Integer.parseInt(portStr);
|
||||
Integer srcPort = Integer.parseInt(srcPortStr);
|
||||
if (srcPort < 0 || srcPort > 65535) {
|
||||
errInfo.append(prop.getProperty(portName)
|
||||
errInfo.append(prop.getProperty("client_port")
|
||||
+ String.format(prop.getProperty("must_between"), 0, 65535) + ";");
|
||||
valid = false;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// TODO: handle exception
|
||||
errInfo.append(String.format(prop.getProperty("not_number"), prop.getProperty(portName)) + ";");
|
||||
errInfo.append(String.format(prop.getProperty("not_number"), prop.getProperty("client_port")) + ";");
|
||||
valid = false;
|
||||
}
|
||||
try {
|
||||
Integer destPort = Integer.parseInt(destPortStr);
|
||||
if (destPort < 0 || destPort > 65535) {
|
||||
errInfo.append(prop.getProperty("server_port")
|
||||
+ String.format(prop.getProperty("must_between"), 0, 65535) + ";");
|
||||
valid = false;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// TODO: handle exception
|
||||
errInfo.append(String.format(prop.getProperty("not_number"), prop.getProperty("server_port")) + ";");
|
||||
valid = false;
|
||||
}
|
||||
|
||||
} else if (portPattern.equals("2")) {
|
||||
Pattern p = Constants.PORT_MASK_PATTERN;
|
||||
Matcher m = p.matcher(portStr);
|
||||
Matcher m = p.matcher(srcPortStr);
|
||||
if (!m.matches()) {
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("is_in_wrong_format"), prop.getProperty(portName)) + ";");
|
||||
String.format(prop.getProperty("is_in_wrong_format"), prop.getProperty("client_port")) + ";");
|
||||
valid = false;
|
||||
}
|
||||
|
||||
Integer port = Integer.parseInt(portStr.split("/")[0]);
|
||||
Integer portMask = Integer.parseInt(portStr.split("/")[1]);
|
||||
|
||||
if (port < 0 || port > 65535) {
|
||||
errInfo.append(prop.getProperty(portName)
|
||||
+ String.format(prop.getProperty("must_between"), 0, 65535) + ";");
|
||||
m = p.matcher(destPortStr);
|
||||
if (!m.matches()) {
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("is_in_wrong_format"), prop.getProperty("server_port")) + ";");
|
||||
valid = false;
|
||||
}
|
||||
if (portMask < 0 || portMask > 65535) {
|
||||
errInfo.append(prop.getProperty(portName+"_mask")
|
||||
+ String.format(prop.getProperty("must_between"), 0, 65535) + ";");
|
||||
valid = false;
|
||||
}
|
||||
|
||||
} else if (portPattern.indexOf("1") > -1 && portPattern.indexOf("2") > -1) {
|
||||
Pattern p = Constants.PORT_MASK_PATTERN;
|
||||
Pattern p1 = Constants.PORT_PATTERN;
|
||||
Matcher m = p.matcher(portStr);// 源端口是端口掩码格式
|
||||
Matcher m2 = p1.matcher(portStr);// 源端口是端口格式
|
||||
if (m.matches()) {
|
||||
Integer srcPort = Integer.parseInt(portStr.split("/")[0]);
|
||||
Integer srcPortMask = Integer.parseInt(portStr.split("/")[1]);
|
||||
Integer srcPort = Integer.parseInt(srcPortStr.split("/")[0]);
|
||||
Integer srcPortMask = Integer.parseInt(srcPortStr.split("/")[1]);
|
||||
Integer destPort = Integer.parseInt(destPortStr.split("/")[0]);
|
||||
Integer destPortMask = Integer.parseInt(destPortStr.split("/")[1]);
|
||||
if (srcPort < 0 || srcPort > 65535) {
|
||||
errInfo.append(prop.getProperty(portName)
|
||||
errInfo.append(prop.getProperty("client_port")
|
||||
+ String.format(prop.getProperty("must_between"), 0, 65535) + ";");
|
||||
valid = false;
|
||||
}
|
||||
if (srcPortMask < 0 || srcPortMask > 65535) {
|
||||
errInfo.append(prop.getProperty(portName+"_mask")
|
||||
errInfo.append(prop.getProperty("client_port_mask")
|
||||
+ String.format(prop.getProperty("must_between"), 0, 65535) + ";");
|
||||
valid = false;
|
||||
}
|
||||
if (destPort < 0 || destPort > 65535) {
|
||||
errInfo.append(prop.getProperty("server_port")
|
||||
+ String.format(prop.getProperty("must_between"), 0, 65535) + ";");
|
||||
valid = false;
|
||||
}
|
||||
if (destPortMask < 0 || destPortMask > 65535) {
|
||||
errInfo.append(prop.getProperty("server_port_mask")
|
||||
+ String.format(prop.getProperty("must_between"), 0, 65535) + ";");
|
||||
valid = false;
|
||||
}
|
||||
} else if (portPattern.indexOf("1") > -1 && portPattern.indexOf("2") > -1) {
|
||||
Pattern p = Constants.PORT_MASK_PATTERN;
|
||||
Pattern p1 = Constants.PORT_PATTERN;
|
||||
Matcher m = p.matcher(srcPortStr);// 源端口是端口掩码格式
|
||||
Matcher m1 = p.matcher(destPortStr);// 目的端口是端口掩码格式
|
||||
Matcher m2 = p1.matcher(srcPortStr);// 源端口是端口格式
|
||||
Matcher m3 = p1.matcher(destPortStr);// 目的端口是端口格式
|
||||
if (m.matches()) {
|
||||
Integer srcPort = Integer.parseInt(srcPortStr.split("/")[0]);
|
||||
Integer srcPortMask = Integer.parseInt(srcPortStr.split("/")[1]);
|
||||
if (srcPort < 0 || srcPort > 65535) {
|
||||
errInfo.append(prop.getProperty("client_port")
|
||||
+ String.format(prop.getProperty("must_between"), 0, 65535) + ";");
|
||||
valid = false;
|
||||
}
|
||||
if (srcPortMask < 0 || srcPortMask > 65535) {
|
||||
errInfo.append(prop.getProperty("client_port_mask")
|
||||
+ String.format(prop.getProperty("must_between"), 0, 65535) + ";");
|
||||
valid = false;
|
||||
}
|
||||
}
|
||||
if (m1.matches()) {
|
||||
Integer destPort = Integer.parseInt(destPortStr.split("/")[0]);
|
||||
Integer destPortMask = Integer.parseInt(destPortStr.split("/")[1]);
|
||||
|
||||
if (destPort < 0 || destPort > 65535) {
|
||||
errInfo.append(prop.getProperty("server_port")
|
||||
+ String.format(prop.getProperty("must_between"), 0, 65535) + ";");
|
||||
valid = false;
|
||||
}
|
||||
if (destPortMask < 0 || destPortMask > 65535) {
|
||||
errInfo.append(prop.getProperty("server_port_mask")
|
||||
+ String.format(prop.getProperty("must_between"), 0, 65535) + ";");
|
||||
valid = false;
|
||||
}
|
||||
}
|
||||
if (m2.matches()) {
|
||||
try {
|
||||
Integer srcPort = Integer.parseInt(portStr);
|
||||
Integer srcPort = Integer.parseInt(srcPortStr);
|
||||
if (srcPort < 0 || srcPort > 65535) {
|
||||
errInfo.append(prop.getProperty(portName)
|
||||
errInfo.append(prop.getProperty("client_port")
|
||||
+ String.format(prop.getProperty("must_between"), 0, 65535) + ";");
|
||||
valid = false;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// TODO: handle exception
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("not_number"), prop.getProperty(portName)) + ";");
|
||||
String.format(prop.getProperty("not_number"), prop.getProperty("client_port")) + ";");
|
||||
valid = false;
|
||||
}
|
||||
}
|
||||
if (m3.matches()) {
|
||||
try {
|
||||
Integer destPort = Integer.parseInt(destPortStr);
|
||||
if (destPort < 0 || destPort > 65535) {
|
||||
errInfo.append(prop.getProperty("server_port")
|
||||
+ String.format(prop.getProperty("must_between"), 0, 65535) + ";");
|
||||
valid = false;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// TODO: handle exception
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("not_number"), prop.getProperty("server_port")) + ";");
|
||||
valid = false;
|
||||
}
|
||||
}
|
||||
if ((m.matches() && m3.matches()) || (m2.matches() && m1.matches())) {
|
||||
errInfo.append(prop.getProperty("the_same_port_pattern") + ";");
|
||||
valid = false;
|
||||
}
|
||||
if (!m.matches() && !m2.matches()) {
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("is_in_wrong_format"), prop.getProperty(portName)) + ";");
|
||||
String.format(prop.getProperty("is_in_wrong_format"), prop.getProperty("client_port")) + ";");
|
||||
valid = false;
|
||||
}
|
||||
if (!m1.matches() && !m3.matches()) {
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("is_in_wrong_format"), prop.getProperty("server_port")) + ";");
|
||||
valid = false;
|
||||
}
|
||||
|
||||
}
|
||||
return valid;
|
||||
}
|
||||
@@ -1297,44 +1369,7 @@ public class CheckIpFormatThread implements Callable<String>{
|
||||
}
|
||||
return matchType;
|
||||
}
|
||||
public void ValidateRangeCross(String srcIp,String destIp,StringBuffer errInfo) {
|
||||
long srcStart=0l,srcEnd=0,srcNum=0l,destStart=0l,destEnd=0l,destNum=0l;
|
||||
if(srcIp.indexOf("-")>-1) {
|
||||
String[] srcArr=srcIp.split("\\-");
|
||||
srcStart=IPUtil.getIpHostDesimal(srcArr[0]);
|
||||
srcEnd=IPUtil.getIpHostDesimal(srcArr[1]);
|
||||
}else if(srcIp.indexOf("/")>-1) {
|
||||
srcNum=IPUtil.getIpHostDesimal(srcIp.split("/")[0]);
|
||||
}else {
|
||||
srcNum=IPUtil.getIpHostDesimal(srcIp);
|
||||
}
|
||||
if(destIp.indexOf("-")>-1) {
|
||||
String[] destArr=destIp.split("\\-");
|
||||
destStart=IPUtil.getIpHostDesimal(destArr[0]);
|
||||
destEnd=IPUtil.getIpHostDesimal(destArr[1]);
|
||||
}else if(destIp.indexOf("/")>-1) {
|
||||
destNum=IPUtil.getIpHostDesimal(destIp.split("/")[0]);
|
||||
}else {
|
||||
destNum=IPUtil.getIpHostDesimal(destIp);
|
||||
}
|
||||
if(srcNum==0l) {
|
||||
if(destNum==0l) {
|
||||
if(!(destEnd<srcStart||srcEnd<destStart)) {
|
||||
errInfo.append(prop.getProperty("range_cross")+";");
|
||||
}
|
||||
}else {
|
||||
if(destNum>=srcStart&&destNum<=srcEnd) {
|
||||
errInfo.append(prop.getProperty("range_cross")+";");
|
||||
}
|
||||
}
|
||||
}else {
|
||||
if(destNum==0l) {
|
||||
if(srcNum>=destStart&&srcNum<=destEnd) {
|
||||
errInfo.append(prop.getProperty("range_cross")+";");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public List<Map<Long, AsnGroupInfo>> getAsnNoMaps() {
|
||||
return asnNoMaps;
|
||||
}
|
||||
@@ -1347,4 +1382,5 @@ public class CheckIpFormatThread implements Callable<String>{
|
||||
public void setAsnGroupInfos(Map<Long, AsnGroupInfo> asnGroupInfos) {
|
||||
this.asnGroupInfos = asnGroupInfos;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -46,7 +46,6 @@ import com.nis.domain.Page;
|
||||
import com.nis.domain.SysDataDictionaryItem;
|
||||
import com.nis.domain.basics.AsnGroupInfo;
|
||||
import com.nis.domain.basics.AsnIpCfg;
|
||||
import com.nis.domain.basics.PolicyGroupInfo;
|
||||
import com.nis.domain.basics.ServiceDictInfo;
|
||||
import com.nis.domain.basics.SysDictInfo;
|
||||
import com.nis.domain.configuration.AppComplexFeatureCfg;
|
||||
@@ -65,6 +64,7 @@ import com.nis.domain.configuration.BaseCfg;
|
||||
import com.nis.domain.configuration.BaseIpCfg;
|
||||
import com.nis.domain.configuration.BaseStringCfg;
|
||||
import com.nis.domain.configuration.CfgIndexInfo;
|
||||
import com.nis.domain.configuration.ComplexStringCfgTemplate;
|
||||
import com.nis.domain.configuration.ComplexkeywordCfg;
|
||||
import com.nis.domain.configuration.DdosIpCfg;
|
||||
import com.nis.domain.configuration.DnsIpCfg;
|
||||
@@ -75,6 +75,7 @@ import com.nis.domain.configuration.PxyObjKeyring;
|
||||
import com.nis.domain.configuration.PxyObjTrustedCaCert;
|
||||
import com.nis.domain.configuration.PxyObjTrustedCaCrl;
|
||||
import com.nis.domain.configuration.RequestInfo;
|
||||
import com.nis.domain.configuration.StringCfgTemplate;
|
||||
import com.nis.domain.configuration.template.AppDomainTemplate;
|
||||
import com.nis.domain.configuration.template.AppPayloadTemplate;
|
||||
import com.nis.domain.configuration.template.AsnIpTemplate;
|
||||
@@ -99,7 +100,7 @@ import com.nis.domain.configuration.template.HttpsReplaceIpTemplate;
|
||||
import com.nis.domain.configuration.template.HttpsReplaceTemplate;
|
||||
import com.nis.domain.configuration.template.IpAllNotDoLogTemplate;
|
||||
import com.nis.domain.configuration.template.IpAllTemplate;
|
||||
import com.nis.domain.configuration.template.IpCommCfgTemplate;
|
||||
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.configuration.template.IpSpoofingTemplate;
|
||||
@@ -642,10 +643,6 @@ public class BaseController {
|
||||
}
|
||||
}
|
||||
}
|
||||
if(cfg.getGroupType()!=null) {
|
||||
List<PolicyGroupInfo> policyGroupInfos = policyGroupInfoService.findPolicyGroupInfosByTypeforUD(cfg.getGroupType(), cfg.getUdFlag());
|
||||
model.addAttribute("policyGroupInfos", policyGroupInfos);
|
||||
}
|
||||
}
|
||||
|
||||
protected void initUpdateFormCondition(Model model, BaseCfg cfg) {
|
||||
@@ -710,10 +707,6 @@ public class BaseController {
|
||||
model.addAttribute("regionList", regionList);
|
||||
List<FunctionServiceDict> serviceList = DictUtils.getFunctionServiceDictList(cfg.getFunctionId());
|
||||
model.addAttribute("serviceList", serviceList);
|
||||
if(cfg.getGroupType()!=null) {
|
||||
List<PolicyGroupInfo> policyGroupInfos = policyGroupInfoService.findPolicyGroupInfosByTypeforUD(cfg.getGroupType(), cfg.getUdFlag());
|
||||
model.addAttribute("policyGroupInfos", policyGroupInfos);
|
||||
}
|
||||
}
|
||||
|
||||
public List<AreaBean> getAreaIsps(String areaEffectiveIds, List<AreaBean> areaIspList, List<SysDictInfo> isps,
|
||||
@@ -778,6 +771,75 @@ public class BaseController {
|
||||
}
|
||||
return msgProp;
|
||||
}
|
||||
@Deprecated
|
||||
public void importCfgTemplate(HttpServletRequest request, HttpServletResponse response,
|
||||
RedirectAttributes redirectAttributes, Integer functionId, Integer cfgRegionCode) {
|
||||
Properties msgProp = getMsgProp();
|
||||
try {
|
||||
List<FunctionRegionDict> dictList = DictUtils.getFunctionRegionDictList(functionId);
|
||||
for (FunctionRegionDict dict : dictList) {
|
||||
if (dict.getConfigRegionCode() == cfgRegionCode) {
|
||||
String fileName = dict.getConfigRegionValue() + ".xlsx";
|
||||
if (dict.getRegionType() == 1) {
|
||||
List<IpCfgTemplate> list = Lists.newArrayList();
|
||||
list.add(new IpCfgTemplate());
|
||||
new ExportExcel(new FunctionServiceDict(), new FunctionRegionDict(), msgProp, null,
|
||||
IpCfgTemplate.class, 2).setDataList(msgProp, list, null)
|
||||
.write(request, response, fileName).dispose();
|
||||
} else if (dict.getRegionType() == 2) {
|
||||
List<StringCfgTemplate> list = Lists.newArrayList();
|
||||
list.add(new StringCfgTemplate());
|
||||
new ExportExcel(new FunctionServiceDict(), new FunctionRegionDict(), msgProp, null,
|
||||
StringCfgTemplate.class, 2).setDataList(msgProp, list, null)
|
||||
.write(request, response, fileName).dispose();
|
||||
} else if (dict.getRegionType() == 3) {
|
||||
List<ComplexStringCfgTemplate> list = Lists.newArrayList();
|
||||
list.add(new ComplexStringCfgTemplate());
|
||||
new ExportExcel(new FunctionServiceDict(), new FunctionRegionDict(), msgProp, null,
|
||||
ComplexStringCfgTemplate.class, 2).setDataList(msgProp, list, null)
|
||||
.write(request, response, fileName).dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
msgProp = null;
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
@Deprecated
|
||||
public void importCfgTemplate(HttpServletRequest request, HttpServletResponse response,
|
||||
RedirectAttributes redirectAttributes, Integer functionId, Integer cfgRegionCode, Class clazz) {
|
||||
Properties msgProp = getMsgProp();
|
||||
try {
|
||||
List<FunctionRegionDict> dictList = DictUtils.getFunctionRegionDictList(functionId);
|
||||
for (FunctionRegionDict dict : dictList) {
|
||||
if (dict.getConfigRegionCode() == cfgRegionCode) {
|
||||
String fileName = dict.getConfigRegionValue() + ".xlsx";
|
||||
if (dict.getRegionType() == 1) {
|
||||
List<IpCfgTemplate> list = Lists.newArrayList();
|
||||
list.add((IpCfgTemplate) clazz.newInstance());
|
||||
new ExportExcel(new FunctionServiceDict(), new FunctionRegionDict(), msgProp, null, clazz, 2)
|
||||
.setDataList(msgProp, list, null).write(request, response, fileName).dispose();
|
||||
} else if (dict.getRegionType() == 2) {
|
||||
List<StringCfgTemplate> list = Lists.newArrayList();
|
||||
list.add(new StringCfgTemplate());
|
||||
new ExportExcel(new FunctionServiceDict(), new FunctionRegionDict(), msgProp, null, clazz, 2)
|
||||
.setDataList(msgProp, list, null).write(request, response, fileName).dispose();
|
||||
} else if (dict.getRegionType() == 3) {
|
||||
List<ComplexStringCfgTemplate> list = Lists.newArrayList();
|
||||
list.add(new ComplexStringCfgTemplate());
|
||||
new ExportExcel(new FunctionServiceDict(), new FunctionRegionDict(), msgProp, null, clazz, 2)
|
||||
.setDataList(msgProp, list, null).write(request, response, fileName).dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
msgProp = null;
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public void setLogAction(BaseLogEntity log, List<FunctionServiceDict> serviceList) {
|
||||
if (!StringUtil.isEmpty(serviceList)) {
|
||||
@@ -2437,8 +2499,6 @@ public class BaseController {
|
||||
ei.loadInitParams(IpAllNotDoLogTemplate.class, msgProp, regionDict, serviceDict);
|
||||
} else if((regionDict.getFunctionId().equals(63) || regionDict.getFunctionId().equals(407) || regionDict.getFunctionId().equals(408)) && serviceDict.getAction().equals(64)){ // Policies -> Stream
|
||||
ei.loadInitParams(IpRateLimitTemplate.class, msgProp, regionDict, serviceDict);
|
||||
}else if(regionDict.getFunctionId().equals(110)) { // IP白名单
|
||||
ei.loadInitParams(IpCommCfgTemplate.class, msgProp, regionDict, serviceDict);
|
||||
}else {
|
||||
ei.loadInitParams(IpAllTemplate.class, msgProp, regionDict, serviceDict);
|
||||
}
|
||||
|
||||
@@ -1,521 +0,0 @@
|
||||
package com.nis.web.controller.basics;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.BlockingQueue;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.jets3t.service.ServiceException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||
|
||||
import com.beust.jcommander.internal.Lists;
|
||||
import com.nis.domain.FunctionRegionDict;
|
||||
import com.nis.domain.FunctionServiceDict;
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.basics.IpCommCfg;
|
||||
import com.nis.domain.basics.PolicyGroupInfo;
|
||||
import com.nis.domain.configuration.BaseIpCfg;
|
||||
import com.nis.domain.configuration.CfgIndexInfo;
|
||||
import com.nis.domain.configuration.IpPortCfg;
|
||||
import com.nis.domain.configuration.template.IpCommCfgTemplate;
|
||||
import com.nis.exceptions.MaatConvertException;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.DictUtils;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.util.excel.ImportBigExcel;
|
||||
import com.nis.web.controller.BaseController;
|
||||
import com.nis.web.security.UserUtils;
|
||||
import com.nis.web.service.basics.IpCommGroupCfgService;
|
||||
|
||||
@Controller
|
||||
@RequestMapping(value = "${adminPath}/basics/ip")
|
||||
public class IpCommGroupController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IpCommGroupCfgService ipCommGroupCfgService;
|
||||
|
||||
@RequestMapping(value = { "/list" })
|
||||
public String list(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||
@ModelAttribute("cfg") IpCommCfg entity) {
|
||||
Page<IpCommCfg> page = ipCommGroupCfgService.findPage(new Page<IpCommCfg>(request, response, "r"),
|
||||
entity);
|
||||
model.addAttribute("page", page);
|
||||
// initPageCondition(model);
|
||||
List<FunctionRegionDict> regionList = DictUtils.getFunctionRegionDictList(entity.getFunctionId());
|
||||
model.addAttribute("regionList", regionList);
|
||||
List<FunctionServiceDict> serviceList = DictUtils.getFunctionServiceDictList(entity.getFunctionId());
|
||||
model.addAttribute("serviceList", serviceList);
|
||||
List<PolicyGroupInfo> policyGroupInfos=policyGroupInfoService.findPolicyGroupInfosByType(5);
|
||||
model.addAttribute("policyGroupInfos", policyGroupInfos);
|
||||
return "/basics/ipCommonGroupCfgList";
|
||||
}
|
||||
|
||||
@RequestMapping(value = { "/addForm" })
|
||||
public String addForm(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||
@ModelAttribute("cfg") CfgIndexInfo cfg, RedirectAttributes redirectAttributes) {
|
||||
|
||||
cfg.setGroupType(5);
|
||||
initFormCondition(model, cfg);
|
||||
model.addAttribute("_cfg", cfg);
|
||||
return "/basics/ipCommGroupFormAdd";
|
||||
}
|
||||
|
||||
@RequestMapping(value = { "/save" })
|
||||
@RequiresPermissions(value = { "ip:common:config" })
|
||||
public String save(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||
@ModelAttribute("cfg") CfgIndexInfo cfg, RedirectAttributes redirectAttributes) {
|
||||
|
||||
// System.out.println("URL分组");
|
||||
try {
|
||||
ipCommGroupCfgService.saveIpCommGroupCfg(cfg);
|
||||
} catch (Exception e) {
|
||||
logger.error("信息保存失败", e);
|
||||
if (e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes, "error", e.getMessage());
|
||||
} else {
|
||||
addMessage(redirectAttributes, "error", "save_failed");
|
||||
}
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath + "/basics/ip/list?functionId=" + cfg.getFunctionId();
|
||||
}
|
||||
|
||||
@RequestMapping(value = { "/updateForm" })
|
||||
public String updateForm(Model model, HttpServletRequest request, HttpServletResponse response, String ids,
|
||||
@ModelAttribute("cfg") IpCommCfg cfg, RedirectAttributes redirectAttributes) {
|
||||
cfg = ipCommGroupCfgService.get(Long.parseLong(ids));
|
||||
// initUpdateFormCondition(model, cfg);
|
||||
cfg.setGroupType(5);
|
||||
initUpdateFormCondition(model, cfg);
|
||||
// List<ConfigGroupInfo> groupInfos=configGroupInfoService.findAllList(4);
|
||||
// model.addAttribute("policyGroups", groupInfos);
|
||||
model.addAttribute("_cfg", cfg);
|
||||
return "/basics/ipCommGroupFormUpdate";
|
||||
}
|
||||
|
||||
@RequestMapping(value = { "/update" })
|
||||
@RequiresPermissions(value = { "ip:common:config" })
|
||||
public String update(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||
@ModelAttribute("cfg") IpCommCfg cfg, RedirectAttributes redirectAttributes) {
|
||||
try {
|
||||
ipCommGroupCfgService.update(cfg);
|
||||
addMessage(redirectAttributes, "success", "save_success");
|
||||
} catch (Exception e) {
|
||||
logger.error("信息保存失败", e);
|
||||
addMessage(redirectAttributes, "error", "save_failed");
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath + "/basics/ip/list?functionId=" + cfg.getFunctionId();
|
||||
}
|
||||
|
||||
// @RequestMapping(value = { "/audit" })
|
||||
// @RequiresPermissions(value = { "ip:common:config" })
|
||||
// public String audit(Model model, @ModelAttribute("cfg") IpCommCfg cfg, Integer isAudit, Integer isValid,
|
||||
// String ids, Integer functionId, HttpServletRequest request, HttpServletResponse response,
|
||||
// RedirectAttributes redirectAttributes) {
|
||||
// // 选中配置审核
|
||||
// if (!StringUtil.isEmpty(ids)) {
|
||||
// List<IpCommCfg> ipGroupCfgs = ipCommGroupCfgService.getByIds(ids);
|
||||
// List<IpCommCfg> temp = Lists.newArrayList();
|
||||
// try {
|
||||
// ipCommGroupCfgService.audit(ipGroupCfgs, isAudit, isValid);
|
||||
// } catch (Exception e) {
|
||||
// logger.error("审核失败", e);
|
||||
// addMessage(redirectAttributes, "error", "audit_failed");
|
||||
// } finally {
|
||||
// temp.clear();
|
||||
// }
|
||||
// return "redirect:" + adminPath + "/basics/ip/list?functionId=" + cfg.getFunctionId();
|
||||
// } else {// 全部审核
|
||||
// // 条件下所有配置审核
|
||||
// Page<IpCommCfg> searchPage = new Page<IpCommCfg>(request, response, "a");
|
||||
// Page<IpCommCfg> auditPage = new Page<IpCommCfg>(request, response, "a");
|
||||
// BeanUtils.copyProperties(searchPage, auditPage);
|
||||
//
|
||||
// try {
|
||||
// auditAll(auditPage, isValid, cfg);
|
||||
// addMessage(redirectAttributes, "success", "audit_success");
|
||||
// } catch (Exception e) {
|
||||
// logger.error("配置下发失败:", e);
|
||||
// if (e instanceof MaatConvertException) {
|
||||
// addMessage(redirectAttributes, "error", "request_service_failed");
|
||||
// } else {
|
||||
// addMessage(redirectAttributes, "error", "audit_failed");
|
||||
// }
|
||||
//
|
||||
// }
|
||||
//
|
||||
// return list(model, request, response, cfg);
|
||||
// }
|
||||
// }
|
||||
|
||||
@RequestMapping(value = { "/delete" })
|
||||
@RequiresPermissions(value = { "ip:common:config" })
|
||||
public String delete(Integer isValid, String ids, Integer functionId, RedirectAttributes redirectAttributes) {
|
||||
try {
|
||||
ipCommGroupCfgService.delete(ids);
|
||||
addMessage(redirectAttributes, "success", "delete_success");
|
||||
} catch (Exception e) {
|
||||
logger.error("Delete failed", e);
|
||||
if (e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes, "error", e.getMessage());
|
||||
} else {
|
||||
addMessage(redirectAttributes, "error", "delete_failed");
|
||||
}
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath + "/basics/ip/list?functionId=" + functionId;
|
||||
}
|
||||
|
||||
// ipComm配置导出
|
||||
@RequestMapping(value = "/exportIpComm")
|
||||
public void exportIpCommonCfg(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||
@ModelAttribute("cfg") IpCommCfg entity, String ids, RedirectAttributes redirectAttributes) {
|
||||
try {
|
||||
// export data info
|
||||
List<String> titleList = new ArrayList<String>();
|
||||
Map<String, Class<?>> classMap = new HashMap<String, Class<?>>();
|
||||
Map<String, List> dataMap = new HashMap<String, List>();
|
||||
Map<String, String> noExportMap = new HashMap<String, String>();
|
||||
List<IpCommCfg> list = new ArrayList<IpCommCfg>();
|
||||
if (!StringUtil.isEmpty(ids)) {
|
||||
list = ipCommGroupCfgService.findByPage(ids);
|
||||
} else {
|
||||
Page<IpCommCfg> pageInfo = new Page<IpCommCfg>(request, response, "r");
|
||||
pageInfo.setPageNo(1);
|
||||
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||
Page<IpCommCfg> page = ipCommGroupCfgService.findPage(pageInfo, entity);
|
||||
list = page.getList();
|
||||
}
|
||||
//
|
||||
titleList.add(entity.getMenuNameCode());
|
||||
classMap.put(entity.getMenuNameCode(), IpPortCfg.class);
|
||||
String cfgIndexInfoNoExport = ",block_type,do_log,action"
|
||||
+ ",letter,whether_area_block,classification,attribute,label"
|
||||
+ ",userregion1,userregion2,userregion3,userregion4,userregion5,src_ip_pattern,client_ip,src_port_pattern,client_port,dest_ip_pattern,dest_port_pattern,dest_port,";
|
||||
// 时间过滤
|
||||
if (entity.getSearch_create_time_start() == null) {
|
||||
cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport;
|
||||
}
|
||||
if (entity.getSearch_edit_time_start() == null) {
|
||||
cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport;
|
||||
}
|
||||
if (entity.getSearch_audit_time_start() == null) {
|
||||
cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport;
|
||||
}
|
||||
if (!StringUtil.isEmpty(entity.gethColumns())) {
|
||||
cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport;
|
||||
}
|
||||
|
||||
noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport);
|
||||
dataMap.put(entity.getMenuNameCode(), list);
|
||||
String timeRange = initTimeMap(entity);
|
||||
noExportMap.put("timeRange", timeRange);
|
||||
|
||||
if ("csv".equals(entity.getExType())) {
|
||||
this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||
classMap, dataMap, noExportMap);
|
||||
} else {
|
||||
this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||
classMap, dataMap, noExportMap);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("IpCommGroupCfg export failed", e);
|
||||
addMessage(redirectAttributes, "error", "export_failed");
|
||||
}
|
||||
// return "redirect:" + adminPath
|
||||
// +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量审核
|
||||
*
|
||||
* @param isAudit
|
||||
* @param isValid
|
||||
* @param ids
|
||||
* @param functionId
|
||||
* @param redirectAttributes
|
||||
* @return
|
||||
*/
|
||||
// @Override
|
||||
// public void auditAll(Page page, Integer auditType, Object entity) throws Exception {
|
||||
// long start = System.currentTimeMillis();
|
||||
// page.setOrderBy("");
|
||||
// page.setPageSize(Constants.MAAT_JSON_SEND_SIZE);
|
||||
// page.setPageNo(1);
|
||||
// page.setLastPage(false);
|
||||
// // 携带审核状态信息的BaseCfg
|
||||
// BaseCfg auditBatchCfg = new BaseCfg();
|
||||
// // 携带审核条件的BaseCfg
|
||||
// IpCommCfg searchIpCommGroupCfg = new IpCommCfg();
|
||||
// BeanUtils.copyProperties(entity, auditBatchCfg);
|
||||
// BeanUtils.copyProperties(entity, searchIpCommGroupCfg);
|
||||
//
|
||||
// auditType = (Integer) Reflections.invokeGetter(entity, "isAudit");
|
||||
//
|
||||
// // 全部审核通过,只查询当前条件下的所有未审核的配置 -批量审核通过/不通过
|
||||
// if (auditType.equals(1) || auditType.equals(2)) {
|
||||
//
|
||||
// searchIpCommGroupCfg.setIsValid(0);
|
||||
// searchIpCommGroupCfg.setIsAudit(0);
|
||||
//
|
||||
// if (auditType.equals(1)) {
|
||||
// auditBatchCfg.setIsAudit(1);
|
||||
// auditBatchCfg.setIsValid(1);
|
||||
// } else {
|
||||
// auditBatchCfg.setIsAudit(2);
|
||||
// auditBatchCfg.setIsValid(0);
|
||||
// }
|
||||
// auditBatchCfg.setAuditTime(new Date());
|
||||
// auditBatchCfg.setAuditorId(UserUtils.getUser().getId());
|
||||
// } else {
|
||||
// // 全部取消通过,只查询当前条件下的所有审核通过的配置
|
||||
// searchIpCommGroupCfg.setIsValid(1);
|
||||
// searchIpCommGroupCfg.setIsAudit(1);
|
||||
//
|
||||
// auditBatchCfg.setIsAudit(3);
|
||||
// auditBatchCfg.setIsValid(0);
|
||||
// auditBatchCfg.setAuditTime(new Date());
|
||||
// auditBatchCfg.setAuditorId(UserUtils.getUser().getId());
|
||||
// }
|
||||
//
|
||||
// ServiceConfigTemplateUtil serviceTemplate = new ServiceConfigTemplateUtil();
|
||||
// Integer functionId = 0;
|
||||
// if (auditBatchCfg != null && !StringUtil.isEmpty(auditBatchCfg.getFunctionId())) {
|
||||
// functionId = auditBatchCfg.getFunctionId();
|
||||
// }
|
||||
// List<Map<String, Object>> serviceList = serviceTemplate.getServiceListByFunctionId(functionId);
|
||||
// for (Map<String, Object> service : serviceList) {
|
||||
// String tableNameXml = service.get("tableName").toString(); // 获取业务主配置表
|
||||
// String serviceTypeXml = service.get("serviceType").toString(); // 业务类型 1maat 2callback
|
||||
// String classNameXml = service.get("className").toString(); // 主配置Java类
|
||||
// String serviceIdXml = service.get("id").toString(); // service字典表 service_id字段
|
||||
// auditBatchCfg.setServiceId(Integer.valueOf(serviceIdXml));
|
||||
// auditBatchCfg.setTableName(tableNameXml);
|
||||
// searchIpCommGroupCfg.setServiceId(Integer.valueOf(serviceIdXml));
|
||||
// searchIpCommGroupCfg.setTableName(tableNameXml);
|
||||
//
|
||||
// if ("1".equals(serviceTypeXml)) {// maat类配置
|
||||
// // 存放域配置类型 及 对应表名
|
||||
// List<Map<String, Object>> cfgList = (List<Map<String, Object>>) service.get("cfgList");
|
||||
// List<Map<String, Object>> userRegionList = (List<Map<String, Object>>) service.get("userRegionList");
|
||||
// int cfgType = Integer.parseInt(service.get("cfgType").toString());
|
||||
// if (auditBatchCfg.getIsAudit() == 1) {
|
||||
// boolean hasData = true;
|
||||
//
|
||||
// while (hasData) {
|
||||
// page.setPageNo(1);
|
||||
// page.setLastPage(false);
|
||||
// List list = ipCommGroupCfgService.findPage(page, searchIpCommGroupCfg).getList();
|
||||
// if(CollectionUtils.isNotEmpty(list)){
|
||||
// Map<Integer,List> groupIdMap=new HashMap();
|
||||
// // 配置生效处理
|
||||
// if(auditBatchCfg.getIsAudit().equals(1)) {
|
||||
// hasData=commonPolicyService.auditReuseCommonConfigData(page, auditBatchCfg,groupIdMap,hasData);
|
||||
// Map<Integer,List> groupIpMap=new HashMap();
|
||||
// if(CollectionUtils.isNotEmpty(list)) {
|
||||
// for (IpCommCfg obj : (List<IpCommCfg>)list) {
|
||||
// BaseCfg baseCfg=(BaseCfg)obj;
|
||||
// if(!StringUtil.isEmpty(obj.getGroupId())) {
|
||||
// groupIdMap.get(obj.getGroupId()).add(baseCfg);
|
||||
// }else {
|
||||
// List newList=new ArrayList<>();
|
||||
// newList.add(baseCfg);
|
||||
// groupIdMap.put(obj.getGroupId(),newList);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// }
|
||||
// if(hasData) {
|
||||
// page.setPageNo(1);
|
||||
// page.setLastPage(false);
|
||||
// }
|
||||
// }else{
|
||||
// hasData = false;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// } else {
|
||||
// throw new RuntimeException("wrong service type " + serviceTypeXml);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// // 批量审核通过时,如果没有携带isValid检索条件,返回界面需要将isValid置为null
|
||||
// if (!StringUtil.isEmpty(entity)) {
|
||||
// BaseCfg base = (BaseCfg) entity;
|
||||
// if (!StringUtil.isEmpty(base.getSeltype()) && base.getSeltype().equals("isValid")) {
|
||||
// base.setIsValid(null);
|
||||
// BeanUtils.copyProperties(base, entity);
|
||||
// }
|
||||
// }
|
||||
// long end = System.currentTimeMillis();
|
||||
// logger.warn("配置批量生效/失效耗时:" + (end - start));
|
||||
// }
|
||||
@RequestMapping(value = "import", method=RequestMethod.POST)
|
||||
public String importIp(HttpServletRequest request,HttpServletResponse response,RedirectAttributes redirectAttributes,
|
||||
@RequestParam("files") MultipartFile[] files
|
||||
,Integer serviceDictId
|
||||
,Integer requestId
|
||||
,String attribute
|
||||
,String classify
|
||||
,String regionDictIds
|
||||
,String importPath) {
|
||||
logger.warn("import start...");
|
||||
long start=System.currentTimeMillis();
|
||||
ImportBigExcel ei=null;
|
||||
try {
|
||||
FunctionServiceDict serviceDict = DictUtils.getFunctionServiceDict(serviceDictId);
|
||||
StringBuffer errTip=new StringBuffer();
|
||||
BlockingQueue<BaseIpCfg> ipPortCfgs =null;
|
||||
//List<CfgIndexInfo> cfgIndexInfos = new ArrayList<CfgIndexInfo>();
|
||||
for (int i = 0; i < files.length; i++) {
|
||||
MultipartFile file = files[i];
|
||||
ei = new ImportBigExcel(file, 0, 1);
|
||||
FunctionRegionDict regionDict = DictUtils
|
||||
.getFunctionRegionDict(Integer.parseInt(regionDictIds.split(",")[i]));
|
||||
//加载模板
|
||||
loadTemplate(ei,regionDict, serviceDict);
|
||||
//------------------------------------check format start----------------------------
|
||||
if (regionDict.getRegionType().equals(1)) {// IP
|
||||
BlockingQueue<IpCommCfgTemplate> list = ei.getDataList(IpCommCfgTemplate.class );
|
||||
ipPortCfgs=this.checkIpCfgMulity(errTip,serviceDict, regionDict, null,null, list);
|
||||
}
|
||||
//删除文件
|
||||
if(ei.getUploadFile()!=null&&ei.getUploadFile().exists()) {
|
||||
ei.getUploadFile().delete();
|
||||
}
|
||||
//------------------------------------check format end----------------------------
|
||||
Date date = new Date();
|
||||
String isSend = request.getParameter("isSend")==null?"":request.getParameter("isSend");
|
||||
|
||||
if (regionDict.getRegionType().equals(1)) {// IP
|
||||
List<BaseIpCfg> _ipPortCfgs=Lists.newArrayList(Constants.MAAT_JSON_SEND_SIZE);
|
||||
while(!ipPortCfgs.isEmpty()) {
|
||||
ipPortCfgs.drainTo(_ipPortCfgs, Constants.MAAT_JSON_SEND_SIZE);
|
||||
//List<Integer> regionIds=Lists.newArrayList();
|
||||
//List<Integer> numRegionGroupIds=Lists.newArrayList();
|
||||
//List<Integer> numRegionRegionIds=Lists.newArrayList();
|
||||
/*if(!regionDict.getFunctionId().equals(405)) {//app ip compileId 从config_group_info中取
|
||||
try {
|
||||
if(isSend.equals("1")) {
|
||||
regionIds = ConfigServiceUtil.getId(3,_ipPortCfgs.size());
|
||||
//需要获取数值域的id
|
||||
if(serviceDict!=null&&serviceDict.getProtocolId()!=null&&serviceDict.getProtocolId()>0) {
|
||||
numRegionGroupIds = ConfigServiceUtil.getId(2,_ipPortCfgs.size());
|
||||
numRegionRegionIds = ConfigServiceUtil.getId(3,_ipPortCfgs.size());
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.info("获取编译ID出错");
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
|
||||
}
|
||||
}else {
|
||||
try {
|
||||
regionIds = ConfigServiceUtil.getId(3,_ipPortCfgs.size());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.info("获取域ID出错");
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
|
||||
}
|
||||
}*/
|
||||
int ind=0;
|
||||
for (BaseIpCfg cfg : _ipPortCfgs) {
|
||||
cfg.setAction(serviceDict==null?null:serviceDict.getAction());
|
||||
/*cfg.setAuditorId(UserUtils.getUser().getId());
|
||||
cfg.setAuditTime(date);*/
|
||||
cfg.setCfgRegionCode(regionDict.getConfigRegionCode());
|
||||
cfg.setCfgType(regionDict.getConfigRegionValue());
|
||||
cfg.setCreateTime(date);
|
||||
cfg.setCreatorId(UserUtils.getUser().getId());
|
||||
//cfg.setDoLog(2);
|
||||
cfg.setFunctionId(regionDict.getFunctionId());
|
||||
if(isSend.equals("1")) {
|
||||
cfg.setIsAudit(Constants.AUDIT_YES);
|
||||
cfg.setIsValid(Constants.VALID_YES);
|
||||
cfg.setAuditorId(UserUtils.getUser().getId());
|
||||
cfg.setAuditTime(date);
|
||||
/*if(regionIds!=null&®ionIds.size()==_ipPortCfgs.size()) {
|
||||
cfg.setRegionId(regionIds.get(ind));
|
||||
}
|
||||
if(serviceDict!=null&&serviceDict.getProtocolId()!=null) {
|
||||
if(numRegionGroupIds!=null&&numRegionGroupIds.size()==_ipPortCfgs.size()) {
|
||||
cfg.setNumberRegionGroupId(numRegionGroupIds.get(ind));
|
||||
}
|
||||
if(numRegionRegionIds!=null&&numRegionRegionIds.size()==_ipPortCfgs.size()) {
|
||||
cfg.setNumberRegionRegionId(numRegionRegionIds.get(ind));
|
||||
}
|
||||
}*/
|
||||
}else {
|
||||
cfg.setIsAudit(Constants.AUDIT_NOT_YET);
|
||||
cfg.setIsValid(Constants.VALID_NO);
|
||||
}
|
||||
cfg.setIsAreaEffective(0);
|
||||
cfg.setLable("0");
|
||||
cfg.setRequestId(StringUtil.isEmpty(requestId) ? 0 : requestId);
|
||||
cfg.setAttribute(attribute);
|
||||
cfg.setClassify(classify);
|
||||
cfg.setServiceId(serviceDict==null?null:serviceDict.getServiceId());
|
||||
cfg.setTableName("ip_comm_cfg");
|
||||
ind++;
|
||||
}
|
||||
ipCommGroupCfgService.saveAndSend(regionDict, serviceDict, _ipPortCfgs,isSend.equals("1"));
|
||||
_ipPortCfgs.clear();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
if(errTip.toString().length()>0) {
|
||||
addMessage(redirectAttributes,"error", errTip.toString());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
if(ei!=null) {
|
||||
if(ei.getUploadFile().exists()) {
|
||||
ei.getUploadFile().delete();
|
||||
}
|
||||
}
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
}else if(e instanceof ServiceException) {
|
||||
addMessage(redirectAttributes,"error", e.getMessage());
|
||||
}else if(e instanceof IndexOutOfBoundsException){
|
||||
addMessage(redirectAttributes,"error", "template_error");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error", "import_failed");
|
||||
}
|
||||
logger.error("import failed", e);
|
||||
}
|
||||
long end=System.currentTimeMillis();
|
||||
logger.warn("import finish,cost:"+(end-start));
|
||||
return "redirect:" + adminPath+ importPath;
|
||||
}
|
||||
@RequestMapping(value="ajaxGetGroups",method=RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<Integer,String> ajaxGetGroups(Model model,@RequestParam(required=true,value="groupIds")String groupIds){
|
||||
Map<Integer,String> groupIdList=new HashMap<Integer,String>();
|
||||
if(StringUtils.isNotBlank(groupIds)) {
|
||||
List<PolicyGroupInfo> list=policyGroupInfoService.findPolicyByGroupInfoList(groupIds);
|
||||
for(PolicyGroupInfo p:list) {
|
||||
groupIdList.put(p.getGroupId(), p.getGroupName());
|
||||
}
|
||||
}
|
||||
return groupIdList;
|
||||
}
|
||||
}
|
||||
@@ -18,7 +18,6 @@ import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.basics.PolicyGroupInfo;
|
||||
import com.nis.util.Constants;
|
||||
@@ -123,19 +122,6 @@ public class PolicyGroupController extends BaseController {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@RequestMapping(value="ajaxGetPagedGroup",method=RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Page ajaxGetPagedGroup(HttpServletRequest request
|
||||
, HttpServletResponse response,Model model,@RequestParam(required=true,value="type")Integer type,@RequestParam(required=true,value="pageNo")Integer pageNo,@RequestParam(required=true,value="pageSize")Integer pageSize){
|
||||
|
||||
PolicyGroupInfo cfg=new PolicyGroupInfo();
|
||||
cfg.setGroupType(type);
|
||||
Page<PolicyGroupInfo> pageCondition = new Page<PolicyGroupInfo>(request, response,"r");
|
||||
pageCondition.setPageNo(pageNo);
|
||||
pageCondition.setPageSize(pageSize);
|
||||
Page page = policyGroupInfoService.findPolicyGroupInfoList(pageCondition,cfg);
|
||||
return page;
|
||||
}
|
||||
/**
|
||||
* 校验asn号是否已存在
|
||||
*/
|
||||
|
||||
@@ -1,251 +0,0 @@
|
||||
package com.nis.web.controller.basics;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||
|
||||
import com.nis.domain.FunctionRegionDict;
|
||||
import com.nis.domain.FunctionServiceDict;
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.basics.UrlCommCfg;
|
||||
import com.nis.domain.configuration.CfgIndexInfo;
|
||||
import com.nis.exceptions.MaatConvertException;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.DictUtils;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.web.controller.BaseController;
|
||||
import com.nis.web.service.basics.UrlCommGroupService;
|
||||
|
||||
@Controller
|
||||
@RequestMapping(value = "${adminPath}/basics/url")
|
||||
public class UrlCommGroupController extends BaseController{
|
||||
|
||||
@Autowired
|
||||
private UrlCommGroupService urlCommGroupService;
|
||||
|
||||
@RequestMapping(value = {"/list"})
|
||||
public String list(Model model,HttpServletRequest request
|
||||
,HttpServletResponse response,@ModelAttribute("cfg")UrlCommCfg entity
|
||||
){
|
||||
Page<UrlCommCfg> page = urlCommGroupService.findPage(new Page<UrlCommCfg>(request, response,"r"), entity);
|
||||
model.addAttribute("page", page);
|
||||
|
||||
List<FunctionRegionDict> regionList = DictUtils.getFunctionRegionDictList(entity.getFunctionId());
|
||||
model.addAttribute("regionList", regionList);
|
||||
List<FunctionServiceDict> serviceList = DictUtils.getFunctionServiceDictList(entity.getFunctionId());
|
||||
model.addAttribute("serviceList", serviceList);
|
||||
return "/basics/urlCommGroupList";
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/addForm"})
|
||||
public String addForm(Model model,HttpServletRequest request
|
||||
,HttpServletResponse response,@ModelAttribute("cfg")CfgIndexInfo cfg
|
||||
,RedirectAttributes redirectAttributes){
|
||||
|
||||
|
||||
// UrlCommGroupCfg urlCfg = new UrlCommGroupCfg();
|
||||
// urlCfg.setCfgType("NTC_URL_REGION");
|
||||
// cfg.setUrlCommGroupCfg(urlCfg);
|
||||
// List<UrlCommGroupCfg> urlList = new ArrayList<UrlCommGroupCfg>();
|
||||
// urlList.add(urlCfg);
|
||||
// cfg.setUrlCommGroupList(urlList);
|
||||
// initFormCondition(model, entity);
|
||||
cfg.setGroupType(11);
|
||||
initFormCondition(model,cfg);
|
||||
//List<ConfigGroupInfo> groupInfos=configGroupInfoService.findAllList(4);
|
||||
//model.addAttribute("policyGroups", groupInfos);
|
||||
|
||||
model.addAttribute("_cfg", cfg);
|
||||
return "/basics/urlCommGroupFormAdd";
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/save"})
|
||||
@RequiresPermissions(value={"http:url:config"})
|
||||
public String save(Model model,HttpServletRequest request,HttpServletResponse response,@ModelAttribute("cfg")CfgIndexInfo cfg,RedirectAttributes redirectAttributes){
|
||||
|
||||
// System.out.println("URL分组");
|
||||
try{
|
||||
urlCommGroupService.saveUrlCommGroupCfg(cfg);
|
||||
}catch(Exception e){
|
||||
logger.error("信息保存失败",e);
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error",e.getMessage());
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error","save_failed");
|
||||
}
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath +"/basics/url/list?functionId="+cfg.getFunctionId();
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/updateForm"})
|
||||
public String updateForm(Model model,HttpServletRequest request
|
||||
,HttpServletResponse response,String ids,@ModelAttribute("cfg")UrlCommCfg cfg
|
||||
,RedirectAttributes redirectAttributes){
|
||||
cfg = urlCommGroupService.get(Long.parseLong(ids));
|
||||
// initUpdateFormCondition(model, cfg);
|
||||
cfg.setGroupType(11);
|
||||
initUpdateFormCondition(model,cfg);
|
||||
//List<ConfigGroupInfo> groupInfos=configGroupInfoService.findAllList(4);
|
||||
//model.addAttribute("policyGroups", groupInfos);
|
||||
model.addAttribute("_cfg", cfg);
|
||||
return "/basics/urlCommGroupFormUpdate";
|
||||
}
|
||||
@RequestMapping(value = {"/update"})
|
||||
@RequiresPermissions(value={"http:url:config"})
|
||||
public String update(Model model,HttpServletRequest request,HttpServletResponse response,@ModelAttribute("cfg")UrlCommCfg cfg,RedirectAttributes redirectAttributes){
|
||||
try{
|
||||
urlCommGroupService.update(cfg);
|
||||
addMessage(redirectAttributes,"success","save_success");
|
||||
}catch(Exception e){
|
||||
logger.error("信息保存失败",e);
|
||||
addMessage(redirectAttributes,"error","save_failed");
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath +"/basics/url/list?functionId="+cfg.getFunctionId();
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/audit"})
|
||||
@RequiresPermissions(value={"http:url:config"})
|
||||
public String audit(Model model,@ModelAttribute("cfg")UrlCommCfg cfg
|
||||
,Integer isAudit
|
||||
,Integer isValid
|
||||
,String ids
|
||||
,Integer functionId
|
||||
, HttpServletRequest request
|
||||
,HttpServletResponse response
|
||||
,RedirectAttributes redirectAttributes) {
|
||||
//选中配置审核
|
||||
if(!StringUtil.isEmpty(ids)) {
|
||||
List<UrlCommCfg> urlGroupCfgs=urlCommGroupService.getByIds(ids);
|
||||
// Map<Long,List<UrlCommGroupCfg>> urlcfgMap=Maps.newHashMap();
|
||||
// for(UrlCommGroupCfg urlCommCfg:urlGroupCfgs) {
|
||||
// urlCommCfg.setIsAudit(isAudit);
|
||||
// urlCommCfg.setIsValid(isValid);
|
||||
// urlCommCfg.setAuditorId(UserUtils.getUser().getId());
|
||||
// urlCommCfg.setAuditTime(new Date());
|
||||
// urlCommCfg.setFunctionId(functionId);
|
||||
// if(urlcfgMap.containsKey(Long.parseLong(urlCommCfg.getUserRegion3()))) {
|
||||
// urlcfgMap.get(Long.parseLong(urlCommCfg.getUserRegion3())).add(urlCommCfg);
|
||||
// }else {
|
||||
// List<UrlCommGroupCfg> _urlCfgs=Lists.newArrayList();
|
||||
// _urlCfgs.add(urlCommCfg);
|
||||
// urlcfgMap.put(Long.parseLong(urlCommCfg.getUserRegion3()), _urlCfgs);
|
||||
// }
|
||||
// }
|
||||
/********************每次下发一个组的region,保证事物********************/
|
||||
// for (Long groupId : urlcfgMap.keySet()) {
|
||||
// try {
|
||||
// urlCommGroupService.audit(urlcfgMap.get(groupId),groupId,isValid);
|
||||
// } catch (Exception e) {
|
||||
// logger.error("配置下发失败:",e);
|
||||
// if(e instanceof MaatConvertException) {
|
||||
// addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
// }else {
|
||||
// addMessage(redirectAttributes,"error", "audit_failed");
|
||||
// }
|
||||
//
|
||||
// }
|
||||
// }
|
||||
for (UrlCommCfg urlCommGroup : urlGroupCfgs) {
|
||||
try {
|
||||
urlCommGroupService.audit(urlCommGroup,isAudit,isValid);
|
||||
} catch (Exception e) {
|
||||
logger.error("审核失败",e);
|
||||
addMessage(redirectAttributes,"error","audit_failed");
|
||||
}
|
||||
}
|
||||
}
|
||||
return "redirect:" + adminPath +"/basics/url/list?functionId="+cfg.getFunctionId();
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/delete"})
|
||||
@RequiresPermissions(value={"http:url:config"})
|
||||
public String delete(Integer isValid
|
||||
,String ids,Integer functionId
|
||||
,RedirectAttributes redirectAttributes){
|
||||
try{
|
||||
urlCommGroupService.delete(ids);
|
||||
addMessage(redirectAttributes,"success","delete_success");
|
||||
}catch(Exception e){
|
||||
logger.error("Delete failed",e);
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error",e.getMessage());
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error","delete_failed");
|
||||
}
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath +"/basics/url/list?functionId="+functionId;
|
||||
}
|
||||
//urlComm配置导出
|
||||
@RequestMapping(value = "/exportUrlComm")
|
||||
public void exportAsnIp(Model model,HttpServletRequest request,HttpServletResponse response,
|
||||
@ModelAttribute("cfg")UrlCommCfg entity,String ids,RedirectAttributes redirectAttributes){
|
||||
try {
|
||||
//export data info
|
||||
List<String> titleList=new ArrayList<String>();
|
||||
Map<String, Class<?>> classMap=new HashMap<String, Class<?>>();
|
||||
Map<String, List> dataMap=new HashMap<String, List>();
|
||||
Map<String, String> noExportMap=new HashMap<String, String>();
|
||||
List<UrlCommCfg> list = new ArrayList<UrlCommCfg>();
|
||||
if (!StringUtil.isEmpty(ids)) {
|
||||
list = urlCommGroupService.findByPage(ids);
|
||||
} else {
|
||||
Page<UrlCommCfg> pageInfo=new Page<UrlCommCfg>(request, response,"r");
|
||||
pageInfo.setPageNo(1);
|
||||
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||
Page<UrlCommCfg> page = urlCommGroupService.findPage(pageInfo, entity);
|
||||
list=page.getList();
|
||||
}
|
||||
//
|
||||
titleList.add(entity.getMenuNameCode());
|
||||
classMap.put(entity.getMenuNameCode(), UrlCommCfg.class);
|
||||
String cfgIndexInfoNoExport=",block_type,do_log,action"
|
||||
+ ",letter,whether_area_block,classification,attribute,label,expression_type,match_method"
|
||||
+",userregion1,userregion2,userregion3,userregion4,userregion5,ir_type,asn_no,is_hex,is_case_insenstive,";
|
||||
// 时间过滤
|
||||
if (entity.getSearch_create_time_start() == null ) {
|
||||
cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport;
|
||||
}
|
||||
if (entity.getSearch_edit_time_start() == null) {
|
||||
cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport;
|
||||
}
|
||||
if (entity.getSearch_audit_time_start() == null) {
|
||||
cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport;
|
||||
}
|
||||
if (!StringUtil.isEmpty(entity.gethColumns())) {
|
||||
cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport;
|
||||
}
|
||||
|
||||
noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport);
|
||||
dataMap.put(entity.getMenuNameCode(), list);
|
||||
String timeRange = initTimeMap(entity);
|
||||
noExportMap.put("timeRange", timeRange);
|
||||
|
||||
if ("csv".equals(entity.getExType())) {
|
||||
this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||
classMap, dataMap, noExportMap);
|
||||
} else {
|
||||
this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||
classMap, dataMap, noExportMap);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("urlGroupConfig export failed",e);
|
||||
addMessage(redirectAttributes,"error","export_failed");
|
||||
}
|
||||
//return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||
}
|
||||
}
|
||||
@@ -362,7 +362,7 @@ public class AppFeatureCfgController extends BaseController {
|
||||
String ipPortInfoNoExport = ",do_log,block_type,config_describe,valid_identifier,is_audit,creator,creator"
|
||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||
+ ",letter,whether_area_block,classification,attribute,label"
|
||||
+ ",userregion1,userregion2,userregion3,userregion4,userregion5,ir_type,group_name,client_ip,src_ip_pattern,client_port,src_port_pattern,";
|
||||
+ ",userregion1,userregion2,userregion3,userregion4,userregion5,ir_type,group_name,";
|
||||
|
||||
// 时间过滤
|
||||
if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) {
|
||||
|
||||
@@ -8,8 +8,10 @@
|
||||
*/
|
||||
package com.nis.web.controller.configuration;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
@@ -17,22 +19,38 @@ import java.util.Properties;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.axis2.databinding.types.soapencoding.Array;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||
|
||||
import com.nis.domain.FunctionRegionDict;
|
||||
import com.nis.domain.FunctionServiceDict;
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.basics.ServiceDictInfo;
|
||||
import com.nis.domain.configuration.BaseIpCfg;
|
||||
import com.nis.domain.configuration.CfgIndexInfo;
|
||||
import com.nis.domain.configuration.HttpBodyCfg;
|
||||
import com.nis.domain.configuration.HttpReqHeadCfg;
|
||||
import com.nis.domain.configuration.HttpResHeadCfg;
|
||||
import com.nis.domain.configuration.HttpUrlCfg;
|
||||
import com.nis.domain.configuration.template.IpAllTemplate;
|
||||
import com.nis.domain.configuration.template.IpCfgTemplate;
|
||||
import com.nis.domain.specific.ConfigGroupInfo;
|
||||
import com.nis.domain.configuration.IpPortCfg;
|
||||
import com.nis.domain.configuration.NtcSubscribeIdCfg;
|
||||
import com.nis.exceptions.MaatConvertException;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.DateUtils;
|
||||
import com.nis.util.DictUtils;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.util.excel.ExportExcel;
|
||||
import com.nis.util.excel.ImportExcel;
|
||||
import com.nis.web.controller.BaseController;
|
||||
import com.nis.web.dao.configuration.IpCfgDao;
|
||||
import com.nis.web.security.UserUtils;
|
||||
|
||||
/**
|
||||
* @ClassName: CommonController.java
|
||||
@@ -270,7 +288,15 @@ public class CommonController extends BaseController {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}*/
|
||||
|
||||
public void _importFileTemplate(HttpServletRequest request,HttpServletResponse response,
|
||||
RedirectAttributes redirectAttributes,Integer functionId,Integer cfgRegionCode) {
|
||||
this.importCfgTemplate(request, response, redirectAttributes, functionId, cfgRegionCode);
|
||||
}
|
||||
@Deprecated
|
||||
public void _importFileTemplate(HttpServletRequest request,HttpServletResponse response,
|
||||
RedirectAttributes redirectAttributes,Integer functionId,Integer cfgRegionCode,Class clazz) {
|
||||
this.importCfgTemplate(request, response, redirectAttributes, functionId, cfgRegionCode,clazz);
|
||||
}
|
||||
//ip配置导出
|
||||
public void _exportIp(String columns,Model model,HttpServletRequest request,HttpServletResponse response,
|
||||
IpPortCfg entity,String ids,RedirectAttributes redirectAttributes){
|
||||
|
||||
@@ -250,7 +250,7 @@ public class DnsIpCfgController extends BaseController {
|
||||
}
|
||||
titleList.add(entity.getMenuNameCode());
|
||||
classMap.put(entity.getMenuNameCode(), DnsIpCfg.class);
|
||||
String cfgIndexInfoNoExport = ",log_total,whether_area_block,client_ip,src_ip_pattern,src_port_pattern,dest_port_pattern,client_port,server_port,ir_type,direction,protocol,do_log,client_port,ir_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
String cfgIndexInfoNoExport = ",log_total,whether_area_block,client_ip,port_pattern,client_port,server_port,ir_type,direction,protocol,do_log,client_port,ir_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
|
||||
// 时间过滤
|
||||
if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) {
|
||||
|
||||
@@ -40,6 +40,7 @@ import com.nis.domain.configuration.IpPortCfg;
|
||||
import com.nis.domain.configuration.IpReuseDnatPolicyCfg;
|
||||
import com.nis.domain.configuration.IpReusePolicyCfg;
|
||||
import com.nis.domain.configuration.UserManage;
|
||||
import com.nis.domain.configuration.template.IpMultiplexPolicyTemplate;
|
||||
import com.nis.exceptions.MaatConvertException;
|
||||
import com.nis.util.ConfigServiceUtil;
|
||||
import com.nis.util.Constants;
|
||||
@@ -120,6 +121,26 @@ public class IpMultiplexController extends CommonController {
|
||||
return "redirect:" + adminPath + "/manipulation/ipmulitiplex/list?functionId=" + cfg.getFunctionId();
|
||||
}
|
||||
|
||||
// ip配置导入
|
||||
/*
|
||||
* @RequestMapping(value = "/import", method=RequestMethod.POST) public
|
||||
* String importIp(String cfgName,RedirectAttributes redirectAttributes,
|
||||
*
|
||||
* @RequestParam("file") MultipartFile file,IpPortCfg cfg) {
|
||||
* this._importIp(cfgName,redirectAttributes,
|
||||
* file,cfg,IpMultiplexPolicyTemplate.class);
|
||||
* redirectAttributes.addAttribute("urlPrefix","/manipulation/ipmulitiplex")
|
||||
* ; redirectAttributes.addAttribute("requiresPermissionPrefix",
|
||||
* "ip:mulitiplex"); return "redirect:" + adminPath
|
||||
* +"/manipulation/ipmulitiplex/list?functionId="+cfg.getFunctionId(); }
|
||||
*/
|
||||
// ip模板下载
|
||||
@RequestMapping(value = "import/template")
|
||||
public void importFileTemplate(HttpServletRequest request, HttpServletResponse response,
|
||||
RedirectAttributes redirectAttributes, Integer functionId, Integer cfgRegionCode) {
|
||||
this._importFileTemplate(request, response, redirectAttributes, functionId, cfgRegionCode,
|
||||
IpMultiplexPolicyTemplate.class);
|
||||
}
|
||||
|
||||
// ip配置导出
|
||||
@RequestMapping(value = "export")
|
||||
|
||||
@@ -112,7 +112,20 @@ public class RatelimitController extends CommonController {
|
||||
redirectAttributes.addAttribute("requiresPermissionPrefix","domain:ratelimit");
|
||||
return "redirect:" + adminPath +"/manipulation/ratelimit/domain/list?functionId="+cfg.getFunctionId();
|
||||
}
|
||||
|
||||
//ip配置导入
|
||||
/*@RequestMapping(value = "/ip/import", method=RequestMethod.POST)
|
||||
public String importIp(String cfgName,RedirectAttributes redirectAttributes,
|
||||
@RequestParam("file") MultipartFile file,IpPortCfg cfg) {
|
||||
this._importIp(cfgName,redirectAttributes, file,cfg,IpRateLimitTemplate.class);
|
||||
redirectAttributes.addAttribute("urlPrefix","/manipulation/ratelimit/ip");
|
||||
redirectAttributes.addAttribute("requiresPermissionPrefix","ip:ratelimit");
|
||||
return "redirect:" + adminPath +"/manipulation/ratelimit/ip/list?functionId="+cfg.getFunctionId();
|
||||
}*/
|
||||
@RequestMapping(value = "/ip/import/template")
|
||||
public void importFileTemplate(HttpServletRequest request,HttpServletResponse response,
|
||||
RedirectAttributes redirectAttributes,Integer functionId,Integer cfgRegionCode) {
|
||||
this._importFileTemplate(request, response, redirectAttributes, functionId, cfgRegionCode,IpRateLimitTemplate.class);
|
||||
}
|
||||
//ip配置导出
|
||||
@RequestMapping(value = "/ip/export")
|
||||
public void exportIp(String columns,Model model,HttpServletRequest request,HttpServletResponse response,
|
||||
|
||||
@@ -27,6 +27,7 @@ import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||
import com.nis.domain.FunctionRegionDict;
|
||||
import com.nis.domain.FunctionServiceDict;
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.configuration.AppPolicyCfg;
|
||||
import com.nis.domain.configuration.AsnKeywordCfg;
|
||||
import com.nis.domain.configuration.CfgIndexInfo;
|
||||
import com.nis.domain.configuration.IpPortCfg;
|
||||
@@ -55,7 +56,6 @@ import com.nis.domain.configuration.template.HttpsReplaceIpTemplate;
|
||||
import com.nis.domain.configuration.template.HttpsReplaceTemplate;
|
||||
import com.nis.domain.configuration.template.IpAllNotDoLogTemplate;
|
||||
import com.nis.domain.configuration.template.IpAllTemplate;
|
||||
import com.nis.domain.configuration.template.IpCommCfgTemplate;
|
||||
import com.nis.domain.configuration.template.IpPayloadTemplate;
|
||||
import com.nis.domain.configuration.template.IpRateLimitTemplate;
|
||||
import com.nis.domain.configuration.template.IpSpoofingTemplate;
|
||||
@@ -66,6 +66,7 @@ import com.nis.domain.configuration.template.SnatTemplate;
|
||||
import com.nis.domain.configuration.template.StringAllNotDoLogTemplate;
|
||||
import com.nis.domain.configuration.template.StringAllTemplate;
|
||||
import com.nis.domain.configuration.template.TopicWebsiteTemplate;
|
||||
import com.nis.domain.specific.SpecificServiceCfg;
|
||||
import com.nis.exceptions.MaatConvertException;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.DictUtils;
|
||||
@@ -477,11 +478,6 @@ public class IpController extends BaseController{
|
||||
ExportExcel excel=new ExportExcel(serviceDict,regionDict,pro,null, IpRateLimitTemplate.class, 2);
|
||||
excel.setDataList(pro,classList,null).
|
||||
write(request,response, fileName).dispose();
|
||||
}else if(regionDict.getFunctionId().equals(110)){
|
||||
List<IpCommCfgTemplate> classList=new ArrayList<IpCommCfgTemplate>();
|
||||
ExportExcel excel=new ExportExcel(serviceDict,regionDict,pro,null, IpCommCfgTemplate.class, 2);
|
||||
excel.setDataList(pro,classList,null).
|
||||
write(request,response, fileName).dispose();
|
||||
}else{
|
||||
List<IpAllTemplate> classList=new ArrayList<IpAllTemplate>();
|
||||
ExportExcel excel=new ExportExcel(serviceDict,regionDict,pro,null, IpAllTemplate.class, 2);
|
||||
|
||||
@@ -14,11 +14,15 @@ import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.apache.taglibs.standard.functions.Functions;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||
|
||||
import com.nis.domain.FunctionRegionDict;
|
||||
@@ -27,6 +31,10 @@ import com.nis.domain.configuration.BaseStringCfg;
|
||||
import com.nis.domain.configuration.CfgIndexInfo;
|
||||
import com.nis.domain.configuration.ComplexkeywordCfg;
|
||||
import com.nis.domain.configuration.DnsResStrategy;
|
||||
import com.nis.domain.configuration.ComplexStringCfgTemplate;
|
||||
import com.nis.domain.configuration.template.IpCfgTemplate;
|
||||
import com.nis.domain.specific.ConfigGroupInfo;
|
||||
import com.nis.domain.configuration.StringCfgTemplate;
|
||||
import com.nis.domain.configuration.HttpBodyCfg;
|
||||
import com.nis.domain.configuration.HttpReqHeadCfg;
|
||||
import com.nis.domain.configuration.HttpResHeadCfg;
|
||||
@@ -39,6 +47,7 @@ import com.nis.util.Constants;
|
||||
import com.nis.util.DictUtils;
|
||||
import com.nis.util.LogUtils;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.util.excel.ImportExcel;
|
||||
import com.nis.web.controller.BaseController;
|
||||
import com.nis.web.security.UserUtils;
|
||||
|
||||
@@ -633,6 +642,13 @@ public class WebsiteController extends BaseController {
|
||||
return "redirect:" + adminPath + "/ntc/website/dnsList?functionId=" + functionId;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
// 下载导入模板
|
||||
@RequestMapping(value = "import/template")
|
||||
public void importFileTemplate(HttpServletRequest request, HttpServletResponse response,
|
||||
RedirectAttributes redirectAttributes, Integer functionId, Integer cfgRegionCode) {
|
||||
this.importCfgTemplate(request, response, redirectAttributes, functionId, cfgRegionCode);
|
||||
}
|
||||
// http配置导入
|
||||
/*
|
||||
* @RequestMapping(value = "importHttp", method=RequestMethod.POST) public
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.nis.web.controller.configuration.ntc;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
@@ -25,11 +26,13 @@ import com.nis.domain.configuration.CfgIndexInfo;
|
||||
import com.nis.domain.configuration.HttpUrlCfg;
|
||||
import com.nis.domain.configuration.IpPortCfg;
|
||||
import com.nis.domain.configuration.NtcSubscribeIdCfg;
|
||||
import com.nis.domain.configuration.template.WhiteListIpTemplate;
|
||||
import com.nis.exceptions.MaatConvertException;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.LogUtils;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.web.controller.configuration.CommonController;
|
||||
import com.nis.web.security.UserUtils;
|
||||
|
||||
/**
|
||||
* 白名单
|
||||
@@ -401,6 +404,24 @@ public class WhiteListController extends CommonController {
|
||||
return "redirect:" + adminPath + "/ntc/whitelist/domain/list?functionId=" + functionId;
|
||||
}
|
||||
|
||||
// ip配置导入
|
||||
/*
|
||||
* @RequestMapping(value = "ip/import", method=RequestMethod.POST) public
|
||||
* String importIp(String cfgName,RedirectAttributes redirectAttributes,
|
||||
*
|
||||
* @RequestParam("file") MultipartFile file,IpPortCfg cfg) {
|
||||
* this._importIp(cfgName,redirectAttributes,
|
||||
* file,cfg,WhiteListIpTemplate.class); return "redirect:" + adminPath
|
||||
* +"/ntc/whitelist/ip/list?functionId="+cfg.getFunctionId(); }
|
||||
*/
|
||||
// ip模板下载
|
||||
@RequestMapping(value = "ip/import/template")
|
||||
public void importFileTemplate(HttpServletRequest request, HttpServletResponse response,
|
||||
RedirectAttributes redirectAttributes, Integer functionId, Integer cfgRegionCode) {
|
||||
this._importFileTemplate(request, response, redirectAttributes, functionId, cfgRegionCode,
|
||||
WhiteListIpTemplate.class);
|
||||
}
|
||||
|
||||
// ip配置导出
|
||||
@RequestMapping(value = "ip/export")
|
||||
public void exportIp(String columns, Model model, HttpServletRequest request, HttpServletResponse response,
|
||||
|
||||
@@ -120,6 +120,11 @@ public class ControlController extends CommonController {
|
||||
redirectAttributes.addAttribute("requiresPermissionPrefix","control:ip");
|
||||
return "redirect:" + adminPath +"/proxy/control/ip/list?functionId="+cfg.getFunctionId();
|
||||
}
|
||||
@RequestMapping(value = "/ip/import/template")
|
||||
public void importFileTemplate(HttpServletRequest request,HttpServletResponse response,
|
||||
RedirectAttributes redirectAttributes,Integer functionId,Integer cfgRegionCode) {
|
||||
this._importFileTemplate(request, response, redirectAttributes, functionId, cfgRegionCode);
|
||||
}
|
||||
//ip配置导出
|
||||
@RequestMapping(value = "/ip/export")
|
||||
public void exportIp(String columns,Model model,HttpServletRequest request,HttpServletResponse response,
|
||||
|
||||
@@ -181,27 +181,6 @@ public class HttpRedirectPolicyController extends BaseController {
|
||||
return "/cfg/proxy/control/httpRedirectForm";
|
||||
}
|
||||
|
||||
@RequestMapping(value = { "commForm" })
|
||||
@RequiresPermissions(value = { "control:httpBlock:config", "control:httpRedirect:config",
|
||||
"control:httpReplace:config", "control:httpMinit:config",
|
||||
"control:httpWhitelist:config" }, logical = Logical.OR)
|
||||
public String commForm(Model model, HttpServletRequest request, HttpServletResponse response, String ids,
|
||||
@ModelAttribute("cfg") CfgIndexInfo entity) {
|
||||
if (StringUtils.isNotBlank(ids)) {
|
||||
entity = httpRedirectCfgService.getCommCfg(Long.parseLong(ids), null);
|
||||
|
||||
initUpdateFormCondition(model, entity);
|
||||
} else {
|
||||
initFormCondition(model, entity);
|
||||
}
|
||||
// 获取所有的响应文件内容,阻断,或重定向时可以选择
|
||||
List<ProxyFileStrategyCfg> allProxyFileStrategys = proxyFileStrategyService
|
||||
.getProxyFileStrategyCfgList(new ProxyFileStrategyCfg());
|
||||
model.addAttribute("_cfg", entity);
|
||||
model.addAttribute("allProxyFileStrategys", allProxyFileStrategys);
|
||||
return "/cfg/proxy/control/httpRedirectCommonForm";
|
||||
}
|
||||
|
||||
@RequestMapping(value = { "saveOrUpdate" })
|
||||
@RequiresPermissions(value = { "control:httpBlock:config", "control:httpRedirect:config",
|
||||
"control:httpReplace:config", "control:httpMinit:config",
|
||||
|
||||
@@ -5,8 +5,7 @@
|
||||
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
|
||||
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
|
||||
<result column="ip_type" property="ipType" jdbcType="INTEGER" />
|
||||
<result column="src_ip_pattern" property="srcIpPattern" jdbcType="INTEGER" />
|
||||
<result column="dest_ip_pattern" property="destIpPattern" jdbcType="INTEGER" />
|
||||
<result column="ip_pattern" property="ipPattern" jdbcType="INTEGER" />
|
||||
<result column="dest_ip_address" property="destIpAddress" jdbcType="VARCHAR" />
|
||||
<result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" />
|
||||
<result column="dest_port" property="destPort" jdbcType="VARCHAR" />
|
||||
@@ -49,7 +48,7 @@
|
||||
</resultMap>
|
||||
|
||||
<sql id="columns">
|
||||
r.cfg_id,r.cfg_desc,r.ip_type,r.src_ip_address,r.src_ip_pattern,r.dest_ip_pattern,r.src_port_pattern,r.dest_port_pattern,r.src_port
|
||||
r.cfg_id,r.cfg_desc,r.ip_type,r.src_ip_address,r.ip_pattern,r.port_pattern,r.src_port
|
||||
,r.protocol,r.protocol_id,r.direction,r.cfg_type,r.action,r.dest_port,r.dest_ip_address
|
||||
,r.is_valid,r.is_audit,r.creator_id,r.create_time,r.editor_id
|
||||
,r.edit_time,r.auditor_id,r.audit_time,r.service_id,r.request_id,
|
||||
@@ -92,11 +91,8 @@
|
||||
<if test="ipType != null">
|
||||
AND r.IP_TYPE=#{ipType,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="srcIpPattern != null">
|
||||
AND r.src_ip_pattern=#{srcIpPattern,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="destIpPattern != null">
|
||||
AND r.dest_ip_pattern=#{destIpPattern,jdbcType=INTEGER}
|
||||
<if test="ipPattern != null">
|
||||
AND r.IP_PATTERN=#{ipPattern,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="srcIpAddress != null and srcIpAddress != ''">
|
||||
AND r.SRC_IP_ADDRESS=#{srcIpAddress,jdbcType=VARCHAR}
|
||||
@@ -104,11 +100,8 @@
|
||||
<if test="destIpAddress != null and destIpAddress != ''">
|
||||
AND r.DEST_IP_ADDRESS=#{destIpAddress,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="srcPortPattern != null">
|
||||
AND r.src_port_pattern=#{srcPortPattern,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="destPortPattern != null">
|
||||
AND r.dest_port_pattern=#{destPortPattern,jdbcType=INTEGER}
|
||||
<if test="portPattern != null">
|
||||
AND r.PORT_PATTERN=#{portPattern,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="srcPort != null and srcPort !=''">
|
||||
AND r.SRC_PORT=#{srcPort,jdbcType=VARCHAR}
|
||||
@@ -234,11 +227,8 @@
|
||||
<if test="ipType != null">
|
||||
AND r.IP_TYPE=#{ipType,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="srcIpPattern != null">
|
||||
AND r.src_ip_pattern=#{srcIpPattern,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="destIpPattern != null">
|
||||
AND r.dest_ip_pattern=#{destIpPattern,jdbcType=INTEGER}
|
||||
<if test="ipPattern != null">
|
||||
AND r.IP_PATTERN=#{ipPattern,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="srcIpAddress != null and srcIpAddress != ''">
|
||||
AND r.SRC_IP_ADDRESS=#{srcIpAddress,jdbcType=VARCHAR}
|
||||
@@ -246,11 +236,8 @@
|
||||
<if test="destIpAddress != null and destIpAddress != ''">
|
||||
AND r.DEST_IP_ADDRESS=#{destIpAddress,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="srcPortPattern != null">
|
||||
AND r.src_port_pattern=#{srcPortPattern,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="destPortPattern != null">
|
||||
AND r.dest_port_pattern=#{destPortPattern,jdbcType=INTEGER}
|
||||
<if test="portPattern != null">
|
||||
AND r.PORT_PATTERN=#{portPattern,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="srcPort != null and srcPort !=''">
|
||||
AND r.SRC_PORT=#{srcPort,jdbcType=VARCHAR}
|
||||
@@ -361,7 +348,9 @@
|
||||
AREA_EFFECTIVE_IDS,
|
||||
function_id,
|
||||
ip_type,
|
||||
src_ip_address,SRC_IP_PATTERN,DEST_IP_PATTERN,SRC_PORT_PATTERN,DEST_PORT_PATTERN,
|
||||
src_ip_address,
|
||||
ip_pattern,
|
||||
port_pattern,
|
||||
src_port,
|
||||
protocol,
|
||||
protocol_id,
|
||||
@@ -402,8 +391,8 @@
|
||||
#{functionId,jdbcType=INTEGER},
|
||||
#{ipType,jdbcType=INTEGER},
|
||||
#{srcIpAddress,jdbcType=VARCHAR},
|
||||
#{srcIpPattern,jdbcType=INTEGER},#{destIpPattern,jdbcType=INTEGER},
|
||||
#{srcPortPattern,jdbcType=INTEGER},#{destPortPattern,jdbcType=INTEGER},
|
||||
#{ipPattern,jdbcType=INTEGER},
|
||||
#{portPattern,jdbcType=INTEGER},
|
||||
#{srcPort,jdbcType=VARCHAR},
|
||||
#{protocol,jdbcType=INTEGER},
|
||||
#{protocolId,jdbcType=INTEGER},
|
||||
@@ -487,17 +476,11 @@
|
||||
<if test="srcIpAddress != null and srcIpAddress != ''" >
|
||||
src_ip_address = #{srcIpAddress,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="srcIpPattern != null" >
|
||||
src_ip_pattern = #{srcIpPattern,jdbcType=INTEGER},
|
||||
<if test="ipPattern != null" >
|
||||
ip_pattern = #{ipPattern,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="destIpPattern != null" >
|
||||
dest_ip_pattern =#{destIpPattern,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="srcPortPattern != null" >
|
||||
src_port_pattern = #{srcPortPattern,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="destPortPattern != null" >
|
||||
dest_port_pattern = #{destPortPattern,jdbcType=INTEGER},
|
||||
<if test="portPattern != null" >
|
||||
port_pattern = #{portPattern,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="srcPort != null and srcPort != ''" >
|
||||
src_port = #{srcPort,jdbcType=VARCHAR},
|
||||
@@ -584,7 +567,7 @@
|
||||
INSERT INTO asn_ip_cfg
|
||||
(CFG_DESC,ACTION,IS_VALID,IS_AUDIT,CREATOR_ID,CREATE_TIME,EDITOR_ID,EDIT_TIME,AUDITOR_ID,
|
||||
AUDIT_TIME,SERVICE_ID,REQUEST_ID,region_id,compile_id,IS_AREA_EFFECTIVE,CLASSIFY,ATTRIBUTE,LABLE,
|
||||
AREA_EFFECTIVE_IDS,function_id,ip_type,src_ip_address,SRC_IP_PATTERN,DEST_IP_PATTERN,SRC_PORT_PATTERN,DEST_PORT_PATTERN,src_port,
|
||||
AREA_EFFECTIVE_IDS,function_id,ip_type,src_ip_address,ip_pattern,port_pattern,src_port,
|
||||
protocol,protocol_id,direction,dest_port,dest_ip_address,cfg_type,cfg_region_code,
|
||||
asn_ip_group,user_region1,user_region2,user_region3,user_region4,user_region5,organization,country,detail)
|
||||
VALUES
|
||||
@@ -611,10 +594,8 @@
|
||||
#{asnIp.functionId,jdbcType=INTEGER},
|
||||
#{asnIp.ipType,jdbcType=INTEGER},
|
||||
#{asnIp.srcIpAddress,jdbcType=VARCHAR},
|
||||
#{asnIp.srcIpPattern,jdbcType=INTEGER},
|
||||
#{asnIp.destIpPattern,jdbcType=INTEGER},
|
||||
#{asnIp.srcPortPattern,jdbcType=INTEGER},
|
||||
#{asnIp.destPortPattern,jdbcType=INTEGER},
|
||||
#{asnIp.ipPattern,jdbcType=INTEGER},
|
||||
#{asnIp.portPattern,jdbcType=INTEGER},
|
||||
#{asnIp.srcPort,jdbcType=VARCHAR},
|
||||
#{asnIp.protocol,jdbcType=INTEGER},
|
||||
#{asnIp.protocolId,jdbcType=INTEGER},
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
package com.nis.web.dao.basics;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import com.nis.domain.basics.IpCommCfg;
|
||||
import com.nis.domain.basics.Varibles;
|
||||
import com.nis.web.dao.CrudDao;
|
||||
import com.nis.web.dao.MyBatisDao;
|
||||
@MyBatisDao
|
||||
public interface IpCommGroupCfgDao extends CrudDao<IpCommCfg>{
|
||||
public List<IpCommCfg> findPage(IpCommCfg cfg);
|
||||
public List<IpCommCfg> findByPage(@Param("ids")String ids);
|
||||
public void delete(@Param("ids")String ids);
|
||||
public void updateIssued(IpCommCfg cfg);
|
||||
public List<IpCommCfg> getByIds(@Param("ids")String ids);
|
||||
public List<IpCommCfg> findAllList(IpCommCfg cfg);
|
||||
public List<Integer> findOtherIps(@Param("groupId")Integer groupId,@Param("cfgId")Integer cfgId);
|
||||
public List<Integer> countValidIPs(@Param("groups")String groups,@Param("ids")String ids);
|
||||
public int insertBatch(List<IpCommCfg> list);
|
||||
public Varibles getVaribles(@Param("name")String name);
|
||||
public void ajaxDeleteAsnIp(@Param("ids")String ids);
|
||||
public IpCommCfg getOne(IpCommCfg cfg);
|
||||
public List<Object[]> findAllIpCommGroupCfgList();
|
||||
public void insertIpCommGroupCfg(IpCommCfg ipPortCfg);
|
||||
public int getGroupIdCount(int groupId);
|
||||
}
|
||||
@@ -1,514 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.nis.web.dao.basics.IpCommGroupCfgDao">
|
||||
<resultMap id="IpCommGroupCfgMap" type="com.nis.domain.basics.IpCommCfg">
|
||||
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
|
||||
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
|
||||
<result column="cfg_type" property="cfgType" jdbcType="VARCHAR" />
|
||||
<result column="cfg_region_code" property="cfgRegionCode" jdbcType="INTEGER" />
|
||||
<result column="ip_type" property="ipType" jdbcType="INTEGER" />
|
||||
<result column="src_ip_pattern" property="srcIpPattern" jdbcType="INTEGER" />
|
||||
<result column="dest_ip_pattern" property="destIpPattern" jdbcType="INTEGER" />
|
||||
<result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" />
|
||||
<result column="dest_ip_address" property="destIpAddress" jdbcType="VARCHAR" />
|
||||
<result column="port_pattern" property="portPattern" jdbcType="INTEGER" />
|
||||
<result column="src_port" property="srcPort" jdbcType="VARCHAR" />
|
||||
<result column="dest_port" property="destPort" jdbcType="VARCHAR" />
|
||||
<result column="direction" property="direction" jdbcType="INTEGER" />
|
||||
<result column="protocol" property="protocol" jdbcType="INTEGER" />
|
||||
<result column="protocol_id" property="protocolId" jdbcType="INTEGER" />
|
||||
<result column="action" property="action" jdbcType="INTEGER" />
|
||||
<result column="is_valid" property="isValid" jdbcType="INTEGER" />
|
||||
<result column="is_audit" property="isAudit" jdbcType="INTEGER" />
|
||||
<result column="creator_id" property="creatorId" jdbcType="INTEGER" />
|
||||
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
|
||||
<result column="editor_id" property="editorId" jdbcType="INTEGER" />
|
||||
<result column="edit_time" property="editTime" jdbcType="TIMESTAMP" />
|
||||
<result column="auditor_id" property="auditorId" jdbcType="INTEGER" />
|
||||
<result column="audit_time" property="auditTime" jdbcType="TIMESTAMP" />
|
||||
<result column="service_id" property="serviceId" jdbcType="INTEGER" />
|
||||
<result column="request_id" property="requestId" jdbcType="INTEGER" />
|
||||
<result column="compile_id" property="compileId" jdbcType="INTEGER" />
|
||||
<result column="is_area_effective" property="isAreaEffective" jdbcType="INTEGER" />
|
||||
<result column="classify" property="classify" jdbcType="VARCHAR" />
|
||||
<result column="attribute" property="attribute" jdbcType="VARCHAR" />
|
||||
<result column="lable" property="lable" jdbcType="VARCHAR" />
|
||||
<result column="area_effective_ids" property="areaEffectiveIds" jdbcType="VARCHAR" />
|
||||
<result column="function_id" property="functionId" jdbcType="INTEGER" />
|
||||
<result column="ratelimit" property="ratelimit" jdbcType="VARCHAR" />
|
||||
<result column="region_id" property="regionId" jdbcType="INTEGER" />
|
||||
<result column="group_id" property="groupId" jdbcType="INTEGER" />
|
||||
<result column="user_region1" property="userRegion1" jdbcType="VARCHAR" />
|
||||
<result column="user_region2" property="userRegion2" jdbcType="VARCHAR" />
|
||||
<result column="user_region3" property="userRegion3" jdbcType="VARCHAR" />
|
||||
<result column="user_region4" property="userRegion4" jdbcType="VARCHAR" />
|
||||
<result column="user_region5" property="userRegion5" jdbcType="VARCHAR" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="columns">
|
||||
r.cfg_id,r.cfg_desc,r.cfg_type,r.cfg_region_code,r.ip_type,r.src_ip_pattern,r.src_ip_address,r.dest_ip_pattern,r.dest_ip_address,
|
||||
r.src_port_pattern,r.src_port,r.dest_port_pattern,r.dest_port
|
||||
,r.protocol,r.protocol_id,r.direction,r.action
|
||||
,r.is_valid,r.is_audit,r.creator_id,r.create_time,r.editor_id
|
||||
,r.edit_time,r.auditor_id,r.audit_time,r.service_id,r.request_id,
|
||||
r.is_area_effective,r.classify,r.attribute,r.lable
|
||||
,r.area_effective_ids,r.function_id,r.user_region1
|
||||
,r.user_region2,r.user_region3,r.user_region4,r.user_region5,r.compile_id,r.region_id,r.group_id
|
||||
</sql>
|
||||
|
||||
<select id="findPage" resultMap="IpCommGroupCfgMap">
|
||||
select
|
||||
<include refid="columns"></include>
|
||||
<trim prefix="," prefixOverrides=",">
|
||||
,s.name as creator_name,e.name as editor_name,u.name as auditor_name
|
||||
</trim>
|
||||
from ip_comm_cfg r
|
||||
left join sys_user s on r.creator_id=s.id
|
||||
left join sys_user e on r.editor_id=e.id
|
||||
left join sys_user u on r.auditor_id=u.id
|
||||
<trim prefix="WHERE" prefixOverrides="AND |OR ">
|
||||
<if test="page !=null and page.where != null and page.where != ''">
|
||||
AND ${page.where}
|
||||
</if>
|
||||
<if test="cfgId != null">
|
||||
AND r.CFG_ID=#{cfgId,jdbcType=BIGINT}
|
||||
</if>
|
||||
<if test="cfgDesc != null and cfgDesc != ''">
|
||||
AND r.CFG_DESC like concat(concat('%',#{cfgDesc,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="cfgRegionCode != null">
|
||||
AND r.CFG_REGION_CODE=#{cfgRegionCode,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="cfgType != null and cfgType != ''">
|
||||
AND r.CFG_TYPE like concat(concat('%',#{CFG_TYPE,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="ipType != null">
|
||||
AND r.IP_TYPE=#{ipType,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="srcIpPattern != null">
|
||||
AND r.src_ip_pattern=#{srcIpPattern,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="destIpPattern != null">
|
||||
AND r.dest_ip_pattern=#{destIpPattern,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="srcIpAddress != null and srcIpAddress != ''">
|
||||
AND r.SRC_IP_ADDRESS=#{srcIpAddress,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="destIpAddress != null and destIpAddress != ''">
|
||||
AND r.DEST_IP_ADDRESS=#{destIpAddress,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="srcPortPattern != null">
|
||||
AND r.src_port_pattern=#{srcPortPattern,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="destPortPattern != null">
|
||||
AND r.dest_port_pattern=#{destPortPattern,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="srcPort != null and srcPort !=''">
|
||||
AND r.SRC_PORT=#{srcPort,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="destPort != null and destPort !=''">
|
||||
AND r.DEST_PORT=#{destPort,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="direction != null">
|
||||
AND r.DIRECTION=#{direction,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="protocol != null">
|
||||
AND r.PROTOCOL=#{protocol,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="protocolId != null">
|
||||
AND r.PROTOCOL_ID=#{protocolId,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="action != null">
|
||||
AND r.ACTION=#{action,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="isValid != null">
|
||||
AND r.IS_VALID=#{isValid,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="isValid == null">
|
||||
AND r.IS_VALID != -1
|
||||
</if>
|
||||
<if test="isAudit != null">
|
||||
AND r.IS_AUDIT=#{isAudit,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="creatorName != null and creatorName !=''">
|
||||
AND CREATOR_NAME like concat(concat('%',#{creatorName,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="createTime != null and createTime !=''">
|
||||
AND r.CREATE_TIME=#{createTime,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
<if test="editorName != null and editorName !=''">
|
||||
AND EDITOR_NAME like concat(concat('%',#{editorName,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="editTime != null and editTime !='' ">
|
||||
AND r.EDIT_TIME=#{editTime,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
<if test="auditorName != null and auditorName !=''">
|
||||
AND AUDITOR_NAME like concat(concat('%',#{auditorName,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="auditTime != null and auditTime !=''">
|
||||
AND r.AUDIT_TIME=#{auditTime,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
<if test="serviceId != null">
|
||||
AND r.SERVICE_ID=#{serviceId,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="requestId != null">
|
||||
AND r.REQUEST_ID=#{requestId,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="regionId != null">
|
||||
AND r.region_id=#{regionId,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="isAreaEffective != null">
|
||||
AND r.IS_AREA_EFFECTIVE=#{isAreaEffective,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="classify != null and classify !=''">
|
||||
AND r.classify like concat(concat('%',#{classify,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="attribute != null and attribute !=''">
|
||||
AND r.attribute like concat(concat('%',#{attribute,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="lable != null and lable !=''">
|
||||
AND r.lable like concat(concat('%',#{lable,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="areaEffectiveIds != null and areaEffectiveIds !=''">
|
||||
AND r.AREA_EFFECTIVE_IDS like concat(concat('%',#{areaEffectiveIds,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="functionId != null">
|
||||
AND r.FUNCTION_ID=#{functionId,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="userRegion3 != null">
|
||||
AND r.user_region3 like concat(concat('%',#{userRegion3,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
|
||||
<!-- 数据范围过滤 -->
|
||||
${sqlMap.dsf}
|
||||
</trim>
|
||||
<choose>
|
||||
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
||||
ORDER BY ${page.orderBy}
|
||||
</when>
|
||||
<otherwise>
|
||||
ORDER BY r.CFG_ID desc
|
||||
</otherwise>
|
||||
</choose>
|
||||
</select>
|
||||
|
||||
<select id="get" resultMap="IpCommGroupCfgMap">
|
||||
select
|
||||
<include refid="columns"></include>
|
||||
from ip_comm_cfg r
|
||||
where r.cfg_id=#{cfgId}
|
||||
</select>
|
||||
<select id="getByIds" resultMap="IpCommGroupCfgMap">
|
||||
select
|
||||
<include refid="columns"></include>
|
||||
from ip_comm_cfg r
|
||||
where r.cfg_id in (${ids}) and is_valid !=-1
|
||||
</select>
|
||||
<select id="getByAsnNo" resultMap="IpCommGroupCfgMap" parameterType="java.lang.Long" >
|
||||
select
|
||||
<include refid="columns"></include>
|
||||
from ip_comm_cfg r where r.is_valid!=-1 and r.user_region1=#{asnId}
|
||||
</select>
|
||||
<insert id="insertIpCommGroupCfg" parameterType="com.nis.domain.basics.IpCommCfg" >
|
||||
<selectKey resultType="java.lang.Long" order="AFTER" keyProperty="cfgId">
|
||||
SELECT LAST_INSERT_ID()
|
||||
</selectKey>
|
||||
insert into ip_comm_cfg (
|
||||
CFG_DESC,
|
||||
ACTION,
|
||||
IS_VALID,
|
||||
IS_AUDIT,
|
||||
CREATOR_ID,
|
||||
CREATE_TIME,
|
||||
EDITOR_ID,
|
||||
EDIT_TIME,
|
||||
AUDITOR_ID,
|
||||
AUDIT_TIME,
|
||||
SERVICE_ID,
|
||||
REQUEST_ID,
|
||||
REGION_ID,
|
||||
GROUP_ID,
|
||||
COMPILE_ID,
|
||||
IS_AREA_EFFECTIVE,
|
||||
CLASSIFY,
|
||||
ATTRIBUTE,
|
||||
LABLE,
|
||||
AREA_EFFECTIVE_IDS,
|
||||
FUNCTION_ID,
|
||||
IP_TYPE,
|
||||
SRC_IP_ADDRESS,
|
||||
SRC_IP_PATTERN,
|
||||
DEST_IP_PATTERN,
|
||||
SRC_PORT_PATTERN,
|
||||
DEST_PORT_PATTERN,
|
||||
SRC_PORT,
|
||||
PROTOCOL,
|
||||
PROTOCOL_ID,
|
||||
DIRECTION,
|
||||
DEST_PORT,
|
||||
DEST_IP_ADDRESS,
|
||||
CFG_TYPE,
|
||||
CFG_REGION_CODE,
|
||||
USER_REGION1,
|
||||
USER_REGION2,
|
||||
USER_REGION3,
|
||||
USER_REGION4,
|
||||
USER_REGION5,
|
||||
)values (
|
||||
#{cfgDesc,jdbcType=VARCHAR},
|
||||
#{action,jdbcType=INTEGER},
|
||||
#{isValid,jdbcType=INTEGER},
|
||||
#{isAudit,jdbcType=INTEGER},
|
||||
#{creatorId,jdbcType=INTEGER},
|
||||
#{createTime,jdbcType=TIMESTAMP},
|
||||
#{editorId,jdbcType=INTEGER},
|
||||
#{editTime,jdbcType=TIMESTAMP},
|
||||
#{auditorId,jdbcType=INTEGER},
|
||||
#{auditTime,jdbcType=TIMESTAMP},
|
||||
#{serviceId,jdbcType=INTEGER},
|
||||
#{requestId,jdbcType=INTEGER},
|
||||
#{regionId,jdbcType=INTEGER},
|
||||
#{groupId,jdbcType=INTEGER},
|
||||
#{compileId,jdbcType=INTEGER},
|
||||
#{isAreaEffective,jdbcType=INTEGER},
|
||||
#{classify,jdbcType=VARCHAR},
|
||||
#{attribute,jdbcType=VARCHAR},
|
||||
#{lable,jdbcType=VARCHAR},
|
||||
#{areaEffectiveIds,jdbcType=VARCHAR},
|
||||
#{functionId,jdbcType=INTEGER},
|
||||
#{ipType,jdbcType=INTEGER},
|
||||
#{srcIpAddress,jdbcType=VARCHAR},
|
||||
#{srcIpPattern,jdbcType=INTEGER},#{destIpPattern,jdbcType=INTEGER},
|
||||
#{srcPortPattern,jdbcType=INTEGER},#{destPortPattern,jdbcType=INTEGER},
|
||||
#{srcPort,jdbcType=VARCHAR},
|
||||
#{protocol,jdbcType=INTEGER},
|
||||
#{protocolId,jdbcType=INTEGER},
|
||||
#{direction,jdbcType=INTEGER},
|
||||
#{destPort,jdbcType=VARCHAR},
|
||||
#{destIpAddress,jdbcType=VARCHAR},
|
||||
#{cfgType,jdbcType=VARCHAR},
|
||||
#{cfgRegionCode,jdbcType=INTEGER},
|
||||
#{userRegion1,jdbcType=VARCHAR},
|
||||
#{userRegion2,jdbcType=VARCHAR},
|
||||
#{userRegion3,jdbcType=VARCHAR},
|
||||
#{userRegion4,jdbcType=VARCHAR},
|
||||
#{userRegion5,jdbcType=VARCHAR}
|
||||
)
|
||||
</insert>
|
||||
<insert id="insertForBatch" parameterType="com.nis.domain.basics.IpCommCfg" >
|
||||
insert into ip_comm_cfg (
|
||||
CFG_DESC,
|
||||
ACTION,
|
||||
IS_VALID,
|
||||
IS_AUDIT,
|
||||
CREATOR_ID,
|
||||
CREATE_TIME,
|
||||
EDITOR_ID,
|
||||
EDIT_TIME,
|
||||
AUDITOR_ID,
|
||||
AUDIT_TIME,
|
||||
SERVICE_ID,
|
||||
REQUEST_ID,
|
||||
REGION_ID,
|
||||
GROUP_ID,
|
||||
COMPILE_ID,
|
||||
IS_AREA_EFFECTIVE,
|
||||
CLASSIFY,
|
||||
ATTRIBUTE,
|
||||
LABLE,
|
||||
AREA_EFFECTIVE_IDS,
|
||||
FUNCTION_ID,
|
||||
IP_TYPE,
|
||||
SRC_IP_ADDRESS,
|
||||
SRC_IP_PATTERN,
|
||||
DEST_IP_PATTERN,
|
||||
SRC_PORT_PATTERN,
|
||||
DEST_PORT_PATTERN,
|
||||
SRC_PORT,
|
||||
PROTOCOL,
|
||||
PROTOCOL_ID,
|
||||
DIRECTION,
|
||||
DEST_PORT,
|
||||
DEST_IP_ADDRESS,
|
||||
CFG_TYPE,
|
||||
CFG_REGION_CODE,
|
||||
USER_REGION1,
|
||||
USER_REGION2,
|
||||
USER_REGION3,
|
||||
USER_REGION4,
|
||||
USER_REGION5
|
||||
)values (
|
||||
#{cfgDesc,jdbcType=VARCHAR},
|
||||
#{action,jdbcType=INTEGER},
|
||||
#{isValid,jdbcType=INTEGER},
|
||||
#{isAudit,jdbcType=INTEGER},
|
||||
#{creatorId,jdbcType=INTEGER},
|
||||
#{createTime,jdbcType=TIMESTAMP},
|
||||
#{editorId,jdbcType=INTEGER},
|
||||
#{editTime,jdbcType=TIMESTAMP},
|
||||
#{auditorId,jdbcType=INTEGER},
|
||||
#{auditTime,jdbcType=TIMESTAMP},
|
||||
#{serviceId,jdbcType=INTEGER},
|
||||
#{requestId,jdbcType=INTEGER},
|
||||
#{regionId,jdbcType=INTEGER},
|
||||
#{groupId,jdbcType=INTEGER},
|
||||
#{compileId,jdbcType=INTEGER},
|
||||
#{isAreaEffective,jdbcType=INTEGER},
|
||||
#{classify,jdbcType=VARCHAR},
|
||||
#{attribute,jdbcType=VARCHAR},
|
||||
#{lable,jdbcType=VARCHAR},
|
||||
#{areaEffectiveIds,jdbcType=VARCHAR},
|
||||
#{functionId,jdbcType=INTEGER},
|
||||
#{ipType,jdbcType=INTEGER},
|
||||
#{srcIpAddress,jdbcType=VARCHAR},
|
||||
#{srcIpPattern,jdbcType=INTEGER},#{destIpPattern,jdbcType=INTEGER},
|
||||
#{srcPortPattern,jdbcType=INTEGER},#{destPortPattern,jdbcType=INTEGER},
|
||||
#{srcPort,jdbcType=VARCHAR},
|
||||
#{protocol,jdbcType=INTEGER},
|
||||
#{protocolId,jdbcType=INTEGER},
|
||||
#{direction,jdbcType=INTEGER},
|
||||
#{destPort,jdbcType=VARCHAR},
|
||||
#{destIpAddress,jdbcType=VARCHAR},
|
||||
#{cfgType,jdbcType=VARCHAR},
|
||||
#{cfgRegionCode,jdbcType=INTEGER},
|
||||
#{userRegion1,jdbcType=VARCHAR},
|
||||
#{userRegion2,jdbcType=VARCHAR},
|
||||
#{userRegion3,jdbcType=VARCHAR},
|
||||
#{userRegion4,jdbcType=VARCHAR},
|
||||
#{userRegion5,jdbcType=VARCHAR}
|
||||
)
|
||||
</insert>
|
||||
<update id="update" parameterType="com.nis.domain.basics.IpCommCfg" >
|
||||
update ip_comm_cfg
|
||||
<set >
|
||||
<trim suffixOverrides=",">
|
||||
<if test="cfgDesc != null and cfgDesc != ''" >
|
||||
CFG_DESC = #{cfgDesc,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="action != null" >
|
||||
ACTION = #{action,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="isValid != null" >
|
||||
IS_VALID = #{isValid,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="isAudit != null" >
|
||||
IS_AUDIT = #{isAudit,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="editorId != null" >
|
||||
EDITOR_ID = #{editorId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="editTime != null and editTime != ''" >
|
||||
EDIT_TIME = #{editTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="auditorId != null" >
|
||||
AUDITOR_ID = #{auditorId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="auditTime != null and auditTime != ''" >
|
||||
AUDIT_TIME = #{auditTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="regionId != null" >
|
||||
REGION_ID = #{regionId,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="requestId != null" >
|
||||
REQUEST_ID = #{requestId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="isAreaEffective != null" >
|
||||
IS_AREA_EFFECTIVE = #{isAreaEffective,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="classify != null and classify != ''" >
|
||||
CLASSIFY = #{classify,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="attribute != null and attribute != ''" >
|
||||
ATTRIBUTE = #{attribute,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="lable != null and lable != ''" >
|
||||
LABLE = #{lable,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="areaEffectiveIds != null" >
|
||||
AREA_EFFECTIVE_IDS = #{areaEffectiveIds,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="functionId != null" >
|
||||
FUNCTION_ID = #{functionId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="serviceId != null" >
|
||||
SERVICE_ID = #{serviceId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="ipType != null" >
|
||||
IP_TYPE = #{ipType,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="srcIpAddress != null and srcIpAddress != ''" >
|
||||
SRC_IP_ADDRESS = #{srcIpAddress,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="srcIpPattern != null" >
|
||||
SRC_IP_PATTERN = #{srcIpPattern,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="destIpPattern != null" >
|
||||
DEST_IP_PATTERN =#{destIpPattern,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="srcPortPattern != null" >
|
||||
SRC_PORT_PATTERN = #{srcPortPattern,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="destPortPattern != null" >
|
||||
DEST_PORT_PATTERN = #{destPortPattern,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="srcPort != null and srcPort != ''" >
|
||||
SRC_PORT = #{srcPort,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="protocol != null" >
|
||||
PROTOCOL = #{protocol,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="protocolId != null" >
|
||||
PROTOCOL_ID = #{protocolId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="direction != null" >
|
||||
DIRECTION = #{direction,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="destPort != null and destPort != ''" >
|
||||
DEST_PORT = #{destPort,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="destIpAddress != null and destIpAddress != ''" >
|
||||
DEST_IP_ADDRESS = #{destIpAddress,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="cfgType != null and cfgType != ''" >
|
||||
CFG_TYPE = #{cfgType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="cfgRegionCode != null " >
|
||||
CFG_REGION_CODE = #{cfgRegionCode,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="userRegion1 != null and userRegion1 != ''" >
|
||||
USER_REGION1 = #{userRegion1,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="userRegion2 != null and userRegion2 != ''" >
|
||||
USER_REGION2 = #{userRegion2,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="userRegion3 != null and userRegion3 != ''" >
|
||||
USER_REGION3 = #{userRegion3,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="userRegion4 != null and userRegion4 != ''" >
|
||||
USER_REGION4 = #{userRegion4,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="userRegion5 != null and userRegion5 != ''" >
|
||||
USER_REGION5 = #{userRegion5,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="groupId != null and groupId != ''" >
|
||||
GROUP_ID = #{groupId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="regionId != null and regionId != ''" >
|
||||
REGION_ID = #{regionId,jdbcType=INTEGER},
|
||||
</if>
|
||||
</trim>
|
||||
</set>
|
||||
<where>
|
||||
and cfg_id = #{cfgId,jdbcType=INTEGER}
|
||||
</where>
|
||||
</update>
|
||||
|
||||
<delete id="delete" parameterType="java.lang.String" >
|
||||
delete from ip_comm_cfg where cfg_id in (${ids})
|
||||
</delete>
|
||||
<select id="getGroupIdCount" parameterType="java.lang.Integer" resultType="java.lang.Integer">
|
||||
SELECT COUNT(cfg_id) groupCount from ip_comm_cfg
|
||||
WHERE group_id= #{groupId}
|
||||
and is_valid=1
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -24,9 +24,6 @@ public interface PolicyGroupInfoDao extends CrudDao<PolicyGroupInfo> {
|
||||
|
||||
Integer getGroupIdByGroupName(String groupName);
|
||||
PolicyGroupInfo getGroupInfo(PolicyGroupInfo policyGroupInfo);
|
||||
List<PolicyGroupInfo> findPolicyGroupInfosByTypeForUD(@Param("groupType")Integer groupType,@Param("flag")Integer flag);
|
||||
List<PolicyGroupInfo> findLimitedPolicyGroupInfosByTypeForUD(@Param("groupType")Integer groupType,@Param("flag")Integer flag,@Param("limit")Integer limit);
|
||||
|
||||
List<PolicyGroupInfo> findPolicyByGroupInfoList(@Param("ids")String ids);
|
||||
void updateUdFlag(@Param("groupId")int groupId,@Param("udFlag")int udFlag,@Param("groupType")int groupType);
|
||||
List<PolicyGroupInfo> findPolicyByServiceGroupInfoList(@Param("ids")String ids);
|
||||
}
|
||||
@@ -266,45 +266,6 @@
|
||||
WHERE
|
||||
r.group_id IN (${ids})
|
||||
</select>
|
||||
<select id="findPolicyByServiceGroupInfoList" resultMap="PolicyGroupInfoMap">
|
||||
SELECT
|
||||
<include refid="PolicyGroupInfoColumns"/>
|
||||
<trim prefix="," prefixOverrides=",">
|
||||
, s.name as creator_name
|
||||
,e.name as editor_name
|
||||
</trim>
|
||||
FROM
|
||||
policy_group_info r
|
||||
left join sys_user s on r.creator_id=s.id
|
||||
left join sys_user e on r.editor_id=e.id
|
||||
WHERE
|
||||
r.service_group_id IN (${ids})
|
||||
</select>
|
||||
<select id="findPolicyGroupInfosByTypeForUD" resultMap="PolicyGroupInfoMap">
|
||||
SELECT
|
||||
<include refid="PolicyGroupInfoColumns"/>
|
||||
FROM policy_group_info r
|
||||
where r.is_valid=1 and r.group_type=#{groupType,jdbcType=INTEGER}
|
||||
<if test="flag!=null">
|
||||
and ud_flag=#{flag}
|
||||
</if>
|
||||
</select>
|
||||
<select id="findLimitedPolicyGroupInfosByTypeForUD" resultMap="PolicyGroupInfoMap">
|
||||
SELECT
|
||||
<include refid="PolicyGroupInfoColumns"/>
|
||||
FROM policy_group_info r
|
||||
where r.is_valid=1 and r.group_type=#{groupType,jdbcType=INTEGER}
|
||||
<if test="flag!=null">
|
||||
and ud_flag=#{flag}
|
||||
</if>
|
||||
<if test="flag!=null">
|
||||
limit #{limit}
|
||||
</if>
|
||||
</select>
|
||||
<update id="updateUdFlag" parameterType="java.lang.Integer">
|
||||
UPDATE policy_group_info SET ud_flag =#{udFlag}
|
||||
WHERE service_group_id=#{groupId}
|
||||
and group_type=#{groupType}
|
||||
</update>
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -1,38 +0,0 @@
|
||||
package com.nis.web.dao.basics;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import com.nis.domain.basics.UrlCommCfg;
|
||||
import com.nis.web.dao.CrudDao;
|
||||
import com.nis.web.dao.MyBatisDao;
|
||||
|
||||
@MyBatisDao
|
||||
public interface UrlCommGroupDao extends CrudDao<UrlCommCfg>{
|
||||
|
||||
// 查询列表
|
||||
public List<UrlCommCfg> findAllPageList(UrlCommCfg entity);
|
||||
|
||||
public List<UrlCommCfg> findByPage(@Param("ids")String ids);
|
||||
|
||||
public List<UrlCommCfg> findInfoByCfgId(@Param("cfgId")Long cfgId);
|
||||
//新增
|
||||
public int insertUrlCommGroupCfg(UrlCommCfg entity);
|
||||
|
||||
public Integer findUrlUdFlag(@Param("groupId")Integer groupId);
|
||||
|
||||
public int updateUrlUdFlag(@Param("groupId")Integer groupId,@Param("udFlag")Integer udFlag);
|
||||
|
||||
//修改
|
||||
public int update(UrlCommCfg entity);
|
||||
|
||||
//删除
|
||||
public int delete(@Param("ids")String ids);
|
||||
|
||||
public List<UrlCommCfg> getByIds(@Param("ids")String ids);
|
||||
|
||||
|
||||
public Integer getGroupIdCount(@Param("groupId")String groupId);
|
||||
|
||||
}
|
||||
@@ -1,388 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.nis.web.dao.basics.UrlCommGroupDao">
|
||||
<resultMap id="urlCommGroupCfgMap" type="com.nis.domain.basics.UrlCommCfg">
|
||||
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
|
||||
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
|
||||
<result column="cfg_keywords" property="cfgKeywords" jdbcType="VARCHAR" />
|
||||
<result column="action" property="action" jdbcType="INTEGER" />
|
||||
<result column="is_valid" property="isValid" jdbcType="INTEGER" />
|
||||
<result column="is_audit" property="isAudit" jdbcType="INTEGER" />
|
||||
<result column="creator_id" property="creatorId" jdbcType="INTEGER" />
|
||||
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
|
||||
<result column="editor_id" property="editorId" jdbcType="INTEGER" />
|
||||
<result column="edit_time" property="editTime" jdbcType="TIMESTAMP" />
|
||||
<result column="auditor_id" property="auditorId" jdbcType="INTEGER" />
|
||||
<result column="audit_time" property="auditTime" jdbcType="TIMESTAMP" />
|
||||
<result column="service_id" property="serviceId" jdbcType="INTEGER" />
|
||||
<result column="request_id" property="requestId" jdbcType="INTEGER" />
|
||||
<result column="compile_id" property="compileId" jdbcType="INTEGER" />
|
||||
<result column="is_area_effective" property="isAreaEffective" jdbcType="INTEGER" />
|
||||
<result column="classify" property="classify" jdbcType="VARCHAR" />
|
||||
<result column="attribute" property="attribute" jdbcType="VARCHAR" />
|
||||
<result column="lable" property="lable" jdbcType="VARCHAR" />
|
||||
<result column="expr_type" property="exprType" jdbcType="INTEGER" />
|
||||
<result column="match_method" property="matchMethod" jdbcType="INTEGER" />
|
||||
<result column="is_hexbin" property="isHexbin" jdbcType="INTEGER" />
|
||||
<result column="area_effective_ids" property="areaEffectiveIds" jdbcType="VARCHAR" />
|
||||
<result column="function_id" property="functionId" jdbcType="INTEGER" />
|
||||
<result column="cfg_region_code" property="cfgRegionCode" jdbcType="INTEGER" />
|
||||
<result column="cfg_type" property="cfgType" jdbcType="VARCHAR" />
|
||||
<result column="ratelimit" property="ratelimit" jdbcType="VARCHAR" />
|
||||
<result column="user_region1" property="userRegion1" jdbcType="VARCHAR" />
|
||||
<result column="user_region2" property="userRegion2" jdbcType="VARCHAR" />
|
||||
<result column="user_region3" property="userRegion3" jdbcType="VARCHAR" />
|
||||
<result column="user_region4" property="userRegion4" jdbcType="VARCHAR" />
|
||||
<result column="user_region5" property="userRegion5" jdbcType="VARCHAR" />
|
||||
|
||||
<result column="group_name" property="groupName" jdbcType="VARCHAR" />
|
||||
</resultMap>
|
||||
|
||||
<select id="findAllPageList" parameterType="com.nis.domain.basics.UrlCommCfg" resultMap="urlCommGroupCfgMap">
|
||||
SELECT
|
||||
r.cfg_id,r.cfg_desc,r.cfg_keywords,r.action,r.is_valid,r.is_audit,r.creator_id,
|
||||
r.create_time,r.editor_id,r.edit_time,r.auditor_id,r.audit_time,r.service_id,
|
||||
r.request_id,r.compile_id,r.is_area_effective,r.classify,r.attribute,r.lable,
|
||||
r.expr_type,r.match_method,r.is_hexbin,r.area_effective_ids,r.function_id,
|
||||
r.cfg_region_code,r.cfg_type,r.ratelimit,r.user_region1,r.user_region2,
|
||||
r.user_region3,r.user_region4,r.user_region5,
|
||||
s.name AS creator_name,e.name AS editor_name,u.name AS auditor_name,c.group_name
|
||||
FROM
|
||||
http_url_cfg r
|
||||
LEFT JOIN sys_user s ON r.creator_id = s.id
|
||||
LEFT JOIN sys_user e ON r.editor_id = e.id
|
||||
LEFT JOIN sys_user u ON r.auditor_id = u.id
|
||||
LEFT JOIN policy_group_info c ON c.service_group_id=r.user_region3
|
||||
<trim prefix="WHERE" prefixOverrides="AND |OR ">
|
||||
<if test="page !=null and page.where != null and page.where != ''">
|
||||
AND ${page.where}
|
||||
</if>
|
||||
<if test="cfgId != null">
|
||||
AND r.CFG_ID=#{cfgId,jdbcType=BIGINT}
|
||||
</if>
|
||||
<if test="cfgDesc != null and cfgDesc != ''">
|
||||
AND r.CFG_DESC like concat(concat('%',#{cfgDesc,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="cfgKeywords != null and cfgKeywords != ''">
|
||||
AND r.cfg_keywords like concat(concat('%',#{cfgKeywords,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="cfgRegionCode != null">
|
||||
AND r.CFG_REGION_CODE=#{cfgRegionCode,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="cfgType != null and cfgType != ''">
|
||||
AND r.CFG_TYPE like concat(concat('%',#{cfgType,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="action != null">
|
||||
AND r.ACTION=#{action,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="isValid != null">
|
||||
AND r.IS_VALID=#{isValid,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="isValid == null">
|
||||
AND r.IS_VALID != -1
|
||||
</if>
|
||||
<if test="isAudit != null">
|
||||
AND r.IS_AUDIT=#{isAudit,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="creatorName != null and creatorName !=''">
|
||||
AND CREATOR_NAME like concat(concat('%',#{creatorName,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="createTime != null and createTime !=''">
|
||||
AND r.CREATE_TIME=#{createTime,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
<if test="editorName != null and editorName !=''">
|
||||
AND EDITOR_NAME like concat(concat('%',#{editorName,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="editTime != null and editTime !='' ">
|
||||
AND r.EDIT_TIME=#{editTime,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
<if test="auditorName != null and auditorName !=''">
|
||||
AND AUDITOR_NAME like concat(concat('%',#{auditorName,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="auditTime != null and auditTime !=''">
|
||||
AND r.AUDIT_TIME=#{auditTime,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
<if test="serviceId != null">
|
||||
AND r.SERVICE_ID=#{serviceId,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="requestId != null">
|
||||
AND r.REQUEST_ID=#{requestId,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="isAreaEffective != null">
|
||||
AND r.IS_AREA_EFFECTIVE=#{isAreaEffective,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="classify != null and classify !=''">
|
||||
AND r.classify like concat(concat('%',#{classify,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="attribute != null and attribute !=''">
|
||||
AND r.attribute like concat(concat('%',#{attribute,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="lable != null and lable !=''">
|
||||
AND r.lable like concat(concat('%',#{lable,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="areaEffectiveIds != null and areaEffectiveIds !=''">
|
||||
AND r.AREA_EFFECTIVE_IDS like concat(concat('%',#{areaEffectiveIds,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="functionId != null">
|
||||
AND r.FUNCTION_ID=#{functionId,jdbcType=INTEGER}
|
||||
</if>
|
||||
|
||||
<!-- 数据范围过滤 -->
|
||||
${sqlMap.dsf}
|
||||
</trim>
|
||||
<choose>
|
||||
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
||||
ORDER BY ${page.orderBy}
|
||||
</when>
|
||||
<otherwise>
|
||||
ORDER BY r.is_audit,r.create_time desc
|
||||
</otherwise>
|
||||
</choose>
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<select id="findByPage" resultMap="urlCommGroupCfgMap">
|
||||
SELECT
|
||||
r.cfg_id,r.cfg_desc,r.cfg_keywords,r.action,r.is_valid,r.is_audit,r.creator_id,
|
||||
r.create_time,r.editor_id,r.edit_time,r.auditor_id,r.audit_time,r.service_id,
|
||||
r.request_id,r.compile_id,r.is_area_effective,r.classify,r.attribute,r.lable,
|
||||
r.expr_type,r.match_method,r.is_hexbin,r.area_effective_ids,r.function_id,
|
||||
r.cfg_region_code,r.cfg_type,r.ratelimit,r.user_region1,r.user_region2,
|
||||
r.user_region3,r.user_region4,r.user_region5,
|
||||
s.name AS creator_name,e.name AS editor_name,u.name AS auditor_name
|
||||
FROM
|
||||
http_url_cfg r
|
||||
LEFT JOIN sys_user s ON r.creator_id = s.id
|
||||
LEFT JOIN sys_user e ON r.editor_id = e.id
|
||||
LEFT JOIN sys_user u ON r.auditor_id = u.id
|
||||
where r.CFG_ID in (${ids})
|
||||
</select>
|
||||
|
||||
<select id="findInfoByCfgId" resultMap="urlCommGroupCfgMap">
|
||||
SELECT
|
||||
r.cfg_id,r.cfg_desc,r.cfg_keywords,r.action,r.is_valid,r.is_audit,r.creator_id,
|
||||
r.create_time,r.editor_id,r.edit_time,r.auditor_id,r.audit_time,r.service_id,
|
||||
r.request_id,r.compile_id,r.is_area_effective,r.classify,r.attribute,r.lable,
|
||||
r.expr_type,r.match_method,r.is_hexbin,r.area_effective_ids,r.function_id,
|
||||
r.cfg_region_code,r.cfg_type,r.ratelimit,r.user_region1,r.user_region2,
|
||||
r.user_region3,r.user_region4,r.user_region5
|
||||
FROM
|
||||
http_url_cfg r
|
||||
where r.CFG_ID =#{cfgId}
|
||||
|
||||
</select>
|
||||
|
||||
<select id="get" resultMap="urlCommGroupCfgMap">
|
||||
SELECT
|
||||
r.cfg_id,r.cfg_desc,r.cfg_keywords,r.action,r.is_valid,r.is_audit,r.creator_id,
|
||||
r.create_time,r.editor_id,r.edit_time,r.auditor_id,r.audit_time,r.service_id,
|
||||
r.request_id,r.compile_id,r.is_area_effective,r.classify,r.attribute,r.lable,
|
||||
r.expr_type,r.match_method,r.is_hexbin,r.area_effective_ids,r.function_id,
|
||||
r.cfg_region_code,r.cfg_type,r.ratelimit,r.user_region1,r.user_region2,
|
||||
r.user_region3,r.user_region4,r.user_region5
|
||||
from http_url_cfg r
|
||||
where r.cfg_id=#{cfgId}
|
||||
</select>
|
||||
|
||||
<insert id="insertUrlCommGroupCfg" parameterType="com.nis.domain.basics.UrlCommCfg">
|
||||
insert into http_url_cfg (
|
||||
CFG_DESC,
|
||||
cfg_keywords,
|
||||
action,
|
||||
is_valid,
|
||||
is_audit,
|
||||
creator_id,
|
||||
create_time,
|
||||
editor_id,
|
||||
edit_time,
|
||||
auditor_id,
|
||||
audit_time,
|
||||
service_id,
|
||||
request_id,
|
||||
compile_id,
|
||||
IS_AREA_EFFECTIVE,
|
||||
CLASSIFY,
|
||||
ATTRIBUTE,
|
||||
LABLE,
|
||||
expr_type,
|
||||
match_method,
|
||||
is_hexbin,
|
||||
area_effective_ids,
|
||||
function_id,
|
||||
cfg_region_code,
|
||||
cfg_type,
|
||||
ratelimit,
|
||||
user_region1,
|
||||
user_region2,
|
||||
user_region3,
|
||||
user_region4,
|
||||
user_region5
|
||||
)values (
|
||||
#{cfgDesc,jdbcType=VARCHAR},
|
||||
#{cfgKeywords,jdbcType=VARCHAR},
|
||||
#{action,jdbcType=INTEGER},
|
||||
#{isValid,jdbcType=INTEGER},
|
||||
#{isAudit,jdbcType=INTEGER},
|
||||
#{creatorId,jdbcType=INTEGER},
|
||||
#{createTime,jdbcType=TIMESTAMP},
|
||||
#{editorId,jdbcType=INTEGER},
|
||||
#{editTime,jdbcType=TIMESTAMP},
|
||||
#{auditorId,jdbcType=INTEGER},
|
||||
#{auditTime,jdbcType=TIMESTAMP},
|
||||
#{serviceId,jdbcType=INTEGER},
|
||||
#{requestId,jdbcType=INTEGER},
|
||||
#{compileId,jdbcType=INTEGER},
|
||||
#{isAreaEffective,jdbcType=INTEGER},
|
||||
#{classify,jdbcType=VARCHAR},
|
||||
#{attribute,jdbcType=VARCHAR},
|
||||
#{lable,jdbcType=VARCHAR},
|
||||
#{exprType,jdbcType=INTEGER},
|
||||
#{matchMethod,jdbcType=INTEGER},
|
||||
#{isHexbin,jdbcType=INTEGER},
|
||||
#{areaEffectiveIds,jdbcType=VARCHAR},
|
||||
#{functionId,jdbcType=INTEGER},
|
||||
#{cfgRegionCode,jdbcType=INTEGER},
|
||||
#{cfgType,jdbcType=VARCHAR},
|
||||
#{ratelimit,jdbcType=VARCHAR},
|
||||
#{userRegion1,jdbcType=VARCHAR},
|
||||
#{userRegion2,jdbcType=VARCHAR},
|
||||
#{userRegion3,jdbcType=VARCHAR},
|
||||
#{userRegion4,jdbcType=VARCHAR},
|
||||
#{userRegion5,jdbcType=VARCHAR}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<select id="findUrlUdFlag" parameterType="java.lang.Integer" resultType="java.lang.Integer">
|
||||
SELECT ud_flag from policy_group_info
|
||||
where service_group_id=#{groupId}
|
||||
and group_type=11
|
||||
</select>
|
||||
|
||||
<update id="updateUrlUdFlag" parameterType="java.lang.Integer">
|
||||
UPDATE policy_group_info SET ud_flag =#{udFlag}
|
||||
WHERE service_group_id=#{groupId}
|
||||
and group_type=11
|
||||
</update>
|
||||
|
||||
<update id="update" parameterType="com.nis.domain.basics.UrlCommCfg" >
|
||||
update http_url_cfg
|
||||
<set >
|
||||
<trim suffixOverrides=",">
|
||||
<if test="cfgDesc != null and cfgDesc != ''" >
|
||||
cfg_desc = #{cfgDesc,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="cfgKeywords != null and cfgKeywords != ''" >
|
||||
cfg_keywords = #{cfgKeywords,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="action != null" >
|
||||
action = #{action,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="isValid != null" >
|
||||
is_valid = #{isValid,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="isAudit != null" >
|
||||
is_audit = #{isAudit,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="editorId != null" >
|
||||
editor_id = #{editorId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="editTime != null and editTime != ''" >
|
||||
edit_time = #{editTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="auditorId != null" >
|
||||
AUDITOR_ID = #{auditorId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="auditTime != null and auditTime != ''" >
|
||||
AUDIT_TIME = #{auditTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="serviceId != null" >
|
||||
service_id = #{serviceId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="requestId != null" >
|
||||
request_id = #{requestId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="compileId != null and compileId != ''" >
|
||||
compile_id = #{compileId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="isAreaEffective != null" >
|
||||
is_area_effective = #{isAreaEffective,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="classify != null and classify != ''" >
|
||||
classify = #{classify,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="attribute != null and attribute != ''" >
|
||||
attribute = #{attribute,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="lable != null and lable != ''" >
|
||||
lable = #{lable,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="exprType != null" >
|
||||
expr_type = #{exprType,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="matchMethod != null" >
|
||||
match_method = #{matchMethod,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="isHexbin != null" >
|
||||
is_hexbin = #{isHexbin,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="areaEffectiveIds != null" >
|
||||
area_effective_ids = #{areaEffectiveIds,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="functionId != null" >
|
||||
function_id = #{functionId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="cfgType != null and cfgType != ''" >
|
||||
cfg_type = #{cfgType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="cfgRegionCode != null " >
|
||||
cfg_region_code = #{cfgRegionCode,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="ratelimit != null and ratelimit != ''" >
|
||||
ratelimit = #{ratelimit,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="userRegion1 != null and userRegion1 != ''" >
|
||||
user_region1 = #{userRegion1,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="userRegion2 != null and userRegion2 != ''" >
|
||||
user_region2 = #{userRegion2,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="userRegion3 != null and userRegion3 != ''" >
|
||||
user_region3 = #{userRegion3,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="userRegion4 != null and userRegion4 != ''" >
|
||||
user_region4 = #{userRegion4,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="userRegion5 != null and userRegion5 != ''" >
|
||||
user_region5 = #{userRegion5,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</set>
|
||||
<where>
|
||||
and cfg_id = #{cfgId,jdbcType=INTEGER}
|
||||
</where>
|
||||
</update>
|
||||
|
||||
<delete id="delete" parameterType="java.lang.String" >
|
||||
delete from http_url_cfg where cfg_id in (${ids})
|
||||
</delete>
|
||||
|
||||
<select id="getByIds" resultMap="urlCommGroupCfgMap">
|
||||
select
|
||||
r.cfg_id,r.cfg_desc,r.cfg_keywords,r.action,r.is_valid,r.is_audit,r.creator_id,
|
||||
r.create_time,r.editor_id,r.edit_time,r.auditor_id,r.audit_time,r.service_id,
|
||||
r.request_id,r.compile_id,r.is_area_effective,r.classify,r.attribute,r.lable,
|
||||
r.expr_type,r.match_method,r.is_hexbin,r.area_effective_ids,r.function_id,
|
||||
r.cfg_region_code,r.cfg_type,r.ratelimit,r.user_region1,r.user_region2,
|
||||
r.user_region3,r.user_region4,r.user_region5
|
||||
from http_url_cfg r
|
||||
where r.cfg_id in (${ids}) and is_valid !=-1
|
||||
</select>
|
||||
|
||||
<select id="getGroupIdCount" parameterType="java.lang.String" resultType="java.lang.Integer">
|
||||
SELECT COUNT(cfg_id) groupCount from http_url_cfg
|
||||
WHERE user_region3= #{groupId}
|
||||
and is_valid=1
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -43,8 +43,7 @@
|
||||
<result column="app_code" property="appCode" jdbcType="INTEGER" />
|
||||
<result column="behav_code" property="behavCode" jdbcType="INTEGER" />
|
||||
<result column="ip_type" property="ipType" jdbcType="INTEGER" />
|
||||
<result column="src_ip_pattern" property="srcIpPattern" jdbcType="INTEGER" />
|
||||
<result column="dest_ip_pattern" property="destIpPattern" jdbcType="INTEGER" />
|
||||
<result column="ip_pattern" property="ipPattern" jdbcType="INTEGER" />
|
||||
<result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" />
|
||||
<result column="dest_ip_address" property="destIpAddress" jdbcType="VARCHAR" />
|
||||
<result column="port_pattern" property="portPattern" jdbcType="INTEGER" />
|
||||
@@ -236,8 +235,7 @@
|
||||
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
|
||||
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
|
||||
<result column="ip_type" property="ipType" jdbcType="INTEGER" />
|
||||
<result column="src_ip_pattern" property="srcIpPattern" jdbcType="INTEGER" />
|
||||
<result column="dest_ip_pattern" property="destIpPattern" jdbcType="INTEGER" />
|
||||
<result column="ip_pattern" property="ipPattern" jdbcType="INTEGER" />
|
||||
<result column="dest_ip_address" property="destIpAddress" jdbcType="VARCHAR" />
|
||||
<result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" />
|
||||
<result column="dest_port" property="destPort" jdbcType="VARCHAR" />
|
||||
@@ -396,7 +394,7 @@
|
||||
r.CREATOR_ID,r.CREATE_TIME,r.EDITOR_ID,r.EDIT_TIME,r.AUDITOR_ID,r.AUDIT_TIME,
|
||||
r.SERVICE_ID,r.REQUEST_ID,r.COMPILE_ID,r.IS_AREA_EFFECTIVE,r.CLASSIFY,
|
||||
r.ATTRIBUTE,r.LABLE,AREA_EFFECTIVE_IDS,r.RATELIMIT,r.FUNCTION_ID,r.CFG_TYPE,r.CFG_REGION_CODE,
|
||||
r.IP_TYPE, r.SRC_IP_PATTERN,r.DEST_IP_PATTERN, r.SRC_IP_ADDRESS,r.DEST_IP_ADDRESS, r.SRC_PORT_PATTERN,r.DEST_PORT_PATTERN,r.SRC_PORT,DEST_PORT,
|
||||
r.IP_TYPE, r.IP_PATTERN, r.SRC_IP_ADDRESS,r.DEST_IP_ADDRESS, r.PORT_PATTERN,r.SRC_PORT,DEST_PORT,
|
||||
r.DIRECTION,r.PROTOCOL,r.DO_LOG,r.USER_REGION1,r.USER_REGION2,r.USER_REGION3,r.USER_REGION4,r.USER_REGION5
|
||||
</sql>
|
||||
|
||||
@@ -463,7 +461,7 @@
|
||||
</sql>
|
||||
|
||||
<sql id="IpCfg_Column" >
|
||||
a.cfg_id,a.cfg_desc,a.ip_type,a.src_ip_address,a.src_ip_pattern,a.dest_ip_pattern,a.src_port_pattern,a.dest_port_pattern,a.src_port
|
||||
a.cfg_id,a.cfg_desc,a.ip_type,a.src_ip_address,a.ip_pattern,a.port_pattern,a.src_port
|
||||
,a.protocol,a.protocol_id,a.direction,a.cfg_type,a.action,a.dest_port,a.dest_ip_address
|
||||
,a.is_valid,a.is_audit,a.creator_id,a.create_time,a.editor_id
|
||||
,a.edit_time,a.auditor_id,a.audit_time,a.service_id,a.request_id,
|
||||
@@ -889,11 +887,8 @@
|
||||
<if test="ipType != null">
|
||||
AND r.IP_TYPE=#{ipType,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="srcIpPattern != null">
|
||||
AND r.src_ip_pattern=#{srcIpPattern,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="destIpPattern != null">
|
||||
AND r.dest_ip_pattern=#{destIpPattern,jdbcType=INTEGER}
|
||||
<if test="ipPattern != null">
|
||||
AND r.IP_PATTERN=#{ipPattern,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="srcIpAddress != null and srcIpAddress != ''">
|
||||
AND r.SRC_IP_ADDRESS=#{srcIpAddress,jdbcType=VARCHAR}
|
||||
@@ -901,11 +896,8 @@
|
||||
<if test="destIpAddress != null and destIpAddress != ''">
|
||||
AND r.DEST_IP_ADDRESS=#{destIpAddress,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="srcPortPattern != null">
|
||||
AND r.src_port_pattern=#{srcPortPattern,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="destPortPattern != null">
|
||||
AND r.dest_port_pattern=#{destPortPattern,jdbcType=INTEGER}
|
||||
<if test="portPattern != null">
|
||||
AND r.PORT_PATTERN=#{portPattern,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="srcPort != null and srcPort !=''">
|
||||
AND r.SRC_PORT=#{srcPort,jdbcType=VARCHAR}
|
||||
@@ -1831,12 +1823,12 @@
|
||||
CREATOR_ID,CREATE_TIME,EDITOR_ID,EDIT_TIME,AUDITOR_ID,AUDIT_TIME,
|
||||
SERVICE_ID,REQUEST_ID,COMPILE_ID,IS_AREA_EFFECTIVE,CLASSIFY,
|
||||
ATTRIBUTE,LABLE,AREA_EFFECTIVE_IDS,RATELIMIT,FUNCTION_ID,CFG_TYPE,CFG_REGION_CODE,
|
||||
IP_TYPE,SRC_IP_PATTERN,DEST_IP_PATTERN, SRC_IP_ADDRESS,DEST_IP_ADDRESS,SRC_PORT_PATTERN,DEST_PORT_PATTERN,SRC_PORT,DEST_PORT,
|
||||
IP_TYPE, IP_PATTERN, SRC_IP_ADDRESS,DEST_IP_ADDRESS, PORT_PATTERN,SRC_PORT,DEST_PORT,
|
||||
DIRECTION,PROTOCOL,DO_LOG,user_region1,user_region2,user_region3,user_region4,user_region5
|
||||
)values (
|
||||
<include refid="AppCommonCfg_Value_List" />,
|
||||
#{ipType,jdbcType=INTEGER}, #{srcIpPattern,jdbcType=INTEGER},#{destIpPattern,jdbcType=INTEGER},#{srcIpAddress,jdbcType=VARCHAR},#{destIpAddress,jdbcType=VARCHAR},
|
||||
#{srcPortPattern,jdbcType=INTEGER},#{destPortPattern,jdbcType=INTEGER},#{srcPort,jdbcType=VARCHAR},#{destPort,jdbcType=VARCHAR},#{direction,jdbcType=INTEGER},
|
||||
#{ipType,jdbcType=INTEGER}, #{ipPattern,jdbcType=INTEGER},#{srcIpAddress,jdbcType=VARCHAR},#{destIpAddress,jdbcType=VARCHAR},
|
||||
#{portPattern,jdbcType=INTEGER},#{srcPort,jdbcType=VARCHAR},#{destPort,jdbcType=VARCHAR},#{direction,jdbcType=INTEGER},
|
||||
#{protocol,jdbcType=INTEGER},#{doLog,jdbcType=INTEGER},#{userRegion1,jdbcType=VARCHAR},#{userRegion2,jdbcType=VARCHAR}
|
||||
,#{userRegion3,jdbcType=VARCHAR},#{userRegion4,jdbcType=VARCHAR},#{userRegion5,jdbcType=VARCHAR}
|
||||
)
|
||||
@@ -1847,12 +1839,12 @@
|
||||
CREATOR_ID,CREATE_TIME,EDITOR_ID,EDIT_TIME,AUDITOR_ID,AUDIT_TIME,
|
||||
SERVICE_ID,REQUEST_ID,COMPILE_ID,IS_AREA_EFFECTIVE,CLASSIFY,
|
||||
ATTRIBUTE,LABLE,AREA_EFFECTIVE_IDS,RATELIMIT,FUNCTION_ID,CFG_TYPE,CFG_REGION_CODE,
|
||||
IP_TYPE,SRC_IP_PATTERN,DEST_IP_PATTERN, SRC_IP_ADDRESS,DEST_IP_ADDRESS,SRC_PORT_PATTERN,DEST_PORT_PATTERN,SRC_PORT,DEST_PORT,
|
||||
IP_TYPE, IP_PATTERN, SRC_IP_ADDRESS,DEST_IP_ADDRESS, PORT_PATTERN,SRC_PORT,DEST_PORT,
|
||||
DIRECTION,PROTOCOL,DO_LOG,user_region1,user_region2,user_region3,user_region4,user_region5
|
||||
)values (
|
||||
<include refid="AppCommonCfg_Value_List" />,
|
||||
#{ipType,jdbcType=INTEGER}, #{srcIpPattern,jdbcType=INTEGER},#{destIpPattern,jdbcType=INTEGER},#{srcIpAddress,jdbcType=VARCHAR},#{destIpAddress,jdbcType=VARCHAR},
|
||||
#{srcPortPattern,jdbcType=INTEGER},#{destPortPattern,jdbcType=INTEGER},#{srcPort,jdbcType=VARCHAR},#{destPort,jdbcType=VARCHAR},#{direction,jdbcType=INTEGER},
|
||||
#{ipType,jdbcType=INTEGER}, #{ipPattern,jdbcType=INTEGER},#{srcIpAddress,jdbcType=VARCHAR},#{destIpAddress,jdbcType=VARCHAR},
|
||||
#{portPattern,jdbcType=INTEGER},#{srcPort,jdbcType=VARCHAR},#{destPort,jdbcType=VARCHAR},#{direction,jdbcType=INTEGER},
|
||||
#{protocol,jdbcType=INTEGER},#{doLog,jdbcType=INTEGER},#{userRegion1,jdbcType=VARCHAR},#{userRegion2,jdbcType=VARCHAR}
|
||||
,#{userRegion3,jdbcType=VARCHAR},#{userRegion4,jdbcType=VARCHAR},#{userRegion5,jdbcType=VARCHAR}
|
||||
)
|
||||
@@ -1863,7 +1855,7 @@
|
||||
CREATOR_ID,CREATE_TIME,EDITOR_ID,EDIT_TIME,AUDITOR_ID,AUDIT_TIME,
|
||||
SERVICE_ID,REQUEST_ID,COMPILE_ID,IS_AREA_EFFECTIVE,CLASSIFY,
|
||||
ATTRIBUTE,LABLE,AREA_EFFECTIVE_IDS,RATELIMIT,FUNCTION_ID,CFG_TYPE,CFG_REGION_CODE,
|
||||
IP_TYPE,SRC_IP_PATTERN,DEST_IP_PATTERN, SRC_IP_ADDRESS,DEST_IP_ADDRESS,SRC_PORT_PATTERN,DEST_PORT_PATTERN,SRC_PORT,DEST_PORT,
|
||||
IP_TYPE, IP_PATTERN, SRC_IP_ADDRESS,DEST_IP_ADDRESS, PORT_PATTERN,SRC_PORT,DEST_PORT,
|
||||
DIRECTION,PROTOCOL,DO_LOG,user_region1,user_region2,user_region3,user_region4,user_region5
|
||||
)values
|
||||
<foreach collection ="list" item="appIp" separator =",">
|
||||
@@ -1876,10 +1868,9 @@
|
||||
#{appIp.requestId,jdbcType=INTEGER},#{appIp.compileId,jdbcType=INTEGER},#{appIp.isAreaEffective,jdbcType=INTEGER},
|
||||
#{appIp.classify,jdbcType=VARCHAR},#{appIp.attribute,jdbcType=VARCHAR},#{appIp.lable,jdbcType=VARCHAR},
|
||||
#{appIp.areaEffectiveIds,jdbcType=VARCHAR},#{appIp.ratelimit,jdbcType=VARCHAR},#{appIp.functionId,jdbcType=INTEGER},
|
||||
#{appIp.cfgType,jdbcType=VARCHAR},#{appIp.cfgRegionCode,jdbcType=INTEGER},#{appIp.ipType,jdbcType=INTEGER},
|
||||
#{appIp.srcIpPattern,jdbcType=INTEGER},#{appIp.destIpPattern,jdbcType=INTEGER},#{appIp.srcIpAddress,jdbcType=VARCHAR},
|
||||
#{appIp.destIpAddress,jdbcType=VARCHAR},#{appIp.srcPortPattern,jdbcType=INTEGER},#{appIp.destPortPattern,jdbcType=INTEGER},
|
||||
#{appIp.srcPort,jdbcType=VARCHAR},#{appIp.destPort,jdbcType=VARCHAR},#{appIp.direction,jdbcType=INTEGER},
|
||||
#{appIp.cfgType,jdbcType=VARCHAR},#{appIp.cfgRegionCode,jdbcType=INTEGER},
|
||||
#{appIp.ipType,jdbcType=INTEGER}, #{appIp.ipPattern,jdbcType=INTEGER},#{appIp.srcIpAddress,jdbcType=VARCHAR},#{appIp.destIpAddress,jdbcType=VARCHAR},
|
||||
#{appIp.portPattern,jdbcType=INTEGER},#{appIp.srcPort,jdbcType=VARCHAR},#{appIp.destPort,jdbcType=VARCHAR},#{appIp.direction,jdbcType=INTEGER},
|
||||
#{appIp.protocol,jdbcType=INTEGER},#{appIp.doLog,jdbcType=INTEGER},#{appIp.userRegion1,jdbcType=VARCHAR},#{appIp.userRegion2,jdbcType=VARCHAR}
|
||||
,#{appIp.userRegion3,jdbcType=VARCHAR},#{appIp.userRegion4,jdbcType=VARCHAR},#{appIp.userRegion5,jdbcType=VARCHAR}
|
||||
)
|
||||
@@ -2066,7 +2057,9 @@
|
||||
AREA_EFFECTIVE_IDS,
|
||||
function_id,
|
||||
ip_type,
|
||||
src_ip_address,SRC_IP_PATTERN,DEST_IP_PATTERN,SRC_PORT_PATTERN,DEST_PORT_PATTERN,
|
||||
src_ip_address,
|
||||
ip_pattern,
|
||||
port_pattern,
|
||||
src_port,
|
||||
protocol,
|
||||
protocol_id,
|
||||
@@ -2097,8 +2090,8 @@
|
||||
#{functionId,jdbcType=INTEGER},
|
||||
#{ipType,jdbcType=INTEGER},
|
||||
#{srcIpAddress,jdbcType=VARCHAR},
|
||||
#{srcIpPattern,jdbcType=INTEGER},#{destIpPattern,jdbcType=INTEGER},
|
||||
#{srcPortPattern,jdbcType=INTEGER},#{destPortPattern,jdbcType=INTEGER},
|
||||
#{ipPattern,jdbcType=INTEGER},
|
||||
#{portPattern,jdbcType=INTEGER},
|
||||
#{srcPort,jdbcType=VARCHAR},
|
||||
#{protocol,jdbcType=INTEGER},
|
||||
#{protocolId,jdbcType=INTEGER},
|
||||
@@ -2301,11 +2294,8 @@
|
||||
<if test="ipType != null" >
|
||||
IP_TYPE = #{ipType,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="srcIpPattern != null">
|
||||
SRC_IP_PATTERN=#{srcIpPattern,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="destIpPattern != null">
|
||||
DEST_IP_PATTERN=#{destIpPattern,jdbcType=INTEGER},
|
||||
<if test="ipPattern != null">
|
||||
IP_PATTERN=#{ipPattern,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="srcIpAddress != null and srcIpAddress != ''">
|
||||
SRC_IP_ADDRESS=#{srcIpAddress,jdbcType=VARCHAR},
|
||||
@@ -2313,11 +2303,8 @@
|
||||
<if test="destIpAddress != null and destIpAddress != ''">
|
||||
DEST_IP_ADDRESS=#{destIpAddress,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="srcPortPattern != null">
|
||||
SRC_PORT_PATTERN=#{srcPortPattern,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="destPortPattern != null">
|
||||
DEST_PORT_PATTERN=#{destPortPattern,jdbcType=INTEGER},
|
||||
<if test="portPattern != null">
|
||||
PORT_PATTERN=#{portPattern,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="srcPort != null and srcPort !=''">
|
||||
SRC_PORT=#{srcPort,jdbcType=VARCHAR},
|
||||
|
||||
@@ -42,8 +42,7 @@
|
||||
<result column="app_code" property="appCode" jdbcType="INTEGER" />
|
||||
<result column="behav_code" property="behavCode" jdbcType="INTEGER" />
|
||||
<result column="ip_type" property="ipType" jdbcType="INTEGER" />
|
||||
<result column="src_ip_pattern" property="srcIpPattern" jdbcType="INTEGER" />
|
||||
<result column="dest_ip_pattern" property="destIpPattern" jdbcType="INTEGER" />
|
||||
<result column="ip_pattern" property="ipPattern" jdbcType="INTEGER" />
|
||||
<result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" />
|
||||
<result column="dest_ip_address" property="destIpAddress" jdbcType="VARCHAR" />
|
||||
<result column="port_pattern" property="portPattern" jdbcType="INTEGER" />
|
||||
@@ -197,7 +196,7 @@
|
||||
r.CREATOR_ID,r.CREATE_TIME,r.EDITOR_ID,r.EDIT_TIME,r.AUDITOR_ID,r.AUDIT_TIME,
|
||||
r.SERVICE_ID,r.REQUEST_ID,r.COMPILE_ID,r.IS_AREA_EFFECTIVE,r.CLASSIFY,
|
||||
r.ATTRIBUTE,r.LABLE,AREA_EFFECTIVE_IDS,r.FUNCTION_ID,r.CFG_TYPE,r.CFG_REGION_CODE,
|
||||
r.IP_TYPE, r.src_ip_pattern,r.dest_ip_pattern, r.SRC_IP_ADDRESS,r.DEST_IP_ADDRESS, r.src_port_pattern,r.dest_port_pattern,r.SRC_PORT,DEST_PORT,
|
||||
r.IP_TYPE, r.IP_PATTERN, r.SRC_IP_ADDRESS,r.DEST_IP_ADDRESS, r.PORT_PATTERN,r.SRC_PORT,DEST_PORT,
|
||||
r.DIRECTION,r.PROTOCOL,r.DO_LOG,r.USER_REGION1,r.USER_REGION2,r.USER_REGION3,r.USER_REGION4,r.USER_REGION5
|
||||
</sql>
|
||||
|
||||
@@ -541,13 +540,13 @@
|
||||
CREATOR_ID,CREATE_TIME,EDITOR_ID,EDIT_TIME,AUDITOR_ID,AUDIT_TIME,
|
||||
SERVICE_ID,REQUEST_ID,COMPILE_ID,IS_AREA_EFFECTIVE,CLASSIFY,
|
||||
ATTRIBUTE,LABLE,AREA_EFFECTIVE_IDS,FUNCTION_ID,CFG_TYPE,CFG_REGION_CODE,
|
||||
IP_TYPE,SRC_IP_PATTERN,DEST_IP_PATTERN, SRC_IP_ADDRESS,DEST_IP_ADDRESS,SRC_PORT_PATTERN,DEST_PORT_PATTERN,SRC_PORT,DEST_PORT,
|
||||
IP_TYPE, IP_PATTERN, SRC_IP_ADDRESS,DEST_IP_ADDRESS, PORT_PATTERN,SRC_PORT,DEST_PORT,
|
||||
DIRECTION,PROTOCOL,DO_LOG,user_region1,user_region2,user_region3,user_region4,user_region5
|
||||
)values (
|
||||
<include refid="AppCommonCfg_Value_List" />,
|
||||
#{cfgType,jdbcType=VARCHAR},#{cfgRegionCode,jdbcType=INTEGER},
|
||||
#{ipType,jdbcType=INTEGER}, #{srcIpPattern,jdbcType=INTEGER},#{destIpPattern,jdbcType=INTEGER},#{srcIpAddress,jdbcType=VARCHAR},#{destIpAddress,jdbcType=VARCHAR},
|
||||
#{srcPortPattern,jdbcType=INTEGER},#{destPortPattern,jdbcType=INTEGER},#{srcPort,jdbcType=VARCHAR},#{destPort,jdbcType=VARCHAR},#{direction,jdbcType=INTEGER},
|
||||
#{ipType,jdbcType=INTEGER}, #{ipPattern,jdbcType=INTEGER},#{srcIpAddress,jdbcType=VARCHAR},#{destIpAddress,jdbcType=VARCHAR},
|
||||
#{portPattern,jdbcType=INTEGER},#{srcPort,jdbcType=VARCHAR},#{destPort,jdbcType=VARCHAR},#{direction,jdbcType=INTEGER},
|
||||
#{protocol,jdbcType=INTEGER},#{doLog,jdbcType=INTEGER},#{userRegion1,jdbcType=VARCHAR},#{userRegion2,jdbcType=VARCHAR}
|
||||
,#{userRegion3,jdbcType=VARCHAR},#{userRegion4,jdbcType=VARCHAR},#{userRegion5,jdbcType=VARCHAR}
|
||||
)
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.nis.web.dao.configuration.AreaIpCfgDao" >
|
||||
<resultMap id="AreaIpMap" type="com.nis.domain.configuration.AreaIpCfg" >
|
||||
<resultMap id="BaseIpMap" type="com.nis.domain.configuration.AreaIpCfg" >
|
||||
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
|
||||
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
|
||||
<result column="cfg_type" property="cfgType" jdbcType="VARCHAR" />
|
||||
<result column="cfg_region_code" property="cfgRegionCode" jdbcType="INTEGER" />
|
||||
<result column="ip_type" property="ipType" jdbcType="INTEGER" />
|
||||
<result column="src_ip_pattern" property="srcIpPattern" jdbcType="INTEGER" />
|
||||
<result column="dest_ip_pattern" property="destIpPattern" jdbcType="INTEGER" />
|
||||
<result column="ip_pattern" property="ipPattern" jdbcType="INTEGER" />
|
||||
<result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" />
|
||||
<result column="dest_ip_address" property="destIpAddress" jdbcType="VARCHAR" />
|
||||
<result column="port_pattern" property="portPattern" jdbcType="INTEGER" />
|
||||
@@ -37,13 +36,13 @@
|
||||
<result column="function_id" property="functionId" jdbcType="INTEGER" />
|
||||
</resultMap>
|
||||
<sql id="AreaIpCfg_Column_List_with_id" >
|
||||
CFG_ID,CFG_DESC,CFG_REGION_CODE,CFG_TYPE, IP_TYPE,SRC_IP_PATTERN,DEST_IP_PATTERN, SRC_IP_ADDRESS,DEST_IP_ADDRESS,SRC_PORT_PATTERN,DEST_PORT_PATTERN,SRC_PORT,
|
||||
CFG_ID,CFG_DESC,CFG_REGION_CODE,CFG_TYPE, IP_TYPE, IP_PATTERN, SRC_IP_ADDRESS,DEST_IP_ADDRESS, PORT_PATTERN,SRC_PORT,
|
||||
DEST_PORT,DIRECTION,PROTOCOL,PROTOCOL_ID,ACTION,IS_VALID,IS_AUDIT,
|
||||
CREATOR_ID,CREATE_TIME,EDITOR_ID,EDIT_TIME,AUDITOR_ID,AUDIT_TIME,
|
||||
SERVICE_ID,REQUEST_ID,COMPILE_ID,IS_AREA_EFFECTIVE,CLASSIFY,
|
||||
ATTRIBUTE,LABLE,AREA_EFFECTIVE_IDS,FUNCTION_ID
|
||||
</sql>
|
||||
<select id="getByCompileId" resultMap="AreaIpMap" >
|
||||
<select id="getByCompileId" resultMap="BaseIpMap" >
|
||||
SELECT
|
||||
<include refid="AreaIpCfg_Column_List_with_id" />
|
||||
FROM area_ip_cfg
|
||||
@@ -77,7 +76,9 @@
|
||||
AREA_EFFECTIVE_IDS,
|
||||
function_id,
|
||||
ip_type,
|
||||
src_ip_address,SRC_IP_PATTERN,DEST_IP_PATTERN,SRC_PORT_PATTERN,DEST_PORT_PATTERN,
|
||||
src_ip_address,
|
||||
ip_pattern,
|
||||
port_pattern,
|
||||
src_port,
|
||||
protocol,
|
||||
protocol_id,
|
||||
@@ -108,8 +109,8 @@
|
||||
#{functionId,jdbcType=INTEGER},
|
||||
#{ipType,jdbcType=INTEGER},
|
||||
#{srcIpAddress,jdbcType=VARCHAR},
|
||||
#{srcIpPattern,jdbcType=INTEGER},#{destIpPattern,jdbcType=INTEGER},
|
||||
#{srcPortPattern,jdbcType=INTEGER},#{destPortPattern,jdbcType=INTEGER},
|
||||
#{ipPattern,jdbcType=INTEGER},
|
||||
#{portPattern,jdbcType=INTEGER},
|
||||
#{srcPort,jdbcType=VARCHAR},
|
||||
#{protocol,jdbcType=INTEGER},
|
||||
#{protocolId,jdbcType=INTEGER},
|
||||
@@ -146,7 +147,9 @@
|
||||
AREA_EFFECTIVE_IDS,
|
||||
function_id,
|
||||
ip_type,
|
||||
src_ip_address,SRC_IP_PATTERN,DEST_IP_PATTERN,SRC_PORT_PATTERN,DEST_PORT_PATTERN,
|
||||
src_ip_address,
|
||||
ip_pattern,
|
||||
port_pattern,
|
||||
src_port,
|
||||
protocol,
|
||||
protocol_id,
|
||||
@@ -177,8 +180,8 @@
|
||||
#{functionId,jdbcType=INTEGER},
|
||||
#{ipType,jdbcType=INTEGER},
|
||||
#{srcIpAddress,jdbcType=VARCHAR},
|
||||
#{srcIpPattern,jdbcType=INTEGER},#{destIpPattern,jdbcType=INTEGER},
|
||||
#{srcPortPattern,jdbcType=INTEGER},#{destPortPattern,jdbcType=INTEGER},
|
||||
#{ipPattern,jdbcType=INTEGER},
|
||||
#{portPattern,jdbcType=INTEGER},
|
||||
#{srcPort,jdbcType=VARCHAR},
|
||||
#{protocol,jdbcType=INTEGER},
|
||||
#{protocolId,jdbcType=INTEGER},
|
||||
@@ -252,17 +255,11 @@
|
||||
<if test="srcIpAddress != null and srcIpAddress != ''" >
|
||||
src_ip_address = #{srcIpAddress,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="srcIpPattern != null" >
|
||||
src_ip_pattern = #{srcIpPattern,jdbcType=INTEGER},
|
||||
<if test="ipPattern != null" >
|
||||
ip_pattern = #{ipPattern,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="destIpPattern != null" >
|
||||
dest_ip_pattern = #{destIpPattern,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="srcPortPattern != null" >
|
||||
src_port_pattern = #{srcPortPattern,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="destPortPattern != null" >
|
||||
dest_port_pattern = #{destPortPattern,jdbcType=INTEGER},
|
||||
<if test="portPattern != null" >
|
||||
port_pattern = #{portPattern,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="srcPort != null and srcPort != ''" >
|
||||
src_port = #{srcPort,jdbcType=VARCHAR},
|
||||
|
||||
@@ -30,8 +30,7 @@
|
||||
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
|
||||
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
|
||||
<result column="ip_type" property="ipType" jdbcType="INTEGER" />
|
||||
<result column="src_ip_pattern" property="srcIpPattern" jdbcType="INTEGER" />
|
||||
<result column="dest_ip_pattern" property="destIpPattern" jdbcType="INTEGER" />
|
||||
<result column="ip_pattern" property="ipPattern" jdbcType="INTEGER" />
|
||||
<result column="dest_ip_address" property="destIpAddress" jdbcType="VARCHAR" />
|
||||
<result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" />
|
||||
<result column="dest_port" property="destPort" jdbcType="VARCHAR" />
|
||||
@@ -95,8 +94,7 @@
|
||||
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
|
||||
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
|
||||
<result column="ip_type" property="ipType" jdbcType="INTEGER" />
|
||||
<result column="src_ip_pattern" property="srcIpPattern" jdbcType="INTEGER" />
|
||||
<result column="dest_ip_pattern" property="destIpPattern" jdbcType="INTEGER" />
|
||||
<result column="ip_pattern" property="ipPattern" jdbcType="INTEGER" />
|
||||
<result column="dest_ip_address" property="destIpAddress" jdbcType="VARCHAR" />
|
||||
<result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" />
|
||||
<result column="dest_port" property="destPort" jdbcType="VARCHAR" />
|
||||
@@ -195,8 +193,7 @@
|
||||
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
|
||||
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
|
||||
<result column="ip_type" property="ipType" jdbcType="INTEGER" />
|
||||
<result column="src_ip_pattern" property="srcIpPattern" jdbcType="INTEGER" />
|
||||
<result column="dest_ip_pattern" property="destIpPattern" jdbcType="INTEGER" />
|
||||
<result column="ip_pattern" property="ipPattern" jdbcType="INTEGER" />
|
||||
<result column="dest_ip_address" property="destIpAddress" jdbcType="VARCHAR" />
|
||||
<result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" />
|
||||
<result column="dest_port" property="destPort" jdbcType="VARCHAR" />
|
||||
@@ -227,7 +224,7 @@
|
||||
<result column="cfg_type" property="cfgType" jdbcType="VARCHAR" />
|
||||
</resultMap>
|
||||
<sql id="IpCfg_Column" >
|
||||
a.cfg_id,a.cfg_desc,a.ip_type,a.src_ip_address,a.src_ip_pattern,a.dest_ip_pattern,a.src_port_pattern,a.dest_port_pattern,a.src_port
|
||||
a.cfg_id,a.cfg_desc,a.ip_type,a.src_ip_address,a.ip_pattern,a.port_pattern,a.src_port
|
||||
,a.protocol,a.protocol_id,a.direction,a.cfg_type,a.action,a.dest_port,a.dest_ip_address
|
||||
,a.is_valid,a.is_audit,a.creator_id,a.create_time,a.editor_id
|
||||
,a.edit_time,a.auditor_id,a.audit_time,a.service_id,a.request_id,
|
||||
@@ -241,7 +238,7 @@
|
||||
r.ATTRIBUTE,r.LABLE,r.AREA_EFFECTIVE_IDS,r.function_id,r.do_log,r.do_blacklist
|
||||
</sql>
|
||||
<sql id="AvVoipIp_Column" >
|
||||
r.cfg_id,r.cfg_desc,r.ip_type,r.src_ip_address,r.src_ip_pattern,r.dest_ip_pattern,r.src_port_pattern,r.dest_port_pattern,r.src_port
|
||||
r.cfg_id,r.cfg_desc,r.ip_type,r.src_ip_address,r.ip_pattern,r.port_pattern,r.src_port
|
||||
,r.protocol,r.protocol_id,r.direction,r.cfg_type,r.action,r.dest_port,r.dest_ip_address
|
||||
,r.is_valid,r.is_audit,r.creator_id,r.create_time,r.editor_id
|
||||
,r.edit_time,r.auditor_id,r.audit_time,r.service_id,r.request_id,
|
||||
@@ -255,7 +252,7 @@
|
||||
r.expr_type,r.match_method,r.is_hexbin,r.area_effective_ids,r.function_id,r.cfg_region_code
|
||||
</sql>
|
||||
<sql id="AvContIp_Column" >
|
||||
r.cfg_id,r.cfg_desc,r.ip_type,r.src_ip_address,r.src_ip_pattern,r.dest_ip_pattern,r.src_port_pattern,r.dest_port_pattern,r.src_port
|
||||
r.cfg_id,r.cfg_desc,r.ip_type,r.src_ip_address,r.ip_pattern,r.port_pattern,r.src_port
|
||||
,r.protocol,r.protocol_id,r.direction,r.cfg_type,r.action,r.dest_port,r.dest_ip_address
|
||||
,r.is_valid,r.is_audit,r.creator_id,r.create_time,r.editor_id
|
||||
,r.edit_time,r.auditor_id,r.audit_time,r.service_id,r.request_id,
|
||||
@@ -819,10 +816,8 @@
|
||||
function_id,
|
||||
ip_type,
|
||||
src_ip_address,
|
||||
src_ip_pattern,
|
||||
dest_ip_pattern,
|
||||
src_port_pattern,
|
||||
dest_port_pattern,
|
||||
ip_pattern,
|
||||
port_pattern,
|
||||
src_port,
|
||||
protocol,
|
||||
protocol_id,
|
||||
@@ -853,10 +848,8 @@
|
||||
#{functionId,jdbcType=INTEGER},
|
||||
#{ipType,jdbcType=INTEGER},
|
||||
#{srcIpAddress,jdbcType=VARCHAR},
|
||||
#{srcIpPattern,jdbcType=INTEGER},
|
||||
#{destIpPattern,jdbcType=INTEGER},
|
||||
#{srcPortPattern,jdbcType=INTEGER},
|
||||
#{destPortPattern,jdbcType=INTEGER},
|
||||
#{ipPattern,jdbcType=INTEGER},
|
||||
#{portPattern,jdbcType=INTEGER},
|
||||
#{srcPort,jdbcType=VARCHAR},
|
||||
#{protocol,jdbcType=INTEGER},
|
||||
#{protocolId,jdbcType=INTEGER},
|
||||
@@ -1060,7 +1053,9 @@
|
||||
AREA_EFFECTIVE_IDS,
|
||||
function_id,
|
||||
ip_type,
|
||||
src_ip_address,SRC_IP_PATTERN,DEST_IP_PATTERN,SRC_PORT_PATTERN,DEST_PORT_PATTERN,
|
||||
src_ip_address,
|
||||
ip_pattern,
|
||||
port_pattern,
|
||||
src_port,
|
||||
protocol,
|
||||
protocol_id,
|
||||
@@ -1091,8 +1086,8 @@
|
||||
#{functionId,jdbcType=INTEGER},
|
||||
#{ipType,jdbcType=INTEGER},
|
||||
#{srcIpAddress,jdbcType=VARCHAR},
|
||||
#{srcIpPattern,jdbcType=INTEGER},#{destIpPattern,jdbcType=INTEGER},
|
||||
#{srcPortPattern,jdbcType=INTEGER},#{destPortPattern,jdbcType=INTEGER},
|
||||
#{ipPattern,jdbcType=INTEGER},
|
||||
#{portPattern,jdbcType=INTEGER},
|
||||
#{srcPort,jdbcType=VARCHAR},
|
||||
#{protocol,jdbcType=INTEGER},
|
||||
#{protocolId,jdbcType=INTEGER},
|
||||
@@ -1242,17 +1237,11 @@
|
||||
<if test="voipIp != null and voipIp.srcIpAddress != null and voipIp.srcIpAddress != ''" >
|
||||
src_ip_address = #{voipIp.srcIpAddress,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="voipIp != null and voipIp.srcIpPattern != null" >
|
||||
src_ip_pattern = #{voipIp.srcIpPattern,jdbcType=INTEGER},
|
||||
<if test="voipIp != null and voipIp.ipPattern != null" >
|
||||
ip_pattern = #{voipIp.ipPattern,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="voipIp != null and voipIp.destIpPattern != null" >
|
||||
dest_ip_pattern = #{voipIp.destIpPattern,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="voipIp != null and voipIp.srcPortPattern != null" >
|
||||
src_port_pattern = #{voipIp.srcPortPattern,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="voipIp != null and voipIp.destPortPattern != null" >
|
||||
dest_port_pattern = #{voipIp.destPortPattern,jdbcType=INTEGER},
|
||||
<if test="voipIp != null and voipIp.portPattern != null" >
|
||||
port_pattern = #{voipIp.portPattern,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="voipIp != null and voipIp.srcPort != null and voipIp.srcPort != ''" >
|
||||
src_port = #{voipIp.srcPort,jdbcType=VARCHAR},
|
||||
@@ -1663,7 +1652,9 @@
|
||||
AREA_EFFECTIVE_IDS,
|
||||
function_id,
|
||||
ip_type,
|
||||
src_ip_address,SRC_IP_PATTERN,DEST_IP_PATTERN,SRC_PORT_PATTERN,DEST_PORT_PATTERN,
|
||||
src_ip_address,
|
||||
ip_pattern,
|
||||
port_pattern,
|
||||
src_port,
|
||||
protocol,
|
||||
protocol_id,
|
||||
@@ -1695,8 +1686,8 @@
|
||||
#{functionId,jdbcType=INTEGER},
|
||||
#{ipType,jdbcType=INTEGER},
|
||||
#{srcIpAddress,jdbcType=VARCHAR},
|
||||
#{srcIpPattern,jdbcType=INTEGER},#{destIpPattern,jdbcType=INTEGER},
|
||||
#{srcPortPattern,jdbcType=INTEGER},#{destPortPattern,jdbcType=INTEGER},
|
||||
#{ipPattern,jdbcType=INTEGER},
|
||||
#{portPattern,jdbcType=INTEGER},
|
||||
#{srcPort,jdbcType=VARCHAR},
|
||||
#{protocol,jdbcType=INTEGER},
|
||||
#{protocolId,jdbcType=INTEGER},
|
||||
@@ -1771,17 +1762,11 @@
|
||||
<if test="srcIpAddress != null and srcIpAddress != ''" >
|
||||
src_ip_address = #{srcIpAddress,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="srcIpPattern != null" >
|
||||
src_ip_pattern = #{srcIpPattern,jdbcType=INTEGER},
|
||||
<if test="ipPattern != null" >
|
||||
ip_pattern = #{ipPattern,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="destIpPattern != null" >
|
||||
dest_ip_pattern = #{destIpPattern,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="srcPortPattern != null" >
|
||||
src_port_pattern = #{srcPortPattern,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="destPortPattern != null" >
|
||||
dest_port_pattern = #{destPortPattern,jdbcType=INTEGER},
|
||||
<if test="portPattern != null" >
|
||||
port_pattern = #{portPattern,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="srcPort != null and srcPort != ''" >
|
||||
src_port = #{srcPort,jdbcType=VARCHAR},
|
||||
|
||||
@@ -30,8 +30,7 @@
|
||||
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
|
||||
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
|
||||
<result column="ip_type" property="ipType" jdbcType="INTEGER" />
|
||||
<result column="src_ip_pattern" property="srcIpPattern" jdbcType="INTEGER" />
|
||||
<result column="dest_ip_pattern" property="destIpPattern" jdbcType="INTEGER" />
|
||||
<result column="ip_pattern" property="ipPattern" jdbcType="INTEGER" />
|
||||
<result column="dest_ip_address" property="destIpAddress" jdbcType="VARCHAR" />
|
||||
<result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" />
|
||||
<result column="dest_port" property="destPort" jdbcType="VARCHAR" />
|
||||
@@ -163,7 +162,7 @@
|
||||
a.ATTRIBUTE,a.LABLE,a.AREA_EFFECTIVE_IDS,a.function_id,a.do_log,a.do_blacklist
|
||||
</sql>
|
||||
<sql id="IpCfg_Column" >
|
||||
a.cfg_id,a.cfg_desc,a.ip_type,a.src_ip_address,a.src_ip_pattern,a.dest_ip_pattern,a.src_port_pattern,a.dest_port_pattern,a.src_port
|
||||
a.cfg_id,a.cfg_desc,a.ip_type,a.src_ip_address,a.ip_pattern,a.port_pattern,a.src_port
|
||||
,a.protocol,a.protocol_id,a.direction,a.cfg_type,a.action,a.dest_port,a.dest_ip_address
|
||||
,a.is_valid,a.is_audit,a.creator_id,a.create_time,a.editor_id
|
||||
,a.edit_time,a.auditor_id,a.audit_time,a.service_id,a.request_id,
|
||||
@@ -433,7 +432,9 @@
|
||||
AREA_EFFECTIVE_IDS,
|
||||
function_id,
|
||||
ip_type,
|
||||
src_ip_address,SRC_IP_PATTERN,DEST_IP_PATTERN,SRC_PORT_PATTERN,DEST_PORT_PATTERN,
|
||||
src_ip_address,
|
||||
ip_pattern,
|
||||
port_pattern,
|
||||
src_port,
|
||||
protocol,
|
||||
protocol_id,
|
||||
@@ -464,8 +465,8 @@
|
||||
#{functionId,jdbcType=INTEGER},
|
||||
#{ipType,jdbcType=INTEGER},
|
||||
#{srcIpAddress,jdbcType=VARCHAR},
|
||||
#{srcIpPattern,jdbcType=INTEGER},#{destIpPattern,jdbcType=INTEGER},
|
||||
#{srcPortPattern,jdbcType=INTEGER},#{destPortPattern,jdbcType=INTEGER},
|
||||
#{ipPattern,jdbcType=INTEGER},
|
||||
#{portPattern,jdbcType=INTEGER},
|
||||
#{srcPort,jdbcType=VARCHAR},
|
||||
#{protocol,jdbcType=INTEGER},
|
||||
#{protocolId,jdbcType=INTEGER},
|
||||
|
||||
@@ -74,8 +74,7 @@
|
||||
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
|
||||
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
|
||||
<result column="ip_type" property="ipType" jdbcType="INTEGER" />
|
||||
<result column="src_ip_pattern" property="srcIpPattern" jdbcType="INTEGER" />
|
||||
<result column="dest_ip_pattern" property="destIpPattern" jdbcType="INTEGER" />
|
||||
<result column="ip_pattern" property="ipPattern" jdbcType="INTEGER" />
|
||||
<result column="dest_ip_address" property="destIpAddress" jdbcType="VARCHAR" />
|
||||
<result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" />
|
||||
<result column="dest_port" property="destPort" jdbcType="VARCHAR" />
|
||||
@@ -173,7 +172,7 @@
|
||||
a.do_blacklist
|
||||
</sql>
|
||||
<sql id="IpCfg_Column" >
|
||||
a.cfg_id,a.cfg_desc,a.ip_type,a.src_ip_address,a.src_ip_pattern,a.dest_ip_pattern,a.src_port_pattern,a.dest_port_pattern,a.src_port
|
||||
a.cfg_id,a.cfg_desc,a.ip_type,a.src_ip_address,a.ip_pattern,a.port_pattern,a.src_port
|
||||
,a.protocol,a.protocol_id,a.direction,a.cfg_type,a.action,a.dest_port,a.dest_ip_address
|
||||
,a.is_valid,a.is_audit,a.creator_id,a.create_time,a.editor_id
|
||||
,a.edit_time,a.auditor_id,a.audit_time,a.service_id,a.request_id,
|
||||
@@ -490,7 +489,9 @@
|
||||
AREA_EFFECTIVE_IDS,
|
||||
function_id,
|
||||
ip_type,
|
||||
src_ip_address,SRC_IP_PATTERN,DEST_IP_PATTERN,SRC_PORT_PATTERN,DEST_PORT_PATTERN,
|
||||
src_ip_address,
|
||||
ip_pattern,
|
||||
port_pattern,
|
||||
src_port,
|
||||
protocol,
|
||||
protocol_id,
|
||||
@@ -526,8 +527,8 @@
|
||||
#{functionId,jdbcType=INTEGER},
|
||||
#{ipType,jdbcType=INTEGER},
|
||||
#{srcIpAddress,jdbcType=VARCHAR},
|
||||
#{srcIpPattern,jdbcType=INTEGER},#{destIpPattern,jdbcType=INTEGER},
|
||||
#{srcPortPattern,jdbcType=INTEGER},#{destPortPattern,jdbcType=INTEGER},
|
||||
#{ipPattern,jdbcType=INTEGER},
|
||||
#{portPattern,jdbcType=INTEGER},
|
||||
#{srcPort,jdbcType=VARCHAR},
|
||||
#{protocol,jdbcType=INTEGER},
|
||||
#{protocolId,jdbcType=INTEGER},
|
||||
|
||||
@@ -80,8 +80,7 @@
|
||||
<result column="app_code" property="appCode" jdbcType="INTEGER" />
|
||||
<result column="behav_code" property="behavCode" jdbcType="INTEGER" />
|
||||
<result column="ip_type" property="ipType" jdbcType="INTEGER" />
|
||||
<result column="src_ip_pattern" property="srcIpPattern" jdbcType="INTEGER" />
|
||||
<result column="dest_ip_pattern" property="destIpPattern" jdbcType="INTEGER" />
|
||||
<result column="ip_pattern" property="ipPattern" jdbcType="INTEGER" />
|
||||
<result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" />
|
||||
<result column="dest_ip_address" property="destIpAddress" jdbcType="VARCHAR" />
|
||||
<result column="port_pattern" property="portPattern" jdbcType="INTEGER" />
|
||||
@@ -241,8 +240,7 @@
|
||||
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
|
||||
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
|
||||
<result column="ip_type" property="ipType" jdbcType="INTEGER" />
|
||||
<result column="src_ip_pattern" property="srcIpPattern" jdbcType="INTEGER" />
|
||||
<result column="dest_ip_pattern" property="destIpPattern" jdbcType="INTEGER" />
|
||||
<result column="ip_pattern" property="ipPattern" jdbcType="INTEGER" />
|
||||
<result column="dest_ip_address" property="destIpAddress" jdbcType="VARCHAR" />
|
||||
<result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" />
|
||||
<result column="dest_port" property="destPort" jdbcType="VARCHAR" />
|
||||
@@ -383,8 +381,7 @@
|
||||
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
|
||||
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
|
||||
<result column="ip_type" property="ipType" jdbcType="INTEGER" />
|
||||
<result column="src_ip_pattern" property="srcIpPattern" jdbcType="INTEGER" />
|
||||
<result column="dest_ip_pattern" property="destIpPattern" jdbcType="INTEGER" />
|
||||
<result column="ip_pattern" property="ipPattern" jdbcType="INTEGER" />
|
||||
<result column="dest_ip_address" property="destIpAddress" jdbcType="VARCHAR" />
|
||||
<result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" />
|
||||
<result column="dest_port" property="destPort" jdbcType="VARCHAR" />
|
||||
@@ -704,8 +701,7 @@
|
||||
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
|
||||
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
|
||||
<result column="ip_type" property="ipType" jdbcType="INTEGER" />
|
||||
<result column="src_ip_pattern" property="srcIpPattern" jdbcType="INTEGER" />
|
||||
<result column="dest_ip_pattern" property="destIpPattern" jdbcType="INTEGER" />
|
||||
<result column="ip_pattern" property="ipPattern" jdbcType="INTEGER" />
|
||||
<result column="dest_ip_address" property="destIpAddress" jdbcType="VARCHAR" />
|
||||
<result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" />
|
||||
<result column="dest_port" property="destPort" jdbcType="VARCHAR" />
|
||||
@@ -779,12 +775,12 @@
|
||||
<sql id="DdosIpCfg_Column" >
|
||||
a.cfg_id,a.cfg_desc,a.action,a.is_valid,a.is_audit,a.creator_id,a.audit_time,
|
||||
a.service_id,a.request_id,a.compile_id,a.is_area_effective,a.classify,a.attribute,a.lable,
|
||||
a.area_effective_ids,a.function_id,a.ip_type,a.src_ip_address,a.src_ip_pattern,a.dest_ip_pattern,a.src_port_pattern,a.dest_port_pattern,a.src_port
|
||||
a.area_effective_ids,a.function_id,a.ip_type,a.src_ip_address,a.ip_pattern,a.port_pattern,a.src_port
|
||||
,a.protocol,a.protocol_id,a.direction,a.dest_port,a.dest_ip_address,a.cfg_type,a.pps_threadshold,
|
||||
a.antiddos_protocol,a.bps_threadshold
|
||||
</sql>
|
||||
<sql id="IpCfg_Column" >
|
||||
a.ip_type,a.src_ip_address,a.src_ip_pattern,a.dest_ip_pattern,a.src_port_pattern,a.dest_port_pattern,a.src_port,
|
||||
a.ip_type,a.src_ip_address,a.ip_pattern,a.port_pattern,a.src_port,
|
||||
a.protocol,a.protocol_id,a.direction,a.dest_port,a.dest_ip_address,a.cfg_type,a.compile_id
|
||||
</sql>
|
||||
<sql id="IpCfg_AllColumn" >
|
||||
@@ -792,7 +788,7 @@
|
||||
a.service_id,a.request_id,a.compile_id,a.is_area_effective,a.classify,a.attribute,a.lable,
|
||||
a.area_effective_ids,a.function_id,a.do_log,a.dns_strategy_id,a.user_region1,a.user_region2,
|
||||
a.user_region3,a.user_region4,a.user_region5,
|
||||
a.ip_type,a.src_ip_address,a.src_ip_pattern,a.dest_ip_pattern,a.src_port_pattern,a.dest_port_pattern,a.src_port,
|
||||
a.ip_type,a.src_ip_address,a.ip_pattern,a.port_pattern,a.src_port,
|
||||
a.protocol,a.protocol_id,a.direction,a.dest_port,a.dest_ip_address,a.cfg_type
|
||||
</sql>
|
||||
<sql id="IpDropCfg_Column" >
|
||||
@@ -800,11 +796,11 @@
|
||||
a.service_id,a.request_id,a.compile_id,a.is_area_effective,a.classify,a.attribute,a.lable,
|
||||
a.area_effective_ids,a.function_id,a.user_region1,a.user_region2,
|
||||
a.user_region3,a.user_region4,a.user_region5,
|
||||
a.ip_type,a.src_ip_address,a.src_ip_pattern,a.dest_ip_pattern,a.src_port_pattern,a.dest_port_pattern,a.src_port,
|
||||
a.ip_type,a.src_ip_address,a.ip_pattern,a.port_pattern,a.src_port,
|
||||
a.protocol,a.protocol_id,a.direction,a.dest_port,a.dest_ip_address,a.cfg_type
|
||||
</sql>
|
||||
<sql id="AsnIpCfg_Column" >
|
||||
a.ip_type,a.src_ip_address,a.src_ip_pattern,a.dest_ip_pattern,a.src_port_pattern,a.dest_port_pattern,a.src_port
|
||||
a.ip_type,a.src_ip_address,a.ip_pattern,a.port_pattern,a.src_port
|
||||
,a.protocol,a.protocol_id,a.direction,a.dest_port,a.dest_ip_address,a.cfg_type,a.asn_ip_group,
|
||||
a.user_region1,a.region_id
|
||||
</sql>
|
||||
@@ -887,7 +883,7 @@
|
||||
,a.area_effective_ids,a.function_id,a.cfg_region_code,a.compile_id
|
||||
</sql>
|
||||
<sql id="DnsIpCfgColumns">
|
||||
a.cfg_id,a.cfg_desc,a.ip_type,a.src_ip_address,a.src_ip_pattern,a.dest_ip_pattern,a.src_port_pattern,a.dest_port_pattern,a.src_port
|
||||
a.cfg_id,a.cfg_desc,a.ip_type,a.src_ip_address,a.ip_pattern,a.port_pattern,a.src_port
|
||||
,a.protocol,a.protocol_id,a.direction,a.cfg_type,a.action,a.dest_port,a.dest_ip_address
|
||||
,a.is_valid,a.is_audit,a.creator_id,a.create_time,a.editor_id
|
||||
,a.edit_time,a.auditor_id,a.audit_time,a.service_id,a.request_id,
|
||||
@@ -911,7 +907,7 @@
|
||||
a.feature_table_type,a.app_code,a.spec_service_id,a.cfg_region_code
|
||||
</sql>
|
||||
<sql id="AppIpCfg_Column" >
|
||||
a.ip_type,a.src_ip_address,a.src_ip_pattern,a.dest_ip_pattern,a.src_port_pattern,a.dest_port_pattern,a.src_port
|
||||
a.ip_type,a.src_ip_address,a.ip_pattern,a.port_pattern,a.src_port
|
||||
,a.protocol,a.direction,a.dest_port,a.dest_ip_address,a.cfg_type,a.compile_id
|
||||
</sql>
|
||||
|
||||
@@ -932,7 +928,7 @@
|
||||
a.CREATOR_ID,a.CREATE_TIME,a.EDITOR_ID,a.EDIT_TIME,a.AUDITOR_ID,a.AUDIT_TIME,
|
||||
a.SERVICE_ID,a.REQUEST_ID,a.COMPILE_ID,a.IS_AREA_EFFECTIVE,a.CLASSIFY,
|
||||
a.ATTRIBUTE,a.LABLE,AREA_EFFECTIVE_IDS,a.RATELIMIT,a.FUNCTION_ID,a.CFG_TYPE,a.CFG_REGION_CODE,
|
||||
a.IP_TYPE, a.src_ip_pattern,a.dest_ip_pattern, a.SRC_IP_ADDRESS,a.DEST_IP_ADDRESS, a.src_port_pattern,a.dest_port_pattern,a.SRC_PORT,DEST_PORT,
|
||||
a.IP_TYPE, a.IP_PATTERN, a.SRC_IP_ADDRESS,a.DEST_IP_ADDRESS, a.PORT_PATTERN,a.SRC_PORT,DEST_PORT,
|
||||
a.DIRECTION,a.PROTOCOL,a.DO_LOG,a.USER_REGION1,a.USER_REGION2,a.USER_REGION3,a.USER_REGION4,a.USER_REGION5
|
||||
</sql>
|
||||
|
||||
@@ -1633,7 +1629,7 @@
|
||||
</select>
|
||||
<select id="getAsnIpList" resultType="com.nis.domain.basics.AsnIpCfg" parameterType="com.nis.domain.configuration.CfgIndexInfo">
|
||||
select
|
||||
a.cfg_id,a.cfg_desc,a.ip_type,a.src_ip_address,a.src_ip_pattern,a.dest_ip_pattern,a.src_port_pattern,a.dest_port_pattern,a.src_port
|
||||
a.cfg_id,a.cfg_desc,a.ip_type,a.src_ip_address,a.ip_pattern,a.port_pattern,a.src_port
|
||||
,a.protocol,a.protocol_id,a.direction,a.cfg_type,a.action,a.dest_port,a.dest_ip_address
|
||||
,a.is_valid,a.is_audit,a.creator_id,a.create_time,a.editor_id
|
||||
,a.edit_time,a.auditor_id,a.audit_time,a.service_id,a.request_id,
|
||||
|
||||
@@ -5,8 +5,7 @@
|
||||
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
|
||||
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
|
||||
<result column="ip_type" property="ipType" jdbcType="INTEGER" />
|
||||
<result column="src_ip_pattern" property="srcIpPattern" jdbcType="INTEGER" />
|
||||
<result column="dest_ip_pattern" property="destIpPattern" jdbcType="INTEGER" />
|
||||
<result column="ip_pattern" property="ipPattern" jdbcType="INTEGER" />
|
||||
<result column="dest_ip_address" property="destIpAddress" jdbcType="VARCHAR" />
|
||||
<result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" />
|
||||
<result column="dest_port" property="destPort" jdbcType="VARCHAR" />
|
||||
@@ -42,7 +41,7 @@
|
||||
</resultMap>
|
||||
|
||||
<sql id="columns">
|
||||
r.cfg_id,r.cfg_desc,r.ip_type,r.src_ip_address,r.src_ip_pattern,r.dest_ip_pattern,r.src_port_pattern,r.dest_port_pattern,r.src_port
|
||||
r.cfg_id,r.cfg_desc,r.ip_type,r.src_ip_address,r.ip_pattern,r.port_pattern,r.src_port
|
||||
,r.protocol,r.protocol_id,r.direction,r.cfg_type,r.action,r.dest_port,r.dest_ip_address
|
||||
,r.is_valid,r.is_audit,r.creator_id,r.create_time,r.editor_id
|
||||
,r.edit_time,r.auditor_id,r.audit_time,r.service_id,r.request_id,
|
||||
@@ -81,11 +80,8 @@
|
||||
<if test="ipType != null">
|
||||
AND r.IP_TYPE=#{ipType,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="srcIpPattern != null">
|
||||
AND r.src_ip_pattern=#{srcIpPattern,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="destIpPattern != null">
|
||||
AND r.dest_ip_pattern=#{destIpPattern,jdbcType=INTEGER}
|
||||
<if test="ipPattern != null">
|
||||
AND r.IP_PATTERN=#{ipPattern,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="srcIpAddress != null and srcIpAddress != ''">
|
||||
AND r.SRC_IP_ADDRESS=#{srcIpAddress,jdbcType=VARCHAR}
|
||||
@@ -93,11 +89,8 @@
|
||||
<if test="destIpAddress != null and destIpAddress != ''">
|
||||
AND r.DEST_IP_ADDRESS=#{destIpAddress,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="srcPortPattern != null">
|
||||
AND r.src_port_pattern=#{srcPortPattern,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="destPortPattern != null">
|
||||
AND r.dest_port_pattern=#{destPortPattern,jdbcType=INTEGER}
|
||||
<if test="portPattern != null">
|
||||
AND r.PORT_PATTERN=#{portPattern,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="srcPort != null and srcPort !=''">
|
||||
AND r.SRC_PORT=#{srcPort,jdbcType=VARCHAR}
|
||||
@@ -224,7 +217,9 @@
|
||||
AREA_EFFECTIVE_IDS,
|
||||
function_id,
|
||||
ip_type,
|
||||
src_ip_address,SRC_IP_PATTERN,DEST_IP_PATTERN,SRC_PORT_PATTERN,DEST_PORT_PATTERN,
|
||||
src_ip_address,
|
||||
ip_pattern,
|
||||
port_pattern,
|
||||
src_port,
|
||||
protocol,
|
||||
protocol_id,
|
||||
@@ -259,8 +254,8 @@
|
||||
#{functionId,jdbcType=INTEGER},
|
||||
#{ipType,jdbcType=INTEGER},
|
||||
#{srcIpAddress,jdbcType=VARCHAR},
|
||||
#{srcIpPattern,jdbcType=INTEGER},#{destIpPattern,jdbcType=INTEGER},
|
||||
#{srcPortPattern,jdbcType=INTEGER},#{destPortPattern,jdbcType=INTEGER},
|
||||
#{ipPattern,jdbcType=INTEGER},
|
||||
#{portPattern,jdbcType=INTEGER},
|
||||
#{srcPort,jdbcType=VARCHAR},
|
||||
#{protocol,jdbcType=INTEGER},
|
||||
#{protocolId,jdbcType=INTEGER},
|
||||
@@ -337,17 +332,11 @@
|
||||
<if test="srcIpAddress != null and srcIpAddress != ''" >
|
||||
src_ip_address = #{srcIpAddress,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="srcIpPattern != null" >
|
||||
src_ip_pattern = #{srcIpPattern,jdbcType=INTEGER},
|
||||
<if test="ipPattern != null" >
|
||||
ip_pattern = #{ipPattern,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="destIpPattern != null" >
|
||||
dest_ip_pattern = #{destIpPattern,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="srcPortPattern != null" >
|
||||
src_port_pattern = #{srcPortPattern,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="destPortPattern != null" >
|
||||
dest_port_pattern = #{destPortPattern,jdbcType=INTEGER},
|
||||
<if test="portPattern != null" >
|
||||
port_pattern = #{portPattern,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="srcPort != null and srcPort != ''" >
|
||||
src_port = #{srcPort,jdbcType=VARCHAR},
|
||||
|
||||
@@ -5,8 +5,7 @@
|
||||
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
|
||||
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
|
||||
<result column="ip_type" property="ipType" jdbcType="INTEGER" />
|
||||
<result column="src_ip_pattern" property="srcIpPattern" jdbcType="INTEGER" />
|
||||
<result column="dest_ip_pattern" property="destIpPattern" jdbcType="INTEGER" />
|
||||
<result column="ip_pattern" property="ipPattern" jdbcType="INTEGER" />
|
||||
<result column="dest_ip_address" property="destIpAddress" jdbcType="VARCHAR" />
|
||||
<result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" />
|
||||
<result column="dest_port" property="destPort" jdbcType="VARCHAR" />
|
||||
@@ -41,7 +40,7 @@
|
||||
</resultMap>
|
||||
|
||||
<sql id="columns">
|
||||
r.cfg_id,r.cfg_desc,r.ip_type,r.src_ip_address,r.src_ip_pattern,r.dest_ip_pattern,r.src_port_pattern,r.dest_port_pattern,r.src_port
|
||||
r.cfg_id,r.cfg_desc,r.ip_type,r.src_ip_address,r.ip_pattern,r.port_pattern,r.src_port
|
||||
,r.protocol,r.protocol_id,r.direction,r.cfg_type,r.action,r.dest_port,r.dest_ip_address
|
||||
,r.is_valid,r.is_audit,r.creator_id,r.create_time,r.editor_id
|
||||
,r.edit_time,r.auditor_id,r.audit_time,r.service_id,r.request_id,
|
||||
@@ -84,11 +83,8 @@
|
||||
<if test="ipType != null">
|
||||
AND r.IP_TYPE=#{ipType,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="srcIpPattern != null">
|
||||
AND r.src_ip_pattern=#{srcIpPattern,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="destIpPattern != null">
|
||||
AND r.dest_ip_pattern=#{destIpPattern,jdbcType=INTEGER}
|
||||
<if test="ipPattern != null">
|
||||
AND r.IP_PATTERN=#{ipPattern,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="srcIpAddress != null and srcIpAddress != ''">
|
||||
AND r.SRC_IP_ADDRESS=#{srcIpAddress,jdbcType=VARCHAR}
|
||||
@@ -96,11 +92,8 @@
|
||||
<if test="destIpAddress != null and destIpAddress != ''">
|
||||
AND r.DEST_IP_ADDRESS=#{destIpAddress,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="srcPortPattern != null">
|
||||
AND r.src_port_pattern=#{srcPortPattern,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="destPortPattern != null">
|
||||
AND r.dest_port_pattern=#{destPortPattern,jdbcType=INTEGER}
|
||||
<if test="portPattern != null">
|
||||
AND r.PORT_PATTERN=#{portPattern,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="srcPort != null and srcPort !=''">
|
||||
AND r.SRC_PORT=#{srcPort,jdbcType=VARCHAR}
|
||||
@@ -239,7 +232,9 @@
|
||||
AREA_EFFECTIVE_IDS,
|
||||
function_id,
|
||||
ip_type,
|
||||
src_ip_address,SRC_IP_PATTERN,DEST_IP_PATTERN,SRC_PORT_PATTERN,DEST_PORT_PATTERN,
|
||||
src_ip_address,
|
||||
ip_pattern,
|
||||
port_pattern,
|
||||
src_port,
|
||||
protocol,
|
||||
protocol_id,
|
||||
@@ -272,8 +267,8 @@
|
||||
#{functionId,jdbcType=INTEGER},
|
||||
#{ipType,jdbcType=INTEGER},
|
||||
#{srcIpAddress,jdbcType=VARCHAR},
|
||||
#{srcIpPattern,jdbcType=INTEGER},#{destIpPattern,jdbcType=INTEGER},
|
||||
#{srcPortPattern,jdbcType=INTEGER},#{destPortPattern,jdbcType=INTEGER},
|
||||
#{ipPattern,jdbcType=INTEGER},
|
||||
#{portPattern,jdbcType=INTEGER},
|
||||
#{srcPort,jdbcType=VARCHAR},
|
||||
#{protocol,jdbcType=INTEGER},
|
||||
#{protocolId,jdbcType=INTEGER},
|
||||
@@ -348,17 +343,11 @@
|
||||
<if test="srcIpAddress != null and srcIpAddress != ''" >
|
||||
src_ip_address = #{srcIpAddress,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="srcIpPattern != null" >
|
||||
src_ip_pattern = #{srcIpPattern,jdbcType=INTEGER},
|
||||
<if test="ipPattern != null" >
|
||||
ip_pattern = #{ipPattern,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="destIpPattern != null" >
|
||||
dest_ip_pattern = #{destIpPattern,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="srcPortPattern != null" >
|
||||
src_port_pattern = #{srcPortPattern,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="destPortPattern != null" >
|
||||
dest_port_pattern = #{destPortPattern,jdbcType=INTEGER},
|
||||
<if test="portPattern != null" >
|
||||
port_pattern = #{portPattern,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="srcPort != null and srcPort != ''" >
|
||||
src_port = #{srcPort,jdbcType=VARCHAR},
|
||||
|
||||
@@ -35,8 +35,7 @@
|
||||
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
|
||||
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
|
||||
<result column="ip_type" property="ipType" jdbcType="INTEGER" />
|
||||
<result column="src_ip_pattern" property="srcIpPattern" jdbcType="INTEGER" />
|
||||
<result column="dest_ip_pattern" property="destIpPattern" jdbcType="INTEGER" />
|
||||
<result column="ip_pattern" property="ipPattern" jdbcType="INTEGER" />
|
||||
<result column="dest_ip_address" property="destIpAddress" jdbcType="VARCHAR" />
|
||||
<result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" />
|
||||
<result column="dest_port" property="destPort" jdbcType="VARCHAR" />
|
||||
@@ -173,7 +172,7 @@
|
||||
a.do_blacklist
|
||||
</sql>
|
||||
<sql id="IpCfg_Column" >
|
||||
a.cfg_id,a.cfg_desc,a.ip_type,a.src_ip_address,a.src_ip_pattern,a.dest_ip_pattern,a.src_port_pattern,a.dest_port_pattern,a.src_port
|
||||
a.cfg_id,a.cfg_desc,a.ip_type,a.src_ip_address,a.ip_pattern,a.port_pattern,a.src_port
|
||||
,a.protocol,a.protocol_id,a.direction,a.cfg_type,a.action,a.dest_port,a.dest_ip_address
|
||||
,a.is_valid,a.is_audit,a.creator_id,a.create_time,a.editor_id
|
||||
,a.edit_time,a.auditor_id,a.audit_time,a.service_id,a.request_id,
|
||||
@@ -454,7 +453,9 @@
|
||||
AREA_EFFECTIVE_IDS,
|
||||
function_id,
|
||||
ip_type,
|
||||
src_ip_address,SRC_IP_PATTERN,DEST_IP_PATTERN,SRC_PORT_PATTERN,DEST_PORT_PATTERN,
|
||||
src_ip_address,
|
||||
ip_pattern,
|
||||
port_pattern,
|
||||
src_port,
|
||||
protocol,
|
||||
protocol_id,
|
||||
@@ -490,8 +491,8 @@
|
||||
#{functionId,jdbcType=INTEGER},
|
||||
#{ipType,jdbcType=INTEGER},
|
||||
#{srcIpAddress,jdbcType=VARCHAR},
|
||||
#{srcIpPattern,jdbcType=INTEGER},#{destIpPattern,jdbcType=INTEGER},
|
||||
#{srcPortPattern,jdbcType=INTEGER},#{destPortPattern,jdbcType=INTEGER},
|
||||
#{ipPattern,jdbcType=INTEGER},
|
||||
#{portPattern,jdbcType=INTEGER},
|
||||
#{srcPort,jdbcType=VARCHAR},
|
||||
#{protocol,jdbcType=INTEGER},
|
||||
#{protocolId,jdbcType=INTEGER},
|
||||
|
||||
@@ -1,15 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.nis.web.dao.configuration.IpCfgDao" >
|
||||
<!-- 基础 -->
|
||||
<resultMap id="BaseIpMap" type="com.nis.domain.configuration.BaseIpCfg" >
|
||||
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
|
||||
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
|
||||
<result column="cfg_type" property="cfgType" jdbcType="VARCHAR" />
|
||||
<result column="cfg_region_code" property="cfgRegionCode" jdbcType="INTEGER" />
|
||||
<result column="ip_type" property="ipType" jdbcType="INTEGER" />
|
||||
<result column="src_ip_pattern" property="srcIpPattern" jdbcType="INTEGER" />
|
||||
<result column="dest_ip_pattern" property="destIpPattern" jdbcType="INTEGER" />
|
||||
<result column="ip_pattern" property="ipPattern" jdbcType="INTEGER" />
|
||||
<result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" />
|
||||
<result column="dest_ip_address" property="destIpAddress" jdbcType="VARCHAR" />
|
||||
<result column="port_pattern" property="portPattern" jdbcType="INTEGER" />
|
||||
@@ -87,8 +85,7 @@
|
||||
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
|
||||
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
|
||||
<result column="ip_type" property="ipType" jdbcType="INTEGER" />
|
||||
<result column="src_ip_pattern" property="srcIpPattern" jdbcType="INTEGER" />
|
||||
<result column="dest_ip_pattern" property="destIpPattern" jdbcType="INTEGER" />
|
||||
<result column="ip_pattern" property="ipPattern" jdbcType="INTEGER" />
|
||||
<result column="dest_ip_address" property="destIpAddress" jdbcType="VARCHAR" />
|
||||
<result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" />
|
||||
<result column="dest_port" property="destPort" jdbcType="VARCHAR" />
|
||||
@@ -119,14 +116,14 @@
|
||||
<result column="cfg_type" property="cfgType" jdbcType="VARCHAR" />
|
||||
</resultMap>
|
||||
<sql id="BaseIpCfg_Column_List_with_id" >
|
||||
CFG_ID, CFG_DESC,CFG_REGION_CODE,CFG_TYPE, IP_TYPE,SRC_IP_PATTERN,DEST_IP_PATTERN, SRC_IP_ADDRESS,DEST_IP_ADDRESS,SRC_PORT_PATTERN,DEST_PORT_PATTERN,SRC_PORT,DEST_PORT,
|
||||
CFG_ID, CFG_DESC,CFG_REGION_CODE,CFG_TYPE, IP_TYPE, IP_PATTERN, SRC_IP_ADDRESS,DEST_IP_ADDRESS, PORT_PATTERN,SRC_PORT,DEST_PORT,
|
||||
DIRECTION,PROTOCOL,PROTOCOL_ID,ACTION,IS_VALID,IS_AUDIT,
|
||||
CREATOR_ID,CREATE_TIME,EDITOR_ID,EDIT_TIME,AUDITOR_ID,AUDIT_TIME,
|
||||
SERVICE_ID,REQUEST_ID,COMPILE_ID,IS_AREA_EFFECTIVE,CLASSIFY,
|
||||
ATTRIBUTE,LABLE,AREA_EFFECTIVE_IDS,FUNCTION_ID,RATELIMIT,DNS_STRATEGY_ID,IR_TYPE,USER_REGION1,USER_REGION2,USER_REGION3,USER_REGION4,USER_REGION5
|
||||
</sql>
|
||||
<sql id="BaseIpCfg_Column_List_with_id_name" >
|
||||
CFG_ID, CFG_DESC,CFG_REGION_CODE,CFG_TYPE, IP_TYPE,SRC_IP_PATTERN,DEST_IP_PATTERN, SRC_IP_ADDRESS,DEST_IP_ADDRESS,SRC_PORT_PATTERN,DEST_PORT_PATTERN,SRC_PORT,DEST_PORT,
|
||||
CFG_ID, CFG_DESC,CFG_REGION_CODE,CFG_TYPE, IP_TYPE, IP_PATTERN, SRC_IP_ADDRESS,DEST_IP_ADDRESS, PORT_PATTERN,SRC_PORT,DEST_PORT,
|
||||
DIRECTION,PROTOCOL,PROTOCOL_ID,ACTION,IS_VALID,IS_AUDIT,
|
||||
CREATOR_ID,CREATE_TIME,EDITOR_ID,EDIT_TIME,AUDITOR_ID,AUDIT_TIME,
|
||||
SERVICE_ID,REQUEST_ID,COMPILE_ID,IS_AREA_EFFECTIVE,CLASSIFY,
|
||||
@@ -136,8 +133,7 @@
|
||||
<choose>
|
||||
<when test="page !=null and page.alias != null and page.alias != ''">
|
||||
${page.alias}.CFG_ID as cfgId, ${page.alias}.CFG_DESC as cfgDesc,${page.alias}.CFG_REGION_CODE as cfgRegionCode,${page.alias}.CFG_TYPE as cfgType, ${page.alias}.IP_TYPE as ipType,
|
||||
${page.alias}.SRC_IP_PATTERN as srcIpPattern,${page.alias}.DEST_IP_PATTERN as destIpPattern, ${page.alias}.SRC_IP_ADDRESS as srcIpAddress, ${page.alias}.DEST_IP_ADDRESS as destIpAddress,
|
||||
${page.alias}.SRC_PORT_PATTERN as srcPortPattern,${page.alias}.DEST_PORT_PATTERN as destPortPattern,${page.alias}.SRC_PORT as srcPort,${page.alias}.DEST_PORT as destPort,
|
||||
${page.alias}.IP_PATTERN as ipPattern, ${page.alias}.SRC_IP_ADDRESS as srcIpAddress, ${page.alias}.DEST_IP_ADDRESS as destIpAddress, ${page.alias}.PORT_PATTERN as portPattern,${page.alias}.SRC_PORT as srcPort,${page.alias}.DEST_PORT as destPort,
|
||||
${page.alias}.DIRECTION as direction,${page.alias}.PROTOCOL as protocol,${page.alias}.PROTOCOL_ID as protocolId,${page.alias}.ACTION as action,${page.alias}.IS_VALID as isValid,${page.alias}.IS_AUDIT as isAudit,
|
||||
${page.alias}.CREATOR_ID as creatorId,${page.alias}.CREATE_TIME AS createTime,${page.alias}.EDITOR_ID as editorId,${page.alias}.EDIT_TIME AS editTime,${page.alias}.AUDITOR_ID as auditorId,${page.alias}.AUDIT_TIME AS auditTime,
|
||||
${page.alias}.SERVICE_ID as serviceId,${page.alias}.REQUEST_ID AS requestId,${page.alias}.COMPILE_ID AS compileId,${page.alias}.IS_AREA_EFFECTIVE as isAreaEffective,${page.alias}.classify,
|
||||
@@ -151,8 +147,7 @@
|
||||
</when>
|
||||
<otherwise>
|
||||
r.CFG_ID as cfgId, r.CFG_DESC as cfgDesc,r.CFG_REGION_CODE as cfgRegionCode,r.CFG_TYPE as cfgType, r.IP_TYPE as ipType,
|
||||
r.src_ip_pattern as srcIpPattern,r.dest_ip_pattern as destIpPattern, r.SRC_IP_ADDRESS as srcIpAddress, r.DEST_IP_ADDRESS as destIpAddress,
|
||||
r.src_port_pattern as srcPortPattern,r.dest_port_pattern as destPortPattern,r.SRC_PORT as srcPort,r.DEST_PORT as destPort,
|
||||
r.IP_PATTERN as ipPattern, r.SRC_IP_ADDRESS as srcIpAddress, r.DEST_IP_ADDRESS as destIpAddress, r.PORT_PATTERN as portPattern,r.SRC_PORT as srcPort,r.DEST_PORT as destPort,
|
||||
r.DIRECTION as direction,r.PROTOCOL as protocol,r.PROTOCOL_ID as protocolId,r.ACTION as action,r.IS_VALID as isValid,r.IS_AUDIT as isAudit,
|
||||
r.CREATOR_ID as creatorId,r.CREATE_TIME AS createTime,r.EDITOR_ID as editorId,r.EDIT_TIME AS editTime,r.AUDITOR_ID as auditorId,r.AUDIT_TIME AS auditTime,
|
||||
r.SERVICE_ID as serviceId,r.REQUEST_ID AS requestId,r.COMPILE_ID AS compileId,r.IS_AREA_EFFECTIVE as isAreaEffective,r.classify,
|
||||
@@ -168,7 +163,8 @@
|
||||
</sql>
|
||||
<sql id="BaseIpCfg_Column_List" >
|
||||
CFG_DESC,CFG_REGION_CODE,CFG_TYPE,
|
||||
IP_TYPE,SRC_IP_PATTERN,DEST_IP_PATTERN,SRC_IP_ADDRESS,DEST_IP_ADDRESS,SRC_PORT_PATTERN,DEST_PORT_PATTERN,SRC_PORT,DEST_PORT,DIRECTION,
|
||||
IP_TYPE,IP_PATTERN,SRC_IP_ADDRESS,DEST_IP_ADDRESS,
|
||||
PORT_PATTERN,SRC_PORT,DEST_PORT,DIRECTION,
|
||||
PROTOCOL,PROTOCOL_ID,ACTION,
|
||||
IS_VALID,IS_AUDIT,CREATOR_ID,
|
||||
CREATE_TIME,EDITOR_ID,EDIT_TIME,
|
||||
@@ -180,8 +176,8 @@
|
||||
</sql>
|
||||
<sql id="BaseIpCfg_Value_List" >
|
||||
#{cfgDesc,jdbcType=VARCHAR},#{cfgRegionCode,jdbcType=INTEGER},#{cfgType,jdbcType=VARCHAR},
|
||||
#{ipType,jdbcType=INTEGER}, #{srcIpPattern,jdbcType=INTEGER},#{destIpPattern,jdbcType=INTEGER},#{srcIpAddress,jdbcType=VARCHAR},#{destIpAddress,jdbcType=VARCHAR},
|
||||
#{srcPortPattern,jdbcType=INTEGER},#{destPortPattern,jdbcType=INTEGER},#{srcPort,jdbcType=VARCHAR},#{destPort,jdbcType=VARCHAR},#{direction,jdbcType=INTEGER},
|
||||
#{ipType,jdbcType=INTEGER}, #{ipPattern,jdbcType=INTEGER},#{srcIpAddress,jdbcType=VARCHAR},#{destIpAddress,jdbcType=VARCHAR},
|
||||
#{portPattern,jdbcType=INTEGER},#{srcPort,jdbcType=VARCHAR},#{destPort,jdbcType=VARCHAR},#{direction,jdbcType=INTEGER},
|
||||
#{protocol,jdbcType=INTEGER},#{protocolId,jdbcType=INTEGER},#{action,jdbcType=INTEGER},
|
||||
#{isValid,jdbcType=INTEGER},#{isAudit,jdbcType=INTEGER},#{creatorId,jdbcType=INTEGER},
|
||||
#{createTime,jdbcType=TIMESTAMP},#{editorId,jdbcType=INTEGER},#{editTime,jdbcType=TIMESTAMP},
|
||||
@@ -205,7 +201,7 @@
|
||||
a.user_region2,a.user_region3,a.user_region4,a.user_region5,a.do_log,a.do_blacklist
|
||||
</sql>
|
||||
<sql id="IpCfg_Column" >
|
||||
a.cfg_id,a.cfg_desc,a.ip_type,a.src_ip_address,a.src_ip_pattern,a.dest_ip_pattern,a.src_port_pattern,a.dest_port_pattern,a.src_port
|
||||
a.cfg_id,a.cfg_desc,a.ip_type,a.src_ip_address,a.ip_pattern,a.port_pattern,a.src_port
|
||||
,a.protocol,a.protocol_id,a.direction,a.cfg_type,a.action,a.dest_port,a.dest_ip_address
|
||||
,a.is_valid,a.is_audit,a.creator_id,a.create_time,a.editor_id
|
||||
,a.edit_time,a.auditor_id,a.audit_time,a.service_id,a.request_id,
|
||||
@@ -295,11 +291,8 @@
|
||||
<if test="ipType != null">
|
||||
AND ${page.alias}.IP_TYPE=#{ipType,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="srcIpPattern != null">
|
||||
AND ${page.alias}.SRC_IP_PATTERN=#{srcIpPattern,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="destIpPattern != null">
|
||||
AND ${page.alias}.DEST_IP_PATTERN=#{destIpPattern,jdbcType=INTEGER}
|
||||
<if test="ipPattern != null">
|
||||
AND ${page.alias}.IP_PATTERN=#{ipPattern,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="srcIpAddress != null and srcIpAddress != ''">
|
||||
AND ${page.alias}.SRC_IP_ADDRESS=#{srcIpAddress,jdbcType=VARCHAR}
|
||||
@@ -307,11 +300,8 @@
|
||||
<if test="destIpAddress != null and destIpAddress != ''">
|
||||
AND ${page.alias}.DEST_IP_ADDRESS=#{destIpAddress,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="srcPortPattern != null">
|
||||
AND ${page.alias}.SRC_PORT_PATTERN=#{srcPortPattern,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="destPortPattern != null">
|
||||
AND ${page.alias}.DEST_PORT_PATTERN=#{destPortPattern,jdbcType=INTEGER}
|
||||
<if test="portPattern != null">
|
||||
AND ${page.alias}.PORT_PATTERN=#{portPattern,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="srcPort != null and srcPort !=''">
|
||||
AND ${page.alias}.SRC_PORT=#{srcPort,jdbcType=VARCHAR}
|
||||
@@ -426,11 +416,8 @@
|
||||
<if test="ipType != null">
|
||||
AND r.IP_TYPE=#{ipType,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="srcIpPattern != null">
|
||||
AND r.src_ip_pattern=#{srcIpPattern,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="destIpPattern != null">
|
||||
AND r.dest_ip_pattern=#{destIpPattern,jdbcType=INTEGER}
|
||||
<if test="ipPattern != null">
|
||||
AND r.IP_PATTERN=#{ipPattern,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="srcIpAddress != null and srcIpAddress != ''">
|
||||
AND r.SRC_IP_ADDRESS=#{srcIpAddress,jdbcType=VARCHAR}
|
||||
@@ -438,11 +425,8 @@
|
||||
<if test="destIpAddress != null and destIpAddress != ''">
|
||||
AND r.DEST_IP_ADDRESS=#{destIpAddress,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="srcPortPattern != null">
|
||||
AND r.src_port_pattern=#{srcPortPattern,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="destPortPattern != null">
|
||||
AND r.dest_port_pattern=#{destPortPattern,jdbcType=INTEGER}
|
||||
<if test="portPattern != null">
|
||||
AND r.PORT_PATTERN=#{portPattern,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="srcPort != null and srcPort !=''">
|
||||
AND r.SRC_PORT=#{srcPort,jdbcType=VARCHAR}
|
||||
@@ -612,11 +596,8 @@
|
||||
<if test="ipType != null" >
|
||||
IP_TYPE = #{ipType,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="srcIpPattern != null">
|
||||
SRC_IP_PATTERN=#{srcIpPattern,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="destIpPattern != null">
|
||||
DEST_IP_PATTERN=#{destIpPattern,jdbcType=INTEGER},
|
||||
<if test="ipPattern != null">
|
||||
IP_PATTERN=#{ipPattern,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="srcIpAddress != null and srcIpAddress != ''">
|
||||
SRC_IP_ADDRESS=#{srcIpAddress,jdbcType=VARCHAR},
|
||||
@@ -625,7 +606,7 @@
|
||||
DEST_IP_ADDRESS=#{destIpAddress,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="portPattern != null">
|
||||
PORT_PATTERN=#{srcPortPattern,jdbcType=INTEGER},#{destPortPattern,jdbcType=INTEGER},
|
||||
PORT_PATTERN=#{portPattern,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="srcPort != null and srcPort !=''">
|
||||
SRC_PORT=#{srcPort,jdbcType=VARCHAR},
|
||||
@@ -763,8 +744,7 @@
|
||||
<select id="getListByCfgIdWithName" resultMap="BaseIpMapWithUser">
|
||||
select
|
||||
r.CFG_ID as cfgId, r.CFG_DESC as cfgDesc,r.CFG_REGION_CODE as cfgRegionCode,r.CFG_TYPE as cfgType, r.IP_TYPE as ipType,
|
||||
r.src_ip_pattern as srcIpPattern,r.dest_ip_pattern as destIpPattern, r.SRC_IP_ADDRESS as srcIpAddress, r.DEST_IP_ADDRESS as destIpAddress,
|
||||
r.src_port_pattern as srcPortPattern,r.dest_port_pattern as destPortPattern,r.SRC_PORT as srcPort,r.DEST_PORT as destPort,
|
||||
r.IP_PATTERN as ipPattern, r.SRC_IP_ADDRESS as srcIpAddress, r.DEST_IP_ADDRESS as destIpAddress, r.PORT_PATTERN as portPattern,r.SRC_PORT as srcPort,r.DEST_PORT as destPort,
|
||||
r.DIRECTION as direction,r.PROTOCOL as protocol,r.PROTOCOL_ID as protocolId,r.ACTION as action,r.IS_VALID as isValid,r.IS_AUDIT as isAudit,
|
||||
r.CREATOR_ID as creatorId,r.CREATE_TIME AS createTime,r.EDITOR_ID as editorId,r.EDIT_TIME AS editTime,r.AUDITOR_ID as auditorId,r.AUDIT_TIME AS auditTime,
|
||||
r.SERVICE_ID as serviceId,r.REQUEST_ID AS requestId,r.COMPILE_ID AS compileId,r.IS_AREA_EFFECTIVE as isAreaEffective,r.classify,
|
||||
@@ -947,7 +927,9 @@
|
||||
AREA_EFFECTIVE_IDS,
|
||||
function_id,
|
||||
ip_type,
|
||||
src_ip_address,SRC_IP_PATTERN,DEST_IP_PATTERN,SRC_PORT_PATTERN,DEST_PORT_PATTERN,
|
||||
src_ip_address,
|
||||
ip_pattern,
|
||||
port_pattern,
|
||||
src_port,
|
||||
protocol,
|
||||
protocol_id,
|
||||
@@ -983,10 +965,8 @@
|
||||
#{functionId,jdbcType=INTEGER},
|
||||
#{ipType,jdbcType=INTEGER},
|
||||
#{srcIpAddress,jdbcType=VARCHAR},
|
||||
#{srcIpPattern,jdbcType=INTEGER},
|
||||
#{destIpPattern,jdbcType=INTEGER},
|
||||
#{srcPortPattern,jdbcType=INTEGER},
|
||||
#{destPortPattern,jdbcType=INTEGER},
|
||||
#{ipPattern,jdbcType=INTEGER},
|
||||
#{portPattern,jdbcType=INTEGER},
|
||||
#{srcPort,jdbcType=VARCHAR},
|
||||
#{protocol,jdbcType=INTEGER},
|
||||
#{protocolId,jdbcType=INTEGER},
|
||||
|
||||
@@ -29,8 +29,7 @@
|
||||
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
|
||||
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
|
||||
<result column="ip_type" property="ipType" jdbcType="INTEGER" />
|
||||
<result column="src_ip_pattern" property="srcIpPattern" jdbcType="INTEGER" />
|
||||
<result column="dest_ip_pattern" property="destIpPattern" jdbcType="INTEGER" />
|
||||
<result column="ip_pattern" property="ipPattern" jdbcType="INTEGER" />
|
||||
<result column="dest_ip_address" property="destIpAddress" jdbcType="VARCHAR" />
|
||||
<result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" />
|
||||
<result column="dest_port" property="destPort" jdbcType="VARCHAR" />
|
||||
@@ -125,7 +124,7 @@
|
||||
a.ATTRIBUTE,a.LABLE,a.AREA_EFFECTIVE_IDS,a.function_id,a.do_log,a.do_blacklist
|
||||
</sql>
|
||||
<sql id="IpCfg_Column" >
|
||||
a.cfg_id,a.cfg_desc,a.ip_type,a.src_ip_address,a.src_ip_pattern,a.dest_ip_pattern,a.src_port_pattern,a.dest_port_pattern,a.src_port
|
||||
a.cfg_id,a.cfg_desc,a.ip_type,a.src_ip_address,a.ip_pattern,a.port_pattern,a.src_port
|
||||
,a.protocol,a.protocol_id,a.direction,a.cfg_type,a.action,a.dest_port,a.dest_ip_address
|
||||
,a.is_valid,a.is_audit,a.creator_id,a.create_time,a.editor_id
|
||||
,a.edit_time,a.auditor_id,a.audit_time,a.service_id,a.request_id,
|
||||
@@ -385,7 +384,9 @@
|
||||
AREA_EFFECTIVE_IDS,
|
||||
function_id,
|
||||
ip_type,
|
||||
src_ip_address,SRC_IP_PATTERN,DEST_IP_PATTERN,SRC_PORT_PATTERN,DEST_PORT_PATTERN,
|
||||
src_ip_address,
|
||||
ip_pattern,
|
||||
port_pattern,
|
||||
src_port,
|
||||
protocol,
|
||||
protocol_id,
|
||||
@@ -416,8 +417,8 @@
|
||||
#{functionId,jdbcType=INTEGER},
|
||||
#{ipType,jdbcType=INTEGER},
|
||||
#{srcIpAddress,jdbcType=VARCHAR},
|
||||
#{srcIpPattern,jdbcType=INTEGER},#{destIpPattern,jdbcType=INTEGER},
|
||||
#{srcPortPattern,jdbcType=INTEGER},#{destPortPattern,jdbcType=INTEGER},
|
||||
#{ipPattern,jdbcType=INTEGER},
|
||||
#{portPattern,jdbcType=INTEGER},
|
||||
#{srcPort,jdbcType=VARCHAR},
|
||||
#{protocol,jdbcType=INTEGER},
|
||||
#{protocolId,jdbcType=INTEGER},
|
||||
|
||||
@@ -39,8 +39,7 @@
|
||||
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
|
||||
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
|
||||
<result column="ip_type" property="ipType" jdbcType="INTEGER" />
|
||||
<result column="src_ip_pattern" property="srcIpPattern" jdbcType="INTEGER" />
|
||||
<result column="dest_ip_pattern" property="destIpPattern" jdbcType="INTEGER" />
|
||||
<result column="ip_pattern" property="ipPattern" jdbcType="INTEGER" />
|
||||
<result column="dest_ip_address" property="destIpAddress" jdbcType="VARCHAR" />
|
||||
<result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" />
|
||||
<result column="dest_port" property="destPort" jdbcType="VARCHAR" />
|
||||
@@ -138,7 +137,7 @@
|
||||
a.do_blacklist
|
||||
</sql>
|
||||
<sql id="IpCfg_Column" >
|
||||
a.cfg_id,a.cfg_desc,a.ip_type,a.src_ip_address,a.src_ip_pattern,a.dest_ip_pattern,a.src_port_pattern,a.dest_port_pattern,a.src_port
|
||||
a.cfg_id,a.cfg_desc,a.ip_type,a.src_ip_address,a.ip_pattern,a.port_pattern,a.src_port
|
||||
,a.protocol,a.protocol_id,a.direction,a.cfg_type,a.action,a.dest_port,a.dest_ip_address
|
||||
,a.is_valid,a.is_audit,a.creator_id,a.create_time,a.editor_id
|
||||
,a.edit_time,a.auditor_id,a.audit_time,a.service_id,a.request_id,
|
||||
@@ -568,7 +567,9 @@
|
||||
AREA_EFFECTIVE_IDS,
|
||||
function_id,
|
||||
ip_type,
|
||||
src_ip_address,SRC_IP_PATTERN,DEST_IP_PATTERN,SRC_PORT_PATTERN,DEST_PORT_PATTERN,
|
||||
src_ip_address,
|
||||
ip_pattern,
|
||||
port_pattern,
|
||||
src_port,
|
||||
protocol,
|
||||
protocol_id,
|
||||
@@ -604,8 +605,8 @@
|
||||
#{functionId,jdbcType=INTEGER},
|
||||
#{ipType,jdbcType=INTEGER},
|
||||
#{srcIpAddress,jdbcType=VARCHAR},
|
||||
#{srcIpPattern,jdbcType=INTEGER},#{destIpPattern,jdbcType=INTEGER},
|
||||
#{srcPortPattern,jdbcType=INTEGER},#{destPortPattern,jdbcType=INTEGER},
|
||||
#{ipPattern,jdbcType=INTEGER},
|
||||
#{portPattern,jdbcType=INTEGER},
|
||||
#{srcPort,jdbcType=VARCHAR},
|
||||
#{protocol,jdbcType=INTEGER},
|
||||
#{protocolId,jdbcType=INTEGER},
|
||||
|
||||
@@ -29,8 +29,7 @@
|
||||
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
|
||||
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
|
||||
<result column="ip_type" property="ipType" jdbcType="INTEGER" />
|
||||
<result column="src_ip_pattern" property="srcIpPattern" jdbcType="INTEGER" />
|
||||
<result column="dest_ip_pattern" property="destIpPattern" jdbcType="INTEGER" />
|
||||
<result column="ip_pattern" property="ipPattern" jdbcType="INTEGER" />
|
||||
<result column="dest_ip_address" property="destIpAddress" jdbcType="VARCHAR" />
|
||||
<result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" />
|
||||
<result column="dest_port" property="destPort" jdbcType="VARCHAR" />
|
||||
@@ -126,7 +125,7 @@
|
||||
a.ATTRIBUTE,a.LABLE,a.AREA_EFFECTIVE_IDS,a.function_id,do_log
|
||||
</sql>
|
||||
<sql id="IpCfg_Column" >
|
||||
a.cfg_id,a.cfg_desc,a.ip_type,a.src_ip_address,a.src_ip_pattern,a.dest_ip_pattern,a.src_port_pattern,a.dest_port_pattern,a.src_port
|
||||
a.cfg_id,a.cfg_desc,a.ip_type,a.src_ip_address,a.ip_pattern,a.port_pattern,a.src_port
|
||||
,a.protocol,a.protocol_id,a.direction,a.cfg_type,a.action,a.dest_port,a.dest_ip_address
|
||||
,a.is_valid,a.is_audit,a.creator_id,a.create_time,a.editor_id
|
||||
,a.edit_time,a.auditor_id,a.audit_time,a.service_id,a.request_id,
|
||||
@@ -354,7 +353,9 @@
|
||||
AREA_EFFECTIVE_IDS,
|
||||
function_id,
|
||||
ip_type,
|
||||
src_ip_address,SRC_IP_PATTERN,DEST_IP_PATTERN,SRC_PORT_PATTERN,DEST_PORT_PATTERN,
|
||||
src_ip_address,
|
||||
ip_pattern,
|
||||
port_pattern,
|
||||
src_port,
|
||||
protocol,
|
||||
protocol_id,
|
||||
@@ -385,8 +386,8 @@
|
||||
#{functionId,jdbcType=INTEGER},
|
||||
#{ipType,jdbcType=INTEGER},
|
||||
#{srcIpAddress,jdbcType=VARCHAR},
|
||||
#{srcIpPattern,jdbcType=INTEGER},#{destIpPattern,jdbcType=INTEGER},
|
||||
#{srcPortPattern,jdbcType=INTEGER},#{destPortPattern,jdbcType=INTEGER},
|
||||
#{ipPattern,jdbcType=INTEGER},
|
||||
#{portPattern,jdbcType=INTEGER},
|
||||
#{srcPort,jdbcType=VARCHAR},
|
||||
#{protocol,jdbcType=INTEGER},
|
||||
#{protocolId,jdbcType=INTEGER},
|
||||
|
||||
@@ -7,8 +7,7 @@
|
||||
<id column="host_id" property="hostId" jdbcType="INTEGER" />
|
||||
<result column="spec_service_id" property="specServiceId" jdbcType="INTEGER" />
|
||||
<result column="ip_type" property="ipType" jdbcType="INTEGER" />
|
||||
<result column="src_ip_pattern" property="srcIpPattern" jdbcType="INTEGER" />
|
||||
<result column="dest_ip_pattern" property="destIpPattern" jdbcType="INTEGER" />
|
||||
<result column="ip_pattern" property="ipPattern" jdbcType="INTEGER" />
|
||||
<result column="dest_ip_address" property="destIpAddress" jdbcType="VARCHAR" />
|
||||
<result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" />
|
||||
<result column="dest_port" property="destPort" jdbcType="VARCHAR" />
|
||||
@@ -122,7 +121,9 @@ from specific_service_host_cfg s where s.spec_service_id = #{specServiceId}
|
||||
<!-- 新增 -->
|
||||
<insert id="insert" parameterType="com.nis.domain.specific.SpecificServiceHostCfg">
|
||||
insert into specific_service_host_cfg (spec_service_id,ip_type,
|
||||
src_ip_address,SRC_IP_PATTERN,DEST_IP_PATTERN,SRC_PORT_PATTERN,DEST_PORT_PATTERN,
|
||||
src_ip_address,
|
||||
ip_pattern,
|
||||
port_pattern,
|
||||
src_port,
|
||||
protocol,
|
||||
direction,
|
||||
@@ -131,8 +132,8 @@ from specific_service_host_cfg s where s.spec_service_id = #{specServiceId}
|
||||
is_valid,is_audit,creator_id,create_time,editor_id,edit_time,auditor_id,audit_time)
|
||||
values(#{specServiceId},#{ipType,jdbcType=INTEGER},
|
||||
#{srcIpAddress,jdbcType=VARCHAR},
|
||||
#{srcIpPattern,jdbcType=INTEGER},#{destIpPattern,jdbcType=INTEGER},
|
||||
#{srcPortPattern,jdbcType=INTEGER},#{destPortPattern,jdbcType=INTEGER},
|
||||
#{ipPattern,jdbcType=INTEGER},
|
||||
#{portPattern,jdbcType=INTEGER},
|
||||
#{srcPort,jdbcType=VARCHAR},
|
||||
#{protocol,jdbcType=INTEGER},
|
||||
#{direction,jdbcType=INTEGER},
|
||||
@@ -145,10 +146,10 @@ from specific_service_host_cfg s where s.spec_service_id = #{specServiceId}
|
||||
update specific_service_host_cfg s set
|
||||
s.spec_service_id = #{specServiceId},
|
||||
s.IP_TYPE = #{ipType,jdbcType=INTEGER},
|
||||
s.IP_PATTERN=#{srcIpPattern,jdbcType=INTEGER},#{destIpPattern,jdbcType=INTEGER},
|
||||
s.IP_PATTERN=#{ipPattern,jdbcType=INTEGER},
|
||||
s.SRC_IP_ADDRESS=#{srcIpAddress,jdbcType=VARCHAR},
|
||||
s.DEST_IP_ADDRESS=#{destIpAddress,jdbcType=VARCHAR},
|
||||
s.PORT_PATTERN=#{srcPortPattern,jdbcType=INTEGER},#{destPortPattern,jdbcType=INTEGER},
|
||||
s.PORT_PATTERN=#{portPattern,jdbcType=INTEGER},
|
||||
s.SRC_PORT=#{srcPort,jdbcType=VARCHAR},
|
||||
s.DEST_PORT=#{destPort,jdbcType=VARCHAR},
|
||||
s.direction = #{direction,jdbcType=INTEGER},
|
||||
|
||||
@@ -16,7 +16,6 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringEscapeUtils;
|
||||
import org.apache.ibatis.executor.Executor;
|
||||
import org.apache.ibatis.mapping.MappedStatement;
|
||||
@@ -52,8 +51,6 @@ import com.nis.domain.SysRole;
|
||||
import com.nis.domain.SysUser;
|
||||
import com.nis.domain.basics.AsnGroupInfo;
|
||||
import com.nis.domain.basics.AsnIpCfg;
|
||||
import com.nis.domain.basics.IpCommCfg;
|
||||
import com.nis.domain.basics.UrlCommCfg;
|
||||
import com.nis.domain.callback.InlineIp;
|
||||
import com.nis.domain.callback.NtcDnsResStrategy;
|
||||
import com.nis.domain.callback.ProxyObjKeyring;
|
||||
@@ -1056,10 +1053,13 @@ public abstract class BaseService {
|
||||
*/
|
||||
public static List<IpCfg> ipConvert(IpCfg dstIp, BaseIpCfg srcIp) {
|
||||
List<IpCfg> ipConvertList = Lists.newArrayList();
|
||||
boolean isRange = ((srcIp.getIpPattern() != null && srcIp.getIpPattern() == 2)
|
||||
|| (srcIp.getSrcIpAddress() != null && srcIp.getSrcIpAddress().indexOf("-") > -1)
|
||||
|| (srcIp.getDestIpAddress() != null && srcIp.getDestIpAddress().indexOf("-") > -1));
|
||||
if (isRange) {
|
||||
List<IpCfg> tempList = Lists.newArrayList();
|
||||
List<IpCfg> tempList1 = Lists.newArrayList();
|
||||
if (srcIp.getIpType().equals(4)) {// IP V4
|
||||
if(srcIp.getSrcIpPattern().equals(2)) {//源IP范围
|
||||
if (srcIp.getIpType().intValue() == 4) {
|
||||
if (srcIp.getSrcIpAddress() != null) {
|
||||
String startIpPart = srcIp.getSrcIpAddress().split("-")[0];
|
||||
String endIpPart = srcIp.getSrcIpAddress().split("-")[1];
|
||||
@@ -1077,24 +1077,7 @@ public abstract class BaseService {
|
||||
dstIp.setSrcIpMask("255.255.255.255");
|
||||
tempList.add(dstIp);
|
||||
}
|
||||
}else if(srcIp.getSrcIpPattern().equals(1)){
|
||||
Integer srcMaskNum = Integer.parseInt(srcIp.getSrcIpAddress().split("/")[1]);
|
||||
if (srcMaskNum == 0) {
|
||||
dstIp.setSrcIpMask("0.0.0.0");
|
||||
} else {
|
||||
dstIp.setSrcIpMask(IpUtil.convertMask(srcMaskNum));
|
||||
}
|
||||
dstIp.setSrcIp(srcIp.getSrcIpAddress().split("/")[0]);
|
||||
tempList.add(dstIp);
|
||||
}else if(srcIp.getSrcIpPattern().equals(3)){
|
||||
dstIp.setSrcIp(srcIp.getSrcIpAddress());
|
||||
dstIp.setSrcIpMask("255.255.255.255");
|
||||
tempList.add(dstIp);
|
||||
}else {
|
||||
throw new RuntimeException("Unsupported IP Pattern " + srcIp.getSrcIpPattern());
|
||||
}
|
||||
if (srcIp.getDestIpAddress() != null) {
|
||||
if(srcIp.getDestIpPattern().equals(2)) {
|
||||
String startIpPart = srcIp.getDestIpAddress().split("-")[0];
|
||||
String endIpPart = srcIp.getDestIpAddress().split("-")[1];
|
||||
Integer startNum = Integer.parseInt(startIpPart.split("\\.")[3]);
|
||||
@@ -1114,38 +1097,6 @@ public abstract class BaseService {
|
||||
}
|
||||
}
|
||||
tempList.clear();
|
||||
}else if(srcIp.getDestIpPattern().equals(1)) {
|
||||
Integer dstMaskNum = Integer.parseInt(srcIp.getDestIpAddress().split("/")[1]);
|
||||
for (IpCfg _cfg : tempList) {
|
||||
IpCfg tempIp = new IpCfg();
|
||||
BeanUtils.copyProperties(_cfg, tempIp);
|
||||
if (dstMaskNum == 0) {
|
||||
tempIp.setDstIpMask("0.0.0.0");
|
||||
} else {
|
||||
tempIp.setDstIpMask(IpUtil.convertMask(dstMaskNum));
|
||||
}
|
||||
tempIp.setDstIp(srcIp.getDestIpAddress().split("/")[0]);
|
||||
if (!tempIp.getSrcIp().equals(tempIp.getDstIp())) {
|
||||
// 处理
|
||||
convertPortValues(tempIp, srcIp);
|
||||
tempList1.add(tempIp);
|
||||
}
|
||||
}
|
||||
tempList.clear();
|
||||
}else {
|
||||
for (IpCfg _cfg : tempList) {
|
||||
IpCfg tempIp = new IpCfg();
|
||||
BeanUtils.copyProperties(_cfg, tempIp);
|
||||
tempIp.setDstIp(srcIp.getDestIpAddress());
|
||||
if (!tempIp.getSrcIp().equals(tempIp.getDstIp())) {
|
||||
tempIp.setDstIpMask("255.255.255.255");
|
||||
// 处理
|
||||
convertPortValues(tempIp, srcIp);
|
||||
tempList1.add(tempIp);
|
||||
}
|
||||
}
|
||||
tempList.clear();
|
||||
}
|
||||
} else {
|
||||
for (IpCfg _cfg : tempList) {
|
||||
_cfg.setDstIp("0.0.0.0");
|
||||
@@ -1158,50 +1109,206 @@ public abstract class BaseService {
|
||||
} else {
|
||||
ipConvertList.addAll(tempList);
|
||||
}
|
||||
}else if(srcIp.getIpType().equals(6)){// IP V6
|
||||
} else if (srcIp.getIpType().intValue() == 6) {
|
||||
if (srcIp.getSrcIpAddress() != null) {
|
||||
if(srcIp.getSrcIpPattern().equals(2)) {
|
||||
IPv6Address address1 = IPv6Address.fromString(srcIp.getSrcIpAddress().split("-")[0]);
|
||||
IPv6Address address2 = IPv6Address.fromString(srcIp.getSrcIpAddress().split("-")[1]);
|
||||
IPv6Network network = IPv6Network.fromTwoAddresses(address1, address2);
|
||||
dstIp.setSrcIp(address1.toString());
|
||||
dstIp.setSrcIpMask(network.getNetmask().asAddress().toString());
|
||||
}else if(srcIp.getSrcIpPattern().equals(1)){// IP/掩码
|
||||
IPv6Network strangeNetwork = IPv6Network.fromString(srcIp.getSrcIpAddress());
|
||||
dstIp.setSrcIp(srcIp.getSrcIpAddress().split("/")[0]);
|
||||
dstIp.setSrcIpMask(strangeNetwork.getNetmask().asAddress().toString());
|
||||
}else {// IP
|
||||
dstIp.setSrcIp(srcIp.getSrcIpAddress());
|
||||
dstIp.setSrcIpMask("FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF");
|
||||
}
|
||||
} else {
|
||||
dstIp.setSrcIp("::");
|
||||
dstIp.setSrcIpMask("FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF");
|
||||
}
|
||||
if (srcIp.getDestIpAddress() != null) {
|
||||
if(srcIp.getDestIpPattern().equals(2)) {
|
||||
IPv6Address address1 = IPv6Address.fromString(srcIp.getDestIpAddress().split("-")[0]);
|
||||
IPv6Address address2 = IPv6Address.fromString(srcIp.getDestIpAddress().split("-")[1]);
|
||||
IPv6Network network = IPv6Network.fromTwoAddresses(address1, address2);
|
||||
dstIp.setDstIp(address1.toString());
|
||||
dstIp.setDstIpMask(network.getNetmask().asAddress().toString());
|
||||
}else if(srcIp.getDestIpPattern().equals(1)) {// IP/掩码
|
||||
IPv6Network strangeNetwork = IPv6Network.fromString(srcIp.getDestIpAddress());
|
||||
dstIp.setDstIp(srcIp.getDestIpAddress().split("/")[0]);
|
||||
dstIp.setDstIpMask(strangeNetwork.getNetmask().asAddress().toString());
|
||||
}else {// IP
|
||||
dstIp.setDstIp(srcIp.getDestIpAddress());
|
||||
dstIp.setDstIpMask("FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF");
|
||||
}
|
||||
} else {
|
||||
dstIp.setDstIp("::");
|
||||
dstIp.setDstIpMask("FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF");
|
||||
}
|
||||
convertPortValues(dstIp, srcIp);
|
||||
|
||||
ipConvertList.add(dstIp);
|
||||
} else {
|
||||
throw new RuntimeException("Unsupported IP type " + srcIp.getIpType());
|
||||
}
|
||||
} else {
|
||||
if (srcIp.getSrcIpAddress() != null) {
|
||||
if (srcIp.getSrcIpAddress().indexOf("/") != -1) {
|
||||
if (srcIp.getIpType() == 4 /* || srcIp.getIpType()==46 */) {// 46表示源ip为ipv4,目的ip为ipv6
|
||||
Integer srcMaskNum = Integer.parseInt(srcIp.getSrcIpAddress().split("/")[1]);
|
||||
if (srcMaskNum == 0) {
|
||||
dstIp.setSrcIpMask("0.0.0.0");
|
||||
} else {
|
||||
dstIp.setSrcIpMask(IpUtil.convertMask(srcMaskNum));
|
||||
}
|
||||
|
||||
dstIp.setSrcIp(srcIp.getSrcIpAddress().split("/")[0]);
|
||||
} else if (srcIp.getIpType() == 6/* || srcIp.getIpType()==64 */) {// 64表示源ip为ipv6,目的ip为ipv4
|
||||
IPv6Network strangeNetwork = IPv6Network.fromString(srcIp.getSrcIpAddress());
|
||||
dstIp.setSrcIp(srcIp.getSrcIpAddress().split("/")[0]);
|
||||
dstIp.setSrcIpMask(strangeNetwork.getNetmask().asAddress().toString());
|
||||
} /*
|
||||
* else { Pattern
|
||||
* patternV4Subnet=Pattern.compile(Constants.IPV4_IP_SUBNET_REGEXP); Pattern
|
||||
* patternV6Subnet=Pattern.compile(Constants.IPV6_IP_SUBNET_REGEXP); Matcher
|
||||
* matchernV4Subnet=patternV4Subnet.matcher(srcIp.getSrcIpAddress()); Matcher
|
||||
* matcherV6Subnet=patternV6Subnet.matcher(srcIp.getSrcIpAddress());
|
||||
* if(matchernV4Subnet.matches()) { Integer srcMaskNum =
|
||||
* Integer.parseInt(srcIp.getSrcIpAddress().split("/")[1]); if(srcMaskNum==0){
|
||||
* dstIp.setSrcIpMask("0.0.0.0"); }else{
|
||||
* dstIp.setSrcIpMask(IpUtil.convertMask(srcMaskNum)); }
|
||||
* dstIp.setSrcIp(srcIp.getSrcIpAddress().split("/")[0]); }else
|
||||
* if(matcherV6Subnet.matches()){ IPv6Network strangeNetwork =
|
||||
* IPv6Network.fromString(srcIp.getSrcIpAddress());
|
||||
* dstIp.setSrcIp(srcIp.getSrcIpAddress().split("/")[0]);
|
||||
* dstIp.setSrcIpMask(strangeNetwork.getNetmask().asAddress().toString()); }else
|
||||
* { throw new RuntimeException("Invalid IP/subnet mask format"); } }
|
||||
*/
|
||||
else {
|
||||
throw new RuntimeException("Unsupported IP type " + srcIp.getIpType());
|
||||
}
|
||||
} else {
|
||||
if (srcIp.getIpType() == 4/* || srcIp.getIpType()==46 */) {// 46表示源ip为ipv4,目的ip为ipv6
|
||||
dstIp.setSrcIp(srcIp.getSrcIpAddress());
|
||||
dstIp.setSrcIpMask("255.255.255.255");
|
||||
} else if (srcIp.getIpType() == 6/* || srcIp.getIpType()==64 */) {// 64表示源ip为ipv6,目的ip为ipv4
|
||||
dstIp.setSrcIp(srcIp.getSrcIpAddress());
|
||||
dstIp.setSrcIpMask("FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF");
|
||||
} /*
|
||||
* else {//all Pattern patternV4=Pattern.compile(Constants.IPV4_IP_REGEXP);
|
||||
* Pattern patternV6=Pattern.compile(Constants.IPV6_IP_REGEXP); Matcher
|
||||
* matcherV4=patternV4.matcher(srcIp.getSrcIpAddress()); Matcher
|
||||
* matcherV6=patternV6.matcher(srcIp.getSrcIpAddress()); if(matcherV4.matches())
|
||||
* { dstIp.setSrcIp(srcIp.getSrcIpAddress());
|
||||
* dstIp.setSrcIpMask("255.255.255.255"); }else if(matcherV6.matches()) {
|
||||
* dstIp.setSrcIp(srcIp.getSrcIpAddress());
|
||||
* dstIp.setSrcIpMask("FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF"); }else { throw
|
||||
* new RuntimeException("Invalid IP format"); } }
|
||||
*/
|
||||
else {
|
||||
throw new RuntimeException("Unsupported IP type " + srcIp.getIpType());
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (srcIp.getIpType() == 4/* || srcIp.getIpType()==46 */) {// 46表示源ip为ipv4,目的ip为ipv6
|
||||
dstIp.setSrcIp(srcIp.getSrcIpAddress());
|
||||
dstIp.setSrcIpMask("255.255.255.255");
|
||||
} else if (srcIp.getIpType() == 6/* || srcIp.getIpType()==64 */) {// 64表示源ip为ipv6,目的ip为ipv4
|
||||
dstIp.setSrcIp(srcIp.getSrcIpAddress());
|
||||
dstIp.setSrcIpMask("FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF");
|
||||
} /*
|
||||
* else {//all dstIp.setSrcIp(srcIp.getSrcIpAddress());
|
||||
* dstIp.setSrcIpMask("255.255.255.255"); }
|
||||
*/
|
||||
else {
|
||||
throw new RuntimeException("Unsupported IP type " + srcIp.getIpType());
|
||||
}
|
||||
}
|
||||
if (srcIp.getDestIpAddress() != null) {
|
||||
if (srcIp.getDestIpAddress().indexOf("/") != -1) {
|
||||
if (srcIp.getIpType() == 4/* || srcIp.getIpType()==64 */) {// 64表示源ip为ipv6,目的ip为ipv4
|
||||
Integer dstMaskNum = Integer.parseInt(srcIp.getDestIpAddress().split("/")[1]);
|
||||
if (dstMaskNum == 0) {
|
||||
dstIp.setDstIpMask("0.0.0.0");
|
||||
} else {
|
||||
dstIp.setDstIpMask(IpUtil.convertMask(dstMaskNum));
|
||||
;
|
||||
}
|
||||
dstIp.setDstIp(srcIp.getDestIpAddress().split("/")[0]);
|
||||
} else if (srcIp.getIpType() == 6/* || srcIp.getIpType()==46 */) {// 46表示源ip为ipv4,目的ip为ipv6
|
||||
IPv6Network strangeNetwork = IPv6Network.fromString(srcIp.getDestIpAddress());
|
||||
dstIp.setDstIp(srcIp.getDestIpAddress().split("/")[0]);
|
||||
dstIp.setDstIpMask(strangeNetwork.getNetmask().asAddress().toString());
|
||||
} /*
|
||||
* else { Pattern
|
||||
* patternV4Subnet=Pattern.compile(Constants.IPV4_IP_SUBNET_REGEXP); Pattern
|
||||
* patternV6Subnet=Pattern.compile(Constants.IPV6_IP_SUBNET_REGEXP); Matcher
|
||||
* matchernV4Subnet=patternV4Subnet.matcher(srcIp.getDestIpAddress()); Matcher
|
||||
* matcherV6Subnet=patternV6Subnet.matcher(srcIp.getDestIpAddress());
|
||||
* if(matchernV4Subnet.matches()) { Integer dstMaskNum =
|
||||
* Integer.parseInt(srcIp.getDestIpAddress().split("/")[1]); if(dstMaskNum==0){
|
||||
* dstIp.setDstIpMask("0.0.0.0"); }else{
|
||||
* dstIp.setDstIpMask(IpUtil.convertMask(dstMaskNum));; }
|
||||
* dstIp.setDstIp(srcIp.getDestIpAddress().split("/")[0]); }else
|
||||
* if(matcherV6Subnet.matches()){ IPv6Network strangeNetwork =
|
||||
* IPv6Network.fromString(srcIp.getDestIpAddress());
|
||||
* dstIp.setDstIp(srcIp.getDestIpAddress().split("/")[0]);
|
||||
* dstIp.setDstIpMask(strangeNetwork.getNetmask().asAddress().toString()); }else
|
||||
* { throw new RuntimeException("Invalid IP/subnet mask format"); } }
|
||||
*/
|
||||
else {
|
||||
throw new RuntimeException("Unsupported IP type " + srcIp.getIpType());
|
||||
}
|
||||
|
||||
} else {
|
||||
if (srcIp.getIpType() == 4/* || srcIp.getIpType()==64 */) {// 64表示源ip为ipv6,目的ip为ipv4
|
||||
dstIp.setDstIp(srcIp.getDestIpAddress());
|
||||
dstIp.setDstIpMask("255.255.255.255");
|
||||
} else if (srcIp.getIpType() == 6/* || srcIp.getIpType()==46 */) {// 46表示源ip为ipv4,目的ip为ipv6
|
||||
dstIp.setDstIp(srcIp.getDestIpAddress());
|
||||
dstIp.setDstIpMask("FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF");
|
||||
} /*
|
||||
* else {//all Pattern patternV4=Pattern.compile(Constants.IPV4_IP_REGEXP);
|
||||
* Pattern patternV6=Pattern.compile(Constants.IPV6_IP_REGEXP); Matcher
|
||||
* matcherV4=patternV4.matcher(srcIp.getDestIpAddress()); Matcher
|
||||
* matcherV6=patternV6.matcher(srcIp.getDestIpAddress());
|
||||
* if(matcherV4.matches()) { dstIp.setDstIp(srcIp.getDestIpAddress());
|
||||
* dstIp.setDstIpMask("255.255.255.255"); }else if(matcherV6.matches()) {
|
||||
* dstIp.setDstIp(srcIp.getDestIpAddress());
|
||||
* dstIp.setDstIpMask("FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF"); }else { throw
|
||||
* new RuntimeException("invalid ip format"); } }
|
||||
*/
|
||||
else {
|
||||
throw new RuntimeException("Unsupported IP type " + srcIp.getIpType());
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (srcIp.getIpType() == 4/* || srcIp.getIpType()==64 */) {// 64表示源ip为ipv6,目的ip为ipv4
|
||||
dstIp.setDstIp(srcIp.getDestIpAddress());
|
||||
dstIp.setDstIpMask("255.255.255.255");
|
||||
} else if (srcIp.getIpType() == 6/* || srcIp.getIpType()==46 */) {// 46表示源ip为ipv4,目的ip为ipv6
|
||||
dstIp.setDstIp(srcIp.getDestIpAddress());
|
||||
dstIp.setDstIpMask("FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF");
|
||||
} /*
|
||||
* else {//all dstIp.setDstIp(srcIp.getDestIpAddress());
|
||||
* dstIp.setDstIpMask("255.255.255.255"); }
|
||||
*/
|
||||
else {
|
||||
throw new RuntimeException("Unsupported IP type " + srcIp.getIpType());
|
||||
}
|
||||
}
|
||||
if (srcIp.getSrcPort() != null) {
|
||||
if (srcIp.getSrcPort().indexOf("/") != -1) {
|
||||
String srcMaskNum = srcIp.getSrcPort().split("/")[1];
|
||||
dstIp.setSrcPortMask(srcMaskNum);
|
||||
dstIp.setSrcPort(srcIp.getSrcPort().split("/")[0]);
|
||||
} else {
|
||||
dstIp.setSrcPort(srcIp.getSrcPort());
|
||||
dstIp.setSrcPortMask("65535");
|
||||
}
|
||||
} else {
|
||||
dstIp.setSrcPort("0");
|
||||
dstIp.setSrcPortMask("65535");
|
||||
}
|
||||
if (srcIp.getDestPort() != null) {
|
||||
if (srcIp.getDestPort().indexOf("/") != -1) {
|
||||
String dstMaskNum = srcIp.getDestPort().split("/")[1];
|
||||
dstIp.setDstPortMask(dstMaskNum);
|
||||
dstIp.setDstPort(srcIp.getDestPort().split("/")[0]);
|
||||
} else {
|
||||
dstIp.setDstPort(srcIp.getDestPort());
|
||||
dstIp.setDstPortMask("65535");
|
||||
}
|
||||
} else {
|
||||
dstIp.setDstPort("0");
|
||||
dstIp.setDstPortMask("65535");
|
||||
}
|
||||
ipConvertList.add(dstIp);
|
||||
}
|
||||
return ipConvertList;
|
||||
}
|
||||
|
||||
@@ -1452,67 +1559,12 @@ public abstract class BaseService {
|
||||
List<IpCfg> cfgs = ipConvert(cfg, baseIpCfg);
|
||||
maatIpList.addAll(cfgs);
|
||||
}
|
||||
} else if(ipCfgList.get(0) instanceof IpCommCfg) {
|
||||
for (BaseCfg<?> _cfg : ipCfgList) {
|
||||
IpCfg cfg = new IpCfg();
|
||||
BaseIpCfg baseIpCfg = new BaseIpCfg();
|
||||
IpCommCfg ipCommGroupCfg = (IpCommCfg) _cfg;
|
||||
BeanUtils.copyProperties(ipCommGroupCfg, baseIpCfg);
|
||||
BeanUtils.copyProperties(baseIpCfg, cfg);
|
||||
if(groupId==null) {
|
||||
cfg.setGroupId(ipCommGroupCfg.getGroupId());
|
||||
}else {
|
||||
cfg.setGroupId(groupId);
|
||||
}
|
||||
cfg.setRegionId(ipCommGroupCfg.getRegionId());
|
||||
//user regions
|
||||
//String userRegion = "APP_ID=" + appIpCfg.getAppCode();
|
||||
//cfg.setUserRegion(userRegion);
|
||||
cfg.setIsValid(isValid);
|
||||
cfg.setAuditTime(opTime);
|
||||
List<IpCfg> cfgs = ipConvert(cfg, baseIpCfg);
|
||||
maatIpList.addAll(cfgs);
|
||||
}
|
||||
}
|
||||
}
|
||||
long end = System.currentTimeMillis();
|
||||
logger.warn("convert data finish,cost:" + (end - start));
|
||||
return maatIpList;
|
||||
}
|
||||
public List<StringCfg> groupReuseStringCfgAddRemoveConvert(List<? extends BaseCfg<?>> stringCfgList, Integer isValid,
|
||||
Integer groupId) {
|
||||
logger.warn("convert data start");
|
||||
long start = System.currentTimeMillis();
|
||||
Date opTime = new Date();
|
||||
List<StringCfg> maatStringList = new ArrayList<>();
|
||||
if (CollectionUtils.isNotEmpty(stringCfgList)) {
|
||||
// 只用一次instanceof,取代循环中每次都用一次instanceof
|
||||
if(stringCfgList.get(0) instanceof UrlCommCfg) {
|
||||
for (BaseCfg<?> _cfg : stringCfgList) {
|
||||
StringCfg cfg = new StringCfg();
|
||||
BaseStringCfg baseStringCfg = new BaseStringCfg();
|
||||
UrlCommCfg ipCommGroupCfg = (UrlCommCfg) _cfg;
|
||||
BeanUtils.copyProperties(_cfg, baseStringCfg);
|
||||
BeanUtils.copyProperties(baseStringCfg, cfg);
|
||||
if(groupId==null) {
|
||||
cfg.setGroupId(ipCommGroupCfg.getGroupId());
|
||||
}else {
|
||||
cfg.setGroupId(groupId);
|
||||
}
|
||||
cfg.setRegionId(ipCommGroupCfg.getRegionId());
|
||||
//user regions
|
||||
//String userRegion = "APP_ID=" + appIpCfg.getAppCode();
|
||||
//cfg.setUserRegion(userRegion);
|
||||
cfg.setIsValid(isValid);
|
||||
cfg.setAuditTime(opTime);
|
||||
maatStringList.add(cfg);
|
||||
}
|
||||
}
|
||||
}
|
||||
long end = System.currentTimeMillis();
|
||||
logger.warn("convert data finish,cost:" + (end - start));
|
||||
return maatStringList;
|
||||
}
|
||||
public MaatCfg convertMaatCfg(BaseCfg _cfg,Integer cfgType) {
|
||||
MaatCfg maatCfg = new MaatCfg();
|
||||
maatCfg.initDefaultValue();
|
||||
@@ -2553,15 +2605,7 @@ public abstract class BaseService {
|
||||
if(_cfg.getAction().equals(Constants.MONIT_ACTION)) {
|
||||
maatCfg.setUserRegion(Constants.INTERCEPT_IP_MONIT_USER_REGION_KEY+"="+Constants.USER_REGION_PLACEHOLDER);
|
||||
}*/
|
||||
if(serviceDict!=null&&serviceDict.getAction().equals(Constants.MONIT_ACTION)) {// 监测 需要发keyring_id、拦截强度
|
||||
_cfg.setUserRegion1(StringUtil.isEmpty(_cfg.getUserRegion1()) ? "0":_cfg.getUserRegion1());
|
||||
_cfg.setUserRegion5(StringUtil.isEmpty(_cfg.getUserRegion5()) ? "1":_cfg.getUserRegion5());
|
||||
maatCfg.setUserRegion(Constants.INTERCEPT_IP_MONIT_USER_REGION_KEY+"=0"+";"+Constants.INTERCEPT_DOMAN_INTENSITY_USER_REGION_KEY+"="+_cfg.getUserRegion5());
|
||||
}
|
||||
if(serviceDict!=null&&serviceDict.getAction().equals(64)) {
|
||||
maatCfg.setUserRegion(Constants.INTERCEPT_IP_RATELIMIT_DROPRATE_USER_REGION_KEY+"="+_cfg.getUserRegion2());
|
||||
}
|
||||
|
||||
}else if(regionDict.getFunctionId()==207 || regionDict.getFunctionId()==208 || regionDict.getFunctionId()==209) {// HTTP(s)阻断、重定向、替换
|
||||
String userRegion = Constants.USER_REGION_PLACEHOLDER;
|
||||
if(_cfg.getAction().equals(Constants.REJECT_ACTION)) {// 阻断
|
||||
|
||||
@@ -1,250 +0,0 @@
|
||||
package com.nis.web.service.basics;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.ibatis.session.ExecutorType;
|
||||
import org.apache.ibatis.session.SqlSession;
|
||||
import org.apache.ibatis.session.SqlSessionFactory;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.beust.jcommander.internal.Maps;
|
||||
import com.beust.jcommander.internal.Sets;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.nis.domain.FunctionRegionDict;
|
||||
import com.nis.domain.FunctionServiceDict;
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.basics.AsnGroupInfo;
|
||||
import com.nis.domain.basics.AsnIpCfg;
|
||||
import com.nis.domain.basics.IpCommCfg;
|
||||
import com.nis.domain.configuration.BaseIpCfg;
|
||||
import com.nis.domain.configuration.CfgIndexInfo;
|
||||
import com.nis.domain.maat.GroupReuseAddBean;
|
||||
import com.nis.domain.maat.GroupReuseCfg;
|
||||
import com.nis.domain.maat.MaatCfg;
|
||||
import com.nis.domain.maat.ToMaatBean;
|
||||
import com.nis.domain.maat.ToMaatResult;
|
||||
import com.nis.domain.maat.MaatCfg.DigestCfg;
|
||||
import com.nis.domain.maat.MaatCfg.GroupCfg;
|
||||
import com.nis.domain.maat.MaatCfg.IpCfg;
|
||||
import com.nis.domain.maat.MaatCfg.NumBoundaryCfg;
|
||||
import com.nis.domain.maat.MaatCfg.StringCfg;
|
||||
import com.nis.util.ConfigServiceUtil;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.web.dao.basics.AsnGroupInfoDao;
|
||||
import com.nis.web.dao.basics.AsnIpCfgDao;
|
||||
import com.nis.web.dao.basics.IpCommGroupCfgDao;
|
||||
import com.nis.web.dao.basics.PolicyGroupInfoDao;
|
||||
import com.nis.web.security.UserUtils;
|
||||
import com.nis.web.service.BaseService;
|
||||
import com.nis.web.service.SpringContextHolder;
|
||||
@Service
|
||||
public class IpCommGroupCfgService extends BaseService {
|
||||
@Autowired
|
||||
private IpCommGroupCfgDao ipCommGroupCfgDao;
|
||||
@Autowired
|
||||
private PolicyGroupInfoDao policyGroupInfoDao;
|
||||
/**
|
||||
* @param page
|
||||
* @param entity
|
||||
* @return
|
||||
*/
|
||||
public Page<IpCommCfg> findPage(Page<IpCommCfg> page, IpCommCfg entity) {
|
||||
entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(),"r"));
|
||||
entity.setPage(page);
|
||||
List<IpCommCfg> list=ipCommGroupCfgDao.findPage(entity);
|
||||
page.setList(list);
|
||||
return page;
|
||||
}
|
||||
|
||||
public List<IpCommCfg> findByPage(String ids) {
|
||||
List<IpCommCfg> list=ipCommGroupCfgDao.findByPage(ids);
|
||||
return list;
|
||||
}
|
||||
|
||||
public IpCommCfg get(Long id ) {
|
||||
return ipCommGroupCfgDao.get(id);
|
||||
}
|
||||
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void save(List<IpCommCfg> entitys) {
|
||||
logger.warn("Start to save IP,size:"+entitys.size());
|
||||
long start=System.currentTimeMillis();
|
||||
for(IpCommCfg ipCfg:entitys) {
|
||||
ipCommGroupCfgDao.insert(ipCfg);
|
||||
}
|
||||
long end=System.currentTimeMillis();
|
||||
logger.warn("Save IP finish,cost:"+(end-start));
|
||||
}
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void update(IpCommCfg entity){
|
||||
ipCommGroupCfgDao.update(entity);
|
||||
}
|
||||
|
||||
|
||||
public List<IpCommCfg> getByIds(String ids) {
|
||||
if(ids==null) {
|
||||
throw new RuntimeException("ids is null!");
|
||||
}
|
||||
return ipCommGroupCfgDao.getByIds(ids);
|
||||
}
|
||||
|
||||
//新增
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void saveIpCommGroupCfg(CfgIndexInfo entity) {
|
||||
Date createTime=new Date();
|
||||
if(CollectionUtils.isNotEmpty(entity.getIpCommGroupCfgList())) {
|
||||
for (int i = 0; i < entity.getIpCommGroupCfgList().size(); i++) {
|
||||
BeanUtils.copyProperties(entity, entity.getIpCommGroupCfgList().get(i), new String[]{"cfgId","userregion3"});
|
||||
entity.getIpCommGroupCfgList().get(i).setRequestId(0);
|
||||
entity.getIpCommGroupCfgList().get(i).setClassify("0");
|
||||
entity.getIpCommGroupCfgList().get(i).setAttribute("0");
|
||||
entity.getIpCommGroupCfgList().get(i).setLable("0");
|
||||
entity.getIpCommGroupCfgList().get(i).setCreateTime(createTime);
|
||||
entity.getIpCommGroupCfgList().get(i).setCreatorId(entity.getCurrentUser().getId());
|
||||
entity.getIpCommGroupCfgList().get(i).setIsValid(Constants.VALID_NO);
|
||||
entity.getIpCommGroupCfgList().get(i).setIsAudit(Constants.AUDIT_NOT_YET);
|
||||
entity.getIpCommGroupCfgList().get(i).setGroupId(Integer.parseInt(entity.getUserRegion3()));
|
||||
ipCommGroupCfgDao.insertForBatch(entity.getIpCommGroupCfgList().get(i));
|
||||
}
|
||||
}
|
||||
}
|
||||
// @Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
// public void audit(List<IpCommCfg> ipCommGroupCfgs, Integer isAudit, Integer isValid) {
|
||||
// // TODO Auto-generated method stub
|
||||
// Set<Integer> groupIds=Sets.newHashSet();
|
||||
// if(!StringUtil.isEmpty(ipCommGroupCfgs)){
|
||||
// for(IpCommCfg cfg:ipCommGroupCfgs) {
|
||||
// cfg.setIsValid(isValid);
|
||||
// cfg.setIsAudit(isAudit);
|
||||
// cfg.setAuditorId(UserUtils.getUser().getId());
|
||||
// cfg.setAuditTime(new Date());
|
||||
// groupIds.add(cfg.getGroupId());
|
||||
// ipCommGroupCfgDao.update(cfg);
|
||||
// }
|
||||
// }
|
||||
// //查询有效的Ip配置个数
|
||||
// for(Integer groupId:groupIds) {
|
||||
// Integer groupCount=ipCommGroupCfgDao.getGroupIdCount(groupId);
|
||||
// if(groupCount>0){//udFlag 设置为1
|
||||
// policyGroupInfoDao.updateUdFlag(groupId, 1,5);
|
||||
// }else{//udFlag 设置为0
|
||||
// policyGroupInfoDao.updateUdFlag(groupId, 0,5);
|
||||
// }
|
||||
// }
|
||||
// //下发配置时改变公共组udFlag标识
|
||||
// send2Maat(ipCommGroupCfgs,isValid);
|
||||
// }
|
||||
// public void send2Maat(List<IpCommCfg> ipCommGroupCfgs,int isValid) {
|
||||
// GroupReuseAddBean maatBean = new GroupReuseAddBean();
|
||||
// List<GroupReuseCfg> groupReuseList=new ArrayList<>();
|
||||
// GroupReuseCfg groupReuseCfg=new GroupReuseCfg();
|
||||
// List<IpCfg> ipRegionList = groupReuseCfgAddRemoveConvert(ipCommGroupCfgs,isValid,null);
|
||||
// List<StringCfg> strRegionList = new ArrayList<>();
|
||||
// List<NumBoundaryCfg> numRegionList = new ArrayList<>();
|
||||
// groupReuseCfg.setIpRegionList(ipRegionList);
|
||||
// groupReuseCfg.setStrRegionList(strRegionList);
|
||||
// groupReuseCfg.setNumRegionList(numRegionList);
|
||||
// groupReuseList.add(groupReuseCfg);
|
||||
// maatBean.setGroupReuseCfgList(groupReuseList);
|
||||
// maatBean.setAuditTime(new Date());
|
||||
// maatBean.setCreatorName(UserUtils.getUser().getName());
|
||||
// maatBean.setVersion(Constants.MAAT_VERSION);
|
||||
// logger.warn("IP Common Region Send To Maat start");
|
||||
// long start=System.currentTimeMillis();
|
||||
// if(isValid==Constants.VALID_YES) {
|
||||
// maatBean.setOpAction(Constants.INSERT_ACTION);
|
||||
// //调用服务接口下发配置数据
|
||||
// String json=gsonToJson(maatBean);
|
||||
// if(ipCommGroupCfgs.size()<=100) {
|
||||
// logger.info("ip 公共组域新增配置下发配置参数:"+json);
|
||||
// }else {
|
||||
// logger.info("ip 公共组域新增配置下发region条数:"+ipCommGroupCfgs.size());
|
||||
// }
|
||||
// //调用服务接口下发配置
|
||||
// ToMaatResult result =ConfigServiceUtil.postGroupReuseSources(json);
|
||||
// logger.info("ip 公共组域新增配置响应信息:"+result.getMsg());
|
||||
// }else {
|
||||
// maatBean.setOpAction(Constants.UPDATE_ACTION);
|
||||
// //调用服务接口下发配置数据
|
||||
// String json=gsonToJson(maatBean);
|
||||
// if(ipCommGroupCfgs.size()<=100) {
|
||||
// logger.info("ip 公共组域删除配置下发配置参数:"+json);
|
||||
// }else {
|
||||
// logger.info("ip 公共组域删除配置下发region条数:"+ipCommGroupCfgs.size());
|
||||
//
|
||||
// }
|
||||
// //调用服务接口下发配置
|
||||
// ToMaatResult result = ConfigServiceUtil.put(json,3);
|
||||
// logger.info("asn ip复用域删除配置响应信息:"+result.getMsg());
|
||||
// }
|
||||
// long end=System.currentTimeMillis();
|
||||
// logger.warn("IP Common Region Send To Maat finish,cost:"+(end-start));
|
||||
// }
|
||||
public void delete(String ids) {
|
||||
// TODO Auto-generated method stub
|
||||
if(ids==null) {
|
||||
throw new RuntimeException("ids is null!");
|
||||
}
|
||||
ipCommGroupCfgDao.delete(ids);
|
||||
}
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void saveAndSend(FunctionRegionDict regionDict, FunctionServiceDict serviceDict, List<BaseIpCfg> cfgs,
|
||||
boolean send) {
|
||||
// TODO Auto-generated method stub
|
||||
logger.warn("Start to save IP,size:"+cfgs.size());
|
||||
long start=System.currentTimeMillis();
|
||||
SqlSessionFactory sqlSessionFactory=SpringContextHolder.getBean(SqlSessionFactory.class);
|
||||
SqlSession batchSqlSession = null;
|
||||
//需要通过新增域接口新增的ip集合
|
||||
Map<Integer,Integer> groupCount=Maps.newHashMap();
|
||||
// AsnCacheUtils.init(true);
|
||||
List<IpCommCfg> ipCommCfgs=new ArrayList(cfgs.size());
|
||||
try{
|
||||
batchSqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, false);
|
||||
|
||||
for(BaseIpCfg cfg:cfgs) {
|
||||
IpCommCfg ipCommCfg=new IpCommCfg();
|
||||
BeanUtils.copyProperties(cfg, ipCommCfg);
|
||||
ipCommCfgs.add(ipCommCfg);
|
||||
((IpCommGroupCfgDao) batchSqlSession.getMapper(IpCommGroupCfgDao.class)).insertForBatch(ipCommCfg);
|
||||
// if(send) {
|
||||
// if(groupCount.containsKey(ipCommCfg.getGroupId())) {
|
||||
// groupCount.put(ipCommCfg.getGroupId(), groupCount.get(ipCommCfg.getGroupId())+1);
|
||||
// }else {
|
||||
// groupCount.put(ipCommCfg.getGroupId(), 1);
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
// if(send) {
|
||||
// if(groupCount.size()>0) {
|
||||
// for(Entry<Integer, Integer> groupId:groupCount.entrySet()) {
|
||||
// policyGroupInfoDao.updateUdFlag(groupId.getKey(), 1,5);
|
||||
// }
|
||||
//
|
||||
// this.send2Maat(ipCommCfgs, Constants.VALID_YES);
|
||||
// }
|
||||
// }
|
||||
batchSqlSession.commit();
|
||||
}finally {
|
||||
if(batchSqlSession != null){
|
||||
batchSqlSession.close();
|
||||
}
|
||||
}
|
||||
long end=System.currentTimeMillis();
|
||||
logger.warn("Save IP finish,cost:"+(end-start));
|
||||
cfgs.clear();
|
||||
cfgs=null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -47,10 +47,6 @@ public class PolicyGroupInfoService extends BaseService{
|
||||
List<PolicyGroupInfo> list=policyGroupInfoDao.findPolicyByGroupInfoList(ids);
|
||||
return list;
|
||||
}
|
||||
public List<PolicyGroupInfo> findPolicyByServiceGroupInfoList(String ids) {
|
||||
List<PolicyGroupInfo> list=policyGroupInfoDao.findPolicyByServiceGroupInfoList(ids);
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
public List<PolicyGroupInfo> findPolicyGroupInfos() {
|
||||
@@ -88,7 +84,7 @@ public class PolicyGroupInfoService extends BaseService{
|
||||
entity.setCreatorId(UserUtils.getUser().getId());
|
||||
entity.setCreateTime(createTime);
|
||||
//asn类型从综合服务获取groupId
|
||||
if(4==entity.getGroupType().intValue()||5==entity.getGroupType().intValue()||6==entity.getGroupType().intValue()||7==entity.getGroupType().intValue()) {
|
||||
if(4==entity.getGroupType().intValue()) {
|
||||
int serviceGroupId=0;
|
||||
List<Integer> groupIds= ConfigServiceUtil.getId(2,1);
|
||||
if(groupIds.size()>0) {
|
||||
@@ -177,15 +173,5 @@ public class PolicyGroupInfoService extends BaseService{
|
||||
public PolicyGroupInfo getGroupInfo(PolicyGroupInfo policyGroupInfo){
|
||||
return policyGroupInfoDao.getGroupInfo(policyGroupInfo);
|
||||
}
|
||||
/**
|
||||
* 公共组相关功能使用
|
||||
*/
|
||||
public List<PolicyGroupInfo> findPolicyGroupInfosByTypeforUD(Integer type,Integer flag) {
|
||||
List<PolicyGroupInfo> list=policyGroupInfoDao.findPolicyGroupInfosByTypeForUD(type,flag);
|
||||
return list;
|
||||
}
|
||||
public List<PolicyGroupInfo> findPolicyGroupInfosByTypeforUD(Integer type,Integer flag,Integer limit) {
|
||||
List<PolicyGroupInfo> list=policyGroupInfoDao.findLimitedPolicyGroupInfosByTypeForUD(type,flag,limit);
|
||||
return list;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,153 +0,0 @@
|
||||
package com.nis.web.service.basics;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.session.ExecutorType;
|
||||
import org.apache.ibatis.session.SqlSession;
|
||||
import org.apache.ibatis.session.SqlSessionFactory;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.basics.AsnGroupInfo;
|
||||
import com.nis.domain.basics.AsnIpCfg;
|
||||
import com.nis.domain.basics.UrlCommCfg;
|
||||
import com.nis.domain.configuration.BaseIpCfg;
|
||||
import com.nis.domain.configuration.CfgIndexInfo;
|
||||
import com.nis.domain.maat.GroupReuseAddBean;
|
||||
import com.nis.domain.maat.GroupReuseCfg;
|
||||
import com.nis.domain.maat.MaatCfg;
|
||||
import com.nis.domain.maat.ToMaatBean;
|
||||
import com.nis.domain.maat.ToMaatResult;
|
||||
import com.nis.domain.maat.MaatCfg.DigestCfg;
|
||||
import com.nis.domain.maat.MaatCfg.GroupCfg;
|
||||
import com.nis.domain.maat.MaatCfg.IpCfg;
|
||||
import com.nis.domain.maat.MaatCfg.NumBoundaryCfg;
|
||||
import com.nis.domain.maat.MaatCfg.StringCfg;
|
||||
import com.nis.util.ConfigServiceUtil;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.web.dao.CrudDao;
|
||||
import com.nis.web.dao.basics.UrlCommGroupDao;
|
||||
import com.nis.web.dao.configuration.IpCfgDao;
|
||||
import com.nis.web.security.UserUtils;
|
||||
import com.nis.web.service.CrudService;
|
||||
import com.nis.web.service.SpringContextHolder;
|
||||
|
||||
@Service
|
||||
public class UrlCommGroupService extends CrudService<CrudDao<UrlCommCfg>, UrlCommCfg>{
|
||||
|
||||
@Autowired
|
||||
private UrlCommGroupDao urlCommGroupDao;
|
||||
|
||||
|
||||
public Page<UrlCommCfg> findPage(Page<UrlCommCfg> page, UrlCommCfg entity) {
|
||||
entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(),"r"));
|
||||
entity.setPage(page);
|
||||
List<UrlCommCfg> list=urlCommGroupDao.findAllPageList(entity);
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
String key=list.get(i).getCfgKeywords().replace("***and***", " ");
|
||||
list.get(i).setCfgKeywords(key);
|
||||
}
|
||||
page.setList(list);
|
||||
return page;
|
||||
}
|
||||
|
||||
|
||||
public List<UrlCommCfg> findByPage(String ids) {
|
||||
List<UrlCommCfg> list=urlCommGroupDao.findByPage(ids);
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public UrlCommCfg get(Long id ) {
|
||||
return urlCommGroupDao.get(id);
|
||||
}
|
||||
|
||||
//新增 insertUrlCommGroupCfg
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void saveUrlCommGroupCfg(CfgIndexInfo entity) {
|
||||
Date createTime=new Date();
|
||||
if(entity.getUrlCommGroupList()!=null) {
|
||||
for (int i = 0; i < entity.getUrlCommGroupList().size(); i++) {
|
||||
BeanUtils.copyProperties(entity, entity.getUrlCommGroupList().get(i), new String[]{"cfgId"});
|
||||
entity.getUrlCommGroupList().get(i).setRequestId(0);
|
||||
entity.getUrlCommGroupList().get(i).setClassify("0");
|
||||
entity.getUrlCommGroupList().get(i).setAttribute("0");
|
||||
entity.getUrlCommGroupList().get(i).setLable("0");
|
||||
entity.getUrlCommGroupList().get(i).setIsHexbin(0);
|
||||
entity.getUrlCommGroupList().get(i).setCreateTime(createTime);
|
||||
entity.getUrlCommGroupList().get(i).setCreatorId(entity.getCurrentUser().getId());
|
||||
entity.getUrlCommGroupList().get(i).setIsValid(Constants.VALID_NO);
|
||||
entity.getUrlCommGroupList().get(i).setIsAudit(Constants.AUDIT_NOT_YET);
|
||||
if(entity.getUrlCommGroupList().get(i).getCfgKeywords().contains("***and***")){
|
||||
entity.getUrlCommGroupList().get(i).setExprType(1);
|
||||
}else{
|
||||
entity.getUrlCommGroupList().get(i).setExprType(0);
|
||||
}
|
||||
urlCommGroupDao.insertUrlCommGroupCfg(entity.getUrlCommGroupList().get(i));
|
||||
}
|
||||
// //修改公共组的标识
|
||||
// Integer udFlag=urlCommGroupDao.findUrlUdFlag(Integer.parseInt(entity.getUserRegion3()));
|
||||
// if(udFlag == 0){
|
||||
// urlCommGroupDao.updateUrlUdFlag(Integer.parseInt(entity.getUserRegion3()), 1);
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void update(UrlCommCfg entity){
|
||||
Date editTime=new Date();
|
||||
entity.setIsValid(0);
|
||||
entity.setIsAudit(0);
|
||||
entity.setEditTime(editTime);
|
||||
entity.setEditorId(entity.getCurrentUser().getId());
|
||||
if(entity.getCfgKeywords().contains("***and***")){
|
||||
entity.setExprType(1);
|
||||
}else{
|
||||
entity.setExprType(0);
|
||||
}
|
||||
urlCommGroupDao.update(entity);
|
||||
}
|
||||
|
||||
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void delete(String ids) {
|
||||
|
||||
urlCommGroupDao.delete(ids);
|
||||
}
|
||||
|
||||
public List<UrlCommCfg> getByIds(String ids) {
|
||||
if(ids==null) {
|
||||
throw new RuntimeException("ids is null!");
|
||||
}
|
||||
return urlCommGroupDao.getByIds(ids);
|
||||
}
|
||||
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void audit(UrlCommCfg urlGroupCfg,Integer isAudit,Integer isValid) {
|
||||
|
||||
if(!StringUtil.isEmpty(urlGroupCfg)){
|
||||
urlGroupCfg.setIsValid(isValid);
|
||||
urlGroupCfg.setIsAudit(isAudit);
|
||||
urlGroupCfg.setAuditorId(UserUtils.getUser().getId());
|
||||
urlGroupCfg.setAuditTime(new Date());
|
||||
|
||||
urlCommGroupDao.update(urlGroupCfg);
|
||||
}
|
||||
//下发配置时改变公共组udFlag标识
|
||||
//查询有效的url配置个数
|
||||
Integer groupCount=urlCommGroupDao.getGroupIdCount(urlGroupCfg.getUserRegion3());
|
||||
if(groupCount>0){//udFlag 设置为1
|
||||
urlCommGroupDao.updateUrlUdFlag(Integer.parseInt(urlGroupCfg.getUserRegion3()), 1);
|
||||
}else{//udFlag 设置为0
|
||||
urlCommGroupDao.updateUrlUdFlag(Integer.parseInt(urlGroupCfg.getUserRegion3()), 0);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -391,7 +391,7 @@ public class AppCfgService extends BaseService {
|
||||
if(entity.getFunctionId() == 408){
|
||||
entity.setConfigType(Constants.SPECIFIC_SERVICE_CFG_TYPE_ENCRYPTED_TUNNEL_BEHAVIOR);
|
||||
}
|
||||
auditAppPolicyCfg(entity, entity.getIsAudit(),Constants.UPDATE_ACTION);
|
||||
auditAppPolicyCfg(entity, entity.getIsAudit(),Constants.INSERT_ACTION);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -469,7 +469,7 @@ public class AppCfgService extends BaseService {
|
||||
BeanUtils.copyProperties(entity, cfg,
|
||||
new String[] { "cfgRegionCode", "cfgType", "ipType", "isAreaEffective",
|
||||
"areaEffectiveIds", "protocol", "portPattern", "srcPort", "destPort",
|
||||
"direction", "destIpAddress", "srcIpAddress", "srcIpPattern", "destIpPattern" });
|
||||
"direction", "destIpAddress", "srcIpAddress", "ipPattern" });
|
||||
areaIpCfgDao.saveAreaIpCfg(cfg);
|
||||
}
|
||||
}
|
||||
@@ -500,7 +500,7 @@ public class AppCfgService extends BaseService {
|
||||
BeanUtils.copyProperties(entity, cfg,
|
||||
new String[] { "cfgRegionCode", "cfgType", "ipType", "isAreaEffective", "areaEffectiveIds",
|
||||
"protocol", "portPattern", "srcPort", "destPort", "direction", "destIpAddress",
|
||||
"srcIpAddress", "srcIpPattern", "destIpPattern" });
|
||||
"srcIpAddress", "ipPattern" });
|
||||
areaIpCfgDao.saveAreaIpCfg(cfg);
|
||||
}
|
||||
}
|
||||
@@ -654,7 +654,7 @@ public class AppCfgService extends BaseService {
|
||||
if(isValid==1) {
|
||||
entity.setIsAudit(1);
|
||||
entity.setIsValid(1);
|
||||
auditAppDomainCfg(entity, entity.getIsAudit(),Constants.UPDATE_ACTION);
|
||||
auditAppDomainCfg(entity, entity.getIsAudit(),Constants.INSERT_ACTION);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -722,7 +722,7 @@ public class AppCfgService extends BaseService {
|
||||
if(isValid==1) {
|
||||
entity.setIsAudit(1);
|
||||
entity.setIsValid(1);
|
||||
auditAppTopicDomainCfg(entity, entity.getIsAudit(),Constants.UPDATE_ACTION);
|
||||
auditAppTopicDomainCfg(entity, entity.getIsAudit(),Constants.INSERT_ACTION);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -255,7 +255,7 @@ public class AppMultiFeatureCfgService extends BaseService {
|
||||
if(isValid==1) {
|
||||
entity.setIsAudit(1);
|
||||
entity.setIsValid(1);
|
||||
auditAppFeatureCfg(entity, entity.getIsAudit(),Constants.UPDATE_ACTION);
|
||||
auditAppFeatureCfg(entity, entity.getIsAudit(),Constants.INSERT_ACTION);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -214,12 +214,6 @@ public class AvContentCfgService extends BaseService{
|
||||
entity.setCreateTime(new Date());
|
||||
entity.setCreatorId(entity.getCurrentUser().getId());
|
||||
avContentCfgDao.insertCfgIndexInfo(entity);
|
||||
/* if(entity.getVoipIps()!=null){
|
||||
for (AvVoipIpCfg voipIp : entity.getVoipIps()) {
|
||||
entity.setVoipIp(voipIp);
|
||||
avContentCfgDao.insertAvVoipIp(entity);
|
||||
}
|
||||
}*/
|
||||
if(entity.getIpPortList()!=null){
|
||||
for(IpPortCfg cfg:entity.getIpPortList()){
|
||||
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
||||
@@ -311,7 +305,7 @@ public class AvContentCfgService extends BaseService{
|
||||
if(isValid==1) {
|
||||
entity.setIsAudit(1);
|
||||
entity.setIsValid(1);
|
||||
auditAvVoip(entity,entity.getIsAudit(), Constants.UPDATE_ACTION);
|
||||
auditAvVoip(entity,entity.getIsAudit(), Constants.INSERT_ACTION);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -782,11 +776,9 @@ public class AvContentCfgService extends BaseService{
|
||||
BeanUtils.copyProperties(entity, areaIpCfg,new String[]{"cfgRegionCode"
|
||||
,"cfgType"
|
||||
,"ipType"
|
||||
,"srcIpPattern"
|
||||
,"destIpPattern"
|
||||
,"ipPattern"
|
||||
,"srcIpAddress"
|
||||
,"srcPortPattern"
|
||||
,"destPortPattern"
|
||||
,"portPattern"
|
||||
,"srcPort"
|
||||
,"destPort"
|
||||
,"protocol"
|
||||
@@ -824,11 +816,9 @@ public class AvContentCfgService extends BaseService{
|
||||
,"cfgType"
|
||||
,"cfgId"
|
||||
,"ipType"
|
||||
,"srcIpPattern"
|
||||
,"destIpPattern"
|
||||
,"ipPattern"
|
||||
,"srcIpAddress"
|
||||
,"srcPortPattern"
|
||||
,"destPortPattern"
|
||||
,"portPattern"
|
||||
,"srcPort"
|
||||
,"destPort"
|
||||
,"protocol"
|
||||
@@ -843,11 +833,9 @@ public class AvContentCfgService extends BaseService{
|
||||
BeanUtils.copyProperties(entity, areaIpCfg,new String[]{"cfgRegionCode"
|
||||
,"cfgType"
|
||||
,"ipType"
|
||||
,"srcIpPattern"
|
||||
,"destIpPattern"
|
||||
,"ipPattern"
|
||||
,"srcIpAddress"
|
||||
,"srcPortPattern"
|
||||
,"destPortPattern"
|
||||
,"portPattern"
|
||||
,"srcPort"
|
||||
,"destPort"
|
||||
,"protocol"
|
||||
@@ -952,11 +940,9 @@ public class AvContentCfgService extends BaseService{
|
||||
,"cfgType"
|
||||
,"cfgId"
|
||||
,"ipType"
|
||||
,"srcIpPattern"
|
||||
,"destIpPattern"
|
||||
,"ipPattern"
|
||||
,"srcIpAddress"
|
||||
,"srcPortPattern"
|
||||
,"destPortPattern"
|
||||
,"portPattern"
|
||||
,"srcPort"
|
||||
,"destPort"
|
||||
,"protocol"
|
||||
@@ -1129,11 +1115,9 @@ public class AvContentCfgService extends BaseService{
|
||||
BeanUtils.copyProperties(entity, areaIpCfg,new String[]{"cfgRegionCode"
|
||||
,"cfgType"
|
||||
,"ipType"
|
||||
,"srcIpPattern"
|
||||
,"destIpPattern"
|
||||
,"ipPattern"
|
||||
,"srcIpAddress"
|
||||
,"srcPortPattern"
|
||||
,"destPortPattern"
|
||||
,"portPattern"
|
||||
,"srcPort"
|
||||
,"destPort"
|
||||
,"protocol"
|
||||
@@ -1171,11 +1155,9 @@ public class AvContentCfgService extends BaseService{
|
||||
,"cfgType"
|
||||
,"cfgId"
|
||||
,"ipType"
|
||||
,"srcIpPattern"
|
||||
,"destIpPattern"
|
||||
,"ipPattern"
|
||||
,"srcIpAddress"
|
||||
,"srcPortPattern"
|
||||
,"destPortPattern"
|
||||
,"portPattern"
|
||||
,"srcPort"
|
||||
,"destPort"
|
||||
,"protocol"
|
||||
@@ -1190,11 +1172,9 @@ public class AvContentCfgService extends BaseService{
|
||||
BeanUtils.copyProperties(entity, areaIpCfg,new String[]{"cfgRegionCode"
|
||||
,"cfgType"
|
||||
,"ipType"
|
||||
,"srcIpPattern"
|
||||
,"destIpPattern"
|
||||
,"ipPattern"
|
||||
,"srcIpAddress"
|
||||
,"srcPortPattern"
|
||||
,"destPortPattern"
|
||||
,"portPattern"
|
||||
,"srcPort"
|
||||
,"destPort"
|
||||
,"protocol"
|
||||
@@ -1299,11 +1279,9 @@ public class AvContentCfgService extends BaseService{
|
||||
,"cfgType"
|
||||
,"cfgId"
|
||||
,"ipType"
|
||||
,"srcIpPattern"
|
||||
,"destIpPattern"
|
||||
,"ipPattern"
|
||||
,"srcIpAddress"
|
||||
,"srcPortPattern"
|
||||
,"destPortPattern"
|
||||
,"portPattern"
|
||||
,"srcPort"
|
||||
,"destPort"
|
||||
,"protocol"
|
||||
|
||||
@@ -246,7 +246,7 @@ public class BgpCfgService extends CrudService<BgpCfgDao,CfgIndexInfo> {
|
||||
if(isValid==1) {
|
||||
entity.setIsAudit(1);
|
||||
entity.setIsValid(1);
|
||||
auditBgpCfg(entity, entity.getIsAudit(),Constants.UPDATE_ACTION);
|
||||
auditBgpCfg(entity, entity.getIsAudit(),Constants.INSERT_ACTION);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -262,7 +262,7 @@ public class CachePolicyService extends CrudService<WebsiteCfgDao,CfgIndexInfo>
|
||||
if(isValid==1) {
|
||||
entity.setIsAudit(1);
|
||||
entity.setIsValid(1);
|
||||
auditCachePolicy(entity, entity.getIsAudit(),Constants.UPDATE_ACTION);
|
||||
auditCachePolicy(entity, entity.getIsAudit(),Constants.INSERT_ACTION);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -274,73 +274,6 @@ public class CommonPolicyService extends CrudService<WebsiteCfgDao, CfgIndexInfo
|
||||
}
|
||||
return hasData;
|
||||
}
|
||||
/**
|
||||
* 公共分组通用配置
|
||||
* @param page
|
||||
* @param entity
|
||||
* @param auditMap
|
||||
* @param hasData
|
||||
* @return
|
||||
*/
|
||||
public boolean auditReuseCommonConfigData(
|
||||
Page page,
|
||||
BaseCfg entity,
|
||||
Map<Integer, List> auditMap,
|
||||
boolean hasData){
|
||||
long start=System.currentTimeMillis();
|
||||
long end=System.currentTimeMillis();
|
||||
long totalSize=0;
|
||||
|
||||
if(page.isLastPage()){
|
||||
hasData = false;
|
||||
}
|
||||
List<Integer> regionIds = new ArrayList();
|
||||
for(Entry<Integer, List> e:auditMap.entrySet()) {
|
||||
List<BaseCfg> list=e.getValue();
|
||||
for (BaseCfg baseCfg : list) {
|
||||
regionIds.add(baseCfg.getRegionId());
|
||||
}
|
||||
totalSize=totalSize+list.size();
|
||||
|
||||
}
|
||||
start=System.currentTimeMillis();
|
||||
logger.warn("复用配置批量失效-数据库状态变更:start()");
|
||||
commonPolicyDao.auditCfgBatch( entity.getTableName(), entity,regionIds,null);
|
||||
end=System.currentTimeMillis();
|
||||
logger.warn("复用配置批量失效-数据库状态变更:end("+(end-start)+")");
|
||||
|
||||
//已经下发过的,调用分组复用配置删除接口
|
||||
if(!auditMap.isEmpty()) {
|
||||
GroupReuseAddBean maatBean = new GroupReuseAddBean();
|
||||
List<GroupReuseCfg> groupReuseList=new ArrayList<>();
|
||||
GroupReuseCfg groupReuseCfg=new GroupReuseCfg();
|
||||
List<IpCfg> ipRegionList=new ArrayList<>();
|
||||
for (Integer groupId : auditMap.keySet()) {
|
||||
ipRegionList.addAll(groupReuseCfgAddRemoveConvert(auditMap.get(groupId),Constants.VALID_NO,groupId));
|
||||
}
|
||||
groupReuseCfg.setIpRegionList(ipRegionList);
|
||||
groupReuseCfg.setStrRegionList(null);
|
||||
groupReuseCfg.setNumRegionList(null);
|
||||
groupReuseList.add(groupReuseCfg);
|
||||
maatBean.setGroupReuseCfgList(groupReuseList);
|
||||
maatBean.setAuditTime(new Date());
|
||||
maatBean.setCreatorName(UserUtils.getUser().getName());
|
||||
maatBean.setVersion(Constants.MAAT_VERSION);
|
||||
maatBean.setOpAction(Constants.UPDATE_ACTION);
|
||||
//调用服务接口下发配置数据
|
||||
String json=gsonToJson(maatBean);
|
||||
logger.warn("复用域配置批量取消("+page.getPageNo()+"次):"+ipRegionList.size());
|
||||
//logger.info("app协议IP域配置批量取消:"+json);
|
||||
//调用服务接口下发配置
|
||||
logger.warn("复用配置批量失效-下发:start()");
|
||||
start=System.currentTimeMillis();
|
||||
ToMaatResult result = ConfigServiceUtil.put(json,3);
|
||||
end=System.currentTimeMillis();
|
||||
logger.warn("复用域配置批量取消响应信息:"+result.getMsg());
|
||||
logger.warn("复用配置批量失效-下发:end("+(end-start)+")");
|
||||
}
|
||||
return hasData;
|
||||
}
|
||||
/**
|
||||
* 回调类配置下发
|
||||
* @param className
|
||||
|
||||
@@ -151,7 +151,7 @@ public class ControlPolicyService extends BaseService{
|
||||
if(isValid==1) {
|
||||
entity.setIsAudit(1);
|
||||
entity.setIsValid(1);
|
||||
audit(entity.getIsAudit(), entity.getIsValid(), entity.getFunctionId(), entity.getId().toString(), new Date(), Constants.REPLACE_REQ_KEY_VALUE, Constants.UPDATE_ACTION);
|
||||
audit(entity.getIsAudit(), entity.getIsValid(), entity.getFunctionId(), entity.getId().toString(), new Date(), Constants.REPLACE_REQ_KEY_VALUE, Constants.INSERT_ACTION);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -139,7 +139,7 @@ public class DdosCfgService extends BaseService{
|
||||
if(isValid==1) {
|
||||
entity.setIsAudit(1);
|
||||
entity.setIsValid(1);
|
||||
audit(entity.getIsAudit(), isValid, entity.getFunctionId(),String.valueOf(entity.getCfgId()), new Date(),Constants.UPDATE_ACTION);
|
||||
audit(entity.getIsAudit(), isValid, entity.getFunctionId(),String.valueOf(entity.getCfgId()), new Date(),Constants.INSERT_ACTION);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -150,13 +150,11 @@ public class DnsIpCfgService extends BaseService{
|
||||
dnsIp.setFunctionId(401);
|
||||
dnsIp.setCfgRegionCode(1);
|
||||
dnsIp.setCfgType("dns_fake_ip");
|
||||
dnsIp.setSrcIpPattern(3);
|
||||
dnsIp.setDestIpPattern(3);
|
||||
dnsIp.setIpPattern(3);
|
||||
dnsIp.setSrcIpAddress("0.0.0.0");
|
||||
dnsIp.setDestPort("0");
|
||||
dnsIp.setSrcPort("0");
|
||||
dnsIp.setSrcPortPattern(1);
|
||||
dnsIp.setDestPortPattern(1);
|
||||
dnsIp.setPortPattern(1);
|
||||
dnsIp.setDnsStrategyId(0);
|
||||
dnsIp.setAction(16);
|
||||
dnsIp.setServiceId(64);
|
||||
|
||||
@@ -76,7 +76,7 @@ public class DomainService extends CrudService<DomainDao,HttpUrlCfg> {
|
||||
c.initDefaultValue();
|
||||
BeanUtils.copyProperties(cfg, c,new String[]{"cfgId","ipType","direction",
|
||||
"protocol","protocolId","areaEffectiveIds","cfgRegionCode",
|
||||
"cfgType","srcIpPattern","destIpPattern","srcIpAddress","srcPortPattern","destPortPattern","srcPort","destIpAddress","destPort"});
|
||||
"cfgType","ipPattern","srcIpAddress","portPattern","srcPort","destIpAddress","destPort"});
|
||||
c.setTableName(AreaIpCfg.getTablename());
|
||||
}
|
||||
this.saveIpBatch(cfg.getAreaCfg());
|
||||
@@ -106,7 +106,7 @@ public class DomainService extends CrudService<DomainDao,HttpUrlCfg> {
|
||||
c.initDefaultValue();
|
||||
BeanUtils.copyProperties(cfg, c,new String[]{"cfgId","ipType","direction",
|
||||
"protocol","protocolId","areaEffectiveIds","cfgRegionCode",
|
||||
"cfgType","srcIpPattern","destIpPattern","srcIpAddress","srcPortPattern","destPortPattern","srcPort","destIpAddress","destPort"});
|
||||
"cfgType","ipPattern","srcIpAddress","portPattern","srcPort","destIpAddress","destPort"});
|
||||
c.setTableName(AreaIpCfg.getTablename());
|
||||
c.setCreatorId(cfg.getCurrentUser().getId());
|
||||
c.setCreateTime(date);
|
||||
@@ -202,11 +202,9 @@ public class DomainService extends CrudService<DomainDao,HttpUrlCfg> {
|
||||
,"cfgType"
|
||||
,"cfgId"
|
||||
,"ipType"
|
||||
,"srcIpPattern"
|
||||
,"destIpPattern"
|
||||
,"ipPattern"
|
||||
,"srcIpAddress"
|
||||
,"srcPortPattern"
|
||||
,"destPortPattern"
|
||||
,"portPattern"
|
||||
,"srcPort"
|
||||
,"destPort"
|
||||
,"protocol"
|
||||
@@ -537,7 +535,7 @@ public class DomainService extends CrudService<DomainDao,HttpUrlCfg> {
|
||||
if(isValid==1) {
|
||||
entity.setIsAudit(1);
|
||||
entity.setIsValid(1);
|
||||
auditDomainCfg(entity, entity.getIsAudit(),Constants.UPDATE_ACTION);
|
||||
auditDomainCfg(entity, entity.getIsAudit(),Constants.INSERT_ACTION);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -235,7 +235,7 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
|
||||
if(isValid==1) {
|
||||
entity.setIsAudit(1);
|
||||
entity.setIsValid(1);
|
||||
auditFtpCfg(entity, entity.getIsAudit(),Constants.UPDATE_ACTION);
|
||||
auditFtpCfg(entity, entity.getIsAudit(),Constants.INSERT_ACTION);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -569,7 +569,7 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
|
||||
if(isValid==1) {
|
||||
entity.setIsAudit(1);
|
||||
entity.setIsValid(1);
|
||||
auditFileDigestCfg(entity.getIsAudit(), isValid,entity.getFunctionId(),entity.getCfgId()+"",Constants.UPDATE_ACTION);
|
||||
auditFileDigestCfg(entity.getIsAudit(), isValid,entity.getFunctionId(),entity.getCfgId()+"",Constants.INSERT_ACTION);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -926,7 +926,7 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
|
||||
if(isValid==1) {
|
||||
entity.setIsAudit(1);
|
||||
entity.setIsValid(1);
|
||||
auditP2pCfg(entity, entity.getIsAudit(),Constants.UPDATE_ACTION);
|
||||
auditP2pCfg(entity, entity.getIsAudit(),Constants.INSERT_ACTION);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,10 +78,6 @@ public class HttpRedirectCfgService extends CrudService<WebsiteCfgDao,CfgIndexIn
|
||||
entity.setNtcSubscribeIdCfgList(subscribeIdList);
|
||||
return entity;
|
||||
}
|
||||
public CfgIndexInfo getCommCfg(Long cfgId,Integer compileId){
|
||||
CfgIndexInfo entity = websiteCfgDao.getCfgIndexInfo(cfgId,compileId);
|
||||
return entity;
|
||||
}
|
||||
|
||||
public Map<String, List> exportHttpCfg(CfgIndexInfo entity){
|
||||
Map<String, List> dataMap=new HashMap<String, List>();
|
||||
@@ -298,7 +294,7 @@ public class HttpRedirectCfgService extends CrudService<WebsiteCfgDao,CfgIndexIn
|
||||
if(isValid==1) {
|
||||
entity.setIsAudit(1);
|
||||
entity.setIsValid(1);
|
||||
auditHttpCfg(entity, entity.getIsAudit(),Constants.UPDATE_ACTION);
|
||||
auditHttpCfg(entity, entity.getIsAudit(),Constants.INSERT_ACTION);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -285,7 +285,7 @@ public class InterceptCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo>
|
||||
if(isValid==1) {
|
||||
entity.setIsAudit(1);
|
||||
entity.setIsValid(1);
|
||||
auditInterceptIpCfg(entity, entity.getIsAudit(),Constants.UPDATE_ACTION);
|
||||
auditInterceptIpCfg(entity, entity.getIsAudit(),Constants.INSERT_ACTION);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -98,10 +98,9 @@ public class IpCfgService extends CrudService<IpCfgDao, BaseIpCfg> {
|
||||
if (cfg.getAreaCfg() != null && cfg.getAreaCfg().size() > 0) {
|
||||
for (AreaIpCfg c : cfg.getAreaCfg()) {
|
||||
c.initDefaultValue();
|
||||
BeanUtils.copyProperties(cfg, c,
|
||||
new String[] { "cfgId", "ipType", "direction", "protocol", "protocolId", "areaEffectiveIds",
|
||||
"cfgRegionCode", "cfgType", "srcIpPattern", "destIpPattern", "srcIpAddress",
|
||||
"srcPortPattern", "destPortPattern", "srcPort", "destIpAddress", "destPort" });
|
||||
BeanUtils.copyProperties(cfg, c,new String[]{"cfgId","ipType","direction",
|
||||
"protocol","protocolId","areaEffectiveIds","cfgRegionCode",
|
||||
"cfgType","ipPattern","srcIpAddress","portPattern","srcPort","destIpAddress","destPort"});
|
||||
c.setTableName(AreaIpCfg.getTablename());
|
||||
}
|
||||
this.saveIpBatch(cfg.getAreaCfg());
|
||||
@@ -287,7 +286,7 @@ public class IpCfgService extends CrudService<IpCfgDao, BaseIpCfg> {
|
||||
if (isValid == 1) {
|
||||
entity.setIsAudit(1);
|
||||
entity.setIsValid(1);
|
||||
auditIpCfg(entity, entity.getIsAudit(), Constants.UPDATE_ACTION);
|
||||
auditIpCfg(entity, entity.getIsAudit(), Constants.INSERT_ACTION);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -357,10 +356,9 @@ public class IpCfgService extends CrudService<IpCfgDao, BaseIpCfg> {
|
||||
if (cfg.getAreaCfg() != null && cfg.getAreaCfg().size() > 0) {
|
||||
for (AreaIpCfg c : cfg.getAreaCfg()) {
|
||||
c.initDefaultValue();
|
||||
BeanUtils.copyProperties(cfg, c,
|
||||
new String[] { "cfgId", "ipType", "direction", "protocol", "protocolId", "areaEffectiveIds",
|
||||
"cfgRegionCode", "cfgType", "srcIpPattern", "destIpPattern", "srcIpAddress",
|
||||
"srcPortPattern", "destPortPattern", "srcPort", "destIpAddress", "destPort" });
|
||||
BeanUtils.copyProperties(cfg, c,new String[]{"cfgId","ipType","direction",
|
||||
"protocol","protocolId","areaEffectiveIds","cfgRegionCode",
|
||||
"cfgType","ipPattern","srcIpAddress","portPattern","srcPort","destIpAddress","destPort"});
|
||||
c.setTableName(AreaIpCfg.getTablename());
|
||||
c.setCreatorId(cfg.getCurrentUser().getId());
|
||||
c.setCreateTime(date);
|
||||
@@ -379,10 +377,19 @@ public class IpCfgService extends CrudService<IpCfgDao, BaseIpCfg> {
|
||||
List<BaseIpCfg> beans1=new ArrayList<>();
|
||||
List<AreaIpCfg> areaIpCfgList=areaIpCfgDao.getByCompileId(cfg.getCompileId());
|
||||
for(AreaIpCfg area:areaIpCfgList){
|
||||
BeanUtils.copyProperties(cfg, area,
|
||||
new String[] { "cfgRegionCode", "cfgType", "cfgId", "ipType", "srcIpPattern", "destIpPattern",
|
||||
"srcIpAddress", "srcPortPattern", "destPortPattern", "srcPort", "destPort", "protocol",
|
||||
"direction", "protocolId" });
|
||||
BeanUtils.copyProperties(cfg,area ,new String[]{"cfgRegionCode"
|
||||
,"cfgType"
|
||||
,"cfgId"
|
||||
,"ipType"
|
||||
,"ipPattern"
|
||||
,"srcIpAddress"
|
||||
,"portPattern"
|
||||
,"srcPort"
|
||||
,"destPort"
|
||||
,"protocol"
|
||||
,"direction"
|
||||
,"protocolId"
|
||||
});
|
||||
beans1.add(area);
|
||||
}
|
||||
this.auditIpBatch(beans1);
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
package com.nis.web.service.configuration;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@@ -13,12 +16,14 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
import com.beust.jcommander.internal.Lists;
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.configuration.BaseIpCfg;
|
||||
import com.nis.domain.configuration.DdosIpCfg;
|
||||
import com.nis.domain.configuration.IpReuseDnatPolicyCfg;
|
||||
import com.nis.domain.configuration.IpReusePolicyCfg;
|
||||
import com.nis.domain.maat.ToMaatResult;
|
||||
import com.nis.exceptions.MaatConvertException;
|
||||
import com.nis.util.ConfigServiceUtil;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.StringUtils;
|
||||
import com.nis.web.dao.configuration.IpMultiplexDao;
|
||||
import com.nis.web.security.UserUtils;
|
||||
import com.nis.web.service.BaseService;
|
||||
|
||||
@@ -249,7 +249,7 @@ public class MailCfgService extends CrudService<MailCfgDao,CfgIndexInfo> {
|
||||
if(isValid==1) {
|
||||
entity.setIsAudit(1);
|
||||
entity.setIsValid(1);
|
||||
auditMailCfg(entity, entity.getIsAudit(),Constants.UPDATE_ACTION);
|
||||
auditMailCfg(entity, entity.getIsAudit(),Constants.INSERT_ACTION);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -374,7 +374,7 @@ public class WebsiteCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo> {
|
||||
if(isValid==1) {
|
||||
entity.setIsAudit(1);
|
||||
entity.setIsValid(1);
|
||||
auditHttpCfg(entity, entity.getIsAudit(),Constants.UPDATE_ACTION);
|
||||
auditHttpCfg(entity, entity.getIsAudit(),Constants.INSERT_ACTION);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -828,7 +828,7 @@ public class WebsiteCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo> {
|
||||
if(isValid==1) {
|
||||
entity.setIsAudit(1);
|
||||
entity.setIsValid(1);
|
||||
auditSslCfg(entity, entity.getIsAudit(),Constants.UPDATE_ACTION);
|
||||
auditSslCfg(entity, entity.getIsAudit(),Constants.INSERT_ACTION);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -987,7 +987,7 @@ public class WebsiteCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo> {
|
||||
maatBean.setAuditTime(entity.getAuditTime());
|
||||
maatBean.setCreatorName(entity.getCurrentUser().getName());
|
||||
maatBean.setVersion(Constants.MAAT_VERSION);
|
||||
maatBean.setOpAction(Constants.INSERT_ACTION);
|
||||
maatBean.setOpAction(Constants.UPDATE_ACTION);
|
||||
//调用服务接口取消配置
|
||||
String json=gsonToJson(maatBean);
|
||||
logger.info("ssl配置下发配置参数:"+json);
|
||||
@@ -1131,7 +1131,7 @@ public class WebsiteCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo> {
|
||||
if(isValid==1) {
|
||||
entity.setIsAudit(1);
|
||||
entity.setIsValid(1);
|
||||
auditDnsCfg(entity, entity.getIsAudit(),Constants.UPDATE_ACTION);
|
||||
auditDnsCfg(entity, entity.getIsAudit(),Constants.INSERT_ACTION);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ import com.nis.domain.Page;
|
||||
import com.nis.domain.SysUser;
|
||||
import com.nis.domain.specific.SpecificServiceCfg;
|
||||
import com.nis.domain.specific.SpecificServiceHostCfg;
|
||||
import com.nis.util.BasicProvingUtil;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.web.dao.specific.SpecificServiceHostCfgDao;
|
||||
import com.nis.web.security.UserUtils;
|
||||
@@ -57,66 +58,45 @@ public class SpecificServiceHostCfgService extends BaseService{
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void saveOrUpdate(SpecificServiceHostCfg specificServiceHostCfg) {
|
||||
SysUser user = UserUtils.getUser();
|
||||
String defaultSrcIp = "0.0.0.0"; //缺省0.0.0.0值表示任意
|
||||
String defaultDestIp = "0.0.0.0"; //缺省0.0.0.0值表示任意
|
||||
String defaultIp = "0.0.0.0"; //缺省0.0.0.0值表示任意
|
||||
if(specificServiceHostCfg.getIpType().equals(4)){
|
||||
if(specificServiceHostCfg.getSrcIpPattern()==1){
|
||||
defaultSrcIp = "0.0.0.0/32"; //0.0.0.0表示任意
|
||||
}else if(specificServiceHostCfg.getSrcIpPattern()==2){
|
||||
defaultSrcIp = "0.0.0.0-0.0.0.0";
|
||||
if(specificServiceHostCfg.getIpPattern()==1){
|
||||
defaultIp = "0.0.0.0/32"; //0.0.0.0表示任意
|
||||
}else if(specificServiceHostCfg.getIpPattern()==2){
|
||||
defaultIp = "0.0.0.0-0.0.0.0";
|
||||
}else{
|
||||
defaultSrcIp = "0.0.0.0";
|
||||
}
|
||||
if(specificServiceHostCfg.getDestIpPattern()==1){
|
||||
defaultDestIp = "0.0.0.0/32"; //0.0.0.0表示任意
|
||||
}else if(specificServiceHostCfg.getDestIpPattern()==2){
|
||||
defaultDestIp = "0.0.0.0-0.0.0.0";
|
||||
}else{
|
||||
defaultDestIp = "0.0.0.0";
|
||||
defaultIp = "0.0.0.0";
|
||||
}
|
||||
|
||||
}
|
||||
if(specificServiceHostCfg.getIpType().equals(6)){
|
||||
if(specificServiceHostCfg.getSrcIpPattern()==1){
|
||||
defaultSrcIp = "::/64";
|
||||
}else if(specificServiceHostCfg.getSrcIpPattern()==2){
|
||||
defaultSrcIp = "::-::";
|
||||
if(specificServiceHostCfg.getIpPattern()==1){
|
||||
defaultIp = "::/64";
|
||||
}else if(specificServiceHostCfg.getIpPattern()==2){
|
||||
defaultIp = "::-::";
|
||||
}else{
|
||||
defaultSrcIp = "::";
|
||||
}
|
||||
if(specificServiceHostCfg.getDestIpPattern()==1){
|
||||
defaultDestIp = "::/64";
|
||||
}else if(specificServiceHostCfg.getDestIpPattern()==2){
|
||||
defaultDestIp = "::-::";
|
||||
}else{
|
||||
defaultDestIp = "::";
|
||||
defaultIp = "::";
|
||||
}
|
||||
}
|
||||
String defaultSrcPort = "0"; //0表示任意
|
||||
String defaultDestPort = "0"; //0表示任意
|
||||
if(specificServiceHostCfg.getSrcPortPattern().equals(1)){
|
||||
defaultSrcPort = "0";
|
||||
String defaultPort = "0"; //0表示任意
|
||||
if(specificServiceHostCfg.getPortPattern().equals(1)){
|
||||
defaultPort = "0";
|
||||
}else{
|
||||
defaultSrcPort = "0/0";
|
||||
}
|
||||
if(specificServiceHostCfg.getDestPortPattern().equals(1)){
|
||||
defaultDestPort = "0";
|
||||
}else{
|
||||
defaultDestPort = "0/0";
|
||||
defaultPort = "0/0";
|
||||
}
|
||||
//ip地址默认 缺省0.0.0.0值表示任意
|
||||
if(StringUtil.isBlank(specificServiceHostCfg.getSrcIpAddress())){
|
||||
specificServiceHostCfg.setSrcIpAddress(defaultSrcIp);
|
||||
specificServiceHostCfg.setSrcIpAddress(defaultIp);
|
||||
}
|
||||
if(StringUtil.isBlank(specificServiceHostCfg.getDestIpAddress())){
|
||||
specificServiceHostCfg.setDestIpAddress(defaultDestIp);
|
||||
specificServiceHostCfg.setDestIpAddress(defaultIp);
|
||||
}
|
||||
//端口掩码默认
|
||||
if(StringUtil.isBlank(specificServiceHostCfg.getSrcPort())){
|
||||
specificServiceHostCfg.setSrcPort(defaultSrcPort);
|
||||
specificServiceHostCfg.setSrcPort(defaultPort);
|
||||
}
|
||||
if(StringUtil.isBlank(specificServiceHostCfg.getDestPort())){
|
||||
specificServiceHostCfg.setDestPort(defaultDestPort);
|
||||
specificServiceHostCfg.setDestPort(defaultPort);
|
||||
}
|
||||
//方向缺省
|
||||
if(specificServiceHostCfg.getDirection()==null){
|
||||
|
||||
@@ -31,24 +31,20 @@ public class MaatCfgConverTest {
|
||||
ToMaatBean maat = new ToMaatBean();
|
||||
BaseStringCfg str = new BaseStringCfg();
|
||||
BaseIpCfg ip = new BaseIpCfg();
|
||||
ip.setSrcIpPattern(1);
|
||||
ip.setDestIpPattern(1);
|
||||
ip.setIpPattern(1);
|
||||
ip.setIpType(4);
|
||||
ip.setSrcIpAddress("192.168.10.0/24");
|
||||
ip.setSrcPortPattern(2);
|
||||
ip.setDestPortPattern(2);
|
||||
ip.setPortPattern(2);
|
||||
ip.setSrcPort("8080-8089");
|
||||
ip.setCompileId(123);
|
||||
ip.setProtocol(6);
|
||||
ip.setDirection(2);
|
||||
ipList.add(ip);
|
||||
ip = new BaseIpCfg();
|
||||
ip.setSrcIpPattern(2);
|
||||
ip.setDestIpPattern(2);
|
||||
ip.setIpPattern(2);
|
||||
ip.setIpType(4);
|
||||
ip.setSrcIpAddress("10.0.6.0-10.0.6.100");
|
||||
ip.setSrcPortPattern(1);
|
||||
ip.setDestPortPattern(1);
|
||||
ip.setPortPattern(1);
|
||||
ip.setSrcPort("7080/65534");
|
||||
ip.setCompileId(124);
|
||||
ip.setDirection(1);
|
||||
@@ -71,17 +67,17 @@ public class MaatCfgConverTest {
|
||||
for(BaseIpCfg c:ipList){
|
||||
IpCfg ipCfg = new IpCfg();
|
||||
ipCfg.setRegionId(regionId);
|
||||
if(c.getSrcIpPattern()==1){
|
||||
if(c.getIpPattern()==1){
|
||||
ipCfg.setSrcIp(c.getSrcIpAddress().split("/")[0]);
|
||||
ipCfg.setSrcIpMask(IpUtil.convertMask(Integer.parseInt(c.getSrcIpAddress().split("/")[1])));
|
||||
}else if(c.getSrcIpPattern()==2){
|
||||
}else if(c.getIpPattern()==2){
|
||||
ipCfg.setSrcIp(c.getSrcIpAddress().split("-")[0]);
|
||||
ipCfg.setSrcIpMask(IpUtil.getMask(c.getSrcIpAddress().split("-")[0], c.getSrcIpAddress().split("-")[1]));
|
||||
}
|
||||
if(c.getSrcPortPattern()==1){
|
||||
if(c.getPortPattern()==1){
|
||||
ipCfg.setSrcPort(c.getSrcPort().split("/")[0]);
|
||||
ipCfg.setSrcPortMask(c.getSrcPort().split("/")[1]);
|
||||
}else if(c.getSrcPortPattern()==2){
|
||||
}else if(c.getPortPattern()==2){
|
||||
ipCfg.setSrcPort(c.getSrcPort().split("-")[0]);
|
||||
Integer portMask = Integer.parseInt(c.getSrcPort().split("-")[1])-Integer.parseInt(c.getSrcPort().split("-")[0]);
|
||||
ipCfg.setSrcPortMask(portMask.toString());
|
||||
|
||||
@@ -1490,43 +1490,42 @@ GByte=GByte
|
||||
interval=\u041f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u043a
|
||||
month=\u041c\u0435\u0441\u044f\u0446\u044b
|
||||
day=\u0414\u043d\u0438
|
||||
week=weeks
|
||||
week=\u043d\u0435\u0434\u0435\u043b\u044c
|
||||
startTime=\u041d\u0430\u0447\u0430\u0442\u044c
|
||||
endTime=\u0417\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u044c
|
||||
single=\u041e\u0434\u043d\u043e\u043a\u0440\u0430\u0442\u043d\u043e
|
||||
everyDay=\u0415\u0436\u0435\u0434\u043d\u0435\u0432\u043d\u043e
|
||||
everyWeek=\u0415\u0436\u0435\u043d\u0435\u0434\u0435\u043b\u044c\u043d\u043e
|
||||
everyMonth=\u0415\u0436\u0435\u043c\u0435\u0441\u044f\u0447\u043d\u043e
|
||||
on=On
|
||||
is_schduler=Scheduler
|
||||
validate_error=Unexpected error occurred while validating
|
||||
v4_num=IPv4 Number
|
||||
v6_num=IPv6 Number
|
||||
on=\u041e\u0442\u043a\u0440\u044b\u0442\u044c
|
||||
is_schduler=\u041f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0449\u0438\u043a
|
||||
validate_error=\u041d\u0435\u043f\u0440\u0435\u0434\u0432\u0438\u0434\u0435\u043d\u043d\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0435
|
||||
v4_num=\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e ipv4
|
||||
v6_num=\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e ipv6
|
||||
always=\u041f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e
|
||||
schedule=Scheduler
|
||||
cancel_all=Cancel all configurations!
|
||||
pre_version=Previous Version
|
||||
approved_all=Approve all configurations!
|
||||
protection_list_manage=Protection List Manage
|
||||
effective=Effective
|
||||
admin_user_warn=Admin User Warn
|
||||
interface_total=Interface Total
|
||||
service_total=Service Total
|
||||
none_file_tip=Please Choose File!
|
||||
schedule=\u041f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0449\u0438\u043a
|
||||
cancel_all=\u041e\u0442\u043c\u0435\u043d\u0438\u0442\u044c \u0432\u0441\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438%21
|
||||
pre_version=\u041f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0430\u044f \u0412\u0435\u0440\u0441\u0438\u044f
|
||||
approved_all=\u0423\u0442\u0432\u0440\u0435\u0434\u0438\u0442\u044c \u0432\u0441\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438%21
|
||||
protection_list_manage=\u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0421\u043f\u0438\u0441\u043a\u043e\u043c \u0417\u0430\u0449\u0438\u0442\u044b%21
|
||||
effective=\u0410\u043a\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435
|
||||
admin_user_warn=\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0410\u0434\u043c\u0438\u043d
|
||||
interface_total=\u041e\u0431\u0449\u0435\u0435 \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0418\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430
|
||||
service_total=\u041e\u0431\u0449\u0435\u0435 \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0421\u0435\u0440\u0432\u0438\u0441\u0430
|
||||
none_file_tip=\u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0444\u0430\u0439\u043b%21
|
||||
the_same_ip_type=IP-\u0430\u0434\u0440\u0435\u0441 \u043A\u043B\u0438\u0435\u043D\u0442\u0430 \u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0434\u043E\u043B\u0436\u043D\u044B \u0438\u043C\u0435\u0442\u044C \u043E\u0434\u0438\u043D \u0438 \u0442\u043E\u0442 \u0436\u0435 \u0442\u0438\u043F.
|
||||
src_ip_pattern=Client IP Pattern
|
||||
dest_ip_pattern=Server IP Pattern
|
||||
src_port_pattern=Client Port Pattern
|
||||
dest_port_pattern=Server Port Pattern
|
||||
src_ip_pattern=\u0424\u043e\u0440\u043c\u0430\u0442 ip \u041a\u043b\u0438\u0435\u043d\u0442\u0430
|
||||
dest_ip_pattern=\u0424\u043e\u0440\u043c\u0430\u0442 ip \u0421\u0435\u0440\u0432\u0435\u0440\u0430
|
||||
src_port_pattern=\u0424\u043e\u0440\u043c\u0430\u0442 \u041f\u043e\u0440\u0442\u0430 \u041a\u043b\u0438\u0435\u043d\u0442\u0430
|
||||
dest_port_pattern=\u0424\u043e\u0440\u043c\u0430\u0442 \u041f\u043e\u0440\u0442\u0430 \u0421\u0435\u0440\u0432\u0435\u0440\u0430
|
||||
url_group_configuration=URL Group Configuration
|
||||
dns_keyword_group_configuration=DNS Keyword Group Configuration
|
||||
app_ip_correlation=APP IP Correlation
|
||||
ip_group=IP Group
|
||||
common_ip_config=Common IP Config
|
||||
common_group=Common Group
|
||||
dns_keyword_group_manage=DNS Keyword Group Manage
|
||||
old_asn_group_manage=ASN Group
|
||||
url_group_manage=URL Group Manage
|
||||
range_cross=Found intersections between Server IP address and Client IP address
|
||||
app_ip_correlation=APP IP Correlation
|
||||
public_private_file_error=Public-private key mismatch
|
||||
range_cross=\u041d\u0430\u0439\u0434\u0435\u043d\u044b \u043f\u0435\u0440\u0435\u0441\u0435\u0447\u0435\u043d\u0438\u044f \u043c\u0435\u0436\u0434\u0443 ip-\u0430\u0434\u0440\u0435\u0441\u043e\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0438 ip-\u0430\u0434\u0440\u0435\u0441\u043e\u043c \u043a\u043b\u0438\u0435\u043d\u0442\u0430
|
||||
app_ip_correlation=\u041a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u044f ip-\u0430\u0434\u0440\u0435\u0441\u043e\u0432 \u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439
|
||||
public_private_file_error=\u041d\u0435\u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u043e-\u043f\u0440\u0438\u0432\u0430\u0442\u043d\u043e\u0433\u043e \u043a\u043b\u044e\u0447\u0430.
|
||||
|
||||
@@ -706,7 +706,7 @@ ir_type=\u590d\u7528\u7c7b\u578b
|
||||
dns_strategy_id=DNS\u7b56\u7565ID
|
||||
no_strategy=\u9ed8\u8ba4\u7b56\u7565
|
||||
domain=\u57df\u540d
|
||||
app_ip_config=APP\u534F\u8BAEIP\u914D\u7F6E
|
||||
app_ip_config=APP IP
|
||||
bytes=\u5b57\u8282
|
||||
app_http_config=APP HTTP\u7279\u5f81
|
||||
app_domain_config=APP\u57df\u540d\u7279\u5f81
|
||||
@@ -1133,11 +1133,11 @@ av_voip_reject=VoIP\u963b\u65ad
|
||||
label_proto_source=\u534f\u8bae\u6765\u6e90
|
||||
label_behav_source=\u884c\u4e3a\u6765\u6e90
|
||||
label_app_source=\u5e94\u7528\u6765\u6e90
|
||||
packet=\u5305
|
||||
stream=\u6D41
|
||||
packet=Packet
|
||||
stream=Stream
|
||||
protocol_menu=Protocol
|
||||
advanced=Advanced
|
||||
protocol_identify=\u57FA\u7840\u534F\u8BAE
|
||||
protocol_identify=Protocol Identify
|
||||
MM_FILE_DIGEST=\u6587\u4ef6\u6458\u8981
|
||||
NTC_ASN_IP=ASN
|
||||
NTC_STREAMING_MEDIA_URL=URL
|
||||
|
||||
@@ -9,6 +9,9 @@ page.pageSize=20
|
||||
#\u5206\u9875\u914d\u7f6e
|
||||
page.count=0
|
||||
|
||||
#\u7d22\u5f15\u9875\u8def\u5f84
|
||||
web.view.index=/nis/index
|
||||
|
||||
#\u7f13\u5b58\u8bbe\u7f6e
|
||||
ehcache.configFile=cache/ehcache-local.xml
|
||||
#ehcache.configFile=cache/ehcache-rmi.xml
|
||||
@@ -57,12 +60,71 @@ version=V1.0.0
|
||||
#\u4e0a\u4f20\u6587\u4ef6\u7edd\u5bf9\u8def\u5f84, \u8def\u5f84\u4e2d\u4e0d\u5141\u8bb8\u5305\u542b\u201cuserfiles\u201d
|
||||
userfiles.basedir=upload
|
||||
|
||||
|
||||
#============================#
|
||||
#===== webservice settings ======#
|
||||
#============================#
|
||||
|
||||
#ESB\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\u1e69\ufffd\ufffd\u0373\u04bb\ufffd\ufffd\u05b7
|
||||
webservice.esb.endpoint=http://10.55.0.197:7879/TongServiceProxy_doprocess/services/WebService1/
|
||||
#webservice RID
|
||||
webservice.rid=XFBL
|
||||
|
||||
#webservice user SID
|
||||
webservice.yh.sid=s_2016_x2000
|
||||
|
||||
#webservice office SID
|
||||
webservice.jg.sid=s_2015_x2000
|
||||
|
||||
#webservice data dict SID
|
||||
webservice.data.dict.sid=s_2031_x2000
|
||||
|
||||
#webservice data dict bm SID
|
||||
webservice.data.dict.bm.sid=s_2032_x2000
|
||||
|
||||
#webservice data dict code SID
|
||||
webservice.data.dict.code.sid=s_2042_0660BD17-35E4-4482-AA3A-556F2C024902
|
||||
|
||||
#webservice request timeout for seconds
|
||||
webservice.request.timeout=30
|
||||
|
||||
#\ufffd\ufffd\ufffd\ufffd\ufffdURL
|
||||
webservice.jg.service.url=http://10.55.0.155:8080/jgService
|
||||
|
||||
#\ufffd\u00fb\ufffd\ufffd\ufffd\ufffd\ufffdURL
|
||||
webservice.yh.service.url=http://10.55.0.155:8080/ryService
|
||||
|
||||
#\ufffd\ufffd\ufffd\ufffd\u05b5\ufffdURL
|
||||
webservice.data.dict.service.url=http://10.55.0.155:8080/sjzdService
|
||||
|
||||
#\ufffd\ufffd\ufffd\ufffd\u05b5\ufffd\ufffd\ufffd\ufffdURL
|
||||
webservice.data.dict.bm.url=http://10.55.0.155:8080/sjzdbmService
|
||||
|
||||
#\ufffd\ufffd\ufffd\ufffd\ufffd\ufffdURL
|
||||
webservice.data.code.url=http://10.55.0.155:8080/sjmbService
|
||||
|
||||
#webservice\ufffd\u04ff\ufffd\ufffd\ufffd\ufffd\u00ff\u04b3\ufffd\ufffd\ufffd\ufffd
|
||||
webservice.data.pagesize = 2000
|
||||
#webservice\ufffd\ufffd\u01f0\u012c\ufffd\ufffd\u04b3
|
||||
webservice.data.currentpage = 1
|
||||
|
||||
#webservice \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd
|
||||
webservice.jgmb.name=CK_T_JC_RY
|
||||
#webservice \ufffd\u00fb\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd
|
||||
webservice.yhmb.name=CK_T_YH_RY
|
||||
#webservice\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd \u022b\ufffd\ufffd
|
||||
webservice.method.name.ql=getData
|
||||
# webservice\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd \ufffd\ufffd\ufffd\ufffd
|
||||
webservice.method.name.zl=getDataZL
|
||||
|
||||
# redis\u914d\u7f6e\u6587\u4ef6
|
||||
#redis \u5404\u4e2a\u5206\u7247\u7684 IP\u7aef\u53e3
|
||||
redis.cluster.host_port=10.0.6.32:6379,10.0.6.32:6380,10.0.6.32:6381,10.0.6.33:6379,10.0.6.33:6380,10.0.6.33:6381
|
||||
|
||||
|
||||
#\u4e2d\u5fc3\u73b0\u573aredis\u5730\u5740\u548c\u7aef\u53e3
|
||||
#redis.cluster.host_port=10.174.196.33:6379,10.174.196.33:6380,10.174.196.33:6381,10.174.196.34:6379,10.174.196.34:6380,10.174.196.34:6381,10.174.196.35:6379,10.174.196.35:6380,10.174.196.35:6381,10.174.196.36:6379,10.174.196.36:6380,10.174.196.36:6381,10.174.196.37:6379,10.174.196.37:6380,10.174.196.37:6381,10.174.196.38:6379,10.174.196.38:6380,10.174.196.38:6381,10.174.196.39:6379,10.174.196.39:6380,10.174.196.39:6381
|
||||
|
||||
redis.cluster.connectiontimeout=5000
|
||||
redis.cluster.sotimeout=5000
|
||||
redis.cluster.maxattempts=3
|
||||
@@ -107,12 +169,54 @@ http.pool.maxTotal=200
|
||||
http.pool.defaultMaxPerRoute=100
|
||||
##########HTTPCLIENT POOL END###################
|
||||
search.dateformat=yyyy-MM-dd HH:mm:ss
|
||||
search.eshostandport_A=10.0.6.115:9200
|
||||
search.eshostandport_B=10.0.6.115:9200
|
||||
search.eshostandport_C=10.0.6.115:9200
|
||||
|
||||
#search.eshostandport=10.174.196.135:9200
|
||||
|
||||
|
||||
#\u65e5\u5fd7\u662f\u5426\u4ecehive\u4e2d\u67e5\u8be2
|
||||
selFromHive=false
|
||||
|
||||
#\u662f\u5426\u83b7\u53d6\u6570\u636e\u4e2d\u5fc3\u67e5\u8be2\u8bb0\u5f55\u7684\u603b\u6761\u6570
|
||||
isGetHiveCount=false
|
||||
|
||||
#\u6bcf\u6b21\u83b7\u53d6\u6570\u636e\u4e2d\u5fc3\u591a\u5c11\u6761\u6570\u636e,\u54b1\u4eec\u5728\u5bf9\u83b7\u53d6\u7684\u6570\u636e\u8fdb\u884c\u5206\u9875\u5904\u7406
|
||||
everyGetHiveDataNum=10000
|
||||
|
||||
#oracle\u6570\u636e\u5e93\u6709\u95ee\u9898\u4e0d\u4eceoracle\u67e5\u8be2\u6570\u636e,\u6240\u6709\u65e5\u5fd7\u6570\u636e\u5747\u4ece\u6570\u636e\u4e2d\u5fc3\u67e5\u8be2
|
||||
onlySelFromHive=false
|
||||
|
||||
#\u662f\u5426\u67e5\u8be2\u795e\u901a\u6570\u636e\u5e93
|
||||
isSelectCluster=true
|
||||
|
||||
#\u7528\u6237\u67e5\u8be2\u65e5\u5fd7\u8d85\u8fc7\u591a\u5c11\u5c0f\u65f6\u53bb\u6570\u636e\u4e2d\u5fc3\u67e5\u8be2
|
||||
dataCenterTime=48
|
||||
|
||||
#\u662f\u5426\u5f00\u542f\u57fa\u7840\u9a8c\u8bc1
|
||||
baseValidate=true
|
||||
|
||||
#\u662f\u5426\u5f00\u542f\u4e1a\u52a1\u9a8c\u8bc1
|
||||
serviceValidate=true
|
||||
|
||||
|
||||
|
||||
#\u65e5\u5fd7\u5b58\u50a8\u672c\u5730\u65f6\u95f4(\u5355\u4f4d\u5c0f\u65f6)
|
||||
logLocalTime=48
|
||||
#\u5b9e\u65f6\u7edf\u8ba1\u9ed8\u8ba4\u67e5\u8be2\u672c\u5730\u4e00\u4e2a\u5c0f\u65f6\u7684\u6570\u636e(\u5355\u4f4d\uff1a\u5c0f\u65f6)
|
||||
reportLocalTime=1
|
||||
|
||||
#\u795e\u901a\u6570\u636e\u5e93\u6700\u65e9\u65e5\u5fd7\u65f6\u95f4(A\u7248\u6beb\u79d2)
|
||||
#2017-08-13 10:07:25
|
||||
clusterAStartTime=1503504000725
|
||||
#\u795e\u901a\u6570\u636e\u5e93\u6700\u65e9\u7ed3\u675f\u65f6\u95f4(B\u7248\u6beb\u79d2)
|
||||
#2017-08-13 10:07:25
|
||||
clusterBStartTime=1503504000725
|
||||
############################################################################################################################################
|
||||
#\u8bbe\u7f6e\u914d\u7f6e\u662f\u5426\u5165\u5e93
|
||||
############################################################################################################################################
|
||||
isCommit=true
|
||||
############################################################################################################################################
|
||||
############################################################################################################################################
|
||||
httpUrl=http://10.0.7.14:9999/galaxy-service/service/cfg/
|
||||
|
||||
@@ -421,7 +421,6 @@
|
||||
<service id="400" functionId="600" serviceType="1" cfgType="1" tableName="asn_ip_cfg" className="AppIpCfg" desc="ASN IP特征">
|
||||
<userRegion regionKey="ASN" regionColumn="userRegion1" userRegionPosition="1"></userRegion>
|
||||
</service>
|
||||
<service id="401" functionId="110" serviceType="1" cfgType="1" tableName="ip_comm_cfg" className="IpCommCfg" desc="IP公共分组域"></service>
|
||||
|
||||
|
||||
</serviceList>
|
||||
@@ -144,7 +144,7 @@ is automatically deleted from the cache by the cache manager, regardless
|
||||
of whether or not it has expired.
|
||||
|
||||
', null);
|
||||
INSERT INTO `help_document` VALUES ('2', 'Control Policy
|
||||
INSERT INTO `help_document` VALUES ('2', 'control_policy.md', 'Control Policy
|
||||
|
||||
On National Proxy System, Individual Control policy rules determine
|
||||
whether to allow, block, redirect or replace a session based on traffic
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
drop PROCEDURE proc_statistics_config;
|
||||
DROP PROCEDURE IF EXISTS `proc_statistics_config`;
|
||||
delimiter ;;
|
||||
CREATE DEFINER=`root`@`%` PROCEDURE `proc_statistics_config`()
|
||||
BEGIN
|
||||
|
||||
@@ -66,7 +67,7 @@ BEGIN
|
||||
|
||||
|
||||
#20190328 增加定时任务后is_audit=1 && (is_valid=1 || is_valid=0) 即为approved (增加cfg_state=4[is_valid=0 && is_audit=1],代表定时任务审核过的),而cfg_state=1仅仅代表审核通过且有效的,界面展示的approved值实际包含cfg_state=4和cfg_state=1
|
||||
set @insert_statistics_sql := concat('insert into cfg_num_statistics(statistic_time,function_id,service_id,action,compile_id,cfg_state) select ','''',ntime,'''',',','function_id,service_id,action,compile_id,if(is_valid=-1,-1,if(is_valid=1,1,if(is_audit=0,0,if(is_audit=1,4,if(is_audit=2,2,if(is_audit=3,3,0)))))) cfg_state from ',tabName);
|
||||
set @insert_statistics_sql := concat('insert into cfg_num_statistics(statistic_time,audit_time,function_id,service_id,action,compile_id,cfg_state) select ','''',ntime,'''',',','audit_time,function_id,service_id,action,compile_id,if(is_valid=-1,-1,if(is_valid=1,1,if(is_audit=0,0,if(is_audit=1,4,if(is_audit=2,2,if(is_audit=3,3,0)))))) cfg_state from ',tabName);
|
||||
|
||||
|
||||
PREPARE execs FROM @insert_statistics_sql;
|
||||
@@ -130,3 +131,8 @@ BEGIN
|
||||
END IF;
|
||||
COMMIT;
|
||||
END
|
||||
;;
|
||||
delimiter ;
|
||||
|
||||
#执行存储过程
|
||||
call exec_procs();
|
||||
@@ -73,32 +73,32 @@ UPDATE function_region_dict SET config_ip_port_show=3 WHERE function_id=401;
|
||||
#ASN IP修改只显示目的IP
|
||||
UPDATE function_region_dict SET config_ip_port_show=3 WHERE function_id=600;
|
||||
#sql 更新字段语句
|
||||
UPDATE app_ip_cfg c SET c.dest_ip_pattern =(SELECT b.src_ip_pattern FROM ( SELECT a.src_ip_pattern,a.`cfg_id` FROM app_ip_cfg a) b WHERE b.cfg_id=c.`cfg_id`);
|
||||
UPDATE app_ip_cfg c SET c.dest_port_pattern =(SELECT b.src_port_pattern FROM ( SELECT a.src_port_pattern,a.`cfg_id` FROM app_ip_cfg a) b WHERE b.cfg_id=c.`cfg_id`);
|
||||
UPDATE app_ip_cfg c SET c.dest_ip_pattern =(SELECT b.src_ip_pattern FROM ( SELECT a.src_ip_pattern,a.`cfg_id` FROM ip_port_cfg a) b WHERE b.cfg_id=c.`cfg_id`)
|
||||
UPDATE app_ip_cfg c SET c.dest_port_pattern =(SELECT b.src_port_pattern FROM ( SELECT a.src_port_pattern,a.`cfg_id` FROM port_port_cfg a) b WHERE b.cfg_id=c.`cfg_id`)
|
||||
|
||||
UPDATE app_ip_range_cfg c SET c.dest_ip_pattern =(SELECT b.src_ip_pattern FROM ( SELECT a.src_ip_pattern,a.`cfg_id` FROM app_ip_range_cfg a) b WHERE b.cfg_id=c.`cfg_id`);
|
||||
UPDATE app_ip_range_cfg c SET c.dest_port_pattern =(SELECT b.src_port_pattern FROM ( SELECT a.src_port_pattern,a.`cfg_id` FROM app_ip_range_cfg a) b WHERE b.cfg_id=c.`cfg_id`);
|
||||
UPDATE app_ip_range_cfg c SET c.dest_ip_pattern =(SELECT b.src_ip_pattern FROM ( SELECT a.src_ip_pattern,a.`cfg_id` FROM ip_port_cfg a) b WHERE b.cfg_id=c.`cfg_id`)
|
||||
UPDATE app_ip_range_cfg c SET c.dest_port_pattern =(SELECT b.src_port_pattern FROM ( SELECT a.src_port_pattern,a.`cfg_id` FROM port_port_cfg a) b WHERE b.cfg_id=c.`cfg_id`)
|
||||
|
||||
UPDATE area_ip_cfg c SET c.dest_ip_pattern =(SELECT b.src_ip_pattern FROM ( SELECT a.src_ip_pattern,a.`cfg_id` FROM area_ip_cfg a) b WHERE b.cfg_id=c.`cfg_id`);
|
||||
UPDATE area_ip_cfg c SET c.dest_port_pattern =(SELECT b.src_port_pattern FROM ( SELECT a.src_port_pattern,a.`cfg_id` FROM area_ip_cfg a) b WHERE b.cfg_id=c.`cfg_id`);
|
||||
UPDATE area_ip_cfg c SET c.dest_ip_pattern =(SELECT b.src_ip_pattern FROM ( SELECT a.src_ip_pattern,a.`cfg_id` FROM ip_port_cfg a) b WHERE b.cfg_id=c.`cfg_id`)
|
||||
UPDATE area_ip_cfg c SET c.dest_port_pattern =(SELECT b.src_port_pattern FROM ( SELECT a.src_port_pattern,a.`cfg_id` FROM port_port_cfg a) b WHERE b.cfg_id=c.`cfg_id`)
|
||||
|
||||
UPDATE asn_ip_cfg c SET c.dest_ip_pattern =(SELECT b.src_ip_pattern FROM ( SELECT a.src_ip_pattern,a.`cfg_id` FROM asn_ip_cfg a) b WHERE b.cfg_id=c.`cfg_id`);
|
||||
UPDATE asn_ip_cfg c SET c.dest_port_pattern =(SELECT b.src_port_pattern FROM ( SELECT a.src_port_pattern,a.`cfg_id` FROM asn_ip_cfg a) b WHERE b.cfg_id=c.`cfg_id`);
|
||||
UPDATE asn_ip_cfg c SET c.dest_ip_pattern =(SELECT b.src_ip_pattern FROM ( SELECT a.src_ip_pattern,a.`cfg_id` FROM ip_port_cfg a) b WHERE b.cfg_id=c.`cfg_id`)
|
||||
UPDATE asn_ip_cfg c SET c.dest_port_pattern =(SELECT b.src_port_pattern FROM ( SELECT a.src_port_pattern,a.`cfg_id` FROM port_port_cfg a) b WHERE b.cfg_id=c.`cfg_id`)
|
||||
|
||||
UPDATE av_cont_ip_cfg c SET c.dest_ip_pattern =(SELECT b.src_ip_pattern FROM ( SELECT a.src_ip_pattern,a.`cfg_id` FROM av_cont_ip_cfg a) b WHERE b.cfg_id=c.`cfg_id`);
|
||||
UPDATE av_cont_ip_cfg c SET c.dest_port_pattern =(SELECT b.src_port_pattern FROM ( SELECT a.src_port_pattern,a.`cfg_id` FROM av_cont_ip_cfg a) b WHERE b.cfg_id=c.`cfg_id`);
|
||||
UPDATE av_cont_ip_cfg c SET c.dest_ip_pattern =(SELECT b.src_ip_pattern FROM ( SELECT a.src_ip_pattern,a.`cfg_id` FROM ip_port_cfg a) b WHERE b.cfg_id=c.`cfg_id`)
|
||||
UPDATE av_cont_ip_cfg c SET c.dest_port_pattern =(SELECT b.src_port_pattern FROM ( SELECT a.src_port_pattern,a.`cfg_id` FROM port_port_cfg a) b WHERE b.cfg_id=c.`cfg_id`)
|
||||
|
||||
UPDATE av_pic_ip_cfg c SET c.dest_ip_pattern =(SELECT b.src_ip_pattern FROM ( SELECT a.src_ip_pattern,a.`cfg_id` FROM av_pic_ip_cfg a) b WHERE b.cfg_id=c.`cfg_id`);
|
||||
UPDATE av_pic_ip_cfg c SET c.dest_port_pattern =(SELECT b.src_port_pattern FROM ( SELECT a.src_port_pattern,a.`cfg_id` FROM av_pic_ip_cfg a) b WHERE b.cfg_id=c.`cfg_id`);
|
||||
UPDATE av_pic_ip_cfg c SET c.dest_ip_pattern =(SELECT b.src_ip_pattern FROM ( SELECT a.src_ip_pattern,a.`cfg_id` FROM ip_port_cfg a) b WHERE b.cfg_id=c.`cfg_id`)
|
||||
UPDATE av_pic_ip_cfg c SET c.dest_port_pattern =(SELECT b.src_port_pattern FROM ( SELECT a.src_port_pattern,a.`cfg_id` FROM port_port_cfg a) b WHERE b.cfg_id=c.`cfg_id`)
|
||||
|
||||
UPDATE av_voip_ip_cfg c SET c.dest_ip_pattern =(SELECT b.src_ip_pattern FROM ( SELECT a.src_ip_pattern,a.`cfg_id` FROM av_voip_ip_cfg a) b WHERE b.cfg_id=c.`cfg_id`);
|
||||
UPDATE av_voip_ip_cfg c SET c.dest_port_pattern =(SELECT b.src_port_pattern FROM ( SELECT a.src_port_pattern,a.`cfg_id` FROM av_voip_ip_cfg a) b WHERE b.cfg_id=c.`cfg_id`);
|
||||
UPDATE av_voip_ip_cfg c SET c.dest_ip_pattern =(SELECT b.src_ip_pattern FROM ( SELECT a.src_ip_pattern,a.`cfg_id` FROM ip_port_cfg a) b WHERE b.cfg_id=c.`cfg_id`)
|
||||
UPDATE av_voip_ip_cfg c SET c.dest_port_pattern =(SELECT b.src_port_pattern FROM ( SELECT a.src_port_pattern,a.`cfg_id` FROM port_port_cfg a) b WHERE b.cfg_id=c.`cfg_id`)
|
||||
|
||||
UPDATE ddos_ip_cfg c SET c.dest_ip_pattern =(SELECT b.src_ip_pattern FROM ( SELECT a.src_ip_pattern,a.`cfg_id` FROM ddos_ip_cfg a) b WHERE b.cfg_id=c.`cfg_id`);
|
||||
UPDATE ddos_ip_cfg c SET c.dest_port_pattern =(SELECT b.src_port_pattern FROM ( SELECT a.src_port_pattern,a.`cfg_id` FROM ddos_ip_cfg a) b WHERE b.cfg_id=c.`cfg_id`);
|
||||
UPDATE ddos_ip_cfg c SET c.dest_ip_pattern =(SELECT b.src_ip_pattern FROM ( SELECT a.src_ip_pattern,a.`cfg_id` FROM ip_port_cfg a) b WHERE b.cfg_id=c.`cfg_id`)
|
||||
UPDATE ddos_ip_cfg c SET c.dest_port_pattern =(SELECT b.src_port_pattern FROM ( SELECT a.src_port_pattern,a.`cfg_id` FROM port_port_cfg a) b WHERE b.cfg_id=c.`cfg_id`)
|
||||
|
||||
UPDATE dns_ip_cfg c SET c.dest_ip_pattern =(SELECT b.src_ip_pattern FROM ( SELECT a.src_ip_pattern,a.`cfg_id` FROM dns_ip_cfg a) b WHERE b.cfg_id=c.`cfg_id`);
|
||||
UPDATE dns_ip_cfg c SET c.dest_port_pattern =(SELECT b.src_port_pattern FROM ( SELECT a.src_port_pattern,a.`cfg_id` FROM dns_ip_cfg a) b WHERE b.cfg_id=c.`cfg_id`);
|
||||
UPDATE dns_ip_cfg c SET c.dest_ip_pattern =(SELECT b.src_ip_pattern FROM ( SELECT a.src_ip_pattern,a.`cfg_id` FROM ip_port_cfg a) b WHERE b.cfg_id=c.`cfg_id`)
|
||||
UPDATE dns_ip_cfg c SET c.dest_port_pattern =(SELECT b.src_port_pattern FROM ( SELECT a.src_port_pattern,a.`cfg_id` FROM port_port_cfg a) b WHERE b.cfg_id=c.`cfg_id`)
|
||||
|
||||
UPDATE ip_port_cfg c SET c.dest_ip_pattern =(SELECT b.src_ip_pattern FROM ( SELECT a.src_ip_pattern,a.`cfg_id` FROM ip_port_cfg a) b WHERE b.cfg_id=c.`cfg_id`);
|
||||
UPDATE ip_port_cfg c SET c.dest_port_pattern =(SELECT b.src_port_pattern FROM ( SELECT a.src_port_pattern,a.`cfg_id` FROM ip_port_cfg a) b WHERE b.cfg_id=c.`cfg_id`);
|
||||
UPDATE ip_port_cfg c SET c.dest_ip_pattern =(SELECT b.src_ip_pattern FROM ( SELECT a.src_ip_pattern,a.`cfg_id` FROM ip_port_cfg a) b WHERE b.cfg_id=c.`cfg_id`)
|
||||
UPDATE ip_port_cfg c SET c.dest_port_pattern =(SELECT b.src_port_pattern FROM ( SELECT a.src_port_pattern,a.`cfg_id` FROM port_port_cfg a) b WHERE b.cfg_id=c.`cfg_id`)
|
||||
@@ -1,17 +0,0 @@
|
||||
--修改实时报表->流量统计->协议统计 国际化代码
|
||||
UPDATE sys_menu SET code='protocol_statistics', name ='Protocol Statistics' WHERE id = 1215
|
||||
|
||||
--修改实时报表->流量统计->流量统计 国际化代码
|
||||
UPDATE sys_menu SET code='traffic_statistics' WHERE id = 1207 >
|
||||
|
||||
--修改实时报表->流量统计->活跃IP统计 国际化代码
|
||||
UPDATE sys_menu SET code='active_ip_statistics' WHERE id = 1211 >
|
||||
|
||||
--修改实时报表->流量统计->App统计 国际化代码
|
||||
UPDATE sys_menu SET code='app_statistics' WHERE id = 1213 >
|
||||
|
||||
--修改实时报表->流量统计->服务统计 国际化代码
|
||||
UPDATE sys_menu SET code='service_statistics' WHERE id = 1209 >
|
||||
|
||||
--修改实时报表->流量统计->网站统计 国际化代码
|
||||
UPDATE sys_menu SET code='website_statistics' WHERE id = 1205 >
|
||||
@@ -1,67 +0,0 @@
|
||||
/*
|
||||
SQLyog Professional v12.08 (64 bit)
|
||||
MySQL - 10.2.14-MariaDB : Database - ntc_test
|
||||
*********************************************************************
|
||||
*/
|
||||
|
||||
|
||||
/*!40101 SET NAMES utf8 */;
|
||||
|
||||
/*!40101 SET SQL_MODE=''*/;
|
||||
|
||||
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
|
||||
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
|
||||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
/*Table structure for table `ip_comm_cfg` */
|
||||
|
||||
CREATE TABLE `ip_comm_cfg` (
|
||||
`cfg_id` BIGINT(20) NOT NULL AUTO_INCREMENT COMMENT '主键,自增',
|
||||
`cfg_desc` VARCHAR(128) DEFAULT NULL,
|
||||
`ip_type` INT(11) NOT NULL COMMENT 'IPV4=4,IPV6=6',
|
||||
`direction` INT(11) NOT NULL COMMENT '0双向,1单向,默认缺省为双向。',
|
||||
`protocol` INT(11) NOT NULL COMMENT '6表示tcp,17表示udp,0表示任意',
|
||||
`protocol_id` INT(11) NOT NULL COMMENT '非0时,maat规范需写入通用IP配置表与通用协议类型配置表 此表固定写0',
|
||||
`action` INT(11) NOT NULL COMMENT '1:阻断,2:监测, 5: FD 白名单,6:监测白名单,7: FD 监测都白名单,应与业务ID所代表的逻辑相匹配,8-灰名单',
|
||||
`is_valid` INT(11) NOT NULL COMMENT '0无效,1有效,-1删除\r\n1) 未审核时配置可删除\r\n2) 审核通过,此字段置1\r\n3) 取消审核通过,此字段置0',
|
||||
`is_audit` INT(11) NOT NULL COMMENT '0未审核,1审核通过,2审核未通过,3取消审核通过\r\n1) 审核未通过,配置可修改\r\n2) 审核通过,配置不可删除,只能取消审核通过',
|
||||
`creator_id` INT(11) NOT NULL COMMENT '取自sys_user.id',
|
||||
`create_time` DATETIME NOT NULL,
|
||||
`editor_id` INT(11) DEFAULT NULL COMMENT '取自sys_user.id',
|
||||
`edit_time` DATETIME DEFAULT NULL,
|
||||
`auditor_id` INT(11) DEFAULT NULL COMMENT '取自sys_user.id',
|
||||
`audit_time` DATETIME DEFAULT NULL,
|
||||
`service_id` INT(11) NOT NULL COMMENT '参考系统业务类型管理表',
|
||||
`request_id` INT(11) NOT NULL COMMENT '取自request_info.id',
|
||||
`compile_id` INT(11) NULL COMMENT '取自服务接口返回的maat配置的编译id,配置初始入库时获取。',
|
||||
`is_area_effective` INT(11) NOT NULL COMMENT '0否,1是',
|
||||
`classify` VARCHAR(128) DEFAULT NULL COMMENT '分类id,多个用英文逗号分隔',
|
||||
`attribute` VARCHAR(128) DEFAULT NULL COMMENT '性质id,多个用英文逗号分隔',
|
||||
`lable` VARCHAR(128) DEFAULT NULL COMMENT '标签id,多个用英文逗号分隔',
|
||||
`area_effective_ids` VARCHAR(1024) DEFAULT NULL COMMENT '多个英文逗号分隔',
|
||||
`function_id` INT(11) NOT NULL,
|
||||
`cfg_region_code` INT(11) DEFAULT NULL,
|
||||
`cfg_type` VARCHAR(64) DEFAULT NULL,
|
||||
`src_ip_pattern` INT(11) DEFAULT NULL COMMENT '源ip格式',
|
||||
`src_ip_address` VARCHAR(128) NOT NULL,
|
||||
`src_port_pattern` INT(11) DEFAULT NULL COMMENT '源端口格式',
|
||||
`src_port` VARCHAR(16) NOT NULL,
|
||||
`dest_ip_address` VARCHAR(128) NOT NULL,
|
||||
`dest_port` VARCHAR(16) NOT NULL,
|
||||
`ratelimit` VARCHAR(10) DEFAULT NULL COMMENT '限速比例,0到1之间',
|
||||
`user_region1` VARCHAR(1024) DEFAULT NULL COMMENT '预留自定义域1',
|
||||
`user_region2` VARCHAR(1024) DEFAULT NULL COMMENT '预留自定义域2',
|
||||
`user_region3` VARCHAR(1024) DEFAULT NULL COMMENT '预留自定义域3',
|
||||
`user_region4` VARCHAR(1024) DEFAULT NULL COMMENT '预留自定义域4',
|
||||
`user_region5` VARCHAR(1024) DEFAULT NULL COMMENT '预留自定义域5',
|
||||
`cancel_request_id` INT(11) DEFAULT NULL COMMENT '取消审核来函',
|
||||
`dest_ip_pattern` INT(11) DEFAULT NULL COMMENT '目的ip格式',
|
||||
`dest_port_pattern` INT(11) DEFAULT NULL COMMENT '目的ip格式',
|
||||
`region_id` INT(11) DEFAULT NULL COMMENT '域ID',
|
||||
`group_id` INT(11) DEFAULT NULL COMMENT '组ID',
|
||||
PRIMARY KEY (`cfg_id`)
|
||||
) ENGINE=INNODB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
||||
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
||||
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
|
||||
@@ -1,2 +0,0 @@
|
||||
INSERT INTO function_service_dict (function_id,protocol_id,ACTION,action_code,service_id,service_name,service_desc,is_valid,creator_id,create_time,region_code,is_import,sort) VALUES(110,0,1,'monit',400,'ip_group','ip_group',1,1,NULL,1,1,1);
|
||||
INSERT INTO function_region_dict (function_id,config_district,config_region_code,config_region_value,config_desc,is_valid,is_maat,region_type,creator_id,create_time,config_ip_type,config_ip_pattern,config_port_pattern,config_direction,config_protocol,config_ip_port_show,config_region_sort,is_import)VALUES(110,'',0,'ip_group_region','ip组IP',1,1,1,1,NOW(),'4,6','1,3;1,3','1;1',0,0,3,1,1);
|
||||
612
src/main/resources/sql/deploymentsql/help_document.sql
Normal file
612
src/main/resources/sql/deploymentsql/help_document.sql
Normal file
@@ -0,0 +1,612 @@
|
||||
-- ----------------------------
|
||||
-- Table structure for help_document
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `help_document`;
|
||||
CREATE TABLE `help_document` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`file_name` varchar(100) DEFAULT '',
|
||||
`file_comment` text DEFAULT NULL,
|
||||
`back_file_comment` text DEFAULT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `INDEX_FILE_NAME` (`file_name`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=45 DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of help_document
|
||||
-- ----------------------------
|
||||
INSERT INTO `help_document` VALUES ('1', 'cache_policy.md', 'Cache Policy
|
||||
|
||||
On National Proxy System, Individual Cache policy rules determine
|
||||
whether to cache or not based on traffic attributes, such as URL and
|
||||
Cookies. For cache action, the optimization parameters are:
|
||||
|
||||
*A Cache key* - is a unique string that lets the National Proxy System
|
||||
look for web content when requests hit them. It<49><74>s made up of a hostname,
|
||||
path, and cookie parts. By default, the Proxy use the entire URL as the
|
||||
cache key. Selecting the correct cache key will ensure maximum cache
|
||||
footprint and increase cache hits.
|
||||
|
||||
*Ignore Query String in URL* - in case the query strings doesn<73><6E>t
|
||||
actually indicate that the object need to be different then you could
|
||||
EXCLUDE them from the cache key. For example, after ignoring <20><>sqp<71><70> and
|
||||
<EFBFBD><EFBFBD>rs<EFBFBD><EFBFBD> of URL: <20><>https://example.com/pic.jpg?~~sqp=UAAI&rs=AOn4~~<7E><>.
|
||||
|
||||
*Include Cookie Values* - in case the server send different content for
|
||||
the same URL based on the cookie value, you can include that cookie
|
||||
value as a part of cache key. For example, the server may set a cookie
|
||||
at the client called "prefLang=ru" to record user preferred language,
|
||||
you could add "prefLang" to distinguish different web content.
|
||||
|
||||
*Disable Revalidate* - is an ON-OFF switch. The pragma-no-cache header
|
||||
in a client<6E><74>s request causes the proxy to re-fetch the entire object
|
||||
from the original server, even if the cached copy of the object is
|
||||
fresh. By default this option is switch OFF, which means a client<6E><74>s
|
||||
non-conditional request results in a conditional GET request sent to the
|
||||
original server if the object is already in cache. The conditional
|
||||
request allows the original server to return the 304 Not Modified
|
||||
response, if the content in cache is still fresh. Thereby, the
|
||||
server-side bandwidth and latency consumed are lesser as the full
|
||||
content is not retrieved again from the original server.
|
||||
|
||||
*Cache Dynamic Content* - is an ON-OFF switch. A URL is considered
|
||||
dynamic if it ends in <20><>.asp(x)<29><> or contains a question mark (?), a
|
||||
semicolon (;), or <20><>cgi<67><69>. *Ignore Query String* overrides this option
|
||||
(switch on).
|
||||
|
||||
*Cache Cookied Content* - is an ON-OFF switch. By default, the Proxy
|
||||
does NOT cache cookied content of any type. If this option is switch on,
|
||||
the system cache all cookied content except HTML.
|
||||
|
||||
*Ignore Request no-cache Headers* - is an ON-OFF switch. By default, the
|
||||
proxy strictly observes client Cache-Control: no-cache directives. As
|
||||
known as:
|
||||
|
||||
i. Authorization
|
||||
|
||||
ii. WWW-Authenticate
|
||||
|
||||
iii. Cache-Control: no-store
|
||||
|
||||
iv. Cache-Control: no-cache
|
||||
|
||||
If a requested object contains a no-cache header, then proxy forwards
|
||||
the request to the origin server even if it has a fresh copy in cache.
|
||||
You can configure proxy to ignore client no-cache directives such that
|
||||
it ignores no-cache headers from client requests and serves the object
|
||||
from its cache.
|
||||
|
||||
*Ignore Response no-cache Headers* - is an ON-OFF switch. By default, a
|
||||
response from an origin server with a no-cache header is not stored in
|
||||
the cache. As known as:
|
||||
|
||||
i. Cache-Control: no-store
|
||||
|
||||
ii. Cache-Control: private
|
||||
|
||||
iii. Set-Cookie
|
||||
|
||||
iv. Cache-Control: no-cache
|
||||
|
||||
v. WWW-Authenticate
|
||||
|
||||
vi. Expires header with a value of 0 (zero) or a past date.
|
||||
|
||||
If you configure proxy to ignore no-cache headers, then proxy also
|
||||
ignores no-store headers. The default behavior of observing no-cache
|
||||
directives is appropriate in most cases.
|
||||
|
||||
*Forcing Object Caching* - is an ON-OFF switch. You can force Proxy to
|
||||
cache specific URLs (including dynamic URLs) for a specified duration,
|
||||
regardless of Cache-Control response headers.
|
||||
|
||||
*Minimum Use* - sets the number of times an item must be requested by
|
||||
clients before Proxy caches it. This is useful if the cache is
|
||||
constantly filling up, as it ensures that only the most frequently
|
||||
accessed items are added to the cache. By default, Proxy cache object at
|
||||
its first appearance. The counter resets in every 30 minutes. Note that
|
||||
the requests is counted independently on each processing unit.
|
||||
|
||||
*Max Cache Object Size* - sets the upper limit of an object size, larger
|
||||
object will not be cached. By default, Proxy does not cache object
|
||||
larger than 1 GB.
|
||||
|
||||
*Cache Pinning Time* - configures Proxy to keep certain objects in the
|
||||
cache for a specified time. You can use this option to ensure that the
|
||||
most popular objects are in cache when needed and to prevent cache
|
||||
manager from deleting important objects. Proxy observes Cache-Control
|
||||
headers and pins an object in the cache only if it is indeed cacheable.
|
||||
|
||||
*Max Cache Size* - sets the upper limit of the size of storage for a
|
||||
policy. By default, Proxy uses all available disk space. When the cache
|
||||
size reaches the limit, the cache manager removes the files that were
|
||||
least recently used to bring the cache size back under the limit.
|
||||
|
||||
*Inactive Time* - specifies how long an item can remain in the cache
|
||||
without being accessed. A file that has not been requested for this time
|
||||
is automatically deleted from the cache by the cache manager, regardless
|
||||
of whether or not it has expired.
|
||||
|
||||
', null);
|
||||
INSERT INTO `help_document` VALUES ('2', 'control_policy.md', 'Control Policy
|
||||
|
||||
On National Proxy System, Individual Control policy rules determine
|
||||
whether to allow, block, redirect or replace a session based on traffic
|
||||
attributes, such as URL, request header fields, request body keywords,
|
||||
response header fields, response body keywords, IP address, Subscribe ID
|
||||
and their combination. You could specify these attributes in the submenu
|
||||
of *Control Policy*.
|
||||
|
||||
The attributes are detailed in following context:
|
||||
|
||||
*URL* - From proxy<78><79>s perspective, a HTTP URL consists of a hierarchical
|
||||
sequence of three components: URL = hostname/path[?query] . The URL path
|
||||
name can also be specified by the user in the local writing system. If
|
||||
not already encoded, it is converted to UTF-8, and any characters not
|
||||
part of the basic URL character set are escaped as hexadecimal using
|
||||
percent-encoding; for example, search keywords <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܧڧۡ<DAA7> in Google
|
||||
produces URL<52><4C>
|
||||
|
||||
https://www.google.com/search?q=%D1%80%D1%83%D1%81%D1%81%D0%BA%D0%B8%D0%B9
|
||||
|
||||
To perform policy action on above URL, you could input the whole URL in
|
||||
the input box. Or, you could input original keywords and let the Proxy
|
||||
do the decoding, e.g. <20><>google.com/search<63><68> & <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܧڧۡ<DAA7>. Note that the
|
||||
scheme string MUST be excluded from the URL, it<69><74>s <20><>https://<2F><> in this
|
||||
case.
|
||||
|
||||
NOTE Maximum HTTP/HTTPS URL length is 1023 characters
|
||||
|
||||
*Request Header* - is used to set conditions on request header fields.
|
||||
Header fields are colon-separated key-value pairs in clear-text string
|
||||
format, terminated by a carriage return (CR) and line feed (LF)
|
||||
character sequence. For example, <20><>user-agent: Mozilla/5.0 (Windows NT
|
||||
10.0; Win64; x64)<29><> is a header filed in request header. The *Matching
|
||||
District* is used to configure the field<6C><64>s key, if the key was
|
||||
presented, the Proxy will search in the value for *Keywords*.
|
||||
|
||||
*Response Header* - is used to set conditions on response header fields.
|
||||
Its configuration is similar to *Request Header*.
|
||||
|
||||
*Request Body* - is used to set conditions on request<73><74>s body message.
|
||||
The Proxy searches the pre-configured *Keywords* in it. You can
|
||||
configure non-ASCII or non-utf8 keywords by turn on HEX.
|
||||
|
||||
*Response Body* - is used to set conditions on response<73><65>s body message.
|
||||
Its configuration is similar to *Request Body*.
|
||||
|
||||
You could select one of the five actions for above attributes, as known
|
||||
as:
|
||||
|
||||
*Monitor* - the Proxy produce a log to record matched HTTP session
|
||||
information.
|
||||
|
||||
*Block* - the Proxy terminate matched HTTP session with an error page
|
||||
and produce a log. You MUST specify a *Response Code* and a *Response
|
||||
Content* to generate an error page.
|
||||
|
||||
*Redirect*<2A><>the Proxy redirect matched HTTP session to a predefined URL.
|
||||
Since redirection need to be performed before delivering response to
|
||||
client, condition of response body is not applicable in this action. You
|
||||
MUST configure the redirect response via *Response Code* and *Response
|
||||
URL*. The Response URL MUST start with a scheme (http:// or https://).
|
||||
You SHOULD NOT select **301** as *Response Code* unless you exactly know
|
||||
what you are doing. This action produces a log.
|
||||
|
||||
*Replace*<2A><>the Proxy *Searches in* a given HTTP part to *Find* a given
|
||||
string, and *Replace* any matches *with* another given string. If no
|
||||
match was found, the session remained untouched. For performance
|
||||
concerns, condition of request body and response body is not available
|
||||
in this action. For example, you can configure the Proxy to search in
|
||||
the response body of URL <20><>www.example.com/index.html<6D><6C>, find every
|
||||
<EFBFBD><EFBFBD>string1<EFBFBD><EFBFBD> and replace with <20><>string2<67><32>. This action produces a log.
|
||||
|
||||
*Whitelist*<2A><>the Proxy pass-through the matched sessions and produce no
|
||||
log.
|
||||
|
||||
National Proxy will enforce policy check on traffic attributes, policies
|
||||
have been created that there will be some that overlap or are subsets of
|
||||
the parameters that the policies use to determine which policy should be
|
||||
matched against the traffic. The execute order of policy is <20><>first
|
||||
match, first served<65><64>. In case of an incoming traffic attribute matches
|
||||
one more policy, the priority order is *Whitelist \> Block \>
|
||||
Redirect \> Replace \> Monitor*, action with higher priority overrides
|
||||
others. If multiple policies of same action are matched, policy with
|
||||
bigger ID number is precedence.
|
||||
', null);
|
||||
INSERT INTO `help_document` VALUES ('3', 'intercept_policy.md', 'Intercept Policy
|
||||
|
||||
An Intercept policy rule allows you to define traffic that you want the
|
||||
National Proxy to decrypt and to define traffic that you choose to
|
||||
exclude from decryption because the traffic is personal or because of
|
||||
local regulations. A connection is intercepted/optimized based on
|
||||
traffic attributes, such as IP address, domain name (via SNI matching)
|
||||
and Subscribe ID. You could specify these attributes in *IP Intercept*
|
||||
and *Domain Intercept*.
|
||||
|
||||
Both *IP intercept* and *Domain Intercept* are subject two actions:
|
||||
|
||||
*Intercept*<2A><>the National Proxy System intercepts network traffic for
|
||||
further control policy and cache policy checking. Interception requires
|
||||
certificates to establish the National Proxy as a trusted third party.
|
||||
National Proxy deployed in transparent mode, which means the users don`t
|
||||
have any proxy settings in their browser. When a connection is set to
|
||||
intercept, the proxy terminates the connection and initiates a new
|
||||
connection between client and server. If the connection is SSL
|
||||
encrypted, the original certificate is replaced with a substitute one.
|
||||
|
||||
*Bypass*<2A><>the Proxy passes through the network connection without apply
|
||||
an optimization or policy checking. You can also use bypass action when
|
||||
excluding servers from SSL decryption for technical reasons (the site
|
||||
breaks decryption for reasons such as certificate pinning, unsupported
|
||||
ciphers, or mutual authentication). Apple Store, WhatsApp, Telegram,
|
||||
Microsoft Windows Update are common SSL pinning application. In case of
|
||||
traffic matches one more policy, bypass overrides intercept.
|
||||
|
||||
When *Intercept Related Domains* is enabled, domains that share one
|
||||
certificates with the specified domain are considered as the same. For
|
||||
example, if the intercept facebook.com with I*ntercept Related Domain*
|
||||
option, then \*.xx.fbcdn.net, fb.com, .messenger.com and etc. are also
|
||||
intercepted. There may be side effects that intercept undesired websites
|
||||
that share one certificate. For example, two websites hosted in a same
|
||||
CDN provider (Content Delivery Network) or different products of one
|
||||
company.
|
||||
|
||||
*Key ring* determines which certificate will be used to generate
|
||||
substitute certificate. You could configure key ring through *Proxy
|
||||
Policy Object* page. If no key ring is specified, proxy will use the
|
||||
default one.
|
||||
|
||||
Intercept policy produces no log. You can find out if the interception
|
||||
is successful by checking if the certificate is issued by your
|
||||
pre-configured Root CA. You need a PC which traffic has already directed
|
||||
to the Proxy, and a web browser to test the policy. For Chrome and
|
||||
Microsoft Internet Explorer, you could click the lock icon on the
|
||||
address bar to view certificate. For Firefox, after you clicking the
|
||||
lock icon, click <20><>\><3E><> button to show connection details, click <20><>more
|
||||
information<EFBFBD><EFBFBD>, and then click <20><>view certificate<74><65>. If the browser warning
|
||||
that the connection is not secure, one possible reason is you haven<65><6E>t
|
||||
install/trust the root certificate yet.
|
||||
|
||||
**Note:** You should exercise caution because web applications may not
|
||||
cooperate with SSL interception. Reasons that sites break decryption
|
||||
technically include pinned certificates, mutual authentication,
|
||||
incomplete certificate chains, unsupported ciphers, and non-standard SSL
|
||||
implementation. If a site uses an incomplete certificate chain, the
|
||||
National Proxy doesn<73><6E>t automatically fix the chain as a browser would.
|
||||
You need to manually download the missing sub-CA certificates and load
|
||||
and deploy them onto the proxy.', null);
|
||||
INSERT INTO `help_document` VALUES ('4', 'proxy_policy_object.md', 'Proxy Policy Object
|
||||
|
||||
A policy object is a single object or a collective unit that groups
|
||||
discrete identities such as IP addresses, URLs, applications, or users.
|
||||
With policy objects that are a collective unit, you can reference the
|
||||
object in policy instead of manually selecting multiple objects one at a
|
||||
time. Typically, when creating a policy object, you group objects that
|
||||
require similar permissions in policy.
|
||||
|
||||
1. Key Ring
|
||||
|
||||
On National Proxy System, Key Ring is a pair of private key and public
|
||||
certificate. You can also import a certificate chain containing multiple
|
||||
certificates. Key Ring is a policy object, you can reference it in
|
||||
*Intercept Policy*.
|
||||
|
||||
There are three *Certificate Type:*
|
||||
|
||||
*End-entity Certificate*<2A><> is used for web servers to identify
|
||||
themselves. The *Public Key File* MUST be .p12 format that contains
|
||||
entire certificate chain. The Private Key File could be .pem, .key or
|
||||
.p12 format. This certificate type is not applicable to *Domain
|
||||
Intercept* for it cannot be used to sign other certificates. *Expire
|
||||
After* parameter is also not applicable to end-entity certificate for
|
||||
the same reason.
|
||||
|
||||
*Intermedia Certificate* - is used to sign other certificates. An
|
||||
intermediate certificate must be signed by another intermediate
|
||||
certificate, or a root certificate. The *Public Key File* MUST be .p12
|
||||
format that contains entire certificate chain. The *Expire After*
|
||||
parameter indicates the expiration of the substitute certificate that
|
||||
was issued by this intermedia certificate.
|
||||
|
||||
*Root Certificate* - is used to sign other certificates. The *Public Key
|
||||
File* could be .der, .cer, .crt or .pem format. The *Expire After*
|
||||
parameter has the same meaning as Intermedia Certificate.
|
||||
|
||||
*CRL* - or Certificate Revocation List, is a list of digital
|
||||
certificates that have been revoked by the issuing certificate authority
|
||||
(CA) before their scheduled expiration date and should no longer be
|
||||
trusted. On Key Ring settings, CRL is an HTTP URL that point to a valid
|
||||
.crl file. Invalid URL or .crl file may produce certificate warnings on
|
||||
some browser, i.e. Internet Explorer 11.
|
||||
|
||||
Specification of certificate formats:
|
||||
|
||||
*.pem* <20>C (Privacy-enhanced Electronic Mail) Base64 encoded DER
|
||||
certificate, enclosed between "-----BEGIN CERTIFICATE-----" and
|
||||
"-----END CERTIFICATE-----"
|
||||
|
||||
*.cer, .crt, .der* <20>C usually in binary DER form, but Base64-encoded
|
||||
certificates are common too (see .pem above)
|
||||
|
||||
*.p12* <20>C PKCS\#12, may contain certificate(s) (public) and private keys
|
||||
(without password protected)
|
||||
|
||||
1. Trusted Certificate
|
||||
|
||||
National Proxy System has a build-in trusted certificate authorities
|
||||
list. When the original certificate is issued by a certificate authority
|
||||
that not in the list, the proxy will issued the substitute certificate
|
||||
with an untrusted root certificate, and so consequently, the browser
|
||||
could identify unsecure connections.
|
||||
|
||||
You can add a custom certificate authority to the trusted certificate
|
||||
authorities of the system.
|
||||
|
||||
The certificate MUST be PEM format.
|
||||
|
||||
Following are the National Proxy System<65><6D>s default trusted certificate
|
||||
authorities:
|
||||
|
||||
ACCVRAIZ1
|
||||
|
||||
Actalis Authentication Root CA
|
||||
|
||||
AddTrust External CA Root
|
||||
|
||||
AffirmTrust Commercial
|
||||
|
||||
AffirmTrust Networking
|
||||
|
||||
AffirmTrust Premium
|
||||
|
||||
AffirmTrust Premium ECC
|
||||
|
||||
Amazon Root CA 1
|
||||
|
||||
Amazon Root CA 2
|
||||
|
||||
Amazon Root CA 3
|
||||
|
||||
Amazon Root CA 4
|
||||
|
||||
Atos TrustedRoot 2011
|
||||
|
||||
Autoridad de Certificacion Firmaprofesional CIF A62634068
|
||||
|
||||
Baltimore CyberTrust Root
|
||||
|
||||
Buypass Class 2 Root CA
|
||||
|
||||
Buypass Class 3 Root CA
|
||||
|
||||
CA Disig Root R2
|
||||
|
||||
CFCA EV ROOT
|
||||
|
||||
COMODO Certification Authority
|
||||
|
||||
COMODO ECC Certification Authority
|
||||
|
||||
COMODO RSA Certification Authority
|
||||
|
||||
Certigna
|
||||
|
||||
Certinomis - Root CA
|
||||
|
||||
Class 2 Primary CA
|
||||
|
||||
Certplus Root CA G1
|
||||
|
||||
Certplus Root CA G2
|
||||
|
||||
Certum Trusted Network CA
|
||||
|
||||
Certum Trusted Network CA 2
|
||||
|
||||
Chambers of Commerce Root - 2008
|
||||
|
||||
AAA Certificate Services
|
||||
|
||||
Cybertrust Global Root
|
||||
|
||||
D-TRUST Root Class 3 CA 2 2009
|
||||
|
||||
D-TRUST Root Class 3 CA 2 EV 2009
|
||||
|
||||
DST Root CA X3
|
||||
|
||||
Deutsche Telekom Root CA 2
|
||||
|
||||
DigiCert Assured ID Root CA
|
||||
|
||||
DigiCert Assured ID Root G2
|
||||
|
||||
DigiCert Assured ID Root G3
|
||||
|
||||
DigiCert Global Root CA
|
||||
|
||||
DigiCert Global Root G2
|
||||
|
||||
DigiCert Global Root G3
|
||||
|
||||
DigiCert High Assurance EV Root CA
|
||||
|
||||
DigiCert Trusted Root G4
|
||||
|
||||
E-Tugra Certification Authority
|
||||
|
||||
EC-ACC
|
||||
|
||||
EE Certification Centre Root CA
|
||||
|
||||
Entrust.net Certification Authority (2048)
|
||||
|
||||
Entrust Root Certification Authority
|
||||
|
||||
Entrust Root Certification Authority - EC1
|
||||
|
||||
Entrust Root Certification Authority - G2
|
||||
|
||||
GDCA TrustAUTH R5 ROOT
|
||||
|
||||
GeoTrust Global CA
|
||||
|
||||
GeoTrust Primary Certification Authority
|
||||
|
||||
GeoTrust Primary Certification Authority - G2
|
||||
|
||||
GeoTrust Primary Certification Authority - G3
|
||||
|
||||
GeoTrust Universal CA
|
||||
|
||||
GeoTrust Universal CA 2
|
||||
|
||||
GlobalSign
|
||||
|
||||
GlobalSign
|
||||
|
||||
GlobalSign Root CA
|
||||
|
||||
GlobalSign
|
||||
|
||||
GlobalSign
|
||||
|
||||
Global Chambersign Root - 2008
|
||||
|
||||
Go Daddy Root Certificate Authority - G2
|
||||
|
||||
Hellenic Academic and Research Institutions ECC RootCA 2015
|
||||
|
||||
Hellenic Academic and Research Institutions RootCA 2011
|
||||
|
||||
Hellenic Academic and Research Institutions RootCA 2015
|
||||
|
||||
Hongkong Post Root CA 1
|
||||
|
||||
ISRG Root X1
|
||||
|
||||
IdenTrust Commercial Root CA 1
|
||||
|
||||
IdenTrust Public Sector Root CA 1
|
||||
|
||||
Izenpe.com
|
||||
|
||||
LuxTrust Global Root 2
|
||||
|
||||
Microsec e-Szigno Root CA 2009
|
||||
|
||||
NetLock Arany (Class Gold) F?tan<61><6E>s<EFBFBD><73>tv<74><76>ny
|
||||
|
||||
Network Solutions Certificate Authority
|
||||
|
||||
OISTE WISeKey Global Root GA CA
|
||||
|
||||
OISTE WISeKey Global Root GB CA
|
||||
|
||||
OpenTrust Root CA G1
|
||||
|
||||
OpenTrust Root CA G2
|
||||
|
||||
OpenTrust Root CA G3
|
||||
|
||||
QuoVadis Root Certification Authority
|
||||
|
||||
QuoVadis Root CA 1 G3
|
||||
|
||||
QuoVadis Root CA 2
|
||||
|
||||
QuoVadis Root CA 2 G3
|
||||
|
||||
QuoVadis Root CA 3
|
||||
|
||||
QuoVadis Root CA 3 G3
|
||||
|
||||
SSL.com EV Root Certification Authority ECC
|
||||
|
||||
SSL.com EV Root Certification Authority RSA R2
|
||||
|
||||
SSL.com Root Certification Authority ECC
|
||||
|
||||
SSL.com Root Certification Authority RSA
|
||||
|
||||
SZAFIR ROOT CA2
|
||||
|
||||
SecureSign RootCA11
|
||||
|
||||
SecureTrust CA
|
||||
|
||||
Secure Global CA
|
||||
|
||||
Sonera Class2 CA
|
||||
|
||||
Staat der Nederlanden EV Root CA
|
||||
|
||||
Staat der Nederlanden Root CA - G2
|
||||
|
||||
Staat der Nederlanden Root CA - G3
|
||||
|
||||
Starfield Root Certificate Authority - G2
|
||||
|
||||
Starfield Services Root Certificate Authority - G2
|
||||
|
||||
SwissSign Gold CA - G2
|
||||
|
||||
SwissSign Silver CA - G2
|
||||
|
||||
T-TeleSec GlobalRoot Class 2
|
||||
|
||||
T-TeleSec GlobalRoot Class 3
|
||||
|
||||
TUBITAK Kamu SM SSL Kok Sertifikasi - Surum 1
|
||||
|
||||
TWCA Global Root CA
|
||||
|
||||
TWCA Root Certification Authority
|
||||
|
||||
TeliaSonera Root CA v1
|
||||
|
||||
TrustCor ECA-1
|
||||
|
||||
TrustCor RootCert CA-1
|
||||
|
||||
TrustCor RootCert CA-2
|
||||
|
||||
T<EFBFBD><EFBFBD>RKTRUST Elektronik Sertifika Hizmet Sa?lay?c?s? H5
|
||||
|
||||
USERTrust ECC Certification Authority
|
||||
|
||||
USERTrust RSA Certification Authority
|
||||
|
||||
VeriSign Class 3 Public Primary Certification Authority - G4
|
||||
|
||||
VeriSign Class 3 Public Primary Certification Authority - G5
|
||||
|
||||
VeriSign Universal Root Certification Authority
|
||||
|
||||
VeriSign Class 3 Public Primary Certification Authority - G3
|
||||
|
||||
Visa eCommerce Root
|
||||
|
||||
XRamp Global Certification Authority
|
||||
|
||||
thawte Primary Root CA
|
||||
|
||||
thawte Primary Root CA - G2
|
||||
|
||||
thawte Primary Root CA - G3
|
||||
|
||||
Microsoft Root Authority
|
||||
|
||||
Microsoft Root Certificate Authority
|
||||
|
||||
Microsoft Root Certificate Authority 2010
|
||||
|
||||
Microsoft Root Certificate Authority 2011
|
||||
|
||||
Baltimore CyberTrust Root
|
||||
|
||||
', null);
|
||||
|
||||
commit;
|
||||
|
||||
|
||||
191
src/main/resources/sql/deploymentsql/other_sql.sql
Normal file
191
src/main/resources/sql/deploymentsql/other_sql.sql
Normal file
@@ -0,0 +1,191 @@
|
||||
CREATE TABLE `inner_protection_list` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`keyword` varchar(500) NOT NULL COMMENT '<EFBFBD>ؼ<EFBFBD><EFBFBD><EFBFBD>',
|
||||
`target_type` varchar(128) DEFAULT '' COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD>',
|
||||
`description` varchar(200) DEFAULT '',
|
||||
`is_valid` int(2) NOT NULL DEFAULT 0 COMMENT '-1ɾ<31><C9BE> 1<><31>Ч',
|
||||
`create_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`editor_id` int(11) DEFAULT NULL,
|
||||
`creator_id` int(11) NOT NULL,
|
||||
`edit_time` datetime DEFAULT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=108 DEFAULT CHARSET=utf8mb4;
|
||||
INSERT INTO `inner_protection_list` VALUES ('104', '.com', 'domainCheck', 'protection domain', '1', '2019-03-26 13:54:28', '1', '1', '2019-04-02 11:16:36');
|
||||
INSERT INTO `inner_protection_list` VALUES ('106', '.com', 'urlCheck', 'protection url', '1', '2019-03-27 11:08:24', '1', '1', '2019-04-02 11:21:52');
|
||||
commit;
|
||||
|
||||
|
||||
DROP PROCEDURE IF EXISTS `proc_statistics_config`;
|
||||
delimiter ;;
|
||||
CREATE DEFINER=`root`@`%` PROCEDURE `proc_statistics_config`()
|
||||
BEGIN
|
||||
|
||||
DECLARE ntime VARCHAR(40);/*<EFBFBD><EFBFBD>ǰʱ<EFBFBD><EFBFBD>*/
|
||||
|
||||
DECLARE otime VARCHAR(40);/*<EFBFBD>ϴ<EFBFBD>ͳ<EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>*/
|
||||
|
||||
DECLARE nRow VARCHAR(40);/*<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͳ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
|
||||
|
||||
DECLARE tabName VARCHAR(500);
|
||||
|
||||
DECLARE description VARCHAR(500);
|
||||
|
||||
DECLARE deleteSql VARCHAR(500);
|
||||
|
||||
DECLARE done INT;/*<EFBFBD>α<EFBFBD><EFBFBD><EFBFBD>ʶ*/
|
||||
|
||||
DECLARE flag INT;/*ѭ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ*/
|
||||
|
||||
DECLARE t_error INT;/*<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ*/
|
||||
|
||||
DECLARE proc_log_table VARCHAR(100);/*<EFBFBD>洢<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>־<EFBFBD><EFBFBD>*/
|
||||
|
||||
DECLARE proc_name VARCHAR(100);/*<EFBFBD>洢<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
|
||||
|
||||
DECLARE icursor CURSOR FOR SELECT tab_name FROM statistics_tables where is_valid=1;
|
||||
|
||||
DECLARE CONTINUE HANDLER FOR NOT found SET done=1;
|
||||
|
||||
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION set t_error=1;
|
||||
|
||||
select max(statistic_time) into otime from cfg_num_statistics;
|
||||
|
||||
SET done=0;
|
||||
|
||||
SET t_error=0;
|
||||
|
||||
SET proc_log_table='proc_exec_log';
|
||||
|
||||
SET proc_name='proc_statistics_config';
|
||||
|
||||
SET ntime=DATE_FORMAT(SYSDATE(),'%Y-%m-%d %H:%i:%S');
|
||||
|
||||
OPEN icursor;
|
||||
|
||||
loop_iloop:LOOP
|
||||
|
||||
FETCH icursor INTO tabName;
|
||||
|
||||
SET description=tabName;
|
||||
|
||||
set @descriptionStart=concat(description,'<EFBFBD><EFBFBD>ͳ<EFBFBD><EFBFBD>start');
|
||||
|
||||
/*ͳ<EFBFBD>Ƶ<EFBFBD>ǰ<EFBFBD><EFBFBD><EFBFBD>ñ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݵ<EFBFBD>ͳ<EFBFBD>Ʊ<EFBFBD><EFBFBD><EFBFBD>start*/
|
||||
|
||||
set @v_log_sql1 := concat('insert into ',proc_log_table,'(proc_name,table_name,log_time,description) values(?,?,?,?)');
|
||||
|
||||
PREPARE execs FROM @v_log_sql1;
|
||||
|
||||
EXECUTE execs using proc_name,proc_log_table,ntime,@descriptionStart;
|
||||
|
||||
DEALLOCATE PREPARE execs;
|
||||
|
||||
COMMIT;
|
||||
|
||||
|
||||
#20190328 <20><><EFBFBD>Ӷ<EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>is_audit=1 && (is_valid=1 || is_valid=0) <20><>Ϊapproved <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>cfg_state=4[is_valid=0 && is_audit=1],<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˹<EFBFBD><CBB9>ģ<EFBFBD><C4A3><EFBFBD><EFBFBD><EFBFBD>cfg_state=1<><31><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ч<EFBFBD>ģ<EFBFBD><C4A3><EFBFBD><EFBFBD><EFBFBD>չʾ<D5B9><CABE>approvedֵʵ<D6B5>ʰ<EFBFBD><CAB0><EFBFBD>cfg_state=4<><34>cfg_state=1
|
||||
set @insert_statistics_sql := concat('insert into cfg_num_statistics(statistic_time,audit_time,function_id,service_id,action,compile_id,cfg_state) select ','''',ntime,'''',',','audit_time,function_id,service_id,action,compile_id,if(is_valid=-1,-1,if(is_valid=1,1,if(is_audit=0,0,if(is_audit=1,4,if(is_audit=2,2,if(is_audit=3,3,0)))))) cfg_state from ',tabName);
|
||||
|
||||
|
||||
PREPARE execs FROM @insert_statistics_sql;
|
||||
|
||||
EXECUTE execs;
|
||||
|
||||
DEALLOCATE PREPARE execs;
|
||||
|
||||
COMMIT;
|
||||
|
||||
|
||||
|
||||
set @descriptionEnd=concat(description,'<EFBFBD><EFBFBD>ͳ<EFBFBD><EFBFBD>end');
|
||||
|
||||
set @v_log_sql2 := concat('insert into ',proc_log_table,'(proc_name,table_name,log_time,description) values(?,?,?,?)');
|
||||
|
||||
PREPARE execs FROM @v_log_sql2;
|
||||
|
||||
EXECUTE execs using proc_name,proc_log_table,ntime,@descriptionEnd;
|
||||
|
||||
DEALLOCATE PREPARE execs;
|
||||
|
||||
COMMIT;
|
||||
|
||||
/*<EFBFBD>쳣<EFBFBD>˳<EFBFBD>loop*/
|
||||
IF t_error=1 THEN
|
||||
LEAVE loop_iloop;
|
||||
END IF;
|
||||
|
||||
/*ѭ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˳<EFBFBD>loop*/
|
||||
IF done=1 THEN
|
||||
|
||||
LEAVE loop_iloop;
|
||||
|
||||
ELSE
|
||||
|
||||
SET flag=0;
|
||||
|
||||
END IF;
|
||||
|
||||
IF flag=0 THEN
|
||||
|
||||
SET done=0;
|
||||
|
||||
END IF;
|
||||
|
||||
END LOOP loop_iloop;
|
||||
|
||||
CLOSE icursor;
|
||||
/*ȡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͳ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
|
||||
SELECT count(statistic_time) INTO nRow from cfg_num_statistics where statistic_time=ntime;
|
||||
|
||||
|
||||
IF t_error=1 THEN /*<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>쳣<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
|
||||
delete from cfg_num_statistics where statistic_time=ntime;
|
||||
COMMIT;
|
||||
ELSEIF nRow > 0 THEN /*<EFBFBD>жϱ<EFBFBD><EFBFBD><EFBFBD>ͳ<EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD>룬<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɾ<EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD>ͳ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD>ͳ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
|
||||
|
||||
delete from cfg_num_statistics where statistic_time=otime;
|
||||
COMMIT;
|
||||
END IF;
|
||||
COMMIT;
|
||||
END
|
||||
;;
|
||||
delimiter ;
|
||||
|
||||
#ִ<>д洢<D0B4><E6B4A2><EFBFBD><EFBFBD>
|
||||
call exec_procs();
|
||||
|
||||
-- ------------
|
||||
-- <20><>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>type<70><65><EFBFBD>ԣ<EFBFBD><D4A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģ<DEB8><C4A3><EFBFBD>ȫ<EFBFBD><C8AB>ͬ<EFBFBD><CDAC>״̬Ϊ3(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
|
||||
-- ------------
|
||||
ALTER TABLE schedule_cfg ADD type int(1) DEFAULT 1 COMMENT '1:<3A><>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2<EFBFBD><32>ȫ<EFBFBD><C8AB>ͬ<EFBFBD><CDAC>ʱδִ<CEB4>е<EFBFBD><D0B5><EFBFBD><EFBFBD><EFBFBD>';
|
||||
update schedule_cfg set type=1;
|
||||
update sys_data_dictionary_item t set t.item_value=3 where t.dictionary_id=142;
|
||||
|
||||
-- ------------
|
||||
-- ϵͳ<CFB5><CDB3><EFBFBD><EFBFBD>-><3E><><EFBFBD><EFBFBD>Ա<EFBFBD>û<EFBFBD>Ԥ<EFBFBD><D4A4>
|
||||
-- ------------
|
||||
INSERT INTO `sys_menu` (`parent_id`, `parent_ids`, `code`, `name`, `sort`, `href`, `target`, `icon`, `is_show`, `permission`, `create_by`, `create_date`, `update_by`, `update_date`, `remarks`, `del_flag`, `menu_bg`, `quick_action`, `is_top`, `function_id`) VALUES ('2', '0,1,2,', 'admin_user_warn', 'admin user warn', '5060', '/sys/warn/userWarnList', '', '', '1', 'sys:warnList:view', '1', '2019-03-28 10:06:26', '1', '2019-03-28 11:36:42', '', '1', NULL, '0', '0', NULL);
|
||||
|
||||
CREATE TABLE `sys_user_warn` (
|
||||
`service_id` int(11) NOT NULL COMMENT 'ҵ<EFBFBD><EFBFBD>ID',
|
||||
`service_desc` varchar(255) DEFAULT '' COMMENT 'ҵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',
|
||||
`interface_cfg_total` int(11) DEFAULT NULL COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',
|
||||
`system_cfg_total` int(11) DEFAULT NULL COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',
|
||||
`time` datetime DEFAULT NULL COMMENT '<EFBFBD><EFBFBD><EFBFBD>ݲ<EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>',
|
||||
`remark` varchar(255) DEFAULT NULL COMMENT '<EFBFBD><EFBFBD>ע',
|
||||
PRIMARY KEY (`service_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD>û<EFBFBD>Ԥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
||||
-- <20><><EFBFBD>ñ<EFBFBD><C3B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
INSERT INTO `sys_menu` (`parent_id`, `parent_ids`, `code`, `name`, `sort`, `href`, `target`, `icon`, `is_show`, `permission`, `create_by`, `create_date`, `update_by`, `update_date`, `remarks`, `del_flag`, `menu_bg`, `quick_action`, `is_top`, `function_id`) VALUES ('109', '0,1,109,', 'protection_list_manage', 'protection list manage', '5060', '/basics/innerProtectionList/list', '', 'fa fa-sticky-note-o', '1', 'basic:inner_protection_list:list', '1', '2019-03-25 15:28:34', '1', '2019-03-26 15:04:47', '', '1', NULL, '0', '0', NULL);
|
||||
|
||||
-- ------------
|
||||
-- <20><><EFBFBD>˲<EFBFBD><CBB2>·<EFBFBD><C2B7><EFBFBD><EFBFBD>ܣ<EFBFBD>ֻ<EFBFBD>н<EFBFBD><D0BD>˲˵<CBB2><CBB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>沢<EFBFBD>·<EFBFBD><C2B7>û<EFBFBD><C3BB>Ľ<EFBFBD>ɫ<EFBFBD><C9AB><EFBFBD>˽<EFBFBD>ɫ<EFBFBD>µ<EFBFBD><C2B5>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ÿ<EFBFBD>ֱ<EFBFBD><D6B1><EFBFBD>·<EFBFBD><C2B7><EFBFBD><EFBFBD>˰汾ע<E6B1BE><D7A2><EFBFBD><EFBFBD>ɫ<EFBFBD><C9AB><EFBFBD>䣩
|
||||
-- <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˲<EFBFBD><CBB2>·<EFBFBD><C2B7>˵<EFBFBD>
|
||||
-- ------------
|
||||
INSERT INTO `sys_menu`(`parent_id`, `parent_ids`, `code`, `name`, `sort`, `href`, `target`, `icon`, `is_show`, `permission`, `create_by`, `create_date`, `update_by`, `update_date`, `remarks`, `del_flag`, `menu_bg`, `quick_action`, `is_top`, `function_id`) VALUES (86, '0,1,86,', 'save_and_audit', 'save and audit', 5060, '', '', '', 0, 'save:audit:permission', '1', '2019-04-08 11:30:31', '1', '2019-04-08 11:47:16', 'save_and_audit', 1, NULL, 0, 0, NULL);
|
||||
-- <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˲<EFBFBD><CBB2>·<EFBFBD><C2B7><EFBFBD>ɫ
|
||||
INSERT INTO `sys_role`(`NAME`, `DATA_SCOPE`, `REMARK`, `STATUS`, `CREATE_TIME`, `ROLE_TYPE`) VALUES ('saveAndAudit', 1, '', 1, '2019-04-09 11:33:40', 'user');
|
||||
-- <20><><EFBFBD><EFBFBD>ΪsaveAndAudit<69><74>ɫ<EFBFBD><C9AB><EFBFBD><EFBFBD>save_and_audit<69>˵<EFBFBD><CBB5><EFBFBD>
|
||||
insert into sys_privilege (PRIVILEGE_MASTER,PRIVILEGE_MASTER_VALUE,PRIVILEGE_ACCESS,PRIVILEGE_ACCESS_VALUE,PRIVILEGE_OPERATION ) select 'ROLE',r.id,1000,m.id,1 from sys_role r,sys_menu m where r.name='saveAndAudit' and m.code='save_and_audit'
|
||||
|
||||
|
||||
@@ -122,7 +122,7 @@
|
||||
</div>
|
||||
<!-- 600 asn ip、 3:IP白名单、 405:APP协议IP、 403:APP域名特征、 563 APP Payload、 565 APP HTTP、 564 APP DNS、 566 APP SSL -->
|
||||
<c:if test="${(cfg.functionId eq 600) || (cfg.functionId eq 3) || (cfg.functionId eq 405) || (cfg.functionId eq 403) || (cfg.functionId eq 563) || (cfg.functionId eq 565) || (cfg.functionId eq 564) || (cfg.functionId eq 566) ||
|
||||
(cfg.functionId eq 560)||(cfg.functionId eq 110) }">
|
||||
(cfg.functionId eq 560) }">
|
||||
<div class="row hidden requestIdSel">
|
||||
</c:if>
|
||||
<c:if test="${(cfg.functionId ne 600) && (cfg.functionId ne 3) && (cfg.functionId ne 405) && (cfg.functionId ne 403) && (cfg.functionId ne 563) && (cfg.functionId ne 565) && (cfg.functionId ne 564) && (cfg.functionId ne 566) &&
|
||||
|
||||
@@ -9,35 +9,6 @@
|
||||
</h4>
|
||||
<div class="row ipInfo">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group ">
|
||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="protocol"/></label>
|
||||
<div class="col-md-6">
|
||||
<select name="protocol" class="selectpicker show-tick form-control required">
|
||||
<c:forEach items="${fns:getDictList('PROTOCOL')}" var="protocolC">
|
||||
<option value="${protocolC.itemCode}" <c:if test="${_cfg.protocol==protocolC.itemCode || (_cfg.protocol==null && protocolC.itemCode==0)}">selected</c:if>><spring:message code="${protocolC.itemValue}"/></option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
<input type="hidden" name="protocolId" value="0">
|
||||
</div>
|
||||
<div for="protocol"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="direction"/></label>
|
||||
<div class="col-md-6">
|
||||
<select name="direction" class="selectpicker show-tick form-control required" >
|
||||
<c:forEach items="${fns:getDictList('DIRECTION')}" var="directionC">
|
||||
<option value="${directionC.itemCode}" <c:if test="${_cfg.direction==directionC.itemCode || (_cfg.direction==null && directionC.itemCode==0)}">selected</c:if>><spring:message code="${directionC.itemValue}"/></option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</div>
|
||||
<div for="direction"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
@@ -59,67 +30,33 @@
|
||||
<div for="ipType"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row ipCol">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group ">
|
||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="src_ip_pattern"/></label>
|
||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="protocol"/></label>
|
||||
<div class="col-md-6">
|
||||
<select name="srcIpPattern" class="selectpicker show-tick form-control required">
|
||||
<select name="protocol" class="selectpicker show-tick form-control required">
|
||||
<c:forEach items="${fns:getDictList('PROTOCOL')}" var="protocolC">
|
||||
<option value="${protocolC.itemCode}" <c:if test="${_cfg.protocol==protocolC.itemCode || (_cfg.protocol==null && protocolC.itemCode==0)}">selected</c:if>><spring:message code="${protocolC.itemValue}"/></option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
<input type="hidden" name="protocolId" value="0">
|
||||
</div>
|
||||
<div for="protocol"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="ip_pattern"/></label>
|
||||
<div class="col-md-6">
|
||||
<select name="ipPattern" class="selectpicker show-tick form-control required">
|
||||
<c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC">
|
||||
<option value="${ipPatternC.itemCode}" <c:if test="${_cfg.srcIpPattern==ipPatternC.itemCode || (_cfg.srcIpPattern==null && ipPatternC.itemCode==3)}">selected</c:if>><spring:message code="${ipPatternC.itemValue}"/></option>
|
||||
<option value="${ipPatternC.itemCode}" <c:if test="${_cfg.ipPattern==ipPatternC.itemCode || (_cfg.ipPattern==null && ipPatternC.itemCode==3)}">selected</c:if>><spring:message code="${ipPatternC.itemValue}"/></option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</div>
|
||||
<div for="srcIpPattern"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group ">
|
||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="client_ip"/></label>
|
||||
<div class="col-md-6">
|
||||
<input class="form-control required ipCheck" type="text" name="srcIpAddress" value="${_cfg.srcIpAddress}">
|
||||
</div>
|
||||
<div for="srcIpAddress"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row hidden ipCol">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="src_port_pattern"/></label>
|
||||
<div class="col-md-6">
|
||||
<select name="srcPortPattern" class="selectpicker show-tick form-control required">
|
||||
<c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC">
|
||||
<option value="${portPatternC.itemCode}" <c:if test="${_cfg.srcPortPattern==portPatternC.itemCode || (_cfg.srcPortPattern==null && portPatternC.itemCode==1)}">selected</c:if>><spring:message code="${portPatternC.itemValue}"/></option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</div>
|
||||
<div for="srcPortPattern"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group ">
|
||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="client_port"/></label>
|
||||
<div class="col-md-6">
|
||||
<input class="form-control required portCheck" type="text" name="srcPort" value="${_cfg.srcPort}">
|
||||
</div>
|
||||
<div for="srcPort"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row hidden ipCol">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="dest_ip_pattern"/></label>
|
||||
<div class="col-md-6">
|
||||
<select name="destIpPattern" class="selectpicker show-tick form-control required">
|
||||
<c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC">
|
||||
<option value="${ipPatternC.itemCode}" <c:if test="${_cfg.destIpPattern==ipPatternC.itemCode || (_cfg.destIpPattern==null && ipPatternC.itemCode==3)}">selected</c:if>><spring:message code="${ipPatternC.itemValue}"/></option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</div>
|
||||
<div for="destIpPattern"></div>
|
||||
<div for="ipPattern"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
@@ -132,18 +69,25 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row hidden ipCol">
|
||||
<c:choose>
|
||||
<c:when test="${_cfg.cfgId==null}">
|
||||
<div class="row hidden port">
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
<div class="row port">
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="dest_port_pattern"/></label>
|
||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="port_pattern"/></label>
|
||||
<div class="col-md-6">
|
||||
<select name="destPortPattern" class="selectpicker show-tick form-control required">
|
||||
<select name="portPattern" class="selectpicker show-tick form-control required">
|
||||
<c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC">
|
||||
<option value="${portPatternC.itemCode}" <c:if test="${_cfg.destPortPattern==portPatternC.itemCode || (_cfg.destPortPattern==null && portPatternC.itemCode==1)}">selected</c:if>><spring:message code="${portPatternC.itemValue}"/></option>
|
||||
<option value="${portPatternC.itemCode}" <c:if test="${_cfg.portPattern==portPatternC.itemCode || (_cfg.portPattern==null && portPatternC.itemCode==1)}">selected</c:if>><spring:message code="${portPatternC.itemValue}"/></option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</div>
|
||||
<div for="destPortPattern"></div>
|
||||
<div for="portPattern"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
@@ -156,9 +100,50 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<c:choose>
|
||||
<c:when test="${_cfg.cfgId==null}">
|
||||
<div class="row hidden destPort">
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
<div class="row destPort">
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="direction"/></label>
|
||||
<div class="col-md-6">
|
||||
<select name="direction" class="selectpicker show-tick form-control required" >
|
||||
<c:forEach items="${fns:getDictList('DIRECTION')}" var="directionC">
|
||||
<option value="${directionC.itemCode}" <c:if test="${_cfg.direction==directionC.itemCode || (_cfg.direction==null && directionC.itemCode==0)}">selected</c:if>><spring:message code="${directionC.itemValue}"/></option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</div>
|
||||
<div for="direction"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<c:if test="${_cfg.cfgId==null}">
|
||||
<div class="row">
|
||||
<button type="button" class="btn btn-red-hollow center-block" onClick="more(this);" data-click-times="0"><spring:message code="show_more"/></button>
|
||||
</div>
|
||||
</c:if>
|
||||
<div class="row destPort">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<div class="col-md-6">
|
||||
<input type="hidden" name="srcIpAddress" value="${_cfg.srcIpAddress}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group ">
|
||||
<div class="col-md-6">
|
||||
<input type="hidden" name="srcPort" value="${_cfg.srcPort}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</c:if>
|
||||
</c:forEach>
|
||||
@@ -110,6 +110,3 @@
|
||||
<script src="${pageContext.request.contextPath}/static/pages/scripts/appNames.js" type="text/javascript"></script>
|
||||
|
||||
<script src="${pageContext.request.contextPath}/static/global/plugins/clipboard.js" type="text/javascript"></script>
|
||||
<link href="${pageContext.request.contextPath}/static/global/plugins/select2/css/select2.css" rel="stylesheet" />
|
||||
<link href="${pageContext.request.contextPath}/static/global/plugins/select2/css/select2-bootstrap.min.css" rel="stylesheet" />
|
||||
<script src="${pageContext.request.contextPath}/static/global/plugins/select2/js/select2.js" type="text/javascript"></script>
|
||||
|
||||
@@ -122,7 +122,7 @@ function isBatch(url){
|
||||
){
|
||||
flag = true;
|
||||
}
|
||||
return flag;
|
||||
return false;
|
||||
}
|
||||
|
||||
//删除
|
||||
@@ -189,10 +189,11 @@ function update(url){
|
||||
return;
|
||||
} */
|
||||
if($(checkboxes).filter(":checked").length==1){
|
||||
/* if(cked.val()==1){
|
||||
//TODO 生效配置可更改功能,在最后功能实现完成后打开【打开时确认来函和专项是否影响】
|
||||
if(cked.val()==1){
|
||||
top.$.jBox.tip("<spring:message code='has_approved'/>", "<spring:message code='info'/>");
|
||||
return;
|
||||
} *//*else if(cked.val()==3){
|
||||
}/*else if(cked.val()==3){
|
||||
top.$.jBox.tip("<spring:message code='cancel_approved'/>", "<spring:message code='info'/>");
|
||||
return;
|
||||
}*/
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user