Files
SnapAndAnaly/backend/app/models/watch_folder.py
T

26 lines
945 B
Python
Raw Normal View History

"""被监听的截图目录列表。"""
from __future__ import annotations
from datetime import datetime
from sqlalchemy import Boolean, DateTime, Integer, String, UniqueConstraint, func
from sqlalchemy.orm import Mapped, mapped_column
from app.core.db import Base
class WatchFolder(Base):
"""监听的截图目录。"""
__tablename__ = "watch_folders"
__table_args__ = (UniqueConstraint("path", name="uq_watch_folders_path"),)
id: Mapped[int] = mapped_column(Integer, primary_key=True, autoincrement=True)
path: Mapped[str] = mapped_column(String(1024), nullable=False)
enabled: Mapped[bool] = mapped_column(Boolean, default=True)
recursive: Mapped[bool] = mapped_column(Boolean, default=True)
is_sensitive: Mapped[bool] = mapped_column(Boolean, default=False) # 是否禁止上传云端
created_at: Mapped[datetime] = mapped_column(
DateTime, server_default=func.now(), nullable=False
)