From 097eeb38f74406cf563d38358a6e6dbb7982841e Mon Sep 17 00:00:00 2001 From: 18610128193 <10574456+chenweiqiang-123@user.noreply.gitee.com> Date: Tue, 16 Jun 2026 17:40:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=B4=A0=E6=9D=90=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- video-gen-api/app/models/pre_test_template.py | 69 +++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 video-gen-api/app/models/pre_test_template.py diff --git a/video-gen-api/app/models/pre_test_template.py b/video-gen-api/app/models/pre_test_template.py new file mode 100644 index 00000000..5d624488 --- /dev/null +++ b/video-gen-api/app/models/pre_test_template.py @@ -0,0 +1,69 @@ +from datetime import datetime +from typing import Optional + +from sqlalchemy import Boolean, DateTime, ForeignKey, Integer, String, Text +from sqlalchemy.orm import Mapped, mapped_column + +from app.models.base import Base, TimestampMixin, SoftDeleteMixin + + +class PreTestTemplate(Base, TimestampMixin, SoftDeleteMixin): + __tablename__ = "pre_test_template" + + id: Mapped[str] = mapped_column( + String(32), primary_key=True, comment="主键" + ) + name: Mapped[str] = mapped_column( + String(128), nullable=False, comment="模板名称" + ) + user_id: Mapped[str] = mapped_column( + String(32), nullable=False, index=True, comment="用户id" + ) + note: Mapped[Optional[str]] = mapped_column( + Text, nullable=True, comment="模板备注" + ) + platform: Mapped[Optional[str]] = mapped_column( + String(32), nullable=True, comment="投放平台(AD/QIANCHUAN/LOCAL)" + ) + external_action: Mapped[Optional[str]] = mapped_column( + String(64), nullable=True, comment="转化目标" + ) + cpa_bid: Mapped[Optional[float]] = mapped_column( + nullable=True, comment="目标转化成本:[1, 10000]" + ) + audience_gender: Mapped[Optional[str]] = mapped_column( + String(16), nullable=True, comment="性别(ALL/MALE/FEMALE)" + ) + audience_age: Mapped[Optional[str]] = mapped_column( + Text, nullable=True, comment="受众年龄,JSON数组, 格式:[ALL,18-23, 24-30, 31-40, 41-49, 50+]" + ) + audience_region: Mapped[Optional[str]] = mapped_column( + Text, nullable=True, comment="受众地区,JSON数组(二级行政区域code)" + ) + audience_network: Mapped[Optional[str]] = mapped_column( + Text, nullable=True, comment="网络类型,JSON数组, 格式:[ALL,5G,4G,3G,2G,WIFI]" + ) + cus_name: Mapped[Optional[str]] = mapped_column( + String(256), nullable=True, comment="客户主体名称" + ) + pricing_type: Mapped[Optional[str]] = mapped_column( + String(16), nullable=True, comment="出价类型(OCPC/CPA/OCPM)" + ) + cost_cap: Mapped[Optional[bool]] = mapped_column( + Boolean, nullable=True, comment="是否最优成本出价(仅AD支持)" + ) + target_cost: Mapped[Optional[bool]] = mapped_column( + Boolean, nullable=True, comment="是否稳定成本出价(仅AD支持)" + ) + nobid: Mapped[Optional[bool]] = mapped_column( + Boolean, nullable=True, comment="是否最大转化出价(仅AD支持)" + ) + cpc_bid: Mapped[Optional[float]] = mapped_column( + nullable=True, comment="目标点击成本:[1, 10000]" + ) + budget: Mapped[Optional[float]] = mapped_column( + nullable=True, comment="预算金额:[1, 10000]" + ) + is_default: Mapped[Optional[bool]] = mapped_column( + Boolean, nullable=True, comment="是否默认模板" + )