fix
This commit is contained in:
@@ -2,16 +2,26 @@ package models
|
||||
|
||||
import "time"
|
||||
|
||||
// TrapShield 表示一条针对 SNMP Trap 的“屏蔽/防护”规则。
|
||||
type TrapShield struct {
|
||||
ID uint `gorm:"primaryKey" json:"id"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
Name string `gorm:"size:256" json:"name"`
|
||||
Enabled bool `gorm:"default:true" json:"enabled"`
|
||||
SourceIPCIDR string `gorm:"size:64" json:"source_ip_cidr"`
|
||||
OIDPrefix string `gorm:"size:512" json:"oid_prefix"`
|
||||
InterfaceHint string `gorm:"size:256" json:"interface_hint"`
|
||||
TimeWindowsJSON string `gorm:"type:text" json:"time_windows_json"`
|
||||
// ID 是数据库主键。
|
||||
ID uint `gorm:"primaryKey" json:"id"`
|
||||
// CreatedAt 记录创建时间(GORM 自动维护)。
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
// UpdatedAt 记录更新时间(GORM 自动维护)。
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
// Name 规则名称,用于展示/标识。
|
||||
Name string `gorm:"size:256" json:"name"`
|
||||
// Enabled 表示该规则是否启用。
|
||||
Enabled bool `gorm:"default:true" json:"enabled"`
|
||||
// SourceIPCIDR 表示规则适用的源 IP 网段(CIDR)。
|
||||
SourceIPCIDR string `gorm:"size:64" json:"source_ip_cidr"`
|
||||
// OIDPrefix 表示匹配的 OID 前缀。
|
||||
OIDPrefix string `gorm:"size:512" json:"oid_prefix"`
|
||||
// InterfaceHint 关联提示信息(例如接口/线路标识),用于定位设备来源。
|
||||
InterfaceHint string `gorm:"size:256" json:"interface_hint"`
|
||||
// TimeWindowsJSON 以 JSON 文本形式描述规则生效时间窗口。
|
||||
TimeWindowsJSON string `gorm:"type:text" json:"time_windows_json"`
|
||||
}
|
||||
|
||||
func (TrapShield) TableName() string {
|
||||
|
||||
Reference in New Issue
Block a user