Files
disknext/sqlmodels/report.py
于小丘 209cb24ab4 feat: add models for physical files, policies, and user management
- Implement PhysicalFile model to manage physical file references and reference counting.
- Create Policy model with associated options and group links for storage policies.
- Introduce Redeem and Report models for handling redeem codes and reports.
- Add Settings model for site configuration and user settings management.
- Develop Share model for sharing objects with unique codes and associated metadata.
- Implement SourceLink model for managing download links associated with objects.
- Create StoragePack model for managing user storage packages.
- Add Tag model for user-defined tags with manual and automatic types.
- Implement Task model for managing background tasks with status tracking.
- Develop User model with comprehensive user management features including authentication.
- Introduce UserAuthn model for managing WebAuthn credentials.
- Create WebDAV model for managing WebDAV accounts associated with users.
2026-02-10 19:07:48 +08:00

35 lines
846 B
Python

from enum import StrEnum
from typing import TYPE_CHECKING
from sqlmodel import Field, Relationship
from .base import SQLModelBase
from .mixin import 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: int = Field(
foreign_key="share.id",
index=True,
ondelete="CASCADE"
)
"""被举报的分享ID"""
# 关系
share: "Share" = Relationship(back_populates="reports")