Files
logs/internal/models/trap_dictionary.go

30 lines
1.2 KiB
Go
Raw Permalink Normal View History

2026-03-30 15:26:16 +08:00
package models
import "time"
2026-03-30 18:03:40 +08:00
// TrapDictionaryEntry 表示 Trap 字典条目,用于描述某个 OID 前缀对应的告警元信息。
2026-03-30 15:26:16 +08:00
type TrapDictionaryEntry struct {
2026-03-30 18:03:40 +08:00
// ID 是数据库主键。
ID uint `gorm:"primaryKey" json:"id"`
// CreatedAt 记录创建时间GORM 自动维护)。
CreatedAt time.Time `json:"created_at"`
// UpdatedAt 记录更新时间GORM 自动维护)。
UpdatedAt time.Time `json:"updated_at"`
// OIDPrefix 表示该字典条目对应的 OID 前缀(唯一)。
OIDPrefix string `gorm:"size:512;uniqueIndex" json:"oid_prefix"`
// Title 表示字典条目的标题。
Title string `gorm:"size:512" json:"title"`
// Description 表示字典条目的说明文本。
Description string `gorm:"type:text" json:"description"`
// SeverityCode 表示默认严重级别编码。
SeverityCode string `gorm:"size:32" json:"severity_code"`
// RecoveryMessage 表示恢复/消警时的消息模板内容。
RecoveryMessage string `gorm:"type:text" json:"recovery_message"`
// Enabled 表示该字典条目是否启用。
Enabled bool `gorm:"default:true" json:"enabled"`
2026-03-30 15:26:16 +08:00
}
func (TrapDictionaryEntry) TableName() string {
return "logs_trap_dictionary"
}