From 2df46fe37e8921b168852110f0ca169355ca3e5f Mon Sep 17 00:00:00 2001 From: linbangquan <1437892690@qq.com> Date: Thu, 4 Jan 2024 16:17:53 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=8A=9F=E8=83=BD]=20=E5=90=8E=E7=AB=AF-ITSM-?= =?UTF-8?q?CMDB=E5=90=8C=E6=AD=A5=E8=8A=82=E7=82=B9-=E5=85=B3=E7=B3=BB?= =?UTF-8?q?=E6=98=A0=E5=B0=84=E5=AD=90=E6=A8=A1=E5=9E=8B=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 关联 #[1059939512975360]后端-ITSM-CMDB同步节点-关系映射子模型处理 http://192.168.0.96:8090/demo/rdm.html#/task-detail/939050947543040/939050947543050/1059939512975360 --- .../exception/ci/CiUniqueAttrNotFoundException.java | 10 +++++----- .../ci/CiUniqueRuleAttrTypeIrregularException.java | 6 +++++- .../exception/ci/DownwardCiNotFoundException.java | 11 +++++++++++ 3 files changed, 21 insertions(+), 6 deletions(-) create mode 100644 src/main/java/neatlogic/framework/cmdb/exception/ci/DownwardCiNotFoundException.java 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 f924131..5e612b8 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 a938598..e3af37b 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 0000000..cdbe631 --- /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); + } +} -- Gitee