Skip to content

Commit b639e89

Browse files
committed
cria função 'readAll' que retorna o DTO do 'GameService' com todos os jogos do BD
1 parent b6d9cdc commit b639e89

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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.RequestMapping;
7+
import org.springframework.web.bind.annotation.RestController;
8+
import com.gabriel_torelo.game_list.dto.GameMinDTO;
9+
import com.gabriel_torelo.game_list.services.GameService;
10+
11+
@RestController
12+
@RequestMapping(value = "/games")
13+
public class GameController {
14+
15+
@Autowired
16+
private GameService gameService;
17+
18+
@GetMapping
19+
public List<GameMinDTO> readAll() {
20+
return gameService.readAll();
21+
}
22+
}

0 commit comments

Comments
 (0)