We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 81d5284 commit b6d9cdcCopy full SHA for b6d9cdc
1 file changed
src/main/java/com/gabriel_torelo/game_list/services/GameService.java
@@ -0,0 +1,21 @@
1
+package com.gabriel_torelo.game_list.services;
2
+
3
+import java.util.List;
4
+import org.springframework.beans.factory.annotation.Autowired;
5
+import org.springframework.stereotype.Service;
6
+import com.gabriel_torelo.game_list.dto.GameMinDTO;
7
+import com.gabriel_torelo.game_list.entities.Game;
8
+import com.gabriel_torelo.game_list.repositories.GameRepository;
9
10
+@Service
11
+public class GameService {
12
13
+ @Autowired
14
+ private GameRepository gameRepository;
15
16
+ public List<GameMinDTO> readAll() {
17
+ List<Game> rGames = gameRepository.findAll();
18
19
+ return rGames.stream().map(gameEntity -> new GameMinDTO(gameEntity)).toList();
20
+ }
21
+}
0 commit comments