feat:新UI上线测试,问题可能比较多,稳定用户不建议用beta,请使用latest

This commit is contained in:
Lan
2024-11-23 17:06:40 +08:00
parent 41ae5b3d5a
commit f40b45c19f
117 changed files with 313 additions and 14 deletions
+3 -3
View File
@@ -19,10 +19,10 @@ class FileService:
await self.file_storage.delete_file(file_code)
await file_code.delete()
async def list_files(self, page: int, size: int):
async def list_files(self, page: int, size: int, keyword: str = ''):
offset = (page - 1) * size
files = await FileCodes.all().limit(size).offset(offset)
total = await FileCodes.all().count()
files = await FileCodes.filter(prefix__icontains=keyword).limit(size).offset(offset)
total = await FileCodes.filter(prefix__icontains=keyword).count()
return files, total
async def download_file(self, file_id: int):
+2 -1
View File
@@ -63,10 +63,11 @@ async def file_delete(
async def file_list(
page: int = 1,
size: int = 10,
keyword: str = '',
file_service: FileService = Depends(get_file_service),
admin: bool = Depends(admin_required)
):
files, total = await file_service.list_files(page, size)
files, total = await file_service.list_files(page, size, keyword)
return APIResponse(detail={
'page': page,
'size': size,