feat: Implement file download token management and restructure file routes

- Added DownloadTokenManager for creating and verifying JWT download tokens.
- Introduced new download routes for creating download tokens and downloading files using tokens.
- Restructured file upload routes into a dedicated sub-router.
- Updated file upload session management with improved error handling and response structures.
- Created a new MCP (Microservice Communication Protocol) router with basic request and response models.
- Added base models for MCP requests and responses, including method enumeration.
This commit is contained in:
2025-12-23 18:12:11 +08:00
parent 4cd13e4075
commit 16cec42181
14 changed files with 1884 additions and 396 deletions

View File

@@ -40,6 +40,32 @@ class SiteConfigResponse(SQLModelBase):
"""验证码密钥"""
# ==================== 管理员设置 DTO ====================
class SettingItem(SQLModelBase):
"""设置项 DTO"""
name: str
"""设置项名称"""
value: str | None = None
"""设置值"""
class SettingsUpdateRequest(SQLModelBase):
"""更新设置请求 DTO"""
settings: dict[str, dict[str, str | None]]
"""按类型分组的设置项,格式: {"basic": {"siteName": "xxx", ...}, ...}"""
class SettingsGetResponse(SQLModelBase):
"""获取设置响应 DTO"""
settings: dict[str, dict[str, str | None]] = {}
"""按类型分组的设置项"""
# ==================== 数据库模型 ====================
class SettingsType(StrEnum):