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); }