refactor: train.

This commit is contained in:
2025-06-25 08:53:08 +08:00
parent f4df1724b2
commit 8510d19baa
2 changed files with 49 additions and 11 deletions

View File

@ -28,6 +28,7 @@ type BeltAnalysis struct {
Avg4min float64 `gorm:"type:double precision"` // 第4分钟平均心率
Avg6min float64 `gorm:"type:double precision"` // 第6分钟平均心率
CurveParamA float64 `gorm:"type:double precision"` // 拟合参数a值
CurveParamB float64 `gorm:"type:double precision"` // 拟合参数a值
}
// 中间计算结构(无需持久化)
@ -47,9 +48,10 @@ type HeartRate struct {
// 对应Flutter的TrainRecord结构
type TrainRecord 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)
TrainId uint `gorm:"uniqueIndex" json:"tid"` // 对应Dart的tid字段
StartTime int64 `gorm:"type:bigint" json:"time"` // 开始时间戳
TestTime int64 `gorm:"type:bigint" json:"testTime"` // 开始时间戳
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"`