-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[DEL] 필요 없는 order 관련 로직 및 필드 삭제
- Loading branch information
Showing
20 changed files
with
158 additions
and
304 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 5 additions & 8 deletions
13
src/main/java/com/sports/server/query/application/GameTeamQueryService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,31 @@ | ||
package com.sports.server.query.application; | ||
|
||
import static java.util.Comparator.comparingLong; | ||
|
||
import com.sports.server.command.game.domain.Game; | ||
import com.sports.server.command.game.domain.GameTeam; | ||
import com.sports.server.query.dto.response.GameTeamCheerResponseDto; | ||
import com.sports.server.common.application.EntityUtils; | ||
import com.sports.server.query.dto.response.GameTeamCheerResponseDto; | ||
import com.sports.server.query.repository.GameTeamQueryRepository; | ||
import java.util.List; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.stereotype.Service; | ||
import org.springframework.transaction.annotation.Transactional; | ||
|
||
import java.util.List; | ||
|
||
import static java.util.Comparator.comparingLong; | ||
|
||
@Service | ||
@RequiredArgsConstructor | ||
@Transactional(readOnly = true) | ||
public class GameTeamQueryService { | ||
|
||
private final GameTeamQueryRepository gameTeamQueryRepository; | ||
private final GameTeamServiceUtils gameTeamServiceUtils; | ||
private final EntityUtils entityUtils; | ||
|
||
public List<GameTeamCheerResponseDto> getCheerCountOfGameTeams(final Long gameId) { | ||
Game game = entityUtils.getEntity(gameId, Game.class); | ||
|
||
return gameTeamQueryRepository.findAllByGame(game).stream() | ||
.sorted(comparingLong(GameTeam::getId)) | ||
.map(gameTeam -> new GameTeamCheerResponseDto(gameTeam, | ||
gameTeamServiceUtils.calculateOrderOfGameTeam(game, gameTeam))) | ||
.map(gameTeam -> new GameTeamCheerResponseDto(gameTeam)) | ||
.toList(); | ||
} | ||
} |
58 changes: 0 additions & 58 deletions
58
src/main/java/com/sports/server/query/application/GameTeamServiceUtils.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.