Skip to content

Commit bdf6819

Browse files
Merge pull request #22 from GabrielTorelo/feat/gameService
feat/gameService#003 - OK
2 parents 8ff8c2b + ac0a9c1 commit bdf6819

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/main/java/com/gabriel_torelo/game_list/services/GameService.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import com.gabriel_torelo.game_list.dto.GameMinDTO;
99
import com.gabriel_torelo.game_list.dto.GameShortDTO;
1010
import com.gabriel_torelo.game_list.entities.Game;
11+
import com.gabriel_torelo.game_list.projections.GameMinProjection;
1112
import com.gabriel_torelo.game_list.repositories.GameRepository;
1213

1314
@Service
@@ -36,4 +37,11 @@ public GameLongDTO readMoreID(Long id) {
3637

3738
return new GameLongDTO(rGame);
3839
}
40+
41+
@Transactional(readOnly = true)
42+
public List<GameMinDTO> readListID(Long id) {
43+
List<GameMinProjection> rGameProj = gameRepository.readListID(id);
44+
45+
return rGameProj.stream().map(gameProject -> new GameMinDTO(gameProject)).toList();
46+
}
3947
}

0 commit comments

Comments
 (0)