feat:新增投顾工作台相关接口
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
"""portfolio_benchmark 组合基准配置表 ORM(投顾Agent 再平衡参照,运营可调整;工作台只读展示)。"""
|
||||
from __future__ import annotations
|
||||
|
||||
from datetime import datetime
|
||||
from decimal import Decimal
|
||||
from typing import Any
|
||||
|
||||
from sqlalchemy import BigInteger, DateTime, JSON, Numeric, String, func
|
||||
from sqlalchemy.orm import Mapped, mapped_column
|
||||
|
||||
from model.base import Base
|
||||
|
||||
|
||||
class PortfolioBenchmark(Base):
|
||||
__tablename__ = "portfolio_benchmark"
|
||||
__table_args__ = {"comment": "组合基准配置表(投顾Agent 再平衡参照,运营可调整)"}
|
||||
|
||||
id: Mapped[int] = mapped_column(BigInteger, primary_key=True, autoincrement=True)
|
||||
risk_level: Mapped[str] = mapped_column(String(16))
|
||||
target_allocation: Mapped[dict[str, Any] | None] = mapped_column(JSON)
|
||||
drift_threshold: Mapped[Decimal] = mapped_column(Numeric(5, 2), server_default="5.00")
|
||||
status: Mapped[str] = mapped_column(String(8), server_default="启用")
|
||||
create_time: Mapped[datetime] = mapped_column(DateTime, server_default=func.now())
|
||||
update_time: Mapped[datetime] = mapped_column(
|
||||
DateTime, server_default=func.now(), onupdate=func.now()
|
||||
)
|
||||
Reference in New Issue
Block a user