feat: Reader beginning
This commit is contained in:
parent
e90c0a140e
commit
55945adc53
@@ -0,0 +1,50 @@
|
||||
<?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()
|
||||
{
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user