From aa58794535292cef5077e042f0bed6fbc730dbce Mon Sep 17 00:00:00 2001 From: hs12 Date: Fri, 27 Sep 2024 10:01:34 +0900 Subject: [PATCH] =?UTF-8?q?[style]=20:=20=EC=BD=94=EB=93=9C=20=EB=A6=AC?= =?UTF-8?q?=ED=8F=AC=EB=A9=A7=ED=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/dnd/gongmuin/chat/service/ChatRoomService.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/dnd/gongmuin/chat/service/ChatRoomService.java b/src/main/java/com/dnd/gongmuin/chat/service/ChatRoomService.java index c4732855..1008ed00 100644 --- a/src/main/java/com/dnd/gongmuin/chat/service/ChatRoomService.java +++ b/src/main/java/com/dnd/gongmuin/chat/service/ChatRoomService.java @@ -67,7 +67,7 @@ public ChatRoomDetailResponse createChatRoom(CreateChatRoomRequest request, Memb } @Transactional(readOnly = true) - public ChatRoomDetailResponse getChatRoomById(Long chatRoomId, Member member){ + public ChatRoomDetailResponse getChatRoomById(Long chatRoomId, Member member) { ChatRoom chatRoom = getChatRoomById(chatRoomId); Member chatPartner = getChatPartner(member.getId(), chatRoom); return ChatRoomMapper.toChatRoomDetailResponse(chatRoom, chatPartner); @@ -106,11 +106,10 @@ private Member getMemberById(Long id) { .orElseThrow(() -> new NotFoundException(MemberErrorCode.NOT_FOUND_MEMBER)); } - private Member getChatPartner(Long memberId, ChatRoom chatRoom){ - if (Objects.equals(chatRoom.getAnswerer().getId(), memberId)){ + private Member getChatPartner(Long memberId, ChatRoom chatRoom) { + if (Objects.equals(chatRoom.getAnswerer().getId(), memberId)) { return chatRoom.getInquirer(); - } - else if (Objects.equals(chatRoom.getInquirer().getId(), memberId)){ + } else if (Objects.equals(chatRoom.getInquirer().getId(), memberId)) { return chatRoom.getAnswerer(); } else { throw new ValidationException(ChatErrorCode.UNAUTHORIZED_CHAT_ROOM);