Skip to content

Commit 6a0c81c

Browse files
committed
[fix] #274 admin page 에서 사용할 api 수정
1 parent b878acd commit 6a0c81c

3 files changed

Lines changed: 5 additions & 3 deletions

File tree

src/main/java/com/gg/server/admin/game/data/GameAdminRepository.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ public interface GameAdminRepository extends JpaRepository<Game, Long> {
2323
"from v_rank_game_detail t1, v_rank_game_detail t2 " +
2424
"where t1.gameId IN (:games) and t1.teamId <t2.teamId and t1.gameId=t2.gameId order by t1.startTime desc;", nativeQuery = true)
2525
List<GameTeamUser> findTeamsByGameIsIn(@Param("games") List<Long> games);
26-
27-
Page<Game> findAllByStatus(Pageable pageable, StatusType status);
2826
@Query(value = "SELECT g FROM Game g, Team t, TeamUser tu WHERE g.status = :status AND g.id = t.game.id"
2927
+ " AND t.id = tu.team.id AND tu.user.id = :userId")
3028
Optional<Game> findByStatusTypeAndUserId(@Param("status") StatusType status, @Param("userId") Long userId);

src/main/java/com/gg/server/admin/game/dto/GameLogAdminDto.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.gg.server.admin.game.dto;
22

33
import com.gg.server.domain.game.dto.GameTeamUser;
4+
import com.gg.server.domain.game.type.StatusType;
45
import lombok.AllArgsConstructor;
56
import lombok.Getter;
67
import lombok.NoArgsConstructor;
@@ -16,6 +17,7 @@ public class GameLogAdminDto {
1617
private LocalDateTime startAt;
1718
private String slotTime;
1819
private String mode;
20+
private StatusType status;
1921
private GameTeamAdminDto team1;
2022
private GameTeamAdminDto team2;
2123

@@ -27,5 +29,6 @@ public GameLogAdminDto(GameTeamUser game) {
2729
this.mode = game.getMode().getCode();
2830
this.team1 = new GameTeamAdminDto(game.getT1IntraId(), game.getT1TeamId(), game.getT1Score(), game.getT1IsWin());
2931
this.team2 = new GameTeamAdminDto(game.getT2IntraId(), game.getT2TeamId(), game.getT2Score(), game.getT2IsWin());
32+
this.status = game.getStatus();
3033
}
3134
}

src/main/java/com/gg/server/admin/game/service/GameAdminService.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import com.gg.server.domain.user.User;
3030
import com.gg.server.domain.user.UserRepository;
3131
import com.gg.server.domain.user.exception.UserNotFoundException;
32+
import java.util.Arrays;
3233
import lombok.RequiredArgsConstructor;
3334
import lombok.extern.slf4j.Slf4j;
3435
import org.springframework.cache.annotation.CacheEvict;
@@ -57,7 +58,7 @@ public class GameAdminService {
5758

5859
@Transactional(readOnly = true)
5960
public GameLogListAdminResponseDto findAllGamesByAdmin(Pageable pageable) {
60-
Page<Game> gamePage = gameAdminRepository.findAllByStatus(pageable, StatusType.END); //모든 게임 정보 가져오기
61+
Page<Game> gamePage = gameAdminRepository.findAll(pageable); //모든 게임 정보 가져오기
6162
return new GameLogListAdminResponseDto(getGameLogList(gamePage.getContent().stream().map(Game::getId).collect(Collectors.toList())), gamePage.getTotalPages());
6263
}
6364

0 commit comments

Comments
 (0)