dump-autoload
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
e5a411cb69
commit
7ee7ba1f0b
|
@ -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
|
||||||
|
|
|
@ -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')));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue