30 lines
1.2 KiB
Go
30 lines
1.2 KiB
Go
package models
|
||
|
||
import "time"
|
||
|
||
// TrapDictionaryEntry 表示 Trap 字典条目,用于描述某个 OID 前缀对应的告警元信息。
|
||
type TrapDictionaryEntry struct {
|
||
// 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"`
|
||
}
|
||
|
||
func (TrapDictionaryEntry) TableName() string {
|
||
return "logs_trap_dictionary"
|
||
}
|