feat: 触发报警后的通知支持仅发送一次

This commit is contained in:
Akkia
2022-09-13 04:01:08 +08:00
parent 222b87ec78
commit 32d15e116e
3 changed files with 19 additions and 5 deletions

View File

@@ -7,6 +7,11 @@ import (
"gorm.io/gorm"
)
const (
ModeAlwaysTrigger = 0
ModeOnetimeTrigger = 1
)
type CycleTransferStats struct {
Name string
From time.Time
@@ -23,6 +28,7 @@ type AlertRule struct {
Name string
RulesRaw string
Enable *bool
TriggerMode int `gorm:"default:0"` // 触发模式: 0-始终触发(默认) 1-单次触发
NotificationTag string // 该报警规则所在的通知组
Rules []Rule `gorm:"-" json:"-"`
}