Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -16,6 +18,9 @@ public class GameListController {
@Autowired
private GameListService gameListService;

@Autowired
private GameService gameService;

@GetMapping
public List<GameListDTO> readAll() {
return gameListService.readAll();
Expand All @@ -25,4 +30,9 @@ public List<GameListDTO> readAll() {
public GameListDTO readID(@PathVariable Long id) {
return gameListService.readID(id);
}

@GetMapping(value = "/{id}/games")
public List<GameMinDTO> readListID(@PathVariable Long id) {
return gameService.readListID(id);
}
}