model.py 731 B

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