All checks were successful
Test / test (push) Successful in 1m45s
- Migrate SQLModel base classes, mixins, and database management to external sqlmodel-ext package; remove sqlmodels/base/, sqlmodels/mixin/, and sqlmodels/database.py - Add file viewer/editor system with WOPI protocol support for collaborative editing (OnlyOffice, Collabora) - Add enterprise edition license verification module (ee/) - Add Dockerfile multi-stage build with Cython compilation support - Add new dependencies: sqlmodel-ext, cryptography, whatthepatch Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
35 lines
858 B
Python
35 lines
858 B
Python
from enum import StrEnum
|
|
from typing import TYPE_CHECKING
|
|
from uuid import UUID
|
|
|
|
from sqlmodel import Field, Relationship
|
|
|
|
from sqlmodel_ext import SQLModelBase, TableBaseMixin
|
|
|
|
if TYPE_CHECKING:
|
|
from .share import Share
|
|
|
|
|
|
class ReportReason(StrEnum):
|
|
"""举报原因枚举"""
|
|
# [TODO] 补充具体举报原因
|
|
pass
|
|
|
|
|
|
class Report(SQLModelBase, TableBaseMixin):
|
|
"""举报模型"""
|
|
|
|
reason: int = Field(default=0, sa_column_kwargs={"server_default": "0"})
|
|
"""举报原因 [TODO] 待定义枚举"""
|
|
description: str | None = Field(default=None, max_length=255, description="补充描述")
|
|
|
|
# 外键
|
|
share_id: UUID = Field(
|
|
foreign_key="share.id",
|
|
index=True,
|
|
ondelete="CASCADE"
|
|
)
|
|
"""被举报的分享ID"""
|
|
|
|
# 关系
|
|
share: "Share" = Relationship(back_populates="reports") |