PROXY+IP Spoofing+IP payload增加配置热修改和配置新增直接生效功能

This commit is contained in:
duandongmei
2019-04-14 17:17:58 +08:00
parent a769757728
commit ecb1fed2d5
13 changed files with 227 additions and 42 deletions

View File

@@ -167,6 +167,15 @@ public class CachePolicyService extends CrudService<WebsiteCfgDao,CfgIndexInfo>
public void saveCachePolicy(CfgIndexInfo entity){
//设置区域运营商信息
setAreaEffectiveIds(entity);
int isValid=0;
if(!StringUtil.isEmpty(entity.getIsValid()) && entity.getIsValid()==1) {
isValid=1;
}
entity.setIsValid(0);
entity.setIsAudit(0);
if(entity.getCfgId()==null){
Integer compileId = 0;
try {
@@ -206,6 +215,12 @@ public class CachePolicyService extends CrudService<WebsiteCfgDao,CfgIndexInfo>
throw e;
}
if(isValid==1) {
entity.setIsAudit(1);
entity.setIsValid(1);
auditCachePolicy(entity, isValid,Constants.INSERT_ACTION);
}
}else{
//处理复杂用户自定义域
if(!StringUtil.isEmpty(entity.getUserRegion())){
@@ -243,6 +258,12 @@ public class CachePolicyService extends CrudService<WebsiteCfgDao,CfgIndexInfo>
areaIpCfgDao.saveAreaIpCfg(cfg);
}
}
if(isValid==1) {
entity.setIsAudit(1);
entity.setIsValid(1);
auditCachePolicy(entity, isValid,Constants.UPDATE_ACTION);
}
}
}
public void updateCachePolicyValid(Integer isValid,String ids,Integer functionId){
@@ -276,9 +297,12 @@ public class CachePolicyService extends CrudService<WebsiteCfgDao,CfgIndexInfo>
}
}
public void auditCachePolicy(CfgIndexInfo entity,Integer isAudit) throws MaatConvertException{
public void auditCachePolicy(CfgIndexInfo entity,Integer isAudit,Integer opAction) throws MaatConvertException{
//修改数据库审核状态信息
entity.setTableName(CfgIndexInfo.getTablename());
entity.setIsAudit(isAudit);
entity.setAuditorId(UserUtils.getUser().getId());
entity.setAuditTime(new Date());
commonPolicyDao.auditCfg(entity);
ToMaatBean maatBean = new ToMaatBean();
@@ -377,7 +401,7 @@ public class CachePolicyService extends CrudService<WebsiteCfgDao,CfgIndexInfo>
maatBean.setAuditTime(entity.getAuditTime());
maatBean.setCreatorName(entity.getCurrentUser().getName());
maatBean.setVersion(Constants.MAAT_VERSION);
maatBean.setOpAction(Constants.INSERT_ACTION);
maatBean.setOpAction(opAction);
//调用服务接口下发配置数据
String json=gsonToJson(maatBean);
logger.info("代理缓存策略下发配置参数:"+json);