feat: Update notification trigger patterns and add alert trigger

The code changes modify the notification constants and models to update the trigger patterns for tasks and nodes. Additionally, a new trigger for alerts is added to the constants. This change allows for more flexible matching of notification triggers.
This commit is contained in:
Marvin Zhang
2024-07-31 15:58:41 +08:00
parent 86a7beb9e2
commit 7fe770ae9d
6 changed files with 109 additions and 14 deletions

View File

@@ -15,4 +15,5 @@ type NotificationAlertV2 struct {
LastingSeconds int `json:"lasting_seconds" bson:"lasting_seconds"`
TargetValue float32 `json:"target_value" bson:"target_value"`
Level string `json:"level" bson:"level"`
TemplateKey string `json:"template_key,omitempty" bson:"template_key,omitempty"`
}

View File

@@ -17,9 +17,8 @@ type NotificationSettingV2 struct {
TemplateRichTextJson string `json:"template_rich_text_json,omitempty" bson:"template_rich_text_json,omitempty"`
TemplateTheme string `json:"template_theme,omitempty" bson:"template_theme,omitempty"`
TaskTrigger string `json:"task_trigger" bson:"task_trigger"`
TriggerTarget string `json:"trigger_target" bson:"trigger_target"`
Trigger string `json:"trigger" bson:"trigger"`
TaskTrigger string `json:"task_trigger" bson:"task_trigger"`
Trigger string `json:"trigger" bson:"trigger"`
SenderEmail string `json:"sender_email,omitempty" bson:"sender_email,omitempty"`
UseCustomSenderEmail bool `json:"use_custom_sender_email,omitempty" bson:"use_custom_sender_email,omitempty"`