diff --git a/src/main/java/com/nis/domain/configuration/AppByteCfg.java b/src/main/java/com/nis/domain/configuration/AppByteCfg.java index e964322a5..41c15b7fd 100644 --- a/src/main/java/com/nis/domain/configuration/AppByteCfg.java +++ b/src/main/java/com/nis/domain/configuration/AppByteCfg.java @@ -33,6 +33,7 @@ public class AppByteCfg extends BaseCfg { private Integer specServiceId; private String bytes; private String cfgKeywords; + private String appName; @Expose @ExcelField(title="expression_type") @@ -126,5 +127,13 @@ public class AppByteCfg extends BaseCfg { public void setCfgKeywords(String cfgKeywords) { this.cfgKeywords = cfgKeywords; } + + public String getAppName() { + return appName; + } + + public void setAppName(String appName) { + this.appName = appName; + } } diff --git a/src/main/java/com/nis/domain/configuration/AppDomainCfg.java b/src/main/java/com/nis/domain/configuration/AppDomainCfg.java index 80b8d8611..d82587ef3 100644 --- a/src/main/java/com/nis/domain/configuration/AppDomainCfg.java +++ b/src/main/java/com/nis/domain/configuration/AppDomainCfg.java @@ -33,6 +33,7 @@ public class AppDomainCfg extends BaseCfg { private Integer specServiceId; private String domain; private String cfgKeywords; + private String appName; @Expose @ExcelField(title="expression_type") @SerializedName("exprType") @@ -122,4 +123,12 @@ public class AppDomainCfg extends BaseCfg { public void setCfgKeywords(String cfgKeywords) { this.cfgKeywords = cfgKeywords; } + + public String getAppName() { + return appName; + } + + public void setAppName(String appName) { + this.appName = appName; + } } diff --git a/src/main/java/com/nis/domain/configuration/AppHttpCfg.java b/src/main/java/com/nis/domain/configuration/AppHttpCfg.java index b366eca60..2d135305c 100644 --- a/src/main/java/com/nis/domain/configuration/AppHttpCfg.java +++ b/src/main/java/com/nis/domain/configuration/AppHttpCfg.java @@ -33,6 +33,7 @@ public class AppHttpCfg extends BaseCfg { private Integer specServiceId; private String district; private String cfgKeywords; + private String appName; @Expose @ExcelField(title="expression_type") @@ -126,5 +127,13 @@ public class AppHttpCfg extends BaseCfg { public void setCfgKeywords(String cfgKeywords) { this.cfgKeywords = cfgKeywords; } + + public String getAppName() { + return appName; + } + + public void setAppName(String appName) { + this.appName = appName; + } } diff --git a/src/main/java/com/nis/domain/configuration/AppIpCfg.java b/src/main/java/com/nis/domain/configuration/AppIpCfg.java index 07df2affa..968e60686 100644 --- a/src/main/java/com/nis/domain/configuration/AppIpCfg.java +++ b/src/main/java/com/nis/domain/configuration/AppIpCfg.java @@ -23,6 +23,7 @@ public class AppIpCfg extends BaseCfg { private Integer ratelimit; private String appCode; private Integer specServiceId; + private String appName; @Expose @SerializedName("ipType") protected Integer ipType; @@ -230,5 +231,11 @@ public class AppIpCfg extends BaseCfg { public void setSpecServiceId(Integer specServiceId) { this.specServiceId = specServiceId; } + public String getAppName() { + return appName; + } + public void setAppName(String appName) { + this.appName = appName; + } } 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 fa8640511..067a6a957 100644 --- a/src/main/java/com/nis/web/controller/configuration/AppCfgController.java +++ b/src/main/java/com/nis/web/controller/configuration/AppCfgController.java @@ -14,6 +14,10 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.servlet.mvc.support.RedirectAttributes; import com.nis.domain.Page; +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.specific.SpecificServiceCfg; import com.nis.exceptions.MaatConvertException; @@ -36,8 +40,8 @@ public class AppCfgController extends BaseController { * @param response * @return */ - @RequestMapping(value = {"policyList"}) - public String policyList(Model model,@ModelAttribute("cfg")AppPolicyCfg cfg,HttpServletRequest request,HttpServletResponse response) { + @RequestMapping(value = {"policyCfgList"}) + public String policyCfgList(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()){ @@ -48,9 +52,16 @@ public class AppCfgController extends BaseController { initPageCondition(model,cfg); return "/cfg/app/appPolicyCfgList"; } - @RequestMapping(value = {"policyForm"}) + /** + * 策略配置表单 + * @param model + * @param ids + * @param entity + * @return + */ + @RequestMapping(value = {"policyCfgForm"}) @RequiresPermissions(value={"app:policy:config"}) - public String policyForm(Model model,String ids,AppPolicyCfg entity) { + public String policyCfgForm(Model model,String ids,AppPolicyCfg entity) { if(StringUtils.isNotBlank(ids)){ entity = appCfgService.getAppPolicyCfg(Long.parseLong(ids)); initUpdateFormCondition(model,entity); @@ -60,6 +71,15 @@ public class AppCfgController extends BaseController { model.addAttribute("_cfg", entity); return "/cfg/app/appPolicyCfgForm"; } + /** + * 策略配置新增修改 + * @param model + * @param request + * @param response + * @param entity + * @param redirectAttributes + * @return + */ @RequestMapping(value = {"saveAppPolicyCfg"}) @RequiresPermissions(value={"app:policy:config"}) public String saveAppPolicyCfg(Model model,HttpServletRequest request,HttpServletResponse response, @@ -71,8 +91,17 @@ public class AppCfgController extends BaseController { addMessage(redirectAttributes, e.getMessage()); } - return "redirect:" + adminPath +"/app/policyList?function="+entity.getFunctionId(); + return "redirect:" + adminPath +"/app/policyCfgList?function="+entity.getFunctionId(); } + /** + * 策略配置审核 + * @param isAudit + * @param isValid + * @param ids + * @param functionId + * @param redirectAttributes + * @return + */ @RequestMapping(value = {"auditAppPolicyCfg"}) @RequiresPermissions(value={"app:policy:audit"}) public String auditAppPolicyCfg(Integer isAudit,Integer isValid,String ids,Integer functionId, RedirectAttributes redirectAttributes) { @@ -93,12 +122,440 @@ public class AppCfgController extends BaseController { addMessage(redirectAttributes, e.getMessage()); } } - return "redirect:" + adminPath +"/app/policyList?functionId="+functionId; + return "redirect:" + adminPath +"/app/policyCfgList?functionId="+functionId; } + /** + * 策略配置删除 + * @param isValid + * @param ids + * @param functionId + * @return + */ @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; + return "redirect:" + adminPath +"/app/policyCfgList?functionId="+functionId; + } + + /** + * app协议IP配置列表 + * @param model + * @param cfg + * @param request + * @param response + * @return + */ + @RequestMapping(value = {"ipCfgList"}) + public String ipCfgList(Model model,@ModelAttribute("cfg")AppIpCfg cfg,HttpServletRequest request,HttpServletResponse response) { + Page searchPage=new Page(request,response,"r"); + Page page = appCfgService.findAppIpList(searchPage, cfg); + for(AppIpCfg entity:page.getList()){ + SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId()); + entity.setAppName(app.getSpecServiceName()); + } + model.addAttribute("page", page); + initPageCondition(model,cfg); + return "/cfg/app/appIpCfgList"; + } + /** + * 协议IP配置表单 + * @param model + * @param ids + * @param entity + * @return + */ + @RequestMapping(value = {"ipCfgForm"}) + @RequiresPermissions(value={"app:ip:config"}) + public String ipCfgForm(Model model,String ids,AppIpCfg entity) { + if(StringUtils.isNotBlank(ids)){ + entity = appCfgService.getAppIpCfg(Long.parseLong(ids)); + initUpdateFormCondition(model,entity); + }else{ + initFormCondition(model,entity); + } + model.addAttribute("_cfg", entity); + return "/cfg/app/appIpCfgForm"; + } + /** + * 协议IP配置新增修改 + * @param model + * @param request + * @param response + * @param entity + * @param redirectAttributes + * @return + */ + @RequestMapping(value = {"saveAppIpCfg"}) + @RequiresPermissions(value={"app:ip:config"}) + public String saveAppIpCfg(Model model,HttpServletRequest request,HttpServletResponse response, + AppIpCfg entity,RedirectAttributes redirectAttributes) { + try { + appCfgService.saveOrUpdateAppIpCfg(entity); + } catch (Exception e) { + e.printStackTrace(); + addMessage(redirectAttributes, e.getMessage()); + } + + return "redirect:" + adminPath +"/app/ipCfgList?function="+entity.getFunctionId(); + } + /** + * 协议IP配置审核 + * @param isAudit + * @param isValid + * @param ids + * @param functionId + * @param redirectAttributes + * @return + */ + @RequestMapping(value = {"auditAppIpCfg"}) + @RequiresPermissions(value={"app:ip:audit"}) + public String auditAppIpCfg(Integer isAudit,Integer isValid,String ids,Integer functionId, RedirectAttributes redirectAttributes) { + AppIpCfg entity = new AppIpCfg(); + String[] idArray = ids.split(","); + for(String id :idArray){ + entity = appCfgService.getAppIpCfg(Long.parseLong(id)); + entity.setIsAudit(isAudit); + entity.setIsValid(isValid); + entity.setAuditorId(UserUtils.getUser().getId()); + entity.setAuditTime(new Date()); + entity.setFunctionId(functionId); + try { + appCfgService.auditAppIpCfg(entity,isAudit); + } catch (MaatConvertException e) { + e.printStackTrace(); + logger.info("app协议IP配置下发失败:"+e.getMessage()); + addMessage(redirectAttributes, e.getMessage()); + } + } + return "redirect:" + adminPath +"/app/ipCfgList?functionId="+functionId; + } + /** + * IP配置删除 + * @param isValid + * @param ids + * @param functionId + * @return + */ + @RequestMapping(value = {"updateAppIpCfgValid"}) + @RequiresPermissions(value={"app:ip:config"}) + public String updateAppIpCfgValid(Integer isValid,String ids,Integer functionId) { + appCfgService.updateAppIpCfgValid(isValid,ids,functionId); + return "redirect:" + adminPath +"/app/ipCfgList?functionId="+functionId; + } + /** + * app协议http配置列表 + * @param model + * @param cfg + * @param request + * @param response + * @return + */ + @RequestMapping(value = {"httpCfgList"}) + public String httpCfgList(Model model,@ModelAttribute("cfg")AppHttpCfg cfg,HttpServletRequest request,HttpServletResponse response) { + Page searchPage=new Page(request,response,"r"); + Page page = appCfgService.findAppHttpList(searchPage, cfg); + for(AppHttpCfg entity:page.getList()){ + SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId()); + entity.setAppName(app.getSpecServiceName()); + } + model.addAttribute("page", page); + initPageCondition(model,cfg); + return "/cfg/app/appHttpCfgList"; + } + /** + * 协议http配置表单 + * @param model + * @param ids + * @param entity + * @return + */ + @RequestMapping(value = {"httpCfgForm"}) + @RequiresPermissions(value={"app:http:config"}) + public String httpCfgForm(Model model,String ids,AppHttpCfg entity) { + if(StringUtils.isNotBlank(ids)){ + entity = appCfgService.getAppHttpCfg(Long.parseLong(ids)); + initUpdateFormCondition(model,entity); + }else{ + initFormCondition(model,entity); + } + model.addAttribute("_cfg", entity); + return "/cfg/app/appHttpCfgForm"; + } + /** + * http配置新增修改 + * @param model + * @param request + * @param response + * @param entity + * @param redirectAttributes + * @return + */ + @RequestMapping(value = {"saveAppHttpCfg"}) + @RequiresPermissions(value={"app:http:config"}) + public String saveAppHttpCfg(Model model,HttpServletRequest request,HttpServletResponse response, + AppHttpCfg entity,RedirectAttributes redirectAttributes) { + try { + appCfgService.saveOrUpdateAppHttpCfg(entity); + } catch (Exception e) { + e.printStackTrace(); + addMessage(redirectAttributes, e.getMessage()); + } + + return "redirect:" + adminPath +"/app/httpCfgList?function="+entity.getFunctionId(); + } + /** + * http配置审核 + * @param isAudit + * @param isValid + * @param ids + * @param functionId + * @param redirectAttributes + * @return + */ + @RequestMapping(value = {"auditAppHttpCfg"}) +// @RequiresPermissions(value={"app:http:audit"}) + public String auditAppHttpCfg(Integer isAudit,Integer isValid,String ids,Integer functionId, RedirectAttributes redirectAttributes) { + AppHttpCfg entity = new AppHttpCfg(); + String[] idArray = ids.split(","); + for(String id :idArray){ + entity = appCfgService.getAppHttpCfg(Long.parseLong(id)); + entity.setIsAudit(isAudit); + entity.setIsValid(isValid); + entity.setAuditorId(UserUtils.getUser().getId()); + entity.setAuditTime(new Date()); + entity.setFunctionId(functionId); + try { + appCfgService.auditAppHttpCfg(entity,isAudit); + } catch (MaatConvertException e) { + e.printStackTrace(); + logger.info("app http配置下发失败:"+e.getMessage()); + addMessage(redirectAttributes, e.getMessage()); + } + } + return "redirect:" + adminPath +"/app/httpCfgList?functionId="+functionId; + } + /** + * http配置删除 + * @param isValid + * @param ids + * @param functionId + * @return + */ + @RequestMapping(value = {"updateAppHttpCfgValid"}) + @RequiresPermissions(value={"app:http:config"}) + public String updateAppHttpCfgValid(Integer isValid,String ids,Integer functionId) { + appCfgService.updateAppHttpCfgValid(isValid,ids,functionId); + return "redirect:" + adminPath +"/app/httpCfgList?functionId="+functionId; + } + /** + * app协议domain配置列表 + * @param model + * @param cfg + * @param request + * @param response + * @return + */ + @RequestMapping(value = {"domainCfgList"}) + public String domainCfgList(Model model,@ModelAttribute("cfg")AppDomainCfg cfg,HttpServletRequest request,HttpServletResponse response) { + Page searchPage=new Page(request,response,"r"); + Page page = appCfgService.findAppDomainList(searchPage, cfg); + for(AppDomainCfg entity:page.getList()){ + SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId()); + entity.setAppName(app.getSpecServiceName()); + } + model.addAttribute("page", page); + initPageCondition(model,cfg); + return "/cfg/app/appDomainCfgList"; + } + /** + * 协议domain配置表单 + * @param model + * @param ids + * @param entity + * @return + */ + @RequestMapping(value = {"domainCfgForm"}) + @RequiresPermissions(value={"app:domain:config"}) + public String domainCfgForm(Model model,String ids,AppDomainCfg entity) { + if(StringUtils.isNotBlank(ids)){ + entity = appCfgService.getAppDomainCfg(Long.parseLong(ids)); + initUpdateFormCondition(model,entity); + }else{ + initFormCondition(model,entity); + } + model.addAttribute("_cfg", entity); + return "/cfg/app/appDomainCfgForm"; + } +/** + * domain配置新增修改 + * @param model + * @param request + * @param response + * @param entity + * @param redirectAttributes + * @return + */ + @RequestMapping(value = {"saveAppDomainCfg"}) + @RequiresPermissions(value={"app:domain:config"}) + public String saveAppDomainCfg(Model model,HttpServletRequest request,HttpServletResponse response, + AppDomainCfg entity,RedirectAttributes redirectAttributes) { + try { + appCfgService.saveOrUpdateAppDomainCfg(entity); + } catch (Exception e) { + e.printStackTrace(); + addMessage(redirectAttributes, e.getMessage()); + } + + return "redirect:" + adminPath +"/app/domainCfgList?function="+entity.getFunctionId(); + } + /** + * domain配置审核 + * @param isAudit + * @param isValid + * @param ids + * @param functionId + * @param redirectAttributes + * @return + */ + @RequestMapping(value = {"auditAppDomainCfg"}) +// @RequiresPermissions(value={"app:domain:audit"}) + public String auditAppDomainCfg(Integer isAudit,Integer isValid,String ids,Integer functionId, RedirectAttributes redirectAttributes) { + AppDomainCfg entity = new AppDomainCfg(); + String[] idArray = ids.split(","); + for(String id :idArray){ + entity = appCfgService.getAppDomainCfg(Long.parseLong(id)); + entity.setIsAudit(isAudit); + entity.setIsValid(isValid); + entity.setAuditorId(UserUtils.getUser().getId()); + entity.setAuditTime(new Date()); + entity.setFunctionId(functionId); + try { + appCfgService.auditAppDomainCfg(entity,isAudit); + } catch (MaatConvertException e) { + e.printStackTrace(); + logger.info("app协议domain配置下发失败:"+e.getMessage()); + addMessage(redirectAttributes, e.getMessage()); + } + } + return "redirect:" + adminPath +"/app/domainCfgList?functionId="+functionId; + } + /** + * domain配置删除 + * @param isValid + * @param ids + * @param functionId + * @return + */ + @RequestMapping(value = {"updateAppDomainCfgValid"}) + @RequiresPermissions(value={"app:domain:config"}) + public String updateAppDomainCfgValid(Integer isValid,String ids,Integer functionId) { + appCfgService.updateAppDomainCfgValid(isValid,ids,functionId); + return "redirect:" + adminPath +"/app/domainCfgList?functionId="+functionId; + } + /** + * app协议byte配置列表 + * @param model + * @param cfg + * @param request + * @param response + * @return + */ + @RequestMapping(value = {"byteCfgList"}) + public String byteCfgList(Model model,@ModelAttribute("cfg")AppByteCfg cfg,HttpServletRequest request,HttpServletResponse response) { + Page searchPage=new Page(request,response,"r"); + Page page = appCfgService.findAppByteList(searchPage, cfg); + for(AppByteCfg entity:page.getList()){ + SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId()); + entity.setAppName(app.getSpecServiceName()); + } + model.addAttribute("page", page); + initPageCondition(model,cfg); + return "/cfg/app/appByteCfgList"; + } + /** + * 协议byte配置表单 + * @param model + * @param ids + * @param entity + * @return + */ + @RequestMapping(value = {"byteCfgForm"}) + @RequiresPermissions(value={"app:byte:config"}) + public String byteCfgForm(Model model,String ids,AppByteCfg entity) { + if(StringUtils.isNotBlank(ids)){ + entity = appCfgService.getAppByteCfg(Long.parseLong(ids)); + initUpdateFormCondition(model,entity); + }else{ + initFormCondition(model,entity); + } + model.addAttribute("_cfg", entity); + return "/cfg/app/appByteCfgForm"; + } +/** + * byte配置新增修改 + * @param model + * @param request + * @param response + * @param entity + * @param redirectAttributes + * @return + */ + @RequestMapping(value = {"saveAppByteCfg"}) + @RequiresPermissions(value={"app:byte:config"}) + public String saveAppByteCfg(Model model,HttpServletRequest request,HttpServletResponse response, + AppByteCfg entity,RedirectAttributes redirectAttributes) { + try { + appCfgService.saveOrUpdateAppByteCfg(entity); + } catch (Exception e) { + e.printStackTrace(); + addMessage(redirectAttributes, e.getMessage()); + } + + return "redirect:" + adminPath +"/app/byteCfgList?function="+entity.getFunctionId(); + } + /** + * byte配置审核 + * @param isAudit + * @param isValid + * @param ids + * @param functionId + * @param redirectAttributes + * @return + */ + @RequestMapping(value = {"auditAppByteCfg"}) +// @RequiresPermissions(value={"app:byte:audit"}) + public String auditAppByteCfg(Integer isAudit,Integer isValid,String ids,Integer functionId, RedirectAttributes redirectAttributes) { + AppByteCfg entity = new AppByteCfg(); + String[] idArray = ids.split(","); + for(String id :idArray){ + entity = appCfgService.getAppByteCfg(Long.parseLong(id)); + entity.setIsAudit(isAudit); + entity.setIsValid(isValid); + entity.setAuditorId(UserUtils.getUser().getId()); + entity.setAuditTime(new Date()); + entity.setFunctionId(functionId); + try { + appCfgService.auditAppByteCfg(entity,isAudit); + } catch (MaatConvertException e) { + e.printStackTrace(); + logger.info("app协议byte配置下发失败:"+e.getMessage()); + addMessage(redirectAttributes, e.getMessage()); + } + } + return "redirect:" + adminPath +"/app/byteCfgList?functionId="+functionId; + } + /** + * byte配置删除 + * @param isValid + * @param ids + * @param functionId + * @return + */ + @RequestMapping(value = {"updateAppByteCfgValid"}) + @RequiresPermissions(value={"app:byte:config"}) + public String updateAppByteCfgValid(Integer isValid,String ids,Integer functionId) { + appCfgService.updateAppByteCfgValid(isValid,ids,functionId); + return "redirect:" + adminPath +"/app/byteCfgList?functionId="+functionId; } } diff --git a/src/main/java/com/nis/web/service/BaseService.java b/src/main/java/com/nis/web/service/BaseService.java index 67394ecbd..82a827eef 100644 --- a/src/main/java/com/nis/web/service/BaseService.java +++ b/src/main/java/com/nis/web/service/BaseService.java @@ -267,6 +267,8 @@ public abstract class BaseService { } /** * 界面配置list转换为服务接口端的list + * @param + * @param * @param dstList * @param srcList * @param cfgType,1为IP类型,2为字符串类型,3为增强字符串,4数值类型,5摘要类,6回调类[但字符串类域配置和增强字符串域配置在接口参数中同属于strRegionList] @@ -274,13 +276,14 @@ public abstract class BaseService { * @param groupRelationList 配置分组列表 * @return */ - public static Map cfgConvert(List dstList,List srcList,Integer cfgType,BaseCfg baseCfg,List groupRelationList){ + public static Map cfgConvert(List dstList,List srcList,Integer cfgType,BaseCfg baseCfg,List groupRelationList){ Map map = new HashMap(); if(cfgType==1){ List numRegionList = new ArrayList(); Integer groupId = 0; - for(int i=0;i strRegionList = new ArrayList(); List numRegionList = new ArrayList(); List digestRegionList = new ArrayList(); - List areaIpRegionList = 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(); @@ -332,15 +348,14 @@ public class AppCfgService extends BaseService { List numRegionList = new ArrayList(); List digestRegionList = new ArrayList(); List areaIpRegionList = new ArrayList(); - entity = this.getAppIpCfg(entity.getCfgId()); - entity.setTableName(AppPolicyCfg.getTablename()); + entity.setTableName(AppIpCfg.getTablename()); appCfgDao.auditCfg(entity); if(isAudit==1){ List list = new ArrayList(); list.add(entity); - Map map = cfgConvert(strRegionList,list,2,entity,groupRelationList); + Map map = cfgConvert(ipRegionList,list,1,entity,groupRelationList); groupRelationList=map.get("groupList"); - strRegionList=map.get("dstList"); + ipRegionList=map.get("dstList"); } //保存区域IP信息 List areaIpCfgList=areaIpCfgDao.getByCompileId(entity.getCompileId()); @@ -373,9 +388,13 @@ public class AppCfgService extends BaseService { 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); @@ -419,9 +438,9 @@ public class AppCfgService extends BaseService { List numRegionList = new ArrayList(); List digestRegionList = new ArrayList(); List areaIpRegionList = new ArrayList(); - entity = this.getAppHttpCfg(entity.getCfgId()); - entity.setTableName(AppPolicyCfg.getTablename()); + entity.setTableName(AppHttpCfg.getTablename()); appCfgDao.auditCfg(entity); + if(isAudit==1){ List list = new ArrayList(); list.add(entity); @@ -460,9 +479,13 @@ public class AppCfgService extends BaseService { 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); @@ -506,10 +529,10 @@ public class AppCfgService extends BaseService { List numRegionList = new ArrayList(); List digestRegionList = new ArrayList(); List areaIpRegionList = new ArrayList(); - entity = this.getAppDomainCfg(entity.getCfgId()); - entity.setTableName(AppPolicyCfg.getTablename()); + entity.setTableName(AppDomainCfg.getTablename()); appCfgDao.auditCfg(entity); if(isAudit==1){ + entity.setCfgKeywords(entity.getDomain()); List list = new ArrayList(); list.add(entity); Map map = cfgConvert(strRegionList,list,2,entity,groupRelationList); @@ -547,9 +570,13 @@ public class AppCfgService extends BaseService { 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); @@ -593,10 +620,11 @@ public class AppCfgService extends BaseService { List numRegionList = new ArrayList(); List digestRegionList = new ArrayList(); List areaIpRegionList = new ArrayList(); - entity = this.getAppByteCfg(entity.getCfgId()); - entity.setTableName(AppPolicyCfg.getTablename()); + entity.setTableName(AppByteCfg.getTablename()); appCfgDao.auditCfg(entity); + if(isAudit==1){ + entity.setCfgKeywords(entity.getBytes()); List list = new ArrayList(); list.add(entity); Map map = cfgConvert(strRegionList,list,2,entity,groupRelationList); @@ -634,9 +662,13 @@ public class AppCfgService extends BaseService { 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); diff --git a/src/main/resources/messages/message_zh_CN.properties b/src/main/resources/messages/message_zh_CN.properties index 180943f61..6f9c68119 100644 --- a/src/main/resources/messages/message_zh_CN.properties +++ b/src/main/resources/messages/message_zh_CN.properties @@ -718,4 +718,15 @@ target_ip_protect=\u76EE\u6807IP\u9632\u62A4 ratelimit_config=\u9650\u6D41\u7BA1\u7406 ip_ratelimit=ip\u9650\u6D41 domain_ratelimit=\u57DF\u540D\u9650\u6D41 -#=============about manipulation========= \ No newline at end of file +#=============about manipulation========= +#=============about app config=========== +domain=\u57df\u540d +app_ip_config=APP\u534f\u8baeip\u914d\u7f6e + +app_http_config=APP HTTP\u7279\u5f81\u914d\u7f6e +app_domain_config=APP\u57df\u540d\u7279\u5f81\u914d\u7f6e +app_byte_config=APP\u5b57\u8282\u7279\u5f81\u914d\u7f6e +social_app=\u793e\u4ea4\u5e94\u7528 +app_policy_config=APP\u7b56\u7565\u914d\u7f6e +app_features_config=APP\u7279\u5f81\u914d\u7f6e +#=============about app config=========== \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/cfg/app/appByteCfgForm.jsp b/src/main/webapp/WEB-INF/views/cfg/app/appByteCfgForm.jsp new file mode 100644 index 000000000..9b60d5dfd --- /dev/null +++ b/src/main/webapp/WEB-INF/views/cfg/app/appByteCfgForm.jsp @@ -0,0 +1,221 @@ +<%@ 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/appByteCfgList.jsp b/src/main/webapp/WEB-INF/views/cfg/app/appByteCfgList.jsp new file mode 100644 index 000000000..348d6e9b8 --- /dev/null +++ b/src/main/webapp/WEB-INF/views/cfg/app/appByteCfgList.jsp @@ -0,0 +1,402 @@ +<%@ 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});"/> + +
+
+
+ + +
+ + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + ${cfg.cfgDesc }${cfg.appName }${cfg.bytes } + + + + + + + + + + + + + ${cfg.requestName } + + + + + + + + + + + + + + + ${fns:abbr(classify,20)} + + + + + + + + + + + + + + + + + ${fns:abbr(attribute,20)} + + + + + + + + + + + + + + + + + + ${fns:abbr(lableInfo,20)} + + + + + + + + + + + + + ${cfg.creatorName }${cfg.editorName }${cfg.auditorName }
+
${page}
+
+ +
+
+
+ + + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/cfg/app/appDomainCfgForm.jsp b/src/main/webapp/WEB-INF/views/cfg/app/appDomainCfgForm.jsp new file mode 100644 index 000000000..0a811c88f --- /dev/null +++ b/src/main/webapp/WEB-INF/views/cfg/app/appDomainCfgForm.jsp @@ -0,0 +1,221 @@ +<%@ 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/appDomainCfgList.jsp b/src/main/webapp/WEB-INF/views/cfg/app/appDomainCfgList.jsp new file mode 100644 index 000000000..b1f0673b2 --- /dev/null +++ b/src/main/webapp/WEB-INF/views/cfg/app/appDomainCfgList.jsp @@ -0,0 +1,402 @@ +<%@ 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});"/> + +
+
+
+ + +
+ + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + ${cfg.cfgDesc }${cfg.appName }${cfg.domain } + + + + + + + + + + + + + ${cfg.requestName } + + + + + + + + + + + + + + + ${fns:abbr(classify,20)} + + + + + + + + + + + + + + + + + ${fns:abbr(attribute,20)} + + + + + + + + + + + + + + + + + + ${fns:abbr(lableInfo,20)} + + + + + + + + + + + + + ${cfg.creatorName }${cfg.editorName }${cfg.auditorName }
+
${page}
+
+ +
+
+
+ + + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/cfg/app/appHttpCfgForm.jsp b/src/main/webapp/WEB-INF/views/cfg/app/appHttpCfgForm.jsp new file mode 100644 index 000000000..b9dadf39f --- /dev/null +++ b/src/main/webapp/WEB-INF/views/cfg/app/appHttpCfgForm.jsp @@ -0,0 +1,243 @@ +<%@ 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/appHttpCfgList.jsp b/src/main/webapp/WEB-INF/views/cfg/app/appHttpCfgList.jsp new file mode 100644 index 000000000..f68924379 --- /dev/null +++ b/src/main/webapp/WEB-INF/views/cfg/app/appHttpCfgList.jsp @@ -0,0 +1,404 @@ +<%@ 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});"/> + +
+
+
+ + +
+ + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + ${cfg.cfgDesc }${cfg.appName }${cfg.district }${cfg.cfgKeywords } + + + + + + + + + + + + + ${cfg.requestName } + + + + + + + + + + + + + + + ${fns:abbr(classify,20)} + + + + + + + + + + + + + + + + + ${fns:abbr(attribute,20)} + + + + + + + + + + + + + + + + + + ${fns:abbr(lableInfo,20)} + + + + + + + + + + + + + ${cfg.creatorName }${cfg.editorName }${cfg.auditorName }
+
${page}
+
+ +
+
+
+ + + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/cfg/app/appIpCfgForm.jsp b/src/main/webapp/WEB-INF/views/cfg/app/appIpCfgForm.jsp new file mode 100644 index 000000000..16d0f656f --- /dev/null +++ b/src/main/webapp/WEB-INF/views/cfg/app/appIpCfgForm.jsp @@ -0,0 +1,220 @@ +<%@ 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/appIpCfgList.jsp b/src/main/webapp/WEB-INF/views/cfg/app/appIpCfgList.jsp new file mode 100644 index 000000000..3b5bfcda5 --- /dev/null +++ b/src/main/webapp/WEB-INF/views/cfg/app/appIpCfgList.jsp @@ -0,0 +1,423 @@ +<%@ 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});"/> + +
+
+
+ + +
+ + +
+
+
+ + + + + + + + <%-- + --%> + + + + + + + + + + + + + + + + + + + + + + + + + + + <%-- + --%> + + + + + + + + + + + + + + + + + + + + +
ip
+ + ${cfg.cfgDesc }${cfg.appName } + ${ipType.itemValue} + ${cfg.srcIpAddress }${cfg.srcPort }${cfg.destIpAddress }${cfg.destPort } + + + + + + + + + + + + + + + + + + + ${cfg.requestName } + + + + + + + + + + + + + + + ${fns:abbr(classify,20)} + + + + + + + + + + + + + + + + + ${fns:abbr(attribute,20)} + + + + + + + + + + + + + + + + + + ${fns:abbr(lableInfo,20)} + + + + + + + + + + + + + ${cfg.creatorName }${cfg.editorName }${cfg.auditorName }
+
${page}
+
+ +
+
+
+ + + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/cfg/app/appPolicyCfgForm.jsp b/src/main/webapp/WEB-INF/views/cfg/app/appPolicyCfgForm.jsp index 40409e2d9..86956adbb 100644 --- a/src/main/webapp/WEB-INF/views/cfg/app/appPolicyCfgForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/app/appPolicyCfgForm.jsp @@ -90,7 +90,7 @@ $(function(){
- +
"+ - ""+ - ""+ - ""; - var html=""; - html+="
"; - html = html+data; - subTab=subTab+html; - subTab+=""; - subTab+=""; - $("#"+openId).parent().parent().after(subTab); - $("div[name='tabTitle"+index+"']").get(0).click(); - } - }); - } - - }); - - $("span[id^=close]").on("click",function(){ - var closeId=$(this).attr("id"); - var openId=$(this).attr("id").replace("close","open"); - $("#"+closeId).hide(); - $("#"+openId).show(); - $("#"+closeId).parent().parent().next("tr").hide(); - }); }); @@ -87,14 +42,14 @@

- +

@@ -103,7 +58,7 @@
- + @@ -126,7 +81,7 @@
- +
- + @@ -309,7 +264,7 @@ - + @@ -328,33 +283,33 @@ - + - + - ${indexCfg.cfgDesc } - ${indexCfg.appName } - ${indexCfg.ratelimit } + ${cfg.cfgDesc } + ${cfg.appName } + ${cfg.ratelimit } - + - - - + + + - ${indexCfg.requestName } + ${cfg.requestName } - + @@ -373,7 +328,7 @@ - + @@ -393,7 +348,7 @@ - + @@ -411,24 +366,24 @@ - - - + + + - - - - + + + + - ${indexCfg.creatorName } - - ${indexCfg.editorName } - - ${indexCfg.auditorName } - + ${cfg.creatorName } + + ${cfg.editorName } + + ${cfg.auditorName } + diff --git a/src/main/webapp/static/global/scripts/common.js b/src/main/webapp/static/global/scripts/common.js index 9529123bc..f722ff65c 100644 --- a/src/main/webapp/static/global/scripts/common.js +++ b/src/main/webapp/static/global/scripts/common.js @@ -225,7 +225,7 @@ $(function(){ }); $(tagsInputSettings).tagsInput({ - width:$(".form-control").width(), + width:$(tagsInputSettings).find(".form-control").width(), defaultText:'please input keywords', 'delimiter':'***and***',//特殊字符串分隔与表达式的多关键词 onAddTag:function(tag,size){