src/Controller/DefaultController.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\Controller;
  3. use App\DependencyInjection\Service\Data\LogsServiceDI;
  4. use FOS\RestBundle\Controller\AbstractFOSRestController;
  5. use FOS\RestBundle\Controller\Annotations as Rest;
  6. use FOS\RestBundle\Controller\Annotations\View;
  7. use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
  8. class DefaultController extends AbstractFOSRestController
  9. {
  10.     use LogsServiceDI;
  11.     #[Rest\Get('/', name: 'index')]
  12.     #[Template('index.html.twig')]
  13.     public function index(): array
  14.     {
  15.         return [];
  16.     }
  17.     #[Rest\Get('/.well-known/apple-developer-merchantid-domain-association.txt', name: 'apple_verify')]
  18.     #[Template('apple-developer-merchantid-domain-association.html.twig')]
  19.     public function appleVerify(): array
  20.     {
  21.         return [];
  22.     }
  23.     #[Rest\Get('/.well-known/apple-developer-merchantid-domain-association', name: 'apple_verifys')]
  24.     #[Template('apple-developer-merchantid-domain-association.html.twig')]
  25.     public function appleVerifys(): array
  26.     {
  27.         return [];
  28.     }
  29.     #[Rest\Post('/api/test-logs', name: 'api_test_logs')]
  30.     #[View(serializerGroups: ['client'])]
  31.     public function testLogs(): array
  32.     {
  33.         $this->logsService->addLog(__METHOD__, __LINE__, 'Test message', [
  34.             'cheie' => 'testtttt',
  35.         ]);
  36.         $this->logsService->addLog(__METHOD__, __LINE__, 'Test', [
  37.             'a' => 'a',
  38.         ]);
  39.         $this->logsService->addLog(__METHOD__, __LINE__, 'message', [
  40.             's' => 's',
  41.         ]);
  42.         return [
  43.             'message' => 'Test logs',
  44.         ];
  45.     }
  46. }