44 lines
1.5 KiB
PHP
44 lines
1.5 KiB
PHP
<?php
|
|
|
|
namespace App\Domain\Manga\Infrastructure\ApiPlatform\Resource;
|
|
|
|
use ApiPlatform\Metadata\ApiResource;
|
|
use ApiPlatform\Metadata\Post;
|
|
use App\Domain\Manga\Infrastructure\ApiPlatform\State\Processor\RefreshMangaChaptersProcessor;
|
|
|
|
#[ApiResource(
|
|
shortName: 'MangaRefresh',
|
|
operations: [
|
|
new Post(
|
|
uriTemplate: '/manga/{mangaId}/chapters/refresh',
|
|
processor: RefreshMangaChaptersProcessor::class,
|
|
status: 202,
|
|
description: 'Déclenche la synchronisation et le scraping des nouveaux chapitres d\'un manga',
|
|
openapiContext: [
|
|
'summary' => 'Rafraîchir les chapitres d\'un manga',
|
|
'description' => 'Lance la synchronisation incrémentale avec scraping automatique des nouveaux chapitres',
|
|
'parameters' => [
|
|
[
|
|
'name' => 'mangaId',
|
|
'in' => 'path',
|
|
'required' => true,
|
|
'schema' => ['type' => 'string'],
|
|
'description' => 'L\'identifiant unique du manga'
|
|
]
|
|
],
|
|
'responses' => [
|
|
'202' => [
|
|
'description' => 'Demande de refresh acceptée et mise en file d\'attente'
|
|
],
|
|
'404' => [
|
|
'description' => 'Manga non trouvé'
|
|
]
|
|
]
|
|
]
|
|
)
|
|
]
|
|
)]
|
|
class RefreshMangaChaptersResource
|
|
{
|
|
}
|