diff --git a/src/main/java/capstone/facefriend/chat/aop/ChatAop.java b/src/main/java/capstone/facefriend/chat/aop/ChatAop.java index 5195d272c4..f1dc47569a 100644 --- a/src/main/java/capstone/facefriend/chat/aop/ChatAop.java +++ b/src/main/java/capstone/facefriend/chat/aop/ChatAop.java @@ -31,7 +31,6 @@ import java.io.ByteArrayOutputStream; import java.io.IOException; import java.lang.reflect.Method; -import java.util.Arrays; import static capstone.facefriend.chat.exception.ChatExceptionType.NOT_FOUND_CHAT_ROOM_MEMBER; import static capstone.facefriend.member.exception.member.MemberExceptionType.NOT_FOUND; @@ -78,10 +77,10 @@ public void afterSendHeart(JoinPoint joinPoint) throws IOException { Long receiveId = -1L; for (int i = 0; i < method.getParameters().length; i++) { String paramName = method.getParameters()[i].getName(); - if (paramName.equals("arg0")) { + if (paramName.equals("senderId")) { senderId = (Long) params[i]; } - if (paramName.equals("arg1")) { + if (paramName.equals("receiveId")) { receiveId = (Long) params[i]; } } @@ -131,7 +130,7 @@ public void beforeSaveChatMessage(JoinPoint joinPoint) throws IOException { ChatMessage chatMessage = null; for (int i = 0; i < method.getParameters().length; i++) { String paramName = method.getParameters()[i].getName(); - if (paramName.equals("arg0")) { + if (paramName.equals("chatMessage")) { chatMessage = (ChatMessage) params[i]; } } @@ -210,10 +209,10 @@ public void beforeLeftRoom(JoinPoint joinPoint) { Long memberId = null; for (int i = 0; i < method.getParameters().length; i++) { String paramName = method.getParameters()[i].getName(); - if (paramName.equals("arg0")) { + if (paramName.equals("roomId")) { roomId = (Long) params[i]; } - if (paramName.equals("arg1")) { + if (paramName.equals("memberId")) { memberId = (Long) params[i]; } } @@ -272,4 +271,4 @@ private ChatRoomMember findChatRoomMemberByRoomId(Long roomId) { return chatRoomMemberRepository.findByChatRoomId(roomId) .orElseThrow(() -> new ChatException(NOT_FOUND_CHAT_ROOM_MEMBER)); // 영속 } -} +} \ No newline at end of file