feat(pet): 完善宠物购买功能的错误处理和数据验证 - 在控制器层添加错误返回值处理,确保购买宠物操作的错误能够正确传递 - 添加时间验证逻辑,防止使用过期或异常的数据进行购买操作 - 修正金币更新逻辑,确保玩家和系统金币扣除与增加的准确性 - 优化代码结构,增强代码可读性和维护性 ```
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user