feat: add domain register endpoint

This commit is contained in:
Maël Gangloff
2024-07-17 18:18:11 +02:00
parent 29253a47aa
commit 358cad6c21
4 changed files with 63 additions and 15 deletions

View File

@@ -0,0 +1,19 @@
<?php
namespace App\Controller;
use App\Service\RDAPService;
use Exception;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
class DomainRefreshController extends AbstractController
{
/**
* @throws Exception
*/
public function __invoke(string $ldhName, RDAPService $RDAPService): void
{
$RDAPService->registerDomains([$ldhName]);
}
}

View File

@@ -28,24 +28,12 @@ class TestController extends AbstractController
{
public function __construct(
private readonly RDAPService $RDAPService,
private readonly DomainRepository $domainRepository
)
{
}
#[Route(path: '/test/register', name: 'test_register_domain')]
public function testRegisterDomain(Request $request): Response
{
try {
$this->RDAPService->registerDomains(explode(',', $request->query->get('domains')));
} catch (Exception $e) {
return new Response($e->getMessage(), Response::HTTP_INTERNAL_SERVER_ERROR);
}
return new Response();
}
#[Route(path: '/test/publish/calendar', name: 'test_publish_calendar')]
public function testPublishCalendar(): Response
{