diff --git a/src/main/java/com/nis/domain/configuration/AppByteCfg.java b/src/main/java/com/nis/domain/configuration/AppByteCfg.java new file mode 100644 index 000000000..e964322a5 --- /dev/null +++ b/src/main/java/com/nis/domain/configuration/AppByteCfg.java @@ -0,0 +1,130 @@ +/** + *@Title: BaseStringConfig.java + *@Package com.nis.domain.restful + *@Description TODO + *@author dell + *@date 2018年2月5日 下午5:26:02 + *@version 版本号 + */ +package com.nis.domain.configuration; + +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; +import com.nis.util.excel.ExcelField; + +/** + * @Description: APP策略配置 + * @author (dell) + * @date 2018年2月5日 下午5:26:02 + * @version V1.0 + */ +public class AppByteCfg extends BaseCfg { + + /** + * + */ + private static final long serialVersionUID = -3350695484085989968L; + private static final String tableName="app_byte_cfg"; + @Expose + private Integer compileId; + @Expose + private Integer ratelimit; + private String appCode; + private Integer specServiceId; + private String bytes; + private String cfgKeywords; + + @Expose + @ExcelField(title="expression_type") + @SerializedName("exprType") + protected Integer exprType ; + + @Expose + @ExcelField(title="match_method") + @SerializedName("matchMethod") + protected Integer matchMethod ; + + @Expose + @ExcelField(title="whether_hexbinary") + @SerializedName("isHexbin") + protected Integer isHexbin; + + public Integer getExprType() { + return exprType; + } + + public void setExprType(Integer exprType) { + this.exprType = exprType; + } + + public Integer getMatchMethod() { + return matchMethod; + } + + public void setMatchMethod(Integer matchMethod) { + this.matchMethod = matchMethod; + } + + public Integer getIsHexbin() { + return isHexbin; + } + + public void setIsHexbin(Integer isHexbin) { + this.isHexbin = isHexbin; + } + @Override + public void initDefaultValue() { + // TODO Auto-generated method stub + super.initDefaultValue(); + this.isHexbin = 0; + } + + + public Integer getCompileId() { + return compileId; + } + public void setCompileId(Integer compileId) { + this.compileId = compileId; + } + + public static String getTablename() { + return tableName; + } + + public Integer getRatelimit() { + return ratelimit; + } + + public void setRatelimit(Integer ratelimit) { + this.ratelimit = ratelimit; + } + public String getAppCode() { + return appCode; + } + public void setAppCode(String appCode) { + this.appCode = appCode; + } + public Integer getSpecServiceId() { + return specServiceId; + } + public void setSpecServiceId(Integer specServiceId) { + this.specServiceId = specServiceId; + } + + public String getBytes() { + return bytes; + } + + public void setBytes(String bytes) { + this.bytes = bytes; + } + + public String getCfgKeywords() { + return cfgKeywords; + } + + public void setCfgKeywords(String cfgKeywords) { + this.cfgKeywords = cfgKeywords; + } + +} diff --git a/src/main/java/com/nis/domain/configuration/AppDomainCfg.java b/src/main/java/com/nis/domain/configuration/AppDomainCfg.java new file mode 100644 index 000000000..80b8d8611 --- /dev/null +++ b/src/main/java/com/nis/domain/configuration/AppDomainCfg.java @@ -0,0 +1,125 @@ +/** + *@Title: BaseStringConfig.java + *@Package com.nis.domain.restful + *@Description TODO + *@author dell + *@date 2018年2月5日 下午5:26:02 + *@version 版本号 + */ +package com.nis.domain.configuration; + +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; +import com.nis.util.excel.ExcelField; + +/** + * @Description: APP策略配置 + * @author (dell) + * @date 2018年2月5日 下午5:26:02 + * @version V1.0 + */ +public class AppDomainCfg extends BaseCfg { + + /** + * + */ + private static final long serialVersionUID = -4685445179478960429L; + private static final String tableName="app_domain_cfg"; + @Expose + private Integer compileId; + @Expose + private Integer ratelimit; + private String appCode; + private Integer specServiceId; + private String domain; + private String cfgKeywords; + @Expose + @ExcelField(title="expression_type") + @SerializedName("exprType") + protected Integer exprType ; + + @Expose + @ExcelField(title="match_method") + @SerializedName("matchMethod") + protected Integer matchMethod ; + + @Expose + @ExcelField(title="whether_hexbinary") + @SerializedName("isHexbin") + protected Integer isHexbin; + + public Integer getExprType() { + return exprType; + } + + public void setExprType(Integer exprType) { + this.exprType = exprType; + } + + public Integer getMatchMethod() { + return matchMethod; + } + + public void setMatchMethod(Integer matchMethod) { + this.matchMethod = matchMethod; + } + + public Integer getIsHexbin() { + return isHexbin; + } + + public void setIsHexbin(Integer isHexbin) { + this.isHexbin = isHexbin; + } + @Override + public void initDefaultValue() { + // TODO Auto-generated method stub + super.initDefaultValue(); + this.isHexbin = 0; + } + + + public Integer getCompileId() { + return compileId; + } + public void setCompileId(Integer compileId) { + this.compileId = compileId; + } + + public static String getTablename() { + return tableName; + } + + public Integer getRatelimit() { + return ratelimit; + } + + public void setRatelimit(Integer ratelimit) { + this.ratelimit = ratelimit; + } + public String getAppCode() { + return appCode; + } + public void setAppCode(String appCode) { + this.appCode = appCode; + } + public Integer getSpecServiceId() { + return specServiceId; + } + public void setSpecServiceId(Integer specServiceId) { + this.specServiceId = specServiceId; + } + public String getDomain() { + return domain; + } + public void setDomain(String domain) { + this.domain = domain; + } + public String getCfgKeywords() { + return cfgKeywords; + } + + public void setCfgKeywords(String cfgKeywords) { + this.cfgKeywords = cfgKeywords; + } +} diff --git a/src/main/java/com/nis/domain/configuration/AppHttpCfg.java b/src/main/java/com/nis/domain/configuration/AppHttpCfg.java new file mode 100644 index 000000000..b366eca60 --- /dev/null +++ b/src/main/java/com/nis/domain/configuration/AppHttpCfg.java @@ -0,0 +1,130 @@ +/** + *@Title: BaseStringConfig.java + *@Package com.nis.domain.restful + *@Description TODO + *@author dell + *@date 2018年2月5日 下午5:26:02 + *@version 版本号 + */ +package com.nis.domain.configuration; + +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; +import com.nis.util.excel.ExcelField; + +/** + * @Description: APP策略配置 + * @author (dell) + * @date 2018年2月5日 下午5:26:02 + * @version V1.0 + */ +public class AppHttpCfg extends BaseCfg { + + /** + * + */ + private static final long serialVersionUID = 7528723915857911560L; + private static final String tableName="app_http_cfg"; + @Expose + private Integer compileId; + @Expose + private Integer ratelimit; + private String appCode; + private Integer specServiceId; + private String district; + private String cfgKeywords; + + @Expose + @ExcelField(title="expression_type") + @SerializedName("exprType") + protected Integer exprType ; + + @Expose + @ExcelField(title="match_method") + @SerializedName("matchMethod") + protected Integer matchMethod ; + + @Expose + @ExcelField(title="whether_hexbinary") + @SerializedName("isHexbin") + protected Integer isHexbin; + + public Integer getExprType() { + return exprType; + } + + public void setExprType(Integer exprType) { + this.exprType = exprType; + } + + public Integer getMatchMethod() { + return matchMethod; + } + + public void setMatchMethod(Integer matchMethod) { + this.matchMethod = matchMethod; + } + + public Integer getIsHexbin() { + return isHexbin; + } + + public void setIsHexbin(Integer isHexbin) { + this.isHexbin = isHexbin; + } + @Override + public void initDefaultValue() { + // TODO Auto-generated method stub + super.initDefaultValue(); + this.isHexbin = 0; + } + + + public Integer getCompileId() { + return compileId; + } + public void setCompileId(Integer compileId) { + this.compileId = compileId; + } + + public static String getTablename() { + return tableName; + } + + public Integer getRatelimit() { + return ratelimit; + } + + public void setRatelimit(Integer ratelimit) { + this.ratelimit = ratelimit; + } + public String getAppCode() { + return appCode; + } + public void setAppCode(String appCode) { + this.appCode = appCode; + } + public Integer getSpecServiceId() { + return specServiceId; + } + public void setSpecServiceId(Integer specServiceId) { + this.specServiceId = specServiceId; + } + + public String getDistrict() { + return district; + } + + public void setDistrict(String district) { + this.district = district; + } + + public String getCfgKeywords() { + return cfgKeywords; + } + + public void setCfgKeywords(String cfgKeywords) { + this.cfgKeywords = cfgKeywords; + } + +} diff --git a/src/main/java/com/nis/domain/configuration/AppInnerRuleCfg.java b/src/main/java/com/nis/domain/configuration/AppInnerRuleCfg.java new file mode 100644 index 000000000..0df18652e --- /dev/null +++ b/src/main/java/com/nis/domain/configuration/AppInnerRuleCfg.java @@ -0,0 +1,131 @@ +/** + *@Title: BaseStringConfig.java + *@Package com.nis.domain.restful + *@Description TODO + *@author dell + *@date 2018年2月5日 下午5:26:02 + *@version 版本号 + */ +package com.nis.domain.configuration; + +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; +import com.nis.util.excel.ExcelField; + +/** + * @Description: APP策略配置 + * @author (dell) + * @date 2018年2月5日 下午5:26:02 + * @version V1.0 + */ +public class AppInnerRuleCfg extends BaseCfg { + + /** + * + */ + private static final long serialVersionUID = 5620659473745698672L; + private static final String tableName="app_inner_rule_cfg"; + @Expose + private Integer compileId; + @Expose + private Integer ratelimit; + private String appCode; + private Integer specServiceId; + private String ruleFile; + private String cfgKeywords; + + @Expose + @ExcelField(title="expression_type") + @SerializedName("exprType") + protected Integer exprType ; + + @Expose + @ExcelField(title="match_method") + @SerializedName("matchMethod") + protected Integer matchMethod ; + + @Expose + @ExcelField(title="whether_hexbinary") + @SerializedName("isHexbin") + protected Integer isHexbin; + + public Integer getExprType() { + return exprType; + } + + public void setExprType(Integer exprType) { + this.exprType = exprType; + } + + public Integer getMatchMethod() { + return matchMethod; + } + + public void setMatchMethod(Integer matchMethod) { + this.matchMethod = matchMethod; + } + + public Integer getIsHexbin() { + return isHexbin; + } + + public void setIsHexbin(Integer isHexbin) { + this.isHexbin = isHexbin; + } + @Override + public void initDefaultValue() { + // TODO Auto-generated method stub + super.initDefaultValue(); + this.isHexbin = 0; + } + + + public Integer getCompileId() { + return compileId; + } + public void setCompileId(Integer compileId) { + this.compileId = compileId; + } + + public static String getTablename() { + return tableName; + } + + public Integer getRatelimit() { + return ratelimit; + } + + public void setRatelimit(Integer ratelimit) { + this.ratelimit = ratelimit; + } + public String getAppCode() { + return appCode; + } + public void setAppCode(String appCode) { + this.appCode = appCode; + } + public Integer getSpecServiceId() { + return specServiceId; + } + public void setSpecServiceId(Integer specServiceId) { + this.specServiceId = specServiceId; + } + + public String getRuleFile() { + return ruleFile; + } + + public void setRuleFile(String ruleFile) { + this.ruleFile = ruleFile; + } + + public String getCfgKeywords() { + return cfgKeywords; + } + + public void setCfgKeywords(String cfgKeywords) { + this.cfgKeywords = cfgKeywords; + } + + +} diff --git a/src/main/java/com/nis/domain/configuration/AppIpCfg.java b/src/main/java/com/nis/domain/configuration/AppIpCfg.java new file mode 100644 index 000000000..07df2affa --- /dev/null +++ b/src/main/java/com/nis/domain/configuration/AppIpCfg.java @@ -0,0 +1,234 @@ + +package com.nis.domain.configuration; + +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +/** + * @Description: APP策略配置 + * @author (dell) + * @date 2018年2月5日 下午5:26:02 + * @version V1.0 + */ +public class AppIpCfg extends BaseCfg { + + /** + * + */ + private static final long serialVersionUID = 4758285716968228089L; + private static final String tableName="app_ip_cfg"; + @Expose + private Integer compileId; + @Expose + private Integer ratelimit; + private String appCode; + private Integer specServiceId; + @Expose + @SerializedName("ipType") + protected Integer ipType; + protected Integer ipPattern; + protected String srcIpAddress; + protected String destIpAddress; + protected Integer portPattern; + protected String srcPort; + protected String destPort; + + /** + * 方向 + */ + @Expose + @SerializedName("direction") + protected Integer direction ; + /** + * 方向 + */ + @Expose + @SerializedName("protocol") + protected Integer protocol ; + /** + * 协议ID + */ + @Expose + @SerializedName("protocolId") + protected Integer protocolId ; + + /** + * ipType + * @return ipType + */ + + public Integer getIpType() { + return ipType; + } + /** + * @param ipType the ipType to set + */ + public void setIpType(Integer ipType) { + this.ipType = ipType; + } + + /** + * direction + * @return direction + */ + + public Integer getDirection() { + return direction; + } + /** + * @param direction the direction to set + */ + public void setDirection(Integer direction) { + this.direction = direction; + } + /** + * protocol + * @return protocol + */ + + public Integer getProtocol() { + return protocol; + } + /** + * @param protocol the protocol to set + */ + public void setProtocol(Integer protocol) { + this.protocol = protocol; + } + /** + * protocolId + * @return protocolId + */ + + public Integer getProtocolId() { + return protocolId; + } + /** + * @param protocolId the protocolId to set + */ + public void setProtocolId(Integer protocolId) { + this.protocolId = protocolId; + } + + /** + * ipPattern + * @return ipPattern + */ + + public Integer getIpPattern() { + return ipPattern; + } + /** + * @param ipPattern the ipPattern to set + */ + public void setIpPattern(Integer ipPattern) { + this.ipPattern = ipPattern; + } + /** + * portPattern + * @return portPattern + */ + + public Integer getPortPattern() { + return portPattern; + } + /** + * @param portPattern the portPattern to set + */ + public void setPortPattern(Integer portPattern) { + this.portPattern = portPattern; + } + + /** + * srcIpAddress + * @return srcIpAddress + */ + + public String getSrcIpAddress() { + return srcIpAddress; + } + /** + * @param srcIpAddress the srcIpAddress to set + */ + public void setSrcIpAddress(String srcIpAddress) { + this.srcIpAddress = srcIpAddress; + } + /** + * destIpAddress + * @return destIpAddress + */ + + public String getDestIpAddress() { + return destIpAddress; + } + /** + * @param destIpAddress the destIpAddress to set + */ + public void setDestIpAddress(String destIpAddress) { + this.destIpAddress = destIpAddress; + } + /** + * srcPort + * @return srcPort + */ + + public String getSrcPort() { + return srcPort; + } + /** + * @param srcPort the srcPort to set + */ + public void setSrcPort(String srcPort) { + this.srcPort = srcPort; + } + /** + * destPort + * @return destPort + */ + + public String getDestPort() { + return destPort; + } + /** + * @param destPort the destPort to set + */ + public void setDestPort(String destPort) { + this.destPort = destPort; + } + @Override + public void initDefaultValue(){ + super.initDefaultValue(); + this.direction = 0; + } + public Integer getCompileId() { + return compileId; + } + public void setCompileId(Integer compileId) { + this.compileId = compileId; + } + + public static String getTablename() { + return tableName; + } + + public Integer getRatelimit() { + return ratelimit; + } + + public void setRatelimit(Integer ratelimit) { + this.ratelimit = ratelimit; + } + public String getAppCode() { + return appCode; + } + public void setAppCode(String appCode) { + this.appCode = appCode; + } + public Integer getSpecServiceId() { + return specServiceId; + } + public void setSpecServiceId(Integer specServiceId) { + this.specServiceId = specServiceId; + } + +} diff --git a/src/main/java/com/nis/domain/configuration/AppPolicyCfg.java b/src/main/java/com/nis/domain/configuration/AppPolicyCfg.java new file mode 100644 index 000000000..7dee3cebb --- /dev/null +++ b/src/main/java/com/nis/domain/configuration/AppPolicyCfg.java @@ -0,0 +1,128 @@ +/** + *@Title: BaseStringConfig.java + *@Package com.nis.domain.restful + *@Description TODO + *@author dell + *@date 2018年2月5日 下午5:26:02 + *@version 版本号 + */ +package com.nis.domain.configuration; + +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; +import com.nis.util.excel.ExcelField; + +/** + * @Description: APP策略配置 + * @author (dell) + * @date 2018年2月5日 下午5:26:02 + * @version V1.0 + */ +public class AppPolicyCfg extends BaseCfg { + + /** + * + */ + private static final long serialVersionUID = -5679998383250783571L; + private static final String tableName="app_policy_cfg"; + @Expose + private Integer compileId; + @Expose + private Integer ratelimit; + private String appCode; + private Integer specServiceId; + private String appName; + private String cfgKeywords; + + @Expose + @ExcelField(title="expression_type") + @SerializedName("exprType") + protected Integer exprType ; + + @Expose + @ExcelField(title="match_method") + @SerializedName("matchMethod") + protected Integer matchMethod ; + + @Expose + @ExcelField(title="whether_hexbinary") + @SerializedName("isHexbin") + protected Integer isHexbin; + + public Integer getExprType() { + return exprType; + } + + public void setExprType(Integer exprType) { + this.exprType = exprType; + } + + public Integer getMatchMethod() { + return matchMethod; + } + + public void setMatchMethod(Integer matchMethod) { + this.matchMethod = matchMethod; + } + + public Integer getIsHexbin() { + return isHexbin; + } + + public void setIsHexbin(Integer isHexbin) { + this.isHexbin = isHexbin; + } + @Override + public void initDefaultValue() { + // TODO Auto-generated method stub + super.initDefaultValue(); + this.isHexbin = 0; + } + + + public Integer getCompileId() { + return compileId; + } + public void setCompileId(Integer compileId) { + this.compileId = compileId; + } + + public static String getTablename() { + return tableName; + } + + public Integer getRatelimit() { + return ratelimit; + } + + public void setRatelimit(Integer ratelimit) { + this.ratelimit = ratelimit; + } + public String getAppCode() { + return appCode; + } + public void setAppCode(String appCode) { + this.appCode = appCode; + } + public Integer getSpecServiceId() { + return specServiceId; + } + public void setSpecServiceId(Integer specServiceId) { + this.specServiceId = specServiceId; + } + + public String getAppName() { + return appName; + } + + public void setAppName(String appName) { + this.appName = appName; + } + public String getCfgKeywords() { + return cfgKeywords; + } + + public void setCfgKeywords(String cfgKeywords) { + this.cfgKeywords = cfgKeywords; + } +} diff --git a/src/main/java/com/nis/domain/configuration/AppStringCfg.java b/src/main/java/com/nis/domain/configuration/AppStringCfg.java index 6c95b5e23..d6d10f607 100644 --- a/src/main/java/com/nis/domain/configuration/AppStringCfg.java +++ b/src/main/java/com/nis/domain/configuration/AppStringCfg.java @@ -20,7 +20,7 @@ import com.google.gson.annotations.SerializedName; */ public class AppStringCfg extends BaseStringCfg { - + private static final String tableName="app_string_cfg"; /** * @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么) * @@ -29,6 +29,8 @@ public class AppStringCfg extends BaseStringCfg { private static final long serialVersionUID = 4938724489988587634L; @Expose private Integer compileId; + @Expose + private Integer ratelimit; /* (non-Javadoc) * @see com.nis.domain.configuration.BaseCfg#initDefaultValue() @@ -46,5 +48,17 @@ public class AppStringCfg extends BaseStringCfg { public void setCompileId(Integer compileId) { this.compileId = compileId; } + + public static String getTablename() { + return tableName; + } + + public Integer getRatelimit() { + return ratelimit; + } + + public void setRatelimit(Integer ratelimit) { + this.ratelimit = ratelimit; + } } diff --git a/src/main/java/com/nis/web/controller/configuration/AppCfgController.java b/src/main/java/com/nis/web/controller/configuration/AppCfgController.java index 33e867cd8..fa8640511 100644 --- a/src/main/java/com/nis/web/controller/configuration/AppCfgController.java +++ b/src/main/java/com/nis/web/controller/configuration/AppCfgController.java @@ -1,12 +1,12 @@ package com.nis.web.controller.configuration; import java.util.Date; -import java.util.List; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.commons.lang3.StringUtils; +import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.ModelAttribute; @@ -14,16 +14,11 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.servlet.mvc.support.RedirectAttributes; import com.nis.domain.Page; -import com.nis.domain.ServiceConfigInfo; -import com.nis.domain.SystemServiceInfo; -import com.nis.domain.basics.ServiceDictInfo; -import com.nis.domain.basics.SysDictInfo; -import com.nis.domain.configuration.AppIdCfg; -import com.nis.domain.configuration.BaseCfg; -import com.nis.domain.configuration.RequestInfo; +import com.nis.domain.configuration.AppPolicyCfg; import com.nis.domain.specific.SpecificServiceCfg; -import com.nis.util.Constants; +import com.nis.exceptions.MaatConvertException; import com.nis.web.controller.BaseController; +import com.nis.web.security.UserUtils; /** * 特定协议相关配置控制类 @@ -31,270 +26,79 @@ import com.nis.web.controller.BaseController; * */ @Controller -@RequestMapping("${adminPath}/cfg/app") +@RequestMapping("${adminPath}/app") public class AppCfgController extends BaseController { - @RequestMapping(value = {"list"}) - public String cfgList(Model model,Integer audit,String cfgName,@ModelAttribute("cfg")AppIdCfg cfg,HttpServletRequest request,HttpServletResponse response) { - model.addAttribute("cfgName", cfgName); - model.addAttribute("audit", audit); - if(cfg!=null){ - Integer serviceId=cfg.getServiceId(); - logger.info("servcice id is "+serviceId); - if(serviceId!=null){ - model.addAttribute("serviceId", serviceId); - List serviceList=serviceConfigInfoService.findList(serviceId); - if(serviceList!=null){ - for(ServiceConfigInfo s:serviceList){ - if(s.getTableType()==2 || s.getTableType()==4){ - model.addAttribute("isContainFeaturesCfg", true); - break; - } - } - Page page = appCfgService.findPage(new Page(request, response,"r"), cfg); - model.addAttribute("page", page); - model.addAttribute("action", cfg.getAction()); - List requestInfos=requestInfoService.getValidRequestInfo(); - model.addAttribute("requestInfos", requestInfos); - List fls=serviceDictInfoService.findAllFlDict(); - model.addAttribute("fls", fls); - List xzs=serviceDictInfoService.findAllXzDict(); - model.addAttribute("xzs", xzs); - List lables=serviceDictInfoService.findAllLableDict(); - model.addAttribute("lables", lables); - SpecificServiceCfg specificServiceCfg = new SpecificServiceCfg(); - specificServiceCfg.setIsValid(1); - model.addAttribute("protocolList",specificServiceCfgService.findAllSpecificServiceCfg(specificServiceCfg,"spec_service_id DESC")); - }else{ - logger.error("未获取到正确的serviceId"); - } - } - } - - return "/cfg/appCfgList"; - } - - - @RequestMapping(value = {"form"}) - public String cfgForm(int action,String cfgName,Integer serviceId,Model model,HttpServletRequest request,HttpServletResponse response) { - model.addAttribute("action", action); - model.addAttribute("serviceId", serviceId); - model.addAttribute("audit", Constants.CFG_PAGE); - model.addAttribute("cfgName", cfgName); - logger.info("sercice id is "+serviceId); - -// SystemServiceInfo serviceInfo=systemServiceService.get(serviceId); -// model.addAttribute("serviceInfo", serviceInfo); - //来函信息 - List requestInfos=requestInfoService.getValidRequestInfo(); - model.addAttribute("requestInfos", requestInfos); - //分类信息 - List fls=serviceDictInfoService.findFlDict(); - model.addAttribute("fls", fls); - //性质信息 - List xzs=serviceDictInfoService.findXzDict(); - model.addAttribute("xzs", xzs); - //标签信息 - List lables=serviceDictInfoService.findLableDict(); - model.addAttribute("lables", lables); - //特定服务信息 - SpecificServiceCfg specificServiceCfg = new SpecificServiceCfg(); - specificServiceCfg.setIsValid(1); - model.addAttribute("protocolList",specificServiceCfgService.findAllSpecificServiceCfg(specificServiceCfg,"spec_service_id DESC")); - //协议特征配置 - List featuresList = serviceConfigInfoService.findList(serviceId); - model.addAttribute("featuresList",featuresList); - if(featuresList!=null){ - for(ServiceConfigInfo s:featuresList){ - if(s.getTableType()==2 || s.getTableType()==4){ - model.addAttribute("isContainFeaturesCfg", true); - break; - } - } - } - //特征作用域信息 - /*SysDictInfo sysDictInfo = new SysDictInfo(); - sysDictInfo.setItemType(3); - Integer[] itType = new Integer[0]; - List featuresAreaList = sysDictInfoService.findAllSysDictInfo(sysDictInfo,itType,null); - model.addAttribute("featuresAreaList", featuresAreaList);*/ - AppIdCfg cfg = new AppIdCfg(); - cfg.initDefaultValue(); - cfg.setAction(action); - cfg.setServiceId(serviceId.intValue()); - model.addAttribute("_cfg", cfg); - return "/cfg/appCfgForm"; - } - @RequestMapping(value = {"updateForm"}) - public String updateAppCfgForm(int action,long cfgId,String cfgName,Integer serviceId,Model model,HttpServletRequest request,HttpServletResponse response) { - model.addAttribute("cfgName", cfgName); - model.addAttribute("serviceId", serviceId); - model.addAttribute("action", action); - model.addAttribute("audit", Constants.CFG_PAGE); - - AppIdCfg searchBean=new AppIdCfg(); - searchBean.setCfgId(cfgId); - AppIdCfg cfg=appCfgService.getAppCfgById(searchBean); - model.addAttribute("_cfg", cfg); - List requestInfos=requestInfoService.getAllRequestInfo(); - model.addAttribute("requestInfos", requestInfos); - List fls=serviceDictInfoService.findAllFlDict(); - model.addAttribute("fls", fls); - List xzs=serviceDictInfoService.findAllXzDict(); - model.addAttribute("xzs", xzs); - List lables=serviceDictInfoService.findAllLableDict(); - model.addAttribute("lables", lables); - //特定服务信息 - SpecificServiceCfg specificServiceCfg = new SpecificServiceCfg(); - specificServiceCfg.setIsValid(1); - model.addAttribute("protocolList",specificServiceCfgService.findAllSpecificServiceCfg(specificServiceCfg,"spec_service_id DESC")); - //协议特征配置 - List featuresList = serviceConfigInfoService.findList(serviceId); - model.addAttribute("featuresList",featuresList); - return "/cfg/appCfgForm"; - } - @RequestMapping(value = {"showFeaturesCfg"}) - public String showFeaturesCfg(int action,long cfgId,Integer compileId,String cfgName,Integer serviceId,Model model,HttpServletRequest request,HttpServletResponse response){ - AppIdCfg cfg=new AppIdCfg(); - cfg.setCfgId(cfgId); - cfg.setCompileId(compileId); - cfg = appCfgService.findAppIdCfg(cfg); - model.addAttribute("_cfg", cfg); - model.addAttribute("cfgName", cfgName); - model.addAttribute("serviceId", serviceId); - model.addAttribute("action", action); - //协议特征配置 - List featuresList = serviceConfigInfoService.findList(serviceId); - model.addAttribute("featuresList",featuresList); - return "/cfg/appFeaturesCfg"; - } - /** - * - * addAppCfg(新增IP配置) - * (这里描述这个方法适用条件 – 可选) - * @return - *String - * @exception - * @since 1.0.0 + * app策略列表 + * @param model + * @param cfg + * @param request + * @param response + * @return */ - @RequestMapping(value = {"saveOrUpdateCfg"}) - public String saveOrUpdateAppCfg(String cfgName,Model model, AppIdCfg cfg) { - model.addAttribute("audit", Constants.CFG_PAGE); - model.addAttribute("cfgType","app"); - model.addAttribute("cfgName",cfgName); - model.addAttribute("serviceId",cfg.getServiceId()); - model.addAttribute("action",cfg.getAction()); - logger.info("saveOrUpdateAppCfg loaded"); - if(cfg==null){ - logger.error("无法保存空的配置!"); - addMessage(model,"save_failed"); + @RequestMapping(value = {"policyList"}) + public String policyList(Model model,@ModelAttribute("cfg")AppPolicyCfg cfg,HttpServletRequest request,HttpServletResponse response) { + Page searchPage=new Page(request,response,"r"); + Page page = appCfgService.findAppPolicyList(searchPage, cfg); + for(AppPolicyCfg entity:page.getList()){ + SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId()); + entity.setAppName(app.getSpecServiceName()); + } + model.addAttribute("page", page); + initPageCondition(model,cfg); + return "/cfg/app/appPolicyCfgList"; + } + @RequestMapping(value = {"policyForm"}) + @RequiresPermissions(value={"app:policy:config"}) + public String policyForm(Model model,String ids,AppPolicyCfg entity) { + if(StringUtils.isNotBlank(ids)){ + entity = appCfgService.getAppPolicyCfg(Long.parseLong(ids)); + initUpdateFormCondition(model,entity); }else{ - SpecificServiceCfg protocol = specificServiceCfgService.getBySpecServiceId(cfg.getAppId().intValue()); - if(protocol!=null){ - cfg.setAppName(protocol.getSpecServiceName()); - int serviceId=cfg.getServiceId(); - cfg.setIsValid(Constants.VALID_NO); - cfg.setIsAudit(Constants.AUDIT_NOT_YET); - if(cfg.getCfgId()==null){ - cfg.setCreatorId(cfg.getCurrentUser().getId()); - cfg.setCreateTime(new Date()); - try { - appCfgService.addAppCfg(cfg); - } catch (Exception e) { - e.printStackTrace(); - logger.error("配置保存失败!"+e.getMessage()); - addMessage(model,"save_failed"); - } - }else{ - cfg.setEditorId(cfg.getCurrentUser().getId()); - cfg.setEditTime(new Date()); - try { - appCfgService.updateAppCfg(cfg); - } catch (Exception e) { - e.printStackTrace(); - logger.error("配置保存失败!"+e.getMessage()); - addMessage(model,"save_failed"); - } - } - model.addAttribute("serviceId",serviceId); - model.addAttribute("action",cfg.getAction()); - addMessage(model,"save_success"); - }else{ - logger.error("所选协议信息无效!"); - addMessage(model,"save_failed"); - } - + initFormCondition(model,entity); } - return "/cfg/resultPage";//StringEscapeUtils.escapeHtml4("?serviceId="+cfg.getServiceId()+"&action="+cfg.getAction()+"&cfgName="+cfgName); + model.addAttribute("_cfg", entity); + return "/cfg/app/appPolicyCfgForm"; } - - /** - * - * auditAppCfg(审核IP配置) - * (这里描述这个方法适用条件 – 可选) - * @return - *String - * @exception - * @since 1.0.0 - */ - @RequestMapping(value = {"auditCfg"}) - public String auditAppCfg(String cfgName,String ids,Integer auditState,Integer serviceId,Integer action, - Model model,RedirectAttributes redirectAttributes) { - model.addAttribute("cfgName", cfgName); - model.addAttribute("audit", Constants.AUDIT_PAGE); - model.addAttribute("serviceId", serviceId); - model.addAttribute("action",action); - model.addAttribute("cfgType","app"); + @RequestMapping(value = {"saveAppPolicyCfg"}) + @RequiresPermissions(value={"app:policy:config"}) + public String saveAppPolicyCfg(Model model,HttpServletRequest request,HttpServletResponse response, + AppPolicyCfg entity,RedirectAttributes redirectAttributes) { try { - String[] cfgIds = ids.split(","); - int result=appCfgService.auditAppCfg(cfgIds,auditState); - if(result==1){ - addMessage(model,"audit_success"); - }else{ - addMessage(model,"audit_failed"); - } + appCfgService.saveOrUpdateAppPolicyCfg(entity); } catch (Exception e) { e.printStackTrace(); - logger.error("配置下发maat失败,"+e.getMessage()); - addMessage(model,"audit_failed"); + addMessage(redirectAttributes, e.getMessage()); } - return "/cfg/resultPage"; + + return "redirect:" + adminPath +"/app/policyList?function="+entity.getFunctionId(); } - /** - * - * auditAppCfg(删除IP配置,逻辑删除) - * (这里描述这个方法适用条件 – 可选) - * @return - *String - * @exception - * @since 1.0.0 - */ - @RequestMapping(value = {"deleteCfg"}) - public String deleteAppCfg(int action,String ids,String cfgName,Integer serviceId,Model model,RedirectAttributes redirectAttributes) { - model.addAttribute("serviceId", serviceId); - model.addAttribute("cfgName", cfgName); - model.addAttribute("action", action); - model.addAttribute("cfgType","app"); - model.addAttribute("audit", Constants.CFG_PAGE); - String[] cfgIds = ids.split(","); - int result=appCfgService.deleteAppCfg(cfgIds); - if(result==1){ - addMessage(redirectAttributes,"delete_success"); - }else{ - addMessage(redirectAttributes,"delete_failed"); + @RequestMapping(value = {"auditAppPolicyCfg"}) + @RequiresPermissions(value={"app:policy:audit"}) + public String auditAppPolicyCfg(Integer isAudit,Integer isValid,String ids,Integer functionId, RedirectAttributes redirectAttributes) { + AppPolicyCfg entity = new AppPolicyCfg(); + String[] idArray = ids.split(","); + for(String id :idArray){ + entity = appCfgService.getAppPolicyCfg(Long.parseLong(id)); + entity.setIsAudit(isAudit); + entity.setIsValid(isValid); + entity.setAuditorId(UserUtils.getUser().getId()); + entity.setAuditTime(new Date()); + entity.setFunctionId(functionId); + try { + appCfgService.auditAppPolicyCfg(entity,isAudit); + } catch (MaatConvertException e) { + e.printStackTrace(); + logger.info("app策略配置下发失败:"+e.getMessage()); + addMessage(redirectAttributes, e.getMessage()); + } } - return "/cfg/resultPage"; + return "redirect:" + adminPath +"/app/policyList?functionId="+functionId; } - /** - * - * getCompileId(获取编译ID) - * (这里描述这个方法适用条件 – 可选) - * @return - *long - * @exception - * @since 1.0.0 - */ - protected Integer getCompileId(BaseCfg cfg){ - return 0; + @RequestMapping(value = {"updateAppPolicyCfgValid"}) + @RequiresPermissions(value={"app:policy:config"}) + public String updateAppPolicyCfgValid(Integer isValid,String ids,Integer functionId) { + appCfgService.updateAppPolicyCfgValid(isValid,ids,functionId); + return "redirect:" + adminPath +"/app/policyList?functionId="+functionId; } } diff --git a/src/main/java/com/nis/web/dao/configuration/AppCfgDao.java b/src/main/java/com/nis/web/dao/configuration/AppCfgDao.java index 5e2fe35e1..317336b02 100644 --- a/src/main/java/com/nis/web/dao/configuration/AppCfgDao.java +++ b/src/main/java/com/nis/web/dao/configuration/AppCfgDao.java @@ -5,10 +5,17 @@ import java.util.List; import org.apache.ibatis.annotations.Param; +import com.nis.domain.configuration.AppByteCfg; import com.nis.domain.configuration.AppComplexKeywordCfg; +import com.nis.domain.configuration.AppDomainCfg; +import com.nis.domain.configuration.AppHttpCfg; import com.nis.domain.configuration.AppIdCfg; import com.nis.domain.configuration.AppIdCfg.AppFeaturesIndex; +import com.nis.domain.configuration.AppInnerRuleCfg; +import com.nis.domain.configuration.AppIpCfg; +import com.nis.domain.configuration.AppPolicyCfg; import com.nis.domain.configuration.AppStringCfg; +import com.nis.domain.configuration.BaseCfg; import com.nis.domain.configuration.BaseStringCfg; import com.nis.domain.configuration.ComplexkeywordCfg; import com.nis.web.dao.CrudDao; @@ -21,27 +28,39 @@ import com.nis.web.dao.MyBatisDao; * */ @MyBatisDao -public interface AppCfgDao extends CrudDao { - public AppIdCfg getById(@Param("cfgId")Long id) ; - public AppIdCfg get(AppIdCfg entity) ; - public List findList(AppIdCfg entity) ; - public int insert(AppIdCfg entity) ; - public int updateByPrimaryKeySelective(AppIdCfg entity) ; - public int updateValid(AppIdCfg entity) ; - public int audit(AppIdCfg entity) ; - public int updateFeaturesTableValid(@Param("tableName")String tableName,@Param("compileId")Integer compileId, - @Param("isValid")Integer isValid,@Param("editorId")Long editorId,@Param("editTime")Date editTime) ; - public int auditFeaturesTable(@Param("tableName")String tableName,@Param("compileId")Integer compileId, - @Param("isValid")Integer isValid,@Param("isAudit")Integer isAudit, - @Param("auditorId")Long auditorId,@Param("auditTime")Date auditTime) ; - public int getIsValid(@Param("tableName")String tableName,@Param("cfgId")Long id); - public int getIsValid(@Param("cfgId")Long id); - public int getIsAudit(@Param("tableName")String tableName,@Param("cfgId")Long id); - public int getIsAudit(@Param("cfgId")Long id); - public List getFeaturesTableListByAppCompileId(@Param("appCompileId")Integer appCompileId) ; - public int insertFeatures(AppFeaturesIndex entity) ; - public int updateFeaturesByAppId(AppFeaturesIndex entity) ; - public int deleteFeaturesByAppId(AppFeaturesIndex entity) ; - public List getComplexkeywordFeaturesCfgListByCompileId(@Param("featuresTable") String featuresTable,@Param("compileId")Integer compileId); - public List getStrFeaturesCfgListByCompileId(@Param("featuresTable") String featuresTable,@Param("compileId")Integer compileId); +public interface AppCfgDao { + //app策略配置增删改查 + public List findAppPolicyList(AppPolicyCfg entity) ; + public AppPolicyCfg getAppPolicyCfg(Long cfgId) ; + public int insertAppPolicyCfg(AppPolicyCfg entity); + public int updateAppPolicyCfg(AppPolicyCfg entity); + //app协议IP配置增删改查 + public List findAppIpList(AppIpCfg entity) ; + public AppIpCfg getAppIpCfg(Long cfgId) ; + public int insertAppIpCfg(AppIpCfg entity); + public int updateAppIpCfg(AppIpCfg entity); + //app http特征增删改查 + public List findAppHttpList(AppHttpCfg entity) ; + public AppHttpCfg getAppHttpCfg(Long cfgId) ; + public int insertAppHttpCfg(AppHttpCfg entity); + public int updateAppHttpCfg(AppHttpCfg entity); + //app 域名配置增删改查 + public List findAppDomainList(AppDomainCfg entity) ; + public AppDomainCfg getAppDomainCfg(Long cfgId) ; + public int insertAppDomainCfg(AppDomainCfg entity); + public int updateAppDomainCfg(AppDomainCfg entity); + //app 字节特征增删改查 + public List findAppByteList(AppByteCfg entity) ; + public AppByteCfg getAppByteCfg(Long cfgId) ; + public int insertAppByteCfg(AppByteCfg entity); + public int updateAppByteCfg(AppByteCfg entity); + //app内置文件增删改查 + public List findAppInnerRuleList(AppInnerRuleCfg entity) ; + public AppInnerRuleCfg getAppInnerRuleCfg(Long cfgId) ; + public int insertAppInnerRuleCfg(AppInnerRuleCfg entity); + public int updateAppInnerRuleCfg(AppInnerRuleCfg entity); + //审核配置 + public void auditCfg(BaseCfg entity); + //修改配置状态 + public void updateCfgValid(BaseCfg entity); } diff --git a/src/main/java/com/nis/web/dao/configuration/AppCfgDao.xml b/src/main/java/com/nis/web/dao/configuration/AppCfgDao.xml index 0a61ec8b0..89999080f 100644 --- a/src/main/java/com/nis/web/dao/configuration/AppCfgDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/AppCfgDao.xml @@ -1,10 +1,10 @@ - + - - + + @@ -22,99 +22,227 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - - CFG_ID, CFG_DESC, CFG_KEYWORDS,ACTION,IS_VALID,IS_AUDIT, - CREATOR_ID,CREATE_TIME,EDITOR_ID,EDIT_TIME,AUDITOR_ID,AUDIT_TIME, - SERVICE_ID,REQUEST_ID,COMPILE_ID,IS_AREA_EFFECTIVE,CLASSIFY, - ATTRIBUTE,LABLE,AREA_EFFECTIVE_IDS,EXPR_TYPE,MATCH_METHOD,IS_HEXBIN + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + r.CFG_ID, r.APP_CODE,r.SPEC_SERVICE_ID,r.CFG_DESC,r.ACTION,r.IS_VALID,r.IS_AUDIT, + r.CREATOR_ID,r.CREATE_TIME,r.EDITOR_ID,r.EDIT_TIME,r.AUDITOR_ID,r.AUDIT_TIME, + r.SERVICE_ID,r.REQUEST_ID,r.COMPILE_ID,r.IS_AREA_EFFECTIVE,r.CLASSIFY, + r.ATTRIBUTE,r.LABLE,r.AREA_EFFECTIVE_IDS,r.RATELIMIT,r.FUNCTION_ID, + r.CFG_TYPE,r.CFG_REGION_CODE,r.EXPR_TYPE,r.MATCH_METHOD,r.IS_HEXBIN - - CFG_ID, CFG_DESC,DISTRICT, KEYWORDS,ACTION,IS_VALID,IS_AUDIT, - CREATOR_ID,CREATE_TIME,EDITOR_ID,EDIT_TIME,AUDITOR_ID,AUDIT_TIME, - SERVICE_ID,REQUEST_ID,COMPILE_ID,IS_AREA_EFFECTIVE,CLASSIFY, - ATTRIBUTE,LABLE,AREA_EFFECTIVE_IDS,EXPR_TYPE,MATCH_METHOD,IS_HEXBIN + + r.CFG_ID, r.APP_CODE,r.SPEC_SERVICE_ID, r.CFG_DESC,r.ACTION,r.IS_VALID,r.IS_AUDIT, + r.CREATOR_ID,r.CREATE_TIME,r.EDITOR_ID,r.EDIT_TIME,r.AUDITOR_ID,r.AUDIT_TIME, + r.SERVICE_ID,r.REQUEST_ID,r.COMPILE_ID,r.IS_AREA_EFFECTIVE,r.CLASSIFY, + r.ATTRIBUTE,r.LABLE,AREA_EFFECTIVE_IDS,r.RATELIMIT,r.FUNCTION_ID,r.CFG_TYPE,r.CFG_REGION_CODE, + r.IP_TYPE, r.IP_PATTERN, r.SRC_IP_ADDRESS,r.DEST_IP_ADDRESS, r.PORT_PATTERN,r.SRC_PORT,DEST_PORT, + r.DIRECTION,r.PROTOCOL - - CFG_ID, CFG_DESC,APP_NAME, APP_ID,ACTION,IS_VALID,IS_AUDIT, - CREATOR_ID,CREATE_TIME,EDITOR_ID,EDIT_TIME,AUDITOR_ID,AUDIT_TIME, - SERVICE_ID,REQUEST_ID,COMPILE_ID,IS_AREA_EFFECTIVE,CLASSIFY, - ATTRIBUTE,LABLE,AREA_EFFECTIVE_IDS + + r.CFG_ID, r.APP_CODE,r.SPEC_SERVICE_ID,r.CFG_DESC,ACTION,r.IS_VALID,r.IS_AUDIT, + r.CREATOR_ID,r.CREATE_TIME,r.EDITOR_ID,r.EDIT_TIME,r.AUDITOR_ID,r.AUDIT_TIME, + r.SERVICE_ID,r.REQUEST_ID,r.COMPILE_ID,r.IS_AREA_EFFECTIVE,r.CLASSIFY, + r.ATTRIBUTE,r.LABLE,r.AREA_EFFECTIVE_IDS,r.RATELIMIT,r.FUNCTION_ID,r.CFG_TYPE,r.CFG_REGION_CODE, + r.DISTRICT,r.CFG_KEYWORDS,r.EXPR_TYPE,r.MATCH_METHOD,r.IS_HEXBIN + + + + r.CFG_ID, r.APP_CODE,r.SPEC_SERVICE_ID,r.CFG_DESC,r.ACTION,r.IS_VALID,r.IS_AUDIT, + r.CREATOR_ID,r.CREATE_TIME,r.EDITOR_ID,r.EDIT_TIME,r.AUDITOR_ID,r.AUDIT_TIME, + r.SERVICE_ID,r.REQUEST_ID,r.COMPILE_ID,r.IS_AREA_EFFECTIVE,r.CLASSIFY, + r.ATTRIBUTE,r.LABLE,r.AREA_EFFECTIVE_IDS,r.RATELIMIT,r.FUNCTION_ID,r.CFG_TYPE,r.CFG_REGION_CODE, + r.DOMAIN,r.EXPR_TYPE,r.MATCH_METHOD,r.IS_HEXBIN - + + r.CFG_ID, r.APP_CODE,r.SPEC_SERVICE_ID,r.CFG_DESC,r.ACTION,r.IS_VALID,r.IS_AUDIT, + r.CREATOR_ID,r.CREATE_TIME,r.EDITOR_ID,r.EDIT_TIME,r.AUDITOR_ID,r.AUDIT_TIME, + r.SERVICE_ID,r.REQUEST_ID,r.COMPILE_ID,r.IS_AREA_EFFECTIVE,r.CLASSIFY, + r.ATTRIBUTE,r.LABLE,r.AREA_EFFECTIVE_IDS,r.RATELIMIT,r.FUNCTION_ID,r.CFG_TYPE,r.CFG_REGION_CODE, + r.BYTES,r.EXPR_TYPE,r.MATCH_METHOD,r.IS_HEXBIN + + + + r.CFG_ID, r.APP_CODE,r.SPEC_SERVICE_ID,r.CFG_DESC,r.ACTION,r.IS_VALID,r.IS_AUDIT, + r.CREATOR_ID,r.CREATE_TIME,r.EDITOR_ID,r.EDIT_TIME,r.AUDITOR_ID,r.AUDIT_TIME, + r.SERVICE_ID,r.REQUEST_ID,r.COMPILE_ID,r.IS_AREA_EFFECTIVE,r.CLASSIFY, + r.ATTRIBUTE,r.LABLE,r.AREA_EFFECTIVE_IDS,r.RATELIMIT,r.FUNCTION_ID,r.CFG_TYPE,r.CFG_REGION_CODE, + r.RULE_FILE,r.EXPR_TYPE,r.MATCH_METHOD,r.IS_HEXBIN + + + #{appCode,jdbcType=VARCHAR},#{specServiceId,jdbcType=INTEGER}, + #{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},#{ratelimit,jdbcType=INTEGER},#{functionId,jdbcType=INTEGER}, + #{cfgType,jdbcType=VARCHAR},#{cfgRegionCode,jdbcType=INTEGER} + + + - SELECT - - FROM app_id_cfg - - - AND CFG_ID=#{cfgId,jdbcType=BIGINT} - - - AND CFG_DESC=#{cfgDesc,jdbcType=VARCHAR} - - - AND APP_NAME=#{appName,jdbcType=VARCHAR} - - - AND APP_ID=#{appId,jdbcType=BIGINT} - - - AND ACTION=#{action,jdbcType=INTEGER} - - - AND IS_VALID=#{isValid,jdbcType=INTEGER} - - - AND IS_AUDIT=#{isAudit,jdbcType=INTEGER} - - - AND CREATOR_ID=#{creatorId,jdbcType=INTEGER} - - - AND CREATE_TIME=#{createTime,jdbcType=TIMESTAMP} - - - AND EDITOR_ID=#{editorId,jdbcType=INTEGER} - - - AND EDIT_TIME=#{editTime,jdbcType=TIMESTAMP} - - - AND AUDITOR_ID=#{auditorId,jdbcType=INTEGER} - - - AND AUDIT_TIME=#{auditTime,jdbcType=TIMESTAMP} - - - AND SERVICE_ID=#{serviceId,jdbcType=INTEGER} - - - AND REQUEST_ID=#{requestId,jdbcType=INTEGER} - - - AND COMPILE_ID=#{compileId,jdbcType=INTEGER} - - - AND IS_AREA_EFFECTIVE=#{isAreaEffective,jdbcType=INTEGER} - - - AND classify=#{classify,jdbcType=VARCHAR} - - - AND attribute=#{attribute,jdbcType=VARCHAR} - - - AND lable=#{lable,jdbcType=VARCHAR} - - - AND AREA_EFFECTIVE_IDS=#{areaEffectiveIds,jdbcType=VARCHAR} - - + + FROM app_ip_cfg r + WHERE CFG_ID = #{cfgId,jdbcType=BIGINT} - + SELECT + + FROM app_http_cfg r + WHERE CFG_ID = #{cfgId,jdbcType=BIGINT} + + + + + + - select - - - ${page.fields} - - - - - - from app_id_cfg + + + , s.name as creator_name,e.name as editor_name,u.name as auditor_name + ,ri.request_title as requestName + + from app_ip_cfg r + left join sys_user s on r.creator_id=s.id + left join sys_user e on r.editor_id=e.id + left join sys_user u on r.auditor_id=u.id + left join request_info ri on r.request_id=ri.id - - AND ${page.where} - + + + AND r.function_id=#{functionId,jdbcType=INTEGER} + + + AND r.CFG_ID=#{cfgId,jdbcType=BIGINT} + + + AND r.CFG_DESC like concat(concat('%',#{cfgDesc,jdbcType=VARCHAR}),'%') + + + AND r.spec_service_id=#{specServiceId,jdbcType=INTEGER} + + + AND r.CFG_TYPE like concat(concat('%',#{CFG_TYPE,jdbcType=VARCHAR}),'%') + + + AND r.IP_TYPE=#{ipType,jdbcType=INTEGER} + + + AND r.IP_PATTERN=#{ipPattern,jdbcType=INTEGER} + + + AND r.SRC_IP_ADDRESS=#{srcIpAddress,jdbcType=VARCHAR} + + + AND r.DEST_IP_ADDRESS=#{destIpAddress,jdbcType=VARCHAR} + + + AND r.PORT_PATTERN=#{portPattern,jdbcType=INTEGER} + + + AND r.SRC_PORT=#{srcPort,jdbcType=VARCHAR} + + + AND r.DEST_PORT=#{destPort,jdbcType=VARCHAR} + + + AND r.DIRECTION=#{direction,jdbcType=INTEGER} + + + AND r.PROTOCOL=#{protocol,jdbcType=INTEGER} + + + AND r.ACTION=#{action,jdbcType=INTEGER} + + + AND r.IS_VALID=#{isValid,jdbcType=INTEGER} + + + AND r.IS_VALID != -1 + + + AND r.IS_AUDIT=#{isAudit,jdbcType=INTEGER} + + + AND CREATOR_NAME like concat(concat('%',#{creatorName,jdbcType=VARCHAR}),'%') + + + AND r.CREATE_TIME=#{createTime,jdbcType=TIMESTAMP} + + + AND EDITOR_NAME like concat(concat('%',#{editorName,jdbcType=VARCHAR}),'%') + + + AND r.EDIT_TIME=#{editTime,jdbcType=TIMESTAMP} + + + AND AUDITOR_NAME like concat(concat('%',#{auditorName,jdbcType=VARCHAR}),'%') + + + AND r.AUDIT_TIME=#{auditTime,jdbcType=TIMESTAMP} + + + AND r.SERVICE_ID=#{serviceId,jdbcType=INTEGER} + + + AND r.REQUEST_ID=#{requestId,jdbcType=INTEGER} + + + AND r.COMPILE_ID=#{compileId,jdbcType=INTEGER} + + + AND r.IS_AREA_EFFECTIVE=#{isAreaEffective,jdbcType=INTEGER} + + + AND r.classify like concat(concat('%',#{classify,jdbcType=VARCHAR}),'%') + + + AND r.attribute like concat(concat('%',#{attribute,jdbcType=VARCHAR}),'%') + + + AND r.lable like concat(concat('%',#{lable,jdbcType=VARCHAR}),'%') + + + AND r.AREA_EFFECTIVE_IDS like concat(concat('%',#{areaEffectiveIds,jdbcType=VARCHAR}),'%') + + @@ -415,28 +523,500 @@ - + + + + + + SELECT LAST_INSERT_ID() - insert into app_id_cfg ( - + insert into app_policy_cfg ( + APP_CODE,SPEC_SERVICE_ID,CFG_DESC,ACTION,IS_VALID,IS_AUDIT, + CREATOR_ID,CREATE_TIME,EDITOR_ID,EDIT_TIME,AUDITOR_ID,AUDIT_TIME, + SERVICE_ID,REQUEST_ID,COMPILE_ID,IS_AREA_EFFECTIVE,CLASSIFY, + ATTRIBUTE,LABLE,AREA_EFFECTIVE_IDS,RATELIMIT,FUNCTION_ID, + CFG_TYPE,CFG_REGION_CODE,EXPR_TYPE,MATCH_METHOD,IS_HEXBIN )values ( - + , + #{exprType,jdbcType=INTEGER},#{matchMethod,jdbcType=INTEGER},#{isHexbin,jdbcType=INTEGER} ) - - update app_id_cfg + + + SELECT LAST_INSERT_ID() + + insert into app_ip_cfg ( + APP_CODE,SPEC_SERVICE_ID, CFG_DESC,ACTION,IS_VALID,IS_AUDIT, + CREATOR_ID,CREATE_TIME,EDITOR_ID,EDIT_TIME,AUDITOR_ID,AUDIT_TIME, + SERVICE_ID,REQUEST_ID,COMPILE_ID,IS_AREA_EFFECTIVE,CLASSIFY, + ATTRIBUTE,LABLE,AREA_EFFECTIVE_IDS,RATELIMIT,FUNCTION_ID,CFG_TYPE,CFG_REGION_CODE, + IP_TYPE, IP_PATTERN, SRC_IP_ADDRESS,DEST_IP_ADDRESS, PORT_PATTERN,SRC_PORT,DEST_PORT, + DIRECTION,PROTOCOL + )values ( + , + #{ipType,jdbcType=INTEGER}, #{ipPattern,jdbcType=INTEGER},#{srcIpAddress,jdbcType=VARCHAR},#{destIpAddress,jdbcType=VARCHAR}, + #{portPattern,jdbcType=INTEGER},#{srcPort,jdbcType=VARCHAR},#{destPort,jdbcType=VARCHAR},#{direction,jdbcType=INTEGER}, + #{protocol,jdbcType=INTEGER} + ) + + + + SELECT LAST_INSERT_ID() + + insert into app_http_cfg ( + APP_CODE,SPEC_SERVICE_ID,CFG_DESC,ACTION,IS_VALID,IS_AUDIT, + CREATOR_ID,CREATE_TIME,EDITOR_ID,EDIT_TIME,AUDITOR_ID,AUDIT_TIME, + SERVICE_ID,REQUEST_ID,COMPILE_ID,IS_AREA_EFFECTIVE,CLASSIFY, + ATTRIBUTE,LABLE,AREA_EFFECTIVE_IDS,RATELIMIT,FUNCTION_ID,CFG_TYPE,CFG_REGION_CODE, + DISTRICT,CFG_KEYWORDS,EXPR_TYPE,MATCH_METHOD,IS_HEXBIN + )values ( + , + #{district,jdbcType=VARCHAR},#{cfgKeywords,jdbcType=VARCHAR}, + #{exprType,jdbcType=INTEGER},#{matchMethod,jdbcType=INTEGER},#{isHexbin,jdbcType=INTEGER} + ) + + + + SELECT LAST_INSERT_ID() + + insert into app_domain_cfg ( + APP_CODE,SPEC_SERVICE_ID,CFG_DESC,ACTION,IS_VALID,IS_AUDIT, + CREATOR_ID,CREATE_TIME,EDITOR_ID,EDIT_TIME,AUDITOR_ID,AUDIT_TIME, + SERVICE_ID,REQUEST_ID,COMPILE_ID,IS_AREA_EFFECTIVE,CLASSIFY, + ATTRIBUTE,LABLE,AREA_EFFECTIVE_IDS,RATELIMIT,FUNCTION_ID,CFG_TYPE,CFG_REGION_CODE, + DOMAIN,EXPR_TYPE,MATCH_METHOD,IS_HEXBIN + )values ( + , + #{domain,jdbcType=VARCHAR}, + #{exprType,jdbcType=INTEGER},#{matchMethod,jdbcType=INTEGER},#{isHexbin,jdbcType=INTEGER} + ) + + + + SELECT LAST_INSERT_ID() + + insert into app_byte_cfg ( + APP_CODE,SPEC_SERVICE_ID,CFG_DESC,ACTION,IS_VALID,IS_AUDIT, + CREATOR_ID,CREATE_TIME,EDITOR_ID,EDIT_TIME,AUDITOR_ID,AUDIT_TIME, + SERVICE_ID,REQUEST_ID,COMPILE_ID,IS_AREA_EFFECTIVE,CLASSIFY, + ATTRIBUTE,LABLE,AREA_EFFECTIVE_IDS,RATELIMIT,FUNCTION_ID,CFG_TYPE,CFG_REGION_CODE, + BYTES,EXPR_TYPE,MATCH_METHOD,IS_HEXBIN + )values ( + , + #{bytes,jdbcType=VARCHAR}, + #{exprType,jdbcType=INTEGER},#{matchMethod,jdbcType=INTEGER},#{isHexbin,jdbcType=INTEGER} + ) + + + + SELECT LAST_INSERT_ID() + + insert into app_inner_rule_cfg ( + APP_CODE,SPEC_SERVICE_ID,CFG_DESC,ACTION,IS_VALID,IS_AUDIT, + CREATOR_ID,CREATE_TIME,EDITOR_ID,EDIT_TIME,AUDITOR_ID,AUDIT_TIME, + SERVICE_ID,REQUEST_ID,COMPILE_ID,IS_AREA_EFFECTIVE,CLASSIFY, + ATTRIBUTE,LABLE,AREA_EFFECTIVE_IDS,RATELIMIT,FUNCTION_ID,CFG_TYPE,CFG_REGION_CODE, + RULE_FILE,EXPR_TYPE,MATCH_METHOD,IS_HEXBIN + )values ( + , + #{ruleFile,jdbcType=VARCHAR}, + #{exprType,jdbcType=INTEGER},#{matchMethod,jdbcType=INTEGER},#{isHexbin,jdbcType=INTEGER} + ) + + + + update app_policy_cfg cfg_desc = #{cfgDesc,jdbcType=VARCHAR}, - - APP_NAME = #{appName,jdbcType=VARCHAR}, + + APP_CODE = #{appCode,jdbcType=VARCHAR}, - - APP_ID = #{appId,jdbcType=BIGINT}, + + SPEC_SERVICE_ID = #{specServiceId,jdbcType=INTEGER}, action = #{action,jdbcType=INTEGER}, @@ -489,84 +1069,439 @@ area_effective_ids = #{areaEffectiveIds,jdbcType=VARCHAR}, + + function_id = #{functionId,jdbcType=INTEGER}, + + + RATELIMIT=#{ratelimit,jdbcType=INTEGER}, + + + CFG_REGION_CODE=#{cfgRegionCode,jdbcType=INTEGER}, + + + CFG_TYPE =#{cfgType,jdbcType=VARCHAR}, + where cfg_id = #{cfgId,jdbcType=BIGINT} - - update app_id_cfg set is_valid = #{isValid,jdbcType=INTEGER}, editor_id = #{editorId,jdbcType=INTEGER} , edit_time = #{editTime,jdbcType=TIMESTAMP} where cfg_id = #{cfgId,jdbcType=BIGINT} - - - update app_id_cfg set is_audit = #{isAudit,jdbcType=INTEGER}, auditor_id = #{auditorId,jdbcType=INTEGER}, audit_time = #{auditTime,jdbcType=TIMESTAMP} - - ,is_valid = #{isValid,jdbcType=INTEGER} - - where cfg_id = #{cfgId,jdbcType=BIGINT} - - - update ${tableName} set is_valid = #{isValid,jdbcType=INTEGER}, editor_id = #{editorId,jdbcType=INTEGER} , edit_time = #{editTime,jdbcType=TIMESTAMP} where compile_id = #{compileId,jdbcType=INTEGER} - - - update ${tableName} set is_audit = #{isAudit,jdbcType=INTEGER}, auditor_id = #{auditorId,jdbcType=INTEGER}, audit_time = #{auditTime,jdbcType=TIMESTAMP} - - ,is_valid = #{isValid,jdbcType=INTEGER} - - where compile_id = #{compileId,jdbcType=INTEGER} - - - - - - - - - - - - insert into app_features_index (INDEX_ID,APP_COMPILE_ID,FEATURES_TABLE,FEATURES_COMPILE_ID,FEATURES_TABLE_TYPE) - values - (#{indexId,jdbcType=BIGINT},#{appCompileId,jdbcType=INTEGER},#{featuresTable,jdbcType=VARCHAR}, - #{featuresCompileId,jdbcType=INTEGER},#{featuresTableType,jdbcType=INTEGER} - ) - - - - \ No newline at end of file diff --git a/src/main/java/com/nis/web/service/BaseService.java b/src/main/java/com/nis/web/service/BaseService.java index fd8d8883f..67394ecbd 100644 --- a/src/main/java/com/nis/web/service/BaseService.java +++ b/src/main/java/com/nis/web/service/BaseService.java @@ -580,13 +580,16 @@ public abstract class BaseService { } } public static String keywordsEscape(String cfgKeywords){ - //不转译特殊字符 - cfgKeywords = StringEscapeUtils.unescapeHtml4(cfgKeywords); - cfgKeywords=cfgKeywords.replace("\\", "\\\\"); - cfgKeywords=cfgKeywords.replace("&", "\\&"); - cfgKeywords=cfgKeywords.replace(" ", "\\b"); - //***and***在界面表示多个关键字的与表达式,此特殊字符串在common.js中使用定义,maat端以&表示 - cfgKeywords=cfgKeywords.replace(Constants.KEYWORD_EXPR, "&"); + if(StringUtils.isNotEmpty(cfgKeywords)){ + //不转译特殊字符 + cfgKeywords = StringEscapeUtils.unescapeHtml4(cfgKeywords); + cfgKeywords=cfgKeywords.replace("\\", "\\\\"); + cfgKeywords=cfgKeywords.replace("&", "\\&"); + cfgKeywords=cfgKeywords.replace(" ", "\\b"); + //***and***在界面表示多个关键字的与表达式,此特殊字符串在common.js中使用定义,maat端以&表示 + cfgKeywords=cfgKeywords.replace(Constants.KEYWORD_EXPR, "&"); + + } return cfgKeywords; } } diff --git a/src/main/java/com/nis/web/service/configuration/AppCfgService.java b/src/main/java/com/nis/web/service/configuration/AppCfgService.java index cecfee383..5e1d5d6f7 100644 --- a/src/main/java/com/nis/web/service/configuration/AppCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/AppCfgService.java @@ -3,35 +3,36 @@ package com.nis.web.service.configuration; import java.util.ArrayList; import java.util.Date; import java.util.List; +import java.util.Map; +import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; import com.nis.domain.Page; -import com.nis.domain.ServiceConfigInfo; -import com.nis.domain.configuration.AppComplexKeywordCfg; -import com.nis.domain.configuration.AppIdCfg; -import com.nis.domain.configuration.AppIdCfg.AppFeaturesIndex; -import com.nis.domain.configuration.AppStringCfg; -import com.nis.domain.configuration.BaseIpCfg; -import com.nis.domain.maat.AppMaatCfg; -import com.nis.domain.specific.ConfigGroupInfo; -import com.nis.domain.specific.SpecificServiceCfg; -import com.nis.domain.specific.SpecificServiceHostCfg; -import com.nis.main.ConvertTool; +import com.nis.domain.configuration.AppByteCfg; +import com.nis.domain.configuration.AppDomainCfg; +import com.nis.domain.configuration.AppHttpCfg; +import com.nis.domain.configuration.AppIpCfg; +import com.nis.domain.configuration.AppPolicyCfg; +import com.nis.domain.configuration.AreaIpCfg; +import com.nis.domain.maat.MaatCfg; +import com.nis.domain.maat.ToMaatBean; +import com.nis.domain.maat.ToMaatResult; +import com.nis.domain.maat.MaatCfg.DigestCfg; +import com.nis.domain.maat.MaatCfg.GroupCfg; +import com.nis.domain.maat.MaatCfg.IpCfg; +import com.nis.domain.maat.MaatCfg.NumBoundaryCfg; +import com.nis.domain.maat.MaatCfg.StringCfg; +import com.nis.exceptions.MaatConvertException; +import com.nis.util.ConfigServiceUtil; import com.nis.util.Constants; import com.nis.util.StringUtil; import com.nis.web.dao.configuration.AppCfgDao; -import com.nis.web.dao.configuration.ComplexStringCfgDao; -import com.nis.web.dao.configuration.IpCfgDao; -import com.nis.web.dao.configuration.StringCfgDao; -import com.nis.web.dao.specific.SpecificServiceCfgDao; -import com.nis.web.dao.specific.SpecificServiceHostCfgDao; -import com.nis.web.dao.systemService.ServiceConfigInfoDao; -import com.nis.web.service.CrudService; +import com.nis.web.dao.configuration.AreaIpCfgDao; +import com.nis.web.security.UserUtils; +import com.nis.web.service.BaseService; /** @@ -40,566 +41,743 @@ import com.nis.web.service.CrudService; * */ @Service -public class AppCfgService extends CrudService { +public class AppCfgService extends BaseService { @Autowired protected AppCfgDao appCfgDao; @Autowired - protected ServiceConfigInfoDao serviceConfigInfoDao; - @Autowired - protected StringCfgDao stringCfgDao; - @Autowired - protected ComplexStringCfgDao complexStringCfgDao; - @Autowired - private SpecificServiceCfgDao specificServiceCfgDao; - @Autowired - private SpecificServiceHostCfgDao specificServiceHostCfgDao; - @Autowired - protected IpCfgDao ipCfgDao; + protected AreaIpCfgDao areaIpCfgDao; - public Page findPage(Page page, AppIdCfg entity) { + public Page findAppPolicyList(Page page, AppPolicyCfg entity) { + entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(),"a")); entity.setPage(page); - List list = dao.findList(entity); + List list = appCfgDao.findAppPolicyList(entity); page.setList(list); return page; } - public AppIdCfg findAppIdCfg(AppIdCfg entity) { - //查询协议关联特征表 - List featuresTableList = appCfgDao.getFeaturesTableListByAppCompileId(entity.getCompileId()); - List complexList = new ArrayList(); - List strList = new ArrayList(); - if(!StringUtil.isEmpty(featuresTableList)){ - for(AppFeaturesIndex features:featuresTableList){ - if(features.getFeaturesTableType().equals(4)){//增强字符串特征配置 - List complexFeaturesList = appCfgDao.getComplexkeywordFeaturesCfgListByCompileId( - features.getFeaturesTable(),features.getFeaturesCompileId()); - complexList.addAll(complexFeaturesList); - - - }else if(features.getFeaturesTableType().equals(2)){//普通字符串特征配置 - List strFeaturesCfgList = appCfgDao.getStrFeaturesCfgListByCompileId( - features.getFeaturesTable(),features.getFeaturesCompileId()); - strList.addAll(strFeaturesCfgList); - } - } - } - entity.setComplexFeaturesList(complexList); - entity.setStrFeaturesCfgList(strList); - return entity; + public Page findAppIpList(Page page, AppIpCfg entity) { + entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(),"a")); + entity.setPage(page); + List list = appCfgDao.findAppIpList(entity); + page.setList(list); + return page; + } + public Page findAppHttpList(Page page, AppHttpCfg entity) { + entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(),"a")); + entity.setPage(page); + List list = appCfgDao.findAppHttpList(entity); + page.setList(list); + return page; + } + public Page findAppDomainList(Page page, AppDomainCfg entity) { + entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(),"a")); + entity.setPage(page); + List list = appCfgDao.findAppDomainList(entity); + page.setList(list); + return page; + } + public Page findAppByteList(Page page, AppByteCfg entity) { + entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(),"a")); + entity.setPage(page); + List list = appCfgDao.findAppByteList(entity); + page.setList(list); + return page; + } + public AppPolicyCfg getAppPolicyCfg(Long cfgId){ + return appCfgDao.getAppPolicyCfg(cfgId); + } + public AppIpCfg getAppIpCfg(Long cfgId){ + return appCfgDao.getAppIpCfg(cfgId); + } + public AppHttpCfg getAppHttpCfg(Long cfgId){ + return appCfgDao.getAppHttpCfg(cfgId); + } + public AppDomainCfg getAppDomainCfg(Long cfgId){ + return appCfgDao.getAppDomainCfg(cfgId); + } + public AppByteCfg getAppByteCfg(Long cfgId){ + return appCfgDao.getAppByteCfg(cfgId); } - /** - * - * addAppCfg(新增IP类配置) - * (继承AppIdCfg这个类方可使用) - * @param cfg - * @return - *int - * @throws Exception - * @exception - * @since 1.0.0 - */ @Transactional(readOnly=false,rollbackFor=RuntimeException.class) - public int addAppCfg(AppIdCfg cfg) throws Exception{ - //通过配置转换工具获取compileId - Integer appCompileId = 0; - int cfgId = 0; - appCompileId = new ConvertTool().getCompileId(); - cfg.setCompileId(appCompileId); - cfgId = appCfgDao.insert(cfg); - if(cfg.getComplexFeaturesList()!=null){ - for(AppComplexKeywordCfg c:cfg.getComplexFeaturesList()){ - Integer featuresCompileId = new ConvertTool().getCompileId(); - AppFeaturesIndex f = new AppFeaturesIndex(); - f.setAppCompileId(cfg.getCompileId()); - f.setFeaturesCompileId(featuresCompileId); - f.setFeaturesTableType(4); - f.setFeaturesTable(c.getTableName()); - appCfgDao.insertFeatures(f); - - c.setTableName(c.getTableName()); -// c.initDefaultValue(); - c.setAction(cfg.getAction()); - c.setServiceId(cfg.getServiceId()); - c.setCompileId(featuresCompileId); - c.setCreateTime(cfg.getCreateTime()); - c.setCreatorId(cfg.getCreatorId()); - c.setIsAudit(cfg.getIsAudit()); - c.setIsValid(cfg.getIsValid()); - c.setIsAreaEffective(cfg.getIsAreaEffective()); - c.setAreaEffectiveIds(cfg.getAreaEffectiveIds()); - c.setAttribute(cfg.getAttribute()); - c.setLable(cfg.getLable()); - c.setClassify(cfg.getClassify()); - c.setRequestId(cfg.getRequestId()); - c.setCfgDesc(cfg.getCfgDesc()); - complexStringCfgDao.insert(c); - } - } - if(cfg.getStrFeaturesCfgList()!=null){ - for(AppStringCfg s:cfg.getStrFeaturesCfgList()){ - Integer featuresCompileId = new ConvertTool().getCompileId(); - AppFeaturesIndex f = new AppFeaturesIndex(); - f.setAppCompileId(cfg.getCompileId()); - f.setFeaturesCompileId(featuresCompileId); - f.setFeaturesTableType(2); - f.setFeaturesTable(s.getTableName()); - appCfgDao.insertFeatures(f); - s.setTableName(s.getTableName()); -// s.initDefaultValue(); - s.setAction(cfg.getAction()); - s.setServiceId(cfg.getServiceId()); - s.setCompileId(featuresCompileId); - s.setCreateTime(cfg.getCreateTime()); - s.setCreatorId(cfg.getCreatorId()); - s.setIsAudit(cfg.getIsAudit()); - s.setIsValid(cfg.getIsValid()); - s.setIsAreaEffective(cfg.getIsAreaEffective()); - s.setAreaEffectiveIds(cfg.getAreaEffectiveIds()); - s.setAttribute(cfg.getAttribute()); - s.setLable(cfg.getLable()); - s.setClassify(cfg.getClassify()); - s.setRequestId(cfg.getRequestId()); - s.setCfgDesc(cfg.getCfgDesc()); - stringCfgDao.insert(s); - } - } - return cfgId; - } - /** - * - * updateAppCfg(更新IP类配置) - * (继承AppIdCfg这个类方可使用) - * @param cfg - * @return - *int - * @throws Exception - * @exception - * @since 1.0.0 - */ - @Transactional(readOnly=false,rollbackFor=RuntimeException.class) - public int updateAppCfg(AppIdCfg cfg) throws Exception{ - if(cfg.getComplexFeaturesList()!=null){ - for(AppComplexKeywordCfg c:cfg.getComplexFeaturesList()){ - Integer featuresCompileId = 0; - c.setIsAreaEffective(cfg.getIsAreaEffective()); - c.setAreaEffectiveIds(cfg.getAreaEffectiveIds()); - c.setAttribute(cfg.getAttribute()); - c.setLable(cfg.getLable()); - c.setClassify(cfg.getClassify()); - c.setRequestId(cfg.getRequestId()); - c.setCfgDesc(cfg.getCfgDesc()); - c.setEditorId(cfg.getEditorId()); - c.setEditTime(cfg.getEditTime()); - if(c.getCompileId()==null){ - featuresCompileId = new ConvertTool().getCompileId(); - AppFeaturesIndex f = new AppFeaturesIndex(); - f.setAppCompileId(cfg.getCompileId()); - f.setFeaturesCompileId(featuresCompileId); - f.setFeaturesTableType(4); - f.setFeaturesTable(c.getTableName()); - appCfgDao.insertFeatures(f); - c.setTableName(c.getTableName()); - c.setAction(cfg.getAction()); - c.setServiceId(cfg.getServiceId()); - c.setCompileId(featuresCompileId); - c.setCreateTime(new Date()); - c.setCreatorId(cfg.getCurrentUser().getId()); - c.setIsAudit(cfg.getIsAudit()); - c.setIsValid(cfg.getIsValid()); - complexStringCfgDao.insert(c); - }else{ - complexStringCfgDao.update(c); + public int saveOrUpdateAppPolicyCfg(AppPolicyCfg entity) throws Exception{ + //设置区域运营商信息 + setAreaEffectiveIds(entity); + if(entity.getCfgId()==null){ + Integer compileId = 0; + try { + List idList = ConfigServiceUtil.getId(1, 1); + if(idList!=null && idList.size()>0){ + compileId = idList.get(0); } - - + entity.setCompileId(compileId); + entity.setCreateTime(new Date()); + entity.setCreatorId(entity.getCurrentUser().getId()); + entity.setIsValid(0); + entity.setIsAudit(0); + return appCfgDao.insertAppPolicyCfg(entity); + }catch (Exception e) { + e.printStackTrace(); + logger.info("获取编译ID出错"); + throw new MaatConvertException(":"+e.getMessage()); } - } - if(cfg.getStrFeaturesCfgList()!=null){ - for(AppStringCfg s:cfg.getStrFeaturesCfgList()){ - Integer featuresCompileId = 0; - s.setIsAreaEffective(cfg.getIsAreaEffective()); - s.setAreaEffectiveIds(cfg.getAreaEffectiveIds()); - s.setAttribute(cfg.getAttribute()); - s.setLable(cfg.getLable()); - s.setClassify(cfg.getClassify()); - s.setRequestId(cfg.getRequestId()); - s.setCfgDesc(cfg.getCfgDesc()); - s.setEditorId(cfg.getEditorId()); - s.setEditTime(cfg.getEditTime()); - if(s.getCompileId()==null){ - featuresCompileId = new ConvertTool().getCompileId(); - AppFeaturesIndex f = new AppFeaturesIndex(); - f.setAppCompileId(cfg.getCompileId()); - f.setFeaturesCompileId(featuresCompileId); - f.setFeaturesTableType(2); - f.setFeaturesTable(s.getTableName()); - appCfgDao.insertFeatures(f); - s.setTableName(s.getTableName()); - s.setAction(cfg.getAction()); - s.setServiceId(cfg.getServiceId()); - s.setCompileId(featuresCompileId); - s.setCreateTime(new Date()); - s.setCreatorId(cfg.getCurrentUser().getId()); - s.setIsAudit(cfg.getIsAudit()); - s.setIsValid(cfg.getIsValid()); - stringCfgDao.insert(s); - }else{ - stringCfgDao.update(s); - } - - } - } - return appCfgDao.updateByPrimaryKeySelective(cfg); - } - /** - * - * auditAppCfg(审核IP类配置) - * (继承AppIdCfg这个类方可使用) - * @param cfg - * @return - *int - * @throws Exception - * @exception - * @since 1.0.0 - */ - @Transactional(readOnly=false,rollbackFor=RuntimeException.class) - public int auditAppCfg(String[] cfgIds,Integer auditState) throws Exception{ - List jsonList = new ArrayList(); - Gson gson=new GsonBuilder().disableHtmlEscaping() - .excludeFieldsWithoutExposeAnnotation() - .create(); - boolean sendFlag = false; - for(String id:cfgIds){ - AppIdCfg appCfg = appCfgDao.getById(Long.parseLong(id)); - - //给需要修改的配置字段赋值 - appCfg.setIsAudit(auditState); - appCfg.setAuditorId(appCfg.getCurrentUser().getId()); - appCfg.setAuditTime(new Date()); - if(auditState==Constants.AUDIT_NOT_YES){//取消审核通过,设置有效标志为0 - appCfg.setIsValid(Constants.VALID_NO); - }else if(auditState==Constants.AUDIT_YES){//审核通过,设置有效标志为1 - appCfg.setIsValid(Constants.VALID_YES); - } - - if(appCfg.getCompileId()==0){ - logger.error("转换出错,未获取到正确的compileId"); - break; - } - - List featuresTableList = appCfgDao.getFeaturesTableListByAppCompileId(appCfg.getCompileId()); - List strList = new ArrayList(); - List complexList = new ArrayList(); - List hostList =new ArrayList(); - List areaList = new ArrayList(); - ConfigGroupInfo group = null; - //配置审核状态即将改变后的状态 - if(Constants.AUDIT_NOT_YES==auditState|| - Constants.AUDIT_YES==auditState){//审核通过,取消审核通过需要发到maat - - if(Constants.AUDIT_YES==auditState){//审核通过 - if(StringUtil.isEmpty(featuresTableList)){ - SpecificServiceCfg protocol = specificServiceCfgDao.getBySpecServiceId(appCfg.getAppId().intValue()); - group = specificServiceCfgDao.getConfigGroupInfoByGroupId(protocol.getGroupId()); - //featuresTableList为空的时候,该service只有特定服务IP一个配置表 - ServiceConfigInfo serviceCfg=serviceConfigInfoDao.findSysServiceConfigInfo(appCfg.getServiceId()); - if(group==null){ - throw new RuntimeException("配置审核失败,未获取社交应用服务器IP所属分组信息"); - }else{ - if(group.getIsIssued()==0){ - //如果分组信息尚未下发,则下发IP - group.setGroupId(protocol.getGroupId()); - group.setIsIssued(1); - SpecificServiceHostCfg hostCfg = new SpecificServiceHostCfg(); - hostCfg.setSpecServiceId(protocol.getSpecServiceId()); - hostList = specificServiceHostCfgDao.findSpecHostList(hostCfg); - - for(SpecificServiceHostCfg host:hostList){ - SpecificServiceCfg specServiceCfg = specificServiceCfgDao.getBySpecServiceId(host.getSpecServiceId()); - host.setProtocolId(0); - host.setGroupId(specServiceCfg.getGroupId()); - if(StringUtil.isEmpty(serviceCfg)){ - host.setMaatTable("DF_PROTOCOL_APP"); - }else{ - host.setMaatTable(serviceCfg.getMaatTable()); - } - } - }else{ - SpecificServiceHostCfg host = new SpecificServiceHostCfg(); - host.setGroupId(protocol.getGroupId()); - hostList.add(host); - } - } - - - //生效区域列表信息 - if(appCfg.getIsAreaEffective()==1){ - if(StringUtil.isEmpty(appCfg.getAreaEffectiveIds())){ - BaseIpCfg ipCfg = new BaseIpCfg(); - ipCfg.setCompileId(appCfg.getCompileId()); - ipCfg.setTableName("area_ip_cfg"); - areaList = ipCfgDao.findList(ipCfg); - } - } - }else{ - for(AppFeaturesIndex featuresCfg:featuresTableList){ - if(featuresCfg.getFeaturesTableType()==2){ - List list =appCfgDao.getStrFeaturesCfgListByCompileId(featuresCfg.getFeaturesTable(), featuresCfg.getFeaturesCompileId()); - for(AppStringCfg cfg:list){ - List cList = serviceConfigInfoDao.findList(appCfg.getServiceId()); - if(!StringUtil.isEmpty(cList)){ - for(ServiceConfigInfo c:cList){ - if(c.getTableName().equals(featuresCfg.getFeaturesTable())){ - } - } - - } - cfg.setCompileId(featuresCfg.getFeaturesCompileId()); - strList.add(cfg); - } - } - if(featuresCfg.getFeaturesTableType()==4){ - List list = appCfgDao.getComplexkeywordFeaturesCfgListByCompileId(featuresCfg.getFeaturesTable(), featuresCfg.getFeaturesCompileId()); - for(AppComplexKeywordCfg cfg:list){ - List cList = serviceConfigInfoDao.findList(appCfg.getServiceId()); - if(!StringUtil.isEmpty(cList)){ - for(ServiceConfigInfo c:cList){ - if(c.getTableName().equals(featuresCfg.getFeaturesTable())){ - } - } - } - - cfg.setCompileId(featuresCfg.getFeaturesCompileId()); - complexList.add(cfg); - } - } - } - } - AppMaatCfg maatCfg = new AppMaatCfg(); - if(StringUtil.isEmpty(featuresTableList)){ - maatCfg.setIpCfg(hostList); - maatCfg.setAreaCfg(areaList); - if(appCfg.getCompileId()==0){ - throw new RuntimeException("转换出错,未获取到正确的compileId"); - }else{ - maatCfg.setCompileId(appCfg.getCompileId()); - } - }else{//特征配置 - maatCfg.setStrCfg(strList); - maatCfg.setComplexStrCfg(complexList); - } - - if(appCfg.getAction()==null){ - throw new RuntimeException("转换出错,未获取到正确的action"); - }else{ - maatCfg.setAction(appCfg.getAction()); - } - if(appCfg.getIsAreaEffective()==null){ - throw new RuntimeException("转换出错,未获取到正确的isAreaEffective"); - }else{ - maatCfg.setIsAreaEffective(appCfg.getIsAreaEffective()); - } - if(appCfg.getIsValid()==null){ - throw new RuntimeException("转换出错,未获取到正确的isValid"); - }else{ - maatCfg.setIsValid(appCfg.getIsValid()); - } - if(appCfg.getRequestId()==null){ - throw new RuntimeException("转换出错,未获取到正确的requestId"); - }else{ - maatCfg.setRequestId(appCfg.getRequestId()); - } - if(appCfg.getServiceId()==null){ - throw new RuntimeException("转换出错,未获取到正确的serviceId"); - }else{ - maatCfg.setServiceId(appCfg.getServiceId()); - } - maatCfg.setSpecificServiceId(appCfg.getAppId()); - maatCfg.setAreaEffectiveIds(appCfg.getAreaEffectiveIds()==null?"":appCfg.getAreaEffectiveIds()); - maatCfg.setAttribute(appCfg.getAttribute()==null?"":appCfg.getAttribute()); - maatCfg.setClassify(appCfg.getClassify()==null?"":appCfg.getClassify()); - maatCfg.setLable(appCfg.getLable()==null?"":appCfg.getLable()); - jsonList.add(maatCfg); - - //修改appId配置审核下发状态 - appCfgDao.audit(appCfg); - //修改特定服务IP分组下发状态 - specificServiceCfgDao.updateConfigGroupInfobyGroupId(group); - //修改特征表配置审核下发状态 - for(AppFeaturesIndex cfg:featuresTableList){ - appCfgDao.auditFeaturesTable(cfg.getFeaturesTable(), cfg.getFeaturesCompileId(), appCfg.getIsValid(), - appCfg.getIsAudit(), appCfg.getAuditorId(), appCfg.getAuditTime()); - - } - - }else{//取消审核通过 - AppMaatCfg maatCfg = new AppMaatCfg(); - if(StringUtil.isEmpty(featuresTableList)){ - ServiceConfigInfo serviceCfg=serviceConfigInfoDao.findSysServiceConfigInfo(appCfg.getServiceId()); - maatCfg.setMaatTable(serviceCfg.getMaatTable()); - if(appCfg.getCompileId()==0){ - throw new RuntimeException("转换出错,未获取到正确的compileId"); - }else{ - maatCfg.setCompileId(appCfg.getCompileId()); - } - }else{//特征配置 - for(AppFeaturesIndex featuresCfg:featuresTableList){ - if(featuresCfg.getFeaturesTableType()==2){ - List list =appCfgDao.getStrFeaturesCfgListByCompileId(featuresCfg.getFeaturesTable(), featuresCfg.getFeaturesCompileId()); - for(AppStringCfg cfg:list){ - AppStringCfg strCfg = new AppStringCfg(); - List cList = serviceConfigInfoDao.findList(appCfg.getServiceId()); - if(!StringUtil.isEmpty(cList)){ - for(ServiceConfigInfo c:cList){ - if(c.getTableName().equals(featuresCfg.getFeaturesTable())){ - } - } - - } - strCfg.setCompileId(featuresCfg.getFeaturesCompileId()); - strList.add(strCfg); - } - } - if(featuresCfg.getFeaturesTableType()==4){ - List list = appCfgDao.getComplexkeywordFeaturesCfgListByCompileId(featuresCfg.getFeaturesTable(), featuresCfg.getFeaturesCompileId()); - for(AppComplexKeywordCfg cfg:list){ - AppComplexKeywordCfg complexCfg = new AppComplexKeywordCfg(); - List cList = serviceConfigInfoDao.findList(appCfg.getServiceId()); - if(!StringUtil.isEmpty(cList)){ - for(ServiceConfigInfo c:cList){ - if(c.getTableName().equals(featuresCfg.getFeaturesTable())){ - } - } - } - - complexCfg.setCompileId(featuresCfg.getFeaturesCompileId()); - complexList.add(complexCfg); - } - } - } - maatCfg.setStrCfg(strList); - maatCfg.setComplexStrCfg(complexList); - } - - jsonList.add(maatCfg); - - //修改appId配置审核下发状态 - appCfgDao.audit(appCfg); - //修改特定服务IP分组下发状态 - specificServiceCfgDao.updateConfigGroupInfobyGroupId(group); - //修改特征表配置审核下发状态 - for(AppFeaturesIndex cfg:featuresTableList){ - appCfgDao.auditFeaturesTable(cfg.getFeaturesTable(), cfg.getFeaturesCompileId(), appCfg.getIsValid(), - appCfg.getIsAudit(), appCfg.getAuditorId(), appCfg.getAuditTime()); - - } - } - - } - - - } - String json=gson.toJson(jsonList); - //下发maat -// new ConvertTool().saveConfig(json); - sendFlag = true; - if(sendFlag){ - return 1; }else{ - return 0; - } - - } - /** - * - * deleteAppCfg(删除IP类配置) - * (继承AppIdCfg这个类方可使用) - * @param cfg - * @return - *int - * @exception - * @since 1.0.0 - */ - @Transactional(readOnly=false,rollbackFor=RuntimeException.class) - public int deleteAppCfg(String[] cfgIds){ - for(String id : cfgIds){ - AppIdCfg entity = appCfgDao.getById(Long.parseLong(id)); entity.setEditorId(entity.getCurrentUser().getId()); entity.setEditTime(new Date()); - entity.setIsValid(Constants.VALID_DEL); - Integer status = appCfgDao.updateValid(entity); - if(status==1){ - List featuresTableList = appCfgDao.getFeaturesTableListByAppCompileId(entity.getCompileId()); - for(AppFeaturesIndex cfg:featuresTableList){ - status = appCfgDao.updateFeaturesTableValid(cfg.getFeaturesTable(), cfg.getFeaturesCompileId(), - entity.getIsValid(), entity.getEditorId(), entity.getEditTime()); - if(status==0){ - return 0; - } + return appCfgDao.updateAppPolicyCfg(entity); + } + } + @Transactional(readOnly=false,rollbackFor=RuntimeException.class) + public int saveOrUpdateAppIpCfg(AppIpCfg entity) throws Exception{ + //设置区域运营商信息 + setAreaEffectiveIds(entity); + if(entity.getCfgId()==null){ + Integer compileId = 0; + try { + List idList = ConfigServiceUtil.getId(1, 1); + if(idList!=null && idList.size()>0){ + compileId = idList.get(0); } - }else{ - return 0; + entity.setCompileId(compileId); + entity.setCreateTime(new Date()); + entity.setCreatorId(entity.getCurrentUser().getId()); + return appCfgDao.insertAppIpCfg(entity); + }catch (Exception e) { + e.printStackTrace(); + logger.info("获取编译ID出错"); + throw new MaatConvertException(":"+e.getMessage()); + } + }else{ + entity.setEditorId(entity.getCurrentUser().getId()); + entity.setEditTime(new Date()); + return appCfgDao.updateAppIpCfg(entity); + } + } + @Transactional(readOnly=false,rollbackFor=RuntimeException.class) + public int saveOrUpdateAppHttpCfg(AppHttpCfg entity) throws Exception{ + //设置区域运营商信息 + setAreaEffectiveIds(entity); + if(entity.getCfgId()==null){ + Integer compileId = 0; + try { + List idList = ConfigServiceUtil.getId(1, 1); + if(idList!=null && idList.size()>0){ + compileId = idList.get(0); + } + entity.setCompileId(compileId); + entity.setCreateTime(new Date()); + entity.setCreatorId(entity.getCurrentUser().getId()); + return appCfgDao.insertAppHttpCfg(entity); + }catch (Exception e) { + e.printStackTrace(); + logger.info("获取编译ID出错"); + throw new MaatConvertException(":"+e.getMessage()); + } + }else{ + entity.setEditorId(entity.getCurrentUser().getId()); + entity.setEditTime(new Date()); + return appCfgDao.updateAppHttpCfg(entity); + } + } + @Transactional(readOnly=false,rollbackFor=RuntimeException.class) + public int saveOrUpdateAppDomainCfg(AppDomainCfg entity) throws Exception{ + //设置区域运营商信息 + setAreaEffectiveIds(entity); + if(entity.getCfgId()==null){ + Integer compileId = 0; + try { + List idList = ConfigServiceUtil.getId(1, 1); + if(idList!=null && idList.size()>0){ + compileId = idList.get(0); + } + entity.setCompileId(compileId); + entity.setCreateTime(new Date()); + entity.setCreatorId(entity.getCurrentUser().getId()); + return appCfgDao.insertAppDomainCfg(entity); + }catch (Exception e) { + e.printStackTrace(); + logger.info("获取编译ID出错"); + throw new MaatConvertException(":"+e.getMessage()); + } + }else{ + entity.setEditorId(entity.getCurrentUser().getId()); + entity.setEditTime(new Date()); + return appCfgDao.updateAppDomainCfg(entity); + } + } + @Transactional(readOnly=false,rollbackFor=RuntimeException.class) + public int saveOrUpdateAppByteCfg(AppByteCfg entity) throws Exception{ + //设置区域运营商信息 + setAreaEffectiveIds(entity); + if(entity.getCfgId()==null){ + Integer compileId = 0; + try { + List idList = ConfigServiceUtil.getId(1, 1); + if(idList!=null && idList.size()>0){ + compileId = idList.get(0); + } + entity.setCompileId(compileId); + entity.setCreateTime(new Date()); + entity.setCreatorId(entity.getCurrentUser().getId()); + return appCfgDao.insertAppByteCfg(entity); + }catch (Exception e) { + e.printStackTrace(); + logger.info("获取编译ID出错"); + throw new MaatConvertException(":"+e.getMessage()); + } + }else{ + entity.setEditorId(entity.getCurrentUser().getId()); + entity.setEditTime(new Date()); + return appCfgDao.updateAppByteCfg(entity); + } + } + public void auditAppPolicyCfg(AppPolicyCfg entity,Integer isAudit){ + ToMaatBean maatBean = new ToMaatBean(); + MaatCfg maatCfg = new MaatCfg(); + List configCompileList = new ArrayList(); + List groupRelationList = new ArrayList(); + List ipRegionList = new ArrayList(); + List strRegionList = new ArrayList(); + List numRegionList = new ArrayList(); + List digestRegionList = new ArrayList(); + List areaIpRegionList = new ArrayList(); + + entity.setTableName(AppPolicyCfg.getTablename()); + appCfgDao.auditCfg(entity); + entity = this.getAppPolicyCfg(entity.getCfgId()); + if(isAudit==1){ + entity.setCfgKeywords(entity.getAppCode()); + List list = new ArrayList(); + list.add(entity); + Map map = cfgConvert(strRegionList,list,2,entity,groupRelationList); + groupRelationList=map.get("groupList"); + strRegionList=map.get("dstList"); + } + //保存区域IP信息 + List areaIpCfgList=areaIpCfgDao.getByCompileId(entity.getCompileId()); + if(!StringUtil.isEmpty(areaIpCfgList)){ + AreaIpCfg cfg = new AreaIpCfg(); + BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"}); + cfg.setTableName(AreaIpCfg.getTablename()); + appCfgDao.auditCfg(cfg); + if(isAudit==1){ + Map map = cfgConvert(areaIpRegionList,areaIpCfgList,1,entity,groupRelationList); + groupRelationList=map.get("groupList"); + areaIpRegionList=map.get("dstList"); } } - return 1; - } - /** - * - * getAppCfg(根据IP与类名获取IP配置) - * (继承AppIdCfg这个类方可使用) - * @param id - * @return - *AppIdCfg - * @exception - * @since 1.0.0 - */ - public AppIdCfg getAppCfgById(long id){ - return appCfgDao.getById(id); + //构造提交综合服务参数格式,一条配置提交一次综合服务 + if(isAudit==1){ + maatCfg.initDefaultValue(); + BeanUtils.copyProperties(entity, maatCfg); + maatCfg.setAction(entity.getAction()); + maatCfg.setAuditTime(entity.getAuditTime()); + maatCfg.setIpRegionList(ipRegionList); + maatCfg.setStrRegionList(strRegionList); + maatCfg.setNumRegionList(numRegionList); + maatCfg.setDigestRegionList(digestRegionList); + maatCfg.setGroupRelationList(groupRelationList); + maatCfg.setGroupNum(groupRelationList.size()); + maatCfg.setAreaIpRegionList(areaIpRegionList); + maatCfg.setIsValid(entity.getIsValid()); + //设置用户自定义域 + String userRegion = ""; + if(!StringUtil.isEmpty(entity.getAppCode())){ + userRegion = userRegion+entity.getAppCode()+Constants.USER_REGION_SPLIT; + }else{ + userRegion = userRegion+Constants.USER_REGION_SPLIT; + } + if(entity.getRatelimit()!=null){ + userRegion = userRegion+entity.getRatelimit()+Constants.USER_REGION_SPLIT; + }else{ + userRegion = userRegion+Constants.USER_REGION_SPLIT; + } + maatCfg.setUserRegion(userRegion); + configCompileList.add(maatCfg); + maatBean.setConfigCompileList(configCompileList); + maatBean.setAuditTime(entity.getAuditTime()); + maatBean.setCreatorName(entity.getCurrentUser().getName()); + maatBean.setVersion(Constants.MAAT_VERSION); + maatBean.setOpAction(Constants.INSERT_ACTION); + //调用服务接口下发配置数据 + String json=gsonToJson(maatBean); + logger.info("app策略配置下发配置参数:"+json); + //调用服务接口下发配置 + ToMaatResult result = ConfigServiceUtil.postMaatCfg(json); + logger.info("app策略配置下发响应信息:"+result.getMsg()); + + }else if(isAudit==3){ + maatCfg.setCompileId(entity.getCompileId()); + maatCfg.setServiceId(entity.getServiceId()); + maatCfg.setIsValid(0);//无效 + configCompileList.add(maatCfg); + maatBean.setConfigCompileList(configCompileList); + maatBean.setAuditTime(entity.getAuditTime()); + maatBean.setCreatorName(entity.getCurrentUser().getName()); + maatBean.setVersion(Constants.MAAT_VERSION); + maatBean.setOpAction(Constants.UPDATE_ACTION); + //调用服务接口取消配置 + String json=gsonToJson(maatBean); + logger.info("app策略配置下发配置参数:"+json); + //调用服务接口下发配置 + ToMaatResult result = ConfigServiceUtil.put(json,1); + logger.info("app策略配置取消配置响应信息:"+result.getMsg()); + } } - /** - * - * getAppCfg(根据IP与类名获取IP配置) - * (继承AppIdCfg这个类方可使用) - * @param id - * @return - *AppIdCfg - * @exception - * @since 1.0.0 - */ - public AppIdCfg getAppCfgById(AppIdCfg cfg){ - cfg = appCfgDao.get(cfg); - List featuresTableList = appCfgDao.getFeaturesTableListByAppCompileId(cfg.getCompileId()); - List complexList = new ArrayList(); - List strList = new ArrayList(); - if(!StringUtil.isEmpty(featuresTableList)){ - for(AppFeaturesIndex features:featuresTableList){ - if(features.getFeaturesTableType().equals(4)){//增强字符串特征配置 - List complexFeaturesList = appCfgDao.getComplexkeywordFeaturesCfgListByCompileId( - features.getFeaturesTable(),features.getFeaturesCompileId()); - complexList.addAll(complexFeaturesList); - - - }else if(features.getFeaturesTableType().equals(2)){//普通字符串特征配置 - List strFeaturesCfgList = appCfgDao.getStrFeaturesCfgListByCompileId( - features.getFeaturesTable(),features.getFeaturesCompileId()); - strList.addAll(strFeaturesCfgList); - } + public void auditAppIpCfg(AppIpCfg entity,Integer isAudit){ + ToMaatBean maatBean = new ToMaatBean(); + MaatCfg maatCfg = new MaatCfg(); + List configCompileList = new ArrayList(); + List groupRelationList = new ArrayList(); + List ipRegionList = new ArrayList(); + List strRegionList = new ArrayList(); + List numRegionList = new ArrayList(); + List digestRegionList = new ArrayList(); + List areaIpRegionList = new ArrayList(); + entity = this.getAppIpCfg(entity.getCfgId()); + entity.setTableName(AppPolicyCfg.getTablename()); + appCfgDao.auditCfg(entity); + if(isAudit==1){ + List list = new ArrayList(); + list.add(entity); + Map map = cfgConvert(strRegionList,list,2,entity,groupRelationList); + groupRelationList=map.get("groupList"); + strRegionList=map.get("dstList"); + } + //保存区域IP信息 + List areaIpCfgList=areaIpCfgDao.getByCompileId(entity.getCompileId()); + if(!StringUtil.isEmpty(areaIpCfgList)){ + AreaIpCfg cfg = new AreaIpCfg(); + BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"}); + cfg.setTableName(AreaIpCfg.getTablename()); + appCfgDao.auditCfg(cfg); + if(isAudit==1){ + Map map = cfgConvert(areaIpRegionList,areaIpCfgList,1,entity,groupRelationList); + groupRelationList=map.get("groupList"); + areaIpRegionList=map.get("dstList"); + } + } + //构造提交综合服务参数格式,一条配置提交一次综合服务 + if(isAudit==1){ + maatCfg.initDefaultValue(); + BeanUtils.copyProperties(entity, maatCfg); + maatCfg.setAction(entity.getAction()); + maatCfg.setAuditTime(entity.getAuditTime()); + maatCfg.setIpRegionList(ipRegionList); + maatCfg.setStrRegionList(strRegionList); + maatCfg.setNumRegionList(numRegionList); + maatCfg.setDigestRegionList(digestRegionList); + maatCfg.setGroupRelationList(groupRelationList); + maatCfg.setGroupNum(groupRelationList.size()); + maatCfg.setAreaIpRegionList(areaIpRegionList); + maatCfg.setIsValid(entity.getIsValid()); + //设置用户自定义域 + String userRegion = ""; + if(!StringUtil.isEmpty(entity.getAppCode())){ + userRegion = userRegion+entity.getAppCode()+Constants.USER_REGION_SPLIT; + } + if(entity.getRatelimit()!=null){ + userRegion = userRegion+entity.getRatelimit()+Constants.USER_REGION_SPLIT; + } + maatCfg.setUserRegion(userRegion); + configCompileList.add(maatCfg); + maatBean.setConfigCompileList(configCompileList); + maatBean.setAuditTime(entity.getAuditTime()); + maatBean.setCreatorName(entity.getCurrentUser().getName()); + maatBean.setVersion(Constants.MAAT_VERSION); + maatBean.setOpAction(Constants.INSERT_ACTION); + //调用服务接口下发配置数据 + String json=gsonToJson(maatBean); + logger.info("app协议IP配置下发配置参数:"+json); + //调用服务接口下发配置 + ToMaatResult result = ConfigServiceUtil.postMaatCfg(json); + logger.info("app协议IP配置下发响应信息:"+result.getMsg()); + + }else if(isAudit==3){ + maatCfg.setCompileId(entity.getCompileId()); + maatCfg.setServiceId(entity.getServiceId()); + maatCfg.setIsValid(0);//无效 + configCompileList.add(maatCfg); + maatBean.setConfigCompileList(configCompileList); + maatBean.setAuditTime(entity.getAuditTime()); + maatBean.setCreatorName(entity.getCurrentUser().getName()); + maatBean.setVersion(Constants.MAAT_VERSION); + maatBean.setOpAction(Constants.UPDATE_ACTION); + //调用服务接口取消配置 + String json=gsonToJson(maatBean); + logger.info("app协议IP配置下发配置参数:"+json); + //调用服务接口下发配置 + ToMaatResult result = ConfigServiceUtil.put(json,1); + logger.info("app协议IP配置取消配置响应信息:"+result.getMsg()); + } + } + public void auditAppHttpCfg(AppHttpCfg entity,Integer isAudit){ + ToMaatBean maatBean = new ToMaatBean(); + MaatCfg maatCfg = new MaatCfg(); + List configCompileList = new ArrayList(); + List groupRelationList = new ArrayList(); + List ipRegionList = new ArrayList(); + List strRegionList = new ArrayList(); + List numRegionList = new ArrayList(); + List digestRegionList = new ArrayList(); + List areaIpRegionList = new ArrayList(); + entity = this.getAppHttpCfg(entity.getCfgId()); + entity.setTableName(AppPolicyCfg.getTablename()); + appCfgDao.auditCfg(entity); + if(isAudit==1){ + List list = new ArrayList(); + list.add(entity); + Map map = cfgConvert(strRegionList,list,2,entity,groupRelationList); + groupRelationList=map.get("groupList"); + strRegionList=map.get("dstList"); + } + //保存区域IP信息 + List areaIpCfgList=areaIpCfgDao.getByCompileId(entity.getCompileId()); + if(!StringUtil.isEmpty(areaIpCfgList)){ + AreaIpCfg cfg = new AreaIpCfg(); + BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"}); + cfg.setTableName(AreaIpCfg.getTablename()); + appCfgDao.auditCfg(cfg); + if(isAudit==1){ + Map map = cfgConvert(areaIpRegionList,areaIpCfgList,1,entity,groupRelationList); + groupRelationList=map.get("groupList"); + areaIpRegionList=map.get("dstList"); + } + } + //构造提交综合服务参数格式,一条配置提交一次综合服务 + if(isAudit==1){ + maatCfg.initDefaultValue(); + BeanUtils.copyProperties(entity, maatCfg); + maatCfg.setAction(entity.getAction()); + maatCfg.setAuditTime(entity.getAuditTime()); + maatCfg.setIpRegionList(ipRegionList); + maatCfg.setStrRegionList(strRegionList); + maatCfg.setNumRegionList(numRegionList); + maatCfg.setDigestRegionList(digestRegionList); + maatCfg.setGroupRelationList(groupRelationList); + maatCfg.setGroupNum(groupRelationList.size()); + maatCfg.setAreaIpRegionList(areaIpRegionList); + maatCfg.setIsValid(entity.getIsValid()); + //设置用户自定义域 + String userRegion = ""; + if(!StringUtil.isEmpty(entity.getAppCode())){ + userRegion = userRegion+entity.getAppCode()+Constants.USER_REGION_SPLIT; + } + if(entity.getRatelimit()!=null){ + userRegion = userRegion+entity.getRatelimit()+Constants.USER_REGION_SPLIT; + } + maatCfg.setUserRegion(userRegion); + configCompileList.add(maatCfg); + maatBean.setConfigCompileList(configCompileList); + maatBean.setAuditTime(entity.getAuditTime()); + maatBean.setCreatorName(entity.getCurrentUser().getName()); + maatBean.setVersion(Constants.MAAT_VERSION); + maatBean.setOpAction(Constants.INSERT_ACTION); + //调用服务接口下发配置数据 + String json=gsonToJson(maatBean); + logger.info("app HTTP配置下发配置参数:"+json); + //调用服务接口下发配置 + ToMaatResult result = ConfigServiceUtil.postMaatCfg(json); + logger.info("app HTTP配置下发响应信息:"+result.getMsg()); + + }else if(isAudit==3){ + maatCfg.setCompileId(entity.getCompileId()); + maatCfg.setServiceId(entity.getServiceId()); + maatCfg.setIsValid(0);//无效 + configCompileList.add(maatCfg); + maatBean.setConfigCompileList(configCompileList); + maatBean.setAuditTime(entity.getAuditTime()); + maatBean.setCreatorName(entity.getCurrentUser().getName()); + maatBean.setVersion(Constants.MAAT_VERSION); + maatBean.setOpAction(Constants.UPDATE_ACTION); + //调用服务接口取消配置 + String json=gsonToJson(maatBean); + logger.info("app HTTP配置下发配置参数:"+json); + //调用服务接口下发配置 + ToMaatResult result = ConfigServiceUtil.put(json,1); + logger.info("app HTTP配置取消配置响应信息:"+result.getMsg()); + } + } + public void auditAppDomainCfg(AppDomainCfg entity,Integer isAudit){ + ToMaatBean maatBean = new ToMaatBean(); + MaatCfg maatCfg = new MaatCfg(); + List configCompileList = new ArrayList(); + List groupRelationList = new ArrayList(); + List ipRegionList = new ArrayList(); + List strRegionList = new ArrayList(); + List numRegionList = new ArrayList(); + List digestRegionList = new ArrayList(); + List areaIpRegionList = new ArrayList(); + entity = this.getAppDomainCfg(entity.getCfgId()); + entity.setTableName(AppPolicyCfg.getTablename()); + appCfgDao.auditCfg(entity); + if(isAudit==1){ + List list = new ArrayList(); + list.add(entity); + Map map = cfgConvert(strRegionList,list,2,entity,groupRelationList); + groupRelationList=map.get("groupList"); + strRegionList=map.get("dstList"); + } + //保存区域IP信息 + List areaIpCfgList=areaIpCfgDao.getByCompileId(entity.getCompileId()); + if(!StringUtil.isEmpty(areaIpCfgList)){ + AreaIpCfg cfg = new AreaIpCfg(); + BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"}); + cfg.setTableName(AreaIpCfg.getTablename()); + appCfgDao.auditCfg(cfg); + if(isAudit==1){ + Map map = cfgConvert(areaIpRegionList,areaIpCfgList,1,entity,groupRelationList); + groupRelationList=map.get("groupList"); + areaIpRegionList=map.get("dstList"); + } + } + //构造提交综合服务参数格式,一条配置提交一次综合服务 + if(isAudit==1){ + maatCfg.initDefaultValue(); + BeanUtils.copyProperties(entity, maatCfg); + maatCfg.setAction(entity.getAction()); + maatCfg.setAuditTime(entity.getAuditTime()); + maatCfg.setIpRegionList(ipRegionList); + maatCfg.setStrRegionList(strRegionList); + maatCfg.setNumRegionList(numRegionList); + maatCfg.setDigestRegionList(digestRegionList); + maatCfg.setGroupRelationList(groupRelationList); + maatCfg.setGroupNum(groupRelationList.size()); + maatCfg.setAreaIpRegionList(areaIpRegionList); + maatCfg.setIsValid(entity.getIsValid()); + //设置用户自定义域 + String userRegion = ""; + if(!StringUtil.isEmpty(entity.getAppCode())){ + userRegion = userRegion+entity.getAppCode()+Constants.USER_REGION_SPLIT; + } + if(entity.getRatelimit()!=null){ + userRegion = userRegion+entity.getRatelimit()+Constants.USER_REGION_SPLIT; + } + maatCfg.setUserRegion(userRegion); + configCompileList.add(maatCfg); + maatBean.setConfigCompileList(configCompileList); + maatBean.setAuditTime(entity.getAuditTime()); + maatBean.setCreatorName(entity.getCurrentUser().getName()); + maatBean.setVersion(Constants.MAAT_VERSION); + maatBean.setOpAction(Constants.INSERT_ACTION); + //调用服务接口下发配置数据 + String json=gsonToJson(maatBean); + logger.info("app域名配置下发配置参数:"+json); + //调用服务接口下发配置 + ToMaatResult result = ConfigServiceUtil.postMaatCfg(json); + logger.info("app域名配置下发响应信息:"+result.getMsg()); + + }else if(isAudit==3){ + maatCfg.setCompileId(entity.getCompileId()); + maatCfg.setServiceId(entity.getServiceId()); + maatCfg.setIsValid(0);//无效 + configCompileList.add(maatCfg); + maatBean.setConfigCompileList(configCompileList); + maatBean.setAuditTime(entity.getAuditTime()); + maatBean.setCreatorName(entity.getCurrentUser().getName()); + maatBean.setVersion(Constants.MAAT_VERSION); + maatBean.setOpAction(Constants.UPDATE_ACTION); + //调用服务接口取消配置 + String json=gsonToJson(maatBean); + logger.info("app域名配置下发配置参数:"+json); + //调用服务接口下发配置 + ToMaatResult result = ConfigServiceUtil.put(json,1); + logger.info("app域名配置取消配置响应信息:"+result.getMsg()); + } + } + public void auditAppByteCfg(AppByteCfg entity,Integer isAudit){ + ToMaatBean maatBean = new ToMaatBean(); + MaatCfg maatCfg = new MaatCfg(); + List configCompileList = new ArrayList(); + List groupRelationList = new ArrayList(); + List ipRegionList = new ArrayList(); + List strRegionList = new ArrayList(); + List numRegionList = new ArrayList(); + List digestRegionList = new ArrayList(); + List areaIpRegionList = new ArrayList(); + entity = this.getAppByteCfg(entity.getCfgId()); + entity.setTableName(AppPolicyCfg.getTablename()); + appCfgDao.auditCfg(entity); + if(isAudit==1){ + List list = new ArrayList(); + list.add(entity); + Map map = cfgConvert(strRegionList,list,2,entity,groupRelationList); + groupRelationList=map.get("groupList"); + strRegionList=map.get("dstList"); + } + //保存区域IP信息 + List areaIpCfgList=areaIpCfgDao.getByCompileId(entity.getCompileId()); + if(!StringUtil.isEmpty(areaIpCfgList)){ + AreaIpCfg cfg = new AreaIpCfg(); + BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"}); + cfg.setTableName(AreaIpCfg.getTablename()); + appCfgDao.auditCfg(cfg); + if(isAudit==1){ + Map map = cfgConvert(areaIpRegionList,areaIpCfgList,1,entity,groupRelationList); + groupRelationList=map.get("groupList"); + areaIpRegionList=map.get("dstList"); + } + } + //构造提交综合服务参数格式,一条配置提交一次综合服务 + if(isAudit==1){ + maatCfg.initDefaultValue(); + BeanUtils.copyProperties(entity, maatCfg); + maatCfg.setAction(entity.getAction()); + maatCfg.setAuditTime(entity.getAuditTime()); + maatCfg.setIpRegionList(ipRegionList); + maatCfg.setStrRegionList(strRegionList); + maatCfg.setNumRegionList(numRegionList); + maatCfg.setDigestRegionList(digestRegionList); + maatCfg.setGroupRelationList(groupRelationList); + maatCfg.setGroupNum(groupRelationList.size()); + maatCfg.setAreaIpRegionList(areaIpRegionList); + maatCfg.setIsValid(entity.getIsValid()); + //设置用户自定义域 + String userRegion = ""; + if(!StringUtil.isEmpty(entity.getAppCode())){ + userRegion = userRegion+entity.getAppCode()+Constants.USER_REGION_SPLIT; + } + if(entity.getRatelimit()!=null){ + userRegion = userRegion+entity.getRatelimit()+Constants.USER_REGION_SPLIT; + } + maatCfg.setUserRegion(userRegion); + configCompileList.add(maatCfg); + maatBean.setConfigCompileList(configCompileList); + maatBean.setAuditTime(entity.getAuditTime()); + maatBean.setCreatorName(entity.getCurrentUser().getName()); + maatBean.setVersion(Constants.MAAT_VERSION); + maatBean.setOpAction(Constants.INSERT_ACTION); + //调用服务接口下发配置数据 + String json=gsonToJson(maatBean); + logger.info("app字节配置下发配置参数:"+json); + //调用服务接口下发配置 + ToMaatResult result = ConfigServiceUtil.postMaatCfg(json); + logger.info("app字节配置下发响应信息:"+result.getMsg()); + + }else if(isAudit==3){ + maatCfg.setCompileId(entity.getCompileId()); + maatCfg.setServiceId(entity.getServiceId()); + maatCfg.setIsValid(0);//无效 + configCompileList.add(maatCfg); + maatBean.setConfigCompileList(configCompileList); + maatBean.setAuditTime(entity.getAuditTime()); + maatBean.setCreatorName(entity.getCurrentUser().getName()); + maatBean.setVersion(Constants.MAAT_VERSION); + maatBean.setOpAction(Constants.UPDATE_ACTION); + //调用服务接口取消配置 + String json=gsonToJson(maatBean); + logger.info("app字节配置下发配置参数:"+json); + //调用服务接口下发配置 + ToMaatResult result = ConfigServiceUtil.put(json,1); + logger.info("app字节配置取消配置响应信息:"+result.getMsg()); + } + } + public void updateAppPolicyCfgValid(Integer isValid,String ids,Integer functionId){ + AppPolicyCfg entity = new AppPolicyCfg(); + String[] idArray = ids.split(","); + for(String id :idArray){ + entity.setCfgId(Long.parseLong(id)); + entity.setIsValid(isValid); + entity.setEditorId(UserUtils.getUser().getId()); + entity.setEditTime(new Date()); + entity.setTableName(AppPolicyCfg.getTablename()); + entity.setFunctionId(functionId); + appCfgDao.updateCfgValid(entity); + //保存区域IP信息 + if(entity.getAreaCfg()!=null && entity.getAreaCfg().size()>0){ + AreaIpCfg cfg = new AreaIpCfg(); + BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"}); + cfg.setTableName(AreaIpCfg.getTablename()); + appCfgDao.updateCfgValid(cfg); } } - cfg.setComplexFeaturesList(complexList); - cfg.setStrFeaturesCfgList(strList); - return cfg; + } - public Integer getIsValid(Long cfgId){ - return appCfgDao.getIsValid(cfgId); + public void updateAppIpCfgValid(Integer isValid,String ids,Integer functionId){ + AppIpCfg entity = new AppIpCfg(); + String[] idArray = ids.split(","); + for(String id :idArray){ + entity.setCfgId(Long.parseLong(id)); + entity.setIsValid(isValid); + entity.setEditorId(UserUtils.getUser().getId()); + entity.setEditTime(new Date()); + entity.setTableName(AppIpCfg.getTablename()); + entity.setFunctionId(functionId); + appCfgDao.updateCfgValid(entity); + //保存区域IP信息 + if(entity.getAreaCfg()!=null && entity.getAreaCfg().size()>0){ + AreaIpCfg cfg = new AreaIpCfg(); + BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"}); + cfg.setTableName(AreaIpCfg.getTablename()); + appCfgDao.updateCfgValid(cfg); + } + + } + } - public Integer getIsValid(String tableName, long id){ - return appCfgDao.getIsValid(tableName,id); + public void updateAppHttpCfgValid(Integer isValid,String ids,Integer functionId){ + AppHttpCfg entity = new AppHttpCfg(); + String[] idArray = ids.split(","); + for(String id :idArray){ + entity.setCfgId(Long.parseLong(id)); + entity.setIsValid(isValid); + entity.setEditorId(UserUtils.getUser().getId()); + entity.setEditTime(new Date()); + entity.setTableName(AppHttpCfg.getTablename()); + entity.setFunctionId(functionId); + appCfgDao.updateCfgValid(entity); + //保存区域IP信息 + if(entity.getAreaCfg()!=null && entity.getAreaCfg().size()>0){ + AreaIpCfg cfg = new AreaIpCfg(); + BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"}); + cfg.setTableName(AreaIpCfg.getTablename()); + appCfgDao.updateCfgValid(cfg); + } + + } + } - public Integer getIsAudit(Long cfgId){ - return appCfgDao.getIsAudit(cfgId); + public void updateAppDomainCfgValid(Integer isValid,String ids,Integer functionId){ + AppDomainCfg entity = new AppDomainCfg(); + String[] idArray = ids.split(","); + for(String id :idArray){ + entity.setCfgId(Long.parseLong(id)); + entity.setIsValid(isValid); + entity.setEditorId(UserUtils.getUser().getId()); + entity.setEditTime(new Date()); + entity.setTableName(AppDomainCfg.getTablename()); + entity.setFunctionId(functionId); + appCfgDao.updateCfgValid(entity); + //保存区域IP信息 + if(entity.getAreaCfg()!=null && entity.getAreaCfg().size()>0){ + AreaIpCfg cfg = new AreaIpCfg(); + BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"}); + cfg.setTableName(AreaIpCfg.getTablename()); + appCfgDao.updateCfgValid(cfg); + } + + } + } - public Integer getIsAudit(String tableName, long id){ - return appCfgDao.getIsAudit(tableName,id); + public void updateAppByteCfgValid(Integer isValid,String ids,Integer functionId){ + AppByteCfg entity = new AppByteCfg(); + String[] idArray = ids.split(","); + for(String id :idArray){ + entity.setCfgId(Long.parseLong(id)); + entity.setIsValid(isValid); + entity.setEditorId(UserUtils.getUser().getId()); + entity.setEditTime(new Date()); + entity.setTableName(AppByteCfg.getTablename()); + entity.setFunctionId(functionId); + appCfgDao.updateCfgValid(entity); + //保存区域IP信息 + if(entity.getAreaCfg()!=null && entity.getAreaCfg().size()>0){ + AreaIpCfg cfg = new AreaIpCfg(); + BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"}); + cfg.setTableName(AreaIpCfg.getTablename()); + appCfgDao.updateCfgValid(cfg); + } + + } + } } diff --git a/src/main/webapp/WEB-INF/views/cfg/app/appPolicyCfgForm.jsp b/src/main/webapp/WEB-INF/views/cfg/app/appPolicyCfgForm.jsp new file mode 100644 index 000000000..40409e2d9 --- /dev/null +++ b/src/main/webapp/WEB-INF/views/cfg/app/appPolicyCfgForm.jsp @@ -0,0 +1,170 @@ +<%@ page contentType="text/html;charset=UTF-8"%> +<%@ include file="/WEB-INF/include/taglib.jsp"%> + + +<spring:message code="${cfgName}"></spring:message> + + + + +
+ +
+
+
+
+
+ + + +
+
+
+ +
+ + + + + + + + + + + + + + + +
+ +
+
+
+ +
+ +
+
+
+
+ +
+
+ +
+ +
+
+
+
+
+
+
+ +
+ + + +
+
+
+
+
+
+ +
+ +
+
+
+
+
+ <%@include file="/WEB-INF/include/form/areaInfo.jsp" %> + <%@include file="/WEB-INF/include/form/basicInfo.jsp" %> +
+
+
+
+
+
+ + +
+
+
+
+
+
+
+ +
+
+
+
+
+ + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/cfg/app/appPolicyCfgList.jsp b/src/main/webapp/WEB-INF/views/cfg/app/appPolicyCfgList.jsp new file mode 100644 index 000000000..ea156854d --- /dev/null +++ b/src/main/webapp/WEB-INF/views/cfg/app/appPolicyCfgList.jsp @@ -0,0 +1,444 @@ +<%@ 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.cfgDesc }${indexCfg.appName }${indexCfg.ratelimit } + + + + + + + + + + + + + ${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