cn_holiday.py 1.2 KB

123456789101112131415161718192021222324
  1. """中国节假日日历缓存模型"""
  2. from datetime import datetime
  3. from sqlalchemy import Column, Date, DateTime, SmallInteger, String, Text, UniqueConstraint
  4. from app.core.database import Base
  5. class SysCnHolidayDay(Base):
  6. """中国节假日日历缓存 sys_cn_holiday_day"""
  7. __tablename__ = "sys_cn_holiday_day"
  8. __table_args__ = (UniqueConstraint("day_date", name="uk_day_date"),)
  9. id = Column(String(64), primary_key=True, comment="UUID")
  10. day_date = Column(Date, nullable=False, comment="日历日")
  11. day_type = Column(SmallInteger, nullable=False, comment="0工作日1周末2节日3调休放假4补班")
  12. day_name = Column(String(64), nullable=True, comment="名称")
  13. week = Column(SmallInteger, nullable=True, comment="1-7周一到周日")
  14. is_rest_day = Column(SmallInteger, nullable=False, default=0, comment="1休息0工作")
  15. raw_json = Column(Text, nullable=True, comment="原始JSON片段")
  16. sync_time = Column(DateTime, nullable=True, comment="同步时间")
  17. create_time = Column(DateTime, nullable=True, default=datetime.now, comment="创建时间")
  18. update_time = Column(DateTime, nullable=True, default=datetime.now, onupdate=datetime.now, comment="更新时间")