Skip to content

Commit

Permalink
chore: conflict 해결
Browse files Browse the repository at this point in the history
  • Loading branch information
k000927 committed Aug 23, 2024
1 parent e54c111 commit 6983ef0
Showing 1 changed file with 4 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,17 +94,13 @@ public void apply(BaseUser user, int optionId) {
// 진행중인 게임의 응모 비율 반환
public RushEventResultResponseDto getRushEventRate(BaseUser user) {
LocalDate today = LocalDate.now();

Long todayEventId = eventCacheService.getTodayEvent(today).rushEventId();

// 해당 유저의 optionId 를 가져옴
int optionId = eventCacheService.getOptionId(today, user.getPhoneNumber());
Long todayEventId = eventCacheService.getTodayEvent(today).getRushEventId();
Optional<Integer> optionId = rushParticipantsRepository.getOptionIdByUserId(user.getPhoneNumber());

long leftOptionCount = rushParticipantsRepository.countByRushEvent_RushEventIdAndOptionId(todayEventId, 1);
long rightOptionCount = rushParticipantsRepository.countByRushEvent_RushEventIdAndOptionId(todayEventId, 2);

return new RushEventRateResponseDto(
optionId,
return RushEventResultResponseDto.of(optionId.orElseThrow(() -> new CustomException("유저가 응모한 선택지가 존재하지 않습니다.", CustomErrorCode.USER_NOT_FOUND)),
leftOptionCount, rightOptionCount);
}

Expand Down Expand Up @@ -233,11 +229,8 @@ public void setRushEvents() {
rushEvents.add(rushEvent);
}

LocalDate today = LocalDate.now();

eventCacheService.setCacheValue(today);
eventCacheService.setCacheValue(LocalDate.now());
eventCacheService.setAllRushEvent();
eventCacheService.clearUserOptionCache();
rushEventRedisService.clearAllrushEventRate();
}

Expand Down

0 comments on commit 6983ef0

Please sign in to comment.