feat: start record.

This commit is contained in:
2026-04-28 18:52:03 +08:00
parent 2464617599
commit 9a95130488
7 changed files with 251 additions and 15 deletions
+21
View File
@@ -55,3 +55,24 @@ type MqttGatewayStatusRecord struct {
ChargingRatePercentage int32 `json:"chargingRatePercentage"`
ReceivedAt int64 `gorm:"type:bigint;index" json:"receivedAt"`
}
type MqttTrainingSessionRecord struct {
gorm.Model
Identifier string `gorm:"uniqueIndex;size:255" json:"identifier"`
Topic string `gorm:"size:255;index" json:"topic"`
TestID string `gorm:"size:255;index" json:"testId"`
EventType string `gorm:"size:32;index" json:"eventType"`
RegionID uint32 `gorm:"index" json:"regionId"`
FlavorType string `gorm:"size:64;index" json:"flavorType"`
RawFlavor string `gorm:"size:64" json:"rawFlavor"`
AppName string `gorm:"size:255" json:"appName"`
StartedAt *int64 `gorm:"type:bigint;index" json:"startedAt"`
EndedAt *int64 `gorm:"type:bigint;index" json:"endedAt"`
PublishedAt int64 `gorm:"type:bigint;index" json:"publishedAt"`
ReceivedAt int64 `gorm:"type:bigint;index" json:"receivedAt"`
RawPayload string `gorm:"type:text" json:"rawPayload"`
}
func (MqttTrainingSessionRecord) TableName() string {
return "mqtt_training_sessions"
}