feat: 合并 File 和 Folder 模型为统一的 Object 模型,优化对象管理逻辑

refactor: 更新相关模型和路由以支持新对象模型,移除冗余代码
This commit is contained in:
2025-12-18 17:18:40 +08:00
parent d271c81de7
commit 68343c710b
12 changed files with 420 additions and 153 deletions

View File

@@ -9,8 +9,7 @@ from .base import TableBase, SQLModelBase
if TYPE_CHECKING:
from .group import Group
from .download import Download
from .file import File
from .folder import Folder
from .object import Object
from .order import Order
from .share import Share
from .storage_pack import StoragePack
@@ -125,8 +124,8 @@ class User(TableBase, table=True):
)
downloads: list["Download"] = Relationship(back_populates="user")
files: list["File"] = Relationship(back_populates="user")
folders: list["Folder"] = Relationship(back_populates="owner")
objects: list["Object"] = Relationship(back_populates="owner")
"""用户的所有对象(文件和目录)"""
orders: list["Order"] = Relationship(back_populates="user")
shares: list["Share"] = Relationship(back_populates="user")
storage_packs: list["StoragePack"] = Relationship(back_populates="user")