(
page: int = 1,
size: int = 10,
keyword: str = "",
status: str = "",
type: str = "",
health: str = "",
sortBy: str = "created_at",
sortOrder: str = "desc",
file_service: FileService = Depends(get_file_service),
)
| 325 | |
| 326 | @admin_api.get("/file/list") |
| 327 | async def file_list( |
| 328 | page: int = 1, |
| 329 | size: int = 10, |
| 330 | keyword: str = "", |
| 331 | status: str = "", |
| 332 | type: str = "", |
| 333 | health: str = "", |
| 334 | sortBy: str = "created_at", |
| 335 | sortOrder: str = "desc", |
| 336 | file_service: FileService = Depends(get_file_service), |
| 337 | ): |
| 338 | page = max(page, 1) |
| 339 | size = min(max(size, 1), 100) |
| 340 | files, total, summary = await file_service.list_files( |
| 341 | page, |
| 342 | size, |
| 343 | keyword, |
| 344 | status=status, |
| 345 | file_type=type, |
| 346 | health=health, |
| 347 | sort_by=sortBy, |
| 348 | sort_order=sortOrder, |
| 349 | ) |
| 350 | return APIResponse( |
| 351 | detail={ |
| 352 | "page": page, |
| 353 | "size": size, |
| 354 | "data": files, |
| 355 | "total": total, |
| 356 | "summary": summary, |
| 357 | } |
| 358 | ) |
| 359 | |
| 360 | |
| 361 | @admin_api.get("/file/detail") |
nothing calls this directly
no test coverage detected