diff --git a/src/main/java/com/nis/domain/FunctionRegionDict.java b/src/main/java/com/nis/domain/FunctionRegionDict.java index de8dc0f9c..130984d68 100644 --- a/src/main/java/com/nis/domain/FunctionRegionDict.java +++ b/src/main/java/com/nis/domain/FunctionRegionDict.java @@ -16,6 +16,60 @@ public class FunctionRegionDict extends BaseCfg { private String configDesc; private Integer isMaat; private Integer regionType; + private String configMultiKeywords; + private String configHex; + private String configExprType; + private String configMatchMethod; + private String configServiceType; + private String configIpPortShow; + private String configIpType; + private String configIpPattern; + private String configPortPattern; + private String configDirection; + private String configProtocol; + + public String getConfigIpPortShow() { + return configIpPortShow; + } + public void setConfigIpPortShow(String configIpPortShow) { + this.configIpPortShow = configIpPortShow; + } + public String getConfigIpType() { + return configIpType; + } + public void setConfigIpType(String configIpType) { + this.configIpType = configIpType; + } + public String getConfigIpPattern() { + return configIpPattern; + } + public void setConfigIpPattern(String configIpPattern) { + this.configIpPattern = configIpPattern; + } + public String getConfigPortPattern() { + return configPortPattern; + } + public void setConfigPortPattern(String configPortPattern) { + this.configPortPattern = configPortPattern; + } + public String getConfigDirection() { + return configDirection; + } + public void setConfigDirection(String configDirection) { + this.configDirection = configDirection; + } + public String getConfigProtocol() { + return configProtocol; + } + public void setConfigProtocol(String configProtocol) { + this.configProtocol = configProtocol; + } + public String getConfigServiceType() { + return configServiceType; + } + public void setConfigServiceType(String configServiceType) { + this.configServiceType = configServiceType; + } public Integer getDictId() { return dictId; } @@ -64,5 +118,30 @@ public class FunctionRegionDict extends BaseCfg { public void setRegionType(Integer regionType) { this.regionType = regionType; } + public String getConfigMultiKeywords() { + return configMultiKeywords; + } + public void setConfigMultiKeywords(String configMultiKeywords) { + this.configMultiKeywords = configMultiKeywords; + } + public String getConfigHex() { + return configHex; + } + public void setConfigHex(String configHex) { + this.configHex = configHex; + } + public String getConfigExprType() { + return configExprType; + } + public void setConfigExprType(String configExprType) { + this.configExprType = configExprType; + } + public String getConfigMatchMethod() { + return configMatchMethod; + } + public void setConfigMatchMethod(String configMatchMethod) { + this.configMatchMethod = configMatchMethod; + } + } diff --git a/src/main/java/com/nis/domain/FunctionServiceDict.java b/src/main/java/com/nis/domain/FunctionServiceDict.java index 174097d23..42215de2b 100644 --- a/src/main/java/com/nis/domain/FunctionServiceDict.java +++ b/src/main/java/com/nis/domain/FunctionServiceDict.java @@ -16,6 +16,14 @@ public class FunctionServiceDict extends BaseCfg { private String serviceName; private String serviceDesc; private String actionCode; + private Integer regionCode; + + public Integer getRegionCode() { + return regionCode; + } + public void setRegionCode(Integer regionCode) { + this.regionCode = regionCode; + } public Integer getDictId() { return dictId; } diff --git a/src/main/java/com/nis/domain/configuration/AppSslCertCfg.java b/src/main/java/com/nis/domain/configuration/AppSslCertCfg.java new file mode 100644 index 000000000..0d4af4a17 --- /dev/null +++ b/src/main/java/com/nis/domain/configuration/AppSslCertCfg.java @@ -0,0 +1,147 @@ +/** + *@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; + +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; +import com.nis.util.excel.ExcelField; + +/** + * APP SSL证书特征配置 + * @author dell + * + */ +public class AppSslCertCfg extends BaseCfg { + + /** + * + */ + private static final long serialVersionUID = -4366457794248757698L; + private static final String tableName="app_ssl_cert_cfg"; + @Expose + private Integer compileId; + @Expose + private Integer ratelimit; + private Integer appCode;//specific_service_cfg表一级节点的spec_service_code + private Integer behavCode;//specific_service_cfg表二级节点的spec_service_code + private Integer specServiceId; + private String district; + private String cfgKeywords; + private String appName; + + @Expose + @ExcelField(title="expression_type") + @SerializedName("exprType") + protected Integer exprType ; + + @Expose + @ExcelField(title="match_method") + @SerializedName("matchMethod") + protected Integer matchMethod ; + + @Expose + @ExcelField(title="whether_hexbinary") + @SerializedName("isHexbin") + protected Integer isHexbin; + + 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; + } + @Override + public void initDefaultValue() { + // TODO Auto-generated method stub + super.initDefaultValue(); + this.isHexbin = 0; + } + + + public Integer getCompileId() { + return compileId; + } + public void setCompileId(Integer compileId) { + this.compileId = compileId; + } + + public static String getTablename() { + return tableName; + } + + public Integer getRatelimit() { + return ratelimit; + } + + public void setRatelimit(Integer ratelimit) { + this.ratelimit = ratelimit; + } + public Integer getAppCode() { + return appCode; + } + public void setAppCode(Integer appCode) { + this.appCode = appCode; + } + public Integer getSpecServiceId() { + return specServiceId; + } + public void setSpecServiceId(Integer specServiceId) { + this.specServiceId = specServiceId; + } + + public String getDistrict() { + return district; + } + + public void setDistrict(String district) { + this.district = district; + } + + public String getCfgKeywords() { + return cfgKeywords; + } + + public void setCfgKeywords(String cfgKeywords) { + this.cfgKeywords = cfgKeywords; + } + + public String getAppName() { + return appName; + } + + public void setAppName(String appName) { + this.appName = appName; + } + + public Integer getBehavCode() { + return behavCode; + } + + public void setBehavCode(Integer behavCode) { + this.behavCode = behavCode; + } + +} diff --git a/src/main/java/com/nis/domain/configuration/AvVoipIpCfg.java b/src/main/java/com/nis/domain/configuration/AvVoipIpCfg.java index 039566aa4..12b079e2e 100644 --- a/src/main/java/com/nis/domain/configuration/AvVoipIpCfg.java +++ b/src/main/java/com/nis/domain/configuration/AvVoipIpCfg.java @@ -8,12 +8,14 @@ package com.nis.domain.configuration; * @version V1.0 */ public class AvVoipIpCfg extends BaseIpCfg { - + private static final String tableName="av_voip_ip_cfg"; /** * */ private static final long serialVersionUID = -942354218504312548L; - + public static String getTablename() { + return tableName; + } } diff --git a/src/main/java/com/nis/domain/configuration/BaseCfg.java b/src/main/java/com/nis/domain/configuration/BaseCfg.java index 02472d9f0..8eae2e6f8 100644 --- a/src/main/java/com/nis/domain/configuration/BaseCfg.java +++ b/src/main/java/com/nis/domain/configuration/BaseCfg.java @@ -15,6 +15,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; import com.nis.domain.BaseEntity; +import com.nis.util.Constants; import com.nis.util.excel.ExcelField; /** @@ -196,6 +197,18 @@ public class BaseCfg extends BaseEntity implements Cloneable{ */ protected Integer functionId; + /** + * do_log属性在界面(do_log:0不需要1记录所有日志2只记录结构化日志。默认是2) + */ + protected Integer doLog = Constants.MAAT_CFG_DOLOG_DEFAULT; + + + public Integer getDoLog() { + return doLog; + } + public void setDoLog(Integer doLog) { + this.doLog = doLog; + } /** * cfgRegionCode * @return cfgRegionCode diff --git a/src/main/java/com/nis/domain/configuration/CfgIndexInfo.java b/src/main/java/com/nis/domain/configuration/CfgIndexInfo.java index 38b48622f..569f71bfe 100644 --- a/src/main/java/com/nis/domain/configuration/CfgIndexInfo.java +++ b/src/main/java/com/nis/domain/configuration/CfgIndexInfo.java @@ -51,10 +51,30 @@ public class CfgIndexInfo extends BaseCfg { private List complexList; private List stringList; private List digestList; + private List ntcSubscribeIdCfgList;//新增SUBSCRIBE_ID + private NtcSubscribeIdCfg ntcSubscribeIdCfg; private Long dnsStrategyId; private String dnsStrategyName; + private P2pHashCfg p2pHash; + private P2pKeywordCfg p2pKeyword; + private List p2pHashList; + private List p2pKeywordList; + + + public List getNtcSubscribeIdCfgList() { + return ntcSubscribeIdCfgList; + } + public void setNtcSubscribeIdCfgList(List ntcSubscribeIdCfgList) { + this.ntcSubscribeIdCfgList = ntcSubscribeIdCfgList; + } + public NtcSubscribeIdCfg getNtcSubscribeIdCfg() { + return ntcSubscribeIdCfg; + } + public void setNtcSubscribeIdCfg(NtcSubscribeIdCfg ntcSubscribeIdCfg) { + this.ntcSubscribeIdCfg = ntcSubscribeIdCfg; + } public Long getDnsStrategyId() { return dnsStrategyId; } @@ -200,6 +220,30 @@ public class CfgIndexInfo extends BaseCfg { public void setDigestList(List digestList) { this.digestList = digestList; } + public P2pHashCfg getP2pHash() { + return p2pHash; + } + public void setP2pHash(P2pHashCfg p2pHash) { + this.p2pHash = p2pHash; + } + public P2pKeywordCfg getP2pKeyword() { + return p2pKeyword; + } + public void setP2pKeyword(P2pKeywordCfg p2pKeyword) { + this.p2pKeyword = p2pKeyword; + } + public List getP2pHashList() { + return p2pHashList; + } + public void setP2pHashList(List p2pHashList) { + this.p2pHashList = p2pHashList; + } + public List getP2pKeywordList() { + return p2pKeywordList; + } + public void setP2pKeywordList(List p2pKeywordList) { + this.p2pKeywordList = p2pKeywordList; + } public static String getTablename() { return tableName; } diff --git a/src/main/java/com/nis/domain/configuration/NtcSubscribeIdCfg.java b/src/main/java/com/nis/domain/configuration/NtcSubscribeIdCfg.java new file mode 100644 index 000000000..9cab9848b --- /dev/null +++ b/src/main/java/com/nis/domain/configuration/NtcSubscribeIdCfg.java @@ -0,0 +1,23 @@ +package com.nis.domain.configuration; + +public class NtcSubscribeIdCfg extends BaseStringCfg { + private static final String tableName="ntc_subscribe_id_cfg"; + /** + * + */ + private static final long serialVersionUID = 9137401459733286997L; + /** + * 配置关键字 + */ + + @Override + public void initDefaultValue() { + super.initDefaultValue(); + this.exprType=0; + this.matchMethod=0; + } + public static String getTablename() { + return tableName; + } + +} diff --git a/src/main/java/com/nis/domain/configuration/P2pHashCfg.java b/src/main/java/com/nis/domain/configuration/P2pHashCfg.java new file mode 100644 index 000000000..aa0242ef6 --- /dev/null +++ b/src/main/java/com/nis/domain/configuration/P2pHashCfg.java @@ -0,0 +1,24 @@ +package com.nis.domain.configuration; + +public class P2pHashCfg extends BaseStringCfg{ + + /** + * + */ + private static final long serialVersionUID = -7072353181349049294L; + private static final String tableName="p2p_hash_cfg"; + + @Override + public void initDefaultValue() { + // TODO Auto-generated method stub + super.initDefaultValue(); + this.exprType=0; + this.matchMethod=0; + } + + public static String getTablename() { + return tableName; + } + + +} diff --git a/src/main/java/com/nis/domain/configuration/P2pKeywordCfg.java b/src/main/java/com/nis/domain/configuration/P2pKeywordCfg.java new file mode 100644 index 000000000..47d92fcff --- /dev/null +++ b/src/main/java/com/nis/domain/configuration/P2pKeywordCfg.java @@ -0,0 +1,23 @@ +package com.nis.domain.configuration; + +public class P2pKeywordCfg extends BaseStringCfg{ + + /** + * + */ + private static final long serialVersionUID = 1308668362397070497L; + private static final String tableName="p2p_keyword_cfg"; + + @Override + public void initDefaultValue() { + // TODO Auto-generated method stub + super.initDefaultValue(); + this.exprType=0; + this.matchMethod=0; + this.isHexbin=0; + } + + public static String getTablename() { + return tableName; + } +} diff --git a/src/main/java/com/nis/domain/log/BaseLogEntity.java b/src/main/java/com/nis/domain/log/BaseLogEntity.java index fa72a5abe..3b2a43089 100644 --- a/src/main/java/com/nis/domain/log/BaseLogEntity.java +++ b/src/main/java/com/nis/domain/log/BaseLogEntity.java @@ -25,6 +25,11 @@ public class BaseLogEntity extends BaseEntity { protected String serverLocate;// 服务端地址定位信息 protected String clientLocate;// 客户端地址定位信息 protected String userRegion; //用户自定义 + protected String sAsn;//客户端ASN + protected String dAsn;//服务端ASN + protected String sSubscribeId;//客户端用户名 + protected String dSubscribeId;//服务端用户名 + protected String sceneFile;//现场日志文件地址 protected Integer functionId; protected Integer action; @@ -178,15 +183,58 @@ public class BaseLogEntity extends BaseEntity { public void setClientLocate(String clientLocate) { this.clientLocate = clientLocate; } + public String getsAsn() { + return sAsn; + } + public void setsAsn(String sAsn) { + this.sAsn = sAsn; + } + public String getdAsn() { + return dAsn; + } + public void setdAsn(String dAsn) { + this.dAsn = dAsn; + } + public String getsSubscribeId() { + return sSubscribeId; + } + public void setsSubscribeId(String sSubscribeId) { + this.sSubscribeId = sSubscribeId; + } + public String getdSubscribeId() { + return dSubscribeId; + } + public void setdSubscribeId(String dSubscribeId) { + this.dSubscribeId = dSubscribeId; + } + public String getSceneFile() { + return sceneFile; + } + public void setSceneFile(String sceneFile) { + this.sceneFile = sceneFile; + } @Override public String toString() { - return "BaseLogEntity [cfgId=" + cfgId + ", foundTime=" + foundTime + ", recvTime=" + recvTime + ", transProto=" - + transProto + ", addrType=" + addrType + ", dIp=" + dIp + ", sIp=" + sIp + ", dPort=" + dPort - + ", sPort=" + sPort + ", service=" + service + ", entranceId=" + entranceId + ", deviceId=" + deviceId - + ", direction=" + direction + ", streamDir=" + streamDir + ", capIp=" + capIp + ", addrList=" - + addrList + ", serverLocate=" + serverLocate + ", clientLocate=" + clientLocate + ", userRegion=" - + userRegion + ", functionId=" + functionId + ", action=" + action + ", seltype=" + seltype - + ", searchFoundStartTime=" + searchFoundStartTime + ", searchFoundEndTime=" + searchFoundEndTime + "]"; + return "{\"cfgId\"=\"" + cfgId + "\", \"foundTime\"=\"" + foundTime + + "\", \"recvTime\"=\"" + recvTime + "\", \"transProto\"=\"" + + transProto + "\", \"addrType\"=\"" + addrType + + "\", \"dIp\"=\"" + dIp + "\", \"sIp\"=\"" + sIp + + "\", \"dPort\"=\"" + dPort + "\", \"sPort\"=\"" + sPort + + "\", \"service\"=\"" + service + "\", \"entranceId\"=\"" + + entranceId + "\", \"deviceId\"=\"" + deviceId + + "\", \"direction\"=\"" + direction + "\", \"streamDir\"=\"" + + streamDir + "\", \"capIp\"=\"" + capIp + + "\", \"addrList\"=\"" + addrList + "\", \"serverLocate\"=\"" + + serverLocate + "\", \"clientLocate\"=\"" + clientLocate + + "\", \"userRegion\"=\"" + userRegion + "\", \"sAsn\"=\"" + + sAsn + "\", \"dAsn\"=\"" + dAsn + "\", \"sSubscribeId\"=\"" + + sSubscribeId + "\", \"dSubscribeId\"=\"" + dSubscribeId + + "\", \"sceneFile\"=\"" + sceneFile + "\", \"functionId\"=\"" + + functionId + "\", \"action\"=\"" + action + + "\", \"seltype\"=\"" + seltype + + "\", \"searchFoundStartTime\"=\"" + searchFoundStartTime + + "\", \"searchFoundEndTime\"=\"" + searchFoundEndTime + "}"; } - + + } diff --git a/src/main/java/com/nis/domain/log/MmAvIpLog.java b/src/main/java/com/nis/domain/log/MmAvIpLog.java index f49bd59a5..8e2d79d94 100644 --- a/src/main/java/com/nis/domain/log/MmAvIpLog.java +++ b/src/main/java/com/nis/domain/log/MmAvIpLog.java @@ -4,7 +4,6 @@ import com.wordnik.swagger.annotations.ApiModelProperty; /** * @ClassName:MmAvIpLog - * @Description:TODO(这里用一句话描述这个类的作用) * @author (zdx) * @date 2018年7月16日 下午2:54:23 * @version V1.0 @@ -19,7 +18,7 @@ public class MmAvIpLog extends BaseLogEntity { @ApiModelProperty(value="封堵现场片段路径", required=true) protected String logUri; @ApiModelProperty(value="入口页面", required=true) - protected String refer; + protected String referer; @ApiModelProperty(value="有害级别", required=true) protected Integer level; @ApiModelProperty(value="封堵类型", required=true) @@ -44,11 +43,11 @@ public class MmAvIpLog extends BaseLogEntity { public void setLogUri(String logUri) { this.logUri = logUri; } - public String getRefer() { - return refer; + public String getReferer() { + return referer; } - public void setRefer(String refer) { - this.refer = refer; + public void setReferer(String referer) { + this.referer = referer; } public Integer getLevel() { return level; diff --git a/src/main/java/com/nis/domain/log/MmAvUrlLog.java b/src/main/java/com/nis/domain/log/MmAvUrlLog.java index 8876715d1..2398f630a 100644 --- a/src/main/java/com/nis/domain/log/MmAvUrlLog.java +++ b/src/main/java/com/nis/domain/log/MmAvUrlLog.java @@ -19,7 +19,7 @@ public class MmAvUrlLog extends BaseLogEntity { @ApiModelProperty(value="封堵现场片段路径", required=true) protected String logUri; @ApiModelProperty(value="入口页面", required=true) - protected String refer; + protected String referer; @ApiModelProperty(value="有害级别", required=true) protected Integer level; @ApiModelProperty(value="封堵类型", required=true) @@ -44,11 +44,11 @@ public class MmAvUrlLog extends BaseLogEntity { public void setLogUri(String logUri) { this.logUri = logUri; } - public String getRefer() { - return refer; + public String getReferer() { + return referer; } - public void setRefer(String refer) { - this.refer = refer; + public void setReferer(String referer) { + this.referer = referer; } public Integer getLevel() { return level; diff --git a/src/main/java/com/nis/domain/log/MmPicIpLog.java b/src/main/java/com/nis/domain/log/MmPicIpLog.java index b837c13e3..94b757eed 100644 --- a/src/main/java/com/nis/domain/log/MmPicIpLog.java +++ b/src/main/java/com/nis/domain/log/MmPicIpLog.java @@ -7,7 +7,7 @@ public class MmPicIpLog extends BaseLogEntity { private String pid;// 节目ID private String url;// 节目访问地址 private String logUri;// fd现场片段路径 - private String refer;// 入口页面 + private String referer;// 入口页面 private Integer level;// 有害级别 private Integer fdType;// fd类型 private String protocol;// 传输协议 @@ -30,11 +30,11 @@ public class MmPicIpLog extends BaseLogEntity { public void setLogUri(String logUri) { this.logUri = logUri; } - public String getRefer() { - return refer; + public String getReferer() { + return referer; } - public void setRefer(String refer) { - this.refer = refer; + public void setReferer(String referer) { + this.referer = referer; } public Integer getLevel() { return level; diff --git a/src/main/java/com/nis/domain/log/MmPicUrlLog.java b/src/main/java/com/nis/domain/log/MmPicUrlLog.java index 03d27778f..4cd406cbd 100644 --- a/src/main/java/com/nis/domain/log/MmPicUrlLog.java +++ b/src/main/java/com/nis/domain/log/MmPicUrlLog.java @@ -7,7 +7,7 @@ public class MmPicUrlLog extends BaseLogEntity{ private String pid;// 节目ID private String url;// 节目访问地址 private String logUri;// fd现场片段路径 - private String refer;// 入口页面 + private String referer;// 入口页面 private Integer level;// 有害级别 private Integer fdType;// fd类型 private String protocol;// 传输协议 @@ -30,11 +30,11 @@ public class MmPicUrlLog extends BaseLogEntity{ public void setLogUri(String logUri) { this.logUri = logUri; } - public String getRefer() { - return refer; + public String getReferer() { + return referer; } - public void setRefer(String refer) { - this.refer = refer; + public void setReferer(String referer) { + this.referer = referer; } public Integer getLevel() { return level; diff --git a/src/main/java/com/nis/domain/log/MmSampleAudioLog.java b/src/main/java/com/nis/domain/log/MmSampleAudioLog.java index 4a0ec40a2..daa512652 100644 --- a/src/main/java/com/nis/domain/log/MmSampleAudioLog.java +++ b/src/main/java/com/nis/domain/log/MmSampleAudioLog.java @@ -7,7 +7,7 @@ public class MmSampleAudioLog extends BaseLogEntity{ private String pid;// 节目ID private String url;// 节目访问地址 private String logUri;// fd现场片段路径 - private String refer;// 入口页面 + private String referer;// 入口页面 private Integer level;// 有害级别 private Integer fdType;// fd类型 private String protocol;// 传输协议 @@ -30,11 +30,11 @@ public class MmSampleAudioLog extends BaseLogEntity{ public void setLogUri(String logUri) { this.logUri = logUri; } - public String getRefer() { - return refer; + public String getReferer() { + return referer; } - public void setRefer(String refer) { - this.refer = refer; + public void setReferer(String referer) { + this.referer = referer; } public Integer getLevel() { return level; @@ -56,7 +56,7 @@ public class MmSampleAudioLog extends BaseLogEntity{ } @Override public String toString() { - return "MmSampleAudioLog [pid=" + pid + ", url=" + url + ", logUri=" + logUri + ", refer=" + refer + ", level=" + return "MmSampleAudioLog [pid=" + pid + ", url=" + url + ", logUri=" + logUri + ", referer=" + referer + ", level=" + level + ", fdType=" + fdType + ", protocol=" + protocol + "]"; } } diff --git a/src/main/java/com/nis/domain/log/MmSamplePicLog.java b/src/main/java/com/nis/domain/log/MmSamplePicLog.java index c7034b300..734200c59 100644 --- a/src/main/java/com/nis/domain/log/MmSamplePicLog.java +++ b/src/main/java/com/nis/domain/log/MmSamplePicLog.java @@ -7,7 +7,7 @@ public class MmSamplePicLog extends BaseLogEntity{ private String pid;// 节目ID private String url;// 节目访问地址 private String logUri;// fd现场片段路径 - private String refer;// 入口页面 + private String referer;// 入口页面 private Integer level;// 有害级别 private Integer fdType;// fd类型 private String protocol;// 传输协议 @@ -29,11 +29,11 @@ public class MmSamplePicLog extends BaseLogEntity{ public void setLogUri(String logUri) { this.logUri = logUri; } - public String getRefer() { - return refer; + public String getReferer() { + return referer; } - public void setRefer(String refer) { - this.refer = refer; + public void setReferer(String referer) { + this.referer = referer; } public Integer getLevel() { return level; @@ -55,7 +55,7 @@ public class MmSamplePicLog extends BaseLogEntity{ } @Override public String toString() { - return "MmSamplePicLog [pid=" + pid + ", url=" + url + ", logUri=" + logUri + ", refer=" + refer + ", level=" + return "MmSamplePicLog [pid=" + pid + ", url=" + url + ", logUri=" + logUri + ", referer=" + referer + ", level=" + level + ", fdType=" + fdType + ", protocol=" + protocol + "]"; } diff --git a/src/main/java/com/nis/domain/log/MmSampleVideoLog.java b/src/main/java/com/nis/domain/log/MmSampleVideoLog.java index 5146bd6d8..55b17cf4b 100644 --- a/src/main/java/com/nis/domain/log/MmSampleVideoLog.java +++ b/src/main/java/com/nis/domain/log/MmSampleVideoLog.java @@ -7,7 +7,7 @@ public class MmSampleVideoLog extends BaseLogEntity{ private String pid;// 节目ID private String url;// 节目访问地址 private String logUri;// fd现场片段路径 - private String refer;// 入口页面 + private String referer;// 入口页面 private Integer level;// 有害级别 private Integer fdType;// fd类型 private String protocol;// 传输协议 @@ -29,11 +29,11 @@ public class MmSampleVideoLog extends BaseLogEntity{ public void setLogUri(String logUri) { this.logUri = logUri; } - public String getRefer() { - return refer; + public String getReferer() { + return referer; } - public void setRefer(String refer) { - this.refer = refer; + public void setReferer(String referer) { + this.referer = referer; } public Integer getLevel() { return level; @@ -55,7 +55,7 @@ public class MmSampleVideoLog extends BaseLogEntity{ } @Override public String toString() { - return "MmSampleVideoLog [pid=" + pid + ", url=" + url + ", logUri=" + logUri + ", refer=" + refer + ", level=" + return "MmSampleVideoLog [pid=" + pid + ", url=" + url + ", logUri=" + logUri + ", referer=" + referer + ", level=" + level + ", fdType=" + fdType + ", protocol=" + protocol + "]"; } diff --git a/src/main/java/com/nis/domain/log/NtBgpLog.java b/src/main/java/com/nis/domain/log/NtBgpLog.java new file mode 100644 index 000000000..fc422373a --- /dev/null +++ b/src/main/java/com/nis/domain/log/NtBgpLog.java @@ -0,0 +1,7 @@ +package com.nis.domain.log; + +public class NtBgpLog extends BaseLogEntity { + private static final long serialVersionUID = 1000090441108515598L; + + +} diff --git a/src/main/java/com/nis/domain/log/NtcHttpLog.java b/src/main/java/com/nis/domain/log/NtcHttpLog.java index ae2e84674..b7c40a447 100644 --- a/src/main/java/com/nis/domain/log/NtcHttpLog.java +++ b/src/main/java/com/nis/domain/log/NtcHttpLog.java @@ -5,10 +5,16 @@ public class NtcHttpLog extends BaseLogEntity { private static final long serialVersionUID = -7697668215327123848L; private String url; + private String reqHdrKey;//请求头转储文件key private String reqHdrFile; + private String reqBodyKey;//请求体转储文件key private String reqBodyFile; + private String resHdrKey;//应答头转储文件key private String resHdrFile; + private String resBodyKey;//应答体转储文件key private String resBodyFile; + private String website;//域名 + /*以下字段无需反馈到界面*/ private Integer c2sIsn; @@ -134,4 +140,34 @@ public class NtcHttpLog extends BaseLogEntity { public void setResLine(String resLine) { this.resLine = resLine; } + public String getReqHdrKey() { + return reqHdrKey; + } + public void setReqHdrKey(String reqHdrKey) { + this.reqHdrKey = reqHdrKey; + } + public String getReqBodyKey() { + return reqBodyKey; + } + public void setReqBodyKey(String reqBodyKey) { + this.reqBodyKey = reqBodyKey; + } + public String getResHdrKey() { + return resHdrKey; + } + public void setResHdrKey(String resHdrKey) { + this.resHdrKey = resHdrKey; + } + public String getResBodyKey() { + return resBodyKey; + } + public void setResBodyKey(String resBodyKey) { + this.resBodyKey = resBodyKey; + } + public String getWebsite() { + return website; + } + public void setWebsite(String website) { + this.website = website; + } } diff --git a/src/main/java/com/nis/util/CodeDicUtils.java b/src/main/java/com/nis/util/CodeDicUtils.java index 580042d61..1bd1a7405 100644 --- a/src/main/java/com/nis/util/CodeDicUtils.java +++ b/src/main/java/com/nis/util/CodeDicUtils.java @@ -51,105 +51,126 @@ public class CodeDicUtils { // } // putCache(CACHE_MENU_LIST, menuList); // } - + //注释码表获取缓存,增加修改清除缓存功能后可以添加缓存 List result = new ArrayList<>(); if (name.equals(APP_CODE)) { - List codeDicList = (List) CacheUtils.get(APP_CODE); - if(StringUtil.isEmpty(codeDicList)){ - codeDicList = codeAppDicDao.getCodeDicList(); - CacheUtils.put(APP_CODE,codeDicList); - } - for (int i = 0; i < codeDicList.size(); i++) { - CodeResult codeResult = new CodeResult(); - codeResult.setItem(codeDicList.get(i).getAppName()); - codeResult.setCode(codeDicList.get(i).getViewCode()); - codeResult.setCoreApp(codeDicList.get(i).getCoreApp()); - result.add(codeResult); +// List codeDicList = (List) CacheUtils.get(APP_CODE); + List codeDicList = codeAppDicDao.getCodeDicList(); +// if(StringUtil.isEmpty(codeDicList)){ +// codeDicList = codeAppDicDao.getCodeDicList(); +// CacheUtils.put(APP_CODE,codeDicList); +// } + if(codeDicList!=null&&codeDicList.size()>0){ + for (int i = 0; i < codeDicList.size(); i++) { + CodeResult codeResult = new CodeResult(); + codeResult.setItem(codeDicList.get(i).getAppName()); + codeResult.setCode(codeDicList.get(i).getViewCode()); + codeResult.setCoreApp(codeDicList.get(i).getCoreApp()); + result.add(codeResult); + } } return result; } else if (name.equals(BEHAVIOR_CODE)) { - List codeDicList = (List) CacheUtils.get(BEHAVIOR_CODE); - if(StringUtil.isEmpty(codeDicList)){ - codeDicList = codeBehaviorTypeDicDao.getCodeDicList(); - CacheUtils.put(BEHAVIOR_CODE,codeDicList); - } - for (int i = 0; i < codeDicList.size(); i++) { - CodeResult codeResult = new CodeResult(); - codeResult.setItem(codeDicList.get(i).getBehaviorType()); - codeResult.setCode(codeDicList.get(i).getViewCode()); - - result.add(codeResult); +// List codeDicList = (List) CacheUtils.get(BEHAVIOR_CODE); +// if(StringUtil.isEmpty(codeDicList)){ +// codeDicList = codeBehaviorTypeDicDao.getCodeDicList(); +// CacheUtils.put(BEHAVIOR_CODE,codeDicList); +// } + List codeDicList = codeBehaviorTypeDicDao.getCodeDicList(); + if(codeDicList!=null&&codeDicList.size()>0){ + for (int i = 0; i < codeDicList.size(); i++) { + CodeResult codeResult = new CodeResult(); + codeResult.setItem(codeDicList.get(i).getBehaviorType()); + codeResult.setCode(codeDicList.get(i).getViewCode()); + + result.add(codeResult); + } } return result; } else if (name.equals(BROWSER_CODE)) { - List codeDicList = (List) CacheUtils.get(BROWSER_CODE); - if(StringUtil.isEmpty(codeDicList)){ - codeDicList = codeBrowserTypeDicDao.getCodeDicList(); - CacheUtils.put(BROWSER_CODE, codeDicList); - } - for (int i = 0; i < codeDicList.size(); i++) { - CodeResult codeResult = new CodeResult(); - codeResult.setItem(codeDicList.get(i).getBrowserType()); - codeResult.setCode(codeDicList.get(i).getViewCode()); - - result.add(codeResult); +// List codeDicList = (List) CacheUtils.get(BROWSER_CODE); +// if(StringUtil.isEmpty(codeDicList)){ +// codeDicList = codeBrowserTypeDicDao.getCodeDicList(); +// CacheUtils.put(BROWSER_CODE, codeDicList); +// } + List codeDicList = codeBrowserTypeDicDao.getCodeDicList(); + if(codeDicList!=null&&codeDicList.size()>0){ + for (int i = 0; i < codeDicList.size(); i++) { + CodeResult codeResult = new CodeResult(); + codeResult.setItem(codeDicList.get(i).getBrowserType()); + codeResult.setCode(codeDicList.get(i).getViewCode()); + + result.add(codeResult); + } } return result; } else if (name.equals(OS_CODE)) { - List codeDicList = (List) CacheUtils.get(OS_CODE); - if(StringUtil.isEmpty(codeDicList)){ - codeDicList = codeOsTypeDicDao.getCodeDicList(); - CacheUtils.put(OS_CODE, codeDicList); - } - for (int i = 0; i < codeDicList.size(); i++) { - CodeResult codeResult = new CodeResult(); - codeResult.setItem(codeDicList.get(i).getOsType()); - codeResult.setCode(codeDicList.get(i).getViewCode()); - - result.add(codeResult); +// List codeDicList = (List) CacheUtils.get(OS_CODE); +// if(StringUtil.isEmpty(codeDicList)){ +// codeDicList = codeOsTypeDicDao.getCodeDicList(); +// CacheUtils.put(OS_CODE, codeDicList); +// } + List codeDicList = codeOsTypeDicDao.getCodeDicList(); + if(codeDicList!=null&&codeDicList.size()>0){ + for (int i = 0; i < codeDicList.size(); i++) { + CodeResult codeResult = new CodeResult(); + codeResult.setItem(codeDicList.get(i).getOsType()); + codeResult.setCode(codeDicList.get(i).getViewCode()); + + result.add(codeResult); + } } return result; } else if (name.equals(PROTOCOL_CODE)) { - List codeDicList = (List) CacheUtils.get(PROTOCOL_CODE); - if(StringUtil.isEmpty(codeDicList)){ - codeDicList = codeProtocolTypeDicDao.getCodeDicList(); - CacheUtils.put(PROTOCOL_CODE, codeDicList); - } - for (int i = 0; i < codeDicList.size(); i++) { - CodeResult codeResult = new CodeResult(); - codeResult.setItem(codeDicList.get(i).getProtocolType()); - codeResult.setCode(codeDicList.get(i).getViewCode()); - - result.add(codeResult); +// List codeDicList = (List) CacheUtils.get(PROTOCOL_CODE); +// if(StringUtil.isEmpty(codeDicList)){ +// codeDicList = codeProtocolTypeDicDao.getCodeDicList(); +// CacheUtils.put(PROTOCOL_CODE, codeDicList); +// } + List codeDicList = codeProtocolTypeDicDao.getCodeDicList(); + if(codeDicList!=null&&codeDicList.size()>0){ + for (int i = 0; i < codeDicList.size(); i++) { + CodeResult codeResult = new CodeResult(); + codeResult.setItem(codeDicList.get(i).getProtocolType()); + codeResult.setCode(codeDicList.get(i).getViewCode()); + + result.add(codeResult); + } } return result; } else if (name.equals(SERVICE_CODE)) { - List codeDicList = (List) CacheUtils.get(SERVICE_CODE); - if(StringUtil.isEmpty(codeDicList)){ - codeDicList = codeServiceTypeDicDao.getCodeDicList(); - CacheUtils.put(SERVICE_CODE, codeDicList); - } - for (int i = 0; i < codeDicList.size(); i++) { - CodeResult codeResult = new CodeResult(); - codeResult.setItem(codeDicList.get(i).getServiceType()); - codeResult.setCode(codeDicList.get(i).getViewCode()); - - result.add(codeResult); +// List codeDicList = (List) CacheUtils.get(SERVICE_CODE); +// if(StringUtil.isEmpty(codeDicList)){ +// codeDicList = codeServiceTypeDicDao.getCodeDicList(); +// CacheUtils.put(SERVICE_CODE, codeDicList); +// } + List codeDicList = codeServiceTypeDicDao.getCodeDicList(); + if(codeDicList!=null&&codeDicList.size()>0){ + for (int i = 0; i < codeDicList.size(); i++) { + CodeResult codeResult = new CodeResult(); + codeResult.setItem(codeDicList.get(i).getServiceType()); + codeResult.setCode(codeDicList.get(i).getViewCode()); + + result.add(codeResult); + } } return result; } else if (name.equals(WEB_CODE)) { - List codeDicList = (List) CacheUtils.get(WEB_CODE); - if(StringUtil.isEmpty(codeDicList)){ - codeDicList = codeWebServiceDicDao.getCodeDicList(); - CacheUtils.put(WEB_CODE, codeDicList); - } - for (int i = 0; i < codeDicList.size(); i++) { - CodeResult codeResult = new CodeResult(); - codeResult.setItem(codeDicList.get(i).getWebsite()); - codeResult.setCode(codeDicList.get(i).getViewCode()); - - result.add(codeResult); +// List codeDicList = (List) CacheUtils.get(WEB_CODE); +// if(StringUtil.isEmpty(codeDicList)){ +// codeDicList = codeWebServiceDicDao.getCodeDicList(); +// CacheUtils.put(WEB_CODE, codeDicList); +// } + List codeDicList = codeWebServiceDicDao.getCodeDicList(); + if(codeDicList!=null&&codeDicList.size()>0){ + for (int i = 0; i < codeDicList.size(); i++) { + CodeResult codeResult = new CodeResult(); + codeResult.setItem(codeDicList.get(i).getWebsite()); + codeResult.setCode(codeDicList.get(i).getViewCode()); + + result.add(codeResult); + } } return result; } diff --git a/src/main/java/com/nis/util/Constants.java b/src/main/java/com/nis/util/Constants.java index 87cb874c2..1d2ad842e 100644 --- a/src/main/java/com/nis/util/Constants.java +++ b/src/main/java/com/nis/util/Constants.java @@ -389,6 +389,8 @@ public final class Constants { public static final String NTC_NTC_LWHH_REPORT=Configurations.getStringProperty("ntcLwhhReport","ntcLwhhReport"); public static final String NTC_NTC_ENTRANCE_REPORT=Configurations.getStringProperty("ntcEntranceReport","ntcEntranceReport"); public static final String NTC_IP_LOG = Configurations.getStringProperty("ntcIpLog",""); + public static final String NTC_BGP_LOG = Configurations.getStringProperty("ntcBgpLog",""); + public static final String NTC_P2P_LOG = Configurations.getStringProperty("ntcP2pLog",""); public static final String NTC_HTTP_LOG = Configurations.getStringProperty("ntcHttpLog",""); public static final String NTC_DNS_LOG = Configurations.getStringProperty("ntcDnsLog",""); public static final String NTC_SSL_LOG = Configurations.getStringProperty("ntcSslLog",""); @@ -482,6 +484,10 @@ public final class Constants { public static final String REDIRECT_RESPONSE_CODE_STARTWITH = Configurations.getStringProperty("redirect_response_code_startwith","30"); public static final String REPLACE_ZONE_KEY = Configurations.getStringProperty("replace_zone_key","zone"); public static final String REPLACE_SUBSTITUTE_KEY = Configurations.getStringProperty("replace_substitute_key","substitute"); + //P2P配置域 + public static final String P2P_HASH_BIN_REGION = Configurations.getStringProperty("p2p_hash_bin_region","NTC_P2P_HASH_BIN"); + public static final String P2P_KEYWORDS_REGION = Configurations.getStringProperty("p2p_keywords_region","NTC_P2P_KEYWORDS"); + public static final String NTC_SUBSCRIBE_ID_REGION = Configurations.getStringProperty("ntc_subscribe_id_region","NTC_SUBSCRIBE_ID"); /** * 样例文件URL关键字 */ @@ -560,6 +566,9 @@ public final class Constants { public static String HTTP_HEADER_DICT_MODULE=Configurations.getStringProperty("http_header_dict_module", "HTTP_HEADER_DISTRICT"); //DNS自定义域参数 public static String DNS_STRATEGY_USER_REGION_KEY=Configurations.getStringProperty("dns_strategy_user_region_key", "DNS_STRATEGY"); + //P2P自定义域参数 + public static String P2P_IP_TYPE_USER_REGION_KEY=Configurations.getStringProperty("p2p_ip_type_user_region_key", "P2P_IP_TYPE"); + public static String P2P_HASH_TYPE_USER_REGION_KEY=Configurations.getStringProperty("p2p_hash_type_user_region_key", "P2P_HASH_TYPE"); //大屏统计分析查询接口URL public static final String DASHBOARD_URL = Configurations.getStringProperty("dashboardUrl","dashboardUrl"); diff --git a/src/main/java/com/nis/web/controller/BaseController.java b/src/main/java/com/nis/web/controller/BaseController.java index 20c915a61..c478ba7c2 100644 --- a/src/main/java/com/nis/web/controller/BaseController.java +++ b/src/main/java/com/nis/web/controller/BaseController.java @@ -52,6 +52,7 @@ import com.nis.util.Constants; import com.nis.util.DateUtils; import com.nis.util.DictUtils; import com.nis.util.JsonMapper; +import com.nis.util.StringUtil; import com.nis.util.excel.ExportExcel; import com.nis.web.service.ArchiveServcie; import com.nis.web.service.AreaService; @@ -637,11 +638,12 @@ public class BaseController { } } - public void setLogAction(BaseLogEntity log) { - List serviceList = DictUtils.getFunctionServiceDictList(log.getFunctionId()); - for (FunctionServiceDict dict : serviceList) { - if (dict.getServiceId().intValue() == log.getService()) { - log.setAction(dict.getAction()); + public void setLogAction(BaseLogEntity log,List serviceList) { + if(!StringUtil.isEmpty(serviceList)){ + for (FunctionServiceDict dict : serviceList) { + if (dict.getServiceId().intValue() == log.getService()) { + log.setAction(dict.getAction()); + } } } } @@ -727,14 +729,12 @@ public class BaseController { StringBuffer errInfo=new StringBuffer(); // ip_type check start Integer ipType=value.getIpType(); - String ipTypeString=null; if(ipType==null){ errInfo.append(String.format(prop.getProperty("can_not_null"), prop.getProperty("ip_type"))+";"); }else{ boolean has=false; for(SysDataDictionaryItem ipTypeItem:ipTypeList){ if(ipType==Integer.parseInt(ipTypeItem.getItemCode())){ - ipTypeString=ipTypeItem.getItemValue(); has=true; break; } @@ -746,14 +746,12 @@ public class BaseController { // ip_type check end // ip_pattern check start Integer ipPattern=value.getIpPattern(); - String ipPatternString=null; if(ipPattern==null){ errInfo.append(String.format(prop.getProperty("can_not_null"), prop.getProperty("ip_pattern"))+";"); }else{ boolean has=false; for(SysDataDictionaryItem ipPatternItem:ipPatternList){ if(ipPattern==Integer.parseInt(ipPatternItem.getItemCode())){ - ipPatternString=ipPatternItem.getItemValue(); has=true; break; } @@ -767,9 +765,9 @@ public class BaseController { String srcIp=value.getSrcIpAddress(); String _msg=""; if("ipmulitiplex".equals(specialItem)) { - _msg=checkIP(prop,prop.getProperty("IP"),srcIp,ipTypeString,ipPatternString); + _msg=checkIP(prop,prop.getProperty("IP"),srcIp,ipType,ipPattern); }else { - _msg=checkIP(prop,prop.getProperty("client_ip"),srcIp,ipTypeString,ipPatternString); + _msg=checkIP(prop,prop.getProperty("client_ip"),srcIp,ipType,ipPattern); } if(StringUtils.isNotBlank(_msg)){ errInfo.append(_msg); @@ -779,40 +777,40 @@ public class BaseController { String destIp=value.getDestIpAddress(); if("ipmulitiplex".equals(specialItem)) {//set 默认值 if(ipPattern!=null&&ipType!=null) { - if("ip_subnet".equals(ipPatternString)) { - if("ipv4".equals(ipTypeString)) { + if(1==ipPattern.intValue()) { + if(4==ipType.intValue()) { value.setDestIpAddress(Constants.IPV4_DEFAULT_IP_SUBNET_VALUE); - }else if("ipv6".equals(ipTypeString)) { + }else if(6==ipType.intValue()) { value.setDestIpAddress(Constants.IPV6_DEFAULT_IP_SUBNET_VALUE); - }else if("4over6".equals(ipTypeString)) { + }else if(46==ipType.intValue()) { value.setDestIpAddress(Constants.IPV6_DEFAULT_IP_SUBNET_VALUE); - }else if("6over4".equals(ipTypeString)) { + }else if(64==ipType.intValue()) { value.setDestIpAddress(Constants.IPV4_DEFAULT_IP_SUBNET_VALUE); - }else if("all".equals(ipTypeString)) { + }else if(10==ipType.intValue()) { value.setDestIpAddress(Constants.IPV4_DEFAULT_IP_SUBNET_VALUE); } - }else if("ip_range".equals(ipPatternString)) { - if("ipv4".equals(ipTypeString)) { + }else if(2==ipPattern.intValue()) { + if(4==ipType.intValue()) { value.setDestIpAddress(Constants.IPV4_DEFAULT_IP_RANGE_VALUE); - }else if("ipv6".equals(ipTypeString)) { + }else if(6==ipType.intValue()) { value.setDestIpAddress(Constants.IPV6_DEFAULT_IP_RANGE_VALUE); - }else if("4over6".equals(ipTypeString)) { + }else if(46==ipType.intValue()) { value.setDestIpAddress(Constants.IPV6_DEFAULT_IP_RANGE_VALUE); - }else if("6over4".equals(ipTypeString)) { + }else if(64==ipType.intValue()) { value.setDestIpAddress(Constants.IPV4_DEFAULT_IP_RANGE_VALUE); - }else if("all".equals(ipTypeString)) { + }else if(10==ipType.intValue()) { value.setDestIpAddress(Constants.IPV4_DEFAULT_IP_RANGE_VALUE); } - }else if("ip".equals(ipPatternString)) { - if("ipv4".equals(ipTypeString)) { + }else if(3==ipPattern.intValue()) { + if(4==ipType.intValue()) { value.setDestIpAddress(Constants.IPV4_DEFAULT_IP_VALUE); - }else if("ipv6".equals(ipTypeString)) { + }else if(6==ipType.intValue()) { value.setDestIpAddress(Constants.IPV6_DEFAULT_IP_VALUE); - }else if("4over6".equals(ipTypeString)) { + }else if(46==ipType.intValue()) { value.setDestIpAddress(Constants.IPV6_DEFAULT_IP_VALUE); - }else if("6over4".equals(ipTypeString)) { + }else if(64==ipType.intValue()) { value.setDestIpAddress(Constants.IPV4_DEFAULT_IP_VALUE); - }else if("all".equals(ipTypeString)) { + }else if(10==ipType.intValue()) { value.setDestIpAddress(Constants.IPV4_DEFAULT_IP_VALUE); } } @@ -822,13 +820,13 @@ public class BaseController { String info=String.format(prop.getProperty("are_the_same"),prop.getProperty("client_ip"),prop.getProperty("server_ip")); errInfo.append(info+";"); } - _msg=checkIP(prop,prop.getProperty("server_ip"),destIp,ipTypeString,ipPatternString); + _msg=checkIP(prop,prop.getProperty("server_ip"),destIp,ipType,ipPattern); if(StringUtils.isNotBlank(_msg)){ errInfo.append(_msg); } } - if(!"ipmulitiplex".equals(specialItem)&&("4over6".equals(ipTypeString)||"6over4".equals(ipTypeString)||"all".equals(ipTypeString))) { - _msg=checkIp(prop, prop.getProperty("client_ip"), srcIp, prop.getProperty("server_ip"), destIp, ipTypeString, ipPatternString); + if(!"ipmulitiplex".equals(specialItem)&&(46==ipType.intValue()||64==ipType.intValue()||10==ipType.intValue())) { + _msg=checkIp(prop, prop.getProperty("client_ip"), srcIp, prop.getProperty("server_ip"), destIp, ipType, ipPattern); if(StringUtils.isNotBlank(_msg)){ errInfo.append(_msg); } @@ -836,14 +834,12 @@ public class BaseController { //server_ip check end //port_pattern check start Integer portPattern=value.getPortPattern(); - String portPatternString=null; if(portPattern==null){ errInfo.append(String.format(prop.getProperty("can_not_null"), prop.getProperty("port_pattern"))+";"); }else{ boolean has=false; for(SysDataDictionaryItem portPatternItem:portPatternList){ if(portPattern==Integer.parseInt(portPatternItem.getItemCode())){ - portPatternString=portPatternItem.getItemValue(); has=true; break; } @@ -856,9 +852,9 @@ public class BaseController { //src_port check start String srcPort=value.getSrcPort(); if("ipmulitiplex".equals(specialItem)) { - _msg=checkPort(prop,prop.getProperty("port"), srcPort, portPatternString); + _msg=checkPort(prop,prop.getProperty("port"), srcPort, portPattern); }else { - _msg=checkPort(prop,prop.getProperty("client_port"), srcPort, portPatternString); + _msg=checkPort(prop,prop.getProperty("client_port"), srcPort, portPattern); } if(StringUtils.isNotBlank(_msg)){ @@ -869,14 +865,14 @@ public class BaseController { String destPort=value.getDestPort(); if("ipmulitiplex".equals(specialItem)) {//set 默认值 if(portPattern!=null) { - if("port_mask".equals(portPatternString)) { + if(2==portPattern.intValue()) { value.setDestPort(Constants.PORT_MASK_DEFAULT); - }else if("port".equals(portPatternString)) { + }else if(1==portPattern.intValue()) { value.setDestPort(Constants.PORT_DEFAULT); } } }else { - _msg=checkPort(prop,prop.getProperty("server_port"), destPort, portPatternString); + _msg=checkPort(prop,prop.getProperty("server_port"), destPort, portPattern); } if(StringUtils.isNotBlank(_msg)){ errInfo.append(_msg); @@ -1147,10 +1143,72 @@ public class BaseController { } return msg.toString(); } - public static String checkIp(Properties prop,String srcIpName,String srcIp,String destIpName,String destIp,String ipType,String ipPattern) { + /** + * + * checkIP(IP格式验证) + * (这里描述这个方法适用条件 – 可选) + * @param ipName + * @param ip + * @param ipType + * @param ipPattern + * @return + *String + * @exception + * @since 1.0.0 + */ + public static String checkIP(Properties prop,String ipName,String ip,Integer ipType,Integer ipPattern){ StringBuffer msg=new StringBuffer(); - if("4over6".equals(ipType)){ - if("ip_subnet".equals(ipPattern)){ + if(StringUtils.isBlank(ip)){ + msg.append(String.format(prop.getProperty("can_not_null"), ipName)+";"); + }else{ + if(4==ipType.intValue()){ + if(1==ipPattern.intValue()){ + Pattern pattern=Pattern.compile(Constants.IPV4_IP_SUBNET_REGEXP); + Matcher matcher=pattern.matcher(ip); + if(!matcher.matches()){//完全匹配 + msg.append(String.format(prop.getProperty("is_in_wrong_format"), ipName)+";"); + } + }else if(2==ipPattern.intValue()){ + Pattern pattern=Pattern.compile(Constants.IPV4_IP_RANGE_REGEXP); + Matcher matcher=pattern.matcher(ip); + if(!matcher.matches()){//完全匹配 + msg.append(String.format(prop.getProperty("is_in_wrong_format"), ipName)+";"); + } + }else if(3==ipPattern.intValue()){ + Pattern pattern=Pattern.compile(Constants.IPV4_IP_REGEXP); + Matcher matcher=pattern.matcher(ip); + if(!matcher.matches()){//完全匹配 + msg.append(String.format(prop.getProperty("is_in_wrong_format"), ipName)+";"); + } + } + }else if(6==ipType.intValue()){ + if(1==ipPattern.intValue()){ + Pattern pattern=Pattern.compile(Constants.IPV6_IP_SUBNET_REGEXP); + Matcher matcher=pattern.matcher(ip); + if(!matcher.matches()){//完全匹配 + msg.append(String.format(prop.getProperty("is_in_wrong_format"), ipName)+";"); + } + }else if(2==ipPattern.intValue()){ + Pattern pattern=Pattern.compile(Constants.IPV6_IP_RANGE_REGEXP); + Matcher matcher=pattern.matcher(ip); + if(!matcher.matches()){//完全匹配 + msg.append(String.format(prop.getProperty("is_in_wrong_format"), ipName)+";"); + } + }else if(3==ipPattern.intValue()){ + Pattern pattern=Pattern.compile(Constants.IPV6_IP_REGEXP); + Matcher matcher=pattern.matcher(ip); + if(!matcher.matches()){//完全匹配 + msg.append(String.format(prop.getProperty("is_in_wrong_format"), ipName)+";"); + } + } + } + } + return msg.toString(); + } + public static String checkIp(Properties prop,String srcIpName,String srcIp,String destIpName,String destIp,Integer ipType,Integer ipPattern) { + StringBuffer msg=new StringBuffer(); + if(46==ipType.intValue()){ + if(1==ipPattern.intValue()){ Pattern patternV4=Pattern.compile(Constants.IPV4_IP_SUBNET_REGEXP); Pattern patternV6=Pattern.compile(Constants.IPV6_IP_SUBNET_REGEXP); Matcher matcherV4=patternV4.matcher(srcIp); @@ -1161,7 +1219,7 @@ public class BaseController { if(!matcherV6.matches()){//完全匹配 msg.append(String.format(prop.getProperty("is_in_wrong_format"), destIpName)+";"); } - }else if("ip_range".equals(ipPattern)){ + }else if(2==ipPattern.intValue()){ Pattern patternV4=Pattern.compile(Constants.IPV4_IP_RANGE_REGEXP); Pattern patternV6=Pattern.compile(Constants.IPV6_IP_RANGE_REGEXP); Matcher matcherV4=patternV4.matcher(srcIp); @@ -1172,7 +1230,7 @@ public class BaseController { if(!matcherV6.matches()){//完全匹配 msg.append(String.format(prop.getProperty("is_in_wrong_format"), destIpName)+";"); } - }else if("ip".equals(ipPattern)){ + }else if(3==ipPattern.intValue()){ Pattern patternV4=Pattern.compile(Constants.IPV4_IP_REGEXP); Pattern patternV6=Pattern.compile(Constants.IPV6_IP_REGEXP); Matcher matcherV4=patternV4.matcher(srcIp); @@ -1184,8 +1242,8 @@ public class BaseController { msg.append(String.format(prop.getProperty("is_in_wrong_format"), destIpName)+";"); } } - }else if("6over4".equals(ipType)) { - if("ip_subnet".equals(ipPattern)){ + }else if(64==ipType.intValue()) { + if(1==ipPattern.intValue()){ Pattern patternV4=Pattern.compile(Constants.IPV4_IP_SUBNET_REGEXP); Pattern patternV6=Pattern.compile(Constants.IPV6_IP_SUBNET_REGEXP); Matcher matcherV4=patternV4.matcher(destIp); @@ -1196,7 +1254,7 @@ public class BaseController { if(!matcherV6.matches()){//完全匹配 msg.append(String.format(prop.getProperty("is_in_wrong_format"), srcIpName)+";"); } - }else if("ip_range".equals(ipPattern)){ + }else if(2==ipPattern.intValue()){ Pattern patternV4=Pattern.compile(Constants.IPV4_IP_RANGE_REGEXP); Pattern patternV6=Pattern.compile(Constants.IPV6_IP_RANGE_REGEXP); Matcher matcherV4=patternV4.matcher(destIp); @@ -1207,7 +1265,7 @@ public class BaseController { if(!matcherV6.matches()){//完全匹配 msg.append(String.format(prop.getProperty("is_in_wrong_format"), srcIpName )+";"); } - }else if("ip".equals(ipPattern)){ + }else if(3==ipPattern.intValue()){ Pattern patternV4=Pattern.compile(Constants.IPV4_IP_REGEXP); Pattern patternV6=Pattern.compile(Constants.IPV6_IP_REGEXP); Matcher matcherV4=patternV4.matcher(destIp); @@ -1219,8 +1277,8 @@ public class BaseController { msg.append(String.format(prop.getProperty("is_in_wrong_format"), srcIpName)+";"); } } - }else if("all".equals(ipType)) { - if("ip_subnet".equals(ipPattern)){ + }else if(10==ipType.intValue()) { + if(1==ipPattern.intValue()){ Pattern patternV4=Pattern.compile(Constants.IPV4_IP_SUBNET_REGEXP); Pattern patternV6=Pattern.compile(Constants.IPV6_IP_SUBNET_REGEXP); Matcher matcherSrcIpV4=patternV4.matcher(srcIp); @@ -1233,7 +1291,7 @@ public class BaseController { if(!matcherDestIpV4.matches()&&!matcherDestIpV6.matches()){//完全匹配 msg.append(String.format(prop.getProperty("is_in_wrong_format"), destIpName)+";"); } - }else if("ip_range".equals(ipPattern)){ + }else if(2==ipPattern.intValue()){ Pattern patternV4=Pattern.compile(Constants.IPV4_IP_RANGE_REGEXP); Pattern patternV6=Pattern.compile(Constants.IPV6_IP_RANGE_REGEXP); Matcher matcherSrcIpV4=patternV4.matcher(srcIp); @@ -1246,7 +1304,7 @@ public class BaseController { if(!matcherDestIpV4.matches()&&!matcherDestIpV6.matches()){//完全匹配 msg.append(String.format(prop.getProperty("is_in_wrong_format"), destIpName)+";"); } - }else if("ip".equals(ipPattern)){ + }else if(3==ipPattern.intValue()){ Pattern patternV4=Pattern.compile(Constants.IPV4_IP_REGEXP); Pattern patternV6=Pattern.compile(Constants.IPV6_IP_REGEXP); Matcher matcherSrcIpV4=patternV4.matcher(srcIp); @@ -1263,12 +1321,12 @@ public class BaseController { } return msg.toString(); } - public static String checkPort(Properties prop,String portName,String port,String portPattern){ + public static String checkPort(Properties prop,String portName,String port,Integer portPattern){ StringBuffer msg=new StringBuffer(); if(StringUtils.isBlank(port)){ msg.append(String.format(prop.getProperty("can_not_null"), portName)+";"); }else{ - if("port".equals(portPattern)){ + if(1==portPattern.intValue()){ try{ Integer portInt=Integer.parseInt(port); if(portInt<0||portInt>65535){ @@ -1278,7 +1336,7 @@ public class BaseController { // TODO: handle exception msg.append(String.format(prop.getProperty("not_number"), portName)+";"); } - }else if("port_mask".equals(portPattern)){ + }else if(2==portPattern.intValue()){ if(port.indexOf("/")==-1){ msg.append(String.format(prop.getProperty("is_in_wrong_format"), portName)+";"); }else{ diff --git a/src/main/java/com/nis/web/controller/configuration/AppCfgController.java b/src/main/java/com/nis/web/controller/configuration/AppCfgController.java index 586f20711..1a9ed2334 100644 --- a/src/main/java/com/nis/web/controller/configuration/AppCfgController.java +++ b/src/main/java/com/nis/web/controller/configuration/AppCfgController.java @@ -22,6 +22,7 @@ import com.nis.domain.configuration.AppDomainCfg; import com.nis.domain.configuration.AppHttpCfg; import com.nis.domain.configuration.AppIpCfg; import com.nis.domain.configuration.AppPolicyCfg; +import com.nis.domain.configuration.AppSslCertCfg; import com.nis.domain.configuration.IpPortCfg; import com.nis.domain.specific.SpecificServiceCfg; import com.nis.exceptions.MaatConvertException; @@ -633,4 +634,114 @@ public class AppCfgController extends BaseController { appCfgService.updateAppByteCfgValid(isValid,ids,functionId); return "redirect:" + adminPath +"/app/byteCfgList?functionId="+functionId; } + + /** + * APP ssl证书特征配置 列表 + * @param model + * @param cfg + * @param request + * @param response + * @return + */ + @RequestMapping(value = {"sslCfgList"}) + public String sslCfgList(Model model,@ModelAttribute("cfg")AppSslCertCfg cfg,HttpServletRequest request,HttpServletResponse response) { + Page searchPage=new Page(request,response,"r"); + Page page = appCfgService.findAppSslList(searchPage, cfg); + for(AppSslCertCfg entity:page.getList()){ + SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId()); + entity.setAppName(app.getSpecServiceName()); + } + model.addAttribute("page", page); + initPageCondition(model,cfg); + return "/cfg/app/appSslCfgList"; + } + /** + * APP ssl证书特征配置表单(新增/修改) + * @param model + * @param ids + * @param entity + * @return + */ + @RequestMapping(value = {"sslCfgForm"}) + @RequiresPermissions(value={"app:ssl:config"}) + public String sslCfgForm(Model model,String ids,AppSslCertCfg entity) { + if(StringUtils.isNotBlank(ids)){ + entity = appCfgService.getAppSslCfg(Long.parseLong(ids)); + initUpdateFormCondition(model,entity); + }else{ + initFormCondition(model,entity); + } + model.addAttribute("_cfg", entity); + return "/cfg/app/appSslCfgForm"; + } + /** + * APP ssl证书特征配置(新增/修改)提交 + * @param model + * @param request + * @param response + * @param entity + * @param redirectAttributes + * @return + */ + @RequestMapping(value = {"saveAppSslCfg"}) + @RequiresPermissions(value={"app:ssl:config"}) + public String saveAppSslCfg(Model model,HttpServletRequest request,HttpServletResponse response, + AppSslCertCfg entity,RedirectAttributes redirectAttributes) { + try { + SpecificServiceCfg specificService = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId()); + if(specificService!=null){ + entity.setAppCode(specificService.getSpecServiceCode()); + } + appCfgService.saveOrUpdateAppSslCfg(entity); + } catch (Exception e) { + e.printStackTrace(); + addMessage(redirectAttributes, e.getMessage()); + } + + return "redirect:" + adminPath +"/app/sslCfgList?functionId="+entity.getFunctionId(); + } + /** + * APP ssl证书特征配置 审核 + * @param isAudit + * @param isValid + * @param ids + * @param functionId + * @param redirectAttributes + * @return + */ + @RequestMapping(value = {"auditAppSslCfg"}) + @RequiresPermissions(value={"app:ssl:confirm"}) + public String auditAppSslCfg(Integer isAudit,Integer isValid,String ids,Integer functionId, RedirectAttributes redirectAttributes) { + AppSslCertCfg entity = new AppSslCertCfg(); + String[] idArray = ids.split(","); + for(String id :idArray){ + entity = appCfgService.getAppSslCfg(Long.parseLong(id)); + entity.setIsAudit(isAudit); + entity.setIsValid(isValid); + entity.setAuditorId(UserUtils.getUser().getId()); + entity.setAuditTime(new Date()); + entity.setFunctionId(functionId); + try { + appCfgService.auditAppSslCfg(entity,isAudit); + } catch (MaatConvertException e) { + e.printStackTrace(); + logger.info("app SSL配置下发失败:"+e.getMessage()); + addMessage(redirectAttributes, e.getMessage()); + } + } + return "redirect:" + adminPath +"/app/sslCfgList?functionId="+functionId; + } + /** + * APP ssl证书特征配置 删除 + * @param isValid + * @param ids + * @param functionId + * @return + */ + @RequestMapping(value = {"updateAppSslCfgValid"}) + @RequiresPermissions(value={"app:ssl:config"}) + public String updateAppSslCfgValid(Integer isValid,String ids,Integer functionId) { + appCfgService.updateAppSslCfgValid(isValid,ids,functionId); + return "redirect:" + adminPath +"/app/sslCfgList?functionId="+functionId; + } } diff --git a/src/main/java/com/nis/web/controller/configuration/ntc/AvContentController.java b/src/main/java/com/nis/web/controller/configuration/ntc/AvContentController.java index 12d512e46..9f97f0086 100644 --- a/src/main/java/com/nis/web/controller/configuration/ntc/AvContentController.java +++ b/src/main/java/com/nis/web/controller/configuration/ntc/AvContentController.java @@ -30,6 +30,7 @@ import com.nis.domain.configuration.AreaIpCfg; import com.nis.domain.configuration.AvContIpCfg; import com.nis.domain.configuration.AvVoipAccountCfg; import com.nis.domain.configuration.CfgIndexInfo; +import com.nis.domain.configuration.NtcSubscribeIdCfg; import com.nis.exceptions.MaatConvertException; import com.nis.domain.configuration.AvVoipIpCfg; import com.nis.domain.configuration.BaseIpCfg; @@ -51,53 +52,67 @@ import com.nis.web.security.UserUtils; @RequestMapping("${adminPath}/ntc/av") public class AvContentController extends BaseController { /*****************************voip业务***************/ - //音视频VOIP配置新增界面 + //音视频VOIP IP配置新增界面 @RequestMapping(value = {"/voipForm"}) @RequiresPermissions(value={"avVoip:config"}) - public String voipFrom(Model model,HttpServletRequest request - ,HttpServletResponse response - ,String ids,String compileIds - ,@ModelAttribute("cfg")CfgIndexInfo cfg - ,RedirectAttributes redirectAttributes){ + public String voipFrom(Model model,HttpServletRequest request ,HttpServletResponse response + ,String compileIds,String ids, CfgIndexInfo cfg ,RedirectAttributes redirectAttributes){ if(!StringUtil.isEmpty(compileIds)){ cfg.setCompileId(Integer.parseInt(compileIds)); cfg = avContentCfgService.getCfgIndexInfo(cfg); initUpdateFormCondition(model, cfg); }else{ - List avVoipAccountCfgs=new ArrayList(); - avVoipAccountCfgs.add(new AvVoipAccountCfg()); - cfg.setVoipAccounts(avVoipAccountCfgs); - List avVoipIpCfgs=new ArrayList(); - avVoipIpCfgs.add(new AvVoipIpCfg()); - cfg.setVoipIps(avVoipIpCfgs); initFormCondition(model,cfg); } model.addAttribute("_cfg", cfg); return "/cfg/av/voip/voipForm"; } + //音视频VOIP Account配置新增界面 + @RequestMapping(value = {"/voipAccountForm"}) + @RequiresPermissions(value={"avVoip:config"}) + public String voipAccountForm(Model model,HttpServletRequest request ,HttpServletResponse response + ,String compileIds,String ids, CfgIndexInfo cfg ,RedirectAttributes redirectAttributes){ + //修改 + if(!StringUtil.isEmpty(compileIds)){ + cfg.setCompileId(Integer.parseInt(compileIds)); + cfg = avContentCfgService.getCfgIndexInfo2(cfg); + initUpdateFormCondition(model, cfg); + }else{ + initFormCondition(model,cfg);//新增 + } + + model.addAttribute("_cfg", cfg); + return "/cfg/av/voip/voipAccountForm"; + } - - //保存voip信息 + //保存voip ip信息 @RequestMapping(value = {"/saveVoip"}) - public String saveVoip(Model model,HttpServletRequest request,HttpServletResponse response, - @ModelAttribute("cfg")CfgIndexInfo cfg, - @ModelAttribute("areaCfgIds")String areaCfgIds, - @ModelAttribute("voipIpIds")String voipIpIds, - @ModelAttribute("voipAccountIds")String voipAccountIds - ,RedirectAttributes redirectAttributes){ + public String saveVoip(Model model,HttpServletRequest request,HttpServletResponse response,String ids, + CfgIndexInfo cfg ,RedirectAttributes redirectAttributes){ try{ - avContentCfgService.saveOrUpdateAvVoip(cfg,voipIpIds,voipAccountIds,areaCfgIds); + avContentCfgService.saveOrUpdateAvVoip(cfg); addMessage(redirectAttributes,"save_success"); }catch(Exception e){ - logger.error("voip信息保存失败",e); + logger.error("voip IP信息保存失败",e); addMessage(redirectAttributes,"save_failed"); - } - + } return "redirect:" + adminPath +"/ntc/av/voipList?functionId="+cfg.getFunctionId(); } - - //视频文本VOIP配置列表 + //保存voip Account信息 + @RequestMapping(value = {"/saveAccountVoip"}) + public String saveAccountVoip(Model model,HttpServletRequest request,HttpServletResponse response,String ids, + CfgIndexInfo cfg ,RedirectAttributes redirectAttributes){ + try{ + avContentCfgService.saveOrUpdateAvVoipAccount(cfg); + addMessage(redirectAttributes,"save_success"); + }catch(Exception e){ + logger.error("voip Account信息保存失败",e); + addMessage(redirectAttributes,"save_failed"); + } + return "redirect:" + adminPath +"/ntc/av/voipAccountList?functionId="+cfg.getFunctionId(); + } + //视频文本VOIP IP配置列表 @RequestMapping(value = {"/voipList"}) public String voipCfgList(Model model,HttpServletRequest request ,HttpServletResponse response @@ -109,23 +124,50 @@ public class AvContentController extends BaseController { if(entity.getVoipAccount()== null){ entity.setVoipAccount(new AvVoipAccountCfg()); } + if(entity.getNtcSubscribeIdCfg()==null){ + entity.setNtcSubscribeIdCfg(new NtcSubscribeIdCfg()); + } Page page = avContentCfgService.findPage(new Page(request, response,"r"), entity); model.addAttribute("page", page); initPageCondition(model); return "/cfg/av/voip/voipList"; } + //视频文本VOIP Account配置列表 + @RequestMapping(value = {"/voipAccountList"}) + public String voipCfgAccountList(Model model,HttpServletRequest request ,HttpServletResponse response + ,@ModelAttribute("cfg")CfgIndexInfo entity ,RedirectAttributes redirectAttributes){ + if(entity.getVoipAccount()== null){ + entity.setVoipAccount(new AvVoipAccountCfg()); + } + if(entity.getNtcSubscribeIdCfg()==null){ + entity.setNtcSubscribeIdCfg(new NtcSubscribeIdCfg()); + } + Page page = avContentCfgService.findAccountPage(new Page(request, response,"r"), entity); + model.addAttribute("page", page); + initPageCondition(model); + return "/cfg/av/voip/voipAccountList"; + } - //修改VOIP配置状态 + //修改VOIP IP配置状态 @RequestMapping(value = {"/updateAvVoipValid"}) @RequiresPermissions(value={"avVoip:config"}) - public String updateVoipValid(Integer isAudit,Integer isValid,String ids,Integer functionId + public String updateVoipValid(Integer isAudit,String compileIds,Integer isValid,String ids,Integer functionId ,RedirectAttributes redirectAttributes ) { - avContentCfgService.updateAvVoipValid(isAudit,isValid,ids,functionId); + avContentCfgService.updateAvVoipValid(isAudit,isValid,compileIds,functionId); return "redirect:" + adminPath +"/ntc/av/voipList?functionId="+functionId; } - //修改VOIP配置审核状态 + //修改VOIP account配置状态 + @RequestMapping(value = {"/updateAvVoipAccountValid"}) + @RequiresPermissions(value={"avVoip:config"}) + public String updateVoipAccountValid(Integer isAudit,String compileIds,Integer isValid,String ids,Integer functionId + ,RedirectAttributes redirectAttributes + ) { + avContentCfgService.updateAvVoipAccountValid(isAudit,isValid,compileIds,functionId); + return "redirect:" + adminPath +"/ntc/av/voipAccountList?functionId="+functionId; + } + //修改VOIP IP配置审核状态 @RequestMapping(value = {"/auditAvVoip"}) @RequiresPermissions(value={"avVoip:confirm"}) public String auditVoip(Integer isAudit,Integer isValid,String ids @@ -146,22 +188,64 @@ public class AvContentController extends BaseController { } return "redirect:" + adminPath +"/ntc/av/voipList?functionId="+functionId; } + //修改VOIP IP配置审核状态 + @RequestMapping(value = {"/auditAvVoipAccount"}) + @RequiresPermissions(value={"avVoip:confirm"}) + public String auditVoipAccount(Integer isAudit,Integer isValid,String ids + ,String compileIds,Integer functionId + ,RedirectAttributes redirectAttributes) { + if(!StringUtil.isEmpty(compileIds)){ + String[] idArray = compileIds.split(","); + Date auditTime=new Date(); + for(String id :idArray){ + try { + avContentCfgService.auditAvVoipAccount(isAudit,isValid,functionId,id,auditTime); + } catch (MaatConvertException e) { + logger.error("VOIP Account配置下发失败",e); + addMessage(redirectAttributes, e.getMessage()); + } + } + + } + return "redirect:" + adminPath +"/ntc/av/voipAccountList?functionId="+functionId; + } + /** + * 账号account + * 根据索引表信息异步获取子表信息 + * @return + */ + @ResponseBody + @RequestMapping(value = "ajaxVoipAccountInfo") + public Map getVoipAccountInfo(CfgIndexInfo cfgIndexInfo) { + Map voipAndAccountInfoMap=new HashMap(); + List voipAccountCfgList=new ArrayList(); + List ntcSubscribeIdCfgList=new ArrayList(); + + voipAccountCfgList = avContentCfgService.getVoipAccountCfgList(cfgIndexInfo); + ntcSubscribeIdCfgList=avContentCfgService.getSubscribeIdCfgList(cfgIndexInfo); + + voipAndAccountInfoMap.put("account", voipAccountCfgList); + voipAndAccountInfoMap.put("subscribe", ntcSubscribeIdCfgList); + return voipAndAccountInfoMap; + } /** * 根据索引表信息异步获取子表信息 * @return */ @ResponseBody - @RequestMapping(value = "ajaxVoipAndAccountInfo") - public Map getVoipAndAccountInfo(CfgIndexInfo cfgIndexInfo) { + @RequestMapping(value = "ajaxVoipIpInfo") + public Map getVoipIpInfo(CfgIndexInfo cfgIndexInfo) { Map voipAndAccountInfoMap=new HashMap(); //获取voipIpCfg信息 List voipIpCfgList=new ArrayList(); - List voipAccountCfgList=new ArrayList(); + List ntcSubscribeIdCfgList=new ArrayList(); + voipIpCfgList = avContentCfgService.getVoipIpCfgList(cfgIndexInfo); - voipAccountCfgList = avContentCfgService.getVoipAccountCfgList(cfgIndexInfo); + ntcSubscribeIdCfgList=avContentCfgService.getSubscribeIdCfgList(cfgIndexInfo); + voipAndAccountInfoMap.put("ip", voipIpCfgList); - voipAndAccountInfoMap.put("account", voipAccountCfgList); + voipAndAccountInfoMap.put("subscribe", ntcSubscribeIdCfgList); return voipAndAccountInfoMap; } /*****************************voip业务***************/ diff --git a/src/main/java/com/nis/web/controller/configuration/ntc/FileTransferCfgController.java b/src/main/java/com/nis/web/controller/configuration/ntc/FileTransferCfgController.java index 649dd4730..5576b03d5 100644 --- a/src/main/java/com/nis/web/controller/configuration/ntc/FileTransferCfgController.java +++ b/src/main/java/com/nis/web/controller/configuration/ntc/FileTransferCfgController.java @@ -29,9 +29,13 @@ import com.nis.domain.configuration.CfgIndexInfo; import com.nis.domain.configuration.ComplexkeywordCfg; import com.nis.domain.configuration.FileDigestCfg; import com.nis.domain.configuration.IpPortCfg; +import com.nis.domain.configuration.NtcSubscribeIdCfg; +import com.nis.domain.configuration.P2pHashCfg; +import com.nis.domain.configuration.P2pKeywordCfg; 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.FileUtils; import com.nis.util.JsonMapper; import com.nis.util.StringUtil; @@ -226,4 +230,154 @@ public class FileTransferCfgController extends BaseController{ } return "redirect:" + adminPath +"/ntc/fileTransfer/fileDigestList?functionId="+functionId; } + + @RequestMapping(value = {"p2pList"}) + public String p2pList(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg,HttpServletRequest request,HttpServletResponse response) { + Page searchPage=new Page(request,response,"a"); + Page page = fileTransferCfgService.getP2pList(searchPage, cfg); + model.addAttribute("page", page); + initPageCondition(model,cfg); + return "/cfg/fileTransfer/p2pList"; + } + + @RequestMapping(value = {"p2pForm"}) + @RequiresPermissions(value={"fileTransfer:p2p:config"}) + public String p2pForm(Model model,String ids,CfgIndexInfo entity) { + // 跳转操作页面(根据ids判断是新增 or 修改) + if(StringUtils.isNotBlank(ids)){ + entity = fileTransferCfgService.getP2pCfg(Long.parseLong(ids)); + + // 添加配置域Key,用于修改页面区分各域配置 + P2pHashCfg hashCfg = new P2pHashCfg(); + hashCfg.setCfgType(Constants.P2P_HASH_BIN_REGION); + entity.setP2pHash(hashCfg); + P2pKeywordCfg keywordCfg = new P2pKeywordCfg(); + keywordCfg.setCfgType(Constants.P2P_KEYWORDS_REGION); + entity.setP2pKeyword(keywordCfg); + NtcSubscribeIdCfg subscribeIdCfg = new NtcSubscribeIdCfg(); + subscribeIdCfg.setCfgType(Constants.NTC_SUBSCRIBE_ID_REGION); + entity.setNtcSubscribeIdCfg(subscribeIdCfg); + + if(entity.getP2pHashList().size() == 0) { + entity.getP2pHashList().add(hashCfg); + } + if(entity.getP2pKeywordList().size() == 0) { + entity.getP2pKeywordList().add(keywordCfg); + } + if(entity.getNtcSubscribeIdCfgList().size() == 0) { + entity.getNtcSubscribeIdCfgList().add(subscribeIdCfg); + } + + initUpdateFormCondition(model,entity); + }else{ + // 添加配置域Key,用于新增页面区分各域配置 + P2pHashCfg hashCfg = new P2pHashCfg(); + hashCfg.setCfgType(Constants.P2P_HASH_BIN_REGION); + entity.setP2pHash(hashCfg); + P2pKeywordCfg keywordCfg = new P2pKeywordCfg(); + keywordCfg.setCfgType(Constants.P2P_KEYWORDS_REGION); + entity.setP2pKeyword(keywordCfg); + NtcSubscribeIdCfg subscribeIdCfg = new NtcSubscribeIdCfg(); + subscribeIdCfg.setCfgType(Constants.NTC_SUBSCRIBE_ID_REGION); + entity.setNtcSubscribeIdCfg(subscribeIdCfg); + + List hashList = new ArrayList(); + hashList.add(hashCfg); + entity.setP2pHashList(hashList); + List keywordList = new ArrayList(); + keywordList.add(keywordCfg); + entity.setP2pKeywordList(keywordList); + ArrayList subscribeIdList = new ArrayList(); + subscribeIdList.add(subscribeIdCfg); + entity.setNtcSubscribeIdCfgList(subscribeIdList); + + initFormCondition(model,entity); + } + + model.addAttribute("_cfg", entity); + return "/cfg/fileTransfer/p2pForm"; + } + + @RequestMapping(value = {"saveP2pCfg"}) + @RequiresPermissions(value={"fileTransfer:p2p:config"}) + public String saveP2pCfg(Model model,HttpServletRequest request,HttpServletResponse response,String ids,CfgIndexInfo entity) { + fileTransferCfgService.saveP2pCfg(entity); + return "redirect:" + adminPath +"/ntc/fileTransfer/p2pList?functionId="+entity.getFunctionId(); + } + + @RequestMapping(value = {"updateP2pCfgValid"}) + @RequiresPermissions(value={"fileTransfer:p2p:config"}) + public String updateP2pCfgValid(Integer isValid,String ids,Integer functionId) { + fileTransferCfgService.updateP2pCfgValid(isValid,ids,functionId); + return "redirect:" + adminPath +"/ntc/fileTransfer/p2pList?functionId="+functionId; + } + + @RequestMapping(value = {"ajaxP2pSubList"}) + public String ajaxP2pSubList(Model model,Long cfgId,Integer index) { + CfgIndexInfo cfg = fileTransferCfgService.getP2pCfg(cfgId); + List tabList = new ArrayList(); + if(cfg.getIpPortList()!=null){ + String cfgType = null; + for(IpPortCfg ip:cfg.getIpPortList()){ + if(!ip.getCfgType().equals(cfgType)){ + tabList.add(new String[]{"1",ip.getCfgType()}); + cfgType = ip.getCfgType(); + } + } + } + if(cfg.getP2pHashList()!=null){ + String cfgType = null; + for(BaseStringCfg hash:cfg.getP2pHashList()){ + if(!hash.getCfgType().equals(cfgType)){ + tabList.add(new String[]{"2",hash.getCfgType()}); + cfgType = hash.getCfgType(); + } + } + } + if(cfg.getP2pKeywordList()!=null){ + String cfgType = null; + for(BaseStringCfg keyword:cfg.getP2pKeywordList()){ + if(!keyword.getCfgType().equals(cfgType)){ + tabList.add(new String[]{"2",keyword.getCfgType()}); + cfgType = keyword.getCfgType(); + } + } + } + if(cfg.getNtcSubscribeIdCfgList()!=null){ + String cfgType = null; + for(BaseStringCfg subscribeId:cfg.getNtcSubscribeIdCfgList()){ + if(!subscribeId.getCfgType().equals(cfgType)){ + tabList.add(new String[]{"2",subscribeId.getCfgType()}); + cfgType = subscribeId.getCfgType(); + } + } + } + model.addAttribute("_cfg", cfg); + model.addAttribute("index", index); + model.addAttribute("tabList", tabList); + return "/cfg/fileTransfer/p2pSubList"; + } + + @RequestMapping(value = {"auditP2pCfg"}) + @RequiresPermissions(value={"fileTransfer:p2p:confirm"}) + public String auditP2pCfg(Integer isAudit,Integer isValid,String ids,Integer functionId, RedirectAttributes redirectAttributes) { + CfgIndexInfo entity = new CfgIndexInfo(); + String[] idArray = ids.split(","); + for(String id :idArray){ + entity = fileTransferCfgService.getP2pCfg(Long.parseLong(id)); + entity.setIsAudit(isAudit); + entity.setIsValid(isValid); + entity.setAuditorId(UserUtils.getUser().getId()); + entity.setAuditTime(new Date()); + entity.setFunctionId(functionId); + try { + fileTransferCfgService.auditP2pCfg(entity,isAudit); + } catch (MaatConvertException e) { + e.printStackTrace(); + logger.info("p2p配置下发失败:"+e.getMessage()); + addMessage(redirectAttributes, e.getMessage()); + } + } + return "redirect:" + adminPath +"/ntc/fileTransfer/p2pList?functionId="+functionId; + } } diff --git a/src/main/java/com/nis/web/controller/configuration/ntc/IpController.java b/src/main/java/com/nis/web/controller/configuration/ntc/IpController.java index 7bd3a945d..d5696f3ac 100644 --- a/src/main/java/com/nis/web/controller/configuration/ntc/IpController.java +++ b/src/main/java/com/nis/web/controller/configuration/ntc/IpController.java @@ -56,11 +56,11 @@ public class IpController extends CommonController{ model.addAttribute("dropAction",Constants.DROP_ACTION); model.addAttribute("urlPrefix","/ntc/iplist"); model.addAttribute("requiresPermissionPrefix","iplist"); - if(specialFunctionId!=null && "ipsec".equals(specialFunctionId)) { - return "/cfg/ipsec/ipForm"; - }else if(specialFunctionId!=null && "ipaddr".equals(specialFunctionId)) { - return "/cfg/ipaddr/ipForm"; - } +// if(specialFunctionId!=null && "ipsec".equals(specialFunctionId)) { +// return "/cfg/ipsec/ipForm"; +// }else if(specialFunctionId!=null && "ipaddr".equals(specialFunctionId)) { +// return "/cfg/ipaddr/ipForm"; +// } return "/cfg/common/ipForm"; } @RequestMapping(value = {"saveOrUpdate"}) diff --git a/src/main/java/com/nis/web/controller/log/manipulation/DkBehaviorLogController.java b/src/main/java/com/nis/web/controller/log/manipulation/DkBehaviorLogController.java index eba500da8..096e9c247 100644 --- a/src/main/java/com/nis/web/controller/log/manipulation/DkBehaviorLogController.java +++ b/src/main/java/com/nis/web/controller/log/manipulation/DkBehaviorLogController.java @@ -17,11 +17,13 @@ import org.springframework.web.bind.annotation.RequestMapping; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.reflect.TypeToken; +import com.nis.domain.FunctionServiceDict; import com.nis.domain.Page; import com.nis.domain.PageLog; import com.nis.domain.log.DkBehaviorLog; import com.nis.domain.maat.LogRecvData; import com.nis.util.Constants; +import com.nis.util.DictUtils; import com.nis.util.httpclient.HttpClientUtil; import com.nis.web.controller.BaseController; @@ -50,6 +52,9 @@ public class DkBehaviorLogController extends BaseController{ //查询值判断 initLogSearchValue(entry,params); + List serviceList = DictUtils.getFunctionServiceDictList(entry.getFunctionId()); + model.addAttribute("serviceList", serviceList); + String url = ""; url = Constants.LOG_BASE_URL+Constants.NTC_DKBEHAVIOR_LOG; String jsonString = HttpClientUtil.getMsg(url,params,request); @@ -64,7 +69,7 @@ public class DkBehaviorLogController extends BaseController{ List list = page.getList(); for (DkBehaviorLog l : list) { l.setFunctionId(entry.getFunctionId()); - setLogAction(l); + setLogAction(l,serviceList); } model.addAttribute("page", page); logger.info("查询行为识别日志成功"); diff --git a/src/main/java/com/nis/web/controller/log/ntc/AppLogController.java b/src/main/java/com/nis/web/controller/log/ntc/AppLogController.java index 240a4ca22..5b6868afd 100644 --- a/src/main/java/com/nis/web/controller/log/ntc/AppLogController.java +++ b/src/main/java/com/nis/web/controller/log/ntc/AppLogController.java @@ -18,11 +18,13 @@ import org.springframework.web.bind.annotation.RequestMapping; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.reflect.TypeToken; +import com.nis.domain.FunctionServiceDict; import com.nis.domain.Page; import com.nis.domain.PageLog; import com.nis.domain.log.NtcAppLog; import com.nis.domain.maat.LogRecvData; import com.nis.util.Constants; +import com.nis.util.DictUtils; import com.nis.util.httpclient.HttpClientUtil; import com.nis.web.controller.BaseController; @@ -51,6 +53,9 @@ public class AppLogController extends BaseController{ //查询值判断 initLogSearchValue(entry,params); + List serviceList = DictUtils.getFunctionServiceDictList(entry.getFunctionId()); + model.addAttribute("serviceList", serviceList); + String url = ""; url = Constants.LOG_BASE_URL+Constants.NTC_APP_LOG; String jsonString = HttpClientUtil.getMsg(url,params,request); @@ -65,7 +70,7 @@ public class AppLogController extends BaseController{ List list = page.getList(); for (NtcAppLog l : list) { l.setFunctionId(entry.getFunctionId()); - setLogAction(l); + setLogAction(l,serviceList); } model.addAttribute("page", page); logger.info("查询App日志成功"); diff --git a/src/main/java/com/nis/web/controller/log/ntc/BgpLogController.java b/src/main/java/com/nis/web/controller/log/ntc/BgpLogController.java new file mode 100644 index 000000000..0fb1daed2 --- /dev/null +++ b/src/main/java/com/nis/web/controller/log/ntc/BgpLogController.java @@ -0,0 +1,77 @@ +package com.nis.web.controller.log.ntc; + +import java.io.File; +import java.io.IOException; +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.commons.lang3.StringUtils; +import org.aspectj.util.FileUtil; +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.ResponseBody; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.reflect.TypeToken; +import com.nis.domain.FunctionServiceDict; +import com.nis.domain.Page; +import com.nis.domain.PageLog; +import com.nis.domain.log.NtcIpLog; +import com.nis.domain.maat.LogRecvData; +import com.nis.exceptions.MaatConvertException; +import com.nis.util.Constants; +import com.nis.util.DictUtils; +import com.nis.util.httpclient.HttpClientUtil; +import com.nis.web.controller.BaseController; + +@Controller +@RequestMapping("${adminPath}/log/ntc/other/bgpLogs") +public class BgpLogController extends BaseController { + + @RequestMapping(value = {"list", ""}) + public String list(@ModelAttribute("log") NtcIpLog log, Model model, HttpServletRequest request, HttpServletResponse response) { + try { + PageLog page = new PageLog(request, response); + Map params = new HashMap(); + params.put("pageSize", page.getPageSize()); + params.put("pageNo", page.getPageNo()); + initLogSearchValue(log, params); + + List serviceList = DictUtils.getFunctionServiceDictList(log.getFunctionId()); + model.addAttribute("serviceList", serviceList); + + String url = Constants.LOG_BASE_URL + Constants.NTC_BGP_LOG; + String recv = HttpClientUtil.getMsg(url, params, request); + + + logger.info("查询结果:" + recv); + if (StringUtils.isNotBlank(recv)) { + Gson gson = new GsonBuilder().create(); + LogRecvData fromJson = gson.fromJson(recv, new TypeToken>(){}.getType()); + if (fromJson.getStatus().intValue() == 200) { + page.setList(fromJson.getData().getList()); + List list = page.getList(); + for (NtcIpLog l : list) { + l.setFunctionId(log.getFunctionId()); + setLogAction(l,serviceList); + } + model.addAttribute("page", page); + } + } + } catch (Exception e) { + logger.error("查询失败", e); + addMessageLog(model, e.getMessage()); + } + + return "/log/ntc/bgpList"; + } + +} diff --git a/src/main/java/com/nis/web/controller/log/ntc/DdosLogController.java b/src/main/java/com/nis/web/controller/log/ntc/DdosLogController.java index 61cfeca8a..215869857 100644 --- a/src/main/java/com/nis/web/controller/log/ntc/DdosLogController.java +++ b/src/main/java/com/nis/web/controller/log/ntc/DdosLogController.java @@ -24,11 +24,13 @@ import com.google.gson.JsonElement; import com.google.gson.JsonParseException; import com.google.gson.reflect.TypeToken; import com.google.protobuf.DescriptorProtos.FieldDescriptorProto.Type; +import com.nis.domain.FunctionServiceDict; import com.nis.domain.Page; import com.nis.domain.PageLog; import com.nis.domain.log.NtcDdosLog; import com.nis.domain.maat.LogRecvData; import com.nis.util.Constants; +import com.nis.util.DictUtils; import com.nis.util.httpclient.HttpClientUtil; import com.nis.web.controller.BaseController; import com.sun.jna.platform.win32.OaIdl.DATE; @@ -58,6 +60,9 @@ public class DdosLogController extends BaseController{ //查询值判断 initLogSearchValue(entry,params); + List serviceList = DictUtils.getFunctionServiceDictList(entry.getFunctionId()); + model.addAttribute("serviceList", serviceList); + String url = ""; url = Constants.LOG_BASE_URL+Constants.NTC_DDOS_LOG; String jsonString = HttpClientUtil.getMsg(url,params,request); @@ -80,7 +85,7 @@ public class DdosLogController extends BaseController{ List list = page.getList(); for (NtcDdosLog l : list) { l.setFunctionId(entry.getFunctionId()); - setLogAction(l); + setLogAction(l,serviceList); } model.addAttribute("page", page); logger.info("查询Ddos日志成功"); diff --git a/src/main/java/com/nis/web/controller/log/ntc/DnsLogController.java b/src/main/java/com/nis/web/controller/log/ntc/DnsLogController.java index 78cbdceef..d34031f2f 100644 --- a/src/main/java/com/nis/web/controller/log/ntc/DnsLogController.java +++ b/src/main/java/com/nis/web/controller/log/ntc/DnsLogController.java @@ -18,11 +18,13 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonSyntaxException; import com.google.gson.reflect.TypeToken; +import com.nis.domain.FunctionServiceDict; import com.nis.domain.Page; import com.nis.domain.PageLog; import com.nis.domain.log.NtcDnsLog; import com.nis.domain.maat.LogRecvData; import com.nis.util.Constants; +import com.nis.util.DictUtils; import com.nis.util.httpclient.HttpClientUtil; import com.nis.web.controller.BaseController; @@ -42,6 +44,9 @@ public class DnsLogController extends BaseController { } initLogSearchValue(log, params); + List serviceList = DictUtils.getFunctionServiceDictList(log.getFunctionId()); + model.addAttribute("serviceList", serviceList); + String url = Constants.LOG_BASE_URL + Constants.NTC_DNS_LOG; String recv = HttpClientUtil.getMsg(url, params, request); logger.info("查询结果:" + recv); @@ -55,7 +60,7 @@ public class DnsLogController extends BaseController { List list = page.getList(); for (NtcDnsLog l : list) { l.setFunctionId(log.getFunctionId()); - setLogAction(l); + setLogAction(l,serviceList); } model.addAttribute("page", page); } diff --git a/src/main/java/com/nis/web/controller/log/ntc/FtpLogController.java b/src/main/java/com/nis/web/controller/log/ntc/FtpLogController.java index 673c2fcb0..aece04557 100644 --- a/src/main/java/com/nis/web/controller/log/ntc/FtpLogController.java +++ b/src/main/java/com/nis/web/controller/log/ntc/FtpLogController.java @@ -18,12 +18,14 @@ import org.springframework.web.bind.annotation.RequestMapping; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.reflect.TypeToken; +import com.nis.domain.FunctionServiceDict; import com.nis.domain.Page; import com.nis.domain.PageLog; import com.nis.domain.log.NtcFtpLog; import com.nis.domain.log.NtcOpenVpnLog; import com.nis.domain.maat.LogRecvData; import com.nis.util.Constants; +import com.nis.util.DictUtils; import com.nis.util.httpclient.HttpClientUtil; import com.nis.web.controller.BaseController; @@ -52,6 +54,9 @@ public class FtpLogController extends BaseController{ //查询值判断 initLogSearchValue(entry,params); + List serviceList = DictUtils.getFunctionServiceDictList(entry.getFunctionId()); + model.addAttribute("serviceList", serviceList); + String url = ""; url = Constants.LOG_BASE_URL+Constants.NTC_FTP_LOG; String jsonString = HttpClientUtil.getMsg(url,params,request); @@ -67,7 +72,7 @@ public class FtpLogController extends BaseController{ List list = page.getList(); for (NtcFtpLog l : list) { l.setFunctionId(entry.getFunctionId()); - setLogAction(l); + setLogAction(l,serviceList); } model.addAttribute("page", page); logger.info("查询Ftp日志成功"); diff --git a/src/main/java/com/nis/web/controller/log/ntc/HttpLogController.java b/src/main/java/com/nis/web/controller/log/ntc/HttpLogController.java index f8a47d442..7825d1859 100644 --- a/src/main/java/com/nis/web/controller/log/ntc/HttpLogController.java +++ b/src/main/java/com/nis/web/controller/log/ntc/HttpLogController.java @@ -17,11 +17,13 @@ import org.springframework.web.bind.annotation.RequestMapping; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.reflect.TypeToken; +import com.nis.domain.FunctionServiceDict; import com.nis.domain.Page; import com.nis.domain.PageLog; import com.nis.domain.log.NtcHttpLog; import com.nis.domain.maat.LogRecvData; import com.nis.util.Constants; +import com.nis.util.DictUtils; import com.nis.util.httpclient.HttpClientUtil; import com.nis.web.controller.BaseController; @@ -41,6 +43,9 @@ public class HttpLogController extends BaseController { } initLogSearchValue(log, params); + List serviceList = DictUtils.getFunctionServiceDictList(log.getFunctionId()); + model.addAttribute("serviceList", serviceList); + String url = Constants.LOG_BASE_URL + Constants.NTC_HTTP_LOG; String recv = HttpClientUtil.getMsg(url, params, request); logger.info("查询结果:" + recv); @@ -54,7 +59,7 @@ public class HttpLogController extends BaseController { List list = page.getList(); for (NtcHttpLog l : list) { l.setFunctionId(log.getFunctionId()); - setLogAction(l); + setLogAction(l,serviceList); } model.addAttribute("page", page); } diff --git a/src/main/java/com/nis/web/controller/log/ntc/IpLogController.java b/src/main/java/com/nis/web/controller/log/ntc/IpLogController.java index a48e850b0..68822d153 100644 --- a/src/main/java/com/nis/web/controller/log/ntc/IpLogController.java +++ b/src/main/java/com/nis/web/controller/log/ntc/IpLogController.java @@ -21,12 +21,14 @@ import org.springframework.web.bind.annotation.ResponseBody; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.reflect.TypeToken; +import com.nis.domain.FunctionServiceDict; import com.nis.domain.Page; import com.nis.domain.PageLog; import com.nis.domain.log.NtcIpLog; import com.nis.domain.maat.LogRecvData; import com.nis.exceptions.MaatConvertException; import com.nis.util.Constants; +import com.nis.util.DictUtils; import com.nis.util.httpclient.HttpClientUtil; import com.nis.web.controller.BaseController; @@ -43,6 +45,9 @@ public class IpLogController extends BaseController { params.put("pageNo", page.getPageNo()); initLogSearchValue(log, params); + List serviceList = DictUtils.getFunctionServiceDictList(log.getFunctionId()); + model.addAttribute("serviceList", serviceList); + String url = Constants.LOG_BASE_URL + Constants.NTC_IP_LOG; String recv = HttpClientUtil.getMsg(url, params, request); @@ -56,7 +61,7 @@ public class IpLogController extends BaseController { List list = page.getList(); for (NtcIpLog l : list) { l.setFunctionId(log.getFunctionId()); - setLogAction(l); + setLogAction(l,serviceList); } model.addAttribute("page", page); } @@ -77,6 +82,9 @@ public class IpLogController extends BaseController { params.put("pageNo", page.getPageNo()); initLogSearchValue(log, params); + List serviceList = DictUtils.getFunctionServiceDictList(log.getFunctionId()); + model.addAttribute("serviceList", serviceList); + String url = "http://10.0.6.121:8080/gwall/test/logTest"; try { String recv = HttpClientUtil.getMsg(url, params, request); @@ -90,7 +98,7 @@ public class IpLogController extends BaseController { List list = page.getList(); for (NtcIpLog l : list) { l.setFunctionId(log.getFunctionId()); - setLogAction(l); + setLogAction(l,serviceList); } model.addAttribute("page", page); } diff --git a/src/main/java/com/nis/web/controller/log/ntc/IpsecLogController.java b/src/main/java/com/nis/web/controller/log/ntc/IpsecLogController.java index 6446eb7f6..6062f4cde 100644 --- a/src/main/java/com/nis/web/controller/log/ntc/IpsecLogController.java +++ b/src/main/java/com/nis/web/controller/log/ntc/IpsecLogController.java @@ -18,12 +18,14 @@ import org.springframework.web.bind.annotation.RequestMapping; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.reflect.TypeToken; +import com.nis.domain.FunctionServiceDict; import com.nis.domain.Page; import com.nis.domain.PageLog; import com.nis.domain.log.NtcIpsecLog; import com.nis.domain.log.NtcIpsecLog; import com.nis.domain.maat.LogRecvData; import com.nis.util.Constants; +import com.nis.util.DictUtils; import com.nis.util.httpclient.HttpClientUtil; import com.nis.web.controller.BaseController; @@ -52,6 +54,9 @@ public class IpsecLogController extends BaseController{ //查询值判断 initLogSearchValue(entry,params); + List serviceList = DictUtils.getFunctionServiceDictList(entry.getFunctionId()); + model.addAttribute("serviceList", serviceList); + String url = ""; url = Constants.LOG_BASE_URL+Constants.NTC_IPSEC_LOG; String jsonString = HttpClientUtil.getMsg(url,params,request); @@ -65,7 +70,7 @@ public class IpsecLogController extends BaseController{ page.setList(list); for (NtcIpsecLog l : list) { l.setFunctionId(entry.getFunctionId()); - setLogAction(l); + setLogAction(l,serviceList); } model.addAttribute("page", page); logger.info("查询Ipsec日志成功"); diff --git a/src/main/java/com/nis/web/controller/log/ntc/L2tpLogController.java b/src/main/java/com/nis/web/controller/log/ntc/L2tpLogController.java index 88ab1640e..5173fc4f4 100644 --- a/src/main/java/com/nis/web/controller/log/ntc/L2tpLogController.java +++ b/src/main/java/com/nis/web/controller/log/ntc/L2tpLogController.java @@ -17,11 +17,13 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonSyntaxException; import com.google.gson.reflect.TypeToken; +import com.nis.domain.FunctionServiceDict; import com.nis.domain.Page; import com.nis.domain.PageLog; import com.nis.domain.log.NtcL2tpLog; import com.nis.domain.maat.LogRecvData; import com.nis.util.Constants; +import com.nis.util.DictUtils; import com.nis.util.httpclient.HttpClientUtil; import com.nis.web.controller.BaseController; @@ -40,6 +42,9 @@ public class L2tpLogController extends BaseController { // 请求参数判断 initLogSearchValue(ntcL2tpLog, params); + List serviceList = DictUtils.getFunctionServiceDictList(ntcL2tpLog.getFunctionId()); + model.addAttribute("serviceList", serviceList); + try { // 请求接口 String url = Constants.LOG_BASE_URL + Constants.NTC_L2TP_LOG; @@ -52,7 +57,7 @@ public class L2tpLogController extends BaseController { List list = fromPage.getList(); for (NtcL2tpLog log : list) { log.setFunctionId(ntcL2tpLog.getFunctionId()); - setLogAction(log); + setLogAction(log,serviceList); } model.addAttribute("page", page); } diff --git a/src/main/java/com/nis/web/controller/log/ntc/MailLogController.java b/src/main/java/com/nis/web/controller/log/ntc/MailLogController.java index 3518bea06..9d46ead43 100644 --- a/src/main/java/com/nis/web/controller/log/ntc/MailLogController.java +++ b/src/main/java/com/nis/web/controller/log/ntc/MailLogController.java @@ -17,11 +17,13 @@ import org.springframework.web.bind.annotation.RequestMapping; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.reflect.TypeToken; +import com.nis.domain.FunctionServiceDict; import com.nis.domain.Page; import com.nis.domain.PageLog; import com.nis.domain.log.NtcMailLog; import com.nis.domain.maat.LogRecvData; import com.nis.util.Constants; +import com.nis.util.DictUtils; import com.nis.util.httpclient.HttpClientUtil; import com.nis.web.controller.BaseController; @@ -38,6 +40,9 @@ public class MailLogController extends BaseController { params.put("pageNo", page.getPageNo()); initLogSearchValue(log, params); + List serviceList = DictUtils.getFunctionServiceDictList(log.getFunctionId()); + model.addAttribute("serviceList", serviceList); + String url = Constants.LOG_BASE_URL + Constants.NTC_MAIL_LOG; String recv = HttpClientUtil.getMsg(url, params, request); @@ -50,7 +55,7 @@ public class MailLogController extends BaseController { List list = page.getList(); for (NtcMailLog l : list) { l.setFunctionId(log.getFunctionId()); - setLogAction(l); + setLogAction(l,serviceList); } model.addAttribute("page", page); } diff --git a/src/main/java/com/nis/web/controller/log/ntc/MmAvIpLogController.java b/src/main/java/com/nis/web/controller/log/ntc/MmAvIpLogController.java index 6980acc71..31f09221c 100644 --- a/src/main/java/com/nis/web/controller/log/ntc/MmAvIpLogController.java +++ b/src/main/java/com/nis/web/controller/log/ntc/MmAvIpLogController.java @@ -17,11 +17,13 @@ import org.springframework.web.bind.annotation.RequestMapping; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.reflect.TypeToken; +import com.nis.domain.FunctionServiceDict; import com.nis.domain.Page; import com.nis.domain.PageLog; import com.nis.domain.log.MmAvIpLog; import com.nis.domain.maat.LogRecvData; import com.nis.util.Constants; +import com.nis.util.DictUtils; import com.nis.util.httpclient.HttpClientUtil; import com.nis.web.controller.BaseController; @@ -51,6 +53,9 @@ public class MmAvIpLogController extends BaseController{ //查询值判断 initLogSearchValue(entry,params); + List serviceList = DictUtils.getFunctionServiceDictList(entry.getFunctionId()); + model.addAttribute("serviceList", serviceList); + String url = ""; url = Constants.LOG_BASE_URL+Constants.NTC_MMAVIP_LOG; String jsonString = HttpClientUtil.getMsg(url,params,request); @@ -65,7 +70,7 @@ public class MmAvIpLogController extends BaseController{ List list = page.getList(); for (MmAvIpLog l : list) { l.setFunctionId(entry.getFunctionId()); - setLogAction(l); + setLogAction(l,serviceList); } model.addAttribute("page", page); logger.info("查询音视频IP日志成功"); diff --git a/src/main/java/com/nis/web/controller/log/ntc/MmAvUrlLogController.java b/src/main/java/com/nis/web/controller/log/ntc/MmAvUrlLogController.java index df0313a36..d4ac8011f 100644 --- a/src/main/java/com/nis/web/controller/log/ntc/MmAvUrlLogController.java +++ b/src/main/java/com/nis/web/controller/log/ntc/MmAvUrlLogController.java @@ -17,11 +17,13 @@ import org.springframework.web.bind.annotation.RequestMapping; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.reflect.TypeToken; +import com.nis.domain.FunctionServiceDict; import com.nis.domain.Page; import com.nis.domain.PageLog; import com.nis.domain.log.MmAvUrlLog; import com.nis.domain.maat.LogRecvData; import com.nis.util.Constants; +import com.nis.util.DictUtils; import com.nis.util.httpclient.HttpClientUtil; import com.nis.web.controller.BaseController; @@ -51,6 +53,9 @@ public class MmAvUrlLogController extends BaseController{ //查询值判断 initLogSearchValue(entry,params); + List serviceList = DictUtils.getFunctionServiceDictList(entry.getFunctionId()); + model.addAttribute("serviceList", serviceList); + String url = ""; url = Constants.LOG_BASE_URL+Constants.NTC_MMAVURL_LOG; String jsonString = HttpClientUtil.getMsg(url,params,request); @@ -65,7 +70,7 @@ public class MmAvUrlLogController extends BaseController{ List list = page.getList(); for (MmAvUrlLog l : list) { l.setFunctionId(entry.getFunctionId()); - setLogAction(l); + setLogAction(l,serviceList); } model.addAttribute("page", page); logger.info("查询音视频url日志成功"); diff --git a/src/main/java/com/nis/web/controller/log/ntc/MmPicIpLogController.java b/src/main/java/com/nis/web/controller/log/ntc/MmPicIpLogController.java index 997174f64..48316189b 100644 --- a/src/main/java/com/nis/web/controller/log/ntc/MmPicIpLogController.java +++ b/src/main/java/com/nis/web/controller/log/ntc/MmPicIpLogController.java @@ -15,11 +15,13 @@ import org.springframework.web.bind.annotation.RequestMapping; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.reflect.TypeToken; +import com.nis.domain.FunctionServiceDict; import com.nis.domain.Page; import com.nis.domain.PageLog; import com.nis.domain.log.MmPicIpLog; import com.nis.domain.maat.LogRecvData; import com.nis.util.Constants; +import com.nis.util.DictUtils; import com.nis.util.httpclient.HttpClientUtil; import com.nis.web.controller.BaseController; @@ -38,6 +40,9 @@ public class MmPicIpLogController extends BaseController { // 请求参数判断 initLogSearchValue(mmPicIpLog, params); + List serviceList = DictUtils.getFunctionServiceDictList(mmPicIpLog.getFunctionId()); + model.addAttribute("serviceList", serviceList); + try { // 请求接口 String url = Constants.LOG_BASE_URL + Constants.NTC_MMPICIP_LOG; @@ -50,7 +55,7 @@ public class MmPicIpLogController extends BaseController { List list = fromPage.getList(); for (MmPicIpLog log : list) { log.setFunctionId(mmPicIpLog.getFunctionId()); - setLogAction(log); + setLogAction(log,serviceList); } model.addAttribute("page", page); logger.info("音视频图片IP日志查询成功!"); diff --git a/src/main/java/com/nis/web/controller/log/ntc/MmPicUrlController.java b/src/main/java/com/nis/web/controller/log/ntc/MmPicUrlController.java index 433fa290c..03520430e 100644 --- a/src/main/java/com/nis/web/controller/log/ntc/MmPicUrlController.java +++ b/src/main/java/com/nis/web/controller/log/ntc/MmPicUrlController.java @@ -15,11 +15,13 @@ import org.springframework.web.bind.annotation.RequestMapping; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.reflect.TypeToken; +import com.nis.domain.FunctionServiceDict; import com.nis.domain.Page; import com.nis.domain.PageLog; import com.nis.domain.log.MmPicUrlLog; import com.nis.domain.maat.LogRecvData; import com.nis.util.Constants; +import com.nis.util.DictUtils; import com.nis.util.httpclient.HttpClientUtil; import com.nis.web.controller.BaseController; @@ -38,6 +40,9 @@ public class MmPicUrlController extends BaseController{ // 请求参数判断 initLogSearchValue(mmPicUrlLog, params); + List serviceList = DictUtils.getFunctionServiceDictList(mmPicUrlLog.getFunctionId()); + model.addAttribute("serviceList", serviceList); + try { // 请求接口 String url = Constants.LOG_BASE_URL + Constants.NTC_MMPICURL_LOG; @@ -50,7 +55,7 @@ public class MmPicUrlController extends BaseController{ List list = fromPage.getList(); for (MmPicUrlLog log : list) { log.setFunctionId(mmPicUrlLog.getFunctionId()); - setLogAction(log); + setLogAction(log,serviceList); } model.addAttribute("page", page); logger.info("音视频图片URL日志查询成功!"); diff --git a/src/main/java/com/nis/web/controller/log/ntc/MmPornAvSampleController.java b/src/main/java/com/nis/web/controller/log/ntc/MmPornAvSampleController.java index 154088bb9..78aa4ea7d 100644 --- a/src/main/java/com/nis/web/controller/log/ntc/MmPornAvSampleController.java +++ b/src/main/java/com/nis/web/controller/log/ntc/MmPornAvSampleController.java @@ -15,11 +15,13 @@ import org.springframework.web.bind.annotation.RequestMapping; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.reflect.TypeToken; +import com.nis.domain.FunctionServiceDict; import com.nis.domain.Page; import com.nis.domain.PageLog; import com.nis.domain.log.MmAvIpLog; import com.nis.domain.maat.LogRecvData; import com.nis.util.Constants; +import com.nis.util.DictUtils; import com.nis.util.httpclient.HttpClientUtil; import com.nis.web.controller.BaseController; @@ -38,6 +40,9 @@ public class MmPornAvSampleController extends BaseController { //查询值判断 initLogSearchValue(entry, params); + List serviceList = DictUtils.getFunctionServiceDictList(entry.getFunctionId()); + model.addAttribute("serviceList", serviceList); + String url = ""; url = Constants.LOG_BASE_URL + Constants.NTC_MMPORNAUDIOSAMPLE_LOG; String jsonString = HttpClientUtil.getMsg(url, params, request); @@ -52,7 +57,7 @@ public class MmPornAvSampleController extends BaseController { List list = page.getList(); for (MmAvIpLog l : list) { l.setFunctionId(entry.getFunctionId()); - setLogAction(l); + setLogAction(l,serviceList); } model.addAttribute("page", page); logger.info("查询音频色情样例日志成功"); @@ -76,6 +81,9 @@ public class MmPornAvSampleController extends BaseController { //查询值判断 initLogSearchValue(entry, params); + List serviceList = DictUtils.getFunctionServiceDictList(entry.getFunctionId()); + model.addAttribute("serviceList", serviceList); + String url = ""; url = Constants.LOG_BASE_URL + Constants.NTC_MMPORNVIDEOSAMPLE_LOG; String jsonString = HttpClientUtil.getMsg(url,params,request); @@ -90,7 +98,7 @@ public class MmPornAvSampleController extends BaseController { List list = page.getList(); for (MmAvIpLog l : list) { l.setFunctionId(entry.getFunctionId()); - setLogAction(l); + setLogAction(l,serviceList); } model.addAttribute("page", page); logger.info("查询视频色情样例日志成功"); diff --git a/src/main/java/com/nis/web/controller/log/ntc/MmSampleAudioController.java b/src/main/java/com/nis/web/controller/log/ntc/MmSampleAudioController.java index f805cdf44..b05a2ef81 100644 --- a/src/main/java/com/nis/web/controller/log/ntc/MmSampleAudioController.java +++ b/src/main/java/com/nis/web/controller/log/ntc/MmSampleAudioController.java @@ -15,11 +15,13 @@ import org.springframework.web.bind.annotation.RequestMapping; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.reflect.TypeToken; +import com.nis.domain.FunctionServiceDict; import com.nis.domain.Page; import com.nis.domain.PageLog; import com.nis.domain.log.MmSampleAudioLog; import com.nis.domain.maat.LogRecvData; import com.nis.util.Constants; +import com.nis.util.DictUtils; import com.nis.util.httpclient.HttpClientUtil; import com.nis.web.controller.BaseController; @@ -38,6 +40,9 @@ public class MmSampleAudioController extends BaseController{ // 请求参数判断 initLogSearchValue(sampleAudioLog, params); + List serviceList = DictUtils.getFunctionServiceDictList(sampleAudioLog.getFunctionId()); + model.addAttribute("serviceList", serviceList); + try { // 请求接口 String url = Constants.LOG_BASE_URL + Constants.NTC_MMSAMPLEAUDIO_LOG; @@ -50,7 +55,7 @@ public class MmSampleAudioController extends BaseController{ List list = fromPage.getList(); for (MmSampleAudioLog log : list) { log.setFunctionId(sampleAudioLog.getFunctionId()); - setLogAction(log); + setLogAction(log,serviceList); } model.addAttribute("page", page); logger.info("音频样例日志查询成功!"); diff --git a/src/main/java/com/nis/web/controller/log/ntc/MmSamplePicController.java b/src/main/java/com/nis/web/controller/log/ntc/MmSamplePicController.java index fcb6d58cb..88c5db172 100644 --- a/src/main/java/com/nis/web/controller/log/ntc/MmSamplePicController.java +++ b/src/main/java/com/nis/web/controller/log/ntc/MmSamplePicController.java @@ -15,11 +15,13 @@ import org.springframework.web.bind.annotation.RequestMapping; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.reflect.TypeToken; +import com.nis.domain.FunctionServiceDict; import com.nis.domain.Page; import com.nis.domain.PageLog; import com.nis.domain.log.MmSamplePicLog; import com.nis.domain.maat.LogRecvData; import com.nis.util.Constants; +import com.nis.util.DictUtils; import com.nis.util.httpclient.HttpClientUtil; import com.nis.web.controller.BaseController; @@ -38,6 +40,9 @@ public class MmSamplePicController extends BaseController{ // 请求参数判断 initLogSearchValue(samplePicLog, params); + List serviceList = DictUtils.getFunctionServiceDictList(samplePicLog.getFunctionId()); + model.addAttribute("serviceList", serviceList); + try { // 请求接口 String url = Constants.LOG_BASE_URL + Constants.NTC_MMSAMPLEPIC_LOG; @@ -50,7 +55,7 @@ public class MmSamplePicController extends BaseController{ List list = fromPage.getList(); for (MmSamplePicLog log : list) { log.setFunctionId(samplePicLog.getFunctionId()); - setLogAction(log); + setLogAction(log,serviceList); } model.addAttribute("page", page); logger.info("图片样例日志查询成功!"); diff --git a/src/main/java/com/nis/web/controller/log/ntc/MmSampleVideoController.java b/src/main/java/com/nis/web/controller/log/ntc/MmSampleVideoController.java index 82c6b2fa4..5257af016 100644 --- a/src/main/java/com/nis/web/controller/log/ntc/MmSampleVideoController.java +++ b/src/main/java/com/nis/web/controller/log/ntc/MmSampleVideoController.java @@ -15,11 +15,13 @@ import org.springframework.web.bind.annotation.RequestMapping; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.reflect.TypeToken; +import com.nis.domain.FunctionServiceDict; import com.nis.domain.Page; import com.nis.domain.PageLog; import com.nis.domain.log.MmSampleVideoLog; import com.nis.domain.maat.LogRecvData; import com.nis.util.Constants; +import com.nis.util.DictUtils; import com.nis.util.httpclient.HttpClientUtil; import com.nis.web.controller.BaseController; @@ -38,6 +40,9 @@ public class MmSampleVideoController extends BaseController{ // 请求参数判断 initLogSearchValue(sampleVideoLog, params); + List serviceList = DictUtils.getFunctionServiceDictList(sampleVideoLog.getFunctionId()); + model.addAttribute("serviceList", serviceList); + try { // 请求接口 String url = Constants.LOG_BASE_URL + Constants.NTC_MMSAMPLEVIDEO_LOG; @@ -50,7 +55,7 @@ public class MmSampleVideoController extends BaseController{ List list = fromPage.getList(); for (MmSampleVideoLog log : list) { log.setFunctionId(sampleVideoLog.getFunctionId()); - setLogAction(log); + setLogAction(log,serviceList); } model.addAttribute("page", page); logger.info("视频样例日志查询成功!"); diff --git a/src/main/java/com/nis/web/controller/log/ntc/MmSampleVoipLogController.java b/src/main/java/com/nis/web/controller/log/ntc/MmSampleVoipLogController.java index ba144132a..c62b5809c 100644 --- a/src/main/java/com/nis/web/controller/log/ntc/MmSampleVoipLogController.java +++ b/src/main/java/com/nis/web/controller/log/ntc/MmSampleVoipLogController.java @@ -19,11 +19,13 @@ import org.springframework.web.bind.annotation.RequestMapping; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.reflect.TypeToken; +import com.nis.domain.FunctionServiceDict; import com.nis.domain.Page; import com.nis.domain.PageLog; import com.nis.domain.log.MmVoipLog; import com.nis.domain.maat.LogRecvData; import com.nis.util.Constants; +import com.nis.util.DictUtils; import com.nis.util.httpclient.HttpClientUtil; import com.nis.web.controller.BaseController; @@ -42,6 +44,9 @@ public class MmSampleVoipLogController extends BaseController { //查询值判断 initLogSearchValue(entry,params); + List serviceList = DictUtils.getFunctionServiceDictList(entry.getFunctionId()); + model.addAttribute("serviceList", serviceList); + String url = Constants.LOG_BASE_URL+Constants.NTC_MMSAMPLE_VOIP_LOG; String jsonString = HttpClientUtil.getMsg(url,params,request); //String path = request.getClass().getClassLoader().getResource("").getPath(); @@ -57,7 +62,7 @@ public class MmSampleVoipLogController extends BaseController { List list = page.getList(); for (MmVoipLog l : list) { l.setFunctionId(entry.getFunctionId()); - setLogAction(l); + setLogAction(l,serviceList); } model.addAttribute("page", page); logger.info("查询Voip样例日志成功"); diff --git a/src/main/java/com/nis/web/controller/log/ntc/MmVoipAccountLogController.java b/src/main/java/com/nis/web/controller/log/ntc/MmVoipAccountLogController.java index 75126b45f..0e097e2d8 100644 --- a/src/main/java/com/nis/web/controller/log/ntc/MmVoipAccountLogController.java +++ b/src/main/java/com/nis/web/controller/log/ntc/MmVoipAccountLogController.java @@ -17,11 +17,13 @@ import org.springframework.web.bind.annotation.RequestMapping; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.reflect.TypeToken; +import com.nis.domain.FunctionServiceDict; import com.nis.domain.Page; import com.nis.domain.PageLog; import com.nis.domain.log.MmVoipLog; import com.nis.domain.maat.LogRecvData; import com.nis.util.Constants; +import com.nis.util.DictUtils; import com.nis.util.httpclient.HttpClientUtil; import com.nis.web.controller.BaseController; @@ -50,6 +52,9 @@ public class MmVoipAccountLogController extends BaseController{ //查询值判断 initLogSearchValue(entry,params); + List serviceList = DictUtils.getFunctionServiceDictList(entry.getFunctionId()); + model.addAttribute("serviceList", serviceList); + String url = ""; url = Constants.LOG_BASE_URL+Constants.NTC_MMVOIP_ACCOUNT_LOG; String jsonString = HttpClientUtil.getMsg(url,params,request); @@ -64,7 +69,7 @@ public class MmVoipAccountLogController extends BaseController{ List list = page.getList(); for (MmVoipLog l : list) { l.setFunctionId(entry.getFunctionId()); - setLogAction(l); + setLogAction(l,serviceList); } model.addAttribute("page", page); logger.info("查询mmVoipAccount日志成功"); diff --git a/src/main/java/com/nis/web/controller/log/ntc/MmVoipIpLogController.java b/src/main/java/com/nis/web/controller/log/ntc/MmVoipIpLogController.java index a195a070a..6aaad7f08 100644 --- a/src/main/java/com/nis/web/controller/log/ntc/MmVoipIpLogController.java +++ b/src/main/java/com/nis/web/controller/log/ntc/MmVoipIpLogController.java @@ -17,11 +17,13 @@ import org.springframework.web.bind.annotation.RequestMapping; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.reflect.TypeToken; +import com.nis.domain.FunctionServiceDict; import com.nis.domain.Page; import com.nis.domain.PageLog; import com.nis.domain.log.MmVoipLog; import com.nis.domain.maat.LogRecvData; import com.nis.util.Constants; +import com.nis.util.DictUtils; import com.nis.util.httpclient.HttpClientUtil; import com.nis.web.controller.BaseController; @@ -50,6 +52,9 @@ public class MmVoipIpLogController extends BaseController{ //查询值判断 initLogSearchValue(entry,params); + List serviceList = DictUtils.getFunctionServiceDictList(entry.getFunctionId()); + model.addAttribute("serviceList", serviceList); + String url = ""; url = Constants.LOG_BASE_URL+Constants.NTC_MMVOIP_IP_LOG; String jsonString = HttpClientUtil.getMsg(url,params,request); @@ -64,7 +69,7 @@ public class MmVoipIpLogController extends BaseController{ List list = page.getList(); for (MmVoipLog l : list) { l.setFunctionId(entry.getFunctionId()); - setLogAction(l); + setLogAction(l,serviceList); } model.addAttribute("page", page); logger.info("查询VoipIp日志成功"); diff --git a/src/main/java/com/nis/web/controller/log/ntc/MmVoipLogController.java b/src/main/java/com/nis/web/controller/log/ntc/MmVoipLogController.java index afaf43574..68b0351b3 100644 --- a/src/main/java/com/nis/web/controller/log/ntc/MmVoipLogController.java +++ b/src/main/java/com/nis/web/controller/log/ntc/MmVoipLogController.java @@ -17,11 +17,13 @@ import org.springframework.web.bind.annotation.RequestMapping; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.reflect.TypeToken; +import com.nis.domain.FunctionServiceDict; import com.nis.domain.Page; import com.nis.domain.PageLog; import com.nis.domain.log.MmVoipLog; import com.nis.domain.maat.LogRecvData; import com.nis.util.Constants; +import com.nis.util.DictUtils; import com.nis.util.httpclient.HttpClientUtil; import com.nis.web.controller.BaseController; @@ -50,6 +52,9 @@ public class MmVoipLogController extends BaseController{ //查询值判断 initLogSearchValue(entry,params); + List serviceList = DictUtils.getFunctionServiceDictList(entry.getFunctionId()); + model.addAttribute("serviceList", serviceList); + String url = ""; url = Constants.LOG_BASE_URL+Constants.NTC_MMVOIP_LOG; String jsonString = HttpClientUtil.getMsg(url,params,request); @@ -64,7 +69,7 @@ public class MmVoipLogController extends BaseController{ List list = page.getList(); for (MmVoipLog l : list) { l.setFunctionId(entry.getFunctionId()); - setLogAction(l); + setLogAction(l,serviceList); } model.addAttribute("page", page); logger.info("查询Voip日志成功"); diff --git a/src/main/java/com/nis/web/controller/log/ntc/OpenVpnLogController.java b/src/main/java/com/nis/web/controller/log/ntc/OpenVpnLogController.java index 4a46cf389..805a49285 100644 --- a/src/main/java/com/nis/web/controller/log/ntc/OpenVpnLogController.java +++ b/src/main/java/com/nis/web/controller/log/ntc/OpenVpnLogController.java @@ -18,12 +18,14 @@ import org.springframework.web.bind.annotation.RequestMapping; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.reflect.TypeToken; +import com.nis.domain.FunctionServiceDict; import com.nis.domain.Page; import com.nis.domain.PageLog; import com.nis.domain.log.NtcOpenVpnLog; import com.nis.domain.log.NtcOpenVpnLog; import com.nis.domain.maat.LogRecvData; import com.nis.util.Constants; +import com.nis.util.DictUtils; import com.nis.util.httpclient.HttpClientUtil; import com.nis.web.controller.BaseController; @@ -52,6 +54,9 @@ public class OpenVpnLogController extends BaseController{ //查询值判断 initLogSearchValue(entry,params); + List serviceList = DictUtils.getFunctionServiceDictList(entry.getFunctionId()); + model.addAttribute("serviceList", serviceList); + String url = ""; url = Constants.LOG_BASE_URL+Constants.NTC_OPENVPN_LOG; String jsonString = HttpClientUtil.getMsg(url,params,request); @@ -66,7 +71,7 @@ public class OpenVpnLogController extends BaseController{ List list = page.getList(); for (NtcOpenVpnLog l : list) { l.setFunctionId(entry.getFunctionId()); - setLogAction(l); + setLogAction(l,serviceList); } model.addAttribute("page", page); logger.info("查询OpenVpn日志成功"); diff --git a/src/main/java/com/nis/web/controller/log/ntc/P2pLogController.java b/src/main/java/com/nis/web/controller/log/ntc/P2pLogController.java new file mode 100644 index 000000000..8a26e34f0 --- /dev/null +++ b/src/main/java/com/nis/web/controller/log/ntc/P2pLogController.java @@ -0,0 +1,67 @@ +package com.nis.web.controller.log.ntc; + +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.commons.lang3.StringUtils; +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 com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.reflect.TypeToken; +import com.nis.domain.FunctionServiceDict; +import com.nis.domain.PageLog; +import com.nis.domain.log.NtcIpLog; +import com.nis.domain.maat.LogRecvData; +import com.nis.util.Constants; +import com.nis.util.DictUtils; +import com.nis.util.httpclient.HttpClientUtil; +import com.nis.web.controller.BaseController; + +@Controller +@RequestMapping("${adminPath}/log/ntc/p2pLogs") +public class P2pLogController extends BaseController { + + @RequestMapping(value = {"list", ""}) + public String list(@ModelAttribute("log") NtcIpLog log, Model model, HttpServletRequest request, HttpServletResponse response) { + try { + PageLog page = new PageLog(request, response); + Map params = new HashMap(); + params.put("pageSize", page.getPageSize()); + params.put("pageNo", page.getPageNo()); + initLogSearchValue(log, params); + + List serviceList = DictUtils.getFunctionServiceDictList(log.getFunctionId()); + model.addAttribute("serviceList", serviceList); + + String url = Constants.LOG_BASE_URL + Constants.NTC_P2P_LOG; + String recv = HttpClientUtil.getMsg(url, params, request); + logger.info("查询结果:" + recv); + if (StringUtils.isNotBlank(recv)) { + Gson gson = new GsonBuilder().create(); + LogRecvData fromJson = gson.fromJson(recv, new TypeToken>(){}.getType()); + if (fromJson.getStatus().intValue() == 200) { + page.setList(fromJson.getData().getList()); + List list = page.getList(); + for (NtcIpLog l : list) { + l.setFunctionId(log.getFunctionId()); + setLogAction(l,serviceList); + } + model.addAttribute("page", page); + } + } + } catch (Exception e) { + logger.error("查询失败", e); + addMessageLog(model, e.getMessage()); + } + + return "/log/ntc/p2pList"; + } + +} diff --git a/src/main/java/com/nis/web/controller/log/ntc/PptpLogController.java b/src/main/java/com/nis/web/controller/log/ntc/PptpLogController.java index d7b22fc29..cdc659651 100644 --- a/src/main/java/com/nis/web/controller/log/ntc/PptpLogController.java +++ b/src/main/java/com/nis/web/controller/log/ntc/PptpLogController.java @@ -17,11 +17,13 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonSyntaxException; import com.google.gson.reflect.TypeToken; +import com.nis.domain.FunctionServiceDict; import com.nis.domain.Page; import com.nis.domain.PageLog; import com.nis.domain.log.NtcPptpLog; import com.nis.domain.maat.LogRecvData; import com.nis.util.Constants; +import com.nis.util.DictUtils; import com.nis.util.httpclient.HttpClientUtil; import com.nis.web.controller.BaseController; @@ -40,6 +42,9 @@ public class PptpLogController extends BaseController { // 请求参数判断 initLogSearchValue(ntcPptpLog, params); + List serviceList = DictUtils.getFunctionServiceDictList(ntcPptpLog.getFunctionId()); + model.addAttribute("serviceList", serviceList); + try { // 请求接口 String url = Constants.LOG_BASE_URL + Constants.NTC_PPTP_LOG; @@ -52,7 +57,7 @@ public class PptpLogController extends BaseController { page.setList(list); for (NtcPptpLog log : list) { log.setFunctionId(ntcPptpLog.getFunctionId()); - setLogAction(log); + setLogAction(log,serviceList); } model.addAttribute("page", page); } diff --git a/src/main/java/com/nis/web/controller/log/ntc/SshLogController.java b/src/main/java/com/nis/web/controller/log/ntc/SshLogController.java index ee1337027..8f2583de0 100644 --- a/src/main/java/com/nis/web/controller/log/ntc/SshLogController.java +++ b/src/main/java/com/nis/web/controller/log/ntc/SshLogController.java @@ -18,12 +18,14 @@ import org.springframework.web.bind.annotation.RequestMapping; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.reflect.TypeToken; +import com.nis.domain.FunctionServiceDict; import com.nis.domain.Page; import com.nis.domain.PageLog; import com.nis.domain.log.NtcSshLog; import com.nis.domain.log.NtcSshLog; import com.nis.domain.maat.LogRecvData; import com.nis.util.Constants; +import com.nis.util.DictUtils; import com.nis.util.httpclient.HttpClientUtil; import com.nis.web.controller.BaseController; @@ -52,6 +54,9 @@ public class SshLogController extends BaseController{ //查询值判断 initLogSearchValue(entry,params); + List serviceList = DictUtils.getFunctionServiceDictList(entry.getFunctionId()); + model.addAttribute("serviceList", serviceList); + String url = ""; url = Constants.LOG_BASE_URL+Constants.NTC_SSH_LOG; String jsonString = HttpClientUtil.getMsg(url,params,request); @@ -66,7 +71,7 @@ public class SshLogController extends BaseController{ List list = page.getList(); for (NtcSshLog l : list) { l.setFunctionId(entry.getFunctionId()); - setLogAction(l); + setLogAction(l,serviceList); } model.addAttribute("page", page); logger.info("查询Ssh日志成功"); diff --git a/src/main/java/com/nis/web/controller/log/ntc/SslLogController.java b/src/main/java/com/nis/web/controller/log/ntc/SslLogController.java index 267e7e562..9ab408e0d 100644 --- a/src/main/java/com/nis/web/controller/log/ntc/SslLogController.java +++ b/src/main/java/com/nis/web/controller/log/ntc/SslLogController.java @@ -17,11 +17,13 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonSyntaxException; import com.google.gson.reflect.TypeToken; +import com.nis.domain.FunctionServiceDict; import com.nis.domain.Page; import com.nis.domain.PageLog; import com.nis.domain.log.NtcSslLog; import com.nis.domain.maat.LogRecvData; import com.nis.util.Constants; +import com.nis.util.DictUtils; import com.nis.util.StringUtils; import com.nis.util.httpclient.HttpClientUtil; import com.nis.web.controller.BaseController; @@ -43,6 +45,10 @@ public class SslLogController extends BaseController { if(StringUtils.isNotBlank(ntcSslLog.getSni())) { params.put("SearchSni", ntcSslLog.getSni()); } + + List serviceList = DictUtils.getFunctionServiceDictList(ntcSslLog.getFunctionId()); + model.addAttribute("serviceList", serviceList); + try { // 请求接口 String url = Constants.LOG_BASE_URL + Constants.NTC_SSL_LOG; @@ -55,7 +61,7 @@ public class SslLogController extends BaseController { page.setList(list); for (NtcSslLog log : list) { log.setFunctionId(ntcSslLog.getFunctionId()); - setLogAction(log); + setLogAction(log,serviceList); } model.addAttribute("page", page); } diff --git a/src/main/java/com/nis/web/controller/log/pxy/PxyHttpLogController.java b/src/main/java/com/nis/web/controller/log/pxy/PxyHttpLogController.java index 163aed5d1..c2603bba6 100644 --- a/src/main/java/com/nis/web/controller/log/pxy/PxyHttpLogController.java +++ b/src/main/java/com/nis/web/controller/log/pxy/PxyHttpLogController.java @@ -17,10 +17,12 @@ import org.springframework.web.servlet.support.RequestContext; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.reflect.TypeToken; +import com.nis.domain.FunctionServiceDict; import com.nis.domain.PageLog; import com.nis.domain.log.PxyHttpLog; import com.nis.domain.maat.LogRecvData; import com.nis.util.Constants; +import com.nis.util.DictUtils; import com.nis.util.httpclient.HttpClientUtil; import com.nis.web.controller.BaseController; @@ -41,6 +43,9 @@ public class PxyHttpLogController extends BaseController { initLogSearchValue(log, params); + List serviceList = DictUtils.getFunctionServiceDictList(log.getFunctionId()); + model.addAttribute("serviceList", serviceList); + String url = Constants.LOG_BASE_URL + Constants.PXY_HTTP_LOG; String recv = HttpClientUtil.getMsg(url, params, request); logger.info("查询结果:" + recv); @@ -53,7 +58,7 @@ public class PxyHttpLogController extends BaseController { List list = page.getList(); for (PxyHttpLog l : list) { l.setFunctionId(log.getFunctionId()); - setLogAction(l); + setLogAction(l,serviceList); } model.addAttribute("page", page); } diff --git a/src/main/java/com/nis/web/dao/FunctionRegionDictDao.xml b/src/main/java/com/nis/web/dao/FunctionRegionDictDao.xml index 9d39bbd61..14d58a585 100644 --- a/src/main/java/com/nis/web/dao/FunctionRegionDictDao.xml +++ b/src/main/java/com/nis/web/dao/FunctionRegionDictDao.xml @@ -11,10 +11,23 @@ + + + + + + + + + + + dict_id, function_id, config_region_value,config_region_code, config_district, config_desc, is_valid,is_maat,region_type + ,config_multi_keywords,config_hex,config_expr_type,config_match_method,config_service_type,config_ip_port_show,config_ip_type, + config_ip_pattern,config_port_pattern,config_direction,config_protocol select diff --git a/src/main/java/com/nis/web/dao/configuration/AppCfgDao.java b/src/main/java/com/nis/web/dao/configuration/AppCfgDao.java index f6b5214c5..6962964df 100644 --- a/src/main/java/com/nis/web/dao/configuration/AppCfgDao.java +++ b/src/main/java/com/nis/web/dao/configuration/AppCfgDao.java @@ -14,6 +14,7 @@ import com.nis.domain.configuration.AppIdCfg.AppFeaturesIndex; import com.nis.domain.configuration.AppInnerRuleCfg; import com.nis.domain.configuration.AppIpCfg; import com.nis.domain.configuration.AppPolicyCfg; +import com.nis.domain.configuration.AppSslCertCfg; import com.nis.domain.configuration.AppStringCfg; import com.nis.domain.configuration.BaseCfg; import com.nis.domain.configuration.BaseStringCfg; @@ -64,7 +65,13 @@ public interface AppCfgDao { public List findAppInnerRuleList(AppInnerRuleCfg entity) ; public AppInnerRuleCfg getAppInnerRuleCfg(Long cfgId) ; public int insertAppInnerRuleCfg(AppInnerRuleCfg entity); - public int updateAppInnerRuleCfg(AppInnerRuleCfg entity); + public int updateAppInnerRuleCfg(AppInnerRuleCfg entity); + //app ssl证书特征增删改查 + public List findAppSslList(AppSslCertCfg entity); + public AppSslCertCfg getAppSslCfg(Long cfgId); + public int insertAppSslCfg(AppSslCertCfg entity); + public int updateAppSslCfg(AppSslCertCfg entity); + //审核配置 public void auditCfg(BaseCfg entity); //修改配置状态 diff --git a/src/main/java/com/nis/web/dao/configuration/AppCfgDao.xml b/src/main/java/com/nis/web/dao/configuration/AppCfgDao.xml index 2395f4f71..ddfae9a2c 100644 --- a/src/main/java/com/nis/web/dao/configuration/AppCfgDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/AppCfgDao.xml @@ -228,6 +228,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + r.CFG_ID, r.APP_CODE,r.BEHAV_CODE,r.SPEC_SERVICE_ID,r.CFG_DESC,r.ACTION,r.IS_VALID,r.IS_AUDIT, @@ -298,6 +329,13 @@ a.compile_id,a.is_area_effective,a.classify,a.attribute,a.lable ,a.area_effective_ids,a.function_id,a.cfg_region_code + + r.CFG_ID, r.APP_CODE,r.BEHAV_CODE,r.SPEC_SERVICE_ID,r.CFG_DESC,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.AREA_EFFECTIVE_IDS,r.RATELIMIT,r.FUNCTION_ID,r.CFG_TYPE,r.CFG_REGION_CODE, + r.DISTRICT,r.CFG_KEYWORDS,r.EXPR_TYPE,r.MATCH_METHOD,r.IS_HEXBIN + + ${sqlMap.dsf} + + + + ORDER BY ${page.orderBy} + + + ORDER BY CFG_ID desc + + + + SELECT LAST_INSERT_ID() @@ -1103,6 +1248,22 @@ #{exprType,jdbcType=INTEGER},#{matchMethod,jdbcType=INTEGER},#{isHexbin,jdbcType=INTEGER} ) + + + SELECT LAST_INSERT_ID() + + insert into app_ssl_cert_cfg ( + APP_CODE,BEHAV_CODE,SPEC_SERVICE_ID,CFG_DESC,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,RATELIMIT,FUNCTION_ID,CFG_TYPE,CFG_REGION_CODE, + DISTRICT,CFG_KEYWORDS,EXPR_TYPE,MATCH_METHOD,IS_HEXBIN + )values ( + , + #{district,jdbcType=VARCHAR},#{cfgKeywords,jdbcType=VARCHAR}, + #{exprType,jdbcType=INTEGER},#{matchMethod,jdbcType=INTEGER},#{isHexbin,jdbcType=INTEGER} + ) + @@ -1687,6 +1848,105 @@ and function_id=#{functionId,jdbcType=INTEGER} + + update app_ssl_cert_cfg + + + + cfg_desc = #{cfgDesc,jdbcType=VARCHAR}, + + + APP_CODE = #{appCode,jdbcType=INTEGER}, + + + BEHAV_CODE = #{behavCode,jdbcType=INTEGER}, + + + SPEC_SERVICE_ID = #{specServiceId,jdbcType=INTEGER}, + + + action = #{action,jdbcType=INTEGER}, + + + is_valid = #{isValid,jdbcType=INTEGER}, + + + is_audit = #{isAudit,jdbcType=INTEGER}, + + + creator_id = #{creatorId,jdbcType=INTEGER}, + + + create_time = #{createTime,jdbcType=TIMESTAMP}, + + + editor_id = #{editorId,jdbcType=INTEGER}, + + + edit_time = #{editTime,jdbcType=TIMESTAMP}, + + + auditor_id = #{auditorId,jdbcType=INTEGER}, + + + audit_time = #{auditTime,jdbcType=TIMESTAMP}, + + + service_id = #{serviceId,jdbcType=INTEGER}, + + + request_id = #{requestId,jdbcType=INTEGER}, + + + compile_id = #{compileId,jdbcType=INTEGER}, + + + is_area_effective = #{isAreaEffective,jdbcType=INTEGER}, + + + classify = #{classify,jdbcType=VARCHAR}, + + + attribute = #{attribute,jdbcType=VARCHAR}, + + + lable = #{lable,jdbcType=VARCHAR}, + + + area_effective_ids = #{areaEffectiveIds,jdbcType=VARCHAR}, + + + function_id = #{functionId,jdbcType=INTEGER}, + + + RATELIMIT=#{ratelimit,jdbcType=INTEGER}, + + + CFG_REGION_CODE=#{cfgRegionCode,jdbcType=INTEGER}, + + + CFG_TYPE =#{cfgType,jdbcType=VARCHAR}, + + + district=#{district,jdbcType=VARCHAR}, + + + cfg_keywords=#{cfgKeywords,jdbcType=VARCHAR}, + + + expr_type=#{exprType,jdbcType=INTEGER}, + + + match_method=#{matchMethod,jdbcType=INTEGER}, + + + is_hexbin=#{isHexbin,jdbcType=INTEGER}, + + + + where cfg_id = #{cfgId,jdbcType=BIGINT} + + update ${tableName} set is_audit = #{isAudit,jdbcType=INTEGER}, auditor_id = #{auditorId,jdbcType=INTEGER}, diff --git a/src/main/java/com/nis/web/dao/configuration/AvContentCfgDao.java b/src/main/java/com/nis/web/dao/configuration/AvContentCfgDao.java index d2de898f1..4aaa6b797 100644 --- a/src/main/java/com/nis/web/dao/configuration/AvContentCfgDao.java +++ b/src/main/java/com/nis/web/dao/configuration/AvContentCfgDao.java @@ -9,23 +9,32 @@ import com.nis.domain.configuration.AvVoipIpCfg; import com.nis.domain.configuration.BaseIpCfg; import com.nis.domain.configuration.BaseStringCfg; import com.nis.domain.configuration.CfgIndexInfo; +import com.nis.domain.configuration.NtcSubscribeIdCfg; import com.nis.web.dao.MyBatisDao; @MyBatisDao public interface AvContentCfgDao { public List findVoipList(CfgIndexInfo entity) ; + public List findAccountList(CfgIndexInfo entity) ; public List findVoipIpCfgList(CfgIndexInfo entity); public List findVoipAccountCfgList(CfgIndexInfo entity); + public List findSubscribeIdCfgList(CfgIndexInfo entity); public CfgIndexInfo getCfgIndexInfo(CfgIndexInfo entity); + public void insertCfgIndexInfo(CfgIndexInfo entity); public void insertAvVoipIp(CfgIndexInfo entity); - public void insertAvVoipAccount(CfgIndexInfo entity); + public void insertAvVoipAccountCfg(CfgIndexInfo entity); + public void insertAvVoipKeywordCfg(CfgIndexInfo entity); + public void updateCfgIndexInfo(CfgIndexInfo entity); public void updateAvVoipIp(CfgIndexInfo entity); public void updateAvVoipAccount(CfgIndexInfo entity); + public void updateAvVoipKeywordCfgt(CfgIndexInfo entity); + public void deleteAvVoipIp(CfgIndexInfo entity); - public void deleteAvVoipAccount(CfgIndexInfo entity); + public void deleteAvVoipKeywordCfg(CfgIndexInfo entity); + public void deleteAvVoipAccountCfg(CfgIndexInfo entity); public BaseIpCfg findIpCfgById(BaseIpCfg entity) ; public void insertIp(BaseIpCfg entity); @@ -38,4 +47,5 @@ public interface AvContentCfgDao { public void updateString(BaseStringCfg entity); public List findStringList(BaseStringCfg entity) ; public List getStringList(BaseStringCfg entity) ; + } diff --git a/src/main/java/com/nis/web/dao/configuration/AvContentCfgDao.xml b/src/main/java/com/nis/web/dao/configuration/AvContentCfgDao.xml index 5d7bb7ad0..0d1073c9f 100644 --- a/src/main/java/com/nis/web/dao/configuration/AvContentCfgDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/AvContentCfgDao.xml @@ -23,6 +23,7 @@ + @@ -157,7 +158,7 @@ r.CFG_ID,r.CFG_DESC,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.AREA_EFFECTIVE_IDS,r.function_id + r.ATTRIBUTE,r.LABLE,r.AREA_EFFECTIVE_IDS,r.function_id,r.do_log r.cfg_id,r.cfg_desc,r.ip_type,r.src_ip_address,r.ip_pattern,r.port_pattern,r.src_port @@ -187,7 +188,7 @@ 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 - + + + + + + SELECT + + + , s.name as creator_name,e.name as editor_name,u.name as auditor_name + ,ri.request_title as requestName + + FROM cfg_index_info a + left join sys_user s on a.creator_id=s.id + left join sys_user e on a.editor_id=e.id + left join sys_user u on a.auditor_id=u.id + left join request_info ri on a.request_id=ri.id + + + + AND ${page.where} + + + AND a.CFG_ID=#{cfgId,jdbcType=BIGINT} + + + AND a.CFG_DESC like concat(concat('%',#{cfgDesc,jdbcType=VARCHAR}),'%') + + + AND a.ACTION=#{action,jdbcType=INTEGER} + + + AND a.IS_VALID=#{isValid,jdbcType=INTEGER} + + + AND a.IS_VALID != -1 + + + AND a.IS_AUDIT=#{isAudit,jdbcType=INTEGER} + + + AND CREATOR_NAME like concat(concat('%',#{creatorName,jdbcType=VARCHAR}),'%') + + + AND EDITOR_NAME like concat(concat('%',#{editorName,jdbcType=VARCHAR}),'%') + + + AND AUDITOR_NAME like concat(concat('%',#{auditorName,jdbcType=VARCHAR}),'%') + + + AND a.SERVICE_ID=#{serviceId,jdbcType=INTEGER} + + + AND a.REQUEST_ID=#{requestId,jdbcType=INTEGER} + + + AND a.COMPILE_ID=#{compileId,jdbcType=INTEGER} + + + AND a.IS_AREA_EFFECTIVE=#{isAreaEffective,jdbcType=INTEGER} + + + AND a.classify like concat(concat('%',#{classify,jdbcType=VARCHAR}),'%') + + + AND a.attribute like concat(concat('%',#{attribute,jdbcType=VARCHAR}),'%') + + + AND a.lable like concat(concat('%',#{lable,jdbcType=VARCHAR}),'%') + + + AND a.AREA_EFFECTIVE_IDS like concat(concat('%',#{areaEffectiveIds,jdbcType=VARCHAR}),'%') + + + AND a.function_id=#{functionId,jdbcType=INTEGER} + + + AND a.compile_id in (select t.compile_id from ip_port_cfg t + + and t.protocol_id=4 + + and t.src_ip_address =#{(ipPort.srcIpAddress,jdbcType=VARCHAR} + + + and t.src_port =#{ipPort.srcPort,jdbcType=VARCHAR} + + + and t.dest_ip_address =#{(ipPort.destIpAddress,jdbcType=VARCHAR} + + + and t.dest_port =#{ipPort.destPort,jdbcType=VARCHAR} + + + ) + + + AND a.compile_id in (select f.compile_id from p2p_hash_cfg h + + + and h.cfg_keywords like concat(concat('%',#{p2pHash.cfgKeywords,jdbcType=VARCHAR}),'%') + + + + ) + + + AND a.compile_id in (select f.compile_id from p2p_keyword_cfg k + + + and k.cfg_keywords like concat(concat('%',#{p2pKeyword.cfgKeywords,jdbcType=VARCHAR}),'%') + + + + ) + + + AND a.compile_id in (select f.compile_id from ntc_subscribe_id_cfg s + + + and s.cfg_keywords like concat(concat('%',#{ntcSubscribeIdCfg.cfgKeywords,jdbcType=VARCHAR}),'%') + + + + ) + + + ${sqlMap.dsf} + + + + ORDER BY ${page.orderBy} + + + ORDER BY a.CFG_ID desc + + + + + + + + + + + + + + SELECT LAST_INSERT_ID() + + insert into p2p_hash_cfg ( + CFG_DESC, + 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, + cfg_keywords, + cfg_type, + cfg_region_code, + expr_type, + match_method, + is_hexbin, + user_region1, + user_region2, + user_region3, + user_region4, + user_region5 + )values ( + #{cfgDesc,jdbcType=VARCHAR}, + #{action,jdbcType=INTEGER}, + 0, + 0, + #{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}, + #{areaEffectiveIds,jdbcType=VARCHAR}, + #{functionId,jdbcType=INTEGER}, + #{cfgKeywords,jdbcType=VARCHAR}, + #{cfgType,jdbcType=VARCHAR}, + #{cfgRegionCode,jdbcType=INTEGER}, + #{exprType,jdbcType=INTEGER}, + #{matchMethod,jdbcType=INTEGER}, + #{isHexbin,jdbcType=INTEGER}, + #{userRegion1,jdbcType=VARCHAR}, + #{userRegion2,jdbcType=VARCHAR}, + #{userRegion3,jdbcType=VARCHAR}, + #{userRegion4,jdbcType=VARCHAR}, + #{userRegion5,jdbcType=VARCHAR} + ) + + + + + + SELECT LAST_INSERT_ID() + + insert into p2p_keyword_cfg ( + CFG_DESC, + 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, + cfg_keywords, + cfg_type, + cfg_region_code, + expr_type, + match_method, + is_hexbin + )values ( + #{cfgDesc,jdbcType=VARCHAR}, + #{action,jdbcType=INTEGER}, + 0, + 0, + #{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}, + #{areaEffectiveIds,jdbcType=VARCHAR}, + #{functionId,jdbcType=INTEGER}, + #{cfgKeywords,jdbcType=VARCHAR}, + #{cfgType,jdbcType=VARCHAR}, + #{cfgRegionCode,jdbcType=INTEGER}, + #{exprType,jdbcType=INTEGER}, + #{matchMethod,jdbcType=INTEGER}, + #{isHexbin,jdbcType=INTEGER} + ) + + + + + + SELECT LAST_INSERT_ID() + + insert into ntc_subscribe_id_cfg ( + CFG_DESC, + 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, + cfg_keywords, + cfg_type, + cfg_region_code, + expr_type, + match_method, + is_hexbin + )values ( + #{cfgDesc,jdbcType=VARCHAR}, + #{action,jdbcType=INTEGER}, + 0, + 0, + #{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}, + #{areaEffectiveIds,jdbcType=VARCHAR}, + #{functionId,jdbcType=INTEGER}, + #{cfgKeywords,jdbcType=VARCHAR}, + #{cfgType,jdbcType=VARCHAR}, + #{cfgRegionCode,jdbcType=INTEGER}, + #{exprType,jdbcType=INTEGER}, + #{matchMethod,jdbcType=INTEGER}, + #{isHexbin,jdbcType=INTEGER} + ) + + @@ -647,6 +1020,22 @@ delete from file_digest_cfg where compile_id=#{compileId} and function_id=#{functionId} + + + delete from ip_port_cfg where compile_id=#{compileId} and function_id=#{functionId} + + + + delete from p2p_hash_cfg where compile_id=#{compileId} and function_id=#{functionId} + + + + delete from p2p_keyword_cfg where compile_id=#{compileId} and function_id=#{functionId} + + + + delete from ntc_subscribe_id_cfg where compile_id=#{compileId} and function_id=#{functionId} + diff --git a/src/main/java/com/nis/web/service/BaseService.java b/src/main/java/com/nis/web/service/BaseService.java index 1a324ef20..4df642004 100644 --- a/src/main/java/com/nis/web/service/BaseService.java +++ b/src/main/java/com/nis/web/service/BaseService.java @@ -7,6 +7,10 @@ import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import javax.management.RuntimeErrorException; import org.apache.commons.lang3.StringEscapeUtils; import org.slf4j.Logger; @@ -388,7 +392,7 @@ public abstract class BaseService { * @return */ public static IpCfg ipConvert(IpCfg dstIp,BaseIpCfg srcIp){ - if(srcIp.getSrcIpAddress()!=null){ + 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]); @@ -403,6 +407,26 @@ public abstract class BaseService { 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 if(srcIp.getSrcIpAddress().indexOf("-")!=-1){ @@ -415,6 +439,23 @@ public abstract class BaseService { IPv6Network network = IPv6Network.fromTwoAddresses(address1,address2); dstIp.setSrcIp(address1.toString()); dstIp.setSrcIpMask(network.getNetmask().asAddress().toString()); + }else { + Pattern patternV4Range=Pattern.compile(Constants.IPV4_IP_RANGE_REGEXP); + Pattern patternV6Range=Pattern.compile(Constants.IPV6_IP_RANGE_REGEXP); + Matcher matcherV4Range=patternV4Range.matcher(srcIp.getSrcIpAddress()); + Matcher matcherV6Range=patternV6Range.matcher(srcIp.getSrcIpAddress()); + if(matcherV4Range.matches()) { + dstIp.setSrcIp(srcIp.getSrcIpAddress().split("-")[0]); + dstIp.setSrcIpMask(IpUtil.getMask(srcIp.getSrcIpAddress().split("-")[0], srcIp.getSrcIpAddress().split("-")[1])); + }else if(matcherV6Range.matches()) { + 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 { + throw new RuntimeException("Invalid IP range format"); + } } }else{ @@ -424,6 +465,20 @@ public abstract class BaseService { }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"); + } } } @@ -434,6 +489,9 @@ public abstract class BaseService { }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"); } } if(srcIp.getDestIpAddress()!=null){ @@ -450,6 +508,26 @@ public abstract class BaseService { 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 if(srcIp.getDestIpAddress().indexOf("-")!=-1){ @@ -462,6 +540,23 @@ public abstract class BaseService { IPv6Network network = IPv6Network.fromTwoAddresses(address1,address2); dstIp.setDstIp(address1.toString()); dstIp.setDstIpMask(network.getNetmask().asAddress().toString()); + }else { + Pattern patternV4Range=Pattern.compile(Constants.IPV4_IP_RANGE_REGEXP); + Pattern patternV6Range=Pattern.compile(Constants.IPV6_IP_RANGE_REGEXP); + Matcher matcherV4Range=patternV4Range.matcher(srcIp.getDestIpAddress()); + Matcher matcherV6Range=patternV6Range.matcher(srcIp.getDestIpAddress()); + if(matcherV4Range.matches()) { + dstIp.setDstIp(srcIp.getDestIpAddress().split("-")[0]); + dstIp.setDstIpMask(IpUtil.getMask(srcIp.getDestIpAddress().split("-")[0], srcIp.getDestIpAddress().split("-")[1])); + }else if(matcherV6Range.matches()) { + 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 { + throw new RuntimeException("Invalid IP range format"); + } } }else{ @@ -471,6 +566,20 @@ public abstract class BaseService { }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"); + } } } @@ -481,6 +590,9 @@ public abstract class BaseService { }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"); } } if(srcIp.getSrcPort()!=null){ diff --git a/src/main/java/com/nis/web/service/configuration/AppCfgService.java b/src/main/java/com/nis/web/service/configuration/AppCfgService.java index 2294b341a..fe8763e95 100644 --- a/src/main/java/com/nis/web/service/configuration/AppCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/AppCfgService.java @@ -16,6 +16,7 @@ import com.nis.domain.configuration.AppDomainCfg; import com.nis.domain.configuration.AppHttpCfg; import com.nis.domain.configuration.AppIpCfg; import com.nis.domain.configuration.AppPolicyCfg; +import com.nis.domain.configuration.AppSslCertCfg; import com.nis.domain.configuration.AreaIpCfg; import com.nis.domain.configuration.IpPortCfg; import com.nis.domain.maat.MaatCfg; @@ -84,6 +85,13 @@ public class AppCfgService extends BaseService { page.setList(list); return page; } + public Page findAppSslList(Page page, AppSslCertCfg entity) { + entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(),"r")); + entity.setPage(page); + List list = appCfgDao.findAppSslList(entity); + page.setList(list); + return page; + } public AppPolicyCfg getAppPolicyCfg(Long cfgId){ AppPolicyCfg policy = appCfgDao.getAppPolicyCfg(cfgId); List ipPortList = appCfgDao.getAppPolicyIpList(policy); @@ -102,6 +110,9 @@ public class AppCfgService extends BaseService { public AppByteCfg getAppByteCfg(Long cfgId){ return appCfgDao.getAppByteCfg(cfgId); } + public AppSslCertCfg getAppSslCfg(Long cfgId){ + return appCfgDao.getAppSslCfg(cfgId); + } @Transactional(readOnly=false,rollbackFor=RuntimeException.class) public void saveOrUpdateAppPolicyCfg(AppPolicyCfg entity) throws Exception{ //设置区域运营商信息 @@ -398,7 +409,65 @@ public class AppCfgService extends BaseService { } } } - } + } + @Transactional(readOnly=false,rollbackFor=RuntimeException.class) + public void saveOrUpdateAppSslCfg(AppSslCertCfg entity) throws Exception{ + //设置区域运营商信息 + setAreaEffectiveIds(entity); + if(entity.getCfgId()==null){ + Integer compileId = 0; + try { + List idList = ConfigServiceUtil.getId(1, 1); + if(idList!=null && idList.size()>0){ + compileId = idList.get(0); + } + entity.setCompileId(compileId); + entity.setCreateTime(new Date()); + entity.setCreatorId(entity.getCurrentUser().getId()); + entity.setIsValid(0); + entity.setIsAudit(0); + appCfgDao.insertAppSslCfg(entity); + //保存区域IP信息 + if(entity.getAreaCfg()!=null){ + for(AreaIpCfg cfg:entity.getAreaCfg()){ + cfg.initDefaultValue(); + BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"}); + areaIpCfgDao.saveAreaIpCfg(cfg); + } + } + + }catch (Exception e) { + e.printStackTrace(); + logger.info("获取编译ID出错"); + throw new MaatConvertException(e.getMessage()); + } + }else{ + entity.setEditorId(entity.getCurrentUser().getId()); + entity.setEditTime(new Date()); + entity.setIsValid(0); + entity.setIsAudit(0); + appCfgDao.updateAppSslCfg(entity); + + //删除旧的区域IP,新增新的区域IP + AreaIpCfg area = new AreaIpCfg(); + area.setCompileId(entity.getCompileId()); + area.setFunctionId(entity.getFunctionId()); + areaIpCfgDao.deleteAreaIpCfg(area); + entity.setCreateTime(new Date()); + entity.setCreatorId(entity.getCurrentUser().getId()); + //保存区域IP信息 + if(entity.getAreaCfg()!=null){ + for(AreaIpCfg cfg:entity.getAreaCfg()){ + cfg.initDefaultValue(); + BeanUtils.copyProperties(entity, cfg,new String[]{"cfgDesc","cfgRegionCode","cfgType"}); + areaIpCfgDao.saveAreaIpCfg(cfg); + } + } + + } + + } + public void auditAppPolicyCfg(AppPolicyCfg entity,Integer isAudit){ String configType=entity.getConfigType(); ToMaatBean maatBean = new ToMaatBean(); @@ -864,6 +933,87 @@ public class AppCfgService extends BaseService { logger.info("app字节配置取消配置响应信息:"+result.getMsg()); } } + public void auditAppSslCfg(AppSslCertCfg entity,Integer isAudit){ + ToMaatBean maatBean = new ToMaatBean(); + MaatCfg maatCfg = new MaatCfg(); + List configCompileList = new ArrayList(); + List groupRelationList = new ArrayList(); + List ipRegionList = new ArrayList(); + List strRegionList = new ArrayList(); + List numRegionList = new ArrayList(); + List digestRegionList = new ArrayList(); + List areaIpRegionList = new ArrayList(); + entity.setTableName(AppSslCertCfg.getTablename()); + appCfgDao.auditCfg(entity); + + if(isAudit==1){ + List list = new ArrayList(); + list.add(entity); + Map map = cfgConvert(strRegionList,list,3,entity,groupRelationList); + groupRelationList=map.get("groupList"); + strRegionList=map.get("dstList"); + } + //保存区域IP信息 + List areaIpCfgList=areaIpCfgDao.getByCompileId(entity.getCompileId()); + if(!StringUtil.isEmpty(areaIpCfgList)){ + AreaIpCfg cfg = new AreaIpCfg(); + BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"}); + cfg.setTableName(AreaIpCfg.getTablename()); + appCfgDao.auditCfg(cfg); + if(isAudit==1){ + Map map = cfgConvert(areaIpRegionList,areaIpCfgList,1,entity,groupRelationList); + groupRelationList=map.get("groupList"); + areaIpRegionList=map.get("dstList"); + } + } + //构造提交综合服务参数格式,一条配置提交一次综合服务 + if(isAudit==1){ + maatCfg.initDefaultValue(); + BeanUtils.copyProperties(entity, maatCfg); + maatCfg.setAction(entity.getAction()); + maatCfg.setAuditTime(entity.getAuditTime()); + maatCfg.setIpRegionList(ipRegionList); + maatCfg.setStrRegionList(strRegionList); + maatCfg.setNumRegionList(numRegionList); + maatCfg.setDigestRegionList(digestRegionList); + maatCfg.setGroupRelationList(groupRelationList); + maatCfg.setGroupNum(groupRelationList.size()); + maatCfg.setAreaIpRegionList(areaIpRegionList); + maatCfg.setIsValid(entity.getIsValid()); + //设置APP自定义域 + String userRegion = "APP_ID="+entity.getAppCode(); + maatCfg.setUserRegion(userRegion); + configCompileList.add(maatCfg); + maatBean.setConfigCompileList(configCompileList); + maatBean.setAuditTime(entity.getAuditTime()); + maatBean.setCreatorName(entity.getCurrentUser().getName()); + maatBean.setVersion(Constants.MAAT_VERSION); + maatBean.setOpAction(Constants.INSERT_ACTION); + //调用服务接口下发配置数据 + String json=gsonToJson(maatBean); + logger.info("app SSL配置下发配置参数:"+json); + //调用服务接口下发配置 + //ToMaatResult result = ConfigServiceUtil.postMaatCfg(json); + //logger.info("app SSL配置下发响应信息:"+result.getMsg()); + + }else if(isAudit==3){ + maatCfg.setCompileId(entity.getCompileId()); + maatCfg.setServiceId(entity.getServiceId()); + maatCfg.setIsValid(0);//无效 + configCompileList.add(maatCfg); + maatBean.setConfigCompileList(configCompileList); + maatBean.setAuditTime(entity.getAuditTime()); + maatBean.setCreatorName(entity.getCurrentUser().getName()); + maatBean.setVersion(Constants.MAAT_VERSION); + maatBean.setOpAction(Constants.UPDATE_ACTION); + //调用服务接口取消配置 + String json=gsonToJson(maatBean); + logger.info("app SSL配置下发配置参数:"+json); + //调用服务接口下发配置 + //ToMaatResult result = ConfigServiceUtil.put(json,1); + //logger.info("app SSL配置取消配置响应信息:"+result.getMsg()); + } + } public void updateAppPolicyCfgValid(Integer isValid,String ids,Integer functionId){ AppPolicyCfg entity = new AppPolicyCfg(); String[] idArray = ids.split(","); @@ -983,4 +1133,26 @@ public class AppCfgService extends BaseService { } } + public void updateAppSslCfgValid(Integer isValid,String ids,Integer functionId){ + AppSslCertCfg entity = new AppSslCertCfg(); + String[] idArray = ids.split(","); + for(String id :idArray){ + entity.setCfgId(Long.parseLong(id)); + entity.setIsValid(isValid); + entity.setEditorId(UserUtils.getUser().getId()); + entity.setEditTime(new Date()); + entity.setTableName(AppSslCertCfg.getTablename()); + entity.setFunctionId(functionId); + appCfgDao.updateCfgValid(entity); + //保存区域IP信息 + if(entity.getAreaCfg()!=null && entity.getAreaCfg().size()>0){ + AreaIpCfg cfg = new AreaIpCfg(); + BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"}); + cfg.setTableName(AreaIpCfg.getTablename()); + appCfgDao.updateCfgValid(cfg); + } + + } + + } } diff --git a/src/main/java/com/nis/web/service/configuration/AvContentCfgService.java b/src/main/java/com/nis/web/service/configuration/AvContentCfgService.java index 02b093af5..fcb7e015e 100644 --- a/src/main/java/com/nis/web/service/configuration/AvContentCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/AvContentCfgService.java @@ -20,6 +20,8 @@ import com.nis.domain.configuration.AvVoipIpCfg; import com.nis.domain.configuration.BaseIpCfg; import com.nis.domain.configuration.BaseStringCfg; import com.nis.domain.configuration.CfgIndexInfo; +import com.nis.domain.configuration.IpPortCfg; +import com.nis.domain.configuration.NtcSubscribeIdCfg; import com.nis.domain.maat.MaatCfg; import com.nis.domain.maat.ToMaatBean; import com.nis.domain.maat.ToMaatResult; @@ -35,6 +37,7 @@ import com.nis.util.StringUtil; import com.nis.util.StringUtils; import com.nis.web.dao.configuration.AreaIpCfgDao; import com.nis.web.dao.configuration.AvContentCfgDao; +import com.nis.web.dao.configuration.StringCfgDao; import com.nis.web.security.UserUtils; import com.nis.web.service.BaseService; @@ -51,6 +54,8 @@ public class AvContentCfgService extends BaseService{ protected AvContentCfgDao avContentCfgDao; @Autowired protected AreaIpCfgDao areaIpCfgDao; + @Autowired + protected StringCfgDao stringCfgDao; /********************************voip业务*********************************/ @@ -67,6 +72,19 @@ public class AvContentCfgService extends BaseService{ page.setList(list); return page; } + /** + * 查询account分页数据 + * @param page 分页对象 + * @param entity + * @return + */ + public Page findAccountPage(Page page, CfgIndexInfo entity) { + entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(),"r")); + entity.setPage(page); + List list=avContentCfgDao.findAccountList(entity); + page.setList(list); + return page; + } /** * 根据索引表信息获取voipIpCfg信息 * @param entity @@ -83,199 +101,242 @@ public class AvContentCfgService extends BaseService{ public List getVoipAccountCfgList(CfgIndexInfo entity) { return avContentCfgDao.findVoipAccountCfgList(entity); } + /** + * 公共订阅关键字SubscribeId + * @param cfgIndexInfo + * @return + */ + public List getSubscribeIdCfgList(CfgIndexInfo entity) { + return avContentCfgDao.findSubscribeIdCfgList(entity); + } /** * 根据索引表信息获取voipAccountCfg信息 * @param entity * @return */ public CfgIndexInfo getCfgIndexInfo(CfgIndexInfo entity) { + CfgIndexInfo cfg=avContentCfgDao.getCfgIndexInfo(entity); + List ntcSubscribeList=getSubscribeIdCfgList(entity); + if(ntcSubscribeList ==null || ntcSubscribeList.size() <=0){ + ntcSubscribeList.add(new NtcSubscribeIdCfg()); + } + List voipIps=getVoipIpCfgList(entity); + if(voipIps ==null || voipIps.size() <=0){ + voipIps.add(new AvVoipIpCfg()); + } + cfg.setNtcSubscribeIdCfgList(ntcSubscribeList); + cfg.setVoipIps(voipIps); + + return cfg; + } + public CfgIndexInfo getCfgIndexInfo2(CfgIndexInfo entity) { CfgIndexInfo cfg=avContentCfgDao.getCfgIndexInfo(entity); List voipAccounts=new ArrayList<>(); voipAccounts=getVoipAccountCfgList(entity); if(voipAccounts ==null || voipAccounts.size() <=0){ voipAccounts.add(new AvVoipAccountCfg()); } - List voipIps=new ArrayList<>(); - voipIps=getVoipIpCfgList(entity); - if(voipIps ==null || voipIps.size() <=0){ - voipIps.add(new AvVoipIpCfg()); + List ntcSubscribeList=getSubscribeIdCfgList(entity); + if(ntcSubscribeList ==null || ntcSubscribeList.size() <=0){ + ntcSubscribeList.add(new NtcSubscribeIdCfg()); } cfg.setVoipAccounts(voipAccounts); - cfg.setVoipIps(voipIps); + cfg.setNtcSubscribeIdCfgList(ntcSubscribeList); return cfg; } @Transactional(readOnly=false,rollbackFor=RuntimeException.class) - public void saveOrUpdateAvVoip(CfgIndexInfo entity,String voipIpIds,String voipAccountIds,String areaCfgIds){ - Date createTime=new Date(); + public void saveOrUpdateAvVoip(CfgIndexInfo entity){ + //设置区域运营商信息 + setAreaEffectiveIds(entity); + entity.setIsValid(0);//无效 + entity.setIsAudit(0);//未审核 + if(entity.getCfgId()==null){ + Integer compileId = 0; + try { + List idList = ConfigServiceUtil.getId(1, 1); + if(idList!=null && idList.size()>0){ + compileId = idList.get(0); + } + entity.setCompileId(compileId); + 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.getNtcSubscribeIdCfgList()!=null){ + for(NtcSubscribeIdCfg cfg:entity.getNtcSubscribeIdCfgList()){ + if(StringUtils.isNotBlank(cfg.getCfgKeywords())){ + entity.setNtcSubscribeIdCfg(cfg); + avContentCfgDao.insertAvVoipKeywordCfg(entity); + } + } + } + //保存区域IP信息 + if(entity.getAreaCfg()!=null){ + for(AreaIpCfg cfg:entity.getAreaCfg()){ + cfg.initDefaultValue(); + BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"}); + areaIpCfgDao.saveAreaIpCfg(cfg); + } + } + } catch (Exception e) { + e.printStackTrace(); + logger.info("获取编译ID出错"); + throw new MaatConvertException(":"+e.getMessage()); + } + + }else{ + entity.setEditTime(new Date()); + entity.setEditorId(entity.getCurrentUser().getId()); + avContentCfgDao.updateCfgIndexInfo(entity); + //无效子配置后,再新增子配置 + avContentCfgDao.deleteAvVoipIp(entity); + avContentCfgDao.deleteAvVoipKeywordCfg(entity); + AreaIpCfg area = new AreaIpCfg(); + area.setCompileId(entity.getCompileId()); + area.setFunctionId(entity.getFunctionId()); + areaIpCfgDao.deleteAreaIpCfg(area); + entity.setCreateTime(new Date()); + entity.setCreatorId(entity.getCurrentUser().getId()); + if(entity.getVoipIps()!=null&&entity.getVoipIps().size()>0){ + for (AvVoipIpCfg voipIp : entity.getVoipIps()) { + entity.setVoipIp(voipIp); + avContentCfgDao.insertAvVoipIp(entity); + } + } + if(entity.getNtcSubscribeIdCfgList()!=null){ + for(NtcSubscribeIdCfg cfg:entity.getNtcSubscribeIdCfgList()){ + if(StringUtils.isNotBlank(cfg.getCfgKeywords())){ + entity.setNtcSubscribeIdCfg(cfg); + avContentCfgDao.insertAvVoipKeywordCfg(entity); + } + } + } + //保存区域IP信息 + if(entity.getAreaCfg()!=null){ + for(AreaIpCfg cfg:entity.getAreaCfg()){ + cfg.initDefaultValue(); + BeanUtils.copyProperties(entity, cfg,new String[]{"cfgDesc","cfgRegionCode","cfgType"}); + areaIpCfgDao.saveAreaIpCfg(cfg); + } + } + } + } + + @Transactional(readOnly=false,rollbackFor=RuntimeException.class) + public void saveOrUpdateAvVoipAccount(CfgIndexInfo entity){ //设置区域运营商信息 setAreaEffectiveIds(entity); - //新增 + entity.setIsValid(0);//无效 + entity.setIsAudit(0);//未审核 if(entity.getCfgId()==null){ - entity.setCreatorId(UserUtils.getUser().getId()); - entity.setCreateTime(createTime); - entity.setIsValid(0); - entity.setIsAudit(0); - //调用服务接口获取compileId - List compileIds = new ArrayList(); + Integer compileId = 0; try { - compileIds = ConfigServiceUtil.getId(1,1); + List idList = ConfigServiceUtil.getId(1, 1); + if(idList!=null && idList.size()>0){ + compileId = idList.get(0); + } + entity.setCompileId(compileId); + entity.setCreateTime(new Date()); + entity.setCreatorId(entity.getCurrentUser().getId()); + avContentCfgDao.insertCfgIndexInfo(entity); + if(entity.getVoipAccounts()!=null&&entity.getVoipAccounts().size()>0){ + for(AvVoipAccountCfg voipAccount : entity.getVoipAccounts()){ + entity.setVoipAccount(voipAccount); + avContentCfgDao.insertAvVoipAccountCfg(entity); + } + } + if(entity.getNtcSubscribeIdCfgList()!=null){ + for(NtcSubscribeIdCfg cfg:entity.getNtcSubscribeIdCfgList()){ + if(StringUtils.isNotBlank(cfg.getCfgKeywords())){ + entity.setNtcSubscribeIdCfg(cfg); + avContentCfgDao.insertAvVoipKeywordCfg(entity); + } + } + } + //保存区域IP信息 + if(entity.getAreaCfg()!=null){ + for(AreaIpCfg cfg:entity.getAreaCfg()){ + cfg.initDefaultValue(); + BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"}); + areaIpCfgDao.saveAreaIpCfg(cfg); + } + } } catch (Exception e) { e.printStackTrace(); logger.info("获取编译ID出错"); throw new MaatConvertException(":"+e.getMessage()); } - if(compileIds != null && compileIds.size() >0 && compileIds.get(0) != 0){ - entity.setCompileId(compileIds.get(0)); - //保存avVoipIp - if(entity.getVoipIps() != null && entity.getVoipIps().size() > 0){ - for (AvVoipIpCfg voipIp : entity.getVoipIps()) { - entity.setVoipIp(voipIp); - avContentCfgDao.insertAvVoipIp(entity); - } - } - //保存avVoipAccount - if(entity.getVoipAccounts() != null && entity.getVoipAccounts().size() > 0){ - for (AvVoipAccountCfg voipAccount : entity.getVoipAccounts()) { - entity.setVoipAccount(voipAccount); - avContentCfgDao.insertAvVoipAccount(entity); - } - } - //保存区域IP信息 - if(entity.getAreaCfg()!=null&&entity.getAreaCfg().size()>0){ - for (AreaIpCfg areaIpCfg : entity.getAreaCfg()) { - BeanUtils.copyProperties(entity, areaIpCfg,new String[]{"cfgRegionCode","cfgType"}); - areaIpCfgDao.saveAreaIpCfg(areaIpCfg); - } - } - //保存cfgIndexInfo - avContentCfgDao.insertCfgIndexInfo(entity); - }else{ - throw new MaatConvertException(""); - } - //修改 + }else{ - Date editTime=new Date(); - entity.setIsValid(0); - entity.setIsAudit(0); - - voipIpIds=!StringUtil.isEmpty(voipIpIds)? voipIpIds+",":""; - voipAccountIds=!StringUtil.isEmpty(voipAccountIds)? voipAccountIds+",":""; - areaCfgIds=!StringUtil.isEmpty(areaCfgIds)? ","+areaCfgIds:""; - - //判断voip信息为新增还是修改,清楚voipIpIds修改的voipId记录,剩下即为需要删除的voipId - if(!StringUtil.isEmpty(entity.getVoipIps())){ - for (AvVoipIpCfg voipIp : entity.getVoipIps()) { - if(!StringUtil.isEmpty(voipIp.getCfgId())){ - if(voipIpIds.contains(","+voipIp.getCfgId()+",")){ - voipIpIds=voipIpIds.replace(voipIp.getCfgId()+",", ""); - } - //修改 - entity.setEditorId(UserUtils.getUser().getId()); - entity.setEditTime(editTime); - entity.setVoipIp(voipIp); - avContentCfgDao.updateAvVoipIp(entity); - }else{ - //新增 - entity.setCreatorId(UserUtils.getUser().getId()); - entity.setCreateTime(createTime); - entity.setVoipIp(voipIp); - avContentCfgDao.insertAvVoipIp(entity); - } - } - } - - if(!StringUtil.isEmpty(entity.getVoipAccounts())){ - for (AvVoipAccountCfg voipAccount : entity.getVoipAccounts()) { - if(!StringUtil.isEmpty(voipAccount.getCfgId())){ - if(voipAccountIds.contains(","+voipAccount.getCfgId()+",")){ - voipAccountIds=voipAccountIds.replace(voipAccount.getCfgId()+",", ""); - } - //修改 - entity.setEditorId(UserUtils.getUser().getId()); - entity.setEditTime(editTime); - entity.setVoipAccount(voipAccount); - avContentCfgDao.updateAvVoipAccount(entity); - }else{ - //新增 - entity.setCreatorId(UserUtils.getUser().getId()); - entity.setCreateTime(createTime); - entity.setVoipAccount(voipAccount); - avContentCfgDao.insertAvVoipAccount(entity); - } - } - } - if(!StringUtil.isEmpty(entity.getAreaCfg())){ - for (AreaIpCfg areaIpCfg : entity.getAreaCfg()) { - if(!StringUtil.isEmpty(areaIpCfg.getCfgId())){ - if(areaCfgIds.contains(","+areaIpCfg.getCfgId()+",")){ - areaCfgIds=areaCfgIds.replace(areaIpCfg.getCfgId()+",", ""); - } - //修改 - entity.setEditorId(UserUtils.getUser().getId()); - entity.setEditTime(editTime); - BeanUtils.copyProperties(entity, areaIpCfg,new String[]{"cfgRegionCode","cfgType","cfgId"}); - areaIpCfgDao.updateAreaIpCfg(areaIpCfg); - }else{ - //新增 - entity.setCreatorId(UserUtils.getUser().getId()); - entity.setCreateTime(createTime); - BeanUtils.copyProperties(entity, areaIpCfg,new String[]{"cfgRegionCode" - ,"cfgType" - ,"ipType" - ,"ipPattern" - ,"srcIpAddress" - ,"portPattern" - ,"srcPort" - ,"destPort" - ,"protocol" - ,"direction" - ,"protocolId" - }); - areaIpCfgDao.saveAreaIpCfg(areaIpCfg); - } - } - } - //delete 真是删除voipAccount信息 - if(!StringUtil.isEmpty(voipAccountIds.replaceAll(",", ""))){ - voipAccountIds=voipAccountIds.substring(1,voipAccountIds.length()); - for (String cfgId : voipAccountIds.split(",")) { - CfgIndexInfo cfg=new CfgIndexInfo(); - AvVoipAccountCfg voipAccountCfg=new AvVoipAccountCfg(); - voipAccountCfg.setCfgId(Long.parseLong(cfgId)); - cfg.setVoipAccount(voipAccountCfg); - avContentCfgDao.deleteAvVoipAccount(cfg); - } - } - - //delete 真是删除voipAccount信息 - if(!StringUtil.isEmpty(voipIpIds.replaceAll(",", ""))){ - voipIpIds=voipIpIds.substring(1,voipIpIds.length()); - for (String cfgId : voipIpIds.split(",")) { - CfgIndexInfo cfg=new CfgIndexInfo(); - AvVoipIpCfg voipIpCfg=new AvVoipIpCfg(); - voipIpCfg.setCfgId(Long.parseLong(cfgId)); - cfg.setVoipIp(voipIpCfg); - avContentCfgDao.deleteAvVoipIp(cfg); - } - } - //delete 真是删除areaIpCfg信息 - if(!StringUtil.isEmpty(areaCfgIds.replaceAll(",", ""))){ - areaCfgIds=areaCfgIds.substring(1,areaCfgIds.length()); - for (String cfgId : areaCfgIds.split(",")) { - CfgIndexInfo cfg=new CfgIndexInfo(); - AreaIpCfg areaIpCfg=new AreaIpCfg(); - areaIpCfg.setCfgId(Long.parseLong(cfgId)); - areaIpCfgDao.deleteAreaIpCfgByCfgId(areaIpCfg); - } - } - - //修改 - entity.setEditorId(UserUtils.getUser().getId()); - entity.setEditTime(editTime); + entity.setEditTime(new Date()); + entity.setEditorId(entity.getCurrentUser().getId()); avContentCfgDao.updateCfgIndexInfo(entity); + //无效子配置后,再新增子配置 + avContentCfgDao.deleteAvVoipKeywordCfg(entity); + avContentCfgDao.deleteAvVoipAccountCfg(entity); + AreaIpCfg area = new AreaIpCfg(); + area.setCompileId(entity.getCompileId()); + area.setFunctionId(entity.getFunctionId()); + areaIpCfgDao.deleteAreaIpCfg(area); + entity.setCreateTime(new Date()); + entity.setCreatorId(entity.getCurrentUser().getId()); + if(entity.getVoipAccounts()!=null&&entity.getVoipAccounts().size()>0){ + for (AvVoipAccountCfg voipAccount : entity.getVoipAccounts()) { + entity.setVoipAccount(voipAccount); + avContentCfgDao.insertAvVoipAccountCfg(entity); + } + } + if(entity.getNtcSubscribeIdCfgList()!=null){ + for(NtcSubscribeIdCfg cfg:entity.getNtcSubscribeIdCfgList()){ + if(StringUtils.isNotBlank(cfg.getCfgKeywords())){ + entity.setNtcSubscribeIdCfg(cfg); + avContentCfgDao.insertAvVoipKeywordCfg(entity); + } + } + } + //保存区域IP信息 + if(entity.getAreaCfg()!=null){ + for(AreaIpCfg cfg:entity.getAreaCfg()){ + cfg.initDefaultValue(); + BeanUtils.copyProperties(entity, cfg,new String[]{"cfgDesc","cfgRegionCode","cfgType"}); + areaIpCfgDao.saveAreaIpCfg(cfg); + } + } + } + } + + + /** + * + * @param isAudit + * @param isValid + * @param ids compileIds + */ + @Transactional(readOnly=false,rollbackFor=RuntimeException.class) + public void updateAvVoipValid(Integer isAudit,Integer isValid,String compileIds,Integer functionId){ + CfgIndexInfo entity = new CfgIndexInfo(); + String[] idArray = compileIds.split(","); + for(String id :idArray){ + entity.setCompileId(Integer.parseInt(id)); + entity.setFunctionId(functionId); + entity.setIsAudit(isAudit); + entity.setIsValid(isValid); + entity.setEditorId(UserUtils.getUser().getId()); + entity.setEditTime(new Date()); + avContentCfgDao.updateAvVoipIp(entity); + avContentCfgDao.updateAvVoipKeywordCfgt(entity); + avContentCfgDao.updateCfgIndexInfo(entity); + AreaIpCfg areaIpCfg=new AreaIpCfg(); + BeanUtils.copyProperties(entity, areaIpCfg); + areaIpCfgDao.updateAreaIpCfgValid(areaIpCfg); } } /** @@ -285,9 +346,9 @@ public class AvContentCfgService extends BaseService{ * @param ids compileIds */ @Transactional(readOnly=false,rollbackFor=RuntimeException.class) - public void updateAvVoipValid(Integer isAudit,Integer isValid,String ids,Integer functionId){ + public void updateAvVoipAccountValid(Integer isAudit,Integer isValid,String compileIds,Integer functionId){ CfgIndexInfo entity = new CfgIndexInfo(); - String[] idArray = ids.split(","); + String[] idArray = compileIds.split(","); for(String id :idArray){ entity.setCompileId(Integer.parseInt(id)); entity.setFunctionId(functionId); @@ -295,8 +356,8 @@ public class AvContentCfgService extends BaseService{ entity.setIsValid(isValid); entity.setEditorId(UserUtils.getUser().getId()); entity.setEditTime(new Date()); - avContentCfgDao.updateAvVoipIp(entity); avContentCfgDao.updateAvVoipAccount(entity); + avContentCfgDao.updateAvVoipKeywordCfgt(entity); avContentCfgDao.updateCfgIndexInfo(entity); AreaIpCfg areaIpCfg=new AreaIpCfg(); BeanUtils.copyProperties(entity, areaIpCfg); @@ -316,7 +377,7 @@ public class AvContentCfgService extends BaseService{ List list = new ArrayList(); List voipIpList = new ArrayList(); - List voipAccountList = new ArrayList(); + List ntcList = new ArrayList(); List areaIpCfgList = new ArrayList(); CfgIndexInfo searchCfg=new CfgIndexInfo(); @@ -328,16 +389,16 @@ public class AvContentCfgService extends BaseService{ entity.setAuditorId(UserUtils.getUser().getId()); entity.setAuditTime(auditTime); - avContentCfgDao.updateAvVoipIp(entity); - avContentCfgDao.updateAvVoipAccount(entity); + avContentCfgDao.updateAvVoipKeywordCfgt(entity); + avContentCfgDao.updateCfgIndexInfo(entity); AreaIpCfg areaIpCfg=new AreaIpCfg(); BeanUtils.copyProperties(entity, areaIpCfg,new String[]{"cfgRegionCode","cfgType","cfgId"}); areaIpCfgDao.updateAreaIpCfg(areaIpCfg); voipIpList=avContentCfgDao.findVoipIpCfgList(entity); - voipAccountList=avContentCfgDao.findVoipAccountCfgList(entity); + ntcList=avContentCfgDao.findSubscribeIdCfgList(entity); areaIpCfgList=areaIpCfgDao.getByCompileId(entity.getCompileId()); ToMaatBean maatBean = new ToMaatBean(); @@ -357,8 +418,122 @@ public class AvContentCfgService extends BaseService{ ipRegionList=ipMap.get("dstList"); } - if(!StringUtil.isEmpty(voipAccountList)){ - Map accountMap = cfgConvert(strRegionList,voipAccountList,2,entity,groupRelationList); + if(!StringUtil.isEmpty(ntcList)){ + Map ntcMap = cfgConvert(strRegionList,ntcList,2,entity,groupRelationList); + groupRelationList=ntcMap.get("groupList"); + strRegionList=ntcMap.get("dstList"); + } + if(!StringUtil.isEmpty(areaIpCfgList)){ + Map areaMap = cfgConvert(areaIpRegionList,areaIpCfgList,1,entity,groupRelationList); + groupRelationList=areaMap.get("groupList"); + areaIpRegionList=areaMap.get("dstList"); + } + } + + //构造提交综合服务参数格式,一条配置提交一次综合服务 + if(isAudit==1){ + maatCfg.initDefaultValue(); + BeanUtils.copyProperties(entity, maatCfg); + maatCfg.setAction(entity.getAction()); + maatCfg.setAuditTime(auditTime); + maatCfg.setIpRegionList(ipRegionList); + maatCfg.setStrRegionList(strRegionList); + maatCfg.setNumRegionList(numRegionList); + maatCfg.setDigestRegionList(digestRegionList); + maatCfg.setGroupRelationList(groupRelationList); + maatCfg.setGroupNum(groupRelationList.size()); + maatCfg.setAreaIpRegionList(areaIpRegionList); + maatCfg.setIsValid(entity.getIsValid()); + configCompileList.add(maatCfg); + maatBean.setConfigCompileList(configCompileList); + maatBean.setAuditTime(auditTime); + maatBean.setCreatorName(entity.getCurrentUser().getName()); + maatBean.setVersion(Constants.MAAT_VERSION); + maatBean.setOpAction(Constants.INSERT_ACTION); + //调用服务接口下发配置数据 + String json=gsonToJson(maatBean); + logger.info("voip IP配置下发配置参数:"+json); + //调用服务接口下发配置 + ToMaatResult result = ConfigServiceUtil.postMaatCfg(json); + logger.info("voip IP配置下发响应信息:"+result.getMsg()); + + }else if(isAudit==3){ + maatCfg.setCompileId(entity.getCompileId()); + maatCfg.setServiceId(entity.getServiceId()); + maatCfg.setIsValid(0);//无效 + configCompileList.add(maatCfg); + maatBean.setConfigCompileList(configCompileList); + maatBean.setAuditTime(auditTime); + maatBean.setCreatorName(entity.getCurrentUser().getName()); + maatBean.setVersion(Constants.MAAT_VERSION); + maatBean.setOpAction(Constants.UPDATE_ACTION); + //调用服务接口取消配置 + String json=gsonToJson(maatBean); + logger.info("voip IP配置下发配置参数:"+json); + //调用服务接口下发配置 + ToMaatResult result = ConfigServiceUtil.put(json,1); + logger.info("voip IP配置取消配置响应信息:"+result.getMsg()); + } + + + } + /********************************voip业务*********************************/ + /** + * + * @param isAudit + * @param isValid + * @param ids 编译Id + * @param functionId + */ + @Transactional(readOnly=false,rollbackFor=RuntimeException.class) + public void auditAvVoipAccount(Integer isAudit,Integer isValid,Integer functionId,String compileId,Date auditTime){ + CfgIndexInfo entity = new CfgIndexInfo(); + + List list = new ArrayList(); + List accountList = new ArrayList(); + List ntcList = new ArrayList(); + List areaIpCfgList = new ArrayList(); + + CfgIndexInfo searchCfg=new CfgIndexInfo(); + searchCfg.setCompileId(Integer.parseInt(compileId)); + + entity = avContentCfgDao.getCfgIndexInfo(searchCfg); + entity.setIsAudit(isAudit); + entity.setIsValid(isValid); + entity.setAuditorId(UserUtils.getUser().getId()); + entity.setAuditTime(auditTime); + + avContentCfgDao.updateAvVoipAccount(entity); + avContentCfgDao.updateAvVoipKeywordCfgt(entity); + + avContentCfgDao.updateCfgIndexInfo(entity); + AreaIpCfg areaIpCfg=new AreaIpCfg(); + BeanUtils.copyProperties(entity, areaIpCfg,new String[]{"cfgRegionCode","cfgType","cfgId"}); + areaIpCfgDao.updateAreaIpCfg(areaIpCfg); + + ntcList=avContentCfgDao.findSubscribeIdCfgList(entity); + accountList=avContentCfgDao.findVoipAccountCfgList(entity); + areaIpCfgList=areaIpCfgDao.getByCompileId(entity.getCompileId()); + + ToMaatBean maatBean = new ToMaatBean(); + MaatCfg maatCfg = new MaatCfg(); + List configCompileList = new ArrayList(); + List groupRelationList = new ArrayList(); + List ipRegionList = new ArrayList(); + List strRegionList = new ArrayList(); + List numRegionList = new ArrayList(); + List digestRegionList = new ArrayList(); + List areaIpRegionList = new ArrayList(); + + if(isAudit==1){ + + if(!StringUtil.isEmpty(ntcList)){ + Map accountMap = cfgConvert(strRegionList,ntcList,2,entity,groupRelationList); + groupRelationList=accountMap.get("groupList"); + strRegionList=accountMap.get("dstList"); + } + if(!StringUtil.isEmpty(accountList)){ + Map accountMap = cfgConvert(strRegionList,accountList,2,entity,groupRelationList); groupRelationList=accountMap.get("groupList"); strRegionList=accountMap.get("dstList"); } @@ -391,11 +566,12 @@ public class AvContentCfgService extends BaseService{ maatBean.setOpAction(Constants.INSERT_ACTION); //调用服务接口下发配置数据 String json=gsonToJson(maatBean); - logger.info("voip配置下发配置参数:"+json); + logger.info("voip Account配置下发配置参数:"+json); + System.err.println(json); //调用服务接口下发配置 ToMaatResult result = ConfigServiceUtil.postMaatCfg(json); - logger.info("voip配置下发响应信息:"+result.getMsg()); - + logger.info("voip Account配置下发响应信息:"+result.getMsg()); + }else if(isAudit==3){ maatCfg.setCompileId(entity.getCompileId()); maatCfg.setServiceId(entity.getServiceId()); @@ -408,10 +584,10 @@ public class AvContentCfgService extends BaseService{ maatBean.setOpAction(Constants.UPDATE_ACTION); //调用服务接口取消配置 String json=gsonToJson(maatBean); - logger.info("voip配置下发配置参数:"+json); + logger.info("voip Account配置下发配置参数:"+json); //调用服务接口下发配置 ToMaatResult result = ConfigServiceUtil.put(json,1); - logger.info("voip配置取消配置响应信息:"+result.getMsg()); + logger.info("voip Account配置取消配置响应信息:"+result.getMsg()); } diff --git a/src/main/java/com/nis/web/service/configuration/FileTransferCfgService.java b/src/main/java/com/nis/web/service/configuration/FileTransferCfgService.java index 726ffb3ef..16bb77af7 100644 --- a/src/main/java/com/nis/web/service/configuration/FileTransferCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/FileTransferCfgService.java @@ -22,6 +22,9 @@ import com.nis.domain.configuration.ComplexkeywordCfg; import com.nis.domain.configuration.BaseStringCfg; import com.nis.domain.configuration.FileDigestCfg; import com.nis.domain.configuration.IpPortCfg; +import com.nis.domain.configuration.NtcSubscribeIdCfg; +import com.nis.domain.configuration.P2pHashCfg; +import com.nis.domain.configuration.P2pKeywordCfg; import com.nis.domain.configuration.FtpKeywordCfg; import com.nis.domain.maat.MaatCfg; import com.nis.domain.maat.ToMaatBean; @@ -527,4 +530,354 @@ public class FileTransferCfgService extends CrudService getP2pList(Page page, CfgIndexInfo entity){ + // 生成数据权限过滤条件(dsf为dataScopeFilter的简写,在xml中使用 ${sqlMap.dsf}调用权限SQL) + entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(),"a")); + entity.setPage(page); + List list = fileTransferCfgDao.getP2pList(entity); + page.setList(list); + return page; + } + + public CfgIndexInfo getP2pCfg(Long cfgId){ + // 查询各域配置信息 + CfgIndexInfo entity = fileTransferCfgDao.getCfgIndexInfo(cfgId); + List ipPortList = fileTransferCfgDao.getIpPortList(entity); + List hashList = fileTransferCfgDao.getP2pHashList(entity); + List keywordList = fileTransferCfgDao.getP2pKeywordList(entity); + List subscribeIdList = fileTransferCfgDao.getP2pSubscribeidList(entity); + entity.setIpPortList(ipPortList); + entity.setP2pHashList(hashList); + entity.setP2pKeywordList(keywordList); + entity.setNtcSubscribeIdCfgList(subscribeIdList); + return entity; + } + + /** + * 保存p2p配置 + * @param entity + */ + public void saveP2pCfg(CfgIndexInfo entity){ + // 设置区域运营商信息 + setAreaEffectiveIds(entity); + if(entity.getCfgId()==null){ + Integer compileId = 0; + try { + List idList = ConfigServiceUtil.getId(1, 1); + if(idList!=null && idList.size()>0){ + compileId = idList.get(0); + } + entity.setCompileId(compileId); + entity.setCreateTime(new Date()); + entity.setCreatorId(entity.getCurrentUser().getId()); + fileTransferCfgDao.saveCfgIndex(entity); + // 保存IP域配置信息 + if(entity.getIpPortList()!=null){ + for(IpPortCfg cfg:entity.getIpPortList()){ + BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"}); + cfg.setUserRegion2(null); + fileTransferCfgDao.saveIpPortCfg(cfg); + } + } + // 保存Hash类型域配置信息 + if(entity.getP2pHashList()!=null){ + for(BaseStringCfg cfg:entity.getP2pHashList()){ + if(StringUtils.isNotBlank(cfg.getCfgKeywords())){ + BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"}); + cfg.setUserRegion1(cfg.getUserRegion2()); + cfg.setUserRegion2(null); + fileTransferCfgDao.saveP2pHashCfg(cfg); + } + } + } + // 保存关键字域配置信息 + if(entity.getP2pKeywordList()!=null){ + for(P2pKeywordCfg cfg:entity.getP2pKeywordList()){ + if(StringUtils.isNotBlank(cfg.getCfgKeywords())){ + BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"}); + fileTransferCfgDao.saveP2pKeywordCfg(cfg); + } + } + } + // 保存SubscribeId域配置信息 + if(entity.getNtcSubscribeIdCfgList()!=null){ + for(NtcSubscribeIdCfg cfg:entity.getNtcSubscribeIdCfgList()){ + if(StringUtils.isNotBlank(cfg.getCfgKeywords())){ + BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"}); + fileTransferCfgDao.saveP2pSubscribeIdCfg(cfg); + } + } + } + // 保存区域IP信息 + if(entity.getAreaCfg()!=null){ + for(AreaIpCfg cfg:entity.getAreaCfg()){ + cfg.initDefaultValue(); + BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"}); + areaIpCfgDao.saveAreaIpCfg(cfg); + } + } + } catch (Exception e) { + e.printStackTrace(); + logger.info("获取编译ID出错"); + throw new MaatConvertException(":"+e.getMessage()); + } + + }else{ + // 审核未通过状态的配置 修改后状态改为未审核 + entity.setIsValid(0); + entity.setIsAudit(0); + entity.setEditTime(new Date()); + entity.setEditorId(entity.getCurrentUser().getId()); + fileTransferCfgDao.updateCfgIndex(entity); + // 删除无效子配置后,再新增子配置 + fileTransferCfgDao.deleteP2pIpCfg(entity); + fileTransferCfgDao.deleteP2pHashCfg(entity); + fileTransferCfgDao.deleteP2pKeywordCfg(entity); + fileTransferCfgDao.deleteP2pSubscribeIdCfg(entity); + AreaIpCfg area = new AreaIpCfg(); + area.setCompileId(entity.getCompileId()); + area.setFunctionId(entity.getFunctionId()); + areaIpCfgDao.deleteAreaIpCfg(area); + entity.setCreateTime(new Date()); + entity.setCreatorId(entity.getCurrentUser().getId()); + + if(entity.getIpPortList()!=null){ + for(IpPortCfg cfg:entity.getIpPortList()){ + BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"}); + cfg.setUserRegion2(null); + fileTransferCfgDao.saveIpPortCfg(cfg); + } + } + if(entity.getP2pHashList()!=null){ + for(BaseStringCfg cfg:entity.getP2pHashList()){ + if(StringUtils.isNotBlank(cfg.getCfgKeywords())){ + BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"}); + cfg.setUserRegion1(cfg.getUserRegion2()); + cfg.setUserRegion2(null); + fileTransferCfgDao.saveP2pHashCfg(cfg); + } + } + } + if(entity.getP2pKeywordList()!=null){ + for(P2pKeywordCfg cfg:entity.getP2pKeywordList()){ + if(StringUtils.isNotBlank(cfg.getCfgKeywords())){ + BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"}); + fileTransferCfgDao.saveP2pKeywordCfg(cfg); + } + } + } + if(entity.getNtcSubscribeIdCfgList()!=null){ + for(NtcSubscribeIdCfg cfg:entity.getNtcSubscribeIdCfgList()){ + if(StringUtils.isNotBlank(cfg.getCfgKeywords())){ + BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"}); + fileTransferCfgDao.saveP2pSubscribeIdCfg(cfg); + } + } + } + //保存区域IP信息 + if(entity.getAreaCfg()!=null){ + for(AreaIpCfg cfg:entity.getAreaCfg()){ + cfg.initDefaultValue(); + BeanUtils.copyProperties(entity, cfg,new String[]{"cfgDesc","cfgRegionCode","cfgType"}); + areaIpCfgDao.saveAreaIpCfg(cfg); + } + } + } + } + + public void updateP2pCfgValid(Integer isValid, String ids, Integer functionId) { + CfgIndexInfo entity = new CfgIndexInfo(); + String[] idArray = ids.split(","); + for(String id :idArray){ + entity.setCfgId(Long.parseLong(id)); + entity.setIsValid(isValid); + entity.setEditorId(UserUtils.getUser().getId()); + entity.setEditTime(new Date()); + entity.setTableName(CfgIndexInfo.getTablename()); + entity.setFunctionId(functionId); + fileTransferCfgDao.updateCfgValid(entity); + //查询子配置 + entity = this.getP2pCfg(Long.parseLong(id)); + if(entity.getIpPortList()!=null && entity.getIpPortList().size()>0){ + IpPortCfg cfg = new IpPortCfg(); + BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"}); + cfg.setTableName(IpPortCfg.getTablename()); + cfg.setUserRegion2(null); + fileTransferCfgDao.updateCfgValid(cfg); + } + if(entity.getP2pHashList()!=null && entity.getP2pHashList().size()>0){ + P2pHashCfg cfg = new P2pHashCfg(); + BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"}); + cfg.setTableName(P2pHashCfg.getTablename()); + cfg.setUserRegion1(cfg.getUserRegion2()); + cfg.setUserRegion2(null); + fileTransferCfgDao.updateCfgValid(cfg); + } + if(entity.getP2pKeywordList()!=null && entity.getP2pKeywordList().size()>0){ + P2pKeywordCfg cfg = new P2pKeywordCfg(); + BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"}); + cfg.setTableName(P2pKeywordCfg.getTablename()); + fileTransferCfgDao.updateCfgValid(cfg); + } + if(entity.getNtcSubscribeIdCfgList()!=null && entity.getNtcSubscribeIdCfgList().size()>0){ + NtcSubscribeIdCfg cfg = new NtcSubscribeIdCfg(); + BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"}); + cfg.setTableName(NtcSubscribeIdCfg.getTablename()); + fileTransferCfgDao.updateCfgValid(cfg); + } + //保存区域IP信息 + if(entity.getAreaCfg()!=null && entity.getAreaCfg().size()>0){ + AreaIpCfg cfg = new AreaIpCfg(); + BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"}); + cfg.setTableName(AreaIpCfg.getTablename()); + fileTransferCfgDao.updateCfgValid(cfg); + } + } + + } + + public void auditP2pCfg(CfgIndexInfo entity,Integer isAudit) throws MaatConvertException{ + //修改数据库审核状态信息 + entity.setTableName(CfgIndexInfo.getTablename()); + fileTransferCfgDao.auditCfg(entity); + + ToMaatBean maatBean = new ToMaatBean(); + MaatCfg maatCfg = new MaatCfg(); + List configCompileList = new ArrayList(); + List groupRelationList = new ArrayList(); + List ipRegionList = new ArrayList(); + List strRegionList = new ArrayList(); + List numRegionList = new ArrayList(); + List digestRegionList = new ArrayList(); + List areaIpRegionList = new ArrayList(); + + //查询子配置并修改审核状态 + entity = this.getP2pCfg(entity.getCfgId()); + if(entity.getIpPortList()!=null && entity.getIpPortList().size()>0){ + IpPortCfg cfg = new IpPortCfg(); + BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"}); + cfg.setTableName(IpPortCfg.getTablename()); + fileTransferCfgDao.auditCfg(cfg); + if(isAudit==1){ + Map map = cfgConvert(ipRegionList,entity.getIpPortList(),1,entity,groupRelationList); + groupRelationList=map.get("groupList"); + ipRegionList=map.get("dstList"); + if(map.get("numRegionList")!=null){ + numRegionList.addAll(map.get("numRegionList")); + } + } + } + if(entity.getP2pHashList()!=null && entity.getP2pHashList().size()>0){ + P2pHashCfg cfg = new P2pHashCfg(); + BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"}); + cfg.setTableName(P2pHashCfg.getTablename()); + fileTransferCfgDao.auditCfg(cfg); + if(isAudit==1){ + Map map = cfgConvert(strRegionList,entity.getP2pHashList(),2,entity,groupRelationList); + groupRelationList=map.get("groupList"); + strRegionList=map.get("dstList"); + } + } + if(entity.getP2pKeywordList()!=null && entity.getP2pKeywordList().size()>0){ + P2pKeywordCfg cfg = new P2pKeywordCfg(); + BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"}); + cfg.setTableName(P2pKeywordCfg.getTablename()); + fileTransferCfgDao.auditCfg(cfg); + if(isAudit==1){ + Map map = cfgConvert(strRegionList,entity.getP2pKeywordList(),2,entity,groupRelationList); + groupRelationList=map.get("groupList"); + strRegionList=map.get("dstList"); + } + } + if(entity.getNtcSubscribeIdCfgList()!=null && entity.getNtcSubscribeIdCfgList().size()>0){ + NtcSubscribeIdCfg cfg = new NtcSubscribeIdCfg(); + BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"}); + cfg.setTableName(NtcSubscribeIdCfg.getTablename()); + fileTransferCfgDao.auditCfg(cfg); + if(isAudit==1){ + Map map = cfgConvert(strRegionList,entity.getNtcSubscribeIdCfgList(),2,entity,groupRelationList); + groupRelationList=map.get("groupList"); + strRegionList=map.get("dstList"); + } + } + + + //保存区域IP信息 + List areaIpCfgList=areaIpCfgDao.getByCompileId(entity.getCompileId()); + if(!StringUtil.isEmpty(areaIpCfgList)){ + AreaIpCfg cfg = new AreaIpCfg(); + BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"}); + cfg.setTableName(AreaIpCfg.getTablename()); + fileTransferCfgDao.auditCfg(cfg); + if(isAudit==1){ + Map map = cfgConvert(areaIpRegionList,areaIpCfgList,1,entity,groupRelationList); + groupRelationList=map.get("groupList"); + areaIpRegionList=map.get("dstList"); + } + } + + //构造提交综合服务参数格式,一条配置提交一次综合服务 + if(isAudit==1){ + maatCfg.initDefaultValue(); + BeanUtils.copyProperties(entity, maatCfg); + maatCfg.setAction(entity.getAction()); + maatCfg.setAuditTime(entity.getAuditTime()); + maatCfg.setIpRegionList(ipRegionList); + maatCfg.setStrRegionList(strRegionList); + maatCfg.setNumRegionList(numRegionList); + maatCfg.setDigestRegionList(digestRegionList); + maatCfg.setGroupRelationList(groupRelationList); + maatCfg.setGroupNum(groupRelationList.size()); + maatCfg.setAreaIpRegionList(areaIpRegionList); + maatCfg.setIsValid(entity.getIsValid()); + + //设置自定义域参数 + String userRegion = ""; + for (IpPortCfg ipPortCfg : entity.getIpPortList()) { + if(!ipPortCfg.getUserRegion1().equals("")) { + userRegion += Constants.P2P_IP_TYPE_USER_REGION_KEY+"="+ipPortCfg.getUserRegion1(); + } + for (BaseStringCfg p2pHashCfg : entity.getP2pHashList()) { + if(!p2pHashCfg.getUserRegion1().equals("")) { + userRegion += Constants.USER_REGION_SPLIT+Constants.P2P_HASH_TYPE_USER_REGION_KEY+"="+p2pHashCfg.getUserRegion1(); + }else { + userRegion += Constants.USER_REGION_SPLIT+Constants.P2P_HASH_TYPE_USER_REGION_KEY+"="; + } + } + } + maatCfg.setUserRegion(userRegion); + + configCompileList.add(maatCfg); + maatBean.setConfigCompileList(configCompileList); + maatBean.setAuditTime(entity.getAuditTime()); + maatBean.setCreatorName(entity.getCurrentUser().getName()); + maatBean.setVersion(Constants.MAAT_VERSION); + maatBean.setOpAction(Constants.INSERT_ACTION); + + //调用服务接口下发配置数据 + String json=gsonToJson(maatBean); + logger.info("p2p配置下发配置参数:"+json); + //调用服务接口下发配置 + ToMaatResult result = ConfigServiceUtil.postMaatCfg(json); + logger.info("p2p配置下发响应信息:"+result.getMsg()); + + }else if(isAudit==3){ + maatCfg.setCompileId(entity.getCompileId()); + maatCfg.setServiceId(entity.getServiceId()); + maatCfg.setIsValid(0);//无效 + configCompileList.add(maatCfg); + maatBean.setConfigCompileList(configCompileList); + maatBean.setAuditTime(entity.getAuditTime()); + maatBean.setCreatorName(entity.getCurrentUser().getName()); + maatBean.setVersion(Constants.MAAT_VERSION); + maatBean.setOpAction(Constants.UPDATE_ACTION); + //调用服务接口取消配置 + String json=gsonToJson(maatBean); + logger.info("p2p配置下发配置参数:"+json); + //调用服务接口下发配置 + ToMaatResult result = ConfigServiceUtil.put(json,1); + logger.info("p2p配置取消配置响应信息:"+result.getMsg()); + } + } + } diff --git a/src/main/resources/messages/message_en.properties b/src/main/resources/messages/message_en.properties index 03476781c..3f82105a9 100644 --- a/src/main/resources/messages/message_en.properties +++ b/src/main/resources/messages/message_en.properties @@ -774,8 +774,8 @@ res_group_num=Response Group Number policy_number_value_valid=The policy number can only be 0, or more than 100 policy_number_value_unique=The policy number has already existed location=Location -extra=Abroad -intra=Territory +extra=Outbound +intra=Inbound #=============about Maintenance========= #=============some validation=========== line=line %s @@ -1044,6 +1044,7 @@ tunnel_code=Tunnel Behavior No tunnel_name=Tunnel Behavior Name tunnel_desc=Tunnel Behavior Description call_external_procedures_failed=Call external procedures failedfile_strategy=\u6587\u4EF6\u7B56\u7565 +file_strategy=File Strategy file_desc=File Desc content_type=Content Type content_length=Content Length diff --git a/src/main/resources/messages/message_zh_CN.properties b/src/main/resources/messages/message_zh_CN.properties index f11419696..b92881ffb 100644 --- a/src/main/resources/messages/message_zh_CN.properties +++ b/src/main/resources/messages/message_zh_CN.properties @@ -314,7 +314,6 @@ config_describe=\u914D\u7F6E\u63CF\u8FF0 match_area=\u5339\u914D\u533A\u57DF key_word=\u5173\u952E\u5B57 block_type=\u7BA1\u63A7\u7C7B\u578B -letter=\u6765\u51FD whether_area_block=\u533A\u57DF\u7BA1\u63A7\u8303\u56F4 classification=\u5206\u7C7B label=\u6807\u7B7E @@ -422,7 +421,7 @@ name_existed=\u7528\u6237\u540D\u5DF2\u5B58\u5728 parent_org=\u4E0A\u7EA7\u673A\u6784 is_useable=\u662F\u5426\u53EF\u7528 address=\u8054\u7CFB\u5730\u5740 -nochange=\u6682\u65E0\u4FEE\u6539\u8BB0\u5F55! +nochange=\u6682\u65E0\u4FEE\u6539\u8BB0\u5F55\! module_name=\u6A21\u5757\u540D\u79F0 dict_mark=\u5B57\u5178\u6807\u8BC6 run_state=\u8FD0\u884C\u72B6\u6001 @@ -709,7 +708,7 @@ pid=\u8282\u76EEID log_uri=\u5C01\u5835\u73B0\u573A\u7247\u6BB5\u8DEF\u5F84 fd_type=\u5C01\u5835\u7C7B\u578B access_url=\u8282\u76EE\u8BBF\u95EE\u5730\u5740 -refer=\u5165\u53E3\u9875\u9762 +referer=\u5165\u53E3\u9875\u9762 black_block_list=\u52A8\u6001\u9ED1\u540D\u5355 static_cfg_block=\u9759\u6001\u914D\u7F6E first_hit=\u9996\u6B21\u5206\u6790\u547D\u4E2D @@ -737,9 +736,8 @@ default_group=\u7F3A\u7701\u7EC4 policy_group_manage=\u7B56\u7565\u5206\u7EC4 #===========policy_group_manage end ============= #=============about manipulation========= -ratelimit_config=\u9650\u6D41\u7BA1\u7406 -target_ip_protect=\u76EE\u6807IP\u9632\u62A4 ratelimit_config=\u9650\u901F +target_ip_protect=\u6297DDOS\u653B\u51FB ip_ratelimit=IP\u9650\u6D41 domain_ratelimit=\u57DF\u540D\u9650\u6D41 ratelimit=\u9650\u901F\u6BD4\u4F8B @@ -983,10 +981,9 @@ src_ip_report=\u5883\u5185\u6E90IP\u62A5\u8868 dest_ip_report=\u76EE\u7684\u56FD\u5BB6IP\u62A5\u8868 isp_report=\u8FD0\u8425\u5546\u5C40\u70B9\u62A5\u8868 #=============about report=================== -ip_multiplex_policy=IP Reuse Policy -target_ip_protect=Anti DDOS -ip_multiplex_pool_config=IP Reuse Addr Pool -letter=Official Letter +ip_multiplex_policy=IP\u590D\u7528\u7B56\u7565 +ip_multiplex_pool_config=IP\u590D\u7528\u5730\u5740\u6C60 +letter=\u6765\u51FD show_more=\u5C55\u793A\u66F4\u591A #===============dashboard begin=================================== dashboard=\u7EDF\u8BA1\u56FE\u8868 @@ -1044,6 +1041,46 @@ tunnel_code=\u52A0\u5BC6\u96A7\u9053\u884C\u4E3A\u5E8F\u53F7 tunnel_name=\u52A0\u5BC6\u96A7\u9053\u884C\u4E3A\u540D\u79F0 tunnel_desc=\u52A0\u5BC6\u96A7\u9053\u884C\u4E3A\u63CF\u8FF0 call_external_procedures_failed=\u8C03\u7528\u5916\u90E8\u7A0B\u5E8F\u51FA\u9519 +is_hex=\u662F\u5426\u5341\u516D\u8FDB\u5236 +is_case_insenstive=\u662F\u5426\u5927\u5C0F\u5199\u654F\u611F +case_senstive=\u5927\u5C0F\u5199\u654F\u611F +case_insenstive=\u5927\u5C0F\u5199\u4E0D\u654F\u611F +hex=\u5341\u516D\u8FDB\u5236 +not_hex=\u975E\u5341\u516D\u8FDB\u5236 + +p2p_reject=P2P\u7BA1\u63A7 +NTC_P2P_IP=IP\u914D\u7F6E +NTC_P2P_HASH_BIN=HASH\u914D\u7F6E +NTC_P2P_KEYWORDS=\u5185\u5BB9\u5173\u952E\u5B57\u914D\u7F6E + +s_asn=\u5BA2\u6237\u7AEFASN +d_asn=\u670D\u52A1\u7AEFASN +s_subscribe_id=\u5BA2\u6237\u7AEF\u7528\u6237\u540D +d_subscribe_id=\u670D\u52A1\u7AEF\u7528\u6237\u540D +scene_file=\u73B0\u573A\u65E5\u5FD7\u6587\u4EF6\u5730\u5740 +req_hdr_key=\u8BF7\u6C42\u5934\u8F6C\u50A8\u6587\u4EF6KEY +req_body_key=\u8BF7\u6C42\u4F53\u8F6C\u50A8\u6587\u4EF6KEY +res_hdr_key=\u5E94\u7B54\u5934\u8F6C\u50A8\u6587\u4EF6KEY +res_body_key=\u5E94\u7B54\u4F53\u8F6C\u50A8\u6587\u4EF6KEY +website=\u7F51\u7AD9\u57DF\u540D + +p2p_ip_config_type=IP\u914D\u7F6E\u7C7B\u578B +p2p_hash_type=HASH\u7C7B\u578B +NTC_SUBSCRIBE_ID=\u8BA4\u8BC1\u6807\u8BC6\u914D\u7F6E + +app_header_config=APP\u5C42\u5934\u7279\u5F81 +app_ssl_config=APP SSL\u8BC1\u4E66\u7279\u5F81 +ip_intercepter_replace=IP\u62E6\u622A\u66FF\u6362 +domain_intercepter_replace=\u57DF\u540D\u62E6\u622A\u66FF\u6362 +ip_intercepter_ratelimit=IP\u62E6\u622A\u9650\u901F +domain_intercepter_ratelimit=\u57DF\u540D\u62E6\u622A\u9650\u901F +app_built_in_features_config=APP\u5185\u7F6E\u7279\u5F81\u7EF4\u62A4 +PXY_INTERCEPT_PKT_BIN=\u62E6\u622A\u62A5\u6587 +certificate=\u8BC1\u4E66 +do_log=\u662F\u5426\u8BB0\u5F55\u65E5\u5FD7 +no_log=\u4E0D\u8BB0\u5F55 +all_log=\u8BB0\u5F55\u6240\u6709\u65E5\u5FD7 +framework_log=\u53EA\u8BB0\u5F55\u7ED3\u6784\u5316\u65E5\u5FD7 file_strategy=\u6587\u4EF6\u7B56\u7565 file_desc=\u6587\u4EF6\u63CF\u8FF0 content_type=\u5185\u5BB9\u7C7B\u578B diff --git a/src/main/resources/nis.properties b/src/main/resources/nis.properties index 365304420..8fd656a92 100644 --- a/src/main/resources/nis.properties +++ b/src/main/resources/nis.properties @@ -236,6 +236,8 @@ ntcSrcipDomesticReport=ntcSrcipDomesticReport ntcDestipCountryReport=ntcDestipCountryReport ntcEntranceReport=ntcEntranceReport ntcIpLog=ntcIpLogs +ntcBgpLog=ntcBgpLogs +ntcP2pLog=ntcP2pLogs ntcHttpLog=ntcHttpLogs ntcDnsLog=ntcDnsLogs ntcSslLog=ntcSslLogs @@ -264,7 +266,7 @@ mmSamplePicLog=mmSamplePicLogs mmSampleVoipLog=mmSampleVoipLogs pxyHttpLog=pxyHttpLogs ######################################## -#大屏图表展示服务接口 +#\u5927\u5c4f\u56fe\u8868\u5c55\u793a\u670d\u52a1\u63a5\u53e3 dashboardUrl=http://10.0.6.242:8080/galaxy/service/log/v1/ trafficIpActive=trafficIpActive trafficProtocol=trafficProtocol @@ -282,7 +284,7 @@ log_time_range=300000 #use elasticsearch or not# isUseES=false -#httpclient 工具设置超时时间 +#httpclient \u5de5\u5177\u8bbe\u7f6e\u8d85\u65f6\u65f6\u95f4 http_socket_timeout=300000 http_connect_timeout=10000 http_connect_request_timeout=50000 @@ -295,7 +297,7 @@ jdbc.hive.AName=xa_dfbhit_hive jdbc.hive.BName=xa_z2_mesalog_hive maxPageSize=100000 -#导出最大条数 +#\u5bfc\u51fa\u6700\u5927\u6761\u6570 maxExportSize=100000 #\u5141\u8bb8\u914d\u7f6e\u6700\u5927\u5c42\u7ea7 maxLevelNo=4 @@ -319,6 +321,8 @@ http_redirect_res_hdr_region=PXY_CTRL_HTTP_RES_HDR http_redirect_req_body_region=PXY_CTRL_HTTP_REQ_BODY http_redirect_res_body_region=PXY_CTRL_HTTP_RES_BODY http_redirect_ip_region=PXY_CTRL_IP +p2p_hash_bin_region=NTC_P2P_HASH_BIN +p2p_keywords_region=NTC_P2P_KEYWORDS voip_ip=av_voip_ip voip_account=av_voip_account ssl_sni_region=ssl_sni @@ -328,16 +332,16 @@ ssl_ip_region=ssl_ip bgp_ip_region=bgp_ip behav_id_region=BEHAV_ID rate_limit_region=RATE_LIMIT -#存在与表达式的关键字特殊分隔符 +#\u5b58\u5728\u4e0e\u8868\u8fbe\u5f0f\u7684\u5173\u952e\u5b57\u7279\u6b8a\u5206\u9694\u7b26 keyword_expr=***and*** -#时区 +#\u65f6\u533a time_zone=8 -#需要特殊处理的业务类型 +#\u9700\u8981\u7279\u6b8a\u5904\u7406\u7684\u4e1a\u52a1\u7c7b\u578b service_pxy_domain_intercept=513 service_ip_mulitiplex=768 service_ip_ratelimit=1057 service_domain_ratelimit=1058 -#用户自定义域 +#\u7528\u6237\u81ea\u5b9a\u4e49\u57df userregion_rate_limit=RATE_LIMIT userregion_ir_strategy=IR_STRATEGY userregion_ir_type=IR_TYPE @@ -347,25 +351,25 @@ userregion_replace_type_key=zone userregion_replace_req_key_value=http_req_body userregion_replace_res_key_value=http_res_body userregion_replace_regex_key=regex -#用户自定义域占位符 +#\u7528\u6237\u81ea\u5b9a\u4e49\u57df\u5360\u4f4d\u7b26 user_region_placeholder=0 -#用户自定义域分隔符 +#\u7528\u6237\u81ea\u5b9a\u4e49\u57df\u5206\u9694\u7b26 user_region_split=; -#IP相关验证正则 +#IP\u76f8\u5173\u9a8c\u8bc1\u6b63\u5219 ipv4_ip_subnet_regexp=^(25[0-5]|2[0-4]\\d|[0-1]?\\d?\\d)(\\.(25[0-5]|2[0-4]\\d|[0-1]?\\d?\\d)){3}/(3[0-2]|[1-2][0-9]|[0-9])$ ipv6_ip_subnet_regexp=^\\s*((([0-9A-Fa-f]{1,4}\:){7}(([0-9A-Fa-f]{1,4})|\:))|(([0-9A-Fa-f]{1,4}\:){6}(\:|(\:[0-9A-Fa-f]{1,4})))|(([0-9A-Fa-f]{1,4}\:){5}((\:?)|((\:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}\:){4}(\:[0-9A-Fa-f]{1,4}){0,1}((\:?)|((\:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}\:){3}(\:[0-9A-Fa-f]{1,4}){0,2}((\:?)|((\:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}\:){2}(\:[0-9A-Fa-f]{1,4}){0,3}((\:?)|((\:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}\:)(\:[0-9A-Fa-f]{1,4}){0,4}((\:?)|((\:[0-9A-Fa-f]{1,4}){1,2})))|(\:(\:[0-9A-Fa-f]{1,4}){0,5}((\:)|((\:[0-9A-Fa-f]{1,4}){1,2}))))(%.+)?\\s*/(0|2|4|8|16|32|64|128)$ ipv4_ip_range_regexp=^(25[0-5]|2[0-4]\\d|[0-1]?\\d?\\d)(\\.(25[0-5]|2[0-4]\\d|[0-1]?\\d?\\d)){3}-(25[0-5]|2[0-4]\\d|[0-1]?\\d?\\d)(\\.(25[0-5]|2[0-4]\\d|[0-1]?\\d?\\d)){3}$ ipv6_ip_range_regexp=^\\s*((([0-9A-Fa-f]{1,4}\:){7}(([0-9A-Fa-f]{1,4})|\:))|(([0-9A-Fa-f]{1,4}\:){6}(\:|(\:[0-9A-Fa-f]{1,4})))|(([0-9A-Fa-f]{1,4}\:){5}((\:?)|((\:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}\:){4}(\:[0-9A-Fa-f]{1,4}){0,1}((\:?)|((\:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}\:){3}(\:[0-9A-Fa-f]{1,4}){0,2}((\:?)|((\:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}\:){2}(\:[0-9A-Fa-f]{1,4}){0,3}((\:?)|((\:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}\:)(\:[0-9A-Fa-f]{1,4}){0,4}((\:?)|((\:[0-9A-Fa-f]{1,4}){1,2})))|(\:(\:[0-9A-Fa-f]{1,4}){0,5}((\:)|((\:[0-9A-Fa-f]{1,4}){1,2}))))(%.+)?\\s*-\\s*((([0-9A-Fa-f]{1,4}\:){7}(([0-9A-Fa-f]{1,4})|\:))|(([0-9A-Fa-f]{1,4}\:){6}(\:|(\:[0-9A-Fa-f]{1,4})))|(([0-9A-Fa-f]{1,4}\:){5}((\:?)|((\:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}\:){4}(\:[0-9A-Fa-f]{1,4}){0,1}((\:?)|((\:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}\:){3}(\:[0-9A-Fa-f]{1,4}){0,2}((\:?)|((\:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}\:){2}(\:[0-9A-Fa-f]{1,4}){0,3}((\:?)|((\:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}\:)(\:[0-9A-Fa-f]{1,4}){0,4}((\:?)|((\:[0-9A-Fa-f]{1,4}){1,2})))|(\:(\:[0-9A-Fa-f]{1,4}){0,5}((\:)|((\:[0-9A-Fa-f]{1,4}){1,2}))))(%.+)?\\s*$ ipv4_ip_regexp=^(25[0-5]|2[0-4]\\d|[0-1]?\\d?\\d)(\\.(25[0-5]|2[0-4]\\d|[0-1]?\\d?\\d)){3}$ ipv6_ip_regexp=^\\s*((([0-9A-Fa-f]{1,4}\:){7}(([0-9A-Fa-f]{1,4})|\:))|(([0-9A-Fa-f]{1,4}\:){6}(\:|(\:[0-9A-Fa-f]{1,4})))|(([0-9A-Fa-f]{1,4}\:){5}((\:?)|((\:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}\:){4}(\:[0-9A-Fa-f]{1,4}){0,1}((\:?)|((\:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}\:){3}(\:[0-9A-Fa-f]{1,4}){0,2}((\:?)|((\:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}\:){2}(\:[0-9A-Fa-f]{1,4}){0,3}((\:?)|((\:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}\:)(\:[0-9A-Fa-f]{1,4}){0,4}((\:?)|((\:[0-9A-Fa-f]{1,4}){1,2})))|(\:(\:[0-9A-Fa-f]{1,4}){0,5}((\:)|((\:[0-9A-Fa-f]{1,4}){1,2}))))(%.+)?\\s*$ -#重定向业务自定义域相关参数 +#\u91cd\u5b9a\u5411\u4e1a\u52a1\u81ea\u5b9a\u4e49\u57df\u76f8\u5173\u53c2\u6570 redirect_response_code_key=code redirect_url_key=url redirect_content_key=content redirect_response_code_startwith=30 replace_zone_key=zone replace_substitute_key=substitute -#样例文件上传的uri关键词 +#\u6837\u4f8b\u6587\u4ef6\u4e0a\u4f20\u7684uri\u5173\u952e\u8bcd sample_upload_url_keyword=/av digest_upload_url_keyword=/filetransfer @@ -374,36 +378,36 @@ sample_total_file_max_size=12582912 #audio File Types audio_file_type=,mp4,flv,asf,wmv,avi,mpeg,mov,dat,m4v,m4p,m4b,webm,ogv,wav,mp3, -#audio File Size 10M 10485760(single) +#audio File Size 10M 10485760\uff08single\uff09 audio_single_file_max_size=10485760 #video File Types video_file_type=,mp4,flv,asf,wmv,avi,mpeg,mov,dat,m4v,m4p,m4b,webm,ogv, -#video File Size 10M 10485760(single) +#video File Size 10M 10485760\uff08single\uff09 video_single_file_max_size=10485760 #picture File Types picture_file_type=,bmp,jpg,tiff,raw,gif, -#picture File Size 10M 10485760(single) +#picture File Size 10M 10485760\uff08single\uff09 picture_single_file_max_size=10485760 #voip File Types voip_file_type=,mp3,mp4,flv,ivf,mp2v,jpg, -#voip File Size 10M 10485760(single) +#voip File Size 10M 10485760\uff08single\uff09 voip_single_file_max_size=10485760 #digest File Types digest_file_type=,txt,doc,img,docx,pptx,xlsx,xls,ppt, -#digest File Size 10M 10485760(single) +#digest File Size 10M 10485760\uff08single\uff09 digest_single_file_max_size=10485760 -#digest File Size 12M 12582912(total) +#digest File Size 12M 12582912\uff08total\uff09 digest_total_file_max_size=12582912 -#YSP文件保存路径 +#YSP\u6587\u4ef6\u4fdd\u5b58\u8def\u5f84 #av_file_path=/home/ysp/ av_file_path=D\:\\ysp\\ -#YSP文件特征类型 +#YSP\u6587\u4ef6\u7279\u5f81\u7c7b\u578b av_sample_audio_region=av_sample_audio av_sample_video_region=av_sample_video av_sample_picture_region=av_sample_picture av_sample_voip_region=av_sample_voip -#样例文件生成程序 +#\u6837\u4f8b\u6587\u4ef6\u751f\u6210\u7a0b\u5e8f #audio_sample_create_proc=java -jar /home/sampleTest.jar #video_sample_create_proc=java -jar /home/sampleTest.jar #picture_sample_create_proc=java -jar /home/sampleTest.jar @@ -422,31 +426,34 @@ picture_sample_proc_param_is_quotation=false audio_sample_proc_param_is_translation=true video_sample_proc_param_is_translation=true picture_sample_proc_param_is_translation=true -#http自定义域相关参数 +#http\u81ea\u5b9a\u4e49\u57df\u76f8\u5173\u53c2\u6570 http_header_user_region_key=HTTP_HEADER http_header_dict_module=HTTP_HEADER_DISTRICT -#dns自定义域参数key +#dns\u81ea\u5b9a\u4e49\u57df\u53c2\u6570key dns_strategy_user_region_key=DNS_STRATEGY -#特定服务类别 +#p2p\u81ea\u5b9a\u4e49\u57dfkey +p2p_ip_type_user_region_key=P2P_IP_TYPE +p2p_hash_type_user_region_key=P2P_HASH_TYPE +#\u7279\u5b9a\u670d\u52a1\u7c7b\u522b specific_service_cfg_type_app=social_app specific_service_cfg_type_encrypted_tunnel_behavior=encrypted_tunnel_behavior specific_service_cfg_type_basic_protocol=basic_protocol -#基础协议自定义域 +#\u57fa\u7840\u534f\u8bae\u81ea\u5b9a\u4e49\u57df proto_id_region=PROTO_ID -#IP默认值 +#IP\u9ed8\u8ba4\u503c ipv4_default_ip_value=\:\: ipv4_default_ip_subnet_value=0.0.0.0/32 ipv6_default_ip_subnet_value=::/64 ipv4_default_ip_range_value=0.0.0.0-0.0.0.0 ipv6_default_ip_range_value=::-:: -#端口默认值 +#\u7aef\u53e3\u9ed8\u8ba4\u503c port_default=0 port_mask_default=0/65535 -#MAAT CFG 一些默认值 +#MAAT CFG \u4e00\u4e9b\u9ed8\u8ba4\u503c maat_cfg_dolog_default=1 maat_cfg_dolog_doblacklist_default=1 maat_cfg_dolog_configpercent_default=100 maat_cfg_dolog_configoption_default=1 -#app,基础协议,特定服务的userregion分隔符 +#app\uff0c\u57fa\u7840\u534f\u8bae\uff0c\u7279\u5b9a\u670d\u52a1\u7684userregion\u5206\u9694\u7b26 app_cfg_userregion_splitor=& app_id_region=APP_ID \ No newline at end of file diff --git a/src/main/resources/sql/add_function_region_303.sql b/src/main/resources/sql/add_function_region_303.sql new file mode 100644 index 000000000..9150a9ba9 --- /dev/null +++ b/src/main/resources/sql/add_function_region_303.sql @@ -0,0 +1 @@ +INSERT INTO function_region_dict (function_id,config_region_code,config_region_value,config_desc,is_valid,is_maat,region_type) VALUES(303,1,'LIMIT_DOMAIN','域名限速',1,1,2) \ No newline at end of file diff --git a/src/main/resources/sql/add_function_region_dict_columns.sql b/src/main/resources/sql/add_function_region_dict_columns.sql new file mode 100644 index 000000000..10bca3fa5 --- /dev/null +++ b/src/main/resources/sql/add_function_region_dict_columns.sql @@ -0,0 +1,7 @@ +ALTER TABLE function_region_dict ADD config_ip_port_show VARCHAR(10) NULL COMMENT '1,展示源IP/端口2;展示目目的IP/端口;使用逗号分隔'; +ALTER TABLE function_region_dict ADD config_ip_type VARCHAR(20) NULL COMMENT 'ip的类型,有4,6,46,64,10几种类型,使用逗号分隔'; +ALTER TABLE function_region_dict ADD config_ip_pattern VARCHAR(10) NULL COMMENT 'ip的格式 1:ip掩码;2:IP范围;3:IP;使用逗号分隔'; +ALTER TABLE function_region_dict ADD config_port_pattern VARCHAR(10) NULL COMMENT '端口的格式,1:port;2:port_mask;使用逗号分隔'; +ALTER TABLE function_region_dict ADD config_direction VARCHAR(10) NULL COMMENT 'IP方向0,双向;1,单向.使用逗号分隔'; +ALTER TABLE function_service_dict ADD region_code INT(11) NULL COMMENT 'function_region_dict 表中的config_region_code字段值'; +ALTER TABLE function_region_dict ADD config_protocol VARCHAR(20) NULL COMMENT '协议 0:任意;6:TCP;17:UDP;1:ICMP;50:ESP;51:AH'; diff --git a/src/main/resources/sql/app_layer_header_cfg.sql b/src/main/resources/sql/app_layer_header_cfg.sql new file mode 100644 index 000000000..f70471b6b --- /dev/null +++ b/src/main/resources/sql/app_layer_header_cfg.sql @@ -0,0 +1,60 @@ +/* +Navicat MariaDB Data Transfer + +Source Server : 10.0.6.249 +Source Server Version : 100214 +Source Host : 10.0.6.249:3306 +Source Database : gwall + +Target Server Type : MariaDB +Target Server Version : 100214 +File Encoding : 65001 + +Date: 2018-08-20 20:40:02 +*/ + +SET FOREIGN_KEY_CHECKS=0; + +-- ---------------------------- +-- Table structure for app_layer_header_cfg +-- ---------------------------- +DROP TABLE IF EXISTS `app_layer_header_cfg`; +CREATE TABLE `app_layer_header_cfg` ( + `cfg_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + `district` varchar(128) NOT NULL, + `cfg_keywords` varchar(1024) NOT NULL, + `app_code` int(11) NOT NULL, + `behav_code` int(11) DEFAULT NULL, + `spec_service_id` varchar(255) NOT NULL COMMENT 'specific_service_cfg .spec_service_id', + `cfg_desc` varchar(128) DEFAULT '', + `action` int(11) NOT NULL COMMENT '1:阻断(reject)2:监测(monit)5:管控白名单(Control whitelist)6:监测白名单(monit whitelist)7:管控监测都白名单(global whitelist)', + `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 '业务id', + `request_id` int(11) NOT NULL COMMENT '来自request_info.id', + `compile_id` int(11) NOT NULL, + `is_area_effective` int(11) NOT NULL DEFAULT 0, + `classify` varchar(128) DEFAULT '', + `attribute` varchar(128) DEFAULT '', + `lable` varchar(128) DEFAULT '', + `area_effective_ids` varchar(1024) DEFAULT '', + `function_id` int(11) NOT NULL, + `ratelimit` int(11) DEFAULT 0 COMMENT '限速比例', + `cfg_type` varchar(64) NOT NULL DEFAULT '', + `cfg_region_code` int(11) NOT NULL, + `expr_type` int(11) NOT NULL DEFAULT 0 COMMENT '0:无表达式,1:与表达式', + `match_method` int(11) NOT NULL DEFAULT 3 COMMENT 'expr_type:0时有意义,其它情况必须置0。0:子串匹配;1:右匹配;2:左匹配;3:完全匹配', + `is_hexbin` int(11) NOT NULL DEFAULT 0 COMMENT '默认为0:大小写不敏感,且非HEX;1:HEX格式二进制;2:大小写敏感,且非HEX', + `user_region1` varchar(1024) DEFAULT '' COMMENT '预留自定义域1', + `user_region2` varchar(1024) DEFAULT '' COMMENT '预留自定义域2', + `user_region3` varchar(1024) DEFAULT '' COMMENT '预留自定义域3', + `user_region4` varchar(1024) DEFAULT '' COMMENT '预留自定义域4', + `user_region5` varchar(1024) DEFAULT '' COMMENT '预留自定义域5', + PRIMARY KEY (`cfg_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; diff --git a/src/main/resources/sql/app_ssl_cert_cfg.sql b/src/main/resources/sql/app_ssl_cert_cfg.sql new file mode 100644 index 000000000..f7b3164f1 --- /dev/null +++ b/src/main/resources/sql/app_ssl_cert_cfg.sql @@ -0,0 +1,60 @@ +/* +Navicat MariaDB Data Transfer + +Source Server : 10.0.6.249 +Source Server Version : 100214 +Source Host : 10.0.6.249:3306 +Source Database : gwall + +Target Server Type : MariaDB +Target Server Version : 100214 +File Encoding : 65001 + +Date: 2018-08-20 20:39:54 +*/ + +SET FOREIGN_KEY_CHECKS=0; + +-- ---------------------------- +-- Table structure for app_ssl_cert_cfg +-- ---------------------------- +DROP TABLE IF EXISTS `app_ssl_cert_cfg`; +CREATE TABLE `app_ssl_cert_cfg` ( + `cfg_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + `district` varchar(128) NOT NULL, + `cfg_keywords` varchar(1024) NOT NULL, + `app_code` int(11) NOT NULL, + `behav_code` int(11) DEFAULT NULL, + `spec_service_id` varchar(255) NOT NULL COMMENT 'specific_service_cfg .spec_service_id', + `cfg_desc` varchar(128) DEFAULT '', + `action` int(11) NOT NULL COMMENT '1:阻断(reject)2:监测(monit)5:管控白名单(Control whitelist)6:监测白名单(monit whitelist)7:管控监测都白名单(global whitelist)', + `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 '业务id', + `request_id` int(11) NOT NULL COMMENT '来自request_info.id', + `compile_id` int(11) NOT NULL, + `is_area_effective` int(11) NOT NULL DEFAULT 0, + `classify` varchar(128) DEFAULT '', + `attribute` varchar(128) DEFAULT '', + `lable` varchar(128) DEFAULT '', + `area_effective_ids` varchar(1024) DEFAULT '', + `function_id` int(11) NOT NULL, + `ratelimit` int(11) DEFAULT 0 COMMENT '限速比例', + `cfg_type` varchar(64) NOT NULL DEFAULT '', + `cfg_region_code` int(11) NOT NULL, + `expr_type` int(11) NOT NULL DEFAULT 0 COMMENT '0:无表达式,1:与表达式', + `match_method` int(11) NOT NULL DEFAULT 3 COMMENT 'expr_type:0时有意义,其它情况必须置0。0:子串匹配;1:右匹配;2:左匹配;3:完全匹配', + `is_hexbin` int(11) NOT NULL DEFAULT 0 COMMENT '默认为0:大小写不敏感,且非HEX;1:HEX格式二进制;2:大小写敏感,且非HEX', + `user_region1` varchar(1024) DEFAULT '' COMMENT '预留自定义域1', + `user_region2` varchar(1024) DEFAULT '' COMMENT '预留自定义域2', + `user_region3` varchar(1024) DEFAULT '' COMMENT '预留自定义域3', + `user_region4` varchar(1024) DEFAULT '' COMMENT '预留自定义域4', + `user_region5` varchar(1024) DEFAULT '' COMMENT '预留自定义域5', + PRIMARY KEY (`cfg_id`) +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; diff --git a/src/main/resources/sql/function_region_dict_add_colunm.sql b/src/main/resources/sql/function_region_dict_add_colunm.sql new file mode 100644 index 000000000..20b17d5b9 --- /dev/null +++ b/src/main/resources/sql/function_region_dict_add_colunm.sql @@ -0,0 +1,12 @@ +alter table function_region_dict add config_multi_keywords varchar(2) COMMENT '是否可以多个关键字'; +alter table function_region_dict add config_hex varchar(20) COMMENT '十六进制 单选:0 非十六进制 大小不敏感 1 十六进制,大小写不敏感 2非十六进制 大小写敏感 默认为0'; +alter table function_region_dict add config_expr_type varchar(20) COMMENT '是否表达式 :单选 0 无表达式 1表达式 默认为0'; +alter table function_region_dict add config_match_method varchar(20) COMMENT '匹配方式 下拉 0:子串匹配;1:右匹配;2:左匹配;3:完全匹配 默认为0 expr_type:0时有意义,其它情况必须置0。'; +alter table function_region_dict add config_service_type varchar(50) COMMENT '域业务类型,domain,url,dns, + +INSERT INTO function_region_dict (`function_id`, `config_region_code`, `config_region_value`, `config_district`, `config_desc`, `is_valid`, `creator_id`, `create_time`, `editor_id`, `edit_time`, `is_maat`, `region_type`, `config_multi_keywords`, `config_hex`, `config_expr_type`, `config_match_method`) VALUES ('510', '3', 'NTC_P2P_KEYWORDS', '', 'p2p文件内容配置', '1', NULL, NULL, NULL, NULL, '1', '2', '1', '0,1,2', '0,1', '0,1,2,3'); +INSERT INTO function_region_dict (`function_id`, `config_region_code`, `config_region_value`, `config_district`, `config_desc`, `is_valid`, `creator_id`, `create_time`, `editor_id`, `edit_time`, `is_maat`, `region_type`, `config_multi_keywords`, `config_hex`, `config_expr_type`, `config_match_method`) VALUES ('510', '2', 'NTC_SUBSCRIBE_ID', '', 'p2p subscribe配置', '1', NULL, NULL, NULL, NULL, '1', '2', '1', '0,1,2', '0,1', '0,1,2,3'); +INSERT INTO function_region_dict (`function_id`, `config_region_code`, `config_region_value`, `config_district`, `config_desc`, `is_valid`, `creator_id`, `create_time`, `editor_id`, `edit_time`, `is_maat`, `region_type`, `config_multi_keywords`, `config_hex`, `config_expr_type`, `config_match_method`) VALUES ('510', '1', 'NTC_P2P_HASH_BIN', NULL, 'p2p hash配置', '1', NULL, NULL, NULL, NULL, '1', '2', '1', '1', '0,1', '0,1,2,3'); +INSERT INTO function_region_dict (`function_id`, `config_region_code`, `config_region_value`, `config_district`, `config_desc`, `is_valid`, `creator_id`, `create_time`, `editor_id`, `edit_time`, `is_maat`, `region_type`, `config_multi_keywords`, `config_hex`, `config_expr_type`, `config_match_method`) VALUES ('510', '4', 'NTC_P2P_IP', NULL, 'p2p ip配置', '1', NULL, NULL, NULL, NULL, '1', '1', NULL, NULL, NULL, NULL); +INSERT INTO function_region_dict (`config_service_type`, `config_multi_keywords`, `config_expr_type`, `config_hex`, `config_match_method`, `function_id`, `config_region_code`, `config_region_value`, `config_district`, `config_desc`, `is_valid`, `creator_id`, `create_time`, `editor_id`, `edit_time`, `is_maat`, `region_type`) VALUES ('', '1', '0,1', '0,1,2', '0,1,2,3', '520', '1', 'APP_SSL_CERT', 'DV,OV,EV', 'APP SSL证书特征配置', '1', NULL, NULL, NULL, NULL, '1', '3'); +INSERT INTO function_region_dict (`config_service_type`, `config_multi_keywords`, `config_expr_type`, `config_hex`, `config_match_method`, `function_id`, `config_region_code`, `config_region_value`, `config_district`, `config_desc`, `is_valid`, `creator_id`, `create_time`, `editor_id`, `edit_time`, `is_maat`, `region_type`) VALUES ('', '1', '0,1', '0,1,2', '0,1,2,3', '530', '1', 'APP_LAYER_HEADER', NULL, 'APP 报头特征配置', '1', NULL, NULL, NULL, NULL, '1', '3'); diff --git a/src/main/resources/sql/function_service_dict_add_colunm.sql b/src/main/resources/sql/function_service_dict_add_colunm.sql new file mode 100644 index 000000000..e49b9d685 --- /dev/null +++ b/src/main/resources/sql/function_service_dict_add_colunm.sql @@ -0,0 +1,3 @@ +INSERT INTO function_service_dict (`function_id`, `protocol_id`, `action`, `action_code`, `service_id`, `service_name`, `service_desc`, `is_valid`, `creator_id`, `create_time`, `editor_id`, `edit_time`) VALUES ('510', '0', '16', 'reject', '34', 'p2p_reject', NULL, '1', NULL, NULL, NULL, NULL); +INSERT INTO function_service_dict (`function_id`, `protocol_id`, `action`, `action_code`, `service_id`, `service_name`, `service_desc`, `is_valid`, `creator_id`, `create_time`, `editor_id`, `edit_time`) VALUES ('520', '0', '1', 'monit', '1029', 'app_ssl_cert_feature_monit', NULL, '1', NULL, NULL, NULL, NULL); +INSERT INTO function_service_dict (`function_id`, `protocol_id`, `action`, `action_code`, `service_id`, `service_name`, `service_desc`, `is_valid`, `creator_id`, `create_time`, `editor_id`, `edit_time`) VALUES ('530', '0', '1', 'monit', '1031', 'app_header_feature_monit', NULL, '1', NULL, NULL, NULL, NULL); diff --git a/src/main/resources/sql/p2p_hash_cfg.sql b/src/main/resources/sql/p2p_hash_cfg.sql new file mode 100644 index 000000000..3f017cbe2 --- /dev/null +++ b/src/main/resources/sql/p2p_hash_cfg.sql @@ -0,0 +1,55 @@ +/* +Navicat MariaDB Data Transfer + +Source Server : 10.0.6.249 +Source Server Version : 100214 +Source Host : 10.0.6.249:3306 +Source Database : gwall + +Target Server Type : MariaDB +Target Server Version : 100214 +File Encoding : 65001 + +Date: 2018-08-18 21:11:12 +*/ + +SET FOREIGN_KEY_CHECKS=0; + +-- ---------------------------- +-- Table structure for p2p_hash_cfg +-- ---------------------------- +DROP TABLE IF EXISTS `p2p_hash_cfg`; +CREATE TABLE `p2p_hash_cfg` ( + `cfg_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键,自增', + `cfg_desc` varchar(128) DEFAULT NULL, + `cfg_keywords` varchar(64) NOT NULL, + `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删除;1) 未审核时配置可删除;2) 审核通过,此字段置1;3) 取消审核通过,此字段置0', + `is_audit` int(11) NOT NULL COMMENT '0未审核,1审核通过,2审核未通过,3取消审核通过;1) 审核未通过,配置可修改;2) 审核通过,配置不可删除,只能取消审核通过', + `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) NOT 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,多个用英文逗号分隔', + `expr_type` int(11) NOT NULL COMMENT '0:无表达式,1:与表达式', + `match_method` int(11) NOT NULL COMMENT 'expr_type:0时有意义,其它情况必须置0。0:子串匹配;1:右匹配;2:左匹配;3:完全匹配', + `is_hexbin` int(11) NOT NULL COMMENT '默认为0:大小写不敏感,且非HEX;1:HEX格式二进制;2:大小写敏感,且非HEX', + `area_effective_ids` varchar(1024) DEFAULT NULL COMMENT '多个英文逗号分隔', + `function_id` int(11) DEFAULT NULL, + `cfg_region_code` int(11) DEFAULT NULL, + `cfg_type` varchar(64) DEFAULT NULL, + `user_region1` varchar(1024) DEFAULT '' COMMENT '预留自定义域1', + `user_region2` varchar(1024) DEFAULT '' COMMENT '预留自定义域2', + `user_region3` varchar(1024) DEFAULT '' COMMENT '预留自定义域3', + `user_region4` varchar(1024) DEFAULT '' COMMENT '预留自定义域4', + `user_region5` varchar(1024) DEFAULT '' COMMENT '预留自定义域5', + PRIMARY KEY (`cfg_id`) +) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8; diff --git a/src/main/resources/sql/p2p_keyword_cfg.sql b/src/main/resources/sql/p2p_keyword_cfg.sql new file mode 100644 index 000000000..c3af67791 --- /dev/null +++ b/src/main/resources/sql/p2p_keyword_cfg.sql @@ -0,0 +1,55 @@ +/* +Navicat MariaDB Data Transfer + +Source Server : 10.0.6.249 +Source Server Version : 100214 +Source Host : 10.0.6.249:3306 +Source Database : gwall + +Target Server Type : MariaDB +Target Server Version : 100214 +File Encoding : 65001 + +Date: 2018-08-18 21:11:57 +*/ + +SET FOREIGN_KEY_CHECKS=0; + +-- ---------------------------- +-- Table structure for p2p_keyword_cfg +-- ---------------------------- +DROP TABLE IF EXISTS `p2p_keyword_cfg`; +CREATE TABLE `p2p_keyword_cfg` ( + `cfg_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键,自增', + `cfg_desc` varchar(128) DEFAULT NULL, + `cfg_keywords` varchar(64) NOT NULL, + `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删除;1) 未审核时配置可删除;2) 审核通过,此字段置1;3) 取消审核通过,此字段置0', + `is_audit` int(11) NOT NULL COMMENT '0未审核,1审核通过,2审核未通过,3取消审核通过;1) 审核未通过,配置可修改;2) 审核通过,配置不可删除,只能取消审核通过', + `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) NOT 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,多个用英文逗号分隔', + `expr_type` int(11) NOT NULL COMMENT '0:无表达式,1:与表达式', + `match_method` int(11) NOT NULL COMMENT 'expr_type:0时有意义,其它情况必须置0。0:子串匹配;1:右匹配;2:左匹配;3:完全匹配', + `is_hexbin` int(11) NOT NULL COMMENT '默认为0:大小写不敏感,且非HEX;1:HEX格式二进制;2:大小写敏感,且非HEX', + `area_effective_ids` varchar(1024) DEFAULT NULL COMMENT '多个英文逗号分隔', + `function_id` int(11) DEFAULT NULL, + `cfg_region_code` int(11) DEFAULT NULL, + `cfg_type` varchar(64) DEFAULT NULL, + `user_region1` varchar(1024) DEFAULT '' COMMENT '预留自定义域1', + `user_region2` varchar(1024) DEFAULT '' COMMENT '预留自定义域2', + `user_region3` varchar(1024) DEFAULT '' COMMENT '预留自定义域3', + `user_region4` varchar(1024) DEFAULT '' COMMENT '预留自定义域4', + `user_region5` varchar(1024) DEFAULT '' COMMENT '预留自定义域5', + PRIMARY KEY (`cfg_id`) +) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8; diff --git a/src/main/resources/sql/update_cfg_index_info-20180820.sql b/src/main/resources/sql/update_cfg_index_info-20180820.sql new file mode 100644 index 000000000..a00adcfd9 --- /dev/null +++ b/src/main/resources/sql/update_cfg_index_info-20180820.sql @@ -0,0 +1 @@ +alter table task_info add do_log int(11) COMMENT 'do_log:0不需要1记录所有日志2只记录结构化日志。默认是2' \ No newline at end of file diff --git a/src/main/resources/sql/update_function_region_dict_data.sql b/src/main/resources/sql/update_function_region_dict_data.sql new file mode 100644 index 000000000..74ab782f2 --- /dev/null +++ b/src/main/resources/sql/update_function_region_dict_data.sql @@ -0,0 +1,17 @@ +#ip地址 +UPDATE function_service_dict SET region_code=1 WHERE function_id=5 AND ACTION IN(16,1); +UPDATE function_service_dict SET region_code=2 WHERE function_id=5 AND ACTION IN(32,96); +UPDATE function_region_dict SET config_ip_port_show='1,2' ,config_ip_type='4,6,46,64,10',config_ip_pattern='1,2,3',config_port_pattern='1,2',config_direction='0,1',config_protocol='0,6,17' WHERE dict_id=27; +UPDATE function_region_dict SET config_service_type='ipaddr',config_ip_port_show='1,2' ,config_ip_type='4,6,46,64,10',config_ip_pattern='1,2,3',config_port_pattern='1,2',config_direction='0,1',config_protocol='0,6,17,1' WHERE dict_id=35; +#ip限流 +UPDATE function_service_dict SET region_code=1 WHERE function_id=302 AND ACTION IN(64); +UPDATE function_region_dict SET config_service_type='ratelimit',config_ip_port_show='1,2' ,config_ip_type='4,6,46,64,10',config_ip_pattern='1,2,3',config_port_pattern='1,2',config_direction='0,1',config_protocol='0,6,17' WHERE dict_id=67; +#IP复用策略 +UPDATE function_service_dict SET region_code=1 WHERE function_id=300 AND ACTION IN(96); +UPDATE function_region_dict SET config_service_type='ipmulitiplex',config_ip_port_show='1' ,config_ip_type='4,6',config_ip_pattern='1,2,3',config_port_pattern='1,2',config_direction='0,1',config_protocol='0,6,17' WHERE dict_id=68; +#IP拦截 +UPDATE function_service_dict SET region_code=1 WHERE function_id=200 AND ACTION IN(1,128,64,80); +UPDATE function_region_dict SET config_service_type='ratelimit',config_ip_port_show='1,2' ,config_ip_type='4,6,46,64,10',config_ip_pattern='1,2,3',config_port_pattern='1,2',config_direction='0,1',config_protocol='0,6,17' WHERE dict_id=53; +#音视频IP +UPDATE function_service_dict SET region_code=2 WHERE function_id=20 AND ACTION IN(1,16); +UPDATE function_region_dict SET config_ip_port_show='1,2' ,config_ip_type='4,6,46,64,10',config_ip_pattern='1,2,3',config_port_pattern='1,2',config_direction='0,1',config_protocol='0,6,17' WHERE dict_id=17; \ No newline at end of file diff --git a/src/main/resources/sql/字典修改记录.txt b/src/main/resources/sql/字典修改记录.txt index a8b991713..16b320e35 100644 --- a/src/main/resources/sql/字典修改记录.txt +++ b/src/main/resources/sql/字典修改记录.txt @@ -2,4 +2,11 @@ \u4FEE\u6539\u5B57\u5178LOG_STREAM_TYPE\uFF0C\u5C06\u6807\u8BC60\u30011\u30012\u6539\u4E3A1\u30012\u30013 2018-08-03 -\u589E\u52A0\u5B57\u5178ATTACK_TYPE\uFF0C\u4F9D\u636E\u534F\u8BAE\u7EDF\u8BA1\u5DF2\u6709\u7C7B\u578B \uFF1AUDP-Flood: 1069 \uFF0CSYN-Flood: 1070 \ No newline at end of file +\u589E\u52A0\u5B57\u5178ATTACK_TYPE\uFF0C\u4F9D\u636E\u534F\u8BAE\u7EDF\u8BA1\u5DF2\u6709\u7C7B\u578B \uFF1AUDP-Flood: 1069 \uFF0CSYN-Flood: 1070 + +2018-08-20\uFF08do_log:0\u4E0D\u9700\u89811\u8BB0\u5F55\u6240\u6709\u65E5\u5FD72\u53EA\u8BB0\u5F55\u7ED3\u6784\u5316\u65E5\u5FD7\u3002\u9ED8\u8BA4\u662F2\uFF09 +\u65B0\u589E\u662F\u5426\u8BB0\u5F55\u65E5\u5FD7 DO_LOG +\u6807\u8BC6 \u503C describe \u662F\u5426\u53EF\u7528 \u662F\u5426\u53EF\u7EF4\u62A4 +0 no_log \u4E0D\u8BB0\u5F55\u65E5\u5FD7 \u662F \u662F +1 all_log \u8BB0\u5F55\u6240\u6709\u65E5\u5FD7 \u662F \u662F +2 framework_log \u53EA\u8BB0\u5F55\u7ED3\u6784\u5316\u65E5\u5FD7 \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/include/excel/importIp.jsp b/src/main/webapp/WEB-INF/include/excel/importIp.jsp index d14bb3fe1..d3ced21e2 100644 --- a/src/main/webapp/WEB-INF/include/excel/importIp.jsp +++ b/src/main/webapp/WEB-INF/include/excel/importIp.jsp @@ -2,7 +2,7 @@ <%@ include file="/WEB-INF/include/taglib.jsp"%> - -
-
- -
- - -
-
-
-
-
@@ -130,37 +114,20 @@
- - - - - - - - - - - - - - - -
-
- -
- - -
-
-
-
-
-
+
+
+ +
+ + +
+
+
+
diff --git a/src/main/webapp/WEB-INF/include/form/stringInfo.jsp b/src/main/webapp/WEB-INF/include/form/stringInfo.jsp index 38cf7c87b..bf3c6b0de 100644 --- a/src/main/webapp/WEB-INF/include/form/stringInfo.jsp +++ b/src/main/webapp/WEB-INF/include/form/stringInfo.jsp @@ -15,21 +15,6 @@
-
- -
- -
-
-
-
-
-
-
@@ -47,6 +32,8 @@
+
+
@@ -60,6 +47,60 @@
+
+
+ +
+ + +
+
+
+
+ +
+
+
+
+ +
+ + +
+
+
+
+
+
diff --git a/src/main/webapp/WEB-INF/include/header.jsp b/src/main/webapp/WEB-INF/include/header.jsp index d6aef8b4b..0032e71d5 100644 --- a/src/main/webapp/WEB-INF/include/header.jsp +++ b/src/main/webapp/WEB-INF/include/header.jsp @@ -92,9 +92,7 @@ - + diff --git a/src/main/webapp/WEB-INF/sitemesh3.xml b/src/main/webapp/WEB-INF/sitemesh3.xml index 805b54c1d..9402b88a5 100644 --- a/src/main/webapp/WEB-INF/sitemesh3.xml +++ b/src/main/webapp/WEB-INF/sitemesh3.xml @@ -30,6 +30,7 @@ + /articles/* diff --git a/src/main/webapp/WEB-INF/tags/sys/delRow.tag b/src/main/webapp/WEB-INF/tags/sys/delRow.tag index 9c152c94d..6dcd6b3ca 100644 --- a/src/main/webapp/WEB-INF/tags/sys/delRow.tag +++ b/src/main/webapp/WEB-INF/tags/sys/delRow.tag @@ -174,6 +174,8 @@ var checkboxes=$("#${id} ${value} tbody tr td input.i-checks:checkbox"); } if(url.indexOf("?isAudit") > 1){ loading(''); + }else if(url.indexOf("export") > 1){ + closeTip(); } //$("#searchForm").submit(); } @@ -236,12 +238,14 @@ var checkboxes=$("#${id} ${value} tbody tr td input.i-checks:checkbox"); if(v=="ok"){ $("#searchForm").attr("action",url); $("#searchForm").submit(); + closeTip(); } },{buttonsFocus:1}); top.$('.jbox-body .jbox-icon').css('top','55px'); }else{ $("#searchForm").attr("action",url); $("#searchForm").submit(); + closeTip(); } } } diff --git a/src/main/webapp/WEB-INF/tags/sys/treeselect.tag b/src/main/webapp/WEB-INF/tags/sys/treeselect.tag index e2520f1d6..294d2d9d5 100644 --- a/src/main/webapp/WEB-INF/tags/sys/treeselect.tag +++ b/src/main/webapp/WEB-INF/tags/sys/treeselect.tag @@ -26,10 +26,9 @@ <%@ attribute name="showParentName" type="java.lang.String" required="false" description="显示父类名称"%> <%@ attribute name="checkedPS" type="java.lang.String" required="false" description="复选框选中时是否关联父子节点,ps关联父子,p关联父,s关联子,都不关联为空"%> <%@ attribute name="unCheckedPS" type="java.lang.String" required="false" description="复选框取消选中时是否关联父子节点,ps关联父子,p关联父,s关联子,都不关联为空"%> -<%@ attribute name="rootNodeName" type="java.lang.String" required="false" description="根节点显示的名称"%>
- " data-msg-required="${dataMsgRequired}" placeholder="${empty value?labelValue:value}" class="${cssClass}" style="${cssStyle} background-color:transparent"/>
@@ -50,7 +49,7 @@ ajaxData:{selectIds: $("#${id}Id").val()},buttons:{"":"ok", "":"clear","":true}, submit:function(v, h, f){ if (v == "ok"){ var tree = h.find("iframe")[0].contentWindow.tree;//h.find("iframe").contents(); - var ids = [], names = [], nodes = [],types =[]; + var ids = [], names = [], nodes = []; if ("${checked}" == "true"){ nodes = tree.getCheckedNodes(true); }else{ @@ -101,23 +100,32 @@ }// names.push(nodes[i].name); - if(nodes[i].type){ - types.push(nodes[i].type); - } + //if(nodes[i].type){ + // types.push(nodes[i].type); + //} // break; // 如果为非复选框选择,则返回第一个选择 } + + if((nodes.length==1)&&(nodes[0].level == 0)&&('true'=='${notAllowSelectRoot}')){ + top.$.jBox.tip("("+nodes[0].name+")"); + return false; + } $("#${id}Id").val(ids.join(",").replace(/u_/ig,"")); //if(types.length>0){ // $("#${id}Id").attr('cfgtype',types.join(",")); //} $("#${id}Id").change();//手动触发change事件,使Id的值得变化可以被监听到 $("#${id}Name").val(names.join(",")); + if(!$("#${id}Name").val()&&'${value}'){//如果值不存在,但是value却有值,将placeholder清空 + $("#${id}Name").attr("placeholder",""); + } }else if (v == "clear"){ $("#${id}Id").val(""); //$("#${id}Id").removeAttr('cfgtype'); $("#${id}Id").change();//手动触发change事件,使Id的值得变化可以被监听到 $("#${id}Name").val(""); + $("#${id}Name").attr("placeholder",""); } if(typeof ${id}TreeselectCallBack == 'function'){ ${id}TreeselectCallBack(v, h, f); diff --git a/src/main/webapp/WEB-INF/views/cfg/app/appByteCfgForm.jsp b/src/main/webapp/WEB-INF/views/cfg/app/appByteCfgForm.jsp index f6e35aded..c5edb169d 100644 --- a/src/main/webapp/WEB-INF/views/cfg/app/appByteCfgForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/app/appByteCfgForm.jsp @@ -74,20 +74,14 @@ $(function(){ - - - - - - -
+
-
-
- -
- -
-
-
-
-