新增上传记录模型

This commit is contained in:
18610128193
2026-06-22 09:57:42 +08:00
parent bc123a8e85
commit 8e5190c6db
+29
View File
@@ -0,0 +1,29 @@
from sqlalchemy import String, Text, Integer
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,