restored content
This commit is contained in:
parent
27be2c79dd
commit
24192495cf
@ -14,6 +14,7 @@ $apiNamespace = $argv[2];
|
|||||||
$apiName = $argv[3];
|
$apiName = $argv[3];
|
||||||
$cqrsType = strtolower($argv[4]) === 'true' ? 'Command' : 'Query';
|
$cqrsType = strtolower($argv[4]) === 'true' ? 'Command' : 'Query';
|
||||||
$cqrsNamespace = $argv[5];
|
$cqrsNamespace = $argv[5];
|
||||||
|
$originalCqrsNamespace = $cqrsNamespace;
|
||||||
|
|
||||||
$apiDirectoryPath = $projectSourceDirectory . 'ApiDomain/' . $apiType . '/' . $apiNamespace . '/';
|
$apiDirectoryPath = $projectSourceDirectory . 'ApiDomain/' . $apiType . '/' . $apiNamespace . '/';
|
||||||
$cqrsDirectoryPath = $projectSourceDirectory . 'HandlingDomain/' . $cqrsNamespace . '/';
|
$cqrsDirectoryPath = $projectSourceDirectory . 'HandlingDomain/' . $cqrsNamespace . '/';
|
||||||
@ -164,7 +165,7 @@ return [
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace MyTube\Handling\{$cqrsNamespace};
|
namespace MyTube\Handling\{$originalCqrsNamespace};
|
||||||
|
|
||||||
class ConfigProvider
|
class ConfigProvider
|
||||||
{
|
{
|
||||||
|
|||||||
16
src/ApiDomain/External/TagList/config/routes.php
vendored
16
src/ApiDomain/External/TagList/config/routes.php
vendored
@ -1,16 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
use MyTube\API\External\TagList\Handler\ReadListHandler;
|
|
||||||
|
|
||||||
return [
|
|
||||||
[
|
|
||||||
'name' => 'TODO.TODO',
|
|
||||||
'path' => '/api/TODO/TODO[/]',
|
|
||||||
'allowed_methods' => ['POST'],
|
|
||||||
'middleware' => [
|
|
||||||
ReadListHandler::class,
|
|
||||||
],
|
|
||||||
],
|
|
||||||
];
|
|
||||||
@ -1,17 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
use MyTube\API\External\TagList\Handler\ReadListHandler;
|
|
||||||
use MyTube\API\External\TagList\ResponseFormatter\ReadListResponseFormatter;
|
|
||||||
use Reinfi\DependencyInjection\Factory\AutoWiringFactory;
|
|
||||||
|
|
||||||
return [
|
|
||||||
'factories' => [
|
|
||||||
// Handler
|
|
||||||
ReadListHandler::class => AutoWiringFactory::class,
|
|
||||||
|
|
||||||
// Response Formatter
|
|
||||||
::class => AutoWiringFactory::class,
|
|
||||||
],
|
|
||||||
];
|
|
||||||
@ -1,16 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace MyTube\API\{External}\{TagList};
|
|
||||||
|
|
||||||
class ConfigProvider
|
|
||||||
{
|
|
||||||
public function __invoke(): array
|
|
||||||
{
|
|
||||||
return [
|
|
||||||
'dependencies' => require __DIR__ . './../config/service_manager.php',
|
|
||||||
'routes' => require __DIR__ . '/./../config/routes.php',
|
|
||||||
];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,38 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace MyTube\API\External\TagList\Handler;
|
|
||||||
|
|
||||||
use MyTube\Handling\TagList\Handler\Query\ReadList\ReadListQueryHandler;
|
|
||||||
use MyTube\Handling\TagList\Handler\Query\ReadList\ReadListQueryBuilder;
|
|
||||||
use MyTube\API\External\TagList\ResponseFormatter\ReadListResponseFormatter;
|
|
||||||
use Psr\Http\Message\ResponseInterface;
|
|
||||||
use Psr\Http\Message\ServerRequestInterface;
|
|
||||||
use Psr\Http\Server\RequestHandlerInterface;
|
|
||||||
use MyTube\Infrastructure\Response\SuccessResponse;
|
|
||||||
|
|
||||||
class ReadListHandler implements RequestHandlerInterface
|
|
||||||
{
|
|
||||||
public function __construct(
|
|
||||||
private readonly ReadListQueryHandler $readListQueryHandler,
|
|
||||||
private readonly ReadListQueryBuilder $readListQueryBuilder,
|
|
||||||
private readonly ReadListResponseFormatter $responseFormatter,
|
|
||||||
) {
|
|
||||||
}
|
|
||||||
|
|
||||||
public function handle(ServerRequestInterface $request): ResponseInterface
|
|
||||||
{
|
|
||||||
$data = json_decode(
|
|
||||||
$request->getBody()->getContents(),
|
|
||||||
true
|
|
||||||
);
|
|
||||||
|
|
||||||
$readListQuery = $this->readListQueryBuilder->build(
|
|
||||||
$data
|
|
||||||
);
|
|
||||||
$result = $this->readListQueryHandler->execute($readListQuery);
|
|
||||||
|
|
||||||
return new SuccessResponse($this->responseFormatter->format($result));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,15 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace MyTube\API\External\TagList\ResponseFormatter;
|
|
||||||
|
|
||||||
use MyTube\Handling\TagList\Handler\Query\ReadList\ReadListQueryResult;
|
|
||||||
|
|
||||||
class ReadListResponseFormatter
|
|
||||||
{
|
|
||||||
public function format(ReadListQueryResult $readListQueryResult): array
|
|
||||||
{
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,17 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
use MyTube\Handling\TagList\Handler\Query\ReadList\ReadListQueryHandler;
|
|
||||||
use MyTube\Handling\TagList\Handler\Query\ReadList\ReadListQueryBuilder;
|
|
||||||
use Reinfi\DependencyInjection\Factory\AutoWiringFactory;
|
|
||||||
use Reinfi\DependencyInjection\Factory\InjectionFactory;
|
|
||||||
|
|
||||||
return [
|
|
||||||
'factories' => [
|
|
||||||
/// CQRS
|
|
||||||
// ReadList
|
|
||||||
ReadListQueryBuilder::class => AutoWiringFactory::class,
|
|
||||||
ReadListQueryHandler::class => AutoWiringFactory::class,
|
|
||||||
],
|
|
||||||
];
|
|
||||||
@ -1,15 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace MyTube\Handling\{MyTube\Handling\TagList\Handler\Query\ReadList};
|
|
||||||
|
|
||||||
class ConfigProvider
|
|
||||||
{
|
|
||||||
public function __invoke(): array
|
|
||||||
{
|
|
||||||
return [
|
|
||||||
'dependencies' => require __DIR__ . './../config/service_manager.php',
|
|
||||||
];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,13 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace MyTube\Handling\TagList\Handler\Query\ReadList;
|
|
||||||
|
|
||||||
class ReadListQuery
|
|
||||||
{
|
|
||||||
public function __construct(
|
|
||||||
#TODO
|
|
||||||
) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,16 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace MyTube\Handling\TagList\Handler\Query\ReadList;
|
|
||||||
|
|
||||||
class ReadListQueryBuilder
|
|
||||||
{
|
|
||||||
public function build(
|
|
||||||
#TODO
|
|
||||||
): ReadListQuery {
|
|
||||||
return new ReadListQuery(
|
|
||||||
#TODO
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,18 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace MyTube\Handling\TagList\Handler\Query\ReadList;
|
|
||||||
|
|
||||||
class ReadListQueryHandler
|
|
||||||
{
|
|
||||||
public function __construct(
|
|
||||||
#TODO
|
|
||||||
) {
|
|
||||||
}
|
|
||||||
|
|
||||||
public function execute(ReadListQuery $readListQuery): ReadListQueryResult
|
|
||||||
{
|
|
||||||
return new ReadListQueryResult();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,13 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace MyTube\Handling\TagList\Handler\Query\ReadList;
|
|
||||||
|
|
||||||
class ReadListQueryResult
|
|
||||||
{
|
|
||||||
public function __construct(
|
|
||||||
#TODO
|
|
||||||
) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
Reference in New Issue
Block a user