Files
Mangarr/src/Domain/Reader/Infrastructure/ApiPlatform/Resource/ChapterPagesResource.php
ext.jeremy.guillot@maxicoffee.domains 55945adc53 feat: Reader beginning
2025-02-16 16:15:42 +01:00

51 lines
1.5 KiB
PHP

<?php
declare(strict_types=1);
namespace App\Domain\Reader\Infrastructure\ApiPlatform\Resource;
use ApiPlatform\Metadata\ApiResource;
use ApiPlatform\Metadata\Get;
use App\Domain\Reader\Infrastructure\ApiPlatform\State\Provider\ChapterPagesProvider;
use Symfony\Component\Serializer\Annotation\Groups;
#[ApiResource(
shortName: 'Reader',
operations: [
new Get(
uriTemplate: '/reader/chapter/{chapterId}/pages',
openapiContext: [
'summary' => 'Récupère les pages d\'un chapitre',
'description' => 'Retourne une collection paginée des pages du chapitre',
'parameters' => [
[
'name' => 'chapterId',
'in' => 'path',
'required' => true,
'schema' => ['type' => 'string'],
],
[
'name' => 'page',
'in' => 'query',
'required' => false,
'schema' => ['type' => 'integer', 'default' => 1],
],
[
'name' => 'itemsPerPage',
'in' => 'query',
'required' => false,
'schema' => ['type' => 'integer', 'default' => 20],
],
],
],
provider: ChapterPagesProvider::class
),
],
)]
class ChapterPagesResource
{
public function __construct()
{
}
}