채팅방 리스트 조회 - DevCamp2Flame/FlameTalk_Server GitHub Wiki

Chatroom List get API

Request

Method

GET

URL

/api/chatroom?isOpen=true

Header

Method Parameter Description
Content-Type application/json
token {token} access token값

Query Parameter

Parameter Type Description Required
isOpen Boolean 오픈 채팅방 여부 Y

Response

Header

Method Parameter Description
statusCode {statusCode} http 상태 코드 값

Body

Field Type Description
code Integer 응답 코드
message String 응답 메세지
data Object data 참고

data

Field Type Description
userId String 유저 id
userChatrooms Object List userChatrooms 참고

userChatrooms

Field Type Description
chatroomId String 채팅방 id
userChatroomId Long 유저의 채팅방 id
title String 채팅방 이름. 최대 50글자
thumbnail String List 채팅방 썸네일 이미지 리스트. 리스트 최대 길이 4
lastReadMessageId String 채팅방에서 유저가 마지막으로 확인한 채팅 메세지 ID
inputLock Boolean 채팅방 채팅 잠금 정보
count int 채팅방 인원 수

SUCCESS example

{
    "status": 200,
    "messsage": "채팅방 리스트 조회 성공",
    "data": {
        "userId": "1643163512893324414",
        "userChatrooms": [
            {
                "id": 1,
                "title": "김현국, 김다롬, 팀장 박소연, 최수연",
                "thumbnail": [
                    "https://flametalk-bucket.s3.ap-northeast-2.amazonaws.com/profile/flametalk_a_20222621172609.JPG",
                    "https://flametalk-bucket.s3.ap-northeast-2.amazonaws.com/profile/flametalk_b_20222621172609.JPG",
                    "https://flametalk-bucket.s3.ap-northeast-2.amazonaws.com/profile/flametalk_c_20222621172609.JPG",
                    "https://flametalk-bucket.s3.ap-northeast-2.amazonaws.com/profile/flametalk_d_20222621172609.JPG"
                ],
                "lastReadMessageId": "b49c3059-e509-42d7-add2-9156d87a7db3",
                "inputLock" : false,
                "count" : 4,
            },
            {
                "id": 2,
                "title": "토끼굴",
                "thumbnail": [
                    "https://flametalk-bucket.s3.ap-northeast-2.amazonaws.com/profile/flametalk_rabbit_20222621172609.JPG"
                ],
                "last_read_message_id": "b49c3059-e509-42d7-add2-9156d87d7db3",
                "input_lock" : true,
                "count" : 120
            }
        ]
    }
}

Error Code

Code Error Messsage
400 Bad Request
401 Unauthorized
404 File Not Found
500 Server Error

FAIL example

{
    "status": 404,
    "message": "존재하지 않는 유저입니다.",
    "error": "NOT_FOUND",
    "code": "USER_NOT_FOUND",
    "timestamp": "2022-01-18T19:30:16.3072905",
}