完成部分API路由以及文档

This commit is contained in:
2025-06-18 02:14:37 +08:00
parent 127fb6972f
commit eb3d2843eb
22 changed files with 2867 additions and 2 deletions

View File

@@ -0,0 +1,41 @@
from fastapi import APIRouter, Depends
from middleware.auth import SignRequired
from models.response import ResponseModel
directory_router = APIRouter(
prefix="/directory",
tags=["directory"]
)
@directory_router.put(
path='/',
summary='创建目录',
description='Create a directory endpoint.',
dependencies=[Depends(SignRequired)]
)
def router_directory_create() -> ResponseModel:
"""
Create a directory endpoint.
Returns:
ResponseModel: A model containing the response data for the directory creation.
"""
...
@directory_router.get(
path='/{path:path}',
summary='获取目录内容',
description='Get directory contents endpoint.',
dependencies=[Depends(SignRequired)]
)
def router_directory_get(path: str) -> ResponseModel:
"""
Get directory contents endpoint.
Args:
path (str): The path of the directory to retrieve contents from.
Returns:
ResponseModel: A model containing the response data for the directory contents.
"""
...