feat: 更新模型以支持 UUID,添加注册请求 DTO,重构用户注册逻辑

This commit is contained in:
2025-12-19 16:32:49 +08:00
parent e031f3cc40
commit 922692b820
17 changed files with 380 additions and 147 deletions

View File

@@ -1,6 +1,9 @@
from typing import TYPE_CHECKING
from uuid import UUID
from sqlmodel import Field, Relationship, Index
from .base import TableBase
if TYPE_CHECKING:
@@ -21,8 +24,8 @@ class SourceLink(TableBase, table=True):
"""通过此链接的下载次数"""
# 外键
object_id: int = Field(foreign_key="object.id", index=True)
"""关联的对象ID必须是文件类型"""
object_id: UUID = Field(foreign_key="object.id", index=True)
"""关联的对象UUID必须是文件类型"""
# 关系
object: "Object" = Relationship(back_populates="source_links")