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

19 lines
1.1 KiB
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"
)
// DevTelemetry 对应 dev_telemetry保存设备遥测摘要。
type DevTelemetry struct {
Entity // 公共实体字段
SmartCylinderValveIdentity string `gorm:"column:smart_cylinder_valve_identity;type:varchar(36);not null;index" json:"smart_cylinder_valve_identity"` // smart_cylinder_valve_identity 业务字段
ReportedAt time.Time `gorm:"column:reported_at;type:timestamptz;not null;index" json:"reported_at"` // reported_at 业务字段
Payload string `gorm:"column:payload;type:jsonb;not null;default:'{}'" json:"payload"` // payload 业务字段
QualityFlag string `gorm:"column:quality_flag;type:varchar(32);not null;default:'normal'" json:"quality_flag"` // quality_flag 业务字段
}
func init() { database.AppendMigrate(&DevTelemetry{}) }
func (table *DevTelemetry) TableName() string { return "dev_telemetry" }