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:
parent
ebcca466a9
commit
32b4e4fbb2
@@ -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(),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user