diff --git a/src/main/java/com/leets/X/domain/chat/controller/ChatRoomController.java b/src/main/java/com/leets/X/domain/chat/controller/ChatRoomController.java index 8654d30..2480050 100644 --- a/src/main/java/com/leets/X/domain/chat/controller/ChatRoomController.java +++ b/src/main/java/com/leets/X/domain/chat/controller/ChatRoomController.java @@ -4,6 +4,7 @@ import com.leets.X.domain.chat.dto.response.ChatRoomResponseDto; import com.leets.X.domain.chat.service.ChatRoomService; import com.leets.X.global.common.response.ResponseDto; +import io.swagger.v3.oas.annotations.Operation; import jakarta.validation.Valid; import jakarta.validation.constraints.NotNull; import lombok.RequiredArgsConstructor; @@ -21,6 +22,7 @@ public class ChatRoomController { private final ChatRoomService chatRoomService; @PostMapping + @Operation(summary = "채팅 방 생성") public ResponseDto createChatRoom(@RequestBody @Valid FindChatRoomRequestDto findChatRoomRequestDto){ ChatRoomResponseDto response = chatRoomService.saveChatRoom(findChatRoomRequestDto); return ResponseDto.response(CHATROOM_CREATE_SUCCESS.getCode(), CHATROOM_CREATE_SUCCESS.getMessage(), response); @@ -30,6 +32,7 @@ public ResponseDto createChatRoom(@RequestBody @Valid FindC // user1Id와 user2Id의 채팅방이 있는 지 조회 @GetMapping("/{user1Id}/{user2Id}") + @Operation(summary = "채팅방 존재 여부 확인") public ResponseDto existChatRoom(@PathVariable Long user1Id, @PathVariable Long user2Id){ ChatRoomResponseDto response = chatRoomService.findUser1User2ChatRoom(user1Id , user2Id); @@ -37,6 +40,7 @@ public ResponseDto existChatRoom(@PathVariable Long user1Id } @PostMapping("/{roomId}") // addListener 테스트 용 + @Operation(summary = "채팅 방 addListener 테스트") public void addListener(@PathVariable @NotNull Long roomId) { chatRoomService.addListener(roomId); log.info(roomId+":addListener"); 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 378b2d1..9bc9d4d 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 @@ -4,6 +4,7 @@ import com.leets.X.domain.chat.dto.response.ChattingListResponseDto; import com.leets.X.domain.chat.service.ChattingService; import com.leets.X.global.common.response.ResponseDto; +import io.swagger.v3.oas.annotations.Operation; import lombok.RequiredArgsConstructor; import org.springframework.web.bind.annotation.*; @@ -19,8 +20,8 @@ public class ChattingController { private final ChattingService chattingService; - // 채팅방 하나를 조회해준다. (대화 내역을 돌려준다는 의미) @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); return ResponseDto.response(CHATROOM_GET.getCode(), CHATROOM_GET.getMessage(), response); @@ -28,6 +29,7 @@ public ResponseDto findChatting(@PathVariable Long roomId, @PathVar @GetMapping("/chattingList/{userId}") + @Operation(summary = "유저가 속한 모든 채팅방 조회") public ResponseDto> findChattingList(@PathVariable Long userId){ List response = chattingService.getChattingList(userId); return ResponseDto.response(CHATTINGLIST_GET.getCode(), CHATTINGLIST_GET.getMessage(), response);