feat:新增接口

This commit is contained in:
zhangyongcai
2026-09-12 20:59:10 +08:00
parent b95fb5d4f7
commit 98751d592f
8 changed files with 258 additions and 84 deletions
+11 -5
View File
@@ -14,11 +14,17 @@ class PurchaseReq(BaseModel):
class PurchaseResp(BaseModel):
"""申购结果:最新余额 + 该产品最新持仓。"""
"""申购结果:order_no + status(已确认 / 风控挂起)。
balance: Decimal
holding: HoldingResp
已确认时返回最新余额 + 该产品持仓;风控挂起时账户/持仓不变,仅返回预警关联。
"""
order_no: str
status: str
balance: Decimal | None = None
holding: HoldingResp | None = None
alert_id: int | None = None
@field_serializer("balance")
def _fmt_balance(self, value: Decimal) -> str:
return f"{value:.2f}"
def _fmt_balance(self, value: Decimal | None) -> str | None:
return f"{value:.2f}" if value is not None else None