feat: 실시간 채팅 UI (STOMP 연동)
- ChatDialog: 히스토리 로드 + 실시간 송수신, 내 메시지 우측 정렬, 연결상태 표시 - lib/chatSocket: STOMP 클라이언트(브로커 ws, Bearer 인증, 자동 재연결) - api/chat 히스토리, HomePage 스팟 채팅 버튼 - @stomp/stompjs 의존성 추가 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
import { http } from './http'
|
||||
|
||||
export interface ChatMessage {
|
||||
id: number
|
||||
spotId: number
|
||||
senderId: number
|
||||
senderNickname: string
|
||||
content: string
|
||||
createdAt: string
|
||||
}
|
||||
|
||||
export const chatApi = {
|
||||
history: (spotId: number) => http.get<ChatMessage[]>(`/api/chat/spots/${spotId}/messages`),
|
||||
}
|
||||
Reference in New Issue
Block a user