Skip to content

Commit

Permalink
fix: ChattingController 인증 유저 정보 사용
Browse files Browse the repository at this point in the history
  • Loading branch information
koreaioi committed Nov 13, 2024
1 parent 80dfb7c commit 716607e
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -24,16 +25,17 @@ public class ChattingController {

@GetMapping("/chatting/{roomId}/{page}/{size}")
@Operation(summary = "하나의 채팅방 + 해당 채팅 내역 조회")
public ResponseDto<ChattingDto> findChatting(@PathVariable Long roomId, @PathVariable Integer page, @PathVariable Integer size) {
ChattingDto response = chattingService.getChatRoom(roomId, page, size);
public ResponseDto<ChattingDto> 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<List<ChattingListResponseDto>> findChattingList(@PathVariable Long userId){
List<ChattingListResponseDto> response = chattingService.getChattingList(userId);
public ResponseDto<List<ChattingListResponseDto>> findChattingList(@PathVariable Long userId, @AuthenticationPrincipal String email){
List<ChattingListResponseDto> response = chattingService.getChattingList(userId, email);
return ResponseDto.response(CHATTINGLIST_GET.getCode(), CHATTINGLIST_GET.getMessage(), response);
}

Expand Down

0 comments on commit 716607e

Please sign in to comment.