Protocol配置导入增加doLog属性.
This commit is contained in:
@@ -21,6 +21,7 @@ public class ComplexStringAllTemplate extends BasicTemplate{
|
||||
private Integer matchMethod ;
|
||||
private Integer isHex;
|
||||
private Integer isCaseInsenstive;
|
||||
private Integer doLog;
|
||||
|
||||
@ExcelField(title="config_describe",align=2,sort=1)
|
||||
public String getCfgDesc() {
|
||||
@@ -64,4 +65,12 @@ public class ComplexStringAllTemplate extends BasicTemplate{
|
||||
public void setIsCaseInsenstive(Integer isCaseInsenstive) {
|
||||
this.isCaseInsenstive = isCaseInsenstive;
|
||||
}
|
||||
|
||||
@ExcelField(title="do_log",dictType="DO_LOG",align=2,sort=2)
|
||||
public Integer getDoLog() {
|
||||
return doLog;
|
||||
}
|
||||
public void setDoLog(Integer doLog) {
|
||||
this.doLog = doLog;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ import com.nis.util.excel.ExcelField;
|
||||
public class DnsComplexStringTemplate extends ComplexStringAllTemplate {
|
||||
private Long dnsStrategyId;
|
||||
|
||||
@ExcelField(title="policy_name",align=2,sort=2)
|
||||
@ExcelField(title="policy_name",align=2,sort=3)
|
||||
public Long getDnsStrategyId() {
|
||||
return dnsStrategyId;
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ public class DnsIpTemplate extends IpAllTemplate {
|
||||
|
||||
private Integer dnsStrategyId;
|
||||
|
||||
@ExcelField(title="policy_name",align=2,sort=2)
|
||||
@ExcelField(title="policy_name",align=2,sort=3)
|
||||
public Integer getDnsStrategyId() {
|
||||
return dnsStrategyId;
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ public class StringAllTemplate extends BasicTemplate{
|
||||
private Integer matchMethod ;
|
||||
private Integer isHex;
|
||||
private Integer isCaseInsenstive;
|
||||
private Integer doLog;
|
||||
|
||||
@ExcelField(title="config_describe",align=2,sort=1)
|
||||
public String getCfgDesc() {
|
||||
@@ -56,4 +57,12 @@ public class StringAllTemplate extends BasicTemplate{
|
||||
public void setIsCaseInsenstive(Integer isCaseInsenstive) {
|
||||
this.isCaseInsenstive = isCaseInsenstive;
|
||||
}
|
||||
|
||||
@ExcelField(title="do_log",dictType="DO_LOG",align=2,sort=2)
|
||||
public Integer getDoLog() {
|
||||
return doLog;
|
||||
}
|
||||
public void setDoLog(Integer doLog) {
|
||||
this.doLog = doLog;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ import com.beust.jcommander.internal.Sets;
|
||||
import com.nis.domain.FunctionRegionDict;
|
||||
import com.nis.domain.FunctionServiceDict;
|
||||
import com.nis.domain.SysDataDictionaryItem;
|
||||
import com.nis.domain.configuration.BaseStringCfg;
|
||||
import com.nis.domain.configuration.ComplexkeywordCfg;
|
||||
import com.nis.domain.configuration.DnsResStrategy;
|
||||
import com.nis.util.Constants;
|
||||
@@ -101,7 +102,10 @@ public class CheckComplexStringFormatThread implements Callable<String>{
|
||||
if(baseStringCfg.getCfgKeywords().length() < 4 || baseStringCfg.getCfgKeywords().length() > 1024){
|
||||
errInfo.append(prop.getProperty("key_word")+prop.getProperty("length_error")+" "+String.format(prop.getProperty("min_length")+":4,"+prop.getProperty("max_length")+":1024") + ";");
|
||||
}
|
||||
|
||||
|
||||
// doLog属性检验
|
||||
this.validDoLog(baseStringCfg,errInfo);
|
||||
|
||||
if (regionDict.getRegionType().equals(3)) {
|
||||
if (regionDict.getFunctionId().equals(7)) {
|
||||
Long dnsStrategyId = baseStringCfg.getDnsStrategyId();
|
||||
@@ -438,4 +442,28 @@ public class CheckComplexStringFormatThread implements Callable<String>{
|
||||
logger.warn("validate complexString data finish,cost:"+(end-start));
|
||||
return stringList;
|
||||
}
|
||||
|
||||
/**
|
||||
* doLog属性校验
|
||||
* @param baseStringCfg
|
||||
* @param errInfo
|
||||
*/
|
||||
public void validDoLog(ComplexkeywordCfg baseStringCfg, StringBuffer errInfo) {
|
||||
|
||||
String configDoLog = serviceDict.getConfigDoLog();
|
||||
if(StringUtils.isNotBlank(configDoLog)) {
|
||||
String defaultValue = configDoLog.substring(configDoLog.lastIndexOf(";")+1);
|
||||
String doLogOption = configDoLog.substring(configDoLog.indexOf(";")+1, configDoLog.lastIndexOf(";"));
|
||||
if(baseStringCfg.getDoLog() == null) {
|
||||
baseStringCfg.setDoLog(Integer.parseInt(defaultValue));
|
||||
}
|
||||
Integer doLog = baseStringCfg.getDoLog();
|
||||
if(!doLogOption.contains(doLog+"")) {
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("is_incorrect"), prop.getProperty("do_log"))
|
||||
+ ";");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ import com.nis.domain.FunctionRegionDict;
|
||||
import com.nis.domain.FunctionServiceDict;
|
||||
import com.nis.domain.SysDataDictionaryItem;
|
||||
import com.nis.domain.configuration.BaseStringCfg;
|
||||
import com.nis.domain.configuration.IpPortCfg;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.DictUtils;
|
||||
|
||||
@@ -97,6 +98,9 @@ public class CheckStringFormatThread implements Callable<String>{
|
||||
errInfo.append(prop.getProperty("config_describe")+prop.getProperty("length_error")+" "+String.format(prop.getProperty("max_length")+":128") + ";");
|
||||
}
|
||||
|
||||
// doLog属性检验
|
||||
this.validDoLog(baseStringCfg,errInfo);
|
||||
|
||||
if (regionDict.getRegionType().equals(2)) {
|
||||
if (regionDict.getFunctionId().equals(510) && "p2p_hash".equals(regionDict.getConfigServiceType())) {
|
||||
String userRegion1 = baseStringCfg.getUserRegion1();
|
||||
@@ -491,4 +495,28 @@ public class CheckStringFormatThread implements Callable<String>{
|
||||
logger.warn("validate stringCfg data finish,cost:"+(end-start));
|
||||
return stringList;
|
||||
}
|
||||
|
||||
/**
|
||||
* doLog属性校验
|
||||
* @param baseStringCfg
|
||||
* @param errInfo
|
||||
*/
|
||||
public void validDoLog(BaseStringCfg baseStringCfg, StringBuffer errInfo) {
|
||||
|
||||
String configDoLog = serviceDict.getConfigDoLog();
|
||||
if(StringUtils.isNotBlank(configDoLog)) {
|
||||
String defaultValue = configDoLog.substring(configDoLog.lastIndexOf(";")+1);
|
||||
String doLogOption = configDoLog.substring(configDoLog.indexOf(";")+1, configDoLog.lastIndexOf(";"));
|
||||
if(baseStringCfg.getDoLog() == null) {
|
||||
baseStringCfg.setDoLog(Integer.parseInt(defaultValue));
|
||||
}
|
||||
Integer doLog = baseStringCfg.getDoLog();
|
||||
if(!doLogOption.contains(doLog+"")) {
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("is_incorrect"), prop.getProperty("do_log"))
|
||||
+ ";");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1801,7 +1801,7 @@ public class BaseController {
|
||||
cfg.setCfgType(regionDict.getConfigRegionValue());
|
||||
cfg.setCreateTime(date);
|
||||
cfg.setCreatorId(UserUtils.getUser().getId());
|
||||
cfg.setDoLog(2);
|
||||
//cfg.setDoLog(2);
|
||||
cfg.setFunctionId(regionDict.getFunctionId());
|
||||
if(isSend.equals("1")) {
|
||||
cfg.setIsAudit(Constants.AUDIT_YES);
|
||||
@@ -1897,7 +1897,7 @@ public class BaseController {
|
||||
cfg.setCfgType(regionDict.getConfigRegionValue());
|
||||
cfg.setCreateTime(date);
|
||||
cfg.setCreatorId(UserUtils.getUser().getId());
|
||||
cfg.setDoLog(2);
|
||||
//cfg.setDoLog(2);
|
||||
cfg.setFunctionId(regionDict.getFunctionId());
|
||||
if(isSend.equals("1")) {
|
||||
cfg.setIsAudit(Constants.AUDIT_YES);
|
||||
@@ -1953,12 +1953,12 @@ public class BaseController {
|
||||
for (ComplexkeywordCfg cfg : _complexkeywordCfgs) {
|
||||
cfg.setAction(serviceDict.getAction());
|
||||
/*cfg.setAuditorId(UserUtils.getUser().getId());
|
||||
cfg.setAuditTime(date);*/
|
||||
cfg.setAuditTime(date);*/
|
||||
cfg.setCfgRegionCode(regionDict.getConfigRegionCode());
|
||||
cfg.setCfgType(regionDict.getConfigRegionValue());
|
||||
cfg.setCreateTime(date);
|
||||
cfg.setCreatorId(UserUtils.getUser().getId());
|
||||
cfg.setDoLog(2);
|
||||
//cfg.setDoLog(2);
|
||||
cfg.setFunctionId(regionDict.getFunctionId());
|
||||
if(isSend.equals("1")) {
|
||||
cfg.setIsAudit(Constants.AUDIT_YES);
|
||||
|
||||
Reference in New Issue
Block a user