From b639e898179a0136abefc050f4b433189552f96d Mon Sep 17 00:00:00 2001 From: Gabriel Torelo <57268681+GabrielTorelo@users.noreply.github.com> Date: Fri, 14 Jul 2023 17:33:41 -0300 Subject: [PATCH] =?UTF-8?q?cria=20fun=C3=A7=C3=A3o=20'readAll'=20que=20ret?= =?UTF-8?q?orna=20o=20DTO=20do=20'GameService'=20com=20todos=20os=20jogos?= =?UTF-8?q?=20do=20BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../game_list/controllers/GameController.java | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/main/java/com/gabriel_torelo/game_list/controllers/GameController.java diff --git a/src/main/java/com/gabriel_torelo/game_list/controllers/GameController.java b/src/main/java/com/gabriel_torelo/game_list/controllers/GameController.java new file mode 100644 index 0000000..4c1c597 --- /dev/null +++ b/src/main/java/com/gabriel_torelo/game_list/controllers/GameController.java @@ -0,0 +1,22 @@ +package com.gabriel_torelo.game_list.controllers; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.gabriel_torelo.game_list.dto.GameMinDTO; +import com.gabriel_torelo.game_list.services.GameService; + +@RestController +@RequestMapping(value = "/games") +public class GameController { + + @Autowired + private GameService gameService; + + @GetMapping + public List readAll() { + return gameService.readAll(); + } +}