Files
nl-game-api/internal/model/progress.go
2026-08-14 13:17:03 +08:00

15 lines
841 B
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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" }