From 694e6690cac573a59d9874f9ff95a9a538d8f820 Mon Sep 17 00:00:00 2001 From: dengqichen Date: Thu, 13 Nov 2025 17:13:39 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=9E=84=E5=BB=BA=E9=80=9A?= =?UTF-8?q?=E7=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/NotificationTemplateServiceImpl.java | 30 +++++++++++++++++-- .../src/main/resources/messages.properties | 2 +- .../main/resources/messages_en_US.properties | 2 +- .../main/resources/messages_zh_CN.properties | 2 +- 4 files changed, 31 insertions(+), 5 deletions(-) diff --git a/backend/src/main/java/com/qqchen/deploy/backend/notification/service/impl/NotificationTemplateServiceImpl.java b/backend/src/main/java/com/qqchen/deploy/backend/notification/service/impl/NotificationTemplateServiceImpl.java index a104f401..367e5586 100644 --- a/backend/src/main/java/com/qqchen/deploy/backend/notification/service/impl/NotificationTemplateServiceImpl.java +++ b/backend/src/main/java/com/qqchen/deploy/backend/notification/service/impl/NotificationTemplateServiceImpl.java @@ -113,12 +113,38 @@ public class NotificationTemplateServiceImpl extends BaseServiceImpl variableName [in template ...]" + if (errorMessage != null && errorMessage.contains("==> ")) { + int start = errorMessage.indexOf("==> ") + 4; + int end = errorMessage.indexOf(" ", start); + if (end == -1) { + end = errorMessage.indexOf("[", start); + } + if (end > start) { + return errorMessage.substring(start, end).trim(); + } + } + return "未知参数"; + } + @Override @Transactional public void enable(Long id) { diff --git a/backend/src/main/resources/messages.properties b/backend/src/main/resources/messages.properties index 0f49715a..32503c72 100644 --- a/backend/src/main/resources/messages.properties +++ b/backend/src/main/resources/messages.properties @@ -257,7 +257,7 @@ deploy.record.not.found=部署记录不存在 notification.template.not.found=通知模板不存在或已删除 notification.template.code.exists=模板编码{0}已存在 notification.template.disabled=通知模板已禁用 -notification.template.render.error=模板渲染失败 +notification.template.render.error=模板渲染失败:{0} # 通知渠道相关 (3120-3139) notification.channel.not.found=通知渠道不存在或已删除 diff --git a/backend/src/main/resources/messages_en_US.properties b/backend/src/main/resources/messages_en_US.properties index c6e6ea12..03a6c0d4 100644 --- a/backend/src/main/resources/messages_en_US.properties +++ b/backend/src/main/resources/messages_en_US.properties @@ -190,7 +190,7 @@ deploy.record.not.found=Deployment record not found notification.template.not.found=Notification template not found or has been deleted notification.template.code.exists=Template code {0} already exists notification.template.disabled=Notification template is disabled -notification.template.render.error=Template rendering failed +notification.template.render.error=Template rendering failed: {0} # Notification Channel Related (3120-3139) notification.channel.not.found=Notification channel not found or has been deleted diff --git a/backend/src/main/resources/messages_zh_CN.properties b/backend/src/main/resources/messages_zh_CN.properties index 555459d4..44050ad1 100644 --- a/backend/src/main/resources/messages_zh_CN.properties +++ b/backend/src/main/resources/messages_zh_CN.properties @@ -190,7 +190,7 @@ deploy.record.not.found=部署记录不存在 notification.template.not.found=通知模板不存在或已删除 notification.template.code.exists=模板编码{0}已存在 notification.template.disabled=通知模板已禁用 -notification.template.render.error=模板渲染失败 +notification.template.render.error=模板渲染失败:{0} # 通知渠道相关 (3120-3139) notification.channel.not.found=通知渠道不存在或已删除