feat: Enhance file management and user features
- Add file deduplication mechanism based on PhysicalFile reference counting. - Implement chunked upload support for large files with resumable uploads. - Update sharing page to automatically render README and preview content. - Integrate Redis for caching and token storage (optional). - Refactor project structure to include new models for download tasks, nodes, and tasks. - Introduce user filtering parameters for admin user management. - Add CORS middleware for handling cross-origin requests. - Improve error messages for authentication failures. - Update user model to include two-factor authentication key management. - Enhance API documentation and response models for clarity. - Implement admin checks for user management and permissions.
This commit is contained in:
@@ -260,7 +260,7 @@ def router_user_avatar(id: str, size: int = 128) -> models.ResponseBase:
|
||||
summary='获取用户信息',
|
||||
description='Get user information.',
|
||||
dependencies=[Depends(dependency=auth_required)],
|
||||
response_model=models.ResponseBase,
|
||||
response_model=models.UserResponse,
|
||||
)
|
||||
async def router_user_me(
|
||||
session: SessionDep,
|
||||
@@ -285,7 +285,7 @@ async def router_user_me(
|
||||
# 异步加载 tags 关系
|
||||
user_tags = await user.awaitable_attrs.tags
|
||||
|
||||
user_response = models.UserResponse(
|
||||
return models.UserResponse(
|
||||
id=user.id,
|
||||
username=user.username,
|
||||
status=user.status,
|
||||
@@ -297,8 +297,6 @@ async def router_user_me(
|
||||
tags=[tag.name for tag in user_tags] if user_tags else [],
|
||||
)
|
||||
|
||||
return models.ResponseBase(data=user_response.model_dump())
|
||||
|
||||
@user_router.get(
|
||||
path='/storage',
|
||||
summary='存储信息',
|
||||
|
||||
Reference in New Issue
Block a user