feat: add admin text preview endpoint

This commit is contained in:
Lan committed 2026-06-03 04:05:52 +08:00
1 parent 71fc1ad8ea
commit 1eb69e4cc5
2 files changed
+38

No files matched your search

+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),