From 313f17e7e296eed7c2538fdd09e59b7592960114 Mon Sep 17 00:00:00 2001 From: pgd Date: Mon, 30 Dec 2024 21:45:32 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EC=B1=84=ED=8C=85=EB=B0=A9=20=EA=B2=80?= =?UTF-8?q?=EC=83=89=20=EC=97=94=EB=93=9C=ED=8F=AC=EC=9D=B8=ED=8A=B8=20?= =?UTF-8?q?=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chat/controller/ChatRestController.java | 24 ++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/hf/healthfriend/domain/chat/controller/ChatRestController.java b/src/main/java/com/hf/healthfriend/domain/chat/controller/ChatRestController.java index 128678ed..56b6a072 100644 --- a/src/main/java/com/hf/healthfriend/domain/chat/controller/ChatRestController.java +++ b/src/main/java/com/hf/healthfriend/domain/chat/controller/ChatRestController.java @@ -1,13 +1,31 @@ package com.hf.healthfriend.domain.chat.controller; +import com.hf.healthfriend.domain.chat.constant.ChatroomListSearchCondition; +import com.hf.healthfriend.domain.chat.dto.response.ChatroomListResponseDto; import com.hf.healthfriend.domain.chat.service.ChatService; +import com.hf.healthfriend.global.spec.ApiBasicResponse; import lombok.RequiredArgsConstructor; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.*; + +import java.util.List; @RestController -@RequestMapping("/hf/chat") +@RequestMapping("/hf") @RequiredArgsConstructor public class ChatRestController { private final ChatService chatService; + + @GetMapping("/members/{participantId}/chatrooms") + public ResponseEntity>> getChatroomList( + @PathVariable("participantId") Long participantId, + @RequestParam("searchCondition") ChatroomListSearchCondition searchCondition, + @RequestParam(value = "page", required = false) Integer page, + @RequestParam(value = "pageSize", required = false) Integer pageSize + ) { + return ResponseEntity.ok( + ApiBasicResponse.of(this.chatService.getChatroomList(participantId, searchCondition, page, pageSize), HttpStatus.OK) + ); + } }