mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-16 15:24:26 +00:00
28 lines
689 B
PHP
28 lines
689 B
PHP
<?php
|
|
|
|
namespace Chill\MainBundle\Controller;
|
|
|
|
use Chill\MainBundle\CRUD\Controller\ApiController;
|
|
use Symfony\Component\HttpFoundation\Request;
|
|
use Symfony\Component\HttpFoundation\JsonResponse;
|
|
use Symfony\Component\Routing\Annotation\Route;
|
|
|
|
class UserApiController extends ApiController
|
|
{
|
|
/**
|
|
* @Route(
|
|
* "/api/1.0/main/whoami.{_format}",
|
|
* name="chill_main_user_whoami",
|
|
* requirements={
|
|
* "_format": "json"
|
|
* }
|
|
* )
|
|
*/
|
|
public function whoami($_format): JsonResponse
|
|
{
|
|
return $this->json($this->getUser(), JsonResponse::HTTP_OK, [],
|
|
[ "groups" => [ "read" ] ]);
|
|
}
|
|
|
|
}
|