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.
This commit is contained in:
Marvin Zhang
2024-07-30 12:35:18 +08:00
parent e9ef2fa291
commit 68bba2cceb

View File

@@ -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"`
}