feat: ajout de la gestion des sources de contenu avec des commandes et des gestionnaires pour l'importation, la mise à jour et l'exportation, ainsi que la création des ressources API correspondantes.

This commit is contained in:
ext.jeremy.guillot@maxicoffee.domains
2025-06-26 23:24:13 +02:00
parent ebcca466a9
commit 32b4e4fbb2
30 changed files with 1783 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
<?php
namespace App\Domain\Setting\Application\Response;
use App\Domain\Setting\Domain\Model\ContentSource;
readonly class ContentSourceResponse
{
public function __construct(
public int $id,
public string $baseUrl,
public string $chapterUrlFormat,
public string $scrapingType,
public ?string $imageSelector,
public ?string $nextPageSelector,
public ?string $chapterSelector,
public string $cleanBaseUrl,
) {}
public static function fromDomain(ContentSource $contentSource): self
{
return new self(
id: $contentSource->getId(),
baseUrl: $contentSource->getBaseUrl(),
chapterUrlFormat: $contentSource->getChapterUrlFormat(),
scrapingType: $contentSource->getScrapingType(),
imageSelector: $contentSource->getImageSelector(),
nextPageSelector: $contentSource->getNextPageSelector(),
chapterSelector: $contentSource->getChapterSelector(),
cleanBaseUrl: $contentSource->getCleanBaseUrl(),
);
}
}