model.py 718 B

1234567891011121314151617181920
  1. from sqlalchemy import String, Text
  2. from sqlalchemy.orm import Mapped, mapped_column
  3. from app.core.base_model import ModelMixin, UserMixin
  4. class NoticeModel(ModelMixin, UserMixin):
  5. """
  6. 通知公告表
  7. """
  8. __tablename__: str = "sys_notice"
  9. __table_args__: dict[str, str] = {"comment": "通知公告表"}
  10. __loader_options__: list[str] = ["created_by", "updated_by"]
  11. notice_title: Mapped[str] = mapped_column(String(64), nullable=False, comment="公告标题")
  12. notice_type: Mapped[str] = mapped_column(
  13. String(1), nullable=False, comment="公告类型(1通知 2公告)"
  14. )
  15. notice_content: Mapped[str | None] = mapped_column(Text, nullable=True, comment="公告内容")