Skip to content

Commit

Permalink
feat: 채팅방 검색 엔드포인트 구현
Browse files Browse the repository at this point in the history
  • Loading branch information
rudeh1253 committed Dec 30, 2024
1 parent 24faa92 commit 313f17e
Showing 1 changed file with 21 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -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<ApiBasicResponse<List<ChatroomListResponseDto>>> 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)
);
}
}

0 comments on commit 313f17e

Please sign in to comment.