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

feat(pet): 完善宠物购买功能的错误处理和数据验证

- 在控制器层添加错误返回值处理,确保购买宠物操作的错误能够正确传递
- 添加时间验证逻辑,防止使用过期或异常的数据进行购买操作
- 修正金币更新逻辑,确保玩家和系统金币扣除与增加的准确性
- 优化代码结构,增强代码可读性和维护性
```
This commit is contained in:
昔念
2026-03-10 23:24:33 +08:00
parent fc620d668f
commit ed8b1b71c1
2 changed files with 9 additions and 3 deletions

View File

@@ -110,7 +110,7 @@ func (c *PetBagController) BuyPet(ctx context.Context, req *BuyPetReq) (res *coo
res = &cool.BaseRes{}
service.NewPetService(uint32(admin.UserId)).BuyPet(req.Cid)
err = service.NewPetService(uint32(admin.UserId)).BuyPet(req.Cid)
return