diff --git a/src/main/java/neatlogic/framework/cmdb/exception/ci/CiUniqueAttrNotFoundException.java b/src/main/java/neatlogic/framework/cmdb/exception/ci/CiUniqueAttrNotFoundException.java index f924131cb4b4613b9ef6676aa31bbe9f8e50cf7b..5e612b836d670551218a85135ffc31f1ee55b823 100644 --- a/src/main/java/neatlogic/framework/cmdb/exception/ci/CiUniqueAttrNotFoundException.java +++ b/src/main/java/neatlogic/framework/cmdb/exception/ci/CiUniqueAttrNotFoundException.java @@ -27,22 +27,22 @@ public class CiUniqueAttrNotFoundException extends ApiRuntimeException { private static final long serialVersionUID = 6853526342242823864L; public CiUniqueAttrNotFoundException(String ciName) { - super("配置项模型“{0}”缺少唯一属性,请设置", ciName); + super("nfcec.ciuniqueattrnotfoundexception.ciuniqueattrnotfoundexception_a", ciName); } public CiUniqueAttrNotFoundException(CiVo ciVo, AttrVo attrVo) { - super("模型“{0}({1})”的唯一规则属性“{2}({3})”没有配置匹配字段,请先配置", ciVo.getLabel(), ciVo.getName(), attrVo.getLabel(), attrVo.getName()); + super("nfcec.ciuniqueattrnotfoundexception.ciuniqueattrnotfoundexception_b", ciVo.getLabel(), ciVo.getName(), attrVo.getLabel(), attrVo.getName()); } public CiUniqueAttrNotFoundException(AttrVo attrVo) { - super("唯一规则属性“{0}({1})”的值为空", attrVo.getLabel(), attrVo.getName()); + super("nfcec.ciuniqueattrnotfoundexception.ciuniqueattrnotfoundexception_c", attrVo.getCiLabel(), attrVo.getCiName(), attrVo.getLabel(), attrVo.getName()); } public CiUniqueAttrNotFoundException(Long ciId, Long attrId) { - super("获取模型“{0}”的配置项事务hash失败,唯一属性“{1}”没有值", ciId, attrId); + super("nfcec.ciuniqueattrnotfoundexception.ciuniqueattrnotfoundexception_d", ciId, attrId); } public CiUniqueAttrNotFoundException(SyncCiCollectionVo syncCiCollectionVo, CiVo ciVo, String key, JSONObject dataObj) { - super("配置“{0}->{1}({2})”的唯一键映射属性“{3}”的值不存在,原始数据:{4}", syncCiCollectionVo.getCollectionName(), ciVo.getLabel(), ciVo.getName(), key, dataObj.toString()); + super("nfcec.ciuniqueattrnotfoundexception.ciuniqueattrnotfoundexception_e", syncCiCollectionVo.getCollectionName(), ciVo.getLabel(), ciVo.getName(), key, dataObj.toString()); } } diff --git a/src/main/java/neatlogic/framework/cmdb/exception/ci/CiUniqueRuleAttrTypeIrregularException.java b/src/main/java/neatlogic/framework/cmdb/exception/ci/CiUniqueRuleAttrTypeIrregularException.java index a93859877106ed0f32970fd0f2c5a8c6fdcb7a78..e3af37bb22223bc839210f2e2edc1e498fabd1aa 100644 --- a/src/main/java/neatlogic/framework/cmdb/exception/ci/CiUniqueRuleAttrTypeIrregularException.java +++ b/src/main/java/neatlogic/framework/cmdb/exception/ci/CiUniqueRuleAttrTypeIrregularException.java @@ -22,6 +22,10 @@ import neatlogic.framework.exception.core.ApiRuntimeException; public class CiUniqueRuleAttrTypeIrregularException extends ApiRuntimeException { public CiUniqueRuleAttrTypeIrregularException(CiVo ciVo, AttrVo attrVo) { - super("模型“{0}({1})”的唯一规则属性“{2}({3})”不能是一个表达式属性或引用型属性", ciVo.getLabel(), ciVo.getName(), attrVo.getLabel(), attrVo.getName()); + super("nfcec.ciuniqueruleattrtypeirregularexception.ciuniqueruleattrtypeirregularexception_a", ciVo.getLabel(), ciVo.getName(), attrVo.getLabel(), attrVo.getName()); + } + + public CiUniqueRuleAttrTypeIrregularException(AttrVo attrVo) { + super("nfcec.ciuniqueruleattrtypeirregularexception.ciuniqueruleattrtypeirregularexception_b", attrVo.getCiLabel(), attrVo.getCiName(), attrVo.getLabel(), attrVo.getName()); } } diff --git a/src/main/java/neatlogic/framework/cmdb/exception/ci/DownwardCiNotFoundException.java b/src/main/java/neatlogic/framework/cmdb/exception/ci/DownwardCiNotFoundException.java new file mode 100644 index 0000000000000000000000000000000000000000..cdbe631008e38d57cf7563415ed88225df146f99 --- /dev/null +++ b/src/main/java/neatlogic/framework/cmdb/exception/ci/DownwardCiNotFoundException.java @@ -0,0 +1,11 @@ +package neatlogic.framework.cmdb.exception.ci; + +import neatlogic.framework.cmdb.dto.ci.CiVo; +import neatlogic.framework.exception.core.ApiRuntimeException; + +public class DownwardCiNotFoundException extends ApiRuntimeException { + + public DownwardCiNotFoundException(CiVo rootCi, String ciName) { + super("nfcec.downwardcinotfoundexception.downwardcinotfoundexception", rootCi.getLabel(), rootCi.getName(), ciName); + } +}