535d97a70c
17-table PostgreSQL schema with full Chinese column comments, FastAPI project structure (admin/common/modules), DSL rule files, and schema migration scripts.
29 lines
1.5 KiB
Python
29 lines
1.5 KiB
Python
"""LeAudit 文档文件模型 —— leaudit_document_files 表。"""
|
|
|
|
from __future__ import annotations
|
|
|
|
from sqlalchemy import BigInteger, Boolean, String
|
|
from sqlalchemy.orm import Mapped, mapped_column
|
|
|
|
from fastapi_common.fastapi_common_web.models import BaseModel
|
|
|
|
|
|
class LeauditDocumentFile(BaseModel):
|
|
"""文档文件表。"""
|
|
|
|
__tablename__ = "leaudit_document_files"
|
|
|
|
Id: Mapped[int] = mapped_column(BigInteger, primary_key=True, autoincrement=True)
|
|
documentId: Mapped[int] = mapped_column(BigInteger, comment="关联 leaudit_documents.id")
|
|
fileRole: Mapped[str] = mapped_column(String(64), comment="original/converted_pdf/merged_pdf/temp_input")
|
|
fileName: Mapped[str] = mapped_column(String(512), comment="文件名")
|
|
fileExt: Mapped[str | None] = mapped_column(String(32), comment="扩展名")
|
|
mimeType: Mapped[str | None] = mapped_column(String(128), comment="MIME")
|
|
fileSize: Mapped[int | None] = mapped_column(BigInteger, comment="文件大小")
|
|
sha256: Mapped[str | None] = mapped_column(String(64), comment="SHA256")
|
|
localPath: Mapped[str | None] = mapped_column(String(1024), comment="本地路径")
|
|
ossUrl: Mapped[str | None] = mapped_column(String(2048), comment="OSS 地址")
|
|
storageProvider: Mapped[str | None] = mapped_column(String(32), comment="oss/minio/local")
|
|
isActive: Mapped[bool] = mapped_column(Boolean, default=True, comment="当前生效文件")
|
|
createdBy: Mapped[int | None] = mapped_column(BigInteger, comment="上传人")
|