2026-07-26 18:24:13 +08:00
|
|
|
|
package models
|
|
|
|
|
|
|
2026-07-27 00:18:42 +08:00
|
|
|
|
import (
|
|
|
|
|
|
"git.apinb.com/bsm-sdk/core/database"
|
|
|
|
|
|
"time"
|
|
|
|
|
|
)
|
2026-07-26 18:24:13 +08:00
|
|
|
|
|
2026-07-27 14:28:23 +08:00
|
|
|
|
// SafeEvent 对应 safe_event,保存安全事件统一入口。
|
|
|
|
|
|
type SafeEvent struct {
|
2026-07-27 12:02:08 +08:00
|
|
|
|
Entity // 公共实体字段
|
|
|
|
|
|
EventCode string `gorm:"column:event_code;type:varchar(64);not null;uniqueIndex" json:"event_code"` // event_code 业务字段
|
|
|
|
|
|
Level int `gorm:"column:level;not null;default:3" json:"level"` // level 业务字段
|
|
|
|
|
|
Title string `gorm:"column:title;type:varchar(256);not null;default:''" json:"title"` // title 业务字段
|
|
|
|
|
|
SmartCylinderValveIdentity string `gorm:"column:smart_cylinder_valve_identity;type:varchar(36);not null;default:'';index" json:"smart_cylinder_valve_identity"` // smart_cylinder_valve_identity 业务字段
|
|
|
|
|
|
SLAAt *time.Time `gorm:"column:sla_at;type:timestamptz" json:"sla_at"` // sla_at 业务字段
|
2026-07-26 18:24:13 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-07-27 14:28:23 +08:00
|
|
|
|
func init() { database.AppendMigrate(&SafeEvent{}) }
|
|
|
|
|
|
func (table *SafeEvent) TableName() string { return "safe_event" }
|