dump-autoload
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Sergio Álvarez 2022-01-11 13:27:16 +01:00
parent e5a411cb69
commit 7ee7ba1f0b
No known key found for this signature in database
GPG Key ID: 622780889DFDBDA5
2 changed files with 4 additions and 3 deletions

View File

@ -6,7 +6,7 @@ steps:
- name: backend - name: backend
image: composer:2.1.14 image: composer:2.1.14
commands: commands:
- cd backend && composer install - cd backend && composer install && composer dump-autoload --classmap-authoritative
- name: frontend - name: frontend
image: node:16.13.1-alpine image: node:16.13.1-alpine

View File

@ -7,6 +7,7 @@ namespace App\Controller;
use App\Entity\PregDTO; use App\Entity\PregDTO;
use App\Service\Preg; use App\Service\Preg;
use Exception; use Exception;
use Redis;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
@ -24,7 +25,7 @@ class PregController extends AbstractController
private const STORE_TTL = 60*60*24*7; private const STORE_TTL = 60*60*24*7;
#[Route('/api/preg', name: 'api_preg_post', methods: ["POST"])] #[Route('/api/preg', name: 'api_preg_post', methods: ["POST"])]
public function index(Request $request, SerializerInterface $serializer, \Redis $redis): Response public function index(Request $request, SerializerInterface $serializer, Redis $redis): Response
{ {
$dto = $serializer->deserialize($request->getContent(), PregDTO::class, 'json'); $dto = $serializer->deserialize($request->getContent(), PregDTO::class, 'json');
@ -42,7 +43,7 @@ class PregController extends AbstractController
} }
#[Route('/api/preg', name: 'api_preg_hash', methods: ["GET"])] #[Route('/api/preg', name: 'api_preg_hash', methods: ["GET"])]
public function hash(Request $request, \Redis $redis): Response public function hash(Request $request, Redis $redis): Response
{ {
$json = $redis->get(sprintf(self::STORE_KEY, $request->query->get('hash'))); $json = $redis->get(sprintf(self::STORE_KEY, $request->query->get('hash')));