36 lines
1.1 KiB
PHP
36 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Domain\Setting\Infrastructure\ApiPlatform\Resource;
|
|
|
|
use ApiPlatform\Metadata\ApiResource;
|
|
use ApiPlatform\Metadata\Get;
|
|
use App\Domain\Setting\Infrastructure\ApiPlatform\State\Provider\GetContentSourceStateProvider;
|
|
use Symfony\Component\Validator\Constraints as Assert;
|
|
|
|
#[ApiResource(
|
|
shortName: 'ContentSource',
|
|
operations: [
|
|
new Get(
|
|
uriTemplate: '/content-sources/{id}',
|
|
provider: GetContentSourceStateProvider::class,
|
|
description: 'Récupère une source de contenu par son identifiant'
|
|
)
|
|
]
|
|
)]
|
|
class GetContentSourceResource
|
|
{
|
|
public function __construct(
|
|
#[Assert\NotBlank]
|
|
#[Assert\Type('integer')]
|
|
public readonly int $id,
|
|
public readonly string $baseUrl,
|
|
public readonly string $chapterUrlFormat,
|
|
public readonly string $scrapingType,
|
|
public readonly ?string $imageSelector,
|
|
public readonly ?string $nextPageSelector,
|
|
public readonly ?string $chapterSelector,
|
|
public readonly string $cleanBaseUrl,
|
|
) {
|
|
}
|
|
}
|