1 | package org.hplr.game.core.usecases.service; | |
2 | ||
3 | import lombok.RequiredArgsConstructor; | |
4 | import org.hplr.game.core.enums.Status; | |
5 | import org.hplr.game.core.model.Game; | |
6 | import org.hplr.game.core.model.GameSnapshot; | |
7 | import org.hplr.game.core.usecases.port.in.GetAllGamesByStatusAndPlayerIdUseCaseInterface; | |
8 | import org.hplr.game.core.usecases.port.out.query.SelectGamesByStatusAndPlayerIdQueryInterface; | |
9 | import org.springframework.stereotype.Service; | |
10 | ||
11 | import java.util.List; | |
12 | import java.util.UUID; | |
13 | ||
14 | @RequiredArgsConstructor | |
15 | @Service | |
16 | public class GetAllGamesByStatusAndPlayerIdUseCaseService implements GetAllGamesByStatusAndPlayerIdUseCaseInterface { | |
17 | ||
18 | final SelectGamesByStatusAndPlayerIdQueryInterface selectGamesByStatusAndPlayerIdQueryInterface; | |
19 | @Override | |
20 | public List<GameSnapshot> getAllGamesByStatusAndPlayerId(Status status, UUID playerId) { | |
21 |
1
1. getAllGamesByStatusAndPlayerId : replaced return value with Collections.emptyList for org/hplr/game/core/usecases/service/GetAllGamesByStatusAndPlayerIdUseCaseService::getAllGamesByStatusAndPlayerId → KILLED |
return selectGamesByStatusAndPlayerIdQueryInterface |
22 | .selectGamesByStatusAndPlayerId(status, playerId) | |
23 | .stream() | |
24 | .map(Game::fromDto) | |
25 | .map(Game::toSnapshot) | |
26 | .toList(); | |
27 | } | |
28 | } | |
Mutations | ||
21 |
1.1 |