feat: add admin text preview endpoint

This commit is contained in:
Lan
2026-06-03 04:05:52 +08:00
parent d604d1e077
commit 1af86ae257
2 changed files with 38 additions and 0 deletions
+10
View File
@@ -196,6 +196,16 @@ async def file_download(
return file_content
@admin_api.get("/file/preview")
async def file_preview(
id: int,
maxChars: int = 4000,
file_service: FileService = Depends(get_file_service),
):
preview = await file_service.preview_file(id, maxChars)
return APIResponse(detail=preview)
@admin_api.get("/local/lists")
async def get_local_lists(
local_file_service: LocalFileService = Depends(get_local_file_service),