src/Controller/API/APIController.php line 67

Open in your IDE?
  1. <?php
  2. namespace App\Controller\API;
  3. use App\Entity\DetailsRestoSite;
  4. use App\Repository\RepoDetailsRestoSite;
  5. use App\Repository\RestaurantRepository;
  6. use Symfony\Component\HttpFoundation\Response;
  7. use Symfony\Component\HttpFoundation\Request;
  8. use Symfony\Component\Routing\Annotation\Route;
  9. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  10. use App\Service\AgentService;
  11. use Symfony\Component\HttpFoundation\JsonResponse;
  12. use Symfony\Component\HttpFoundation\RequestStack;
  13. use Symfony\Component\Serializer\SerializerInterface;
  14. class APIController extends AbstractController{
  15.    
  16.     private $agentService;
  17.     private $serializer;
  18.     private $requestStack;
  19.     public function __construct(AgentService $agentService,RequestStack $requestStack ,SerializerInterface $serializer){
  20.        $this->agentService=$agentService;
  21.        $this->serializer=$serializer;
  22.        $this->requestStack=$requestStack;
  23.     }
  24.      /**
  25.      * @Route ("/linkMultiFileC/crtt", name="link.Multi.file.create.cdns", methods={"POST"})
  26.      * 
  27.      */
  28.     public function linkMultiFileByCreatingCodens(Request $request){
  29.       $this->denyAccessUnlessGranted('ROLE_USER',null,'access denied');
  30.       $dataRequest=json_decode($request->getContent(), true);
  31.       $r=$this->agentService->createMltiCodens($dataRequest);
  32.       $response=new Response($r,Response::HTTP_OK);
  33.       $response->headers->set('content-Type''application/json');
  34.       return $response;
  35.     }
  36.     /**
  37.     * @Route("/dlinkAllId", name="unlink_all_fiche_selected", methods={"POST"})
  38.     */
  39.     public function dlinkAllIdLinked(Request $request){
  40.       $this->denyAccessUnlessGranted('ROLE_USER',null,'access denied');
  41.       $dataRequest=json_decode($request->getContent(),true);
  42.       $r=$this->agentService->dlinkAllIdLinked($dataRequest);
  43.       $response=new Response($r,Response::HTTP_OK);
  44.       $response->headers->set('content-Type''application/json');
  45.       return $response;
  46.    }
  47.     /**
  48.      * @Route("/resto/{id}", name="resto_show", methods={"GET"})
  49.      **/
  50.     public function showRestoByID($id){
  51.         $this->denyAccessUnlessGranted('ROLE_USER',null,'access denied');
  52.         $data=$this->agentService->showResultByID($id);
  53.         $response=new Response($data);
  54.         $response->headers->set('content-Type''application/json');
  55.         return $response;
  56.     }
  57.     /**
  58.      * @Route("/resto/codens/{codens}", name="resto_show_by_codens", methods={"GET"})
  59.      **/
  60.     public function showRestoByCodens($codens){
  61.       $this->denyAccessUnlessGranted('ROLE_USER',null,'access denied');
  62.       $data=$this->agentService->showRestoByCodens($codens);
  63.       $response=new Response($data);
  64.       $response->headers->set('content-Type''application/json');
  65.       return $response;
  66.   }
  67.     /**
  68.      * @Route("/restoList/getListEtend", name="list_show", methods={"GET"})
  69.      * 
  70.      */
  71.     public function getListEtend(Request $request){
  72.         $this->denyAccessUnlessGranted('ROLE_USER',null,'access denied');
  73.         $dataRequest$request->query->get('CP');
  74.         $data=$this->agentService->showResultByCP($dataRequest);
  75.         $response=new Response($data);
  76.         $response->headers->set('content-Type''application/json');
  77.         return $response;
  78.     }
  79.     /**
  80.      * @Route ("/linkFile/uptdt", name="link.file", methods={"POST"})
  81.      * 
  82.      */
  83.     public function linkFile(Request $request){
  84.         $this->denyAccessUnlessGranted('ROLE_USER',null,'access denied');
  85.         $dataRequest=$request->request->all();
  86.         $r=$this->agentService->alterCodensValue($dataRequest['cdns'], $dataRequest['id']);
  87.         $response=new Response($r,Response::HTTP_OK);
  88.         $response->headers->set('content-Type''application/json');
  89.         return $response;
  90.     }
  91.      /**
  92.      * @Route ("/linkFileC/up/both", name="link.both.file", methods={"POST"})
  93.      * 
  94.      */
  95.     public function alterCodensValueForToFileWhoHaveBothCdns(Request $request){
  96.       $this->denyAccessUnlessGranted('ROLE_USER',null,'access denied');
  97.       $dataRequest=$request->request->all();
  98.       $r=$this->agentService->alterCodensValueForToFileWhoHaveBothCdns($dataRequest['cdnSource'], $dataRequest['cdnTarget']);
  99.       $response=new Response($r,Response::HTTP_OK);
  100.       $response->headers->set('content-Type''application/json');
  101.       return $response;
  102.     }
  103.     /**
  104.      * @Route ("/linkFileC/crtt", name="link.file.create.cdns", methods={"POST"})
  105.      * 
  106.      */
  107.     public function linkFileByCreatingCodens(Request $request){
  108.         $this->denyAccessUnlessGranted('ROLE_USER',null,'access denied');
  109.         $dataRequest=[];
  110.         // if ($request->isMethod('post')) {
  111.           $dataRequest=$request->request->all();
  112.       //  }else if($request->isMethod('get')){
  113.       //     $dataRequest=$request->query->all();
  114.       //  }
  115.         
  116.        // dd($dataRequest);
  117.         $r=$this->agentService->createCodens($dataRequest['dep'],$dataRequest['idOne'], $dataRequest['idTwo']);
  118.        //$r=$this->agentService->createCodens("44",1,248); 
  119.        $response=new Response($r,Response::HTTP_OK);
  120.         $response->headers->set('content-Type''application/json');
  121.         return $response;
  122.     }
  123.      /**
  124.       * @Route ("/restoPush/setChgtAddr", name="chagement_adresse", methods={"POST"})
  125.       */
  126.       public function setChagementAddress(Request $request){
  127.         $this->denyAccessUnlessGranted('ROLE_USER',null,'access denied');
  128.         $id=$request->request->get("id");
  129.         $cdns=base64_decode($request->request->get("cdns"));
  130.         $r=$this->agentService->setChagementAdresse($id,$cdns);
  131.         $response=new Response($r,Response::HTTP_OK);
  132.         $response->headers->set('content-Type''application/json');
  133.         return $response;
  134.       }
  135.     /**
  136.      * @Route ("/restoPush/pushComm" ,name="push_comm", methods={"POST"})
  137.      */
  138.     public function pushCommValid(Request $request ){
  139.         $this->denyAccessUnlessGranted('ROLE_USER',null,'access denied');
  140.         $dataRequest=$request->request->all();
  141.         $d=$this->agentService->pushCommentaire($dataRequest['cdns'],$dataRequest['id'],base64_decode($dataRequest['ctnt']));
  142.         $response=new Response($d,Response::HTTP_OK);
  143.         $response->headers->set('content-Type''application/json');
  144.         return $response;
  145.     }
  146.     /**
  147.      * @Route ("/delete/deleteComment", name="delete_comment", methods={"POST"})
  148.      */
  149.     public function deleteComment(Request $request){
  150.        $this->denyAccessUnlessGranted('ROLE_USER',null,'access denied');
  151.        $dataRequest=$request->request->all();
  152.        $d=$this->agentService->deleteCommentaire($dataRequest['id'],$dataRequest['cdns']);
  153.        $response=new Response($d,Response::HTTP_OK);
  154.        $response->headers->set('content-Type''application/json');
  155.        return $response;
  156.     }
  157.     /**
  158.      * @Route ("/deleteLinkage/dlink", name="dlink_fiche", methods={"POST"})
  159.      */
  160.     public function dlink(Request $request){
  161.         $this->denyAccessUnlessGranted('ROLE_USER',null,'access denied');
  162.         $dataRequest=$request->request->all();
  163.         $response=$this->agentService->dlinkV2($dataRequest['idOne'],$dataRequest['idTwo']);
  164.         $response=new Response($response,Response::HTTP_OK);
  165.         $response->headers->set('content-Type''application/json');
  166.         return $response;
  167.     }
  168.     /**
  169.      * @Route ("/deleteLinkage/dlinks", name="dlinks_fiche", methods={"POST"})
  170.      */
  171.     public function dlinks(Request $request){
  172.       $this->denyAccessUnlessGranted('ROLE_USER',null,'access denied');
  173.       $dataRequest=$request->request->all();
  174.       $response=$this->agentService->dlink($dataRequest['id']);
  175.       $response=new Response($response,Response::HTTP_OK);
  176.       $response->headers->set('content-Type''application/json');
  177.       return $response;
  178.     }
  179.     /**
  180.      * @Route ("/push/pushEvenement", name="push_evenement", methods={"POST"})
  181.      */
  182.     public function setEvenement(Request $request){
  183.         $this->denyAccessUnlessGranted('ROLE_USER',null,'access denied');
  184.         $dataRequest=$request->request->all();
  185.         $response=new Response($this->agentService->setEvenement($dataRequest['eve'],
  186.                   $dataRequest['cdS'],$dataRequest['cdns'],
  187.                   base64_decode($dataRequest['cmnt']),$dataRequest['id']),Response::HTTP_OK);
  188.         $response->headers->set('content-Type''application/json'); 
  189.         return $response;
  190.     }
  191.     /**
  192.      * @Route ("/push/closeEtab", name="close_etab", methods={"POST"})
  193.      */
  194.     public function closeEtab(Request $request){
  195.       $this->denyAccessUnlessGranted('ROLE_USER',null,'access denied');
  196.       $dataRequest=$request->request->all();
  197.       $response=new Response($this->agentService->closeEtab($dataRequest['id'],$dataRequest['cdns'],$dataRequest['cmnt']),Response::HTTP_OK);
  198.       $response->headers->set('content-Type''application/json'); 
  199.       return $response;
  200.   }
  201.     /**
  202.      * @Route ("/delete/deleteEVE", name="delete_evenement", methods={"POST"})
  203.      * 
  204.      */
  205.     public function deleteEvenement(Request $request){
  206.         $this->denyAccessUnlessGranted('ROLE_USER',null,'access denied');
  207.         $dataRequest=$request->request->all();
  208.         $response=new Response($this->agentService->deleteEvenement($dataRequest['cdns'], $dataRequest['id']));
  209.         $response->headers->set('content-Type''application/json'); 
  210.         return $response;
  211.     }
  212.     /**
  213.      * @Route( "/get/rappel", name="get_rappel", methods={"POST"})
  214.      */
  215.     public function getRappel(Request $request){
  216.         $this->denyAccessUnlessGranted('ROLE_USER',null,'access denied');
  217.         $dep=$request->request->get("dep");
  218.         $response=new Response($this->agentService->getRappel($dep));
  219.         $response->headers->set('content-Type''application/json'); 
  220.         return $response;
  221.     }
  222.     /**
  223.      * @Route("/set/rappel", name="set_rappel", methods={"POST"})
  224.      * 
  225.      */
  226.     public function setRappel(Request $request){
  227.         $this->denyAccessUnlessGranted('ROLE_USER',null,'access denied');
  228.         $dataRequest=$request->request->all();
  229.         $response=new Response($this->agentService->setRappel($dataRequest["cdns"],$dataRequest["id"]),Response::HTTP_OK);
  230.         $response->headers->set('content-Type''application/json'); 
  231.         return $response;
  232.     }
  233.     /**
  234.      * @Route("/user/duplicateFiche",name="dupicate_fiche", methods={"GET","POST"})
  235.      */
  236.     public function dupplicateFiche(Request $request){
  237.        $this->denyAccessUnlessGranted('ROLE_USER',null,'access denied');
  238.        $dataRequest=$request->request->all();
  239.        $response=new Response($this->agentService->duplicateFiche(base64_decode($dataRequest["cdns"]),$dataRequest["id"],$dataRequest["dep"]));
  240.        $response->headers->set('content-Type''application/json'); 
  241.        return $response;
  242.     }
  243.     /**
  244.      * @Route("/set/setFicheValided",name="set_true_fiche_validated", methods={"POST"})
  245.      */
  246.     public function setFicheValidated(Request $request){
  247.         $this->denyAccessUnlessGranted('ROLE_USER',null,'access denied');
  248.         $dataRequest=$request->request->all();
  249.         $a=$this->agentService->setFicheValidated($dataRequest['cdns'],$dataRequest['id']);
  250.         $response=new Response($a);
  251.         $response->headers->set('content-Type''application/json'); 
  252.         return $response;
  253.     }
  254.     /**
  255.      * @Route("/set/reverseRappel", name="reverse_rappel", methods={"POST"})
  256.      */
  257.     public function reverseRappel(Request $request){
  258.         $this->denyAccessUnlessGranted('ROLE_USER',null,'access denied');
  259.         $dataRequest=$request->request->all();
  260.         $a=$this->agentService->reverseRappel($dataRequest['cdns'],$dataRequest['id']);
  261.         $response=new Response($a);
  262.         $response->headers->set('content-Type''application/json'); 
  263.         return $response
  264.     }
  265.     /**
  266.      * @Route("/setDepChoice/{dep}", name="set_dep_choice", methods={"GET"})
  267.      */
  268.     public function setDepChoice($dep){
  269.         $this->denyAccessUnlessGranted('ROLE_USER',null,'access denied');
  270.         $session $this->requestStack->getSession();
  271.         $session->set('dep'$dep);
  272.         $a=new Response($this->serializer->serialize(["response"=>"ok"],'json'));
  273.         $a->headers->set('content-Type''application/json'); 
  274.         return $a
  275.      }
  276.     /**
  277.      * @Route("/setViewChoice/{view}", name="set_view_choice", methods={"GET"})
  278.      */
  279.     public function setViewChoice($view){
  280.       $this->denyAccessUnlessGranted('ROLE_USER',null,'access denied');
  281.       $session $this->requestStack->getSession();
  282.       $session->set('view'$view);
  283.         $a=new Response($this->serializer->serialize(["response"=>"ok"],'json'));
  284.         $a->headers->set('content-Type''application/json'); 
  285.         return $a
  286.      }
  287.      /**
  288.     * @Route("/setCodinseeChoice/{codinsee}", name="set_codinsee_choice") 
  289.     */
  290.     public function setCodinseeChoice($codinsee){
  291.       $this->denyAccessUnlessGranted('ROLE_USER',null,'access denied');
  292.       $session $this->requestStack->getSession();
  293.       $session->set('codinsee'$codinsee);
  294.       $a=new Response($this->serializer->serialize(["response"=>"ok"],'json'));
  295.       $a->headers->set('content-Type''application/json'); 
  296.       return $a;  
  297.     }
  298.     /**
  299.      * @Route("/getAccountDepToValidateByCodinsee/{codinsee}/{dep}",name="get_acoount_dep_validate_codinsee")
  300.      */
  301.       public function getNombreFicheTOvalidateByCodinsee($codinsee,$dep){
  302.         $this->denyAccessUnlessGranted('ROLE_USER',null,'access denied');
  303.         $nbr=$this->agentService-> getNombreFicheTOvalidateByCodinsee($dep,$codinsee);
  304.         $a=new Response($this->serializer->serialize(["nbr"=>$nbr],'json'));
  305.         $a->headers->set('content-Type''application/json'); 
  306.         return $a;  
  307.       }
  308.      /**
  309.       * @Route("/getDepByUserId", name="get_dep_by_user_id" , methods={"GET"})
  310.       */
  311.      public function getDepByUserId(Request $request){
  312.           $this->denyAccessUnlessGranted('ROLE_USER',null,'access denied');
  313.           $id=$request->query->get("id");
  314.           $a=$this->agentService->getDepByUserId($id);
  315.           $response=new Response($a);
  316.           $response->headers->set('content-Type''application/json'); 
  317.           return $response
  318.      }
  319.      /**
  320.      * @Route("/getAccountDepToDo", name="get_acount_dep_to_do", methods={"GET"})
  321.      */
  322.       public function getAccountToDo(Request $request){
  323.         $this->denyAccessUnlessGranted('ROLE_USER',null,'access denied');
  324.         $dep=$request->query->get('dep');
  325.         $response=new Response($this->agentService->getAccountToDo($dep));
  326.         $response->headers->set('content-Type''application/json'); 
  327.         return $response
  328.       }
  329.       /**
  330.        * @Route("/getAccountDepDone", name="get_account_dep_done", methods={"GET"})
  331.        */
  332.       public function getAccountDepDone(Request $request){
  333.         $this->denyAccessUnlessGranted('ROLE_USER',null,'access denied');
  334.         $dep=$request->query->get('dep');
  335.         $response=new Response($this->agentService->getAccountDepDone($dep));
  336.         $response->headers->set('content-Type''application/json'); 
  337.         return $response
  338.       }
  339.       /**
  340.        * @Route("/getAccountRappel", name="get_account_rappel", methods={"GET"})
  341.        */
  342.       public function getAccountRappel(Request $request){
  343.         $this->denyAccessUnlessGranted('ROLE_USER',null,'access denied');
  344.         $dep=$request->query->get('dep');
  345.         $response=new Response($this->agentService->getAccountRappel($dep));
  346.         $response->headers->set('content-Type''application/json'); 
  347.         return $response
  348.       }
  349.       /**
  350.        * @Route("/checkedFastFood", name="fastFood_checked", methods={"POST"})
  351.        */
  352.       public function setCheckBoxFastFood(Request $request){
  353.         $this->denyAccessUnlessGranted('ROLE_USER',null,'access denied');
  354.         $dataRequest=$request->request->all();
  355.         $response=new Response($this->agentService->setCheckBoxFastFood($dataRequest['id'],$dataRequest['b']));
  356.         $response->headers->set('content-Type''application/json'); 
  357.         return $response
  358.       }
  359.       /**
  360.        * @Route("/checkedRestaurant", name="restaurant_checked", methods={"POST"})
  361.        */
  362.       public function setCheckBoxRestaurant(Request $request){
  363.         $this->denyAccessUnlessGranted('ROLE_USER',null,'access denied');
  364.         $dataRequest=$request->request->all();
  365.         $response=new Response($this->agentService->setCheckBoxRestaurant($dataRequest['id'],$dataRequest['b']));
  366.         $response->headers->set('content-Type''application/json'); 
  367.         return $response
  368.       }
  369.       /**
  370.        * @Route("/checkedCreperie", name="creperie_checked", methods={"POST"})
  371.        */
  372.       public function setCheckBoxCreperie(Request $request){
  373.         $this->denyAccessUnlessGranted('ROLE_USER',null,'access denied');
  374.         $dataRequest=$request->request->all();
  375.         $response=new Response($this->agentService->setCheckBoxCreperie($dataRequest['id'],$dataRequest['b']));
  376.         $response->headers->set('content-Type''application/json'); 
  377.         return $response
  378.       }
  379.       /**
  380.        * @Route("/checkedBrasserie", name="brasserie_checked", methods={"POST"})
  381.        */
  382.       public function setCheckBoxBrasserie(Request $request){
  383.         $this->denyAccessUnlessGranted('ROLE_USER',null,'access denied');
  384.         $dataRequest=$request->request->all();
  385.         $response=new Response($this->agentService->setCheckBoxBrasserie($dataRequest['id'],$dataRequest['b']));
  386.         $response->headers->set('content-Type''application/json'); 
  387.         return $response
  388.       }
  389.       /**
  390.        * @Route("/checkedPizzeria", name="pizzeria_checked", methods={"POST"})
  391.        */
  392.       public function setCheckBoxPizzeria(Request $request){
  393.         $this->denyAccessUnlessGranted('ROLE_USER',null,'access denied');
  394.         $dataRequest=$request->request->all();
  395.         $response=new Response($this->agentService->setCheckBoxPizzeria($dataRequest['id'],$dataRequest['b']));
  396.         $response->headers->set('content-Type''application/json'); 
  397.         return $response
  398.       }
  399.       /**
  400.        * @Route("/checkedBoulangerie", name="boulangerie_checked", methods={"POST"})
  401.        */
  402.       public function setCheckBoxBoulangerie(Request $request){
  403.         $this->denyAccessUnlessGranted('ROLE_USER',null,'access denied');
  404.         $dataRequest=$request->request->all();
  405.         $response=new Response($this->agentService->setCheckBoxBoulangerie($dataRequest['id'],$dataRequest['b']));
  406.         $response->headers->set('content-Type''application/json'); 
  407.         return $response
  408.       }
  409.       /**
  410.        * @Route("/checkedBar", name="bar_checked", methods={"POST"})
  411.        */
  412.       public function setCheckBoxBar(Request $request){
  413.         $this->denyAccessUnlessGranted('ROLE_USER',null,'access denied');
  414.         $dataRequest=$request->request->all();
  415.         $response=new Response($this->agentService->setCheckBoxBar($dataRequest['id'],$dataRequest['b']));
  416.         $response->headers->set('content-Type''application/json'); 
  417.         return $response
  418.       }
  419.       /**
  420.        * @Route("/checkedMonde", name="cuisine_monde_checked", methods={"POST"})
  421.        */
  422.       public function setCheckBoxMonde(Request $request){
  423.         $this->denyAccessUnlessGranted('ROLE_USER',null,'access denied');
  424.         $dataRequest=$request->request->all();
  425.         $response=new Response($this->agentService->setCheckBoxMonde($dataRequest['id'],$dataRequest['b']));
  426.         $response->headers->set('content-Type''application/json'); 
  427.         return $response
  428.       }
  429.       /**
  430.        * @Route("/checkedCafe", name="cafe_checked", methods={"POST"})
  431.        */
  432.       public function setCheckBoxCafe(Request $request){
  433.         $this->denyAccessUnlessGranted('ROLE_USER',null,'access denied');
  434.         $dataRequest=$request->request->all();
  435.         $response=new Response($this->agentService->setCheckBoxCafe($dataRequest['id'],$dataRequest['b']));
  436.         $response->headers->set('content-Type''application/json'); 
  437.         return $response
  438.       }
  439.       /**
  440.        * @Route("/checkedSalonThe", name="salonThe_checked", methods={"POST"})
  441.        */
  442.       public function setCheckBoxSalonThe(Request $request){
  443.         $this->denyAccessUnlessGranted('ROLE_USER',null,'access denied');
  444.         $dataRequest=$request->request->all();
  445.         $response=new Response($this->agentService->setCheckBoxSalonThe($dataRequest['id'],$dataRequest['b']));
  446.         $response->headers->set('content-Type''application/json'); 
  447.         return $response
  448.       }
  449.       /**
  450.        * @Route("/setPasGarder", name="pas_garder", methods={"POST"})
  451.        */
  452.       public function setPasGarder(Request $request){
  453.         $this->denyAccessUnlessGranted('ROLE_USER',null,'access denied');
  454.         $dataRequest=$request->request->all();
  455.         $response=new Response($this->agentService->setPasGarder($dataRequest['id'],$dataRequest['cdns']));
  456.         $response->headers->set('content-Type''application/json'); 
  457.         return $response
  458.       }
  459.       /**
  460.        * @Route("/undoPasGarder", name="oui_garder", methods={"POST"})
  461.        */
  462.       public function undoPasGarder(Request $request){
  463.         $this->denyAccessUnlessGranted('ROLE_USER',null,'access denied');
  464.         $dataRequest=$request->request->all();
  465.         $response=new Response($this->agentService->undoPasGarder($dataRequest['id'],$dataRequest['cdns']));
  466.         $response->headers->set('content-Type''application/json'); 
  467.         return $response
  468.       }
  469.       /**
  470.        * @Route("/see/AllAboutFiche", name="see_all_about_fiche", methods={"GET"})
  471.        * 
  472.        */
  473.         public function seeAllAboutFiche(Request $request){
  474.           $this->denyAccessUnlessGranted('ROLE_USER',null,'access denied');
  475.           $id=$request->query->get("id");
  476.           $response=new Response($this->agentService->seeAllAboutFiche($id));
  477.           $response->headers->set('content-Type''application/json'); 
  478.           return $response
  479.        }
  480.        /**
  481.         *@Route("/see/Historique", name="voir_historique", methods={"POST"}) 
  482.         *
  483.         */
  484.         public function showHistorical(Request $request){
  485.           $this->denyAccessUnlessGranted('ROLE_USER',null,'access denied');
  486.           $dep=$request->request->get("dep");
  487.           $response=new Response($this->agentService->showHistorical($dep));
  488.           $response->headers->set('content-Type''application/json'); 
  489.           return $response
  490.         }
  491.         /**
  492.          * @Route("/removeToHistorique", name="annulValidation", methods={"POST"})
  493.          */
  494.         public function removeToListFicheValidad(Request $request){
  495.            $this->denyAccessUnlessGranted('ROLE_USER',null,'access denied'); 
  496.            $dataRequest=$request->request->all();
  497.            $response=new Response($this->agentService->removeToListFicheValided($dataRequest["cdns"],$dataRequest["id"]) );
  498.            $response->headers->set('content-Type''application/json'); 
  499.            return $response;
  500.         }
  501.         /**
  502.          * @Route("/undo/modif", name="undo_modif", methods={"POST"})
  503.          */
  504.         public function undo(Request $request){
  505.           $this->denyAccessUnlessGranted('ROLE_USER',null,'access denied'); 
  506.           $dataRequest=$request->request->get("id");
  507.           $response=new Response($this->agentService->undo($dataRequest) );
  508.           $response->headers->set('content-Type''application/json'); 
  509.           return $response;
  510.         }
  511.         /**
  512.         * @Route("/change/name", name="changer_nom", methods={"POST"})
  513.         * 
  514.         */
  515.         public function changeName(Request $request){
  516.           $this->denyAccessUnlessGranted('ROLE_USER',null,'access denied'); 
  517.           $dataRequest=$request->request->all();
  518.           $response=new Response($this->agentService->changeName($dataRequest["id"],$dataRequest["name"]) );
  519.           $response->headers->set('content-Type''application/json'); 
  520.           return $response;
  521.         }
  522.         /**
  523.          * @Route("/change/adresse", name="changer_adresse", methods={"POST"})
  524.          * 
  525.          */
  526.         public function changeAdresse(Request $request){
  527.           $this->denyAccessUnlessGranted('ROLE_USER',null,'access denied');
  528.           $dataRequest=$request->request->all();
  529.           $response=new Response($this->agentService->changeAddress($dataRequest["id"],$dataRequest["numvoie"],$dataRequest["typevoie"],
  530.           $dataRequest["nomvoie"],$dataRequest["codpost"], 
  531.           $dataRequest["villenorm"],$dataRequest["commune"],
  532.           $dataRequest["compvoie"]));
  533.           $response->headers->set('content-Type''application/json'); 
  534.           return $response;
  535.         }
  536.        /**
  537.         *@Route("/set/flaggoodname", name="flag_good_name", methods={"POST"}) 
  538.         *
  539.         */
  540.         public function putGoodNameFlag(Request $request){
  541.           $this->denyAccessUnlessGranted('ROLE_USER',null,'access denied');
  542.           $id=$request->request->get("id");
  543.           $response=new Response($this->agentService->setNomOk($id)); 
  544.           $response->headers->set('content-Type''application/json'); 
  545.           return $response;
  546.         }
  547.         /**
  548.         *@Route("/remove/flaggoodname", name="remove_flag_good_name", methods={"POST"}) 
  549.         *
  550.         */
  551.         public function removeGoodNameFlag(Request $request){
  552.           $this->denyAccessUnlessGranted('ROLE_USER',null,'access denied');
  553.           $id=$request->request->get("id");
  554.           $response=new Response($this->agentService->unSetNomOk($id)); 
  555.           $response->headers->set('content-Type''application/json'); 
  556.           return $response;
  557.         }
  558.         /**
  559.          * @Route("/set/goodadresseflag", name="good_adresse", methods={"POST"})
  560.          *
  561.          */
  562.         public function putGoodAdresseFlag(Request $request){
  563.           $this->denyAccessUnlessGranted('ROLE_USER',null,'access denied');
  564.           $id=$request->request->get("id");
  565.           $response=new Response($this->agentService->setAdresseOk($id)); 
  566.           $response->headers->set('content-Type''application/json'); 
  567.           return $response
  568.         }
  569.         /**
  570.          * @Route("/remove/goodadresseflag", name="remove_good_adresse", methods={"POST"})
  571.          *
  572.          */
  573.         public function removeGoodAdresseFlag(Request $request){
  574.           $this->denyAccessUnlessGranted('ROLE_USER',null,'access denied');
  575.           $id=$request->request->get("id");
  576.           $response=new Response($this->agentService->unsetAdresseOk($id)); 
  577.           $response->headers->set('content-Type''application/json'); 
  578.           return $response
  579.         }
  580.         /**
  581.          * @Route("/set/sirenok", name="set_siren_ok", methods={"POST"})
  582.          */
  583.         public function setSirenOK(Request $request ){
  584.           $this->denyAccessUnlessGranted('ROLE_USER',null,'access denied');
  585.           $dataRequest=$request->request->all();
  586.           $response=new Response($this->agentService->setSirenOk($dataRequest["id"],$dataRequest["siren"])); 
  587.           $response->headers->set('content-Type''application/json'); 
  588.           return $response
  589.         }
  590.         /**
  591.          * @Route("/change/sirenok", name="change_siren_ok", methods={"POST"})
  592.          */
  593.         public function changeSirenOK(Request $request ){
  594.           $this->denyAccessUnlessGranted('ROLE_USER',null,'access denied');
  595.           $id=$request->request->get("id");
  596.           $siren=$request->request->get("siren");
  597.           $response=new Response($this->agentService->unsetSirenOk($id,$siren)); 
  598.           $response->headers->set('content-Type''application/json'); 
  599.           return $response
  600.         }
  601.  
  602. /**
  603.          * @Route("/undo/sirenok", name="undo_siren_ok", methods={"POST"})
  604.          */
  605.         public function undoSirenOK(Request $request ){
  606.           $this->denyAccessUnlessGranted('ROLE_USER',null,'access denied');
  607.           $id=$request->request->get("id");
  608.           $response=new Response($this->agentService-> undoSirenOk($id)); 
  609.           $response->headers->set('content-Type''application/json'); 
  610.           return $response
  611.         }
  612.  
  613.          /**
  614.          * @Route("/set/telok", name="set_tel_ok", methods={"POST"})
  615.          */
  616.         public function setTelOK(Request $request ){
  617.           $this->denyAccessUnlessGranted('ROLE_USER',null,'access denied');
  618.           $dataRequest=$request->request->all();
  619.           $response=new Response($this->agentService->setTelOk($dataRequest["id"],$dataRequest["tel"])); 
  620.           $response->headers->set('content-Type''application/json'); 
  621.           return $response
  622.         }
  623.         /**
  624.         * @Route("/change/tel", name="unset_tel_ok", methods={"POST"})
  625.         */
  626.         public function changeTelOK(Request $request ){
  627.           $this->denyAccessUnlessGranted('ROLE_USER',null,'access denied');
  628.           $data=$request->request->all();
  629.           $response=new Response($this->agentService->changeTelOk($data["id"],$data["tel"])); 
  630.           $response->headers->set('content-Type''application/json'); 
  631.           return $response
  632.         }
  633.          /**
  634.         * @Route("/undo/telok", name="undo_tel_ok", methods={"POST"})
  635.         */
  636.         public function undoTelOK(Request $request ){
  637.           $this->denyAccessUnlessGranted('ROLE_USER',null,'access denied');
  638.           $data=$request->request->all();
  639.           $response=new Response($this->agentService->undoTelOk($data["id"])); 
  640.           $response->headers->set('content-Type''application/json'); 
  641.           return $response
  642.         }
  643.          /**
  644.         * @Route("/suppr/tel", name="unset_tel_ok", methods={"POST"})
  645.         */
  646.         public function supprTel(Request $request ){
  647.           $this->denyAccessUnlessGranted('ROLE_USER',null,'access denied');
  648.           $data=$request->request->all();
  649.           $response=new Response($this->agentService->supprTel($data["id"],$data["tel"])); 
  650.           $response->headers->set('content-Type''application/json'); 
  651.           return $response
  652.         }
  653.         // #[Route("/set/restaurant/details/web",name:"app_details_resto_web", methods:["POST"])]
  654.         // public function setRestaurantDetailsWeb(Request $request,RepoDetailsRestoSite $repo,SerializerInterface $serialize){
  655.         //     $dataRequest=json_decode($request->getContent(),true);
  656.         //     $denomination=$dataRequest["nom"];
  657.         //     $adresse=$dataRequest["adresse"];
  658.         //     $telephone=$dataRequest["tel"];
  659.         //     $site=$dataRequest["site"];
  660.         //     $codens=$dataRequest["codens"];
  661.         //     $id_restaurant=$dataRequest["id_r"];
  662.         //     $detailRestaurantWeb=new DetailsRestoSite();
  663.         //     $detailRestaurantWeb->setAdresse($adresse)
  664.         //     ->setDenomination($denomination)
  665.         //     ->setTelephone($telephone)
  666.         //     ->setSite($site)
  667.         //     ->setCodens($codens)
  668.         //     ->setIdRestaurant($id_restaurant);
  669.         //     $repo->add($detailRestaurantWeb,true);
  670.         //     $json=$serialize->serialize($dataRequest,'json');
  671.         //     return new JsonResponse($json,Response::HTTP_CREATED,[],true);
  672.         //}
  673.          /**
  674.          *@Route("/get/items/{dep}", name="app_get_all_item", methods={"GET"})
  675.          */
  676.         public function getAllFicheByDep($depRestaurantRepository $repo,SerializerInterface $serialize){
  677.           $restos=$repo->getAllFicheByDep($dep);
  678.           $json=$serialize->serialize($restos,'json');
  679.           return new JsonResponse($json,Response::HTTP_CREATED,[],true);
  680.            
  681.         }
  682.         /**
  683.          *@Route("/up/pos", name="app_up_pos")
  684.          */
  685.         public function updatePoiPos(Request $requestRestaurantRepository $repo){
  686.             $contents=json_decode($request->getContent(),true);
  687.             try{
  688.                 $repo->updatePoiPosition($contents["poiX"], $contents["poiY"],$contents["id"]);
  689.                 return $this->json(["message"=>"ok"],200);
  690.             }catch(\Exception $e){
  691.                return $this->json(["erreur"=>$e],500);
  692.             }
  693.           
  694.         }
  695. }