1 | <?php |
||
21 | class UserController extends RestController |
||
22 | { |
||
23 | |||
24 | /** |
||
25 | * View single user by login |
||
26 | * @Route("/{login}", name="user_view") |
||
27 | * @Method("GET") |
||
28 | * @ApiDoc( |
||
29 | * section="User", |
||
30 | * statusCodes={ |
||
31 | * 200="User was found", |
||
32 | * 404="User with given login was not found", |
||
33 | * } |
||
34 | * ) |
||
35 | * @param string $login user login |
||
36 | */ |
||
37 | 2 | public function viewAction(string $login): Response |
|
41 | |||
42 | /** |
||
43 | * View current user |
||
44 | * @Route("", name="user_view_current") |
||
45 | * @Method("GET") |
||
46 | * @Security("has_role('ROLE_USER')") |
||
47 | * @ApiDoc( |
||
48 | * section="User", |
||
49 | * statusCodes={ |
||
50 | * 200="Current user is logged in", |
||
51 | * 401="Authentication required", |
||
52 | * } |
||
53 | * ) |
||
54 | */ |
||
55 | 1 | public function viewCurrentAction(): Response |
|
67 | |||
68 | private function createUserNotLoggedInErrorResult(): ApiError |
||
72 | } |
||
73 |