From 43c646b537cbb00b199ff1831a744a30fc1996db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B1=88=E8=BD=A9?= Date: Fri, 9 May 2025 21:23:07 +0800 Subject: [PATCH] fix(notify): support notify with robotids (#22503) --- pkg/apis/notify/notification.go | 2 ++ pkg/notify/models/notification.go | 3 +++ 2 files changed, 5 insertions(+) diff --git a/pkg/apis/notify/notification.go b/pkg/apis/notify/notification.go index ac1b6f5230..be3a894717 100644 --- a/pkg/apis/notify/notification.go +++ b/pkg/apis/notify/notification.go @@ -102,6 +102,8 @@ type NotificationManagerEventNotifyInput struct { // description: direct contact, admin privileges required // required: false Contacts []SContact `json:"contacts"` + // 消息机器人列表 + RobotIds []string `json:"robot_ids"` // description: contact types // required: false // example: email diff --git a/pkg/notify/models/notification.go b/pkg/notify/models/notification.go index 143f5a668f..53fe246020 100644 --- a/pkg/notify/models/notification.go +++ b/pkg/notify/models/notification.go @@ -234,6 +234,9 @@ func (nm *SNotificationManager) PerformEventNotify(ctx context.Context, userCred robots[robot] = groupTime } } + for _, id := range input.RobotIds { + robots[id] = 0 + } var webhookRobots []string realRobot := make(map[string]uint32)