package model // GameProgress 关卡进度表:记录用户在带关卡游戏里解锁到的最高关(一人一游戏一条) type GameProgress struct { ID int `gorm:"primaryKey" json:"id"` // 进度ID UserID int `gorm:"uniqueIndex:uk_user_game" json:"user_id"` // 用户ID GameID int `gorm:"uniqueIndex:uk_user_game" json:"game_id"` // 游戏ID Level int `gorm:"default:1" json:"level"` // 已解锁的最高关卡(从 1 开始,通关第 N 关后为 N+1) CreatedAt int64 `gorm:"autoCreateTime" json:"created_at"` // 首次记录时间(int 时间戳) UpdatedAt int64 `gorm:"autoUpdateTime" json:"updated_at"` // 最近推进时间(int 时间戳) } // TableName 指定表名 func (GameProgress) TableName() string { return "game_progress" }