mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-21 17:21:09 +01:00
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:
16
core/models/models/v2/notification_alert_v2.go
Normal file
16
core/models/models/v2/notification_alert_v2.go
Normal 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"`
|
||||
}
|
||||
Reference in New Issue
Block a user