feat(pet): 添加精灵可用性检查 新增Free字段验证,确保购买时精灵确实存在 ```
This commit is contained in:
@@ -63,6 +63,9 @@ func (s *PetService) BuyPet(pid uint32) error {
|
||||
if tt.IsSale == 0 {
|
||||
return fmt.Errorf("未上架")
|
||||
}
|
||||
if tt.Free == 0 {
|
||||
return fmt.Errorf("没有此精灵")
|
||||
}
|
||||
if tt.SalePrice == 0 {
|
||||
return fmt.Errorf("未设置价格")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user