feat: 完善平台总后台模块
This commit is contained in:
@@ -1,18 +1,19 @@
|
||||
package models
|
||||
|
||||
import "git.apinb.com/bsm-sdk/core/database"
|
||||
import (
|
||||
"git.apinb.com/bsm-sdk/core/database"
|
||||
"time"
|
||||
)
|
||||
|
||||
// SafEvent 对应 saf_event,表示需要平台跟踪处置的安全事件。
|
||||
// SafEvent 对应 saf_event,保存安全事件统一入口。
|
||||
type SafEvent struct {
|
||||
Entity
|
||||
EventCode string `gorm:"column:event_code;type:varchar(32);uniqueIndex;not null" json:"event_code"` // 安全事件编码
|
||||
Level int `gorm:"column:level;type:integer;not null" json:"level"` // 风险等级,1 至 3 级
|
||||
Title string `gorm:"column:title;type:varchar(256);not null" json:"title"` // 事件说明
|
||||
EventCode string `gorm:"column:event_code;type:varchar(64);not null;uniqueIndex" json:"event_code"`
|
||||
Level int `gorm:"column:level;not null;default:3" json:"level"`
|
||||
Title string `gorm:"column:title;type:varchar(256);not null;default:''" json:"title"`
|
||||
SmartCylinderValveIdentity string `gorm:"column:smart_cylinder_valve_identity;type:varchar(36);not null;default:'';index" json:"smart_cylinder_valve_identity"`
|
||||
SLAAt *time.Time `gorm:"column:sla_at;type:timestamptz" json:"sla_at"`
|
||||
}
|
||||
|
||||
func init() {
|
||||
database.AppendMigrate(&SafEvent{})
|
||||
}
|
||||
|
||||
// TableName 返回与模型、文件名一致的单数数据表名。
|
||||
func init() { database.AppendMigrate(&SafEvent{}) }
|
||||
func (table *SafEvent) TableName() string { return "saf_event" }
|
||||
|
||||
Reference in New Issue
Block a user