```
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful

feat(shop): 添加商品限购功能并优化购买逻辑

- 修改购买黄金商品接口,添加商品配额检查功能
- 新增月、周、日三种限购类型检查逻辑
- 当商品超出库存或达到购买限制时返回相应错误码
- 移除gold_log表中PlayerID字段的唯一索引约束
- 修复GoldService中的Cheak方法实现,支持多种时间维度限购检查
```
This commit is contained in:
昔念
2026-02-27 00:09:23 +08:00
parent e4ad1745d4
commit a210d653d2
3 changed files with 28 additions and 6 deletions

View File

@@ -14,7 +14,7 @@ const (
type GoldBeanConsume struct {
*cool.Model
PlayerID uint64 `gorm:"not null;uniqueIndex;index:idx_pet_by_player_id;comment:'所属玩家ID'" json:"player_id"`
PlayerID uint64 `gorm:"not null;index:idx_pet_by_player_id;comment:'所属玩家ID'" json:"player_id"`
ConsumeNum uint32 `gorm:"not null;default:0;comment:'消费数量'" json:"consume_num" description:"消费数量"`
BizID uint32 `gorm:"not null;default:0;comment:'关联业务ID如道具ID/扭蛋池ID无则填0'" json:"biz_id" description:"关联业务ID"`
///消费年份