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"` // metric_code 业务字段 ScopeType string `gorm:"column:scope_type;type:varchar(32);not null" json:"scope_type"` // scope_type 业务字段 ScopeID uint64 `gorm:"column:scope_id;not null;default:0;index" json:"scope_id"` // scope_id 业务字段 StatAt time.Time `gorm:"column:stat_at;type:timestamptz;not null;index" json:"stat_at"` // stat_at 业务字段 MetricValue string `gorm:"column:metric_value;type:varchar(128);not null" json:"metric_value"` // metric_value 业务字段 } func init() { database.AppendMigrate(&ReportMetricSnapshot{}) } func (table *ReportMetricSnapshot) TableName() string { return "report_metric_snapshot" }