From 2c4fd39281c94206107ae5a2e7034ad01717d66c Mon Sep 17 00:00:00 2001 From: kimnamgyu Date: Mon, 18 Mar 2024 12:44:13 +0900 Subject: [PATCH] =?UTF-8?q?feat=20#96:=20=EC=BD=94=EB=94=A9=ED=85=8C?= =?UTF-8?q?=EC=8A=A4=ED=8A=B8=20=EC=8B=9C=EC=9E=91/=EC=A2=85=EB=A3=8C=20?= =?UTF-8?q?=EC=8B=9C=20=EB=B0=A9=EC=9E=A5=20=EA=B2=80=EC=A6=9D=ED=95=98?= =?UTF-8?q?=EB=8A=94=20=EB=A1=9C=EC=A7=81=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../algobaroapi/domain/chat/service/ChatServiceImpl.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/ei/algobaroapi/domain/chat/service/ChatServiceImpl.java b/src/main/java/ei/algobaroapi/domain/chat/service/ChatServiceImpl.java index d2dab00..f839c8a 100644 --- a/src/main/java/ei/algobaroapi/domain/chat/service/ChatServiceImpl.java +++ b/src/main/java/ei/algobaroapi/domain/chat/service/ChatServiceImpl.java @@ -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( @@ -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); + } }