From f7eff392b0fee6327de4d1704fc1221ee237e998 Mon Sep 17 00:00:00 2001 From: xingc Date: Fri, 9 May 2025 18:42:21 +0800 Subject: [PATCH] =?UTF-8?q?fix(pay):=20=E6=94=AF=E4=BB=98=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C=E5=8F=82=E6=95=B0=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/routers/pay/routes.py | 2 +- core/routers/product/schema.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/routers/pay/routes.py b/core/routers/pay/routes.py index 89d865b..0a0d05c 100644 --- a/core/routers/pay/routes.py +++ b/core/routers/pay/routes.py @@ -60,7 +60,7 @@ async def create_order( if product is None: raise HTTPException(status.HTTP_404_NOT_FOUND, detail='产品不存在') - if product.number != payload.total_fee: + if product.price != payload.total_fee: raise HTTPException(status.HTTP_400_BAD_REQUEST, detail='产品费用不合法') client_ip = ( diff --git a/core/routers/product/schema.py b/core/routers/product/schema.py index e3c7b30..8cb4ff0 100644 --- a/core/routers/product/schema.py +++ b/core/routers/product/schema.py @@ -16,8 +16,8 @@ class Product(BaseModel): category: ProductCategory price: int number: int - description: str | None + description: str | None = None class ProductOut(Product): - gift_product: Product | None + gift_product: Product | None = None