from sqlalchemy import Column, Integer, String, DateTime, Text, func from app.database import Base import datetime class TryOn(Base): """试穿记录模型类""" __tablename__ = "tryons" id = Column(Integer, primary_key=True, index=True, autoincrement=True) top_garment_url = Column(String(1024), nullable=True, comment="上衣图片URL") bottom_garment_url = Column(String(1024), nullable=True, comment="下衣图片URL") person_image_url = Column(String(1024), nullable=True, comment="人物图片URL") request_id = Column(String(255), nullable=True, comment="请求ID") task_id = Column(String(255), nullable=True, comment="任务ID") task_status = Column(String(50), nullable=True, comment="任务状态") completion_url = Column(String(1024), nullable=True, comment="生成图片URL") created_at = Column(DateTime, default=datetime.datetime.now(), comment="创建时间") updated_at = Column(DateTime, default=datetime.datetime.now(), onupdate=datetime.datetime.now, comment="更新时间") def __repr__(self): return f""