""" 公告模型 """ from sqlalchemy import Column, Integer, String, DateTime, SmallInteger, Text from app.database import Base class Announcement(Base): """公告表""" __tablename__ = "announcements" id = Column(Integer, primary_key=True, index=True, comment="主键ID") title = Column(String(200), nullable=False, comment="公告标题") content = Column(Text, nullable=False, comment="公告内容") priority = Column(SmallInteger, default=0, index=True, comment="优先级") is_active = Column(SmallInteger, default=1, index=True, comment="是否启用") publish_time = Column(DateTime, index=True, comment="发布时间") is_deleted = Column(SmallInteger, default=0, index=True, comment="是否删除:0-否,1-是") created_at = Column(DateTime, comment="创建时间") updated_at = Column(DateTime, comment="更新时间")