✨ Compatible with pydantic 2.0 using the pydantic compatibility layer provided by nonebot

This commit is contained in:
HibiKier
2025-01-10 12:19:11 +08:00
committed by BalconyJH
parent 23ef00d01f
commit e814469b75
69 changed files with 178 additions and 147 deletions
+2
View File
@@ -174,6 +174,8 @@ class UserConsole(Model):
if goods_uuid not in user.props or user.props[goods_uuid] < num:
raise GoodsNotFound("未找到商品或道具数量不足...")
user.props[goods_uuid] -= num
if user.props[goods_uuid] <= 0:
del user.props[goods_uuid]
await user.save(update_fields=["props"])
@classmethod