From 5c00167d76afa8280d1f9646f1ba3f44fce125c4 Mon Sep 17 00:00:00 2001 From: wangwei Date: Wed, 22 May 2019 19:57:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=AE=BF=E9=97=AE=E9=98=BB?= =?UTF-8?q?=E6=96=AD=E9=A1=B5=E9=9D=A2=E8=8F=9C=E5=8D=95;=E5=AE=8C?= =?UTF-8?q?=E5=96=84=E5=8A=AB=E6=8C=81=E3=80=81=E7=AD=96=E7=95=A5=E3=80=81?= =?UTF-8?q?=E6=B3=A8=E5=85=A5=E8=84=9A=E6=9C=AC=E3=80=81=E9=95=9C=E5=83=8F?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E8=8F=9C=E5=8D=95=E7=9B=B8=E5=85=B3=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../callback/ProxyFileHijackCfgAudit.java | 9 + .../ProxyFileInsertScriptCfgAudit.java | 10 + .../callback/ProxyFileResponsePageCfg.java | 63 +++ .../ProxyFileResponsePageCfgAudit.java | 106 +++++ .../callback/ProxyFileStrategyCfgAudit.java | 9 + .../ProxyFileTrafficMirrorCfgAudit.java | 9 + .../nis/web/controller/BaseController.java | 52 ++- .../proxy/FileResponsePageController.java | 222 ++++++++++ .../dao/configuration/ProxyFileHijackDao.xml | 19 + .../ProxyFileInsertScriptDao.xml | 19 + .../ProxyFileResponsePageDao.java | 25 ++ .../ProxyFileResponsePageDao.xml | 334 ++++++++++++++ .../configuration/ProxyFileStrategyDao.xml | 19 + .../ProxyFileTrafficMirrorDao.xml | 19 + .../java/com/nis/web/service/BaseService.java | 23 + .../configuration/CommonPolicyService.java | 28 +- .../ProxyFileResponsePageService.java | 135 ++++++ .../resources/messages/message_en.properties | 1 + .../resources/messages/message_ru.properties | 1 + .../messages/message_zh_CN.properties | 1 + src/main/resources/service/service_config.xml | 2 +- .../sql/20190521/add_menu_responsePage.sql | 8 + .../resources/sql/20190521/insert_dict.sql | 36 ++ src/main/webapp/WEB-INF/tags/sys/delRow.tag | 1 + .../views/cfg/proxy/fileHijack/form.jsp | 4 +- .../views/cfg/proxy/fileHijack/list.jsp | 3 + .../views/cfg/proxy/fileInsertScript/form.jsp | 13 +- .../views/cfg/proxy/fileInsertScript/list.jsp | 3 + .../views/cfg/proxy/fileResponsePage/form.jsp | 229 ++++++++++ .../views/cfg/proxy/fileResponsePage/list.jsp | 409 ++++++++++++++++++ .../views/cfg/proxy/fileStrategy/form.jsp | 4 +- .../views/cfg/proxy/fileStrategy/list.jsp | 4 + .../cfg/proxy/fileTrafficMirror/form.jsp | 2 +- .../cfg/proxy/fileTrafficMirror/list.jsp | 3 + .../1.11.0/localization/messages_en.js | 2 +- .../1.11.0/localization/messages_ru.js | 2 +- .../1.11.0/localization/messages_zh.js | 2 +- 37 files changed, 1807 insertions(+), 24 deletions(-) create mode 100644 src/main/java/com/nis/domain/callback/ProxyFileResponsePageCfg.java create mode 100644 src/main/java/com/nis/domain/callback/ProxyFileResponsePageCfgAudit.java create mode 100644 src/main/java/com/nis/web/controller/configuration/proxy/FileResponsePageController.java create mode 100644 src/main/java/com/nis/web/dao/configuration/ProxyFileResponsePageDao.java create mode 100644 src/main/java/com/nis/web/dao/configuration/ProxyFileResponsePageDao.xml create mode 100644 src/main/java/com/nis/web/service/configuration/ProxyFileResponsePageService.java create mode 100644 src/main/resources/sql/20190521/add_menu_responsePage.sql create mode 100644 src/main/resources/sql/20190521/insert_dict.sql create mode 100644 src/main/webapp/WEB-INF/views/cfg/proxy/fileResponsePage/form.jsp create mode 100644 src/main/webapp/WEB-INF/views/cfg/proxy/fileResponsePage/list.jsp diff --git a/src/main/java/com/nis/domain/callback/ProxyFileHijackCfgAudit.java b/src/main/java/com/nis/domain/callback/ProxyFileHijackCfgAudit.java index 670a752bc..72fe1d0b0 100644 --- a/src/main/java/com/nis/domain/callback/ProxyFileHijackCfgAudit.java +++ b/src/main/java/com/nis/domain/callback/ProxyFileHijackCfgAudit.java @@ -28,6 +28,15 @@ public class ProxyFileHijackCfgAudit { private String path; @Expose private String contentName; + @Expose + private Long opUser; + + public Long getOpUser() { + return opUser; + } + public void setOpUser(Long opUser) { + this.opUser = opUser; + } public String getContentName() { return contentName; diff --git a/src/main/java/com/nis/domain/callback/ProxyFileInsertScriptCfgAudit.java b/src/main/java/com/nis/domain/callback/ProxyFileInsertScriptCfgAudit.java index 87e5a0128..212896333 100644 --- a/src/main/java/com/nis/domain/callback/ProxyFileInsertScriptCfgAudit.java +++ b/src/main/java/com/nis/domain/callback/ProxyFileInsertScriptCfgAudit.java @@ -25,6 +25,16 @@ public class ProxyFileInsertScriptCfgAudit { private String format; @Expose private String path; + @Expose + private Long opUser; + + public Long getOpUser() { + return opUser; + } + public void setOpUser(Long opUser) { + this.opUser = opUser; + } + public Long getId() { return id; } diff --git a/src/main/java/com/nis/domain/callback/ProxyFileResponsePageCfg.java b/src/main/java/com/nis/domain/callback/ProxyFileResponsePageCfg.java new file mode 100644 index 000000000..ecaf10d31 --- /dev/null +++ b/src/main/java/com/nis/domain/callback/ProxyFileResponsePageCfg.java @@ -0,0 +1,63 @@ +package com.nis.domain.callback; + +import com.nis.domain.configuration.BaseCfg; +/** + * http代理文件策略 + * @author nanfang + * + */ +public class ProxyFileResponsePageCfg extends BaseCfg { + + private static final long serialVersionUID = -1989406217948847813L; + public final static String TABLE_NAME = "pxy_profile_response_pages";//对应表名 + private String indexTable = "pxy_profile_response_pages"; + private String fileDesc;//文件描述 + private String url;//文件保存的url + private String contentType;//内容类型,如text/html,取字典表contentType + private String md5;//文件md5值 + private Long contentLength;//文件长度 + + public String getIndexTable() { + return indexTable; + } + + public void setIndexTable(String indexTable) { + this.indexTable = indexTable; + } + + public ProxyFileResponsePageCfg() { + super(); + } + + public String getFileDesc() { + return fileDesc; + } + public void setFileDesc(String fileDesc) { + this.fileDesc = fileDesc; + } + public String getUrl() { + return url; + } + public void setUrl(String url) { + this.url = url; + } + public String getContentType() { + return contentType; + } + public void setContentType(String contentType) { + this.contentType = contentType; + } + public Long getContentLength() { + return contentLength; + } + public void setContentLength(Long contentLength) { + this.contentLength = contentLength; + } + public String getMd5() { + return md5; + } + public void setMd5(String md5) { + this.md5 = md5; + } + +} diff --git a/src/main/java/com/nis/domain/callback/ProxyFileResponsePageCfgAudit.java b/src/main/java/com/nis/domain/callback/ProxyFileResponsePageCfgAudit.java new file mode 100644 index 000000000..bd7feddf7 --- /dev/null +++ b/src/main/java/com/nis/domain/callback/ProxyFileResponsePageCfgAudit.java @@ -0,0 +1,106 @@ +package com.nis.domain.callback; + +import java.util.Date; + +import com.google.gson.annotations.Expose; + +public class ProxyFileResponsePageCfgAudit { + @Expose + private Long id; //compileId + @Expose + private Integer cfgId; //compileId + @Expose + private Integer action; + @Expose + private Integer service; + @Expose + private Integer isValid; + @Expose + private Date opTime; + @Expose + private String format; + @Expose + private Long contentLength; + @Expose + private String path; + @Expose + private Long profileId; + @Expose + private String profileName; + @Expose + private Long opUser; + + public Long getOpUser() { + return opUser; + } + public void setOpUser(Long opUser) { + this.opUser = opUser; + } + public Long getId() { + return id; + } + public void setId(Long id) { + this.id = id; + } + public Integer getCfgId() { + return cfgId; + } + public void setCfgId(Integer cfgId) { + this.cfgId = cfgId; + } + public Integer getAction() { + return action; + } + public void setAction(Integer action) { + this.action = action; + } + public Integer getService() { + return service; + } + public void setService(Integer service) { + this.service = service; + } + public Integer getIsValid() { + return isValid; + } + public void setIsValid(Integer isValid) { + this.isValid = isValid; + } + public Date getOpTime() { + return opTime; + } + public void setOpTime(Date opTime) { + this.opTime = opTime; + } + public String getFormat() { + return format; + } + public void setFormat(String format) { + this.format = format; + } + public Long getContentLength() { + return contentLength; + } + public void setContentLength(Long contentLength) { + this.contentLength = contentLength; + } + public String getPath() { + return path; + } + public void setPath(String path) { + this.path = path; + } + public Long getProfileId() { + return profileId; + } + public void setProfileId(Long profileId) { + this.profileId = profileId; + } + public String getProfileName() { + return profileName; + } + public void setProfileName(String profileName) { + this.profileName = profileName; + } + +} diff --git a/src/main/java/com/nis/domain/callback/ProxyFileStrategyCfgAudit.java b/src/main/java/com/nis/domain/callback/ProxyFileStrategyCfgAudit.java index f5b5d7144..3cec2e3dd 100644 --- a/src/main/java/com/nis/domain/callback/ProxyFileStrategyCfgAudit.java +++ b/src/main/java/com/nis/domain/callback/ProxyFileStrategyCfgAudit.java @@ -27,6 +27,15 @@ public class ProxyFileStrategyCfgAudit { private Long fileId; @Expose private String fileDesc; + @Expose + private Long opUser; + + public Long getOpUser() { + return opUser; + } + public void setOpUser(Long opUser) { + this.opUser = opUser; + } public Long getId() { return id; } diff --git a/src/main/java/com/nis/domain/callback/ProxyFileTrafficMirrorCfgAudit.java b/src/main/java/com/nis/domain/callback/ProxyFileTrafficMirrorCfgAudit.java index cbafbec67..7bfa5ff7d 100644 --- a/src/main/java/com/nis/domain/callback/ProxyFileTrafficMirrorCfgAudit.java +++ b/src/main/java/com/nis/domain/callback/ProxyFileTrafficMirrorCfgAudit.java @@ -26,6 +26,15 @@ public class ProxyFileTrafficMirrorCfgAudit { private List addrList; @Expose private String addrType; + @Expose + private Long opUser; + + public Long getOpUser() { + return opUser; + } + public void setOpUser(Long opUser) { + this.opUser = opUser; + } public Long getId() { return id; } diff --git a/src/main/java/com/nis/web/controller/BaseController.java b/src/main/java/com/nis/web/controller/BaseController.java index 745aebba9..dde72d574 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.domain.basics.ServiceDictInfo; import com.nis.domain.basics.SysDictInfo; import com.nis.domain.callback.ProxyFileHijackCfg; import com.nis.domain.callback.ProxyFileInsertScriptCfg; +import com.nis.domain.callback.ProxyFileResponsePageCfg; import com.nis.domain.callback.ProxyFileStrategyCfg; import com.nis.domain.callback.ProxyFileTrafficMirrorCfg; import com.nis.domain.configuration.AppComplexFeatureCfg; @@ -194,6 +195,7 @@ import com.nis.web.service.configuration.ManipulatPolicyService; import com.nis.web.service.configuration.NumCfgService; import com.nis.web.service.configuration.ProxyFileHijackService; import com.nis.web.service.configuration.ProxyFileInsertScriptService; +import com.nis.web.service.configuration.ProxyFileResponsePageService; import com.nis.web.service.configuration.ProxyFileStrategyService; import com.nis.web.service.configuration.ProxyFileTrafficMirrorService; import com.nis.web.service.configuration.PxyObjKeyringService; @@ -315,6 +317,8 @@ public class BaseController { @Autowired protected ProxyFileInsertScriptService proxyFileInsertScriptService;//注入脚本文件service @Autowired + protected ProxyFileResponsePageService proxyFileResponsePageService;//阻断访问页面 + @Autowired protected ProxyFileTrafficMirrorService proxyFileTrafficMirrorService;//注入流量镜像文件ervice @Autowired protected AppBuiltInFeatureService appBuiltInFeatureService;// 拦截策略service @@ -2803,6 +2807,7 @@ public class BaseController { ProxyFileInsertScriptCfg searFileInsertScriptCfg = new ProxyFileInsertScriptCfg(); ProxyFileTrafficMirrorCfg searFileTrafficMirrorCfg = new ProxyFileTrafficMirrorCfg(); ProxyFileStrategyCfg searFileStrategyCfg = new ProxyFileStrategyCfg(); + ProxyFileResponsePageCfg searFileResponsePageCfg = new ProxyFileResponsePageCfg(); if(entity != null && (entity instanceof CfgIndexInfo)) { BeanUtils.copyProperties(entity, auditBatchCfg); BeanUtils.copyProperties(entity, searchCfg); @@ -2891,6 +2896,9 @@ public class BaseController { }if(entity != null && (entity instanceof ProxyFileStrategyCfg)){ BeanUtils.copyProperties(entity, auditBatchCfg); BeanUtils.copyProperties(entity, searFileStrategyCfg); + }if(entity != null && (entity instanceof ProxyFileResponsePageCfg)){ + BeanUtils.copyProperties(entity, auditBatchCfg); + BeanUtils.copyProperties(entity, searFileResponsePageCfg); } @@ -2972,6 +2980,8 @@ public class BaseController { searFileTrafficMirrorCfg.setTableName(tableNameXml); searFileStrategyCfg.setServiceId(Integer.valueOf(serviceIdXml)); searFileStrategyCfg.setTableName(tableNameXml); + searFileResponsePageCfg.setServiceId(Integer.valueOf(serviceIdXml)); + searFileResponsePageCfg.setTableName(tableNameXml); if("1".equals(serviceTypeXml)){//maat类配置 // 存放域配置类型 及 对应表名 @@ -3371,7 +3381,8 @@ public class BaseController { , searFileHijackCfg , searFileInsertScriptCfg , searFileTrafficMirrorCfg - , searFileStrategyCfg); + , searFileStrategyCfg + , searFileResponsePageCfg); } } } @@ -3455,6 +3466,7 @@ public class BaseController { ProxyFileInsertScriptCfg searchFileInsertScriptCfg = new ProxyFileInsertScriptCfg(); ProxyFileTrafficMirrorCfg searchFileTrafficMirrorCfg = new ProxyFileTrafficMirrorCfg(); ProxyFileStrategyCfg searchFileStrategyCfg = new ProxyFileStrategyCfg(); + ProxyFileResponsePageCfg searchFileResponsePageCfg = new ProxyFileResponsePageCfg(); // 传递检索条件 if(entity != null && (entity instanceof CfgIndexInfo)) { @@ -3537,6 +3549,9 @@ public class BaseController { }if(entity != null && (entity instanceof ProxyFileStrategyCfg)){ BeanUtils.copyProperties(entity, searchFileStrategyCfg); searchFileStrategyCfg.setFunctionId(functionId); + }if(entity != null && (entity instanceof ProxyFileResponsePageCfg)){ + BeanUtils.copyProperties(entity, searchFileResponsePageCfg); + searchFileResponsePageCfg.setFunctionId(functionId); } BaseCfg batchCfg = new BaseCfg(); @@ -3812,6 +3827,19 @@ public class BaseController { } } + }else if("pxy_profile_response_pages".equals(tableNameXml)) { + boolean hasData = true; + while(hasData){ + page.setPageNo(1); + page.setLastPage(false); + List list = proxyFileResponsePageService.findPage(page,searchFileResponsePageCfg).getList(); + if(!StringUtil.isEmpty(list)){ + hasData = commonPolicyService.batchDeleteMaatData(cfgList, page, batchCfg, list, hasData); + }else{ + hasData = false; + } + } + }else { boolean hasData = true; while(hasData){ @@ -3952,7 +3980,8 @@ public class BaseController { ,ProxyFileHijackCfg searFileHijackCfg ,ProxyFileInsertScriptCfg searFileInsertScriptCfg ,ProxyFileTrafficMirrorCfg searFileTrafficMirrorCfg - ,ProxyFileStrategyCfg searFileStrategyCfg) { + ,ProxyFileStrategyCfg searFileStrategyCfg + ,ProxyFileResponsePageCfg searFileResponsePageCfg) { ToMaatBean maatBean; MaatCfg maatCfg; List configCompileList; @@ -4079,6 +4108,25 @@ public class BaseController { notAuditList.add(cfg); } } + }else if(className.equals("ProxyFileResponsePageCfg")){ + list = proxyFileResponsePageService.findPage(page, searFileResponsePageCfg).getList(); + for(int i=0;i page = proxyFileResponsePageService.findPage(new Page(request, response,"a"), cfg); + model.addAttribute("page", page); + model.addAttribute("cfg", cfg); + initPageCondition(model); + return "/cfg/proxy/fileResponsePage/list"; + } + + @RequestMapping(value = {"form"}) + @RequiresPermissions(value={"proxy:fileResponsePage:config"}) + public String fileform(Model model,HttpServletRequest request + ,HttpServletResponse response + ,@ModelAttribute("cfg")ProxyFileResponsePageCfg cfg + ,String ids + ,RedirectAttributes redirectAttributes) { + if(!StringUtil.isEmpty(ids)){ + cfg = proxyFileResponsePageService.getCfgById(Long.valueOf(ids)); + } +// initFormCondition(model); + initFormCondition(model, cfg); + model.addAttribute("_cfg", cfg); + return "/cfg/proxy/fileResponsePage/form"; + } + + /** + * 保存 文件 + * 1、将文件上传到 service 接口 + * 2、将文件信息及 1返回的结果 保存到数据库 + * @param model + * @param request + * @param response + * @param cfgFile + * @param cfg + * @param redirectAttributes + * @return + */ + @RequiresPermissions(value={"proxy:fileResponsePage:config"}) + @RequestMapping(value = {"saveOrUpdate"}) + public String saveOrUpdate(Model model,HttpServletRequest request + ,HttpServletResponse response,MultipartFile cfgFile, + @ModelAttribute("cfg")ProxyFileResponsePageCfg cfg, + RedirectAttributes redirectAttributes){ + File file = null; + try{ + if(cfgFile != null) { + String filename = cfgFile.getOriginalFilename(); + String prefix = FileUtils.getPrefix(filename, false); + String suffix = FileUtils.getSuffix(filename, false); + file = File.createTempFile("file_"+ prefix, suffix); + cfgFile.transferTo(file);//复制文件 + String md5 = FileUtils.getFileMD5(file); + Map srcMap = Maps.newHashMap(); + srcMap.put("filetype", suffix); + srcMap.put("datatype", "dbSystem");//源文件存入数据中心 + srcMap.put("createTime",new Date()); + srcMap.put("key",prefix); + srcMap.put("fileName", filename); + srcMap.put("checksum", md5); + ToMaatResult result = ConfigServiceUtil.postFileCfg(null, file, JsonMapper.toJsonString(srcMap)); + logger.info("http 重定向阻断文件上传响应信息:"+JsonMapper.toJsonString(result)); + String srcAccessUrl = null; + if(!StringUtil.isEmpty(result)){ + ResponseData data = result.getData(); + srcAccessUrl=data.getAccessUrl(); + cfg.setUrl(srcAccessUrl);; + } + cfg.setMd5(md5);//文件md5值 + cfg.setContentLength(file.length());//文件长度 + } + proxyFileResponsePageService.saveOrUpdate(cfg); + //配置仅保存 + if(StringUtil.isEmpty(cfg.getIsValid()) || cfg.getIsValid()!=1) { + addMessage(redirectAttributes, "success", "save_success"); + }else { + //配置直接生效 + addMessage(redirectAttributes, "success", "audit_success"); + } + addMessage(redirectAttributes,"success","save_success"); + }catch(Exception e){ + logger.error("信息保存失败",e); + if(e instanceof MaatConvertException) { + addMessage(redirectAttributes,"error","request_service_failed"); + LogUtils.saveLog(request, null, e, null); + }else { + addMessage(redirectAttributes,"error","save_failed"); + LogUtils.saveLog(request, null, e, null); + } + }finally { + if(file != null) { + file.delete();//删除临时文件 + } + } + + return "redirect:" + adminPath +"/proxy/fileResponsePage/list?functionId="+cfg.getFunctionId(); + } + + @RequestMapping(value = {"delete"}) + @RequiresPermissions(value={"proxy:fileResponsePage:config"}) + public String delete(Integer isAudit, Integer isValid, String ids, Integer functionId, Model model, @ModelAttribute("cfg")ProxyFileResponsePageCfg cfg, + HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes){ + try { + if (!StringUtil.isEmpty(ids)) { + proxyFileResponsePageService.update(isAudit, isValid, ids, functionId); + addMessage(redirectAttributes, "success", "delete_success"); + }else { + // 批量删除 + Page searchPage = new Page(request, response, "a"); + deleteAll(searchPage, functionId, cfg); + } + } catch (Exception e) { + logger.error("配置删除失败:", e); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + LogUtils.saveLog(request, null, e, null); + } else { + addMessage(redirectAttributes, "error", "delete_failed"); + LogUtils.saveLog(request, null, e, null); + } + + } + return "redirect:" + adminPath +"/proxy/fileResponsePage/list?functionId="+functionId; + } + + + @RequestMapping(value = {"audit"}) + @RequiresPermissions(value={"proxy:fileResponsePage:confirm"}) + public String audit(Model model, @ModelAttribute("cfg") ProxyFileResponsePageCfg cfg, Integer isValid, Integer isAudit, + String ids, Integer functionId, RedirectAttributes redirectAttributes, HttpServletResponse response, + HttpServletRequest request) { + if (!StringUtil.isEmpty(ids)) { + String[] idArray = ids.split(","); + for (String id : idArray) { + try { + proxyFileResponsePageService.audit(isAudit, isValid, functionId, id); + addMessage(redirectAttributes, "success", "audit_success"); + } catch (MaatConvertException e) { + logger.error(e); + addMessage(redirectAttributes, "error", "request_service_failed"); + LogUtils.saveLog(request, null, e, null); + } catch (Exception e) { + logger.error(e); + addMessage(redirectAttributes, "error", "audit_failed"); + LogUtils.saveLog(request, null, e, null); + } + } + + } else { + Page searchPage = new Page(request, response, "a"); + Page auditPage = new Page(request, response, "a"); + + try { + BeanUtils.copyProperties(searchPage, auditPage); + auditAll(auditPage, isValid, cfg); + addMessage(redirectAttributes, "success", "audit_success"); + } catch (Exception e) { + logger.error("配置下发失败:", e); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + LogUtils.saveLog(request, null, e, null); + } else { + addMessage(redirectAttributes, "error", "audit_failed"); + LogUtils.saveLog(request, null, e, null); + } + + } + + return fileResponsePageList(cfg, model, request, response); + } + return "redirect:" + adminPath +"/proxy/fileResponsePage/list?functionId="+functionId; + } +} diff --git a/src/main/java/com/nis/web/dao/configuration/ProxyFileHijackDao.xml b/src/main/java/com/nis/web/dao/configuration/ProxyFileHijackDao.xml index 5886a2b8b..e7dab4156 100644 --- a/src/main/java/com/nis/web/dao/configuration/ProxyFileHijackDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/ProxyFileHijackDao.xml @@ -117,6 +117,25 @@ AND a.COMPILE_ID=#{compileId,jdbcType=INTEGER} + + + + AND a.COMPILE_ID >= #{item,jdbcType=INTEGER} + + + AND a.COMPILE_ID <= #{item,jdbcType=INTEGER} + + + + + AND a.COMPILE_ID in + + #{id} + + + + AND a.COMPILE_ID=#{compileIdNew,jdbcType=INTEGER} + AND a.IS_AREA_EFFECTIVE=#{isAreaEffective,jdbcType=INTEGER} diff --git a/src/main/java/com/nis/web/dao/configuration/ProxyFileInsertScriptDao.xml b/src/main/java/com/nis/web/dao/configuration/ProxyFileInsertScriptDao.xml index 285c51c48..c782efba2 100644 --- a/src/main/java/com/nis/web/dao/configuration/ProxyFileInsertScriptDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/ProxyFileInsertScriptDao.xml @@ -117,6 +117,25 @@ AND a.COMPILE_ID=#{compileId,jdbcType=INTEGER} + + + + AND a.COMPILE_ID >= #{item,jdbcType=INTEGER} + + + AND a.COMPILE_ID <= #{item,jdbcType=INTEGER} + + + + + AND a.COMPILE_ID in + + #{id} + + + + AND a.COMPILE_ID=#{compileIdNew,jdbcType=INTEGER} + AND a.IS_AREA_EFFECTIVE=#{isAreaEffective,jdbcType=INTEGER} diff --git a/src/main/java/com/nis/web/dao/configuration/ProxyFileResponsePageDao.java b/src/main/java/com/nis/web/dao/configuration/ProxyFileResponsePageDao.java new file mode 100644 index 000000000..17c1148df --- /dev/null +++ b/src/main/java/com/nis/web/dao/configuration/ProxyFileResponsePageDao.java @@ -0,0 +1,25 @@ +package com.nis.web.dao.configuration; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.nis.domain.callback.ProxyFileResponsePageCfg; +import com.nis.web.dao.MyBatisDao; + + +/** + * 特定协议相关配置数据处理类 + * @author dell + * + */ +@MyBatisDao +public interface ProxyFileResponsePageDao { + + public List findPage(ProxyFileResponsePageCfg entity) ; + public ProxyFileResponsePageCfg getCfgById(@Param("cfgId")Long cfgId); + public void insert(ProxyFileResponsePageCfg entity); + public void update(ProxyFileResponsePageCfg entity); + + +} diff --git a/src/main/java/com/nis/web/dao/configuration/ProxyFileResponsePageDao.xml b/src/main/java/com/nis/web/dao/configuration/ProxyFileResponsePageDao.xml new file mode 100644 index 000000000..f97457041 --- /dev/null +++ b/src/main/java/com/nis/web/dao/configuration/ProxyFileResponsePageDao.xml @@ -0,0 +1,334 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + a.CFG_ID,a.CFG_DESC,a.ACTION,a.IS_VALID,a.IS_AUDIT, + a.CREATOR_ID,a.CREATE_TIME,a.EDITOR_ID,a.EDIT_TIME,a.AUDITOR_ID,a.AUDIT_TIME, + a.SERVICE_ID,a.REQUEST_ID,a.COMPILE_ID,a.IS_AREA_EFFECTIVE,a.CLASSIFY, + a.ATTRIBUTE,a.LABLE,a.AREA_EFFECTIVE_IDS,a.function_id,a.cfg_type,a.cfg_region_code, + a.FILE_DESC,a.URL,a.CONTENT_TYPE,a.CONTENT_LENGTH,a.MD5 + + + + + + + + + + + + SELECT LAST_INSERT_ID() + + insert into pxy_profile_response_pages ( + 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_type, + cfg_region_code, + + file_desc, + url, + content_type, + content_length, + md5 + )values ( + #{cfgDesc,jdbcType=VARCHAR}, + #{action,jdbcType=INTEGER}, + #{isValid,jdbcType=INTEGER}, + #{isAudit,jdbcType=INTEGER}, + #{creatorId,jdbcType=INTEGER}, + #{createTime,jdbcType=TIMESTAMP}, + #{editorId,jdbcType=INTEGER}, + #{editTime,jdbcType=TIMESTAMP}, + #{auditorId,jdbcType=INTEGER}, + #{auditTime,jdbcType=TIMESTAMP}, + #{serviceId,jdbcType=INTEGER}, + #{requestId,jdbcType=INTEGER}, + #{compileId,jdbcType=INTEGER}, + #{isAreaEffective,jdbcType=INTEGER}, + #{classify,jdbcType=VARCHAR}, + #{attribute,jdbcType=VARCHAR}, + #{lable,jdbcType=VARCHAR}, + #{areaEffectiveIds,jdbcType=VARCHAR}, + #{functionId,jdbcType=INTEGER}, + #{cfgType,jdbcType=VARCHAR}, + #{cfgRegionCode,jdbcType=INTEGER}, + + #{fileDesc,jdbcType=VARCHAR}, + #{url,jdbcType=VARCHAR}, + #{contentType,jdbcType=VARCHAR}, + #{contentLength,jdbcType=INTEGER}, + #{md5,jdbcType=VARCHAR} + ) + + + + + update pxy_profile_response_pages + + + cfg_desc = #{cfgDesc,jdbcType=VARCHAR}, + + + 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}, + + + 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}, + + + cfg_region_code = #{cfgRegionCode,jdbcType=INTEGER}, + + + cfg_type = #{cfgType,jdbcType=VARCHAR}, + + + + file_desc = #{fileDesc ,jdbcType=VARCHAR}, + + + url = #{url ,jdbcType=VARCHAR}, + + + content_type = #{contentType ,jdbcType=VARCHAR}, + + + content_length = #{contentLength ,jdbcType=BIGINT}, + + + md5 = #{md5 ,jdbcType=VARCHAR}, + + + where cfg_id = #{cfgId,jdbcType=BIGINT} + + + + + \ No newline at end of file diff --git a/src/main/java/com/nis/web/dao/configuration/ProxyFileStrategyDao.xml b/src/main/java/com/nis/web/dao/configuration/ProxyFileStrategyDao.xml index 8a4c17d25..841eb2166 100644 --- a/src/main/java/com/nis/web/dao/configuration/ProxyFileStrategyDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/ProxyFileStrategyDao.xml @@ -119,6 +119,25 @@ AND a.COMPILE_ID=#{compileId,jdbcType=INTEGER} + + + + AND a.COMPILE_ID >= #{item,jdbcType=INTEGER} + + + AND a.COMPILE_ID <= #{item,jdbcType=INTEGER} + + + + + AND a.COMPILE_ID in + + #{id} + + + + AND a.COMPILE_ID=#{compileIdNew,jdbcType=INTEGER} + AND a.IS_AREA_EFFECTIVE=#{isAreaEffective,jdbcType=INTEGER} diff --git a/src/main/java/com/nis/web/dao/configuration/ProxyFileTrafficMirrorDao.xml b/src/main/java/com/nis/web/dao/configuration/ProxyFileTrafficMirrorDao.xml index 0f27747cb..96503b280 100644 --- a/src/main/java/com/nis/web/dao/configuration/ProxyFileTrafficMirrorDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/ProxyFileTrafficMirrorDao.xml @@ -116,6 +116,25 @@ AND a.COMPILE_ID=#{compileId,jdbcType=INTEGER} + + + + AND a.COMPILE_ID >= #{item,jdbcType=INTEGER} + + + AND a.COMPILE_ID <= #{item,jdbcType=INTEGER} + + + + + AND a.COMPILE_ID in + + #{id} + + + + AND a.COMPILE_ID=#{compileIdNew,jdbcType=INTEGER} + AND a.IS_AREA_EFFECTIVE=#{isAreaEffective,jdbcType=INTEGER} diff --git a/src/main/java/com/nis/web/service/BaseService.java b/src/main/java/com/nis/web/service/BaseService.java index bb62d0a83..7de689150 100644 --- a/src/main/java/com/nis/web/service/BaseService.java +++ b/src/main/java/com/nis/web/service/BaseService.java @@ -58,6 +58,8 @@ import com.nis.domain.callback.ProxyFileHijackCfg; import com.nis.domain.callback.ProxyFileHijackCfgAudit; import com.nis.domain.callback.ProxyFileInsertScriptCfg; import com.nis.domain.callback.ProxyFileInsertScriptCfgAudit; +import com.nis.domain.callback.ProxyFileResponsePageCfg; +import com.nis.domain.callback.ProxyFileResponsePageCfgAudit; import com.nis.domain.callback.ProxyFileStrategyCfg; import com.nis.domain.callback.ProxyFileStrategyCfgAudit; import com.nis.domain.callback.ProxyFileTrafficMirrorCfg; @@ -3198,6 +3200,7 @@ public abstract class BaseService { hijackTemp.setService(cfg.getServiceId()); hijackTemp.setIsValid(cfg.getIsValid()); hijackTemp.setOpTime(cfg.getAuditTime()); + hijackTemp.setOpUser(UserUtils.getUser().getId()); return hijackTemp; } //注入脚本文件 @@ -3213,6 +3216,7 @@ public abstract class BaseService { fileInsertScriptTemp.setService(cfg.getServiceId()); fileInsertScriptTemp.setIsValid(cfg.getIsValid()); fileInsertScriptTemp.setOpTime(cfg.getAuditTime()); + fileInsertScriptTemp.setOpUser(UserUtils.getUser().getId()); return fileInsertScriptTemp; } //流量转发目的地址 @@ -3228,6 +3232,7 @@ public abstract class BaseService { fileTemp.setService(cfg.getServiceId()); fileTemp.setIsValid(cfg.getIsValid()); fileTemp.setOpTime(cfg.getAuditTime()); + fileTemp.setOpUser(UserUtils.getUser().getId()); return fileTemp; } //文件策略 @@ -3244,6 +3249,24 @@ public abstract class BaseService { fileTemp.setFilePath(cfg.getUrl()); fileTemp.setIsValid(cfg.getIsValid()); fileTemp.setOpTime(cfg.getAuditTime()); + fileTemp.setOpUser(UserUtils.getUser().getId()); + return fileTemp; + } + //访问阻断页面 + public static ProxyFileResponsePageCfgAudit convertCallBackProxyFileResponsePage(ProxyFileResponsePageCfg cfg) { + ProxyFileResponsePageCfgAudit fileTemp = new ProxyFileResponsePageCfgAudit(); + fileTemp.setId(Long.valueOf(cfg.getCompileId())); + fileTemp.setCfgId(cfg.getCompileId()); + fileTemp.setProfileId((Long.valueOf(cfg.getCompileId()))); + fileTemp.setProfileName(keywordsEscape(cfg.getFileDesc())); + fileTemp.setFormat(cfg.getContentType()); + fileTemp.setContentLength(cfg.getContentLength()); + fileTemp.setAction(cfg.getAction()); + fileTemp.setService(cfg.getServiceId()); + fileTemp.setPath(cfg.getUrl()); + fileTemp.setIsValid(cfg.getIsValid()); + fileTemp.setOpTime(cfg.getAuditTime()); + fileTemp.setOpUser(UserUtils.getUser().getId()); return fileTemp; } diff --git a/src/main/java/com/nis/web/service/configuration/CommonPolicyService.java b/src/main/java/com/nis/web/service/configuration/CommonPolicyService.java index 959371313..849619cd9 100644 --- a/src/main/java/com/nis/web/service/configuration/CommonPolicyService.java +++ b/src/main/java/com/nis/web/service/configuration/CommonPolicyService.java @@ -17,6 +17,8 @@ import com.nis.domain.callback.ProxyFileHijackCfg; import com.nis.domain.callback.ProxyFileHijackCfgAudit; import com.nis.domain.callback.ProxyFileInsertScriptCfg; import com.nis.domain.callback.ProxyFileInsertScriptCfgAudit; +import com.nis.domain.callback.ProxyFileResponsePageCfg; +import com.nis.domain.callback.ProxyFileResponsePageCfgAudit; import com.nis.domain.callback.ProxyFileStrategyCfg; import com.nis.domain.callback.ProxyFileStrategyCfgAudit; import com.nis.domain.callback.ProxyFileTrafficMirrorCfg; @@ -405,12 +407,21 @@ public class CommonPolicyService extends CrudService 0) { notAuditList = convertList; } + }else if(entity.getServiceId().equals(646)) { // 访问阻断页面 + List convertList = Lists.newArrayList(); + for (Object object : notAuditList) { + ProxyFileResponsePageCfg cfg = (ProxyFileResponsePageCfg)object; + convertList.add(BaseService.convertCallBackProxyFileResponsePage(cfg)); + } + if(convertList.size() > 0) { + notAuditList = convertList; + } } // 格式转换 --> //调用服务接口下发配置数据 String json=gsonToJson(notAuditList); - //logger.warn("批量下发配置参数:"+json); + logger.debug("批量下发配置参数:"+json); //调用服务接口下发配置 ToMaatResult result = ConfigServiceUtil.postCallbackCfg(json); logger.warn("批量下发响应信息:"+result.getMsg()); @@ -496,19 +507,28 @@ public class CommonPolicyService extends CrudService convertList = Lists.newArrayList(); - for (Object object : notAuditList) { + for (Object object : auditList) { ProxyFileStrategyCfg cfg = (ProxyFileStrategyCfg)object; convertList.add(BaseService.convertCallBackProxyFileStrategy(cfg)); } if(convertList.size() > 0) { - notAuditList = convertList; + auditList = convertList; + } + }else if(entity.getServiceId().equals(646)) { // 访问阻断页面 + List convertList = Lists.newArrayList(); + for (Object object : auditList) { + ProxyFileResponsePageCfg cfg = (ProxyFileResponsePageCfg)object; + convertList.add(BaseService.convertCallBackProxyFileResponsePage(cfg)); + } + if(convertList.size() > 0) { + auditList = convertList; } } // 格式转换 --> //调用服务接口取消配置 String json=gsonToJson(auditList); - //logger.warn("批量下发配置参数:"+json); + logger.debug("批量下发配置参数:"+json); if(!StringUtil.isEmpty(auditList)) { logger.warn("批量配置取消个数:"+auditList.size()); } diff --git a/src/main/java/com/nis/web/service/configuration/ProxyFileResponsePageService.java b/src/main/java/com/nis/web/service/configuration/ProxyFileResponsePageService.java new file mode 100644 index 000000000..54bb25a3c --- /dev/null +++ b/src/main/java/com/nis/web/service/configuration/ProxyFileResponsePageService.java @@ -0,0 +1,135 @@ +package com.nis.web.service.configuration; + + +import java.util.Date; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import com.beust.jcommander.internal.Lists; +import com.nis.domain.Page; +import com.nis.domain.callback.ProxyFileResponsePageCfg; +import com.nis.domain.callback.ProxyFileResponsePageCfgAudit; +import com.nis.domain.maat.ToMaatResult; +import com.nis.util.ConfigServiceUtil; +import com.nis.util.StringUtil; +import com.nis.web.dao.configuration.ProxyFileResponsePageDao; +import com.nis.web.security.UserUtils; +import com.nis.web.service.BaseService; + + +@Service +public class ProxyFileResponsePageService extends BaseService{ + @Autowired + protected ProxyFileResponsePageDao proxyFileDao; + + + /** + * 分页查询 + * @param page + * @param entity + * @return + */ + public Page findPage(Page page, ProxyFileResponsePageCfg entity) { + entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(),"a")); + entity.setPage(page); + List list=proxyFileDao.findPage(entity); + page.setList(list); + return page; + } + + public ProxyFileResponsePageCfg getCfgById(Long cfgId) { + return proxyFileDao.getCfgById(cfgId); + } + + @Transactional(readOnly=false,rollbackFor=RuntimeException.class) + public void saveOrUpdate(ProxyFileResponsePageCfg entity){ + Date createTime=new Date(); + //设置区域运营商信息 + setAreaEffectiveIds(entity); + int isValid=0; + if(!StringUtil.isEmpty(entity.getIsValid()) && entity.getIsValid()==1) { + isValid=1; + } + entity.setIsValid(0); + entity.setIsAudit(0); + //新增 + if(entity.getCfgId()==null){ + Integer compileId = ConfigServiceUtil.getId(1, 1).get(0);//获取编译id + entity.setCompileId(compileId); + entity.setCreatorId(UserUtils.getUser().getId()); + entity.setCreateTime(createTime); + entity.setIsValid(0); + entity.setIsAudit(0); + proxyFileDao.insert(entity);//新增 + }else{ + Date editTime=new Date(); + entity.setIsValid(0); + entity.setIsAudit(0); + entity.setEditorId(UserUtils.getUser().getId()); + entity.setEditTime(editTime); + proxyFileDao.update(entity);//更新 + } + if(isValid==1) { + entity.setIsAudit(1); + entity.setIsValid(1); + audit( entity.getIsAudit(), isValid, entity.getFunctionId(), String.valueOf(entity.getCfgId())); + } + } + + @Transactional(readOnly=false,rollbackFor=RuntimeException.class) + public void update(Integer isAudit,Integer isValid,String ids,Integer functionId){ + ProxyFileResponsePageCfg entity = new ProxyFileResponsePageCfg(); + String[] idArray = ids.split(","); + for(String id :idArray){ + entity.setCfgId(Long.parseLong(id)); + entity.setFunctionId(functionId); + entity.setIsAudit(isAudit); + entity.setIsValid(isValid); + entity.setEditorId(UserUtils.getUser().getId()); + entity.setEditTime(new Date()); + proxyFileDao.update(entity); + } + } + + @Transactional(readOnly=false,rollbackFor=RuntimeException.class) + public void audit(Integer isAudit,Integer isValid,Integer functionId,String ids){ + Date auditTime = new Date();//审核时间 + String[] idArray = ids.split(","); + for(String id : idArray) { + ProxyFileResponsePageCfg entity = proxyFileDao.getCfgById(Long.parseLong(id)); + entity.setIsAudit(isAudit); + entity.setIsValid(isValid); + entity.setAuditorId(UserUtils.getUser().getId()); + entity.setAuditTime(auditTime); + proxyFileDao.update(entity); + if(isAudit == 1) {//审核通过,下发配置回调配置信息 + List convertList = Lists.newArrayList(); + convertList.add(BaseService.convertCallBackProxyFileResponsePage(entity)); + String json = gsonToJson(convertList); + logger.debug("访问阻断页面下发参数:" + json); + ToMaatResult result = ConfigServiceUtil.postCallbackCfg(json); + logger.debug("访问阻断页面下发响应:"+gsonToJson(result)); + }else if(isAudit == 3) {//取消审核通过,将回调配置信息置为无效 + List convertList = Lists.newArrayList(); + convertList.add(BaseService.convertCallBackProxyFileResponsePage(entity)); + String json = gsonToJson(convertList); + logger.debug("访问阻断页面下发参数:" + json); + ToMaatResult result = ConfigServiceUtil.put(json,2); + logger.debug("访问阻断页面下发响应:"+gsonToJson(result)); + } + } + + } + + /** + * 获取所有的 响应文件 策略 + * @return + */ + public List getProxyFileResponsePageCfgList(ProxyFileResponsePageCfg entity){ + entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(),"a")); + List list=proxyFileDao.findPage(entity); + return list; + } + +} diff --git a/src/main/resources/messages/message_en.properties b/src/main/resources/messages/message_en.properties index 2f15627f1..21903e8e6 100644 --- a/src/main/resources/messages/message_en.properties +++ b/src/main/resources/messages/message_en.properties @@ -1542,6 +1542,7 @@ mirror_addr_type=Address Type target_name=Target Name traffic_mirror_address=Traffic Mirror Address content_name=Content Name +visit_response_page=Response Pages none_profile_tip=Please Choose Profile Info! #---------------------------pxy intercept------------------------------------ min_should_less_than_max=The min SSL version should less than the max SSL version diff --git a/src/main/resources/messages/message_ru.properties b/src/main/resources/messages/message_ru.properties index 12dc52258..2bc86110b 100644 --- a/src/main/resources/messages/message_ru.properties +++ b/src/main/resources/messages/message_ru.properties @@ -1544,6 +1544,7 @@ mirror_addr_type=Address Type target_name=Target Name traffic_mirror_address=Traffic Mirror Address content_name=Content Name +visit_response_page=Response Pages none_profile_tip=Please Choose Profile Info! #---------------------------pxy intercept------------------------------------ min_should_less_than_max=The min SSL version should less than the max SSL version diff --git a/src/main/resources/messages/message_zh_CN.properties b/src/main/resources/messages/message_zh_CN.properties index 061ceb4e5..8cfe35628 100644 --- a/src/main/resources/messages/message_zh_CN.properties +++ b/src/main/resources/messages/message_zh_CN.properties @@ -1542,6 +1542,7 @@ mirror_addr_type=\u76EE\u6807\u6807\u8BC6\u7C7B\u578B target_name=\u76EE\u6807\u540D\u79F0 traffic_mirror_address=\u6D41\u91CF\u8F6C\u53D1\u76EE\u7684\u5730\u5740 content_name=\u5185\u5BB9\u540D\u79F0 +visit_response_page=\u8BBF\u95EE\u963B\u65AD\u9875\u9762 none_profile_tip=Please Choose Profile Info! #---------------------------pxy intercept------------------------------------ min_should_less_than_max=\u6700\u5C0FSSL\u7248\u672C\u5E94\u5C0F\u4E8E\u6700\u5927SSL\u7248\u672C diff --git a/src/main/resources/service/service_config.xml b/src/main/resources/service/service_config.xml index 2f3a13ecf..3f3045fec 100644 --- a/src/main/resources/service/service_config.xml +++ b/src/main/resources/service/service_config.xml @@ -426,7 +426,7 @@ - + diff --git a/src/main/resources/sql/20190521/add_menu_responsePage.sql b/src/main/resources/sql/20190521/add_menu_responsePage.sql new file mode 100644 index 000000000..fe72613d9 --- /dev/null +++ b/src/main/resources/sql/20190521/add_menu_responsePage.sql @@ -0,0 +1,8 @@ +#访问阻断页面业务表和菜单表 +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`, `region_code`, `is_import`, `sort`, `config_do_log`) +VALUES (516, 0, 1, 'monit', 646, 'visit_response_page', NULL, 1, NULL, '2019-05-17 11:46:48', NULL, '2019-05-17 11:46:51', NULL, 0, 1, NULL); + +INSERT INTO sys_menu (`parent_id`, `parent_ids`, `code`, `name`, `sort`, `href`, `target`, `icon`, `is_show`, `permission`, `create_by`, `create_date`, `update_by`, `update_date`, `remarks`, `del_flag`, `menu_bg`, `quick_action`, `is_top`, `function_id`) +VALUES (1121, '0,1,86,717,1121,', 'visit_response_page', '访问阻断页面', 10, '/proxy/fileResponsePage/list', '', '', 1, 'proxy:fileResponsePage:config', '1', '2019-05-09 11:16:20', '1', '2019-05-09 11:16:20', '', 1, NULL, 0, 0, 516), +(1122, '0,1,150,750,1122,', 'visit_response_page', '访问阻断页面', 428, '/proxy/fileResponsePage/list', '', '', 1, 'proxy:fileResponsePage:confirm', '1', '2019-05-09 14:58:10', '1', '2019-05-09 14:58:10', '', 1, NULL, 0, 0, 516), +(1123, '0,1,151,865,1123,', 'visit_response_page', '访问阻断页面', 41, '/proxy/fileResponsePage/list', '', '', 1, 'proxy:fileResponsePage:audit', '1', '2019-05-09 14:59:54', '1', '2019-05-09 14:59:54', '', 1, NULL, 0, 0, 516); diff --git a/src/main/resources/sql/20190521/insert_dict.sql b/src/main/resources/sql/20190521/insert_dict.sql new file mode 100644 index 000000000..8b6108b01 --- /dev/null +++ b/src/main/resources/sql/20190521/insert_dict.sql @@ -0,0 +1,36 @@ +#劫持相关字典表 insert语句中的156即dictionary_id应替换为select筛选后中id字段的值 +INSERT INTO `sys_data_dictionary_name`(`module_name`, `mark`, `remark`, `revision`, `create_time`, `modify_time`, `status`) +VALUES ('劫持文件内容格式', 'CONTENT_TYPE_HIJACK', 'hijack content-type', '', '2019-05-21 00:00:00', '2019-05-21 00:00:00', 1); + +SELECT * FROM sys_data_dictionary_name WHERE mark='CONTENT_TYPE_HIJACK'; + +INSERT into sys_data_dictionary_item(item_code,item_value,item_sort,`status`,type,dictionary_id) +VALUES('image/gif','image/gif',0,1,1,156), +('image/jpeg','image/jpeg',0,1,1,156), +('image/png','image/png',0,1,1,156), +('image/svg+xml','image/svg+xml',0,1,1,156), +('application/x-msdos-program','application/x-msdos-program',0,1,1,156), +('application/x-msdownload','application/x-msdownload',0,1,1,156), +('application/octet-stream','application/octet-stream',0,1,1,156), +('application/vnd.android.package-archive','application/vnd.android.package-archive',0,1,1,156), +('text/html','text/html',0,1,1,156); + +#文件策略相关字典表 insert语句中的157即dictionary_id应替换为select筛选后中id字段的值 +INSERT INTO `sys_data_dictionary_name`(`module_name`, `mark`, `remark`, `revision`, `create_time`, `modify_time`, `status`) +VALUES('文件策略内容格式', 'CONTENT_TYPE_FILESTRATEGY', 'fileStrategy content-type', '', '2019-05-21 00:00:00', '2019-05-21 00:00:00', 1); + +SELECT * FROM sys_data_dictionary_name WHERE mark='CONTENT_TYPE_FILESTRATEGY'; + +INSERT into sys_data_dictionary_item(item_code,item_value,item_sort,`status`,type,dictionary_id) +VALUES('template','template',0,1,1,157), +('html','html',0,1,1,157); + +#注入脚本相关字典表 insert语句中的158即dictionary_id应替换为select筛选后中id字段的值 +INSERT INTO `sys_data_dictionary_name`(`module_name`, `mark`, `remark`, `revision`, `create_time`, `modify_time`, `status`) +VALUES('注入脚本文件内容格式', 'CONTENT_TYPE_INSERTSCRIPT', 'insertScript content-type', '', '2019-05-21 00:00:00', '2019-05-21 00:00:00', 1); + +SELECT * FROM sys_data_dictionary_name WHERE mark='CONTENT_TYPE_INSERTSCRIPT'; + +INSERT into sys_data_dictionary_item(item_code,item_value,item_sort,`status`,type,dictionary_id) +VALUES('css','css',0,1,1,158), +('js','js',0,1,1,158); \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/tags/sys/delRow.tag b/src/main/webapp/WEB-INF/tags/sys/delRow.tag index 736856645..fabd96f9a 100644 --- a/src/main/webapp/WEB-INF/tags/sys/delRow.tag +++ b/src/main/webapp/WEB-INF/tags/sys/delRow.tag @@ -124,6 +124,7 @@ function isBatch(url){ || url.indexOf("functionId=515&") > -1 //Traffic Mirror || url.indexOf("functionId=512&") > -1 //PXY OBJ FILE || url.indexOf("functionId=215&") > -1 //Proxy Manipulate + || url.indexOf("functionId=516&") > -1 //Response Page ){ flag = true; } diff --git a/src/main/webapp/WEB-INF/views/cfg/proxy/fileHijack/form.jsp b/src/main/webapp/WEB-INF/views/cfg/proxy/fileHijack/form.jsp index 01a9ec143..cec8c79aa 100644 --- a/src/main/webapp/WEB-INF/views/cfg/proxy/fileHijack/form.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/proxy/fileHijack/form.jsp @@ -152,7 +152,7 @@
@@ -164,7 +164,7 @@
- +
diff --git a/src/main/webapp/WEB-INF/views/cfg/proxy/fileHijack/list.jsp b/src/main/webapp/WEB-INF/views/cfg/proxy/fileHijack/list.jsp index 266825569..de5f8ecf4 100644 --- a/src/main/webapp/WEB-INF/views/cfg/proxy/fileHijack/list.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/proxy/fileHijack/list.jsp @@ -8,6 +8,8 @@ //搜索框提示语初始化 if("${cfg.cfgDesc}"){ $("#intype").val("${cfg.cfgDesc}"); + }else if("${cfg.compileIdNew}"){ + $("#intype").val("${cfg.compileIdNew}"); }else{ $("#intype").attr("placeholder"," "+$("#seltype").find("option:selected").text()); } @@ -93,6 +95,7 @@ + diff --git a/src/main/webapp/WEB-INF/views/cfg/proxy/fileInsertScript/form.jsp b/src/main/webapp/WEB-INF/views/cfg/proxy/fileInsertScript/form.jsp index 22f735ab2..d97ea9ffa 100644 --- a/src/main/webapp/WEB-INF/views/cfg/proxy/fileInsertScript/form.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/proxy/fileInsertScript/form.jsp @@ -150,17 +150,12 @@ *
- <%-- --%> + + + +
diff --git a/src/main/webapp/WEB-INF/views/cfg/proxy/fileInsertScript/list.jsp b/src/main/webapp/WEB-INF/views/cfg/proxy/fileInsertScript/list.jsp index 5d773da16..20769255e 100644 --- a/src/main/webapp/WEB-INF/views/cfg/proxy/fileInsertScript/list.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/proxy/fileInsertScript/list.jsp @@ -8,6 +8,8 @@ //搜索框提示语初始化 if("${cfg.cfgDesc}"){ $("#intype").val("${cfg.cfgDesc}"); + }else if("${cfg.compileIdNew}"){ + $("#intype").val("${cfg.compileIdNew}"); }else{ $("#intype").attr("placeholder"," "+$("#seltype").find("option:selected").text()); } @@ -93,6 +95,7 @@ + diff --git a/src/main/webapp/WEB-INF/views/cfg/proxy/fileResponsePage/form.jsp b/src/main/webapp/WEB-INF/views/cfg/proxy/fileResponsePage/form.jsp new file mode 100644 index 000000000..520b01717 --- /dev/null +++ b/src/main/webapp/WEB-INF/views/cfg/proxy/fileResponsePage/form.jsp @@ -0,0 +1,229 @@ +<%@ page contentType="text/html;charset=UTF-8"%> +<%@ include file="/WEB-INF/include/taglib.jsp"%> + + +<spring:message code="${cfgName}"></spring:message> + + + + +
+ +

+ +

+ +
+
+
+
+
+ + + + + + + +
+
+
+ +
+ + + + + + + + + + + + + +
+
+ +
+ +
+
+
+ +
+ +
+ " class="required form-control" + style="background-color: transparent" aria-required="true" + type="text" value="${_cfg.url }"> +
+ +
+
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+
+
+ +
+ +
+
+
+
+ + +
+ <%@include file="/WEB-INF/include/form/basicInfo.jsp"%> +
+
+
+
+
+
+ + + + + + + + + + + + + + +
+
+
+
+
+
+
+ +
+
+
+
+
+ + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/cfg/proxy/fileResponsePage/list.jsp b/src/main/webapp/WEB-INF/views/cfg/proxy/fileResponsePage/list.jsp new file mode 100644 index 000000000..c4046492e --- /dev/null +++ b/src/main/webapp/WEB-INF/views/cfg/proxy/fileResponsePage/list.jsp @@ -0,0 +1,409 @@ +<%@ page contentType="text/html;charset=UTF-8"%> +<%@ include file="/WEB-INF/include/taglib.jsp"%> + + +<spring:message code="${cfgName}"></spring:message> + + + + + + +
+ + + +

+ +

+ +
+
+
+
+ + + + + + + + + +
+
+ + + + + + + + +
+ +
+
+
+ + + + + + +
+ + +
+ + + + + +
+
+
+
+ + + +
+
+ + + + + +
+ + +
+
+ href="javascript:;"> + + +
+
+ + + +
+
+ +
+ +
+ + + + + + + + +
+ +
+ +
+ +
+ + + + + + + +
+ +
+ +
+ +
+ + + + + + + + +
+ +
+ +
+ +
+ + + + + + + +
+ +
+ +
+ +
+
+
+ + +
+
+ +
+
+ + " onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/> + +
+
+ +
+
+ + " onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/> + +
+
+ +
+
+ + " onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/> + +
+
+ +
+
+ + " onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/> + +
+
+ +
+
+ + " onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/> + +
+
+
+ + +
+ + + + + + + +
+
+ +
+ + + + + + + + + <%-- --%> + + + + + + + + + + + + + + + + + + + + + + + <%-- --%> + + + + + + + + + + + + + + + +
+ + ${indexCfg.compileId }${indexCfg.fileDesc }${indexCfg.contentType }${indexCfg.contentLength }(B) + + + + + + ${indexCfg.requestName } + + + + + + + + + + + + + + + ${fns:abbr(classify,20)} + + + + + + + + + + + + + + + + + ${fns:abbr(attribute,20)} + + + + + + + + + + + + + + + + + + ${fns:abbr(lableInfo,20)} + + + + + + + + + + + + + ${indexCfg.creatorName }${indexCfg.editorName }${indexCfg.auditorName }
+
${page}
+
+
+
+
+
+ + + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/cfg/proxy/fileStrategy/form.jsp b/src/main/webapp/WEB-INF/views/cfg/proxy/fileStrategy/form.jsp index 8b25c03f9..a4353d080 100644 --- a/src/main/webapp/WEB-INF/views/cfg/proxy/fileStrategy/form.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/proxy/fileStrategy/form.jsp @@ -151,9 +151,9 @@ *
- - + diff --git a/src/main/webapp/WEB-INF/views/cfg/proxy/fileStrategy/list.jsp b/src/main/webapp/WEB-INF/views/cfg/proxy/fileStrategy/list.jsp index 4c0d4600c..a3ba0bab3 100644 --- a/src/main/webapp/WEB-INF/views/cfg/proxy/fileStrategy/list.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/proxy/fileStrategy/list.jsp @@ -9,6 +9,8 @@ //搜索框提示语初始化 if("${cfg.fileDesc}"){ $("#intype").val("${cfg.fileDesc}"); + }else if("${cfg.compileIdNew}"){ + $("#intype").val("${cfg.compileIdNew}"); }else{ $("#intype").attr("placeholder"," "+$("#seltype").find("option:selected").text()); } @@ -84,6 +86,7 @@ +
@@ -93,6 +96,7 @@ + diff --git a/src/main/webapp/WEB-INF/views/cfg/proxy/fileTrafficMirror/form.jsp b/src/main/webapp/WEB-INF/views/cfg/proxy/fileTrafficMirror/form.jsp index a7d05a433..9caa8d3fc 100644 --- a/src/main/webapp/WEB-INF/views/cfg/proxy/fileTrafficMirror/form.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/proxy/fileTrafficMirror/form.jsp @@ -14,7 +14,7 @@ word-break:break-all;