Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEAT] 다음 라운드 넘어가기 API #75

Merged
merged 8 commits into from
Jul 26, 2024
Merged

[FEAT] 다음 라운드 넘어가기 API #75

merged 8 commits into from
Jul 26, 2024

Conversation

leegwichan
Copy link
Contributor

Issue Number

Closed #63

As-Is

다음 라운드 넘어가는 API 필요

To-Be

다음 라운드 넘어가는 API 구현

Check List

  • 테스트가 전부 통과되었나요?
  • 모든 commit이 push 되었나요?
  • merge할 branch를 확인했나요?
  • Assignee를 지정했나요?
  • Label을 지정했나요?

Test Screenshot

image

(Optional) Additional Description

  • RoomService에 생성한 로직이 BalanceVoteService와 동일한 코드가 존재
    • 주말 간 고민 후 Sprint 3에 논의

@leegwichan leegwichan added ✨ feat 기능 추가 🍃 BE back end labels Jul 25, 2024
@leegwichan leegwichan self-assigned this Jul 25, 2024
@PgmJun PgmJun requested review from PgmJun, jhon3242 and GIVEN53 and removed request for PgmJun and jhon3242 July 25, 2024 13:20
@PgmJun PgmJun added this to the BE Sprint2 milestone Jul 25, 2024
Copy link
Member

@PgmJun PgmJun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수고하셨습니다 커찬 몇 가지 의견을 남겼습니다:)

Comment on lines 29 to 35

@GetMapping("/balances/rooms/{roomId}/members")
public ResponseEntity<RoomMembersResponse> getAllBalanceGameRoomMember(@Positive @PathVariable Long roomId) {
RoomMembersResponse response = roomService.findAllRoomMember(roomId);

return ResponseEntity.ok(response);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

의견) 이거 제가 ResponseEntity 사용 관련해서 정해진게 없을 때 구현했던 코드인데 혹시 ResponseEntity로 감싼 부분 제거해주실 수 있는지 간곡한 요청을 드립니다..

Comment on lines 77 to 78
private RoomContent findCurrentRoomContent(Long roomId) {
Room room = roomRepository.getById(roomId);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

질문) roomRepository에서 roomId로 이미 room을 찾아오는데 여기서 또 다시 조회하는 이유가 궁금합니다~!
이미 찾은 room만 받아도 되지않을까요?

Comment on lines +32 to +49
@Test
void 마지막_라운드_일_경우_예외를_던진다() {
// given
Room room = new Room();
goToFinalRound(room);

// when & then
assertThatThrownBy(() -> room.moveToNextRound())
.isInstanceOf(BadRequestException.class)
.hasMessage("마지막 라운드입니다.");
}

private void goToFinalRound(Room room) {
for (int round = START_ROUND; round < TOTAL_ROUND; round++) {
room.moveToNextRound();
}
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

의견) 이후에 Room의 total_round를 생성자를 통해 입력하게 되면 이 테스트는 터지게될 수도 있으니 주의가 필요할 것 같네요.

Copy link
Contributor Author

@leegwichan leegwichan Jul 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아마도 지금 사용하는 생성자를 유지하지 않을까 싶어요. 결국에는 초기 방 생성시에는 TOTAL_ROUND의 기본 값이 필요할 테니까요. 그리고 updateTotalRound() 형식으로 바뀌어지지 않을까요?

미래를 생각하는 힘드니, 지금 이 형식은 유지하고, 나중에 값이 바뀔 수 있을 때 조금 다듬어야 겠네요;;

Copy link
Member

@GIVEN53 GIVEN53 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

굿보이 꺽찬~~ 이든의 코멘트와 의견이 같아서 먼저 approve하겠슴니돠

Copy link
Member

@jhon3242 jhon3242 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM~ 수고했어 커찬~

RoomService, init.sql 및 일부 테스트 데이터 변경
@leegwichan leegwichan merged commit 0a31152 into develop Jul 26, 2024
1 check passed
@leegwichan leegwichan deleted the feat/#63 branch December 9, 2024 06:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍃 BE back end ✨ feat 기능 추가
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[FEAT] 다음 라운드 넘어가기 API
4 participants