导入和平精英商品目录并优化皮肤列表展示

- 皮肤增加 sku 字段,启动时按 sku 幂等导入 27 个和平精英商品
- 佣金默认 0,支持中英文名搜索
- 列表去掉品类列并固定列宽,避免中文名列空白过大
- 新增商品中英文名对照文档
This commit is contained in:
yml2213
2026-07-20 15:38:38 +08:00
parent 45db0aa4b9
commit 829bea309d
8 changed files with 177 additions and 43 deletions
+9 -8
View File
@@ -35,15 +35,16 @@ type Skin struct {
UpdatedAt time.Time `json:"updated_at"`
DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
Name string `gorm:"size:128;not null" json:"name"`
Game string `gorm:"size:64;index" json:"game"` // 所属游戏
Category string `gorm:"size:64;index" json:"category"` // 分类
Name string `gorm:"size:128;not null" json:"name"` // 中文名(展示用,保持原名)
SKU string `gorm:"uniqueIndex;size:64;not null" json:"sku"` // 英文固定标识
Game string `gorm:"size:64;index" json:"game"` // 所属游戏
Category string `gorm:"size:64;index" json:"category"` // 品类:套装/背包/...
CoverURL string `gorm:"size:512" json:"cover_url"`
Price float64 `gorm:"not null;default:0" json:"price"` // 售价
CostPrice float64 `gorm:"default:0" json:"cost_price"` // 成本价
Commission float64 `gorm:"default:0" json:"commission"` // 佣金比例 0-1
Stock int `gorm:"default:0" json:"stock"` // -1 无限
Status int `gorm:"default:1" json:"status"` // 1上架 0下架
Price float64 `gorm:"not null;default:0" json:"price"` // 售价
CostPrice float64 `gorm:"default:0" json:"cost_price"` // 成本价
Commission float64 `gorm:"default:0" json:"commission"` // 佣金比例 0-1
Stock int `gorm:"default:0" json:"stock"` // -1 无限
Status int `gorm:"default:1" json:"status"` // 1上架 0下架
Description string `gorm:"type:text" json:"description"`
}