From b2b21194c6725206194084419bf7be42189ed4a0 Mon Sep 17 00:00:00 2001 From: caihaohan Date: Wed, 14 Aug 2024 09:57:02 +0800 Subject: [PATCH] =?UTF-8?q?ci:=20=E4=BD=93=E7=B3=BB=E6=A0=91=E8=8A=82?= =?UTF-8?q?=E7=82=B9=E9=87=8D=E5=A4=8D=E6=8F=90=E7=A4=BA=E8=AF=AD=E5=8F=8C?= =?UTF-8?q?=E8=AF=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/jero/common/api/vo/ResultCommon.java | 2 ++ .../standard/service/impl/LawsTreeNodeServiceImpl.java | 7 +++---- .../src/main/resources/i18n/messages.properties | 1 + .../src/main/resources/i18n/messages_en.properties | 1 + .../src/main/resources/i18n/messages_zh.properties | 1 + 5 files changed, 8 insertions(+), 4 deletions(-) diff --git a/laws-base/laws-base-core/src/main/java/com/jero/common/api/vo/ResultCommon.java b/laws-base/laws-base-core/src/main/java/com/jero/common/api/vo/ResultCommon.java index d4771023..73572f99 100644 --- a/laws-base/laws-base-core/src/main/java/com/jero/common/api/vo/ResultCommon.java +++ b/laws-base/laws-base-core/src/main/java/com/jero/common/api/vo/ResultCommon.java @@ -214,4 +214,6 @@ public class ResultCommon { public static final String CAN_NOT_FIND_FIELD = "can_not_find_field"; + public static final String TREE_NODE_EXISTS = "tree.node.exists"; + } diff --git a/laws-modules/src/main/java/com/jero/modules/laws/standard/service/impl/LawsTreeNodeServiceImpl.java b/laws-modules/src/main/java/com/jero/modules/laws/standard/service/impl/LawsTreeNodeServiceImpl.java index 064acf4c..04a70b2b 100644 --- a/laws-modules/src/main/java/com/jero/modules/laws/standard/service/impl/LawsTreeNodeServiceImpl.java +++ b/laws-modules/src/main/java/com/jero/modules/laws/standard/service/impl/LawsTreeNodeServiceImpl.java @@ -3,6 +3,7 @@ package com.jero.modules.laws.standard.service.impl; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.jero.common.api.vo.ResultCommon; import com.jero.common.constant.CommonConstant; import com.jero.common.constant.FillRuleConstant; import com.jero.common.exception.JeroBootException; @@ -161,8 +162,7 @@ public class LawsTreeNodeServiceImpl extends ServiceImpl lawsTreeNodes = this.list(query); if (lawsTreeNodes != null && !lawsTreeNodes.isEmpty()) { - //TODO 翻译 - throw new JeroBootException("已存在名为" + lawsTreeNode.getNodeName() + "的节点"); + throw new JeroBootException(ResultCommon.TREE_NODE_EXISTS, lawsTreeNode.getNodeName()); } String s = UUID.randomUUID().toString().replace("-", ""); lawsTreeNode.setId(s); @@ -196,8 +196,7 @@ public class LawsTreeNodeServiceImpl extends ServiceImpl lawsTreeNodes = this.list(query); if (lawsTreeNodes != null && !lawsTreeNodes.isEmpty()) { - //TODO 翻译 - throw new JeroBootException("已存在名为" + lawsTreeNode.getNodeName() + "的节点"); + throw new JeroBootException(ResultCommon.TREE_NODE_EXISTS, lawsTreeNode.getNodeName()); } this.updateById(lawsTreeNode); return true; diff --git a/laws-single-startup/src/main/resources/i18n/messages.properties b/laws-single-startup/src/main/resources/i18n/messages.properties index 5542875b..9aa0e9b3 100644 --- a/laws-single-startup/src/main/resources/i18n/messages.properties +++ b/laws-single-startup/src/main/resources/i18n/messages.properties @@ -87,3 +87,4 @@ model.import.data.error=\u8F66\u578B\u9879\u76EE\u6587\u4EF6\u4E0A\u4F20\u6570\u file.empty.import.error=\u6587\u4EF6\u4E3A\u7A7A\uFF0C\u8BF7\u68C0\u67E5\u540E\u91CD\u8BD5 can_not_find_template_file=\u627E\u4E0D\u5230\u540D\u4E3A{0}\u7684\u6A21\u677F\u6587\u4EF6 can_not_find_field=\u627E\u4E0D\u5230\u540D\u4E3A{0}\u7684\u5B57\u6BB5 +tree.node.exists=\u5DF2\u5B58\u5728\u540D\u4E3A"{0}"\u7684\u8282\u70B9" \ No newline at end of file diff --git a/laws-single-startup/src/main/resources/i18n/messages_en.properties b/laws-single-startup/src/main/resources/i18n/messages_en.properties index 353c85e2..70308673 100644 --- a/laws-single-startup/src/main/resources/i18n/messages_en.properties +++ b/laws-single-startup/src/main/resources/i18n/messages_en.properties @@ -105,3 +105,4 @@ row.size.too.large=Row size too large can_not_find_template_file=Can not find template file name {0} can_not_find_field=Can not find field {0} tag.add.error.1=The attribute name is too long +tree.node.exists=Name {0} tree node exists \ No newline at end of file diff --git a/laws-single-startup/src/main/resources/i18n/messages_zh.properties b/laws-single-startup/src/main/resources/i18n/messages_zh.properties index 74fe9c41..2e041441 100644 --- a/laws-single-startup/src/main/resources/i18n/messages_zh.properties +++ b/laws-single-startup/src/main/resources/i18n/messages_zh.properties @@ -104,3 +104,4 @@ row.size.too.large=\u884C\u5927\u5C0F\u592A\u5927 can_not_find_template_file=\u627E\u4E0D\u5230\u540D\u4E3A{0}\u7684\u6A21\u677F\u6587\u4EF6 can_not_find_field=\u627E\u4E0D\u5230\u540D\u4E3A{0}\u7684\u5B57\u6BB5 tag.add.error.1=\u5C5E\u6027\u540D\u79F0\u592A\u957F +tree.node.exists=\u5DF2\u5B58\u5728\u540D\u4E3A"{0}"\u7684\u8282\u70B9" \ No newline at end of file