forked from lubiana/futtern
api api
This commit is contained in:
parent
9d2f0204e3
commit
ee32852789
12 changed files with 514 additions and 3 deletions
|
@ -2,7 +2,14 @@
|
|||
|
||||
namespace App\Entity;
|
||||
|
||||
use ApiPlatform\Metadata\ApiResource;
|
||||
use ApiPlatform\Metadata\Delete;
|
||||
use ApiPlatform\Metadata\Get;
|
||||
use ApiPlatform\Metadata\GetCollection;
|
||||
use ApiPlatform\Metadata\Post;
|
||||
use ApiPlatform\Metadata\Put;
|
||||
use App\Repository\FoodOrderRepository;
|
||||
use App\State\OpenOrdersProvider;
|
||||
use DateInterval;
|
||||
use DateTimeImmutable;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
|
@ -13,6 +20,20 @@ use Symfony\Component\Uid\Ulid;
|
|||
|
||||
use function iterator_to_array;
|
||||
|
||||
#[ApiResource(
|
||||
operations: [
|
||||
new GetCollection(
|
||||
uriTemplate: 'food_orders/open',
|
||||
description: 'Get only open orders',
|
||||
provider: OpenOrdersProvider::class,
|
||||
),
|
||||
new GetCollection,
|
||||
new Get,
|
||||
new Post,
|
||||
new Put,
|
||||
new Delete,
|
||||
]
|
||||
)]
|
||||
#[ORM\Entity(repositoryClass: FoodOrderRepository::class)]
|
||||
class FoodOrder
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue