From 54cf19f679999b35e99de09bc8f4ce6b4693579e Mon Sep 17 00:00:00 2001 From: Marvin Zhang Date: Sat, 13 Jul 2024 10:53:38 +0800 Subject: [PATCH] feat: Add trigger fields to NotificationSettingV2 model --- core/constants/notification.go | 4 ++++ core/models/models/v2/notification_setting_v2.go | 2 ++ 2 files changed, 6 insertions(+) diff --git a/core/constants/notification.go b/core/constants/notification.go index 46f289bb..eb2b8f25 100644 --- a/core/constants/notification.go +++ b/core/constants/notification.go @@ -5,6 +5,10 @@ const ( NotificationTriggerTaskError = "task_error" NotificationTriggerTaskEmptyResults = "task_empty_results" NotificationTriggerTaskNever = "task_never" + NotificationTriggerNodeStatusChange = "node_status_change" + NotificationTriggerNodeOnline = "node_online" + NotificationTriggerNodeOffline = "node_offline" + NotificationTriggerNodeNever = "node_never" ) const ( diff --git a/core/models/models/v2/notification_setting_v2.go b/core/models/models/v2/notification_setting_v2.go index b19adfa9..b56ed3a7 100644 --- a/core/models/models/v2/notification_setting_v2.go +++ b/core/models/models/v2/notification_setting_v2.go @@ -15,6 +15,8 @@ type NotificationSettingV2 struct { TemplateRichText string `json:"template_rich_text,omitempty" bson:"template_rich_text,omitempty"` TemplateRichTextJson string `json:"template_rich_text_json,omitempty" bson:"template_rich_text_json,omitempty"` TaskTrigger string `json:"task_trigger" bson:"task_trigger"` + TriggerTarget string `json:"trigger_target" bson:"trigger_target"` + Trigger string `json:"trigger" bson:"trigger"` Mail NotificationSettingMail `json:"mail,omitempty" bson:"mail,omitempty"` Mobile NotificationSettingMobile `json:"mobile,omitempty" bson:"mobile,omitempty"` }