package model_pgsql import ( "fwh-toolbox-server/database" "time" "gorm.io/datatypes" ) var db = database.PgSQL // 保存快照文件数据 type SiteAlarmSnapshotModel struct { ID int64 `gorm:"primaryKey;autoIncrement;comment:"` // 自增ID SN string `gorm:"size:64;not null;uniqueIndex:idx_type_sn_time"` FileRecordID int64 `gorm:"not null"` LogTime time.Time `gorm:"type:timestamp;not null;uniqueIndex:idx_type_sn_time"` // TIMESTAMP WITHOUT TIME ZONE JsonData datatypes.JSON `gorm:"type:jsonb"` } // 记录已处理过的文件(避免重复处理) type SiteAlarmSnapshotFileRecord struct { ID int64 `gorm:"primaryKey"` // 使用雪花ID算法 State int16 }