Skip to content

Commit 07768eb

Browse files
Merge pull request #17 from GabrielTorelo/feat/gameListController
feat/gameListController#001 - OK
2 parents adfb26d + f4becb6 commit 07768eb

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package com.gabriel_torelo.game_list.controllers;
2+
3+
import java.util.List;
4+
import org.springframework.beans.factory.annotation.Autowired;
5+
import org.springframework.web.bind.annotation.GetMapping;
6+
import org.springframework.web.bind.annotation.PathVariable;
7+
import org.springframework.web.bind.annotation.RequestMapping;
8+
import org.springframework.web.bind.annotation.RestController;
9+
import com.gabriel_torelo.game_list.dto.GameListDTO;
10+
import com.gabriel_torelo.game_list.services.GameListService;
11+
12+
@RestController
13+
@RequestMapping(value = "/lists")
14+
public class GameListController {
15+
16+
@Autowired
17+
private GameListService gameListService;
18+
19+
@GetMapping
20+
public List<GameListDTO> readAll() {
21+
return gameListService.readAll();
22+
}
23+
24+
@GetMapping(value = "/{id}")
25+
public GameListDTO readID(@PathVariable Long id) {
26+
return gameListService.readID(id);
27+
}
28+
}

0 commit comments

Comments
 (0)