File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
src/main/java/com/gabriel_torelo/game_list/controllers Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 77import org .springframework .web .bind .annotation .RequestMapping ;
88import org .springframework .web .bind .annotation .RestController ;
99import com .gabriel_torelo .game_list .dto .GameListDTO ;
10+ import com .gabriel_torelo .game_list .dto .GameMinDTO ;
1011import com .gabriel_torelo .game_list .services .GameListService ;
12+ import com .gabriel_torelo .game_list .services .GameService ;
1113
1214@ RestController
1315@ RequestMapping (value = "/lists" )
@@ -16,6 +18,9 @@ public class GameListController {
1618 @ Autowired
1719 private GameListService gameListService ;
1820
21+ @ Autowired
22+ private GameService gameService ;
23+
1924 @ GetMapping
2025 public List <GameListDTO > readAll () {
2126 return gameListService .readAll ();
@@ -25,4 +30,9 @@ public List<GameListDTO> readAll() {
2530 public GameListDTO readID (@ PathVariable Long id ) {
2631 return gameListService .readID (id );
2732 }
33+
34+ @ GetMapping (value = "/{id}/games" )
35+ public List <GameMinDTO > readListID (@ PathVariable Long id ) {
36+ return gameService .readListID (id );
37+ }
2838}
You can’t perform that action at this time.
0 commit comments