From 1827963a8bfb7fc3ac28b1984f7d10954334ca2d Mon Sep 17 00:00:00 2001 From: naiba Date: Thu, 19 Dec 2024 23:21:15 +0800 Subject: [PATCH] fix: rule snapshot --- model/alertrule.go | 2 +- model/alertrule_api.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/model/alertrule.go b/model/alertrule.go index 717f8e4..431dc86 100644 --- a/model/alertrule.go +++ b/model/alertrule.go @@ -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 } diff --git a/model/alertrule_api.go b/model/alertrule_api.go index 074cb81..9a3fdc3 100644 --- a/model/alertrule_api.go +++ b/model/alertrule_api.go @@ -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"`