package models import "gorm.io/gorm" type StepStrideFreq struct { gorm.Model TrainId uint `gorm:"column:train_id; index" json:"trainId"` // 外键关联训练记录[4](@ref) Time int64 `gorm:"type:bigint" json:"time"` // 保持与前端一致的毫秒时间戳[3](@ref) Value int `gorm:"type:int" json:"value"` PredictValue int `gorm:"type:int" json:"predictValue"` Identifier string `gorm:"uniqueIndex;type:varchar(255)" json:"identifier"` } // 对应Flutter的HeartRate结构 type StepHeartRate struct { gorm.Model TrainId uint `gorm:"column:train_id; index" json:"trainId"` // 外键关联训练记录[4](@ref) Time int64 `gorm:"type:bigint" json:"time"` // 保持与前端一致的毫秒时间戳[3](@ref) Value int `gorm:"type:int" json:"value"` HeartRateType int `gorm:"type:int" json:"predictValue"` Identifier string `gorm:"uniqueIndex;type:varchar(255)" json:"identifier"` } // 对应Flutter的TrainRecord结构 type StepTrainRecord struct { gorm.Model TrainId uint `gorm:"uniqueIndex" json:"tid"` // 对应Dart的tid字段 StartTime int64 `gorm:"type:bigint" json:"time"` // 开始时间戳 EndTime int64 `gorm:"type:bigint" json:"endTime"` // 结束时间戳[3](@ref) Name string `gorm:"size:100" json:"name"` RunType string `gorm:"size:100" json:"RunType"` MaxHeartRate int `gorm:"type:int" json:"maxHeartRate"` Duration int `gorm:"type:int" json:"duration"` // 持续时间(秒) DeadZone int `gorm:"type:int" json:"deadZone"` Evaluation string `gorm:"size:50" json:"evaluation"` HeartRates []StepHeartRate `gorm:"foreignKey:TrainId;references:TrainId" json:"HeartRates"` StrideFreqs []StepStrideFreq `gorm:"foreignKey:TrainId;references:TrainId" json:"strideFreqs"` }