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