feat: Ajout d'un endpoint getBySlug

This commit is contained in:
ext.jeremy.guillot@maxicoffee.domains
2025-02-12 16:55:44 +01:00
parent 504c62c155
commit 30d26f530d
9 changed files with 265 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
<?php
namespace App\Domain\Manga\Infrastructure\ApiPlatform\Resource;
use ApiPlatform\Metadata\ApiResource;
use ApiPlatform\Metadata\Get;
use App\Domain\Manga\Infrastructure\ApiPlatform\Dto\MangaDetail;
use App\Domain\Manga\Infrastructure\ApiPlatform\State\Provider\GetMangaBySlugStateProvider;
#[ApiResource(
shortName: 'Manga',
operations: [
new Get(
uriTemplate: '/mangas/by-slug/{slug}',
provider: GetMangaBySlugStateProvider::class,
output: MangaDetail::class,
name: 'get_manga_by_slug'
)
]
)]
class GetMangaBySlugResource
{
public function __construct(
public string $slug
) {}
}