From 716607e9a1d2d429ffe7018b37f628b782f48e2e Mon Sep 17 00:00:00 2001 From: koreaioi Date: Wed, 13 Nov 2024 18:46:28 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20ChattingController=20=EC=9D=B8=EC=A6=9D?= =?UTF-8?q?=20=EC=9C=A0=EC=A0=80=20=EC=A0=95=EB=B3=B4=20=EC=82=AC=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../X/domain/chat/controller/ChattingController.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/leets/X/domain/chat/controller/ChattingController.java b/src/main/java/com/leets/X/domain/chat/controller/ChattingController.java index 541a338..cb6fdd9 100644 --- a/src/main/java/com/leets/X/domain/chat/controller/ChattingController.java +++ b/src/main/java/com/leets/X/domain/chat/controller/ChattingController.java @@ -7,6 +7,7 @@ import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import lombok.RequiredArgsConstructor; +import org.springframework.security.core.annotation.AuthenticationPrincipal; import org.springframework.web.bind.annotation.*; import java.util.List; @@ -24,16 +25,17 @@ public class ChattingController { @GetMapping("/chatting/{roomId}/{page}/{size}") @Operation(summary = "하나의 채팅방 + 해당 채팅 내역 조회") - public ResponseDto findChatting(@PathVariable Long roomId, @PathVariable Integer page, @PathVariable Integer size) { - ChattingDto response = chattingService.getChatRoom(roomId, page, size); + public ResponseDto findChatting(@PathVariable Long roomId, @PathVariable Integer page, + @PathVariable Integer size, @AuthenticationPrincipal String email) { + ChattingDto response = chattingService.getChatRoom(roomId, page, size, email); return ResponseDto.response(CHATROOM_GET.getCode(), CHATROOM_GET.getMessage(), response); } @GetMapping("/chattingList/{userId}") @Operation(summary = "유저가 속한 모든 채팅방 조회") - public ResponseDto> findChattingList(@PathVariable Long userId){ - List response = chattingService.getChattingList(userId); + public ResponseDto> findChattingList(@PathVariable Long userId, @AuthenticationPrincipal String email){ + List response = chattingService.getChattingList(userId, email); return ResponseDto.response(CHATTINGLIST_GET.getCode(), CHATTINGLIST_GET.getMessage(), response); }