From 6bfc2da7e71417f863d80fb6c5d683d5f587eec1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B1=88=E8=BD=A9?= Date: Fri, 9 May 2025 21:23:11 +0800 Subject: [PATCH] fix(notify): support notify with robotids (#22504) --- 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 466c8921bf..aa43860f60 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 2dc0be76ea..47cb5c7f2c 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)