now second commit i guess
This commit is contained in:
parent
5244e9b6e6
commit
fa5375e04d
@ -20,7 +20,7 @@
|
|||||||
"laminas\/laminas-mail": "^2.23",
|
"laminas\/laminas-mail": "^2.23",
|
||||||
"teewurst\/pipeline": "^3.0",
|
"teewurst\/pipeline": "^3.0",
|
||||||
"guzzlehttp\/guzzle": "^7.8",
|
"guzzlehttp\/guzzle": "^7.8",
|
||||||
"micilini\/video-stream": "*"
|
"micilini\/video-stream": "^1.0"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
@ -28,13 +28,16 @@
|
|||||||
"MyTube\\API\\External\\Authentication\\": "src\/ApiDomain\/External\/Authentication\/src",
|
"MyTube\\API\\External\\Authentication\\": "src\/ApiDomain\/External\/Authentication\/src",
|
||||||
"MyTube\\API\\External\\Health\\": "src\/ApiDomain\/External\/Health\/src",
|
"MyTube\\API\\External\\Health\\": "src\/ApiDomain\/External\/Health\/src",
|
||||||
"MyTube\\API\\External\\User\\": "src\/ApiDomain\/External\/User\/src",
|
"MyTube\\API\\External\\User\\": "src\/ApiDomain\/External\/User\/src",
|
||||||
|
"MyTube\\API\\External\\Video\\": "src\/ApiDomain\/External\/Video\/src",
|
||||||
|
"MyTube\\API\\External\\VideoList\\": "src\/ApiDomain\/External\/VideoList\/src",
|
||||||
"MyTube\\Data\\Business\\": "src\/DataDomain\/Business\/src",
|
"MyTube\\Data\\Business\\": "src\/DataDomain\/Business\/src",
|
||||||
"MyTube\\Data\\Log\\": "src\/DataDomain\/Log\/src",
|
"MyTube\\Data\\Log\\": "src\/DataDomain\/Log\/src",
|
||||||
"MyTube\\Handling\\Product\\": "src\/HandlingDomain\/Product\/src",
|
|
||||||
"MyTube\\Handling\\Registration\\": "src\/HandlingDomain\/Registration\/src",
|
"MyTube\\Handling\\Registration\\": "src\/HandlingDomain\/Registration\/src",
|
||||||
"MyTube\\Handling\\Role\\": "src\/HandlingDomain\/Role\/src",
|
"MyTube\\Handling\\Role\\": "src\/HandlingDomain\/Role\/src",
|
||||||
"MyTube\\Handling\\User\\": "src\/HandlingDomain\/User\/src",
|
"MyTube\\Handling\\User\\": "src\/HandlingDomain\/User\/src",
|
||||||
"MyTube\\Handling\\UserSession\\": "src\/HandlingDomain\/UserSession\/src",
|
"MyTube\\Handling\\UserSession\\": "src\/HandlingDomain\/UserSession\/src",
|
||||||
|
"MyTube\\Handling\\Video\\": "src\/HandlingDomain\/Video\/src",
|
||||||
|
"MyTube\\Handling\\VideoList\\": "src\/HandlingDomain\/VideoList\/src",
|
||||||
"MyTube\\Infrastructure\\Database\\": "src\/Infrastructure\/Database\/src",
|
"MyTube\\Infrastructure\\Database\\": "src\/Infrastructure\/Database\/src",
|
||||||
"MyTube\\Infrastructure\\DependencyInjection\\": "src\/Infrastructure\/DependencyInjection\/src",
|
"MyTube\\Infrastructure\\DependencyInjection\\": "src\/Infrastructure\/DependencyInjection\/src",
|
||||||
"MyTube\\Infrastructure\\Encryption\\": "src\/Infrastructure\/Encryption\/src",
|
"MyTube\\Infrastructure\\Encryption\\": "src\/Infrastructure\/Encryption\/src",
|
||||||
@ -68,22 +71,16 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dmg": "php bin\/doctrine-migrations.php migrations:generate --no-interaction",
|
"dmg": "php bin\/doctrine-migrations.php migrations:generate",
|
||||||
"dmm": "php bin\/doctrine-migrations.php migrations:migrate --no-interaction",
|
"dmm": "php bin\/doctrine-migrations.php migrations:migrate --no-interaction",
|
||||||
"dmlg": "php bin\/doctrine-migrations-log.php migrations:generate --no-interaction",
|
"dmlg": "php bin\/doctrine-migrations-log.php migrations:generate",
|
||||||
"dmlm": "php bin\/doctrine-migrations-log.php migrations:migrate --no-interaction",
|
"dmlm": "php bin\/doctrine-migrations-log.php migrations:migrate --no-interaction",
|
||||||
"console": "php bin\/console.php",
|
"console": "php bin\/console.php",
|
||||||
"serve": "php -S 0.0.0.0:8080 -t public\/",
|
"createApi": "php bin\/createApi.php",
|
||||||
"unserve": "killall -9 php",
|
"createPipeline": "php bin\/createPipeline.php",
|
||||||
"da": [
|
"da": [
|
||||||
"composer dump-autoload",
|
"composer dump-autoload",
|
||||||
"composer dump-autoload --dev"
|
"composer dump-autoload --dev"
|
||||||
],
|
|
||||||
"initdb": [
|
|
||||||
"@composer dmm",
|
|
||||||
"@composer dmlm",
|
|
||||||
"@composer console rbac:update",
|
|
||||||
"@composer console init:data"
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"config": {
|
"config": {
|
||||||
@ -99,13 +96,16 @@
|
|||||||
"MyTube\\API\\External\\Authentication\\": "src\/ApiDomain\/External\/Authentication\/src",
|
"MyTube\\API\\External\\Authentication\\": "src\/ApiDomain\/External\/Authentication\/src",
|
||||||
"MyTube\\API\\External\\Health\\": "src\/ApiDomain\/External\/Health\/src",
|
"MyTube\\API\\External\\Health\\": "src\/ApiDomain\/External\/Health\/src",
|
||||||
"MyTube\\API\\External\\User\\": "src\/ApiDomain\/External\/User\/src",
|
"MyTube\\API\\External\\User\\": "src\/ApiDomain\/External\/User\/src",
|
||||||
|
"MyTube\\API\\External\\Video\\": "src\/ApiDomain\/External\/Video\/src",
|
||||||
|
"MyTube\\API\\External\\VideoList\\": "src\/ApiDomain\/External\/VideoList\/src",
|
||||||
"MyTube\\Data\\Business\\": "src\/DataDomain\/Business\/src",
|
"MyTube\\Data\\Business\\": "src\/DataDomain\/Business\/src",
|
||||||
"MyTube\\Data\\Log\\": "src\/DataDomain\/Log\/src",
|
"MyTube\\Data\\Log\\": "src\/DataDomain\/Log\/src",
|
||||||
"MyTube\\Handling\\Product\\": "src\/HandlingDomain\/Product\/src",
|
|
||||||
"MyTube\\Handling\\Registration\\": "src\/HandlingDomain\/Registration\/src",
|
"MyTube\\Handling\\Registration\\": "src\/HandlingDomain\/Registration\/src",
|
||||||
"MyTube\\Handling\\Role\\": "src\/HandlingDomain\/Role\/src",
|
"MyTube\\Handling\\Role\\": "src\/HandlingDomain\/Role\/src",
|
||||||
"MyTube\\Handling\\User\\": "src\/HandlingDomain\/User\/src",
|
"MyTube\\Handling\\User\\": "src\/HandlingDomain\/User\/src",
|
||||||
"MyTube\\Handling\\UserSession\\": "src\/HandlingDomain\/UserSession\/src",
|
"MyTube\\Handling\\UserSession\\": "src\/HandlingDomain\/UserSession\/src",
|
||||||
|
"MyTube\\Handling\\Video\\": "src\/HandlingDomain\/Video\/src",
|
||||||
|
"MyTube\\Handling\\VideoList\\": "src\/HandlingDomain\/VideoList\/src",
|
||||||
"MyTube\\Infrastructure\\Database\\": "src\/Infrastructure\/Database\/src",
|
"MyTube\\Infrastructure\\Database\\": "src\/Infrastructure\/Database\/src",
|
||||||
"MyTube\\Infrastructure\\DependencyInjection\\": "src\/Infrastructure\/DependencyInjection\/src",
|
"MyTube\\Infrastructure\\DependencyInjection\\": "src\/Infrastructure\/DependencyInjection\/src",
|
||||||
"MyTube\\Infrastructure\\Encryption\\": "src\/Infrastructure\/Encryption\/src",
|
"MyTube\\Infrastructure\\Encryption\\": "src\/Infrastructure\/Encryption\/src",
|
||||||
|
|||||||
@ -48,22 +48,16 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dmg": "php bin/doctrine-migrations.php migrations:generate --no-interaction",
|
"dmg": "php bin/doctrine-migrations.php migrations:generate",
|
||||||
"dmm": "php bin/doctrine-migrations.php migrations:migrate --no-interaction",
|
"dmm": "php bin/doctrine-migrations.php migrations:migrate --no-interaction",
|
||||||
"dmlg": "php bin/doctrine-migrations-log.php migrations:generate --no-interaction",
|
"dmlg": "php bin/doctrine-migrations-log.php migrations:generate",
|
||||||
"dmlm": "php bin/doctrine-migrations-log.php migrations:migrate --no-interaction",
|
"dmlm": "php bin/doctrine-migrations-log.php migrations:migrate --no-interaction",
|
||||||
"console": "php bin/console.php",
|
"console": "php bin/console.php",
|
||||||
"serve": "php -S 0.0.0.0:8080 -t public/",
|
"createApi": "php bin/createApi.php",
|
||||||
"unserve": "killall -9 php",
|
"createPipeline": "php bin/createPipeline.php",
|
||||||
"da": [
|
"da": [
|
||||||
"composer dump-autoload",
|
"composer dump-autoload",
|
||||||
"composer dump-autoload --dev"
|
"composer dump-autoload --dev"
|
||||||
],
|
|
||||||
"initdb": [
|
|
||||||
"@composer dmm",
|
|
||||||
"@composer dmlm",
|
|
||||||
"@composer console rbac:update",
|
|
||||||
"@composer console init:data"
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"config": {
|
"config": {
|
||||||
|
|||||||
@ -57,6 +57,7 @@ $aggregator = new ConfigAggregator([
|
|||||||
\MyTube\Handling\User\ConfigProvider::class,
|
\MyTube\Handling\User\ConfigProvider::class,
|
||||||
\MyTube\Handling\UserSession\ConfigProvider::class,
|
\MyTube\Handling\UserSession\ConfigProvider::class,
|
||||||
\MyTube\Handling\Registration\ConfigProvider::class,
|
\MyTube\Handling\Registration\ConfigProvider::class,
|
||||||
|
\MyTube\Handling\Video\ConfigProvider::class,
|
||||||
|
|
||||||
// API
|
// API
|
||||||
/// Command
|
/// Command
|
||||||
@ -66,6 +67,7 @@ $aggregator = new ConfigAggregator([
|
|||||||
\MyTube\API\External\Health\ConfigProvider::class,
|
\MyTube\API\External\Health\ConfigProvider::class,
|
||||||
\MyTube\API\External\User\ConfigProvider::class,
|
\MyTube\API\External\User\ConfigProvider::class,
|
||||||
\MyTube\API\External\Authentication\ConfigProvider::class,
|
\MyTube\API\External\Authentication\ConfigProvider::class,
|
||||||
|
\MyTube\API\External\Video\ConfigProvider::class,
|
||||||
|
|
||||||
/// Internal
|
/// Internal
|
||||||
|
|
||||||
|
|||||||
@ -18,7 +18,6 @@ final class Version20230922085011 extends AbstractMigration
|
|||||||
{
|
{
|
||||||
$sql = "CREATE TABLE role (
|
$sql = "CREATE TABLE role (
|
||||||
id binary(16) NOT NULL,
|
id binary(16) NOT NULL,
|
||||||
product_id binary(16) DEFAULT NULL,
|
|
||||||
identifier varchar(255) UNIQUE NOT NULL,
|
identifier varchar(255) UNIQUE NOT NULL,
|
||||||
PRIMARY KEY (id)
|
PRIMARY KEY (id)
|
||||||
);";
|
);";
|
||||||
|
|||||||
@ -21,7 +21,6 @@ final class Version20230922092351 extends AbstractMigration
|
|||||||
{
|
{
|
||||||
$sql = "CREATE TABLE permission (
|
$sql = "CREATE TABLE permission (
|
||||||
id binary(16) NOT NULL,
|
id binary(16) NOT NULL,
|
||||||
product_id binary(16) DEFAULT NULL,
|
|
||||||
identifier varchar(255) UNIQUE NOT NULL,
|
identifier varchar(255) UNIQUE NOT NULL,
|
||||||
PRIMARY KEY (id)
|
PRIMARY KEY (id)
|
||||||
);";
|
);";
|
||||||
|
|||||||
38
data/migrations/myTube/Version20240214194156.php
Normal file
38
data/migrations/myTube/Version20240214194156.php
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace MyTube\Migrations\MyTube;
|
||||||
|
|
||||||
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
|
use Doctrine\Migrations\AbstractMigration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Auto-generated Migration: Please modify to your needs!
|
||||||
|
*/
|
||||||
|
final class Version20240214194156 extends AbstractMigration
|
||||||
|
{
|
||||||
|
public function getDescription(): string
|
||||||
|
{
|
||||||
|
return "Create Table 'video'";
|
||||||
|
}
|
||||||
|
|
||||||
|
public function up(Schema $schema): void
|
||||||
|
{
|
||||||
|
$sql = "CREATE TABLE video (
|
||||||
|
id binary(16) NOT NULL,
|
||||||
|
title varchar(255) NOT NULL,
|
||||||
|
file_path varchar(255) NOT NULL,
|
||||||
|
created_at datetime NOT NULL,
|
||||||
|
updated_at datetime NOT NULL,
|
||||||
|
PRIMARY KEY (id)
|
||||||
|
);";
|
||||||
|
|
||||||
|
$this->addSql($sql);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down(Schema $schema): void
|
||||||
|
{
|
||||||
|
$this->addSql("DROP TABLE video;");
|
||||||
|
}
|
||||||
|
}
|
||||||
18
src/ApiDomain/External/Video/config/routes.php
vendored
18
src/ApiDomain/External/Video/config/routes.php
vendored
@ -1,16 +1,22 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use MyTube\API\External\Health\Handler\HealthHandler;
|
use MyTube\API\External\Video\Handler\StreamHandler;
|
||||||
|
|
||||||
return [
|
return [
|
||||||
[
|
[
|
||||||
'name' => 'health',
|
'name' => 'video.stream',
|
||||||
'path' => '/api/health',
|
'path' => '/api/video/stream[/]',
|
||||||
'allowed_methods' => ['GET'],
|
'allowed_methods' => ['GET'],
|
||||||
'middleware' => [
|
'middleware' => [
|
||||||
HealthHandler::class
|
StreamHandler::class
|
||||||
|
],
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'video.upload',
|
||||||
|
'path' => '/api/video/upload[/]',
|
||||||
|
'allowed_methods' => ['POST'],
|
||||||
|
'middleware' => [
|
||||||
|
StreamHandler::class
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
?>
|
|
||||||
@ -1,12 +1,10 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use MyTube\API\External\Health\Handler\HealthHandler;
|
use MyTube\API\External\Video\Handler\StreamHandler;
|
||||||
use Reinfi\DependencyInjection\Factory\AutoWiringFactory;
|
use Reinfi\DependencyInjection\Factory\AutoWiringFactory;
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'factories' => [
|
'factories' => [
|
||||||
HealthHandler::class => AutoWiringFactory::class
|
StreamHandler::class => AutoWiringFactory::class
|
||||||
],
|
],
|
||||||
]
|
];
|
||||||
|
|
||||||
?>
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace MyTube\API\External\Health;
|
namespace MyTube\API\External\Video;
|
||||||
|
|
||||||
class ConfigProvider
|
class ConfigProvider
|
||||||
{
|
{
|
||||||
|
|||||||
41
src/ApiDomain/External/Video/src/Handler/StreamHandler.php
vendored
Normal file
41
src/ApiDomain/External/Video/src/Handler/StreamHandler.php
vendored
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace MyTube\API\External\Video\Handler;
|
||||||
|
|
||||||
|
use Laminas\Diactoros\Response\JsonResponse;
|
||||||
|
use Laminas\Http\Response;
|
||||||
|
use Micilini\VideoStream\VideoStream;
|
||||||
|
use MyTube\Handling\Video\Handler\Query\Stream\StreamQueryBuilder;
|
||||||
|
use MyTube\Handling\Video\Handler\Query\Stream\StreamQueryHandler;
|
||||||
|
use Psr\Http\Message\ResponseInterface;
|
||||||
|
use Psr\Http\Message\ServerRequestInterface;
|
||||||
|
use Psr\Http\Server\RequestHandlerInterface;
|
||||||
|
|
||||||
|
class StreamHandler implements RequestHandlerInterface
|
||||||
|
{
|
||||||
|
public function __construct(
|
||||||
|
private readonly StreamQueryHandler $streamQueryHandler,
|
||||||
|
private readonly StreamQueryBuilder $streamQueryBuilder,
|
||||||
|
) {
|
||||||
|
}
|
||||||
|
|
||||||
|
public function handle(ServerRequestInterface $request): ResponseInterface
|
||||||
|
{
|
||||||
|
$videoPath = APP_ROOT . '/var/filestore/video.mp4';
|
||||||
|
|
||||||
|
if (file_exists($videoPath)) {
|
||||||
|
$stream = new VideoStream();
|
||||||
|
return $stream->streamVideo(
|
||||||
|
$videoPath,
|
||||||
|
[
|
||||||
|
'is_localPath' => true,
|
||||||
|
'content_type' => 'video/mp4'
|
||||||
|
]
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
return new JsonResponse("Video not found", Response::STATUS_CODE_404);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
36
src/ApiDomain/External/VideoList/src/Handler/ReadListHandler.php
vendored
Normal file
36
src/ApiDomain/External/VideoList/src/Handler/ReadListHandler.php
vendored
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace MyTube\API\External\VideoList\Handler;
|
||||||
|
|
||||||
|
use MyTube\Handling\VideoList\Handler\Query\ReadList\ReadListQueryHandler;
|
||||||
|
use MyTube\Handling\VideoList\Handler\Query\ReadList\ReadListQueryBuilder;
|
||||||
|
use Psr\Http\Message\ResponseInterface;
|
||||||
|
use Psr\Http\Message\ServerRequestInterface;
|
||||||
|
use Psr\Http\Server\RequestHandlerInterface;
|
||||||
|
use Bee\Infrastructure\Response\SuccessResponse;
|
||||||
|
|
||||||
|
class ReadListHandler implements RequestHandlerInterface
|
||||||
|
{
|
||||||
|
public function __construct(
|
||||||
|
private readonly ReadListQueryHandler $readListQueryHandler,
|
||||||
|
private readonly ReadListQueryBuilder $readListQueryBuilder,
|
||||||
|
) {
|
||||||
|
}
|
||||||
|
|
||||||
|
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('OK');
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -19,15 +19,6 @@ class Permission {
|
|||||||
*/
|
*/
|
||||||
private UuidInterface $id;
|
private UuidInterface $id;
|
||||||
|
|
||||||
/** @ORM\Column(name="product_id", type="uuid_binary_ordered_time", nullable=true) */
|
|
||||||
private ?UuidInterface $productId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ORM\OneToOne(targetEntity="MyTube\Data\Business\Entity\Product")
|
|
||||||
* @ORM\JoinColumn(name="product_id", referencedColumnName="id", nullable=true)
|
|
||||||
*/
|
|
||||||
private ?Product $product;
|
|
||||||
|
|
||||||
/** @ORM\Column(name="identifier", type="string") */
|
/** @ORM\Column(name="identifier", type="string") */
|
||||||
private string $identifier;
|
private string $identifier;
|
||||||
|
|
||||||
@ -52,22 +43,6 @@ class Permission {
|
|||||||
return $this->id;
|
return $this->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getProductId(): ?UuidInterface {
|
|
||||||
return $this->productId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function setProductId(?UuidInterface $productId): void {
|
|
||||||
$this->productId = $productId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getProduct(): ?Product {
|
|
||||||
return $this->product;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function setProduct(?Product $product): void {
|
|
||||||
$this->product = $product;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getIdentifier(): string {
|
public function getIdentifier(): string {
|
||||||
return $this->identifier;
|
return $this->identifier;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -23,12 +23,6 @@ class Role {
|
|||||||
/** @ORM\Column(name="product_id", type="uuid_binary_ordered_time", nullable=true) */
|
/** @ORM\Column(name="product_id", type="uuid_binary_ordered_time", nullable=true) */
|
||||||
private ?UuidInterface $productId;
|
private ?UuidInterface $productId;
|
||||||
|
|
||||||
/**
|
|
||||||
* @ORM\OneToOne(targetEntity="MyTube\Data\Business\Entity\Product")
|
|
||||||
* @ORM\JoinColumn(name="product_id", referencedColumnName="id", nullable=true)
|
|
||||||
*/
|
|
||||||
private ?Product $product;
|
|
||||||
|
|
||||||
/** @ORM\Column(name="identifier", type="string") */
|
/** @ORM\Column(name="identifier", type="string") */
|
||||||
private string $identifier;
|
private string $identifier;
|
||||||
|
|
||||||
@ -53,22 +47,6 @@ class Role {
|
|||||||
return $this->id;
|
return $this->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getProductId(): ?UuidInterface {
|
|
||||||
return $this->productId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function setProductId(?UuidInterface $productId): void {
|
|
||||||
$this->productId = $productId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getProduct(): ?Product {
|
|
||||||
return $this->product;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function setProduct(?Product $product): void {
|
|
||||||
$this->product = $product;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getIdentifier(): string {
|
public function getIdentifier(): string {
|
||||||
return $this->identifier;
|
return $this->identifier;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,25 +8,28 @@ use MyTube\Infrastructure\UuidGenerator\UuidGenerator;
|
|||||||
use Ramsey\Uuid\UuidInterface;
|
use Ramsey\Uuid\UuidInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ORM\Entity(repositoryClass="MyTube\Data\Business\Repository\RegistrationRepository")
|
* @ORM\Entity(repositoryClass="MyTube\Data\Business\Repository\VideoRepository")
|
||||||
* @ORM\Table(name="registration")
|
* @ORM\Table(name="video")
|
||||||
*/
|
*/
|
||||||
class Registration {
|
class Video {
|
||||||
/**
|
/**
|
||||||
* @ORM\Id
|
* @ORM\Id
|
||||||
* @ORM\Column(name="id", type="uuid_binary_ordered_time")
|
* @ORM\Column(name="id", type="uuid_binary_ordered_time")
|
||||||
*/
|
*/
|
||||||
private UuidInterface $id;
|
private UuidInterface $id;
|
||||||
|
|
||||||
/** @ORM\Column(name="username", type="string") */
|
/** @ORM\Column(name="title", type="string") */
|
||||||
private string $username;
|
private string $title;
|
||||||
|
|
||||||
/** @ORM\Column(name="mail", type="string") */
|
/** @ORM\Column(name="file_path", type="string") */
|
||||||
private string $mail;
|
private string $filePath;
|
||||||
|
|
||||||
/** @ORM\Column(name="created_at", type="datetime") */
|
/** @ORM\Column(name="created_at", type="datetime") */
|
||||||
private DateTime $createdAt;
|
private DateTime $createdAt;
|
||||||
|
|
||||||
|
/** @ORM\Column(name="updated_at", type="datetime") */
|
||||||
|
private DateTime $updatedAt;
|
||||||
|
|
||||||
|
|
||||||
public function __construct() {
|
public function __construct() {
|
||||||
$this->id = UuidGenerator::generate();
|
$this->id = UuidGenerator::generate();
|
||||||
@ -40,20 +43,20 @@ class Registration {
|
|||||||
return $this->id;
|
return $this->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getUsername(): string {
|
public function getTitle(): string {
|
||||||
return $this->username;
|
return $this->title;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setUsername(string $username): void {
|
public function setTitle(string $title): void {
|
||||||
$this->username = $username;
|
$this->title = $title;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getMail(): ?string {
|
public function getFilePath(): ?string {
|
||||||
return $this->mail;
|
return $this->filePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setMail(?string $mail): void {
|
public function setFilePath(?string $filePath): void {
|
||||||
$this->mail = $mail;
|
$this->filePath = $filePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getCreatedAt(): DateTime {
|
public function getCreatedAt(): DateTime {
|
||||||
@ -63,4 +66,12 @@ class Registration {
|
|||||||
public function setCreatedAt(DateTime $createdAt): void {
|
public function setCreatedAt(DateTime $createdAt): void {
|
||||||
$this->createdAt = $createdAt;
|
$this->createdAt = $createdAt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getUpdatedAt(): DateTime {
|
||||||
|
return $this->updatedAt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setUpdatedAt(DateTime $updatedAt): void {
|
||||||
|
$this->updatedAt = $updatedAt;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,11 +2,15 @@
|
|||||||
|
|
||||||
namespace MyTube\Data\Business\Repository;
|
namespace MyTube\Data\Business\Repository;
|
||||||
|
|
||||||
|
use Doctrine\ORM\Tools\Pagination\Paginator;
|
||||||
use MyTube\Data\Business\Entity\Registration;
|
use MyTube\Data\Business\Entity\Registration;
|
||||||
use Doctrine\ORM\EntityRepository;
|
use Doctrine\ORM\EntityRepository;
|
||||||
|
|
||||||
class RegistrationRepository extends EntityRepository {
|
class VideoRepository extends EntityRepository {
|
||||||
public function findByIdentifier(string $identifier) : ?Registration {
|
public function findByFilter(
|
||||||
|
string $identifier
|
||||||
|
): Paginator
|
||||||
|
{
|
||||||
$queryBuilder = $this->createQueryBuilder('r');
|
$queryBuilder = $this->createQueryBuilder('r');
|
||||||
$queryBuilder->where(
|
$queryBuilder->where(
|
||||||
$queryBuilder->expr()->orX(
|
$queryBuilder->expr()->orX(
|
||||||
|
|||||||
@ -1,31 +1,16 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use MyTube\Handling\UserSession\Builder\UserSessionBuilder;
|
use MyTube\Handling\Video\Handler\Query\Stream\StreamQueryBuilder;
|
||||||
use MyTube\Handling\UserSession\Handler\Command\LoginUser\LoginUserCommandBuilder;
|
use MyTube\Handling\Video\Handler\Query\Stream\StreamQueryHandler;
|
||||||
use MyTube\Handling\UserSession\Handler\Command\LoginUser\LoginUserCommandHandler;
|
|
||||||
use MyTube\Handling\UserSession\Handler\Command\LogoutUser\LogoutUserCommandBuilder;
|
|
||||||
use MyTube\Handling\UserSession\Handler\Command\LogoutUser\LogoutUserCommandHandler;
|
|
||||||
use MyTube\Handling\UserSession\Rule\UserPasswordMatchesRule;
|
|
||||||
use Reinfi\DependencyInjection\Factory\AutoWiringFactory;
|
use Reinfi\DependencyInjection\Factory\AutoWiringFactory;
|
||||||
use Reinfi\DependencyInjection\Factory\InjectionFactory;
|
use Reinfi\DependencyInjection\Factory\InjectionFactory;
|
||||||
|
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'factories' => [
|
'factories' => [
|
||||||
|
|
||||||
/// Rule
|
|
||||||
UserPasswordMatchesRule::class => AutoWiringFactory::class,
|
|
||||||
|
|
||||||
/// Builder
|
|
||||||
UserSessionBuilder::class => AutoWiringFactory::class,
|
|
||||||
|
|
||||||
/// CQRS
|
/// CQRS
|
||||||
// Login User
|
// Stream Query
|
||||||
LoginUserCommandHandler::class => InjectionFactory::class,
|
StreamQueryHandler::class => InjectionFactory::class,
|
||||||
LoginUserCommandBuilder::class => AutoWiringFactory::class,
|
StreamQueryBuilder::class => AutoWiringFactory::class,
|
||||||
|
|
||||||
// Logout User
|
|
||||||
LogoutUserCommandHandler::class => InjectionFactory::class,
|
|
||||||
LogoutUserCommandBuilder::class => AutoWiringFactory::class,
|
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace MyTube\Handling\UserSession;
|
namespace MyTube\Handling\Video;
|
||||||
|
|
||||||
class ConfigProvider
|
class ConfigProvider
|
||||||
{
|
{
|
||||||
|
|||||||
@ -0,0 +1,15 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace MyTube\Handling\Video\Handler\Query\Stream;
|
||||||
|
|
||||||
|
class StreamQuery
|
||||||
|
{
|
||||||
|
public function __construct(
|
||||||
|
#TODO
|
||||||
|
) {
|
||||||
|
}
|
||||||
|
|
||||||
|
#TODO
|
||||||
|
}
|
||||||
@ -0,0 +1,16 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace MyTube\Handling\Video\Handler\Query\Stream;
|
||||||
|
|
||||||
|
class StreamQueryBuilder
|
||||||
|
{
|
||||||
|
public function build(
|
||||||
|
#TODO
|
||||||
|
): StreamQuery {
|
||||||
|
return new StreamQuery(
|
||||||
|
#TODO
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,17 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace MyTube\Handling\Video\Handler\Query\Stream;
|
||||||
|
|
||||||
|
class StreamQueryHandler
|
||||||
|
{
|
||||||
|
public function __construct(
|
||||||
|
#TODO
|
||||||
|
) {
|
||||||
|
}
|
||||||
|
|
||||||
|
public function execute(StreamQuery $streamQuery): void
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,15 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace MyTube\Handling\VideoList\Handler\Query\ReadList;
|
||||||
|
|
||||||
|
class ReadListQuery
|
||||||
|
{
|
||||||
|
public function __construct(
|
||||||
|
#TODO
|
||||||
|
) {
|
||||||
|
}
|
||||||
|
|
||||||
|
#TODO
|
||||||
|
}
|
||||||
@ -0,0 +1,16 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace MyTube\Handling\VideoList\Handler\Query\ReadList;
|
||||||
|
|
||||||
|
class ReadListQueryBuilder
|
||||||
|
{
|
||||||
|
public function build(
|
||||||
|
#TODO
|
||||||
|
): ReadListQuery {
|
||||||
|
return new ReadListQuery(
|
||||||
|
#TODO
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,17 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace MyTube\Handling\VideoList\Handler\Query\ReadList;
|
||||||
|
|
||||||
|
class ReadListQueryHandler
|
||||||
|
{
|
||||||
|
public function __construct(
|
||||||
|
#TODO
|
||||||
|
) {
|
||||||
|
}
|
||||||
|
|
||||||
|
public function execute(ReadListQuery $readListQuery): void
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user