intercept模块userRegion复用

特定服务模块的基础协议和app共用一套分类
This commit is contained in:
duandongmei
2018-08-28 17:16:49 +08:00
parent 8b938ac477
commit 414992b5ac
6 changed files with 80 additions and 76 deletions

View File

@@ -324,24 +324,24 @@ public class InterceptCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo>
}
//限速需要发Droprate=0.001 暂不支持Bandwidth=200kbps
if(entity.getAction().equals(Constants.RATELIMIT_ACTION)){
entity.setUserRegion2(StringUtil.isEmpty(entity.getUserRegion2()) ? "":entity.getUserRegion2());
entity.setUserRegion1(StringUtil.isEmpty(entity.getUserRegion1()) ? "":entity.getUserRegion1());
maatCfg.setUserRegion(Constants.INTERCEPT_IP_RATELIMIT_DROPRATE_USER_REGION_KEY+"="+entity.getUserRegion2());
maatCfg.setUserRegion(Constants.INTERCEPT_IP_RATELIMIT_DROPRATE_USER_REGION_KEY+"="+entity.getUserRegion1());
}
String userRegion="";
//替换需要发zone
if(entity.getAction().equals(Constants.REPLACE_ACTION)){
//HTTP replace replace type is not null ;find is not null;replace with is not null(userRegion is not null)
userRegion=Constants.REPLACE_ZONE_KEY+"="+entity.getUserRegion3();
userRegion=Constants.REPLACE_ZONE_KEY+"="+entity.getUserRegion1();
String substitute="";
String userRegion4=StringUtil.isEmpty(entity.getUserRegion4()) ? "":entity.getUserRegion4();
String userRegion2=StringUtil.isEmpty(entity.getUserRegion2()) ? "":entity.getUserRegion2();
substitute="/";
userRegion4 = BaseService.replaceContentEscape(userRegion4);
substitute=substitute+userRegion4;
userRegion2 = BaseService.replaceContentEscape(userRegion2);
substitute=substitute+userRegion2;
String userRegion5=StringUtil.isEmpty(entity.getUserRegion5()) ? "":entity.getUserRegion5();
userRegion5 = BaseService.replaceContentEscape(userRegion5);
substitute=substitute+"/"+userRegion5;
String userRegion3=StringUtil.isEmpty(entity.getUserRegion3()) ? "":entity.getUserRegion3();
userRegion3 = BaseService.replaceContentEscape(userRegion3);
substitute=substitute+"/"+userRegion3;
userRegion=userRegion+";"+Constants.REPLACE_SUBSTITUTE_KEY+"="+substitute;
maatCfg.setUserRegion(userRegion);