diff --git a/src/ApiDomain/External/Video/config/routes.php b/src/ApiDomain/External/Video/config/routes.php new file mode 100644 index 0000000..7b3cc22 --- /dev/null +++ b/src/ApiDomain/External/Video/config/routes.php @@ -0,0 +1,16 @@ + 'health', + 'path' => '/api/health', + 'allowed_methods' => ['GET'], + 'middleware' => [ + HealthHandler::class + ], + ], +]; + +?> \ No newline at end of file diff --git a/src/ApiDomain/External/Video/config/service_manager.php b/src/ApiDomain/External/Video/config/service_manager.php new file mode 100644 index 0000000..6a17420 --- /dev/null +++ b/src/ApiDomain/External/Video/config/service_manager.php @@ -0,0 +1,12 @@ + [ + HealthHandler::class => AutoWiringFactory::class + ], +] + +?> \ No newline at end of file diff --git a/src/ApiDomain/External/Video/src/ConfigProvider.php b/src/ApiDomain/External/Video/src/ConfigProvider.php new file mode 100644 index 0000000..d4d3beb --- /dev/null +++ b/src/ApiDomain/External/Video/src/ConfigProvider.php @@ -0,0 +1,16 @@ + require __DIR__ . './../config/service_manager.php', + 'routes' => require __DIR__ . '/./../config/routes.php', + ]; + } +} diff --git a/src/DataDomain/Business/src/Entity/Video.php b/src/DataDomain/Business/src/Entity/Video.php new file mode 100644 index 0000000..8b759dc --- /dev/null +++ b/src/DataDomain/Business/src/Entity/Video.php @@ -0,0 +1,66 @@ +id = UuidGenerator::generate(); + + $now = new DateTime(); + $this->setCreatedAt($now); + } + + + public function getId(): UuidInterface { + return $this->id; + } + + public function getUsername(): string { + return $this->username; + } + + public function setUsername(string $username): void { + $this->username = $username; + } + + public function getMail(): ?string { + return $this->mail; + } + + public function setMail(?string $mail): void { + $this->mail = $mail; + } + + public function getCreatedAt(): DateTime { + return $this->createdAt; + } + + public function setCreatedAt(DateTime $createdAt): void { + $this->createdAt = $createdAt; + } +} diff --git a/src/DataDomain/Business/src/Repository/VideoRepository.php b/src/DataDomain/Business/src/Repository/VideoRepository.php new file mode 100644 index 0000000..737519a --- /dev/null +++ b/src/DataDomain/Business/src/Repository/VideoRepository.php @@ -0,0 +1,24 @@ +createQueryBuilder('r'); + $queryBuilder->where( + $queryBuilder->expr()->orX( + $queryBuilder->expr()->eq('r.username', ':identifier'), + $queryBuilder->expr()->eq('r.mail', ':identifier') + ) + ) + ->setParameter('identifier', $identifier); + $query = $queryBuilder->getQuery(); + + /** @var ?Registration $registration */ + $registration = $query->execute()[0] ?? null; + return $registration; + } +} \ No newline at end of file diff --git a/src/HandlingDomain/Video/config/service_manager.php b/src/HandlingDomain/Video/config/service_manager.php new file mode 100644 index 0000000..fb94f93 --- /dev/null +++ b/src/HandlingDomain/Video/config/service_manager.php @@ -0,0 +1,31 @@ + [ + + /// Rule + UserPasswordMatchesRule::class => AutoWiringFactory::class, + + /// Builder + UserSessionBuilder::class => AutoWiringFactory::class, + + /// CQRS + // Login User + LoginUserCommandHandler::class => InjectionFactory::class, + LoginUserCommandBuilder::class => AutoWiringFactory::class, + + // Logout User + LogoutUserCommandHandler::class => InjectionFactory::class, + LogoutUserCommandBuilder::class => AutoWiringFactory::class, + ], +]; diff --git a/src/HandlingDomain/Video/src/ConfigProvider.php b/src/HandlingDomain/Video/src/ConfigProvider.php new file mode 100644 index 0000000..92ee2eb --- /dev/null +++ b/src/HandlingDomain/Video/src/ConfigProvider.php @@ -0,0 +1,15 @@ + require __DIR__ . '/./../config/service_manager.php', + ]; + } +}