Files
video-gen/video-gen-api/app/models/upload_task.py
T
root 92fb64aa99 修改
1、微信回调签名验证绕过问题
2、联系请求竞态条件问题
3、contact列表count过滤bug
4、核心业务表索引添加
2026-06-29 10:15:10 +08:00

39 lines
1.4 KiB
Python

from sqlalchemy import String, Text, Integer, Index
from sqlalchemy.orm import Mapped, mapped_column
from app.models.base import Base, TimestampMixin, SoftDeleteMixin
class UploadTask(Base, TimestampMixin, SoftDeleteMixin):
__tablename__ = "upload_task"
id: Mapped[str] = mapped_column(
String(32), primary_key=True, comment="主键"
)
user_id: Mapped[str] = mapped_column(
String(64), nullable=False, index=True, comment="用户登录id"
)
advertiser_id: Mapped[str] = mapped_column(
String(64), nullable=False, index=True, comment="广告主id"
)
resource_id: Mapped[str] = mapped_column(
String(64), nullable=False, index=True, comment="资源id"
)
status: Mapped[int] = mapped_column(
Integer, nullable=False, default=1, comment="上传状态:1待上传,2上传中,3上传成功,4上传失败"
)
note: Mapped[str | None] = mapped_column(
Text, nullable=True, comment="上传备注"
)
oauth_id: Mapped[str] = mapped_column(
String(64), nullable=False, index=True, comment="授权表id"
)
other_info: Mapped[str | None] = mapped_column(
String(500), nullable=True, comment="其他信息"
)
__table_args__ = (
Index('idx_upload_user_status_created', 'user_id', 'status', 'created_at'),
Index('idx_upload_oauth_status', 'oauth_id', 'status'),
)