feat: 매칭 플로우 프론트 (진행중·알림·수락/거절·1:1 채팅)
CI / build (push) Failing after 14m12s

- 매칭 버튼: 신청 후 "진행중" 표시, 무료 소진(429) 안내
- 헤더 알림 벨: 받은 매칭 신청 목록 + 수락/거절
- 실시간 알림: STOMP /topic/users/{id} 구독(신청/수락/거절/만료 토스트)
- 수락 시 1:1 매칭 채팅(MatchChatDialog, /topic/matches/{id})

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
sb
2026-07-11 15:04:21 +09:00
parent 12dd26c47f
commit cc3a0fa836
7 changed files with 459 additions and 5 deletions
+4 -1
View File
@@ -2,7 +2,8 @@ import { http } from './http'
export interface ChatMessage {
id: number
spotId: number
spotId: number | null
matchId: number | null
senderId: number
senderNickname: string
content: string
@@ -11,4 +12,6 @@ export interface ChatMessage {
export const chatApi = {
history: (spotId: number) => http.get<ChatMessage[]>(`/api/chat/spots/${spotId}/messages`),
matchHistory: (matchId: number) =>
http.get<ChatMessage[]>(`/api/chat/matches/${matchId}/messages`),
}
+21 -1
View File
@@ -6,13 +6,33 @@ export interface Match {
targetDogId: number
status: string
createdAt: string
expiresAt: string | null
respondedAt: string | null
}
/** 받은 매칭 신청 (신청 견 정보 포함) — 수락/거절 UI용. */
export interface ReceivedMatch {
id: number
requesterDogId: number
requesterDogName: string
requesterDogBreed: string | null
createdAt: string
expiresAt: string | null
}
/** STOMP /topic/users/{userId} 로 오는 매칭 알림. */
export interface MatchNotification {
type: 'NEW_REQUEST' | 'ACCEPTED' | 'REJECTED' | 'EXPIRED'
matchId: number
title: string
message: string
}
export const matchesApi = {
create: (requesterDogId: number, targetDogId: number) =>
http.post<Match>('/api/matches', { requesterDogId, targetDogId }),
accept: (id: number) => http.post<Match>(`/api/matches/${id}/accept`),
reject: (id: number) => http.post<Match>(`/api/matches/${id}/reject`),
received: (dogId: number) => http.get<Match[]>(`/api/matches/received/${dogId}`),
received: (dogId: number) => http.get<ReceivedMatch[]>(`/api/matches/received/${dogId}`),
sent: (dogId: number) => http.get<Match[]>(`/api/matches/sent/${dogId}`),
}