From 1f39824324da35ee43375ce95a5c70c3e02eea07 Mon Sep 17 00:00:00 2001 From: wangxin Date: Wed, 31 Oct 2018 17:00:40 +0800 Subject: [PATCH] =?UTF-8?q?=EF=BC=881=EF=BC=89=E5=AD=97=E7=AC=A6=E4=B8=B2?= =?UTF-8?q?=E5=AF=BC=E5=85=A5=E5=A4=A7=E5=B0=8F=E5=86=99=E6=95=8F=E6=84=9F?= =?UTF-8?q?=EF=BC=8C=E6=98=AF=E5=90=A6=E5=8D=81=E5=85=AD=E8=BF=9B=E5=88=B6?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=EF=BC=882=EF=BC=89http=20=E9=AB=98?= =?UTF-8?q?=E7=BA=A7=E5=AF=BC=E5=85=A5=EF=BC=8Cftp=E5=86=85=E5=AE=B9?= =?UTF-8?q?=E5=85=B3=E9=94=AE=E5=AD=97=E5=AF=BC=E5=85=A5=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=20=EF=BC=883=EF=BC=89=E5=8A=A0=E5=85=A516=E8=BF=9B=E5=88=B6?= =?UTF-8?q?=E5=A4=A7=E5=B0=8F=E5=86=99=E4=B8=80=E5=AE=9A=E4=B8=8D=E6=95=8F?= =?UTF-8?q?=E6=84=9F=E7=9A=84=E9=AA=8C=E8=AF=81=E6=8F=90=E7=A4=BA=20?= =?UTF-8?q?=EF=BC=884=EF=BC=89=E2=80=9Cothers=E2=80=9D=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E5=9F=9F=E4=B8=8D=E5=85=81=E8=AE=B8=E5=AF=BC=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nis/web/controller/BaseController.java | 29 +++++++++++++------ .../configuration/WebsiteCfgService.java | 14 +++++++++ .../resources/messages/message_en.properties | 3 +- .../resources/messages/message_ru.properties | 3 +- .../messages/message_zh_CN.properties | 3 +- .../resources/sql/20181030/update_region.sql | 5 +++- 6 files changed, 44 insertions(+), 13 deletions(-) diff --git a/src/main/java/com/nis/web/controller/BaseController.java b/src/main/java/com/nis/web/controller/BaseController.java index 9aac20726..fc79843f1 100644 --- a/src/main/java/com/nis/web/controller/BaseController.java +++ b/src/main/java/com/nis/web/controller/BaseController.java @@ -1041,8 +1041,10 @@ public class BaseController { baseStringCfg.setIsHexbin(0); } else if (isHex.intValue() == 1 && isCaseInsenstive.intValue() == 0) { baseStringCfg.setIsHexbin(1); - } else if (isHex.intValue() == 1 && isCaseInsenstive.intValue() == 1) { + } else if (isHex.intValue() == 0 && isCaseInsenstive.intValue() == 1) { baseStringCfg.setIsHexbin(2); + }else { + errInfo.append(prop.getProperty("hex_case_insensitive")+ ";"); } } @@ -1119,6 +1121,10 @@ public class BaseController { errInfo.append( String.format(prop.getProperty("is_incorrect"), prop.getProperty("district") + " ") + ";"); + } else if (dirtrictP.indexOf("others")>-1&&district.equals("others")) { + //不允许自定义匹配区域导入 + errInfo.append(prop.getProperty("district")+" "+ + String.format(prop.getProperty("can_not_be"), " 'others'")+ ";"); } } if (mulityKeywordsP.equals("0")) { @@ -1285,8 +1291,10 @@ public class BaseController { baseStringCfg.setIsHexbin(0); } else if (isHex.intValue() == 1 && isCaseInsenstive.intValue() == 0) { baseStringCfg.setIsHexbin(1); - } else if (isHex.intValue() == 1 && isCaseInsenstive.intValue() == 1) { + } else if (isHex.intValue() == 0 && isCaseInsenstive.intValue() == 1) { baseStringCfg.setIsHexbin(2); + }else { + errInfo.append(prop.getProperty("hex_case_insensitive")+ ";"); } } } @@ -3346,10 +3354,10 @@ public class BaseController { if (regionDict.getDictId().intValue() == 167) { interceptCfgService.saveInterceptCfg(stringCfgs); } - if (regionDict.getDictId().intValue() == 15 || regionDict.getDictId().intValue() == 596) { + if (regionDict.getDictId().intValue() == 9||regionDict.getDictId().intValue() == 15 || regionDict.getDictId().intValue() == 596) { websiteCfgService.saveHttpUrlCfg(stringCfgs); } - if (regionDict.getDictId().intValue() == 36) { + if (regionDict.getDictId().intValue() == 36||regionDict.getDictId().intValue() == 37) { fileTransferCfgService.saveFtpCfg(stringCfgs); } if (regionDict.getFunctionId().equals(510)) { // P2p hash @@ -3367,10 +3375,8 @@ public class BaseController { if (regionDict.getFunctionId().intValue() == 34) { websiteCfgService.saveSslCfg(stringCfgs); } - if (regionDict.getFunctionId().intValue() == 635) { - if(regionDict.getDictId().intValue()==601||regionDict.getDictId().intValue()==602) { - websiteCfgService.saveHttpBodyCfg(stringCfgs); - } + if(regionDict.getDictId().intValue()==12||regionDict.getDictId().intValue()==13||regionDict.getDictId().intValue()==601||regionDict.getDictId().intValue()==602) { + websiteCfgService.saveHttpBodyCfg(stringCfgs); } } else if (regionDict.getRegionType().equals(3)) { for (ComplexkeywordCfg cfg : complexkeywordCfgs) { @@ -3427,7 +3433,12 @@ public class BaseController { if (regionDict.getDictId().intValue() == 30 || regionDict.getDictId().intValue() == 31||regionDict.getDictId().intValue() == 599) { mailCfgService.saveMailCfg(complexkeywordCfgs); } - + if(regionDict.getDictId().intValue()==10) { + websiteCfgService.saveHttpReqHeadCfg(complexkeywordCfgs); + } + if(regionDict.getDictId().intValue()==11) { + websiteCfgService.saveHttpResHeadCfg(complexkeywordCfgs); + } } if (cfgIndexInfos != null && cfgIndexInfos.size() > 0) { ipCfgService.saveCfgIndexOf(cfgIndexInfos); diff --git a/src/main/java/com/nis/web/service/configuration/WebsiteCfgService.java b/src/main/java/com/nis/web/service/configuration/WebsiteCfgService.java index c34482772..5a8eb15ea 100644 --- a/src/main/java/com/nis/web/service/configuration/WebsiteCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/WebsiteCfgService.java @@ -172,6 +172,20 @@ public class WebsiteCfgService extends CrudService { websiteCfgDao.saveHttpBodyCfg(_cfg); } } + public void saveHttpReqHeadCfg(List cfgs) { + for(ComplexkeywordCfg cfg:cfgs){ + HttpReqHeadCfg _cfg=new HttpReqHeadCfg(); + BeanUtils.copyProperties(cfg,_cfg); + websiteCfgDao.saveHttpReqHdrCfg(_cfg); + } + } + public void saveHttpResHeadCfg(List cfgs) { + for(ComplexkeywordCfg cfg:cfgs){ + HttpResHeadCfg _cfg=new HttpResHeadCfg(); + BeanUtils.copyProperties(cfg,_cfg); + websiteCfgDao.saveHttpResHdrCfg(_cfg); + } + } public void saveHttpCfg(CfgIndexInfo entity){ //设置区域运营商信息 setAreaEffectiveIds(entity); diff --git a/src/main/resources/messages/message_en.properties b/src/main/resources/messages/message_en.properties index 0c08416b8..5722c3886 100644 --- a/src/main/resources/messages/message_en.properties +++ b/src/main/resources/messages/message_en.properties @@ -1299,4 +1299,5 @@ av_protocol_note=Note:Recognizable Protocols Include RTSP,RTMP. ip_range_in_the_same=Start IP and end IP in a IP range must with in the same subnet log_to_url=To HTTP URL source_compile_id=Configuration Source -most_keywords=%s can have 1024 chars at most \ No newline at end of file +most_keywords=%s can have 1024 chars at most +hex_case_insensitive=Hexadecimal values must case insensitive \ No newline at end of file diff --git a/src/main/resources/messages/message_ru.properties b/src/main/resources/messages/message_ru.properties index 61da343da..71fc407f2 100644 --- a/src/main/resources/messages/message_ru.properties +++ b/src/main/resources/messages/message_ru.properties @@ -1297,4 +1297,5 @@ av_protocol_note=Note:Recognizable Protocols Include RTSP,RTMP. log_to_url=To HTTP URL source_compile_id=Configuration Source av_protocol_note=Note:Recognizable Protocols Include RTSP,RTMP. -most_keywords=%s can have 1024 chars at most \ No newline at end of file +most_keywords=%s can have 1024 chars at most +hex_case_insensitive=Hexadecimal values must case insensitive \ No newline at end of file diff --git a/src/main/resources/messages/message_zh_CN.properties b/src/main/resources/messages/message_zh_CN.properties index 3a9737348..2c6f00c03 100644 --- a/src/main/resources/messages/message_zh_CN.properties +++ b/src/main/resources/messages/message_zh_CN.properties @@ -1291,4 +1291,5 @@ av_protocol_note=\u6CE8\uFF1A\u53EF\u8BC6\u522B\u534F\u8BAE\u5305\u62EC RTSP\u30 ip_range_in_the_same=IP\u8303\u56F4\u7684\u8D77\u59CBIP\u4E0E\u7EC8\u6B62IP\u5FC5\u987B\u5728\u76F8\u540C\u7F51\u6BB5 log_to_url=\u8F6CHTTP URL\u914D\u7F6E source_compile_id=\u914D\u7F6E\u6765\u6E90 -most_keywords=%s\u6700\u591A\u5305\u542B1024\u4E2A\u5B57\u7B26 \ No newline at end of file +most_keywords=%s\u6700\u591A\u5305\u542B1024\u4E2A\u5B57\u7B26 +hex_case_insensitive=16\u8FDB\u5236\u7684\u503C\u5927\u5C0F\u5199\u4E0D\u654F\u611F \ No newline at end of file diff --git a/src/main/resources/sql/20181030/update_region.sql b/src/main/resources/sql/20181030/update_region.sql index e30703760..720f62ba5 100644 --- a/src/main/resources/sql/20181030/update_region.sql +++ b/src/main/resources/sql/20181030/update_region.sql @@ -12,4 +12,7 @@ UPDATE function_service_dict SET is_import=1 WHERE function_id=34; update function_region_dict set is_import=1 where function_id=635; #邮件地址 UPDATE function_region_dict SET is_import=1 WHERE function_id=37 AND dict_id=599; -UPDATE function_region_dict SET is_import=0 WHERE function_id=37 AND dict_id=600; \ No newline at end of file +UPDATE function_region_dict SET is_import=0 WHERE function_id=37 AND dict_id=600; + +#http 高级 +UPDATE function_region_dict SET is_import=1 WHERE function_id=8 AND dict_id IN(9,10,11,12,13); \ No newline at end of file