feat : add TagList and DeployResult API Platform DTOs
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
25
src/ApiResource/DeployResult.php
Normal file
25
src/ApiResource/DeployResult.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\ApiResource;
|
||||
|
||||
use ApiPlatform\Metadata\ApiResource;
|
||||
use ApiPlatform\Metadata\Post;
|
||||
use App\State\DeployProcessor;
|
||||
|
||||
#[ApiResource(
|
||||
operations: [
|
||||
new Post(
|
||||
uriTemplate: '/environments/{id}/deploy',
|
||||
security: "is_granted('ROLE_ADMIN')",
|
||||
processor: DeployProcessor::class,
|
||||
),
|
||||
],
|
||||
)]
|
||||
final class DeployResult
|
||||
{
|
||||
public bool $success = false;
|
||||
public string $output = '';
|
||||
public string $tag = '';
|
||||
}
|
||||
24
src/ApiResource/TagList.php
Normal file
24
src/ApiResource/TagList.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\ApiResource;
|
||||
|
||||
use ApiPlatform\Metadata\ApiResource;
|
||||
use ApiPlatform\Metadata\Get;
|
||||
use App\State\TagListProvider;
|
||||
|
||||
#[ApiResource(
|
||||
operations: [
|
||||
new Get(
|
||||
uriTemplate: '/applications/{slug}/tags',
|
||||
security: "is_granted('ROLE_ADMIN')",
|
||||
provider: TagListProvider::class,
|
||||
),
|
||||
],
|
||||
)]
|
||||
final class TagList
|
||||
{
|
||||
/** @var list<string> */
|
||||
public array $tags = [];
|
||||
}
|
||||
Reference in New Issue
Block a user