Skip to content

Commit

Permalink
[refactor] 안쓰는 메소드 제거 42organization#567
Browse files Browse the repository at this point in the history
  • Loading branch information
Heo Namjun authored and Heo Namjun committed Jan 29, 2023
1 parent d6a1f6b commit c7fd573
Showing 1 changed file with 0 additions and 52 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,58 +71,6 @@ public GameResultResponseDto gameResult(@ModelAttribute @Valid GameResultPageReq
return gameResultResponse;
}

@GetMapping(value = "/games/normal")
public GameResultResponseDto gameNormalResult(@ModelAttribute @Valid GameResultPageRequestDto requestDto, HttpServletRequest request) {
tokenService.findUserByAccessToken(HeaderUtil.getAccessToken(request));

GameFindDto gameFindDto = getGameFindDto(requestDto, Mode.NORMAL);
GameResultListDto resultPageDto = gameService.v1_findGamesAfterId(gameFindDto);

List<GameResultDto> gameResultList = new ArrayList<>();
List<GameDto> gameLists = resultPageDto.getGameList();
gameResponseManager.putResultInGames(gameResultList, gameLists, null);

Integer lastGameId;
if (gameLists.size() == 0) {
lastGameId = 0;
} else {
lastGameId = gameLists.get(gameLists.size() - 1).getId();
}

GameResultResponseDto gameResultResponse = GameResultResponseDto.builder()
.games(gameResultList)
.lastGameId(lastGameId)
.isLast(resultPageDto.getIsLast())
.build();
return gameResultResponse;
}

@GetMapping(value = "/games/rank")
public GameResultResponseDto gameRankResult(@ModelAttribute @Valid GameResultPageRequestDto requestDto, HttpServletRequest request) {
tokenService.findUserByAccessToken(HeaderUtil.getAccessToken(request));

GameFindDto gameFindDto = getGameFindDto(requestDto, Mode.RANK);
GameResultListDto resultPageDto = gameService.v1_findGamesAfterId(gameFindDto);

List<GameResultDto> gameResultList = new ArrayList<>();
List<GameDto> gameLists = resultPageDto.getGameList();
gameResponseManager.putResultInGames(gameResultList, gameLists, null);

Integer lastGameId;
if (gameLists.size() == 0) {
lastGameId = 0;
} else {
lastGameId = gameLists.get(gameLists.size() - 1).getId();
}

GameResultResponseDto gameResultResponse = GameResultResponseDto.builder()
.games(gameResultList)
.lastGameId(lastGameId)
.isLast(resultPageDto.getIsLast())
.build();
return gameResultResponse;
}

@PostMapping(value = "/games/result/normal")
public synchronized void gameNormalSave(HttpServletRequest request) {
UserDto user = tokenService.findUserByAccessToken(HeaderUtil.getAccessToken(request));
Expand Down

0 comments on commit c7fd573

Please sign in to comment.