rollback

parent 5af0d13b
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
namespace BackendBundle\Controller; namespace BackendBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use FOS\RestBundle\Controller\FOSRestController; use FOS\RestBundle\Controller\FOSRestController;
use AppBundle\Lib\Utiles; use AppBundle\Lib\Utiles;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
...@@ -15,7 +14,7 @@ require_once __DIR__ . '/../../../vendor/autoload.php'; ...@@ -15,7 +14,7 @@ require_once __DIR__ . '/../../../vendor/autoload.php';
use FOS\RestBundle\View\View; use FOS\RestBundle\View\View;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
class EnvioSmsController extends Controller { class EnvioSmsController extends FOSRestController {
/** /**
* @Route("/usuario/{id}", requirements={"id" = "\d+"}, defaults={"id" = 1}) * @Route("/usuario/{id}", requirements={"id" = "\d+"}, defaults={"id" = 1})
...@@ -52,24 +51,17 @@ class EnvioSmsController extends Controller { ...@@ -52,24 +51,17 @@ class EnvioSmsController extends Controller {
$usuario = Utiles::getParametroConfiguracion('nrsgateway_user'); $usuario = Utiles::getParametroConfiguracion('nrsgateway_user');
$password = Utiles::getParametroConfiguracion('nrsgateway_pws'); $password = Utiles::getParametroConfiguracion('nrsgateway_pws');
$url = Utiles::getParametroConfiguracion('nrsgateway_url'); $url = Utiles::getParametroConfiguracion('nrsgateway_url');
$resp = $this->enviarMensaje($campana, $telefono, $mensaje, $usuario, $password, $url); return $this->enviarMensaje($campana, $telefono, $mensaje, $usuario, $password, $url);
} else { //teltech } else { //teltech
if ($idmetodo == 2) { if ($idmetodo == 2) {
$usuario = Utiles::getParametroConfiguracion('teltech_user'); $usuario = Utiles::getParametroConfiguracion('teltech_user');
$password = Utiles::getParametroConfiguracion('teltech_pws'); $password = Utiles::getParametroConfiguracion('teltech_pws');
$url = Utiles::getParametroConfiguracion('teltech_url'); $url = Utiles::getParametroConfiguracion('teltech_url');
$resp = $this->enviarMensaje($campana, $telefono, $mensaje, $usuario, $password, $url); return $this->enviarMensaje($campana, $telefono, $mensaje, $usuario, $password, $url);
} else { //Amazon } else { //Amazon
$resp = $this->enviarMensajeAmazon($telefono, $mensaje); return $this->enviarMensajeAmazon($telefono, $mensaje);
} }
} }
$response = new Response(
$resp,
Response::HTTP_OK,
['content-type' => 'application/json']
);
return $response;
} }
private function enviarMensaje($campana, $movil, $mensaje, $usuario, $password, $url) { private function enviarMensaje($campana, $movil, $mensaje, $usuario, $password, $url) {
...@@ -219,15 +211,4 @@ class EnvioSmsController extends Controller { ...@@ -219,15 +211,4 @@ class EnvioSmsController extends Controller {
$notifica->save(); $notifica->save();
} }
public function testAction(){
$response = new Response(
'Prueba',
Response::HTTP_OK,
['content-type' => 'application/json']
);
return $response;
}
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment