Basket Bundle Attributes
This commit is contained in:
parent
e044a424fa
commit
c504f9e4de
@ -474,7 +474,7 @@ namespace Symfony\Component\DependencyInjection\Loader\Configurator;
|
||||
* datetime?: array{
|
||||
* default_format?: scalar|null, // Default: "Y-m-d\\TH:i:sP"
|
||||
* default_deserialization_formats?: list<scalar|null>,
|
||||
* default_timezone?: scalar|null, // Default: "UTC"
|
||||
* default_timezone?: scalar|null, // Default: "Europe/Berlin"
|
||||
* cdata?: scalar|null, // Default: true
|
||||
* },
|
||||
* array_collection?: array{
|
||||
@ -574,7 +574,7 @@ namespace Symfony\Component\DependencyInjection\Loader\Configurator;
|
||||
* datetime?: array{
|
||||
* default_format?: scalar|null, // Default: "Y-m-d\\TH:i:sP"
|
||||
* default_deserialization_formats?: list<scalar|null>,
|
||||
* default_timezone?: scalar|null, // Default: "UTC"
|
||||
* default_timezone?: scalar|null, // Default: "Europe/Berlin"
|
||||
* cdata?: scalar|null, // Default: true
|
||||
* },
|
||||
* array_collection?: array{
|
||||
|
||||
@ -3,9 +3,10 @@
|
||||
namespace PSC\Shop\BasketBundle\Api\Basket\Legacy;
|
||||
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Nelmio\ApiDocBundle\Annotation\Model;
|
||||
use Nelmio\ApiDocBundle\Annotation\Security;
|
||||
use OpenApi\Annotations as OA;
|
||||
use Nelmio\ApiDocBundle\Attribute\Model;
|
||||
use OpenApi\Attributes\JsonContent;
|
||||
use OpenApi\Attributes\RequestBody;
|
||||
use OpenApi\Attributes\Response;
|
||||
use OpenApi\Attributes\Tag;
|
||||
use PSC\Component\ApiBundle\Dto\Error\NotFound;
|
||||
use PSC\Shop\BasketBundle\Dto\Legacy\Input;
|
||||
@ -14,7 +15,6 @@ use PSC\Shop\BasketBundle\Event\Legacy\Add as PSCAdd;
|
||||
use PSC\Shop\EntityBundle\Entity\Product;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\HttpKernel\Attribute\MapRequestPayload;
|
||||
use Symfony\Component\HttpKernel\KernelInterface;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
@ -32,22 +32,11 @@ class Add extends AbstractController
|
||||
) {}
|
||||
|
||||
/**
|
||||
* change temp basketitem
|
||||
*
|
||||
* @deprecated
|
||||
*
|
||||
* @OA\Response(
|
||||
* response=200,
|
||||
* description="basket",
|
||||
* @OA\JsonContent(ref=@Model(type=\PSC\Shop\BasketBundle\Dto\Legacy\Output::class))
|
||||
* )
|
||||
* @OA\RequestBody(
|
||||
* description="This is a request body",
|
||||
* @Model(type=\PSC\Shop\BasketBundle\Dto\Legacy\Input::class))
|
||||
* )
|
||||
* @OA\Tag(name="Basket")
|
||||
*/
|
||||
#[Tag('Basket')]
|
||||
#[Tag(name: 'Basket')]
|
||||
#[Response(response: 200, description: 'basket', content: new JsonContent(ref: new Model(type: Output::class)))]
|
||||
#[RequestBody(description: 'This is a request body', content: new Model(type: Input::class))]
|
||||
#[Route(path: '/legacy/add', methods: ['POST'])]
|
||||
public function add(#[MapRequestPayload] Input $data): JsonResponse
|
||||
{
|
||||
|
||||
@ -3,9 +3,11 @@
|
||||
namespace PSC\Shop\BasketBundle\Api\Basket\Legacy;
|
||||
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Nelmio\ApiDocBundle\Annotation\Model;
|
||||
use Nelmio\ApiDocBundle\Annotation\Security;
|
||||
use OpenApi\Annotations as OA;
|
||||
use Nelmio\ApiDocBundle\Attribute\Model;
|
||||
use OpenApi\Attributes\JsonContent;
|
||||
use OpenApi\Attributes\RequestBody;
|
||||
use OpenApi\Attributes\Response;
|
||||
use OpenApi\Attributes\Tag;
|
||||
use PSC\Component\ApiBundle\Dto\Error\NotFound;
|
||||
use PSC\Shop\BasketBundle\Dto\Legacy\Input;
|
||||
use PSC\Shop\BasketBundle\Dto\Legacy\Output;
|
||||
@ -13,12 +15,11 @@ use PSC\Shop\BasketBundle\Event\Legacy\Temp as PSCTemp;
|
||||
use PSC\Shop\EntityBundle\Entity\Product;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\HttpKernel\KernelInterface;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Component\Yaml\Yaml;
|
||||
use Symfony\Component\Security\Http\Attribute\IsGranted;
|
||||
use Symfony\Component\HttpKernel\Attribute\MapRequestPayload;
|
||||
use Symfony\Component\HttpKernel\KernelInterface;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
use Symfony\Component\Security\Http\Attribute\IsGranted;
|
||||
use Symfony\Component\Yaml\Yaml;
|
||||
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
|
||||
|
||||
class Temp extends AbstractController
|
||||
@ -33,26 +34,17 @@ class Temp extends AbstractController
|
||||
}
|
||||
|
||||
/**
|
||||
* change temp basketitem
|
||||
* @deprecated
|
||||
*
|
||||
* @OA\Response(
|
||||
* response=200,
|
||||
* description="basket",
|
||||
* @OA\JsonContent(ref=@Model(type=\PSC\Shop\BasketBundle\Dto\Legacy\Output::class))
|
||||
* )
|
||||
* @OA\RequestBody(
|
||||
* description="This is a request body",
|
||||
* @Model(type=\PSC\Shop\BasketBundle\Dto\Legacy\Input::class))
|
||||
* )
|
||||
* @OA\Tag(name="Basket")
|
||||
*/
|
||||
#[Tag(name: 'Basket')]
|
||||
#[Response(response: 200, description: 'basket', content: new JsonContent(ref: new Model(type: Output::class)))]
|
||||
#[RequestBody(description: 'This is a request body', content: new Model(type: Input::class))]
|
||||
#[Route(path: '/legacy/temp', methods: ['POST'])]
|
||||
public function temp(#[MapRequestPayload] Input $data): JsonResponse
|
||||
{
|
||||
require_once(__DIR__ . '/../../../../EntityBundle/Lagacy/TP_Basket_Item.php');
|
||||
require_once(__DIR__ . '/../../../../EntityBundle/Lagacy/TP_Basket_Collection.php');
|
||||
require_once(__DIR__ . '/../../../../EntityBundle/Lagacy/TP_Util.php');
|
||||
require_once __DIR__ . '/../../../../EntityBundle/Lagacy/TP_Basket_Item.php';
|
||||
require_once __DIR__ . '/../../../../EntityBundle/Lagacy/TP_Basket_Collection.php';
|
||||
require_once __DIR__ . '/../../../../EntityBundle/Lagacy/TP_Util.php';
|
||||
|
||||
$product = $this->entityManager->getRepository(Product::class)->findOneBy(['uuid' => $data->productUUId]);
|
||||
|
||||
@ -70,6 +62,6 @@ class Temp extends AbstractController
|
||||
return $this->json(new Output());
|
||||
}
|
||||
|
||||
return $this->json(new NotFound("order not found"));
|
||||
return $this->json(new NotFound('order not found'));
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,9 +3,11 @@
|
||||
namespace PSC\Shop\BasketBundle\Api\Basket\Legacy;
|
||||
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Nelmio\ApiDocBundle\Annotation\Model;
|
||||
use Nelmio\ApiDocBundle\Annotation\Security;
|
||||
use OpenApi\Annotations as OA;
|
||||
use Nelmio\ApiDocBundle\Attribute\Model;
|
||||
use OpenApi\Attributes\JsonContent;
|
||||
use OpenApi\Attributes\RequestBody;
|
||||
use OpenApi\Attributes\Response;
|
||||
use OpenApi\Attributes\Tag;
|
||||
use PSC\Component\ApiBundle\Dto\Error\NotFound;
|
||||
use PSC\Shop\BasketBundle\Dto\Legacy\Input;
|
||||
use PSC\Shop\BasketBundle\Dto\Legacy\Output;
|
||||
@ -13,12 +15,11 @@ use PSC\Shop\BasketBundle\Event\Legacy\Update as PSCUpdate;
|
||||
use PSC\Shop\EntityBundle\Entity\Product;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\HttpKernel\KernelInterface;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Component\Yaml\Yaml;
|
||||
use Symfony\Component\Security\Http\Attribute\IsGranted;
|
||||
use Symfony\Component\HttpKernel\Attribute\MapRequestPayload;
|
||||
use Symfony\Component\HttpKernel\KernelInterface;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
use Symfony\Component\Security\Http\Attribute\IsGranted;
|
||||
use Symfony\Component\Yaml\Yaml;
|
||||
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
|
||||
|
||||
class Update extends AbstractController
|
||||
@ -33,26 +34,17 @@ class Update extends AbstractController
|
||||
}
|
||||
|
||||
/**
|
||||
* change temp basketitem
|
||||
* @deprecated
|
||||
*
|
||||
* @OA\Response(
|
||||
* response=200,
|
||||
* description="basket",
|
||||
* @OA\JsonContent(ref=@Model(type=\PSC\Shop\BasketBundle\Dto\Legacy\Output::class))
|
||||
* )
|
||||
* @OA\RequestBody(
|
||||
* description="This is a request body",
|
||||
* @Model(type=\PSC\Shop\BasketBundle\Dto\Legacy\Input::class))
|
||||
* )
|
||||
* @OA\Tag(name="Basket")
|
||||
*/
|
||||
#[Tag(name: 'Basket')]
|
||||
#[Response(response: 200, description: 'basket', content: new JsonContent(ref: new Model(type: Output::class)))]
|
||||
#[RequestBody(description: 'This is a request body', content: new Model(type: Input::class))]
|
||||
#[Route(path: '/legacy/update', methods: ['POST'])]
|
||||
public function update(#[MapRequestPayload] Input $data): JsonResponse
|
||||
{
|
||||
require_once(__DIR__ . '/../../../../EntityBundle/Lagacy/TP_Basket_Item.php');
|
||||
require_once(__DIR__ . '/../../../../EntityBundle/Lagacy/TP_Basket_Collection.php');
|
||||
require_once(__DIR__ . '/../../../../EntityBundle/Lagacy/TP_Util.php');
|
||||
require_once __DIR__ . '/../../../../EntityBundle/Lagacy/TP_Basket_Item.php';
|
||||
require_once __DIR__ . '/../../../../EntityBundle/Lagacy/TP_Basket_Collection.php';
|
||||
require_once __DIR__ . '/../../../../EntityBundle/Lagacy/TP_Util.php';
|
||||
|
||||
$product = $this->entityManager->getRepository(Product::class)->findOneBy(['uuid' => $data->productUUId]);
|
||||
|
||||
@ -76,6 +68,6 @@ class Update extends AbstractController
|
||||
return $this->json(new Output());
|
||||
}
|
||||
|
||||
return $this->json(new NotFound("order not found"));
|
||||
return $this->json(new NotFound('order not found'));
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
namespace PSC\Shop\BasketBundle\Api\Layouter;
|
||||
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Nelmio\ApiDocBundle\Annotation\Model;
|
||||
use OpenApi\Attributes\JsonContent;
|
||||
use OpenApi\Attributes\RequestBody;
|
||||
use OpenApi\Attributes\Response;
|
||||
use OpenApi\Attributes\Tag;
|
||||
use PSC\Shop\BasketBundle\Dto\Layouter\Input;
|
||||
use PSC\Shop\BasketBundle\Dto\Legacy\Output;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
use Symfony\Component\HttpKernel\Attribute\MapRequestPayload;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
|
||||
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
|
||||
|
||||
class Save extends AbstractController
|
||||
{
|
||||
public function __construct(
|
||||
private readonly EntityManagerInterface $entityManager,
|
||||
private readonly EventDispatcherInterface $eventDispatcher,
|
||||
private readonly TokenStorageInterface $tokenStorage,
|
||||
) {}
|
||||
|
||||
/**
|
||||
* change temp basketitem
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
#[Tag(name: 'Basket')]
|
||||
#[Response(
|
||||
response: 200,
|
||||
description: 'basket',
|
||||
content: new JsonContent(ref: new Model(type: Output::class))
|
||||
)]
|
||||
#[RequestBody(
|
||||
description: 'This is a request body',
|
||||
content: new Model(type: Input::class)
|
||||
)]
|
||||
#[Route(path: '/layouter/save', methods: ['POST'])]
|
||||
public function save(#[MapRequestPayload] Input $data): JsonResponse
|
||||
{
|
||||
include_once __DIR__ . '/../../../../EntityBundle/Lagacy/TP_Basket_Item.php';
|
||||
include_once __DIR__ . '/../../../../EntityBundle/Lagacy/TP_Basket_Collection.php';
|
||||
include_once __DIR__ . '/../../../../EntityBundle/Lagacy/TP_Util.php';
|
||||
}
|
||||
}
|
||||
14
src/new/src/PSC/Shop/BasketBundle/Dto/Layouter/Input.php
Normal file
14
src/new/src/PSC/Shop/BasketBundle/Dto/Layouter/Input.php
Normal file
@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace PSC\Shop\BasketBundle\Dto\Layouter;
|
||||
|
||||
use OpenApi\Attributes\Property;
|
||||
|
||||
class Input
|
||||
{
|
||||
#[Property(type: 'string')]
|
||||
public string $productUUId = '';
|
||||
|
||||
#[Property(type: 'string')]
|
||||
public string $layouterUUId = '';
|
||||
}
|
||||
@ -2,70 +2,44 @@
|
||||
|
||||
namespace PSC\Shop\BasketBundle\Dto\Legacy;
|
||||
|
||||
use Nelmio\ApiDocBundle\Annotation\Model;
|
||||
use OpenApi\Annotations as OA;
|
||||
use OpenApi\Attributes\Property;
|
||||
|
||||
class Input
|
||||
{
|
||||
/**
|
||||
* @OA\Property(type="integer")
|
||||
*/
|
||||
#[Property(type: 'integer')]
|
||||
public int $count = 1;
|
||||
|
||||
/**
|
||||
* @OA\Property(type="string")
|
||||
*/
|
||||
#[Property(type: 'string')]
|
||||
public string $productUUId = "";
|
||||
|
||||
/**
|
||||
* @OA\Property(type="string")
|
||||
*/
|
||||
#[Property(type: 'string')]
|
||||
public string $uploadMode = "none";
|
||||
|
||||
/**
|
||||
* @OA\Property(type="string")
|
||||
*/
|
||||
#[Property(type: 'string')]
|
||||
public string $deliveryDate = "";
|
||||
|
||||
/**
|
||||
* @OA\Property(type="string")
|
||||
*/
|
||||
#[Property(type: 'string')]
|
||||
public string $basketField1 = "";
|
||||
|
||||
/**
|
||||
* @OA\Property(type="string")
|
||||
*/
|
||||
#[Property(type: 'string')]
|
||||
public string $basketField2 = "";
|
||||
|
||||
|
||||
/**
|
||||
* @OA\Property(type="string")
|
||||
*/
|
||||
#[Property(type: 'string')]
|
||||
public string $deliveryInfo = "";
|
||||
|
||||
/**
|
||||
* @OA\Property(type="string")
|
||||
*/
|
||||
#[Property(type: 'string')]
|
||||
public string $xmlProduct = "";
|
||||
|
||||
/**
|
||||
* @OA\Property(type="bool")
|
||||
*/
|
||||
#[Property(type: 'bool')]
|
||||
public bool $dispatchNoEvents = false;
|
||||
|
||||
/**
|
||||
* @OA\Property(type="bool")
|
||||
*/
|
||||
#[Property(type: 'bool')]
|
||||
public bool $clearTempItem = true;
|
||||
|
||||
/**
|
||||
* @OA\Property(type="string")
|
||||
*/
|
||||
#[Property(type: 'string')]
|
||||
public string $ref = "";
|
||||
|
||||
/**
|
||||
* @OA\Property(type="string")
|
||||
*/
|
||||
#[Property(type: 'string')]
|
||||
public string $layouterUuid = "";
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user