feat(bookstack) : add BookStackShelf API resource for listing shelves

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-15 18:09:51 +01:00
parent 97c6ef6a52
commit 1e311242a9
2 changed files with 65 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
<?php
declare(strict_types=1);
namespace App\ApiResource;
use ApiPlatform\Metadata\ApiResource;
use ApiPlatform\Metadata\GetCollection;
use App\State\BookStackShelfProvider;
use Symfony\Component\Serializer\Attribute\Groups;
#[ApiResource(
operations: [
new GetCollection(
uriTemplate: '/bookstack/shelves',
normalizationContext: ['groups' => ['bookstack_shelf:read']],
provider: BookStackShelfProvider::class,
security: "is_granted('ROLE_ADMIN')",
),
],
)]
final class BookStackShelf
{
#[Groups(['bookstack_shelf:read'])]
public int $id = 0;
#[Groups(['bookstack_shelf:read'])]
public string $name = '';
}