src/Controller/Api/DataController.php line 47

Open in your IDE?
  1. <?php
  2. namespace App\Controller\Api;
  3. use App\Services\Core\Core;
  4. use Sensio\Bundle\FrameworkExtraBundle\Configuration\Cache;
  5. use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted;
  6. use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
  7. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  8. use Symfony\Component\EventDispatcher\EventDispatcherInterface;
  9. use Symfony\Component\HttpFoundation\Request;
  10. use Symfony\Component\HttpFoundation\Response;
  11. use Symfony\Component\Routing\Annotation\Route;
  12. use Symfony\Component\HttpFoundation\JsonResponse;
  13. class DataController extends AbstractController
  14. {
  15.     public function test(Request $request)
  16.     {
  17.         $data = [
  18.             [
  19.                 'id' => '1',
  20.                 'title' => 'Inscriptions',
  21.                 'number' => 1836,
  22.             ],
  23.             [
  24.                 'id' =>'2',
  25.                 'title' => 'Leads',
  26.                 'number' => 10,
  27.             ],
  28.             [
  29.                 'id' => '3',
  30.                 'title' => 'Factures',
  31.                 'number' => 42,
  32.             ],
  33.             [
  34.                 'id' => '4',
  35.                 'title' => 'Devis',
  36.                 'number' => 0,
  37.             ]
  38.         ];
  39.         return new JsonResponse($data);
  40.     }
  41.     public function widgetmac(Request $request)
  42.     {
  43.         return new JsonResponse([
  44.             'total_inscriptions' => 1200,
  45.             'total_candidates' => 1000,
  46.             'total_recruiters' => 200,
  47.             'new_candidates' => 10,
  48.             'new_recruiters' => 10,
  49.             'recruiter_verifications' => 0,
  50.         ]);
  51.     }
  52. }