buff_selection_request_log.py 1.2 KB

123456789101112131415161718192021
  1. """
  2. BUFF 选品请求单-选品日志表模型:记录第二步对每个饰品的判断结果与时间,供前端展示。
  3. """
  4. from sqlalchemy import Column, BigInteger, Integer, String, DateTime
  5. from app.database import Base
  6. from app.utils.timezone import beijing_now_naive
  7. class BuffSelectionRequestLog(Base):
  8. """BUFF 选品请求单-选品日志表"""
  9. __tablename__ = "buff_selection_request_log"
  10. id = Column(BigInteger, primary_key=True, autoincrement=True, comment="主键ID")
  11. request_id = Column(BigInteger, nullable=False, index=True, comment="选品请求单ID")
  12. user_id = Column(Integer, nullable=False, index=True, comment="用户ID,按用户隔离")
  13. goods_id = Column(String(64), nullable=False, comment="BUFF饰品ID")
  14. goods_name = Column(String(256), nullable=True, comment="饰品名称,便于日志展示")
  15. sequence_no = Column(Integer, nullable=False, default=0, comment="判断序号:本次选品中第几个被判断")
  16. result = Column(String(20), nullable=False, comment="判断结果:selected-已入选, not_selected-未入选")
  17. message = Column(String(256), nullable=True, comment="简短说明,可为空")
  18. created_at = Column(DateTime, default=beijing_now_naive, comment="判断时间")