채팅메시지 리스트 조회 (오래된 메시지 조회)
채팅메시지 리스트 조회 API (이전 메시지 조회)
RDBMS에서 가져오는 채팅메시지 리스트 데이터로 최초진입시 조회 후 스크롤을 위로 올려 오래된 메시지를 조회할 때 사용되는 API 이다.
정렬 순은 최신 순이다.
페이지 요청은 2페이지부터 해야 최초 리스트 조회 데이터와 겹치지 않는다.
GET
/chat/api/v1/msg/{chatRoomId}/{page}
PathVariable
chatRoomId : 채팅방 고유번호
page: 페이지
Request Headers
Name
Value
Accept
application/json
Cookie
리프레시 토큰
Access
액세스 토큰
Response
{
"status": 200,
"code": "SUCCESS REQUEST",
"data": [
{
"chatRoomId": "12",
"message": "4",
"msgCrDateMs": "2025-01-03 21:47:14.992752",
"msgCrDate": "2025-01-03 21:47:00",
"read": true,
"chatType": "TEXT",
"nickName": "하하1"
},
{
"chatRoomId": "12",
"message": "4",
"msgCrDateMs": "2025-01-03 21:47:14.902688",
"msgCrDate": "2025-01-03 21:47:00",
"read": true,
"chatType": "TEXT",
"nickName": "하하1"
},
{
"chatRoomId": "12",
"message": "3",
"msgCrDateMs": "2025-01-03 21:47:12.826259",
"msgCrDate": "2025-01-03 21:47:00",
"read": true,
"chatType": "TEXT",
"nickName": "하하1"
},
{
"chatRoomId": "12",
"message": "2",
"msgCrDateMs": "2025-01-03 21:47:11.274543",
"msgCrDate": "2025-01-03 21:47:00",
"read": true,
"chatType": "TEXT",
"nickName": "하하1"
},
{
"chatRoomId": "12",
"message": "1",
"msgCrDateMs": "2025-01-03 21:47:08.774614",
"msgCrDate": "2025-01-03 21:47:00",
"read": true,
"chatType": "TEXT",
"nickName": "하하1"
}
],
"timestamp": "2025-01-04 01:44:03"
}
Response(Validation)
{
"status": 400,
"message": "채팅방 고유번호는 정수, 1이상이여야 합니다.",
"code": "ERR-CHAT-API-VALI-01",
"timestamp": "2024-11-16 02:00:18"
}
Last updated