ddos提交

This commit is contained in:
zhanghongqing
2018-10-18 10:14:15 +08:00
parent b201c7a520
commit 849ba480de

View File

@@ -3,12 +3,15 @@ package com.nis.web.service.configuration;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.google.gson.Gson;
import com.nis.domain.Page;
import com.nis.domain.callback.InlineIp;
import com.nis.domain.configuration.DdosIpCfg;
@@ -123,11 +126,19 @@ public class DdosCfgService extends BaseService{
ddosCfgDao.update(entity);
entity=ddosCfgDao.getDdosIpCfg(Long.valueOf(id));
String antiddosProtocol = entity.getAntiddosProtocol();
Long bpsThreadshold = entity.getBpsThreadshold();
Long ppsThreadshold = entity.getPpsThreadshold();
Map map= new HashMap();
map.put("protocol", antiddosProtocol);
map.put("bps_threadshold", bpsThreadshold);
map.put("pps_threadshold", ppsThreadshold);
String json="";
if(entity.getIsAudit()==1){
List<InlineIp> ipList=new ArrayList<InlineIp>();
InlineIp resStrategy=convertCallBackIp(entity,null);
resStrategy.setUserRegion(new Gson().toJson(map));
ipList.add(resStrategy);
//调用服务接口下发配置数据
json=gsonToJson(ipList);
@@ -145,6 +156,7 @@ public class DdosCfgService extends BaseService{
}else if(entity.getIsAudit()==3){
List<InlineIp> resStrategyList=new ArrayList<>();
InlineIp resStrategy=convertCallBackIp(entity,entity.getDnsStrategyId());
resStrategy.setUserRegion(new Gson().toJson(map));
resStrategyList.add(resStrategy);
//调用服务接口取消配置
json=gsonToJson(resStrategyList);