Files
platforms/backend/api/internal/models/report_metric_snapshot.go

20 lines
873 B
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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" }