Files
web_template/internal/model/game.go
2026-07-10 10:06:08 +00:00

42 lines
2.1 KiB
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
import "time"
// GameCategory 游戏分类
type GameCategory struct {
ID uint `gorm:"primaryKey" json:"id"`
Name string `gorm:"size:50;not null" json:"name"`
Icon string `gorm:"size:50" json:"icon"`
Sort int `gorm:"default:0" json:"sort"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
// Game 游戏模型(3 套游戏网站共用同一套数据)
type Game struct {
ID uint `gorm:"primaryKey" json:"id"`
Name string `gorm:"size:200;not null" json:"name"`
Description string `gorm:"type:text" json:"description"`
CategoryID uint `gorm:"index" json:"category_id"`
CategoryName string `gorm:"size:50" json:"category_name"`
Cover string `gorm:"size:255" json:"cover"` // 封面图URL
Developer string `gorm:"size:100" json:"developer"` // 开发商
Publisher string `gorm:"size:100" json:"publisher"` // 发行商
Rating float64 `gorm:"type:decimal(2,1);default:5.0" json:"rating"`
Plays int `gorm:"default:0" json:"plays"` // 游玩次数
Downloads int `gorm:"default:0" json:"downloads"` // 下载量
Size string `gorm:"size:50" json:"size"` // 游戏大小
Version string `gorm:"size:50" json:"version"` // 版本号
ReleaseDate string `gorm:"size:20" json:"release_date"` // 发行日期
Platform string `gorm:"size:100" json:"platform"` // 平台
Tags string `gorm:"type:text" json:"tags"` // JSON: 标签数组
Screenshots string `gorm:"type:text" json:"screenshots"` // JSON: 截图描述数组
Features string `gorm:"type:text" json:"features"` // JSON: 特性列表
IsHot bool `gorm:"default:false" json:"is_hot"` // 热门
IsNew bool `gorm:"default:false" json:"is_new"` // 新游
Sort int `gorm:"default:0" json:"sort"`
Status int `gorm:"default:1;not null" json:"status"` // 1=上架
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}