package models import "gorm.io/gorm" type MqttHeartRateRecord struct { gorm.Model Identifier string `gorm:"uniqueIndex;size:255" json:"identifier"` Topic string `gorm:"size:255;index" json:"topic"` RegionID uint32 `gorm:"index" json:"regionId"` GatewayMAC string `gorm:"size:32;index" json:"gatewayMac"` BandID uint32 `gorm:"index" json:"bandId"` BeltAddr string `gorm:"size:64;index" json:"beltAddr"` PacketNum uint32 `gorm:"index" json:"packetNum"` HeartRate int `gorm:"type:int" json:"heartRate"` HrConfidence int `gorm:"type:int" json:"hrConfidence"` IsActive bool `json:"isActive"` IsOnSkin bool `json:"isOnSkin"` Battery uint32 `json:"battery"` SignalRSSINeg float64 `gorm:"type:double precision" json:"signalRssiNeg"` SNR float64 `gorm:"type:double precision" json:"snr"` HubBusID uint32 `json:"hubBusId"` HubSubDevID uint32 `json:"hubSubDevId"` ReceivedAt int64 `gorm:"type:bigint;index" json:"receivedAt"` } type MqttStepCountRecord struct { gorm.Model Identifier string `gorm:"uniqueIndex;size:255" json:"identifier"` Topic string `gorm:"size:255;index" json:"topic"` RegionID uint32 `gorm:"index" json:"regionId"` GatewayMAC string `gorm:"size:32;index" json:"gatewayMac"` BandID uint32 `gorm:"index" json:"bandId"` BeltAddr string `gorm:"size:64;index" json:"beltAddr"` PacketNum uint32 `gorm:"index" json:"packetNum"` StepCount uint32 `json:"stepCount"` SignalRSSINeg float64 `gorm:"type:double precision" json:"signalRssiNeg"` SNR float64 `gorm:"type:double precision" json:"snr"` HubBusID uint32 `json:"hubBusId"` HubSubDevID uint32 `json:"hubSubDevId"` ReceivedAt int64 `gorm:"type:bigint;index" json:"receivedAt"` } type MqttGatewayStatusRecord struct { gorm.Model Identifier string `gorm:"uniqueIndex;size:255" json:"identifier"` Topic string `gorm:"size:255;index" json:"topic"` RegionID uint32 `gorm:"index" json:"regionId"` GatewayMAC string `gorm:"size:32;index" json:"gatewayMac"` BootCount uint32 `json:"bootCount"` UptimeMs uint32 `json:"uptimeMs"` DurationMsSinceLastPacket uint32 `json:"durationMsSinceLastPacket"` RxCount uint32 `json:"rxCount"` BatteryVoltageMV uint32 `json:"batteryVoltageMv"` BatterySOCPercentage uint32 `json:"batterySocPercentage"` 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"` TrainId string `gorm:"size:255;index" json:"trainId"` PeopleNum int `gorm:"type:int" json:"peopleNum"` 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" }