From 6a82fdf2ec60c34cae00e855df98e663b83eea53 Mon Sep 17 00:00:00 2001 From: guoyuqi Date: Mon, 5 Feb 2024 15:13:13 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E9=A1=B9=E7=9B=AE=E7=AE=A1=E7=90=86):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=8F=91=E9=80=81=E9=80=9A=E7=9F=A5=E5=86=85?= =?UTF-8?q?=E5=AE=B9=E4=B8=8D=E7=AC=A6=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/notice/sender/impl/DingCustomNoticeSender.java | 8 +++----- .../system/notice/sender/impl/LarkNoticeSender.java | 2 +- .../system/notice/sender/impl/WeComNoticeSender.java | 8 +++----- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/notice/sender/impl/DingCustomNoticeSender.java b/backend/services/system-setting/src/main/java/io/metersphere/system/notice/sender/impl/DingCustomNoticeSender.java index 23b9eb39e1..62e79a5257 100644 --- a/backend/services/system-setting/src/main/java/io/metersphere/system/notice/sender/impl/DingCustomNoticeSender.java +++ b/backend/services/system-setting/src/main/java/io/metersphere/system/notice/sender/impl/DingCustomNoticeSender.java @@ -1,13 +1,12 @@ package io.metersphere.system.notice.sender.impl; +import io.metersphere.sdk.util.LogUtils; +import io.metersphere.system.domain.User; import io.metersphere.system.notice.MessageDetail; import io.metersphere.system.notice.NoticeModel; import io.metersphere.system.notice.Receiver; import io.metersphere.system.notice.sender.AbstractNoticeSender; import io.metersphere.system.notice.utils.DingClient; -import io.metersphere.sdk.util.LogUtils; -import io.metersphere.system.domain.User; -import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Component; import java.util.List; @@ -25,8 +24,7 @@ public class DingCustomNoticeSender extends AbstractNoticeSender { List mobileList = users.stream().map(User::getPhone).toList(); LogUtils.info("钉钉自定义机器人收件人: {}", userIds); - context += StringUtils.join(mobileList, StringUtils.SPACE); - DingClient.send(messageDetail.getWebhook(), "消息通知: \n" + context, mobileList); + DingClient.send(messageDetail.getWebhook(), messageDetail.getSubject()+": \n" + context, mobileList); } @Override diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/notice/sender/impl/LarkNoticeSender.java b/backend/services/system-setting/src/main/java/io/metersphere/system/notice/sender/impl/LarkNoticeSender.java index 559ded82d1..7d8101e1e5 100644 --- a/backend/services/system-setting/src/main/java/io/metersphere/system/notice/sender/impl/LarkNoticeSender.java +++ b/backend/services/system-setting/src/main/java/io/metersphere/system/notice/sender/impl/LarkNoticeSender.java @@ -28,7 +28,7 @@ public class LarkNoticeSender extends AbstractNoticeSender { LogUtils.info("飞书收件人: {}", userIds); context += StringUtils.join(collect, StringUtils.SPACE); - LarkClient.send(messageDetail.getWebhook(), "消息通知: \n" + context); + LarkClient.send(messageDetail.getWebhook(), messageDetail.getSubject()+": \n" + context); } @Override diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/notice/sender/impl/WeComNoticeSender.java b/backend/services/system-setting/src/main/java/io/metersphere/system/notice/sender/impl/WeComNoticeSender.java index 4679f82ab5..d703d5f2a2 100644 --- a/backend/services/system-setting/src/main/java/io/metersphere/system/notice/sender/impl/WeComNoticeSender.java +++ b/backend/services/system-setting/src/main/java/io/metersphere/system/notice/sender/impl/WeComNoticeSender.java @@ -1,13 +1,12 @@ package io.metersphere.system.notice.sender.impl; +import io.metersphere.sdk.util.LogUtils; +import io.metersphere.system.domain.User; import io.metersphere.system.notice.MessageDetail; import io.metersphere.system.notice.NoticeModel; import io.metersphere.system.notice.Receiver; import io.metersphere.system.notice.sender.AbstractNoticeSender; import io.metersphere.system.notice.utils.WeComClient; -import io.metersphere.sdk.util.LogUtils; -import io.metersphere.system.domain.User; -import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Component; import java.util.List; @@ -24,8 +23,7 @@ public class WeComNoticeSender extends AbstractNoticeSender { List users = super.getUsers(userIds); List mobileList = users.stream().map(User::getPhone).toList(); LogUtils.info("企业微信收件人: {}", userIds); - context += StringUtils.join(mobileList, StringUtils.SPACE); - WeComClient.send(messageDetail.getWebhook(), "消息通知: \n" + context, mobileList); + WeComClient.send(messageDetail.getWebhook(), messageDetail.getSubject()+": \n" + context, mobileList); } @Override