src/Controller/HelloWorld.php line 48

Open in your IDE?
  1. <?php 
  2. // src/Controller/DefaultController.php
  3. namespace App\Controller;
  4. use Symfony\Component\Routing\Annotation\Route;
  5. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  6. use Symfony\Component\HttpFoundation\Request;
  7. use App\Utils\JWTEncoder;
  8. use App\Utils\Constantes;
  9. use App\Utils\Utils;
  10. use App\Utils\ExternalWallet;
  11. use App\Utils\ApiRequest;
  12. use Swagger\Annotations as SWG;
  13. use Symfony\Component\HttpFoundation\Response;
  14. use Symfony\Component\HttpFoundation\JsonResponse;
  15. /**
  16.  * @Route("/api/helloword")
  17.  */
  18. class HelloWorld extends AbstractController
  19. {
  20.     private $jwtFactory;
  21.     private $apiRequest;
  22.     private $em;
  23.     public function __construct(ApiRequest $apiRequest)
  24.     {
  25.         $this->jwtFactory JWTEncoder::getInstance();
  26.         $this->apiRequest $apiRequest;
  27.     }
  28.     
  29.     /**
  30.      * @Route("/", name="api_hello_word_index", methods={"GET"})
  31.      * @SWG\Response(
  32.      *     response=200,
  33.      *     description="Success",
  34.      * )
  35.      * 
  36.      * @SWG\Response(
  37.      *     response=404,
  38.      *     description="Resource not found"
  39.      * )
  40.      *  
  41.      * @SWG\Response(
  42.      *     response=400,
  43.      *     description="Invalid input"
  44.      * )
  45.      *
  46.      * @SWG\Tag(name="Hello World")
  47.      */
  48.     public function index(Request $request)
  49.     {
  50.         
  51.         // $ew = ExternalWallet::getInstance();
  52.         // var_dump($ew->getCredentials());die;
  53.         return $this->json([
  54.             Constantes::STATUS => Constantes::SUCCESS_CODE,
  55.             Constantes::MESSAGE => "Success",
  56.         ]);
  57.     }
  58.     
  59. }