Merge branch 'develop' of http://192.168.10.125/k18_web/NFS.git into develop
This commit is contained in:
@@ -56,6 +56,16 @@ public class InlineIp {
|
||||
private Date opTime;
|
||||
@Expose
|
||||
private Integer policyGroup;
|
||||
@Expose
|
||||
private String userRegion;//用于存储协议跟流量阀值
|
||||
|
||||
|
||||
public String getUserRegion() {
|
||||
return userRegion;
|
||||
}
|
||||
public void setUserRegion(String userRegion) {
|
||||
this.userRegion = userRegion;
|
||||
}
|
||||
/**
|
||||
* action
|
||||
* @return action
|
||||
|
||||
@@ -22,6 +22,28 @@ public class DdosIpCfg extends BaseIpCfg {
|
||||
*/
|
||||
private static final long serialVersionUID = -5446903784736960824L;
|
||||
|
||||
private String antiddosProtocol;//目前支持TCP_SYN, DNS, NTP,
|
||||
private Long bpsThreadshold;// 即DDoS攻击保护动作触发阈值,每秒Bit数和每秒包数
|
||||
private Long ppsThreadshold;
|
||||
|
||||
public String getAntiddosProtocol() {
|
||||
return antiddosProtocol;
|
||||
}
|
||||
public void setAntiddosProtocol(String antiddosProtocol) {
|
||||
this.antiddosProtocol = antiddosProtocol;
|
||||
}
|
||||
public Long getBpsThreadshold() {
|
||||
return bpsThreadshold;
|
||||
}
|
||||
public void setBpsThreadshold(Long bpsThreadshold) {
|
||||
this.bpsThreadshold = bpsThreadshold;
|
||||
}
|
||||
public Long getPpsThreadshold() {
|
||||
return ppsThreadshold;
|
||||
}
|
||||
public void setPpsThreadshold(Long ppsThreadshold) {
|
||||
this.ppsThreadshold = ppsThreadshold;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.nis.web.controller;
|
||||
import java.beans.PropertyEditorSupport;
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Field;
|
||||
import java.net.URLEncoder;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
@@ -2237,6 +2238,11 @@ public class BaseController {
|
||||
map.put("labels", labels);
|
||||
|
||||
String fileName = msgProp.getProperty(functionName, functionName)+"_"+DateUtils.getDate("yyyyMMddHHmmss")+".xlsx";
|
||||
if(request.getHeader("User-Agent").toUpperCase().indexOf("MSIE")>0){
|
||||
fileName = URLEncoder.encode(fileName, "UTF-8");
|
||||
}else{
|
||||
fileName = new String(fileName.getBytes("UTF-8"),"ISO8859-1");
|
||||
}
|
||||
new ExportExcel(msgProp,titleList,noExportMap,classMap,1).setDataList(msgProp,dataMap,map).write(response, fileName).dispose();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -456,4 +456,91 @@ public class FileTransferCfgController extends BaseController{
|
||||
}
|
||||
return "redirect:" + adminPath +"/ntc/fileTransfer/p2pList?functionId="+functionId;
|
||||
}
|
||||
|
||||
//ftp配置导出
|
||||
@RequestMapping(value = "exportftp")
|
||||
public void exportdns(Model model,HttpServletRequest request,HttpServletResponse response,
|
||||
@ModelAttribute("cfg")CfgIndexInfo entity,String ids,RedirectAttributes redirectAttributes){
|
||||
try {
|
||||
//export data info
|
||||
List<String> titleList=new ArrayList<String>();
|
||||
Map<String, Class<?>> classMap=new HashMap<String, Class<?>>();
|
||||
Map<String, List> dataMap=new HashMap<String, List>();
|
||||
Map<String, String> noExportMap=new HashMap<String, String>();
|
||||
|
||||
|
||||
/*//导出选中记录
|
||||
* if(!StringUtil.isEmpty(ids)){
|
||||
for(String id:ids.split(",")){
|
||||
Long.parseLong(id);
|
||||
}
|
||||
//List<CfgIndexInfo> list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids);
|
||||
}else{*/
|
||||
//条件导出数据大于最大导出数,只导出最大导出条数
|
||||
entity.setTableName(IpPortCfg.getTablename());
|
||||
Page<CfgIndexInfo> pageInfo=new Page<CfgIndexInfo>(request, response,"a");
|
||||
if(pageInfo.getCount()>Constants.MAX_EXPORT_SIZE){
|
||||
pageInfo.setPageNo(1);
|
||||
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||
}else{
|
||||
pageInfo.setPageNo(1);
|
||||
pageInfo.setPageSize(-1);
|
||||
}
|
||||
Page<CfgIndexInfo> page = fileTransferCfgService.getFtpList(pageInfo, entity);
|
||||
titleList.add(entity.getMenuNameCode());
|
||||
titleList.add("NTC_IP");
|
||||
titleList.add("NTC_FTP_URL");
|
||||
titleList.add("NTC_FTP_CONTENT");
|
||||
titleList.add("NTC_SUBSCRIBE_ID");
|
||||
classMap.put(entity.getMenuNameCode(), CfgIndexInfo.class);
|
||||
classMap.put("NTC_IP", IpPortCfg.class);
|
||||
classMap.put("NTC_FTP_URL", BaseStringCfg.class);
|
||||
classMap.put("NTC_FTP_CONTENT", BaseStringCfg.class);
|
||||
classMap.put("NTC_SUBSCRIBE_ID", NtcSubscribeIdCfg.class);
|
||||
|
||||
String cfgIndexInfoNoExport=",group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
String ipPortInfoNoExport=",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||
+",letter,whether_area_block,classification,attribute,label"
|
||||
+",userregion1,userregion2,userregion3,userregion4,userregion5,ir_type,group_name,";
|
||||
String ntcSubscribeIdCfgNoExport=",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||
+",letter,whether_area_block,classification,attribute,label"
|
||||
+",userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
String regionCfgNoExport=",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||
+",letter,whether_area_block,classification,attribute,label"
|
||||
+",userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
|
||||
noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport);
|
||||
noExportMap.put("NTC_IP", ipPortInfoNoExport);
|
||||
noExportMap.put("NTC_FTP_URL", regionCfgNoExport);
|
||||
noExportMap.put("NTC_FTP_CONTENT", regionCfgNoExport);
|
||||
noExportMap.put("NTC_SUBSCRIBE_ID", ntcSubscribeIdCfgNoExport);
|
||||
List<IpPortCfg> ipList=new ArrayList<IpPortCfg>();
|
||||
List<NtcSubscribeIdCfg> subscribeInfoList=new ArrayList<NtcSubscribeIdCfg>();
|
||||
List<BaseStringCfg> ftpkeyList=new ArrayList<BaseStringCfg>();
|
||||
List<BaseStringCfg> ftpurlList=new ArrayList<BaseStringCfg>();
|
||||
for (CfgIndexInfo cfg : page.getList()) {
|
||||
Map<String, List> maps=fileTransferCfgService.exportftp(cfg);
|
||||
ftpkeyList.addAll(maps.get("NTC_FTP_CONTENT"));
|
||||
ftpurlList.addAll(maps.get("NTC_FTP_URL"));
|
||||
ipList.addAll(maps.get("NTC_UNIVERSAL_IP"));
|
||||
subscribeInfoList.addAll(maps.get("NTC_SUBSCRIBE_ID"));
|
||||
}
|
||||
|
||||
dataMap.put(entity.getMenuNameCode(), page.getList());
|
||||
dataMap.put("NTC_IP", ipList);
|
||||
dataMap.put("NTC_FTP_URL", ftpurlList);
|
||||
dataMap.put("NTC_FTP_CONTENT", ftpkeyList);
|
||||
dataMap.put("NTC_SUBSCRIBE_ID", subscribeInfoList);
|
||||
/*}*/
|
||||
this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap);
|
||||
} catch (Exception e) {
|
||||
logger.error("ftp export failed",e);
|
||||
addMessage(redirectAttributes, "export_failed");
|
||||
}
|
||||
//return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -32,6 +32,7 @@ import com.nis.domain.configuration.NtcSubscribeIdCfg;
|
||||
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.web.controller.BaseController;
|
||||
@@ -174,4 +175,100 @@ public class MailCfgController extends BaseController{
|
||||
}
|
||||
return "redirect:" + adminPath +"/ntc/mail/mailList?functionId="+functionId;
|
||||
}
|
||||
|
||||
//mail配置导出
|
||||
@RequestMapping(value = "exportmail")
|
||||
public void exportdns(Model model,HttpServletRequest request,HttpServletResponse response,
|
||||
@ModelAttribute("cfg")CfgIndexInfo entity,String ids,RedirectAttributes redirectAttributes){
|
||||
try {
|
||||
//export data info
|
||||
List<String> titleList=new ArrayList<String>();
|
||||
Map<String, Class<?>> classMap=new HashMap<String, Class<?>>();
|
||||
Map<String, List> dataMap=new HashMap<String, List>();
|
||||
Map<String, String> noExportMap=new HashMap<String, String>();
|
||||
|
||||
|
||||
/*//导出选中记录
|
||||
* if(!StringUtil.isEmpty(ids)){
|
||||
for(String id:ids.split(",")){
|
||||
Long.parseLong(id);
|
||||
}
|
||||
//List<CfgIndexInfo> list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids);
|
||||
}else{*/
|
||||
//条件导出数据大于最大导出数,只导出最大导出条数
|
||||
entity.setTableName(IpPortCfg.getTablename());
|
||||
Page<CfgIndexInfo> pageInfo=new Page<CfgIndexInfo>(request, response,"a");
|
||||
if(pageInfo.getCount()>Constants.MAX_EXPORT_SIZE){
|
||||
pageInfo.setPageNo(1);
|
||||
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||
}else{
|
||||
pageInfo.setPageNo(1);
|
||||
pageInfo.setPageSize(-1);
|
||||
}
|
||||
Page<CfgIndexInfo> page = mailCfgService.getMailList(pageInfo, entity);
|
||||
titleList.add(entity.getMenuNameCode());
|
||||
String cfgIndexInfoNoExport=",group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
String ipPortInfoNoExport=",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||
+",letter,whether_area_block,classification,attribute,label"
|
||||
+",userregion1,userregion2,userregion3,userregion4,userregion5,ir_type,group_name,";
|
||||
String ntcSubscribeIdCfgNoExport=",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||
+",letter,whether_area_block,classification,attribute,label"
|
||||
+",userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
String regionCfgNoExport=",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||
+",letter,whether_area_block,classification,attribute,label"
|
||||
+",userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
if(entity.getFunctionId()!=null){
|
||||
if(entity.getFunctionId()!=37){
|
||||
titleList.add("NTC_IP");
|
||||
titleList.add("NTC_MAIL_BODY");
|
||||
|
||||
classMap.put("NTC_IP", IpPortCfg.class);
|
||||
classMap.put("NTC_MAIL_BODY", ComplexkeywordCfg.class);
|
||||
|
||||
noExportMap.put("NTC_IP", ipPortInfoNoExport);
|
||||
noExportMap.put("NTC_MAIL_BODY", regionCfgNoExport);
|
||||
|
||||
}
|
||||
}
|
||||
titleList.add("NTC_MAIL_HDR");
|
||||
titleList.add("NTC_SUBSCRIBE_ID");
|
||||
classMap.put(entity.getMenuNameCode(), CfgIndexInfo.class);
|
||||
classMap.put("NTC_MAIL_HDR", ComplexkeywordCfg.class);
|
||||
classMap.put("NTC_SUBSCRIBE_ID", NtcSubscribeIdCfg.class);
|
||||
noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport);
|
||||
noExportMap.put("NTC_MAIL_HDR", regionCfgNoExport);
|
||||
noExportMap.put("NTC_SUBSCRIBE_ID", ntcSubscribeIdCfgNoExport);
|
||||
List<IpPortCfg> ipList=new ArrayList<IpPortCfg>();
|
||||
List<NtcSubscribeIdCfg> subscribeInfoList=new ArrayList<NtcSubscribeIdCfg>();
|
||||
List<ComplexkeywordCfg> mailBodyList=new ArrayList<ComplexkeywordCfg>();
|
||||
List<ComplexkeywordCfg> mailReqHdrList=new ArrayList<ComplexkeywordCfg>();
|
||||
for (CfgIndexInfo cfg : page.getList()) {
|
||||
Map<String, List> maps=mailCfgService.exportmail(cfg);
|
||||
mailReqHdrList.addAll(maps.get("NTC_MAIL_HDR"));
|
||||
mailBodyList.addAll(maps.get("NTC_MAIL_BODY"));
|
||||
ipList.addAll(maps.get("NTC_UNIVERSAL_IP"));
|
||||
subscribeInfoList.addAll(maps.get("NTC_SUBSCRIBE_ID"));
|
||||
}
|
||||
if(entity.getFunctionId()!=null){
|
||||
if(entity.getFunctionId()!=37){
|
||||
dataMap.put("NTC_IP", ipList);
|
||||
dataMap.put("NTC_MAIL_BODY", mailBodyList);
|
||||
|
||||
}
|
||||
}
|
||||
dataMap.put(entity.getMenuNameCode(), page.getList());
|
||||
dataMap.put("NTC_MAIL_HDR", mailReqHdrList);
|
||||
dataMap.put("NTC_SUBSCRIBE_ID", subscribeInfoList);
|
||||
/*}*/
|
||||
this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap);
|
||||
} catch (Exception e) {
|
||||
logger.error("mail export failed",e);
|
||||
addMessage(redirectAttributes, "export_failed");
|
||||
}
|
||||
//return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -640,5 +640,83 @@ public class WebsiteController extends BaseController{
|
||||
}
|
||||
return "redirect:" + adminPath +"/ntc/website/httpList?functionId="+entity.getFunctionId();
|
||||
}
|
||||
|
||||
//dns配置导出
|
||||
@RequestMapping(value = "exportdns")
|
||||
public void exportdns(Model model,HttpServletRequest request,HttpServletResponse response,
|
||||
@ModelAttribute("cfg")CfgIndexInfo entity,String ids,RedirectAttributes redirectAttributes){
|
||||
try {
|
||||
//export data info
|
||||
List<String> titleList=new ArrayList<String>();
|
||||
Map<String, Class<?>> classMap=new HashMap<String, Class<?>>();
|
||||
Map<String, List> dataMap=new HashMap<String, List>();
|
||||
Map<String, String> noExportMap=new HashMap<String, String>();
|
||||
|
||||
|
||||
/*//导出选中记录
|
||||
* if(!StringUtil.isEmpty(ids)){
|
||||
for(String id:ids.split(",")){
|
||||
Long.parseLong(id);
|
||||
}
|
||||
//List<CfgIndexInfo> list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids);
|
||||
}else{*/
|
||||
//条件导出数据大于最大导出数,只导出最大导出条数
|
||||
entity.setTableName(IpPortCfg.getTablename());
|
||||
Page<CfgIndexInfo> pageInfo=new Page<CfgIndexInfo>(request, response,"a");
|
||||
if(pageInfo.getCount()>Constants.MAX_EXPORT_SIZE){
|
||||
pageInfo.setPageNo(1);
|
||||
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||
}else{
|
||||
pageInfo.setPageNo(1);
|
||||
pageInfo.setPageSize(-1);
|
||||
}
|
||||
Page<CfgIndexInfo> page = websiteCfgService.getWebsiteList(pageInfo, entity);
|
||||
titleList.add(entity.getMenuNameCode());
|
||||
titleList.add("NTC_IP");
|
||||
titleList.add("NTC_DNS_REGION");
|
||||
titleList.add("NTC_SUBSCRIBE_ID");
|
||||
classMap.put(entity.getMenuNameCode(), CfgIndexInfo.class);
|
||||
classMap.put("NTC_IP", IpPortCfg.class);
|
||||
classMap.put("NTC_DNS_REGION", ComplexkeywordCfg.class);
|
||||
classMap.put("NTC_SUBSCRIBE_ID", NtcSubscribeIdCfg.class);
|
||||
String cfgIndexInfoNoExport=",group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
String ipPortInfoNoExport=",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||
+",letter,whether_area_block,classification,attribute,label"
|
||||
+",userregion1,userregion2,userregion3,userregion4,userregion5,ir_type,group_name,";
|
||||
String ntcSubscribeIdCfgNoExport=",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||
+",letter,whether_area_block,classification,attribute,label"
|
||||
+",userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
String regionCfgNoExport=",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||
+",letter,whether_area_block,classification,attribute,label"
|
||||
+",userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport);
|
||||
noExportMap.put("NTC_IP", ipPortInfoNoExport);
|
||||
noExportMap.put("NTC_DNS_REGION", regionCfgNoExport);
|
||||
noExportMap.put("NTC_SUBSCRIBE_ID", ntcSubscribeIdCfgNoExport);
|
||||
List<IpPortCfg> ipList=new ArrayList<IpPortCfg>();
|
||||
List<NtcSubscribeIdCfg> subscribeInfoList=new ArrayList<NtcSubscribeIdCfg>();
|
||||
List<ComplexkeywordCfg> regionInfoList=new ArrayList<ComplexkeywordCfg>();
|
||||
for (CfgIndexInfo cfg : page.getList()) {
|
||||
CfgIndexInfo cfgIndexInfo=websiteCfgService.exportdns(cfg);
|
||||
ipList.addAll(cfgIndexInfo.getIpPortList());
|
||||
subscribeInfoList.addAll(cfgIndexInfo.getNtcSubscribeIdCfgList());
|
||||
regionInfoList.addAll(cfgIndexInfo.getDomainList());
|
||||
}
|
||||
dataMap.put(entity.getMenuNameCode(), page.getList());
|
||||
dataMap.put("NTC_IP", ipList);
|
||||
dataMap.put("NTC_DNS_REGION", regionInfoList);
|
||||
dataMap.put("NTC_SUBSCRIBE_ID", subscribeInfoList);
|
||||
|
||||
/*}*/
|
||||
this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap);
|
||||
} catch (Exception e) {
|
||||
logger.error("dns export failed",e);
|
||||
addMessage(redirectAttributes, "export_failed");
|
||||
}
|
||||
//return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -286,7 +286,7 @@ public class WhiteListController extends CommonController{
|
||||
titleList.add("NTC_IP");
|
||||
classMap.put(entity.getMenuNameCode(), CfgIndexInfo.class);
|
||||
classMap.put("NTC_IP", IpPortCfg.class);
|
||||
String cfgIndexInfoNoExport=",group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
String cfgIndexInfoNoExport=",do_log,letter,whether_area_block,classification,attribute,label,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
String ipPortInfoNoExport=",protocol,direction,do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||
+",letter,whether_area_block,classification,attribute,label"
|
||||
@@ -308,6 +308,61 @@ public class WhiteListController extends CommonController{
|
||||
}
|
||||
//return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||
}
|
||||
|
||||
//ip配置导出
|
||||
@RequestMapping(value = "exportdomain")
|
||||
public void exportdomain(Model model,HttpServletRequest request,HttpServletResponse response,
|
||||
@ModelAttribute("cfg")CfgIndexInfo entity,String ids,RedirectAttributes redirectAttributes){
|
||||
try {
|
||||
//export data info
|
||||
List<String> titleList=new ArrayList<String>();
|
||||
Map<String, Class<?>> classMap=new HashMap<String, Class<?>>();
|
||||
Map<String, List> dataMap=new HashMap<String, List>();
|
||||
Map<String, String> noExportMap=new HashMap<String, String>();
|
||||
|
||||
|
||||
/*//导出选中记录
|
||||
* if(!StringUtil.isEmpty(ids)){
|
||||
for(String id:ids.split(",")){
|
||||
Long.parseLong(id);
|
||||
}
|
||||
//List<CfgIndexInfo> list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids);
|
||||
}else{*/
|
||||
//条件导出数据大于最大导出数,只导出最大导出条数
|
||||
entity.setTableName(IpPortCfg.getTablename());
|
||||
Page<CfgIndexInfo> pageInfo=new Page<CfgIndexInfo>(request, response,"a");
|
||||
if(pageInfo.getCount()>Constants.MAX_EXPORT_SIZE){
|
||||
pageInfo.setPageNo(1);
|
||||
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||
}else{
|
||||
pageInfo.setPageNo(1);
|
||||
pageInfo.setPageSize(-1);
|
||||
}
|
||||
Page<CfgIndexInfo> page = domainService.getDomainList(pageInfo, entity);
|
||||
titleList.add(entity.getMenuNameCode());
|
||||
titleList.add("NTC_HTTP_URL");
|
||||
classMap.put(entity.getMenuNameCode(), CfgIndexInfo.class);
|
||||
classMap.put("NTC_HTTP_URL", HttpUrlCfg.class);
|
||||
String cfgIndexInfoNoExport=",do_log,letter,whether_area_block,classification,attribute,label,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
String httpUrlInfoNoExport=",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||
+",letter,whether_area_block,classification,attribute,label"
|
||||
+",userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport);
|
||||
noExportMap.put("NTC_HTTP_URL", httpUrlInfoNoExport);
|
||||
List<HttpUrlCfg> httpurlList=new ArrayList<HttpUrlCfg>();
|
||||
for (CfgIndexInfo cfg : page.getList()) {
|
||||
CfgIndexInfo cfgIndexInfo=domainService.exportDomainInfo(cfg);
|
||||
httpurlList.addAll(cfgIndexInfo.getHttpUrlList());
|
||||
}
|
||||
dataMap.put(entity.getMenuNameCode(), page.getList());
|
||||
dataMap.put("NTC_HTTP_URL", httpurlList);
|
||||
/*}*/
|
||||
this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap);
|
||||
} catch (Exception e) {
|
||||
logger.error("ip white export failed",e);
|
||||
addMessage(redirectAttributes, "export_failed");
|
||||
}
|
||||
//return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -59,6 +59,9 @@ public class DdosLogController extends BaseController{
|
||||
params.put("pageNo", page.getPageNo());
|
||||
if(entry!=null&&entry.getIsBlock()!=null) {
|
||||
params.put("searchIsBlock", entry.getIsBlock());
|
||||
}else {
|
||||
entry.setIsBlock(1);//默认保护ddos日志
|
||||
params.put("searchIsBlock", entry.getIsBlock());
|
||||
}
|
||||
//查询值判断
|
||||
initLogSearchValue(entry,params);
|
||||
|
||||
@@ -34,6 +34,9 @@
|
||||
<result column="function_id" property="functionId" jdbcType="INTEGER" />
|
||||
<result column="cfg_region_code" property="cfgRegionCode" jdbcType="INTEGER" />
|
||||
<result column="cfg_type" property="cfgType" jdbcType="VARCHAR" />
|
||||
<result column="antiddos_protocol" property="antiddosProtocol" jdbcType="VARCHAR" />
|
||||
<result column="bps_threadshold" property="bpsThreadshold" jdbcType="BIGINT" />
|
||||
<result column="pps_threadshold" property="ppsThreadshold" jdbcType="BIGINT" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="columns">
|
||||
@@ -42,7 +45,7 @@
|
||||
,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.cfg_region_code
|
||||
,r.area_effective_ids,r.function_id,r.cfg_region_code,r.antiddos_protocol,r.bps_threadshold,r.pps_threadshold
|
||||
</sql>
|
||||
|
||||
<select id="findPage" resultMap="ddosIpCfgMap">
|
||||
@@ -213,7 +216,10 @@
|
||||
dest_port,
|
||||
dest_ip_address,
|
||||
cfg_type,
|
||||
cfg_region_code
|
||||
cfg_region_code,
|
||||
antiddos_protocol,
|
||||
bps_threadshold,
|
||||
pps_threadshold
|
||||
)values (
|
||||
#{cfgDesc,jdbcType=VARCHAR},
|
||||
#{action,jdbcType=INTEGER},
|
||||
@@ -245,7 +251,10 @@
|
||||
#{destPort,jdbcType=VARCHAR},
|
||||
#{destIpAddress,jdbcType=VARCHAR},
|
||||
#{cfgType,jdbcType=VARCHAR},
|
||||
#{cfgRegionCode,jdbcType=INTEGER}
|
||||
#{cfgRegionCode,jdbcType=INTEGER},
|
||||
#{antiddosProtocol,jdbcType=VARCHAR},
|
||||
#{bpsThreadshold,jdbcType=BIGINT},
|
||||
#{ppsThreadshold,jdbcType=BIGINT}
|
||||
)
|
||||
</insert>
|
||||
|
||||
@@ -340,6 +349,9 @@
|
||||
<if test="cfgRegionCode != null " >
|
||||
cfg_region_code = #{cfgRegionCode,jdbcType=INTEGER},
|
||||
</if>
|
||||
antiddos_protocol = #{antiddosProtocol,jdbcType=VARCHAR},
|
||||
bps_threadshold = #{bpsThreadshold,jdbcType=BIGINT},
|
||||
pps_threadshold = #{ppsThreadshold,jdbcType=BIGINT}
|
||||
</trim>
|
||||
</set>
|
||||
<where>
|
||||
|
||||
@@ -909,61 +909,33 @@
|
||||
update cfg_index_info
|
||||
<set >
|
||||
<trim suffixOverrides=",">
|
||||
<if test="cfgDesc != null and cfgDesc != ''" >
|
||||
cfg_desc = #{cfgDesc,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="action != null" >
|
||||
action = #{action,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="doLog != null" >
|
||||
do_log = #{doLog,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="isValid != null" >
|
||||
is_valid = #{isValid,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="isAudit != null" >
|
||||
is_audit = #{isAudit,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="creatorId != null" >
|
||||
creator_id = #{creatorId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="createTime != null and createTime != ''" >
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="editorId != null" >
|
||||
editor_id = #{editorId,jdbcType=INTEGER},
|
||||
</if>
|
||||
edit_time = #{editTime,jdbcType=TIMESTAMP},
|
||||
<if test="serviceId != null" >
|
||||
service_id = #{serviceId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="requestId != null" >
|
||||
request_id = #{requestId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="isAreaEffective != null" >
|
||||
is_area_effective = #{isAreaEffective,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="classify != null and classify != ''" >
|
||||
classify = #{classify,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="attribute != null and attribute != ''" >
|
||||
attribute = #{attribute,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="lable != null and lable != ''" >
|
||||
lable = #{lable,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="areaEffectiveIds != null" >
|
||||
area_effective_ids = #{areaEffectiveIds,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="functionId != null" >
|
||||
function_id = #{functionId,jdbcType=INTEGER},
|
||||
</if>
|
||||
user_region1 = #{userRegion1,jdbcType=VARCHAR},
|
||||
user_region2 = #{userRegion2,jdbcType=VARCHAR},
|
||||
user_region3 = #{userRegion3,jdbcType=VARCHAR},
|
||||
user_region4 = #{userRegion4,jdbcType=VARCHAR},
|
||||
user_region5 = #{userRegion5,jdbcType=VARCHAR},
|
||||
dns_strategy_id = #{dnsStrategyId,jdbcType=INTEGER},
|
||||
editor_id = #{editorId,jdbcType=INTEGER},
|
||||
edit_time = #{editTime,jdbcType=TIMESTAMP},
|
||||
service_id = #{serviceId,jdbcType=INTEGER},
|
||||
request_id = #{requestId,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},
|
||||
user_region1 = #{userRegion1,jdbcType=VARCHAR},
|
||||
user_region2 = #{userRegion2,jdbcType=VARCHAR},
|
||||
user_region3 = #{userRegion3,jdbcType=VARCHAR},
|
||||
user_region4 = #{userRegion4,jdbcType=VARCHAR},
|
||||
user_region5 = #{userRegion5,jdbcType=VARCHAR},
|
||||
dns_strategy_id = #{dnsStrategyId,jdbcType=INTEGER},
|
||||
</trim>
|
||||
</set>
|
||||
where cfg_id = #{cfgId,jdbcType=BIGINT}
|
||||
|
||||
@@ -3,12 +3,15 @@ package com.nis.web.service.configuration;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.callback.InlineIp;
|
||||
import com.nis.domain.configuration.DdosIpCfg;
|
||||
@@ -123,11 +126,19 @@ public class DdosCfgService extends BaseService{
|
||||
ddosCfgDao.update(entity);
|
||||
|
||||
entity=ddosCfgDao.getDdosIpCfg(Long.valueOf(id));
|
||||
String antiddosProtocol = entity.getAntiddosProtocol();
|
||||
Long bpsThreadshold = entity.getBpsThreadshold();
|
||||
Long ppsThreadshold = entity.getPpsThreadshold();
|
||||
Map map= new HashMap();
|
||||
map.put("protocol", antiddosProtocol);
|
||||
map.put("bps_threadshold", bpsThreadshold);
|
||||
map.put("pps_threadshold", ppsThreadshold);
|
||||
|
||||
String json="";
|
||||
if(entity.getIsAudit()==1){
|
||||
List<InlineIp> ipList=new ArrayList<InlineIp>();
|
||||
InlineIp resStrategy=convertCallBackIp(entity,null);
|
||||
resStrategy.setUserRegion(new Gson().toJson(map));
|
||||
ipList.add(resStrategy);
|
||||
//调用服务接口下发配置数据
|
||||
json=gsonToJson(ipList);
|
||||
@@ -145,6 +156,7 @@ public class DdosCfgService extends BaseService{
|
||||
}else if(entity.getIsAudit()==3){
|
||||
List<InlineIp> resStrategyList=new ArrayList<>();
|
||||
InlineIp resStrategy=convertCallBackIp(entity,entity.getDnsStrategyId());
|
||||
resStrategy.setUserRegion(new Gson().toJson(map));
|
||||
resStrategyList.add(resStrategy);
|
||||
//调用服务接口取消配置
|
||||
json=gsonToJson(resStrategyList);
|
||||
|
||||
@@ -16,6 +16,7 @@ import com.nis.domain.configuration.AreaIpCfg;
|
||||
import com.nis.domain.configuration.BaseIpCfg;
|
||||
import com.nis.domain.configuration.CfgIndexInfo;
|
||||
import com.nis.domain.configuration.HttpUrlCfg;
|
||||
import com.nis.domain.configuration.IpPortCfg;
|
||||
import com.nis.domain.configuration.NtcSubscribeIdCfg;
|
||||
import com.nis.domain.maat.MaatCfg;
|
||||
import com.nis.domain.maat.MaatCfg.DigestCfg;
|
||||
@@ -23,6 +24,7 @@ import com.nis.domain.maat.MaatCfg.GroupCfg;
|
||||
import com.nis.domain.maat.MaatCfg.IpCfg;
|
||||
import com.nis.domain.maat.MaatCfg.NumBoundaryCfg;
|
||||
import com.nis.domain.maat.MaatCfg.StringCfg;
|
||||
import com.nis.domain.specific.ConfigGroupInfo;
|
||||
import com.nis.domain.maat.ToMaatBean;
|
||||
import com.nis.domain.maat.ToMaatResult;
|
||||
import com.nis.exceptions.MaatConvertException;
|
||||
@@ -666,4 +668,10 @@ public class DomainService extends CrudService<DomainDao,HttpUrlCfg> {
|
||||
page.setList(list);
|
||||
return page;
|
||||
}
|
||||
|
||||
public CfgIndexInfo exportDomainInfo(CfgIndexInfo entity){
|
||||
List<HttpUrlCfg> httpUrlList = websiteCfgDao.getHttpUrlList(entity);
|
||||
entity.setHttpUrlList(httpUrlList);
|
||||
return entity;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,6 +86,23 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
|
||||
entity.setStringList(keywordList);
|
||||
return entity;
|
||||
}
|
||||
|
||||
public Map<String, List> exportftp(CfgIndexInfo entity){
|
||||
Map<String, List> dataMap=new HashMap<String, List>();
|
||||
List<IpPortCfg> ipPortList = fileTransferCfgDao.getIpPortList(entity);
|
||||
entity.setCfgType("NTC_FTP_CONTENT");
|
||||
List<BaseStringCfg> keywordList = fileTransferCfgDao.getFtpKeywordList(entity);
|
||||
entity.setCfgType("NTC_FTP_URL");
|
||||
List<BaseStringCfg> urlwordList = fileTransferCfgDao.getFtpKeywordList(entity);
|
||||
List<NtcSubscribeIdCfg> subscribeIdList = stringCfgDao.findSubscribeIdCfgListByCfgIndexInfo(entity);
|
||||
dataMap.put("NTC_SUBSCRIBE_ID", subscribeIdList);
|
||||
dataMap.put("NTC_FTP_CONTENT", keywordList);
|
||||
dataMap.put("NTC_FTP_URL", urlwordList);
|
||||
dataMap.put("NTC_UNIVERSAL_IP", ipPortList);
|
||||
return dataMap;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 保存ftp配置
|
||||
* @param entity
|
||||
|
||||
@@ -20,6 +20,7 @@ import com.nis.domain.configuration.BaseStringCfg;
|
||||
import com.nis.domain.configuration.CfgIndexInfo;
|
||||
import com.nis.domain.configuration.ComplexkeywordCfg;
|
||||
import com.nis.domain.configuration.FileDigestCfg;
|
||||
import com.nis.domain.configuration.HttpBodyCfg;
|
||||
import com.nis.domain.configuration.IpPortCfg;
|
||||
import com.nis.domain.configuration.MailKeywordCfg;
|
||||
import com.nis.domain.configuration.NtcSubscribeIdCfg;
|
||||
@@ -79,6 +80,22 @@ public class MailCfgService extends CrudService<MailCfgDao,CfgIndexInfo> {
|
||||
entity.setAreaCfg(areaCfg);
|
||||
return entity;
|
||||
}
|
||||
|
||||
public Map<String, List> exportmail(CfgIndexInfo entity){
|
||||
Map<String, List> dataMap=new HashMap<String, List>();
|
||||
List<IpPortCfg> ipPortList = mailCfgDao.getIpPortList(entity);
|
||||
entity.setCfgType("NTC_MAIL_HDR");
|
||||
List<ComplexkeywordCfg> mailHdrList =mailCfgDao.getMailKeywordList(entity);
|
||||
entity.setCfgType("NTC_MAIL_BODY");
|
||||
List<ComplexkeywordCfg> mailBodyList = mailCfgDao.getMailKeywordList(entity);
|
||||
List<NtcSubscribeIdCfg> subscribeIdList = stringCfgDao.findSubscribeIdCfgListByCfgIndexInfo(entity);
|
||||
dataMap.put("NTC_SUBSCRIBE_ID", subscribeIdList);
|
||||
dataMap.put("NTC_MAIL_BODY", mailBodyList);
|
||||
dataMap.put("NTC_MAIL_HDR", mailHdrList);
|
||||
dataMap.put("NTC_UNIVERSAL_IP", ipPortList);
|
||||
return dataMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存mail配置
|
||||
* @param entity
|
||||
|
||||
@@ -33,6 +33,7 @@ import com.nis.domain.maat.MaatCfg.DigestCfg;
|
||||
import com.nis.domain.maat.MaatCfg.GroupCfg;
|
||||
import com.nis.domain.maat.MaatCfg.IpCfg;
|
||||
import com.nis.domain.maat.MaatCfg.StringCfg;
|
||||
import com.nis.domain.specific.ConfigGroupInfo;
|
||||
import com.nis.exceptions.MaatConvertException;
|
||||
import com.nis.util.ConfigServiceUtil;
|
||||
import com.nis.util.Constants;
|
||||
@@ -99,6 +100,19 @@ public class WebsiteCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo> {
|
||||
|
||||
return dataMap;
|
||||
}
|
||||
|
||||
|
||||
public CfgIndexInfo exportdns(CfgIndexInfo entity){
|
||||
List<IpPortCfg> ipPortList = websiteCfgDao.getIpPortList(entity);
|
||||
List<ComplexkeywordCfg> domainList = websiteCfgDao.getDnsDomainList(entity);
|
||||
List<NtcSubscribeIdCfg> subscribeIdList = stringCfgDao.findSubscribeIdCfgListByCfgIndexInfo(entity);
|
||||
entity.setIpPortList(ipPortList);
|
||||
entity.setDomainList(domainList);
|
||||
entity.setNtcSubscribeIdCfgList(subscribeIdList);
|
||||
return entity;
|
||||
}
|
||||
|
||||
|
||||
public CfgIndexInfo getSslCfg(Long cfgId){
|
||||
CfgIndexInfo entity = websiteCfgDao.getCfgIndexInfo(cfgId);
|
||||
List<IpPortCfg> ipPortList = websiteCfgDao.getIpPortList(entity);
|
||||
|
||||
Reference in New Issue
Block a user