34 lines
906 B
Python
34 lines
906 B
Python
from __future__ import annotations
|
|
|
|
from datetime import datetime
|
|
|
|
from pydantic import BaseModel, Field
|
|
|
|
|
|
class RechargeRequest(BaseModel):
|
|
plan: str = Field(..., description="积分商品ID;兼容旧字段名plan")
|
|
method: str = "wechat"
|
|
|
|
|
|
class PaymentOrderOut(BaseModel):
|
|
id: str
|
|
order_no: str
|
|
amount: float
|
|
credits: float
|
|
payment_method: str
|
|
status: str
|
|
product_id: str | None = None
|
|
product_type: str | None = None
|
|
purchase_scene: str | None = None
|
|
price_type: str | None = None
|
|
product_name_snapshot: str | None = None
|
|
target_price_snapshot: float | None = None
|
|
deduction_amount_snapshot: float | None = None
|
|
payable_amount_snapshot: float | None = None
|
|
fulfillment_status: str | None = None
|
|
qr_url: str | None = None
|
|
created_at: datetime
|
|
paid_at: datetime | None = None
|
|
|
|
model_config = {"from_attributes": True}
|