package models import ( "git.apinb.com/bsm-sdk/core/database" "time" ) // ReportMetricSnapshot 对应 report_metric_snapshot,保存指标快照。 type ReportMetricSnapshot struct { Entity MetricCode string `gorm:"column:metric_code;type:varchar(64);not null;index" json:"metric_code"` ScopeType string `gorm:"column:scope_type;type:varchar(32);not null" json:"scope_type"` ScopeID uint64 `gorm:"column:scope_id;not null;default:0;index" json:"scope_id"` StatAt time.Time `gorm:"column:stat_at;type:timestamptz;not null;index" json:"stat_at"` MetricValue string `gorm:"column:metric_value;type:varchar(128);not null" json:"metric_value"` } func init() { database.AppendMigrate(&ReportMetricSnapshot{}) } func (table *ReportMetricSnapshot) TableName() string { return "report_metric_snapshot" }