app限速统一修改为userRegion1=0取限速userRegion2,

userRegion1=1取带宽userRegion3;
app增加VIGNORE自定义域,userRegion4 为空时,下发VIGNORE=1,非空时不下发VIGNORE
This commit is contained in:
DuanDongmei
2018-11-26 13:02:30 +08:00
parent 324100f949
commit 60f4b2316b
10 changed files with 146 additions and 54 deletions

View File

@@ -964,6 +964,23 @@ public class AppCfgService extends BaseService {
if (entity.getBehavCode() != null) {
userRegion += Constants.USER_REGION_SPLIT + Constants.BEHAV_ID_REGION + "=" + entity.getBehavCode();
}
// 限速业务需要设置
if (Constants.RATELIMIT_ACTION.equals(entity.getAction())) {
entity.setUserRegion1(StringUtil.isEmpty(entity.getUserRegion1()) ? "0":entity.getUserRegion1());
//限速 需要发Droprate=0.001 暂不支持Bandwidth=200kbps
if(entity.getUserRegion1().equals("0")){//丢包率
entity.setUserRegion2(StringUtil.isEmpty(entity.getUserRegion2()) ? "":entity.getUserRegion2());
userRegion+=Constants.USER_REGION_SPLIT +Constants.INTERCEPT_IP_RATELIMIT_DROPRATE_USER_REGION_KEY+"="+entity.getUserRegion2();
}else if(entity.getUserRegion1().equals("1")){//带宽
entity.setUserRegion3(StringUtil.isEmpty(entity.getUserRegion3()) ? "":entity.getUserRegion3());
userRegion+=Constants.USER_REGION_SPLIT +Constants.INTERCEPT_IP_RATELIMIT_BANDWITH_USER_REGION_KEY+"="+entity.getUserRegion3();
}
}
//VIGNORE=1
if(StringUtil.isEmpty(entity.getUserRegion4())){
userRegion+=Constants.USER_REGION_SPLIT +Constants.APP_VIGNORE_USER_REGION_KEY+"=1";
}
} 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)) {
@@ -973,14 +990,6 @@ public class AppCfgService extends BaseService {
}
}
// 限速业务需要设置
String actionCode = DictUtils.getDictCode("SERVICE_ACTION", "action_ratelimit");
if (!actionCode.equals("默认")) {
if (entity.getAction().equals(Integer.parseInt(actionCode))) {
userRegion += Constants.USER_REGION_SPLIT + Constants.RATE_LIMIT_REGION + "="
+ entity.getRatelimit();
}
}
maatCfg.setUserRegion(userRegion);
configCompileList.add(maatCfg);
maatBean.setConfigCompileList(configCompileList);