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

24 lines
1.1 KiB
Go
Raw Permalink 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
// GameSkin 游戏皮肤定义更衣室商城price=0 视为默认解锁
type GameSkin struct {
ID int `gorm:"primaryKey" json:"id"`
GameCode string `gorm:"size:32;index" json:"game_code"` // 所属游戏编码(如 starve
Code string `gorm:"size:32" json:"code"` // 皮肤编码(前端绘制参数表的键)
Name string `gorm:"size:32" json:"name"` // 展示名称
Price int `gorm:"default:0" json:"price"` // 售价积分0=免费默认解锁)
Sort int `gorm:"default:0" json:"sort"` // 展示排序
}
func (GameSkin) TableName() string { return "game_skins" }
// UserSkin 用户已购皮肤免费皮肤不落库price=0 人人拥有)
type UserSkin struct {
ID int `gorm:"primaryKey" json:"id"`
UserID int `gorm:"uniqueIndex:uk_user_skin" json:"user_id"`
SkinID int `gorm:"uniqueIndex:uk_user_skin" json:"skin_id"`
CreatedAt int64 `gorm:"autoCreateTime" json:"created_at"`
}
func (UserSkin) TableName() string { return "user_skins" }