|
|
|
|
@@ -413,11 +413,25 @@ public class AppCfgService extends BaseService {
|
|
|
|
|
entity.setTableName(AppPolicyCfg.getTablename());
|
|
|
|
|
appCfgDao.auditCfg(entity);
|
|
|
|
|
if(isAudit==1){
|
|
|
|
|
StringBuffer cfgKeywords=new StringBuffer();
|
|
|
|
|
if(entity.getBehavCode()!=null){
|
|
|
|
|
entity.setCfgKeywords(entity.getAppCode()+Constants.KEYWORD_EXPR+entity.getBehavCode());
|
|
|
|
|
}else{
|
|
|
|
|
entity.setCfgKeywords(entity.getAppCode()+"");
|
|
|
|
|
if(Constants.SPECIFIC_SERVICE_CFG_TYPE_APP.equalsIgnoreCase(configType)) {
|
|
|
|
|
cfgKeywords.append(Constants.APP_ID_REGION+"="+entity.getAppCode());
|
|
|
|
|
}else if(Constants.SPECIFIC_SERVICE_CFG_TYPE_ENCRYPTED_TUNNEL_BEHAVIOR.equalsIgnoreCase(configType)||Constants.SPECIFIC_SERVICE_CFG_TYPE_BASIC_PROTOCOL.equalsIgnoreCase(configType)) {
|
|
|
|
|
cfgKeywords.append(Constants.PROTO_ID_REGION+"="+entity.getAppCode());
|
|
|
|
|
}
|
|
|
|
|
cfgKeywords.append(Constants.KEYWORD_EXPR);
|
|
|
|
|
cfgKeywords.append(Constants.BEHAV_ID_REGION+"="+entity.getBehavCode());
|
|
|
|
|
// entity.setCfgKeywords(entity.getAppCode()+Constants.KEYWORD_EXPR+entity.getBehavCode());
|
|
|
|
|
}else{
|
|
|
|
|
if(Constants.SPECIFIC_SERVICE_CFG_TYPE_APP.equalsIgnoreCase(configType)) {
|
|
|
|
|
cfgKeywords.append(Constants.APP_ID_REGION+"="+entity.getAppCode());
|
|
|
|
|
}else if(Constants.SPECIFIC_SERVICE_CFG_TYPE_ENCRYPTED_TUNNEL_BEHAVIOR.equalsIgnoreCase(configType)||Constants.SPECIFIC_SERVICE_CFG_TYPE_BASIC_PROTOCOL.equalsIgnoreCase(configType)) {
|
|
|
|
|
cfgKeywords.append(Constants.PROTO_ID_REGION+"="+entity.getAppCode());
|
|
|
|
|
}
|
|
|
|
|
// entity.setCfgKeywords(entity.getAppCode()+"");
|
|
|
|
|
}
|
|
|
|
|
entity.setCfgKeywords(cfgKeywords.toString());
|
|
|
|
|
List<AppPolicyCfg> list = new ArrayList();
|
|
|
|
|
list.add(entity);
|
|
|
|
|
Map<String,List> map = cfgConvert(strRegionList,list,2,entity,groupRelationList);
|
|
|
|
|
@@ -469,30 +483,30 @@ public class AppCfgService extends BaseService {
|
|
|
|
|
maatCfg.setGroupNum(groupRelationList.size());
|
|
|
|
|
maatCfg.setAreaIpRegionList(areaIpRegionList);
|
|
|
|
|
maatCfg.setIsValid(entity.getIsValid());
|
|
|
|
|
String userRegion=null;
|
|
|
|
|
if(Constants.SPECIFIC_SERVICE_CFG_TYPE_APP.equalsIgnoreCase(configType)) {
|
|
|
|
|
//设置APP自定义域
|
|
|
|
|
String userRegion = Constants.APP_ID_REGION+"="+entity.getAppCode();
|
|
|
|
|
userRegion = Constants.APP_ID_REGION+"="+entity.getAppCode();
|
|
|
|
|
if(entity.getBehavCode()!=null) {
|
|
|
|
|
userRegion += Constants.USER_REGION_SPLIT+Constants.BEHAV_ID_REGION+"="+entity.getBehavCode();
|
|
|
|
|
}
|
|
|
|
|
}else if(Constants.SPECIFIC_SERVICE_CFG_TYPE_BASIC_PROTOCOL.equalsIgnoreCase(configType)) {
|
|
|
|
|
userRegion = Constants.PROTO_ID_REGION+"="+entity.getAppCode();
|
|
|
|
|
}else if(Constants.SPECIFIC_SERVICE_CFG_TYPE_ENCRYPTED_TUNNEL_BEHAVIOR.equalsIgnoreCase(configType)) {
|
|
|
|
|
userRegion = Constants.PROTO_ID_REGION+"="+entity.getAppCode();
|
|
|
|
|
if(entity.getBehavCode()!=null) {
|
|
|
|
|
userRegion += Constants.USER_REGION_SPLIT+Constants.BEHAV_ID_REGION+"="+entity.getBehavCode();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
//限速业务需要设置
|
|
|
|
|
String actionCode = DictUtils.getDictCode("SERVICE_ACTION", "action_ratelimit");
|
|
|
|
|
if(!actionCode.equals("默认")){
|
|
|
|
|
if(entity.getAction().equals(Integer.parseInt(actionCode))){
|
|
|
|
|
userRegion += Constants.APP_CFG_USERREGION_SPLITOR+Constants.RATE_LIMIT_REGION+"="+entity.getRatelimit();
|
|
|
|
|
userRegion += Constants.USER_REGION_SPLIT+Constants.RATE_LIMIT_REGION+"="+entity.getRatelimit();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(entity.getBehavCode()!=null) {
|
|
|
|
|
userRegion += Constants.APP_CFG_USERREGION_SPLITOR+Constants.BEHAV_ID_REGION+"="+entity.getBehavCode();
|
|
|
|
|
}
|
|
|
|
|
maatCfg.setUserRegion(userRegion);
|
|
|
|
|
}else if(Constants.SPECIFIC_SERVICE_CFG_TYPE_BASIC_PROTOCOL.equalsIgnoreCase(configType)) {
|
|
|
|
|
String userRegion = Constants.APP_ID_REGION+"="+entity.getAppCode();
|
|
|
|
|
maatCfg.setUserRegion(userRegion);
|
|
|
|
|
}else if(Constants.SPECIFIC_SERVICE_CFG_TYPE_ENCRYPTED_TUNNEL_BEHAVIOR.equalsIgnoreCase(configType)) {
|
|
|
|
|
String userRegion = Constants.APP_ID_REGION+"="+entity.getAppCode();
|
|
|
|
|
if(entity.getBehavCode()!=null) {
|
|
|
|
|
userRegion += Constants.APP_CFG_USERREGION_SPLITOR+Constants.BEHAV_ID_REGION+"="+entity.getBehavCode();
|
|
|
|
|
}
|
|
|
|
|
maatCfg.setUserRegion(userRegion);
|
|
|
|
|
}
|
|
|
|
|
configCompileList.add(maatCfg);
|
|
|
|
|
maatBean.setConfigCompileList(configCompileList);
|
|
|
|
|
maatBean.setAuditTime(entity.getAuditTime());
|
|
|
|
|
|