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