<?php
namespace App\Controller;
use App\DependencyInjection\Service\Data\LogsServiceDI;
use FOS\RestBundle\Controller\AbstractFOSRestController;
use FOS\RestBundle\Controller\Annotations as Rest;
use FOS\RestBundle\Controller\Annotations\View;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
class DefaultController extends AbstractFOSRestController
{
use LogsServiceDI;
#[Rest\Get('/', name: 'index')]
#[Template('index.html.twig')]
public function index(): array
{
return [];
}
#[Rest\Get('/.well-known/apple-developer-merchantid-domain-association.txt', name: 'apple_verify')]
#[Template('apple-developer-merchantid-domain-association.html.twig')]
public function appleVerify(): array
{
return [];
}
#[Rest\Get('/.well-known/apple-developer-merchantid-domain-association', name: 'apple_verifys')]
#[Template('apple-developer-merchantid-domain-association.html.twig')]
public function appleVerifys(): array
{
return [];
}
#[Rest\Post('/api/test-logs', name: 'api_test_logs')]
#[View(serializerGroups: ['client'])]
public function testLogs(): array
{
$this->logsService->addLog(__METHOD__, __LINE__, 'Test message', [
'cheie' => 'testtttt',
]);
$this->logsService->addLog(__METHOD__, __LINE__, 'Test', [
'a' => 'a',
]);
$this->logsService->addLog(__METHOD__, __LINE__, 'message', [
's' => 's',
]);
return [
'message' => 'Test logs',
];
}
}