Skip to content

Commit

Permalink
feat #96: 코딩테스트 시작/종료 시 방장 검증하는 로직 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
GiHoo committed Mar 18, 2024
1 parent 6eeca4c commit 2c4fd39
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ public void changeHostManually(

@Override
public void startCodingTest(String roomShortUuid, Long memberId) {
checkMemberIsHost(roomShortUuid, memberId);

RoomDetailResponseDto roomDetailResponseDto = roomService.startCodingTest(roomShortUuid);
Integer timeLimitMinute = roomDetailResponseDto.getTimeLimit();
messageService.sendMessage(
Expand All @@ -85,7 +87,13 @@ public void startCodingTest(String roomShortUuid, Long memberId) {

@Override
public void endCodingTest(String roomShortUuid, Long memberId) {
checkMemberIsHost(roomShortUuid, memberId);

roomService.completeSolveHistory(roomShortUuid);
messageService.sendMessage(roomShortUuid, MessageResponse.endCoding(memberId));
}

private void checkMemberIsHost(String roomShortUuid, Long memberId) {
roomMemberService.validateHost(roomShortUuid, memberId);
}
}

0 comments on commit 2c4fd39

Please sign in to comment.