stream、DDOS和高级功能模块对某些用户的配置不经过审核直接生效及生效中的配置进行修改的功能
This commit is contained in:
@@ -71,10 +71,14 @@ public class DdosCfgService extends BaseService{
|
||||
return ddosCfgDao.getDdosIpCfg(cfgId,compileId);
|
||||
}
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void saveOrUpdate(DdosIpCfg entity){
|
||||
public void saveOrUpdate(DdosIpCfg entity) throws Exception{
|
||||
Date createTime=new Date();
|
||||
//设置区域运营商信息
|
||||
setAreaEffectiveIds(entity);
|
||||
int isValid=0;
|
||||
if(!StringUtil.isEmpty(entity.getIsValid()) && entity.getIsValid()==1) {
|
||||
isValid=1;
|
||||
}
|
||||
String antiddosProtocol = entity.getAntiddosProtocol();
|
||||
Long bpsThreadshold = entity.getBpsThreadshold();
|
||||
Long ppsThreadshold = entity.getPpsThreadshold();
|
||||
@@ -116,7 +120,11 @@ public class DdosCfgService extends BaseService{
|
||||
}else {
|
||||
throw new RuntimeException("Could not get compileId!");
|
||||
}
|
||||
|
||||
if(isValid==1) {
|
||||
entity.setIsAudit(1);
|
||||
entity.setIsValid(1);
|
||||
audit(entity.getIsAudit(), isValid, entity.getFunctionId(),String.valueOf(entity.getCfgId()), new Date(),Constants.INSERT_ACTION);
|
||||
}
|
||||
//修改
|
||||
}else{
|
||||
Date editTime=new Date();
|
||||
@@ -126,6 +134,11 @@ public class DdosCfgService extends BaseService{
|
||||
entity.setEditTime(editTime);
|
||||
|
||||
ddosCfgDao.update(entity);
|
||||
if(isValid==1) {
|
||||
entity.setIsAudit(1);
|
||||
entity.setIsValid(1);
|
||||
audit(entity.getIsAudit(), isValid, entity.getFunctionId(),String.valueOf(entity.getCfgId()), new Date(),Constants.UPDATE_ACTION);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -228,7 +241,7 @@ public class DdosCfgService extends BaseService{
|
||||
|
||||
}*/
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void audit(Integer isAudit,Integer isValid,Integer functionId,String id,Date auditTime) throws Exception{
|
||||
public void audit(Integer isAudit,Integer isValid,Integer functionId,String id,Date auditTime,Integer opAction) throws Exception{
|
||||
DdosIpCfg entity = new DdosIpCfg();
|
||||
|
||||
entity=ddosCfgDao.getDdosIpCfg(Long.valueOf(id),entity.getCompileId());
|
||||
@@ -308,7 +321,7 @@ public class DdosCfgService extends BaseService{
|
||||
maatBean.setAuditTime(auditTime);
|
||||
maatBean.setCreatorName(entity.getCurrentUser().getName());
|
||||
maatBean.setVersion(Constants.MAAT_VERSION);
|
||||
maatBean.setOpAction(Constants.INSERT_ACTION);
|
||||
maatBean.setOpAction(opAction);
|
||||
//调用服务接口下发配置数据
|
||||
String json=gsonToJson(maatBean);
|
||||
logger.info("ddos 配置下发配置参数:"+json);
|
||||
|
||||
Reference in New Issue
Block a user