fix: rule snapshot

This commit is contained in:
naiba 2024-12-19 23:21:15 +08:00
parent d835aeb486
commit 1827963a8b
2 changed files with 2 additions and 2 deletions

View File

@ -19,7 +19,7 @@ type AlertRule struct {
NotificationGroupID uint64 `json:"notification_group_id"` // 该报警规则所在的通知组
FailTriggerTasksRaw string `gorm:"default:'[]'" json:"-"`
RecoverTriggerTasksRaw string `gorm:"default:'[]'" json:"-"`
Rules []Rule `gorm:"-" json:"rules"`
Rules []*Rule `gorm:"-" json:"rules"`
FailTriggerTasks []uint64 `gorm:"-" json:"fail_trigger_tasks"` // 失败时执行的触发任务id
RecoverTriggerTasks []uint64 `gorm:"-" json:"recover_trigger_tasks"` // 恢复时执行的触发任务id
}

View File

@ -2,7 +2,7 @@ package model
type AlertRuleForm struct {
Name string `json:"name" minLength:"1"`
Rules []Rule `json:"rules"`
Rules []*Rule `json:"rules"`
FailTriggerTasks []uint64 `json:"fail_trigger_tasks"` // 失败时触发的任务id
RecoverTriggerTasks []uint64 `json:"recover_trigger_tasks"` // 恢复时触发的任务id
NotificationGroupID uint64 `json:"notification_group_id"`