| 68 | |
| 69 | |
| 70 | async def build_dashboard_recent_file(file_code: FileCodes) -> dict: |
| 71 | is_expired = await file_code.is_expired() |
| 72 | return { |
| 73 | "id": file_code.id, |
| 74 | "code": file_code.code, |
| 75 | "name": file_code.prefix + file_code.suffix, |
| 76 | "suffix": file_code.suffix, |
| 77 | "size": file_code.size, |
| 78 | "text": file_code.text is not None, |
| 79 | "expiredAt": file_code.expired_at, |
| 80 | "expiredCount": file_code.expired_count, |
| 81 | "usedCount": file_code.used_count, |
| 82 | "createdAt": file_code.created_at, |
| 83 | "isExpired": is_expired, |
| 84 | } |
| 85 | |
| 86 | |
| 87 | @admin_api.get("/dashboard") |