TipitakaExportResource.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. namespace App\Http\Resources\V3;
  3. use Illuminate\Http\Request;
  4. /**
  5. * 一次三藏下载的状态(`/v3/tipitaka-exports`)。载荷是 TipitakaExportService::present() 的数组。
  6. *
  7. * `id` 是内容指纹:同一 channel、范围、格式,译文没改过就是同一个 id——客户端(mobile 离线包)
  8. * 可以拿它判断已下载的内容是否过时。`download_url` 是签名的相对地址,`status = ready` 时才有,
  9. * 到 `expires_at` 失效。
  10. */
  11. class TipitakaExportResource extends BaseResource
  12. {
  13. /**
  14. * @param Request $request
  15. * @return array{
  16. * id: string,
  17. * status: string,
  18. * format: string,
  19. * progress: float,
  20. * message: string|null,
  21. * title: string,
  22. * works: int,
  23. * filename: string,
  24. * content_type: string,
  25. * size: int|null,
  26. * ready_at: string|null,
  27. * expires_at: string|null,
  28. * download_url: string|null
  29. * }
  30. */
  31. public function toArray($request)
  32. {
  33. return parent::toArray($request);
  34. }
  35. }