feat: 更新存储策略相关逻辑,使用 UUID 替代 int 类型,优化响应模型

This commit is contained in:
2025-12-19 17:32:26 +08:00
parent 28401d6053
commit 11b67bde6d
5 changed files with 25 additions and 19 deletions

View File

@@ -47,8 +47,8 @@ class DirectoryCreateRequest(SQLModelBase):
name: str
"""目录名称"""
policy_id: int | None = None
"""存储策略ID不指定则继承父目录"""
policy_id: UUID | None = None
"""存储策略UUID不指定则继承父目录"""
class ObjectMoveRequest(SQLModelBase):
@@ -93,8 +93,8 @@ class ObjectResponse(ObjectBase):
class PolicyResponse(SQLModelBase):
"""存储策略响应 DTO"""
id: str
"""策略ID"""
id: UUID
"""策略UUID"""
name: str
"""策略名称"""
@@ -189,8 +189,8 @@ class Object(ObjectBase, UUIDTableBase, table=True):
owner_id: UUID = Field(foreign_key="user.id", index=True)
"""所有者用户UUID"""
policy_id: int = Field(foreign_key="policy.id", index=True)
"""存储策略ID文件直接使用目录作为子文件的默认策略"""
policy_id: UUID = Field(foreign_key="policy.id", index=True)
"""存储策略UUID文件直接使用目录作为子文件的默认策略"""
# ==================== 关系 ====================