1 | <?php |
||
20 | class GenreController extends BaseController |
||
21 | { |
||
22 | /** |
||
23 | * Get all genres. |
||
24 | * |
||
25 | * @Route("/api/genres", methods={"GET"}) |
||
26 | * |
||
27 | * @return JsonResponse |
||
28 | */ |
||
29 | 5 | public function getAll(GenreRepository $genreRepository) |
|
38 | |||
39 | /** |
||
40 | * Create new genre. |
||
41 | * |
||
42 | * @Route("/api/genres", methods={"POST"}) |
||
43 | * |
||
44 | * @param \App\Genres\Request\CreateGenreRequest $request |
||
45 | * @param \App\Genres\Service\GenreManageService $genreManageService |
||
46 | * @param ValidatorInterface $validator |
||
47 | * |
||
48 | * @return Genre|\Symfony\Component\HttpFoundation\JsonResponse|\Symfony\Component\HttpFoundation\Response |
||
49 | */ |
||
50 | 2 | public function postGenres(CreateGenreRequest $request, GenreManageService $genreManageService, ValidatorInterface $validator) |
|
67 | |||
68 | /** |
||
69 | * Update genre. |
||
70 | * |
||
71 | * @Route("/api/genres/{id}", methods={"POST"}) |
||
72 | * |
||
73 | * @param UpdateGenreRequest $request |
||
74 | * @param Genre $genre |
||
75 | * @param \App\Genres\Service\GenreManageService $genreManageService |
||
76 | * @param ValidatorInterface $validator |
||
77 | * |
||
78 | * @return Genre|\Symfony\Component\HttpFoundation\JsonResponse|\Symfony\Component\HttpFoundation\Response |
||
79 | */ |
||
80 | 1 | public function putGenres(UpdateGenreRequest $request, Genre $genre, GenreManageService $genreManageService, ValidatorInterface $validator) |
|
97 | } |
||
98 |