feat : add branch name generation endpoint
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
25
src/ApiResource/GiteaBranchName.php
Normal file
25
src/ApiResource/GiteaBranchName.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\ApiResource;
|
||||
|
||||
use ApiPlatform\Metadata\ApiResource;
|
||||
use ApiPlatform\Metadata\Get;
|
||||
use App\State\GiteaBranchNameProvider;
|
||||
use Symfony\Component\Serializer\Attribute\Groups;
|
||||
|
||||
#[ApiResource(
|
||||
operations: [
|
||||
new Get(
|
||||
uriTemplate: '/tasks/{taskId}/gitea/branch-name/{type}',
|
||||
normalizationContext: ['groups' => ['gitea_branch_name:read']],
|
||||
provider: GiteaBranchNameProvider::class,
|
||||
),
|
||||
],
|
||||
)]
|
||||
final class GiteaBranchName
|
||||
{
|
||||
#[Groups(['gitea_branch_name:read'])]
|
||||
public string $name = '';
|
||||
}
|
||||
Reference in New Issue
Block a user