Skip to content

Commit

Permalink
refactor: 메서드 이름 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
DrRivaski committed Aug 16, 2024
1 parent a77cacb commit 9e8f745
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ public DrawMainResponseDto getDrawMainPageInfo(Integer userId) {

if (drawParticipationCount == 7) {
// 7일 연속 출석자라면
return drawResponseGenerateUtil.responseMainFullAttend(invitedNum, remainDrawCount, drawParticipationCount);
return drawResponseGenerateUtil.generateMainFullAttendResponse(invitedNum, remainDrawCount, drawParticipationCount);
} else {
// 연속 출석자가 아니라면
return drawResponseGenerateUtil.responseMainNotAttend(invitedNum, remainDrawCount, drawParticipationCount);
return drawResponseGenerateUtil.generateMainNotAttendResponse(invitedNum, remainDrawCount, drawParticipationCount);
}
}

Expand All @@ -70,7 +70,7 @@ public DrawModalResponseDto participateDrawEvent(Integer userId) {

// 만약 남은 참여 기회가 0이라면
if (shareInfo.getRemainDrawCount() == 0) {
return drawResponseGenerateUtil.responseLoseModal(userId);
return drawResponseGenerateUtil.generateDrawLoserResponse(userId);
}

increaseDrawParticipationCount(); // 추첨 이벤트 참여자수 증가
Expand All @@ -80,7 +80,7 @@ public DrawModalResponseDto participateDrawEvent(Integer userId) {
int ranking = getRankingIfWinner(userId); // 당첨 목록에 존재한다면 랭킹 반환
if (ranking != 0) {
drawParticipationInfoRepository.increaseLoseCount(userId); // 낙첨 횟수 증가
return drawResponseGenerateUtil.responseLoseModal(userId); // LoseModal 반환
return drawResponseGenerateUtil.generateDrawLoserResponse(userId); // LoseModal 반환
}

// 당첨자 수 조회
Expand Down Expand Up @@ -110,15 +110,15 @@ public DrawModalResponseDto participateDrawEvent(Integer userId) {
if (isWinner(userId, ranking, winnerNum)) { // 레디스에 추첨 티켓이 남았다면, 레디스 당첨 목록에 추가
// 추첨 티켓이 다 팔리지 않았다면
drawParticipationInfoRepository.increaseWinCount(userId); // 당첨 횟수 증가
return drawResponseGenerateUtil.responseWinModal(ranking); // WinModal 반환
return drawResponseGenerateUtil.generateDrawWinnerResponse(ranking); // WinModal 반환
} else {
// 추첨 티켓이 다 팔렸다면 로직상 당첨자라도 실패 반환
drawParticipationInfoRepository.increaseLoseCount(userId); // 낙첨 횟수 증가
return drawResponseGenerateUtil.responseLoseModal(userId); // LoseModal 반환
return drawResponseGenerateUtil.generateDrawLoserResponse(userId); // LoseModal 반환
}
} else { // 낙첨자일 경우
drawParticipationInfoRepository.increaseLoseCount(userId); // 낙첨 횟수 증가
return drawResponseGenerateUtil.responseLoseModal(userId); // LoseModal 반환
return drawResponseGenerateUtil.generateDrawLoserResponse(userId); // LoseModal 반환
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class DrawResponseGenerateUtil {
* @param drawParticipationCount 연속 출석 일수
* @return 7일 연속 출석 상품 모달
*/
public DrawMainFullAttendResponseDto responseMainFullAttend(int invitedNum, int remainDrawCount, int drawParticipationCount) {
public DrawMainFullAttendResponseDto generateMainFullAttendResponse(int invitedNum, int remainDrawCount, int drawParticipationCount) {
return DrawMainFullAttendResponseDto.builder()
.invitedNum(invitedNum)
.remainDrawCount(remainDrawCount)
Expand All @@ -46,7 +46,7 @@ public DrawMainFullAttendResponseDto responseMainFullAttend(int invitedNum, int
* @param drawParticipationCount 연속 출석 일수
* @return 7일 미만 출석 상품 모달
*/
public DrawMainResponseDto responseMainNotAttend(int invitedNum, int remainDrawCount, int drawParticipationCount) {
public DrawMainResponseDto generateMainNotAttendResponse(int invitedNum, int remainDrawCount, int drawParticipationCount) {
return DrawMainResponseDto.builder()
.invitedNum(invitedNum)
.remainDrawCount(remainDrawCount)
Expand All @@ -60,7 +60,7 @@ public DrawMainResponseDto responseMainNotAttend(int invitedNum, int remainDrawC
* @param userId 를 이용하여 공유 url 조회
* @return 낙첨자 응답
*/
public DrawLoseModalResponseDto responseLoseModal(Integer userId) {
public DrawLoseModalResponseDto generateDrawLoserResponse(Integer userId) {
return DrawLoseModalResponseDto.builder()
.isDrawWin(false)
.images(drawUtil.generateLoseImages())
Expand All @@ -73,7 +73,7 @@ public DrawLoseModalResponseDto responseLoseModal(Integer userId) {
*
* @return 당첨자 응답
*/
public DrawWinModalResponseDto responseWinModal(int ranking) {
public DrawWinModalResponseDto generateDrawWinnerResponse(int ranking) {
return DrawWinModalResponseDto.builder()
.isDrawWin(true)
.images(drawUtil.generateWinImages())
Expand Down

0 comments on commit 9e8f745

Please sign in to comment.