基础信息、隧道行为增加限速,Stream模块三个限速位置统一
This commit is contained in:
@@ -964,23 +964,6 @@ 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)) {
|
||||
@@ -990,6 +973,24 @@ public class AppCfgService extends BaseService {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// 限速业务需要设置
|
||||
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";
|
||||
}
|
||||
|
||||
maatCfg.setUserRegion(userRegion);
|
||||
configCompileList.add(maatCfg);
|
||||
maatBean.setConfigCompileList(configCompileList);
|
||||
|
||||
Reference in New Issue
Block a user