rest api
This commit is contained in:
parent
c856315a8d
commit
e59b85701c
|
@ -29,6 +29,19 @@ use Cadoles\CoreBundle\Form\UserType;
|
||||||
|
|
||||||
class RestController extends Controller
|
class RestController extends Controller
|
||||||
{
|
{
|
||||||
|
public function loginAction($key,Request $request)
|
||||||
|
{
|
||||||
|
$output=[];
|
||||||
|
|
||||||
|
// Vérification de la clé
|
||||||
|
$realkey = $this->getParameter("apikeyninegate");
|
||||||
|
if($key!=$realkey) {
|
||||||
|
$output["error"]="error key";
|
||||||
|
return new Response(json_encode($output), 400);
|
||||||
|
}
|
||||||
|
|
||||||
|
return new Response(json_encode($output), 200);
|
||||||
|
}
|
||||||
|
|
||||||
public function userAction($key, $login, Request $request)
|
public function userAction($key, $login, Request $request)
|
||||||
{
|
{
|
||||||
|
|
|
@ -492,6 +492,10 @@ cadoles_core_config_statistic:
|
||||||
defaults: { _controller: CadolesCoreBundle:Statistic:list }
|
defaults: { _controller: CadolesCoreBundle:Statistic:list }
|
||||||
|
|
||||||
#== REST ==================================================================================================================
|
#== REST ==================================================================================================================
|
||||||
|
cadoles_core_rest_login:
|
||||||
|
path: /rest/login/{key}
|
||||||
|
defaults: { _controller: CadolesCoreBundle:Rest:login }
|
||||||
|
|
||||||
cadoles_core_rest_user:
|
cadoles_core_rest_user:
|
||||||
path: /rest/user/{key}/{login}
|
path: /rest/user/{key}/{login}
|
||||||
defaults: { _controller: CadolesCoreBundle:Rest:user }
|
defaults: { _controller: CadolesCoreBundle:Rest:user }
|
||||||
|
|
Loading…
Reference in New Issue