From 779d831a6d7e04e0efcf84d650e0131ded22ee62 Mon Sep 17 00:00:00 2001 From: Marvin Zhang Date: Tue, 30 Jul 2024 12:35:18 +0800 Subject: [PATCH] feat: Add NotificationAlertV2 model Add NotificationAlertV2 model to handle notification alerts in the system. This model includes fields for name, description, enabled status, metric target ID, metric name, operator, target value, and level. --- core/models/models/v2/notification_alert_v2.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 core/models/models/v2/notification_alert_v2.go diff --git a/core/models/models/v2/notification_alert_v2.go b/core/models/models/v2/notification_alert_v2.go new file mode 100644 index 00000000..ad35841b --- /dev/null +++ b/core/models/models/v2/notification_alert_v2.go @@ -0,0 +1,16 @@ +package models + +import "go.mongodb.org/mongo-driver/bson/primitive" + +type NotificationAlertV2 struct { + any `collection:"notification_alerts"` + BaseModelV2[NotificationAlertV2] `bson:",inline"` + Name string `json:"name" bson:"name"` + Description string `json:"description" bson:"description"` + Enabled bool `json:"enabled" bson:"enabled"` + MetricTargetId primitive.ObjectID `json:"metric_target_id,omitempty" bson:"metric_target_id,omitempty"` + MetricName string `json:"metric_name" bson:"metric_name"` + Operator string `json:"operator" bson:"operator"` + TargetValue float32 `json:"target_value" bson:"target_value"` + Level string `json:"level" bson:"level"` +}