From cbf285a35c2c0a4a94d65f1447dbc50cc9a1d706 Mon Sep 17 00:00:00 2001 From: Gabriel Torelo <57268681+GabrielTorelo@users.noreply.github.com> Date: Sun, 16 Jul 2023 07:50:26 -0300 Subject: [PATCH] =?UTF-8?q?cria=20m=C3=A9todo=20'readListID'=20que=20retor?= =?UTF-8?q?na=20o=20DTO=20do=20'GameService'=20com=20todos=20os=20jogos=20?= =?UTF-8?q?de=20uma=20lista=20espec=C3=ADfica?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../game_list/controllers/GameListController.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main/java/com/gabriel_torelo/game_list/controllers/GameListController.java b/src/main/java/com/gabriel_torelo/game_list/controllers/GameListController.java index ffa5fc9..c3517e7 100644 --- a/src/main/java/com/gabriel_torelo/game_list/controllers/GameListController.java +++ b/src/main/java/com/gabriel_torelo/game_list/controllers/GameListController.java @@ -7,7 +7,9 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import com.gabriel_torelo.game_list.dto.GameListDTO; +import com.gabriel_torelo.game_list.dto.GameMinDTO; import com.gabriel_torelo.game_list.services.GameListService; +import com.gabriel_torelo.game_list.services.GameService; @RestController @RequestMapping(value = "/lists") @@ -16,6 +18,9 @@ public class GameListController { @Autowired private GameListService gameListService; + @Autowired + private GameService gameService; + @GetMapping public List readAll() { return gameListService.readAll(); @@ -25,4 +30,9 @@ public List readAll() { public GameListDTO readID(@PathVariable Long id) { return gameListService.readID(id); } + + @GetMapping(value = "/{id}/games") + public List readListID(@PathVariable Long id) { + return gameService.readListID(id); + } }