(1)导入配置获取编译ID改为一次获取多个
(2)DNS IP导入修复 (3)DNS欺骗IP导入提交 (4)SNAT IP池模板提交
This commit is contained in:
@@ -59,6 +59,7 @@ import com.nis.domain.configuration.template.AsnIpTemplate;
|
||||
import com.nis.domain.configuration.template.ComplexStringAllTemplate;
|
||||
import com.nis.domain.configuration.template.DdosIpTemplate;
|
||||
import com.nis.domain.configuration.template.DnsComplexStringTemplate;
|
||||
import com.nis.domain.configuration.template.DnsIpTemplate;
|
||||
import com.nis.domain.configuration.template.IpAllTemplate;
|
||||
import com.nis.domain.configuration.template.IpCfgTemplate;
|
||||
import com.nis.domain.configuration.template.IpPayloadTemplate;
|
||||
@@ -70,6 +71,7 @@ import com.nis.domain.log.BaseLogEntity;
|
||||
import com.nis.domain.log.SearchReport;
|
||||
import com.nis.domain.specific.SpecificServiceCfg;
|
||||
import com.nis.exceptions.MaatConvertException;
|
||||
import com.nis.util.ConfigServiceUtil;
|
||||
import com.nis.util.Configurations;
|
||||
//import com.nis.main.ConvertTool;
|
||||
import com.nis.util.Constants;
|
||||
@@ -1424,6 +1426,23 @@ public class BaseController {
|
||||
}
|
||||
}
|
||||
}
|
||||
// dns fake ip
|
||||
if (regionDict.getFunctionId().equals(401)) {
|
||||
Integer dnsStrategyId = baseIpCfg.getDnsStrategyId();
|
||||
if (dnsStrategyId != null) {
|
||||
if(dnsStrategyId>0) {
|
||||
List<DnsResStrategy> dnsStrategys = dnsResStrategyService
|
||||
.findDnsResStrategys(Long.valueOf(dnsStrategyId), Constants.VALID_YES, Constants.AUDIT_YES);
|
||||
if (dnsStrategys == null || dnsStrategys.size() == 0) {
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("is_incorrect"), prop.getProperty("dns_res_strategy"))
|
||||
+ ";");
|
||||
}
|
||||
}
|
||||
}else {
|
||||
baseIpCfg.setDnsStrategyId(0);
|
||||
}
|
||||
}
|
||||
//p2p ip
|
||||
if (regionDict.getFunctionId().equals(510) && "p2p_ip".equals(regionDict.getConfigServiceType())) { // P2p
|
||||
// IP
|
||||
@@ -3189,7 +3208,13 @@ public class BaseController {
|
||||
List<IpAllTemplate> list = ei.getDataList(IpAllTemplate.class, this.getMsgProp(),regionDict);
|
||||
ipPortCfgs = this.checkIpCfg(serviceDict, regionDict, list);
|
||||
}
|
||||
} else if (regionDict.getFunctionId().equals(212)) {
|
||||
} else if (regionDict.getFunctionId().equals(7)&&serviceDict!=null&&serviceDict.getAction().intValue()==16) {
|
||||
List<DnsIpTemplate> list = ei.getDataList(DnsIpTemplate.class, this.getMsgProp(),regionDict);
|
||||
ipPortCfgs = this.checkIpCfg(serviceDict, regionDict, list);
|
||||
}else if(regionDict.getFunctionId().equals(401)) {
|
||||
List<DnsIpTemplate> list = ei.getDataList(DnsIpTemplate.class, this.getMsgProp(),regionDict);
|
||||
ipPortCfgs = this.checkIpCfg(serviceDict, regionDict, list);
|
||||
}else if (regionDict.getFunctionId().equals(212)) {
|
||||
List<IpPayloadTemplate> list = ei.getDataList(IpPayloadTemplate.class, this.getMsgProp(),regionDict);
|
||||
ipPortCfgs = this.checkIpCfg(serviceDict, regionDict, list);
|
||||
} else if (regionDict.getFunctionId().equals(510)
|
||||
@@ -3278,6 +3303,15 @@ public class BaseController {
|
||||
ipPortCfgs.clear();
|
||||
asnIpCfgService.saveAsnIpBatch(asnIpCfgs);
|
||||
}else {
|
||||
List<Integer> compileIds=Lists.newArrayList();
|
||||
try {
|
||||
compileIds = ConfigServiceUtil.getId(1,ipPortCfgs.size());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.info("获取编译ID出错");
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
|
||||
}
|
||||
int ind=0;
|
||||
for (BaseIpCfg cfg : ipPortCfgs) {
|
||||
cfg.setAction(serviceDict==null?null:serviceDict.getAction());
|
||||
cfg.setAuditorId(UserUtils.getUser().getId());
|
||||
@@ -3297,7 +3331,7 @@ public class BaseController {
|
||||
cfg.setRequestId(StringUtil.isEmpty(requestId) ? 0 : requestId);
|
||||
cfg.setServiceId(serviceDict==null?null:serviceDict.getServiceId());
|
||||
cfg.setTableName("ip_port_cfg");
|
||||
cfg.setCompileId(ipCfgService.getCompileId());
|
||||
cfg.setCompileId(compileIds.get(ind));
|
||||
if (serviceDict!=null&&(serviceDict.getServiceId().intValue() == 33
|
||||
|| serviceDict.getServiceId().intValue() == 145
|
||||
|| serviceDict.getServiceId().intValue() == 35
|
||||
@@ -3322,26 +3356,38 @@ public class BaseController {
|
||||
appPolicyCfgs.add(appPolicyCfg);
|
||||
}
|
||||
} else {
|
||||
if(regionDict.getFunctionId().intValue()!=600) {
|
||||
if(regionDict.getFunctionId().intValue()!=600
|
||||
&®ionDict.getFunctionId().intValue()!=301
|
||||
&®ionDict.getFunctionId().intValue()!=401) {
|
||||
CfgIndexInfo cfgIndexInfo = new CfgIndexInfo();
|
||||
BeanUtils.copyProperties(cfg, cfgIndexInfo);
|
||||
cfgIndexInfos.add(cfgIndexInfo);
|
||||
}
|
||||
}
|
||||
|
||||
ind++;
|
||||
}
|
||||
|
||||
if(ipPortCfgs!=null&&ipPortCfgs.size()>0) {
|
||||
if (regionDict.getFunctionId().equals(301)) {
|
||||
ddosCfgService.saveDdosIpCfg(ipPortCfgs);
|
||||
}else if (regionDict.getFunctionId().equals(401)) {
|
||||
dnsIpCfgService.saveDnsIpCfg(ipPortCfgs);
|
||||
}else {
|
||||
ipCfgService.saveBatch(ipPortCfgs, IpCfgDao.class);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
} else if (regionDict.getRegionType().equals(2)) {
|
||||
List<Integer> compileIds=Lists.newArrayList();
|
||||
try {
|
||||
compileIds = ConfigServiceUtil.getId(1,stringCfgs.size());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.info("获取编译ID出错");
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
|
||||
}
|
||||
int ind=0;
|
||||
for (BaseStringCfg cfg : stringCfgs) {
|
||||
cfg.setAction(serviceDict.getAction());
|
||||
cfg.setAuditorId(UserUtils.getUser().getId());
|
||||
@@ -3360,7 +3406,7 @@ public class BaseController {
|
||||
cfg.setLable("0");
|
||||
cfg.setRequestId(StringUtil.isEmpty(requestId) ? 0 : requestId);
|
||||
cfg.setServiceId(serviceDict.getServiceId());
|
||||
cfg.setCompileId(ipCfgService.getCompileId());
|
||||
cfg.setCompileId(compileIds.get(i));
|
||||
if (serviceDict.getServiceId().intValue() == 33
|
||||
|| serviceDict.getServiceId().intValue() == 145
|
||||
|| serviceDict.getServiceId().intValue() == 35
|
||||
@@ -3389,6 +3435,7 @@ public class BaseController {
|
||||
BeanUtils.copyProperties(cfg, cfgIndexInfo, new String[] {"cfgId"});
|
||||
cfgIndexInfos.add(cfgIndexInfo);
|
||||
}
|
||||
ind++;
|
||||
}
|
||||
// 调用对应配置的service
|
||||
if (regionDict.getDictId().intValue() == 167) {
|
||||
@@ -3425,6 +3472,15 @@ public class BaseController {
|
||||
avContentCfgService.saveVoIpAccountCfg(stringCfgs);
|
||||
}
|
||||
} else if (regionDict.getRegionType().equals(3)) {
|
||||
List<Integer> compileIds=Lists.newArrayList();
|
||||
try {
|
||||
compileIds = ConfigServiceUtil.getId(1,complexkeywordCfgs.size());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.info("获取编译ID出错");
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
|
||||
}
|
||||
int ind=0;
|
||||
for (ComplexkeywordCfg cfg : complexkeywordCfgs) {
|
||||
cfg.setAction(serviceDict.getAction());
|
||||
cfg.setAuditorId(UserUtils.getUser().getId());
|
||||
@@ -3443,7 +3499,7 @@ public class BaseController {
|
||||
cfg.setLable("0");
|
||||
cfg.setRequestId(StringUtil.isEmpty(requestId) ? 0 : requestId);
|
||||
cfg.setServiceId(serviceDict.getServiceId());
|
||||
cfg.setCompileId(ipCfgService.getCompileId());
|
||||
cfg.setCompileId(compileIds.get(ind));
|
||||
if (serviceDict.getServiceId().intValue() == 33
|
||||
|| serviceDict.getServiceId().intValue() == 145
|
||||
|| serviceDict.getServiceId().intValue() == 35
|
||||
@@ -3472,6 +3528,7 @@ public class BaseController {
|
||||
BeanUtils.copyProperties(cfg, cfgIndexInfo);
|
||||
cfgIndexInfos.add(cfgIndexInfo);
|
||||
}
|
||||
ind++;
|
||||
}
|
||||
if (regionDict.getDictId().intValue() == 28) {
|
||||
websiteCfgService.saveDnsCfg(complexkeywordCfgs);
|
||||
|
||||
Reference in New Issue
Block a user