(1)调整ip配置界面

(2)ip配置界面ip限速加入用户自定义域
This commit is contained in:
wangxin
2018-10-11 19:09:28 +08:00
parent 4c63f3b27f
commit ef6d793d6b
7 changed files with 139 additions and 73 deletions

View File

@@ -562,6 +562,13 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
if(map.get("numRegionList")!=null){
numRegionList.addAll(map.get("numRegionList"));
}
if(Constants.SERVICE_IP_MULITIPLEX==cfg.getServiceId().intValue()){
String region=Constants.USERREGION_IR_STRATEGY+"="+cfg.getDnsStrategyId()+Constants.USER_REGION_SPLIT
+Constants.USERREGION_IR_TYPE+"="+cfg.getIrType();
maatCfg.setUserRegion(region);
}else if(Constants.SERVICE_IP_RATELIMIT==cfg.getServiceId().intValue()){
maatCfg.setUserRegion(Constants.USERREGION_RATE_LIMIT+"="+cfg.getRatelimit());
}
}
}
if(entity.getNtcSubscribeIdCfgList()!=null && entity.getNtcSubscribeIdCfgList().size()>0){
@@ -630,6 +637,16 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
maatBean.setCreatorName(entity.getCurrentUser().getName());
maatBean.setVersion(Constants.MAAT_VERSION);
maatBean.setOpAction(Constants.INSERT_ACTION);
//限速需要发Droprate=0.001 暂不支持Bandwidth=200kbps
if(entity.getAction().equals(Constants.RATELIMIT_ACTION)){
if(entity.getUserRegion1().equals("0")){//丢包率
entity.setUserRegion2(StringUtil.isEmpty(entity.getUserRegion2()) ? "":entity.getUserRegion2());
maatCfg.setUserRegion(Constants.INTERCEPT_IP_RATELIMIT_DROPRATE_USER_REGION_KEY+"="+entity.getUserRegion2());
}else if(entity.getUserRegion1().equals("1")){//带宽
entity.setUserRegion3(StringUtil.isEmpty(entity.getUserRegion3()) ? "":entity.getUserRegion3());
maatCfg.setUserRegion(Constants.INTERCEPT_IP_RATELIMIT_BANDWITH_USER_REGION_KEY+"="+entity.getUserRegion3());
}
}
//调用服务接口下发配置数据
String json=gsonToJson(maatBean);
logger.info("ip配置下发配置参数"+json);