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

feat(item_buy): 优化购买逻辑并添加库存限制功能

- 将变量名 is 改为 ok,提高代码可读性
- 移除未使用的变量 addSuccess
- 重构购买成功逻辑,确保物品添加成功后才扣减金币
- 在 talk.go 中修改判断条件,使用 Limit 字段而非 Type 字段
- 在 user_talk.go 中添加 Limit 字段用于限制数量配置
```
This commit is contained in:
昔念
2026-03-28 01:46:52 +08:00
parent ce0474258a
commit 06091ff42c
3 changed files with 25 additions and 21 deletions

View File

@@ -46,7 +46,7 @@ func (s *TalkService) Cheak(mapid uint32, flag int) (int, bool) {
if c == nil {
return 0, false //没在地图
}
switch c.Type {
switch c.Limit {
case 0:
if !utils.IsToday(talks.LastResetTime) {