Files

15 lines
841 B
Go
Raw Permalink Normal View History

2026-08-14 13:17:03 +08:00
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" }