Files
bl/modules/config/model/shop.go
昔念 6b316b868c
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
```
feat(player): 添加称号重复检查逻辑

防止玩家重复获得相同称号,提升系统稳定性

fix(config): 修复boss配置相关代码问题

- 新增BossController的GetList接口
- 优化import语句顺序
- 修正PetBaseConfig中Desc字段为Remark字段
- 移除Tower配置中的TaskIds冗余字段
- 完善ShopConfig字段注释内容
```
2026-02-23 12:39:57 +08:00

54 lines
1.8 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 (
"blazing/cool"
)
// 表名常量定义:商店配置表
const (
TableNameShopConfig = "config_shop" // 商店配置表(记录商品信息、价格、库存、分类等)
)
// ShopConfig 商店商品核心配置模型
type ShopConfig struct {
*BaseConfig
//商品类型
ProductType uint32 `gorm:"not null;default:0;comment:'商品类型'" json:"product_type" description:"商品类型"`
//商品ID
ProductID int64 `gorm:"not null;uniqueIndex;comment:'商品ID'" json:"product_id" description:"商品ID"`
// 价格信息 -1代表不允许购买,0表示不支持购买
SeerdouPrice int32 `gorm:"not null;default:0;comment:'骄阳豆价格'" json:"seerdou_price" description:"骄阳豆价格"`
JindouPrice int32 `gorm:"not null;default:0;comment:'金豆价格'" json:"jindou_price" description:"金豆价格"`
// 库存信息
Stock uint32 `gorm:"not null;default:0;comment:'商品库存数量0表示无限库存'" json:"stock" description:"库存数量"`
// 限购信息
QuotaLimit uint32 `gorm:"not null;default:0;comment:'单位时间内的限购数量'" json:"quota_limit" description:"限购数量"`
//限购类型
QuotaType uint32 `gorm:"not null;default:0;comment:'限购类型(0-不限购 1-每日限购 2-每周限购 3-每月限购)'" json:"quota_type" description:"限购类型"`
}
// -------------------------- 核心配套方法(遵循项目规范)--------------------------
func (*ShopConfig) TableName() string {
return TableNameShopConfig
}
func (*ShopConfig) GroupName() string {
return "default"
}
func NewShopConfig() *ShopConfig {
return &ShopConfig{
BaseConfig: NewBaseConfig(),
}
}
// -------------------------- 表结构自动同步 --------------------------
func init() {
cool.CreateTable(&ShopConfig{})
}