feat: 完善平台总后台模块
This commit is contained in:
19
backend/api/internal/models/report_metric_snapshot.go
Normal file
19
backend/api/internal/models/report_metric_snapshot.go
Normal file
@@ -0,0 +1,19 @@
|
||||
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" }
|
||||
Reference in New Issue
Block a user