mirror of
https://github.com/jikan-me/jikan-rest.git
synced 2025-02-20 11:23:35 +08:00
30 lines
878 B
PHP
30 lines
878 B
PHP
<?php
|
|
|
|
namespace App\Features;
|
|
|
|
use App\Dto\QueryRecentlyAddedEpisodesCommand;
|
|
use Illuminate\Http\JsonResponse;
|
|
use Illuminate\Support\Collection;
|
|
use App\Support\CachedData;
|
|
use Jikan\MyAnimeList\MalClient;
|
|
use Jikan\Request\Watch\RecentEpisodesRequest;
|
|
|
|
/**
|
|
* @extends RequestHandlerWithScraperCache<QueryRecentlyAddedEpisodesCommand, JsonResponse>
|
|
*/
|
|
final class QueryRecentlyAddedEpisodesHandler extends RequestHandlerWithScraperCache
|
|
{
|
|
public function requestClass(): string
|
|
{
|
|
return QueryRecentlyAddedEpisodesCommand::class;
|
|
}
|
|
|
|
protected function getScraperData(string $requestFingerPrint, Collection $requestParams): CachedData
|
|
{
|
|
return $this->scraperService->findList(
|
|
$requestFingerPrint,
|
|
fn(MalClient $jikan, ?int $page = null) => $jikan->getRecentEpisodes(new RecentEpisodesRequest())
|
|
);
|
|
}
|
|
}
|