Skip to content

Commit

Permalink
Merge pull request #179 from 42organization/GGBE-210-admin-user-detail
Browse files Browse the repository at this point in the history
[fix] GGBE-210 admin user detail 수정
  • Loading branch information
FeFe2200 authored Jul 12, 2023
2 parents acba4bf + d0750ae commit 65dd1f5
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,21 @@ public UserDetailAdminResponseDto(User user, RankRedis rank) {
this.roleType = user.getRoleType().getKey();
this.exp = user.getTotalExp();
}

public UserDetailAdminResponseDto(User user) {
this.userId = user.getId();
this.intraId = user.getIntraId();
this.userImageUri = user.getImageUri();
this.racketType = user.getRacketType().getCode();
this.statusMessage = "";
this.wins = 0;
this.losses = 0;
this.ppp = 0;
this.email = user.getEMail() == null ? "" : user.getEMail();
this.roleType = user.getRoleType().getKey();
this.exp = user.getTotalExp();
}

@Override
public String toString() {
return "UserDetailResponseDto{" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,13 @@ public UserSearchAdminResponseDto findByPartsOfIntraId(String intraId, Pageable
public UserDetailAdminResponseDto getUserDetailByIntraId(String intraId) {
User user = userAdminRepository.findByIntraId(intraId).orElseThrow(() -> new UserNotFoundException());
Season currSeason = seasonAdminRepository.findCurrentSeason(LocalDateTime.now()).orElseThrow(() -> new SeasonNotFoundException());
RankRedis userCurrRank = rankRedisRepository.findRankByUserId(RedisKeyManager.getHashKey(currSeason.getId()),
user.getId());
return new UserDetailAdminResponseDto(user, userCurrRank);
try {
RankRedis userCurrRank = rankRedisRepository.findRankByUserId(RedisKeyManager.getHashKey(currSeason.getId()),
user.getId());
return new UserDetailAdminResponseDto(user, userCurrRank);
} catch (RedisDataNotFoundException e){
return new UserDetailAdminResponseDto(user);
}
}

@Transactional
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public synchronized void cancelMatch(UserDto userDto, LocalDateTime startTime) {
Optional<Game> game = gameRepository.findByStartTime(startTime);
if (game.isPresent()) {
gameUpdateService.delete(game.get(), userDto);//cascade 테스트
penaltyService.givePenalty(userDto, 1);
penaltyService.givePenalty(userDto, 30);
return;
}
deleteUserFromQueue(userDto, startTime);
Expand Down

0 comments on commit 65dd1f5

Please sign in to comment.