feat: commit before changing gitea

This commit is contained in:
ext.jeremy.guillot@maxicoffee.domains
2026-02-08 17:58:01 +01:00
parent b05bd98f63
commit ffceda606f
22 changed files with 1653 additions and 22 deletions

View File

@@ -0,0 +1,78 @@
<?php
namespace App\Domain\Manga\Infrastructure\ApiPlatform\Resource;
use ApiPlatform\Metadata\ApiResource;
use ApiPlatform\Metadata\Post;
use App\Domain\Manga\Infrastructure\ApiPlatform\Controller\ImportChapterController;
use Symfony\Component\HttpFoundation\File\File;
use Symfony\Component\Validator\Constraints as Assert;
#[ApiResource(
shortName: 'ImportChapter',
operations: [
new Post(
uriTemplate: '/chapters/import',
controller: ImportChapterController::class,
deserialize: false,
openapiContext: [
'summary' => 'Import a chapter from CBZ file',
'description' => 'Imports a CBZ file for an existing chapter and stores it',
'requestBody' => [
'content' => [
'multipart/form-data' => [
'schema' => [
'type' => 'object',
'required' => ['mangaId', 'chapterNumber', 'file'],
'properties' => [
'mangaId' => [
'type' => 'string',
'format' => 'uuid',
'description' => 'The manga UUID'
],
'chapterNumber' => [
'type' => 'number',
'description' => 'The chapter number (e.g., 1.5)'
],
'file' => [
'type' => 'string',
'format' => 'binary',
'description' => 'CBZ file to import (max 500MB)'
]
]
]
]
]
],
'responses' => [
'200' => [
'description' => 'Chapter imported successfully',
'content' => [
'application/json' => [
'schema' => [
'type' => 'object',
'properties' => [
'message' => ['type' => 'string'],
'chapterId' => ['type' => 'string']
]
]
]
]
]
]
]
)
]
)]
class ImportChapterResource
{
public ?string $mangaId = null;
public ?float $chapterNumber = null;
public ?File $file = null;
}

View File

@@ -0,0 +1,78 @@
<?php
namespace App\Domain\Manga\Infrastructure\ApiPlatform\Resource;
use ApiPlatform\Metadata\ApiResource;
use ApiPlatform\Metadata\Post;
use App\Domain\Manga\Infrastructure\ApiPlatform\Controller\ImportVolumeController;
use Symfony\Component\HttpFoundation\File\File;
#[ApiResource(
shortName: 'ImportVolume',
operations: [
new Post(
uriTemplate: '/volumes/import',
controller: ImportVolumeController::class,
deserialize: false,
openapiContext: [
'summary' => 'Import a volume from CBZ file',
'description' => 'Imports a CBZ file for an existing volume and updates all chapters',
'requestBody' => [
'content' => [
'multipart/form-data' => [
'schema' => [
'type' => 'object',
'required' => ['mangaId', 'volumeNumber', 'file'],
'properties' => [
'mangaId' => [
'type' => 'string',
'format' => 'uuid',
'description' => 'The manga UUID'
],
'volumeNumber' => [
'type' => 'integer',
'description' => 'The volume number'
],
'file' => [
'type' => 'string',
'format' => 'binary',
'description' => 'CBZ file to import (max 500MB)'
]
]
]
]
]
],
'responses' => [
'200' => [
'description' => 'Volume imported successfully',
'content' => [
'application/json' => [
'schema' => [
'type' => 'object',
'properties' => [
'message' => ['type' => 'string'],
'mangaId' => ['type' => 'string'],
'volumeNumber' => ['type' => 'integer']
]
]
]
]
]
]
]
)
]
)]
class ImportVolumeResource
{
public ?string $mangaId = null;
public ?int $volumeNumber = null;
public ?File $file = null;
}