From cc3a0fa836392fb93b6b6de2d20607801a430f08 Mon Sep 17 00:00:00 2001 From: sb Date: Sat, 11 Jul 2026 15:04:21 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EB=A7=A4=EC=B9=AD=20=ED=94=8C=EB=A1=9C?= =?UTF-8?q?=EC=9A=B0=20=ED=94=84=EB=A1=A0=ED=8A=B8=20(=EC=A7=84=ED=96=89?= =?UTF-8?q?=EC=A4=91=C2=B7=EC=95=8C=EB=A6=BC=C2=B7=EC=88=98=EB=9D=BD/?= =?UTF-8?q?=EA=B1=B0=EC=A0=88=C2=B71:1=20=EC=B1=84=ED=8C=85)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 매칭 버튼: 신청 후 "진행중" 표시, 무료 소진(429) 안내 - 헤더 알림 벨: 받은 매칭 신청 목록 + 수락/거절 - 실시간 알림: STOMP /topic/users/{id} 구독(신청/수락/거절/만료 토스트) - 수락 시 1:1 매칭 채팅(MatchChatDialog, /topic/matches/{id}) Co-Authored-By: Claude Opus 4.8 (1M context) --- src/api/chat.ts | 5 +- src/api/matches.ts | 22 ++++- src/components/MatchChatDialog.vue | 144 +++++++++++++++++++++++++++++ src/layouts/MainLayout.vue | 85 ++++++++++++++++- src/lib/chatSocket.ts | 57 ++++++++++++ src/pages/HomePage.vue | 29 +++++- src/stores/matching.ts | 122 ++++++++++++++++++++++++ 7 files changed, 459 insertions(+), 5 deletions(-) create mode 100644 src/components/MatchChatDialog.vue create mode 100644 src/stores/matching.ts diff --git a/src/api/chat.ts b/src/api/chat.ts index feb3f32..ad028b3 100644 --- a/src/api/chat.ts +++ b/src/api/chat.ts @@ -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(`/api/chat/spots/${spotId}/messages`), + matchHistory: (matchId: number) => + http.get(`/api/chat/matches/${matchId}/messages`), } diff --git a/src/api/matches.ts b/src/api/matches.ts index 57892d2..85b1b9d 100644 --- a/src/api/matches.ts +++ b/src/api/matches.ts @@ -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('/api/matches', { requesterDogId, targetDogId }), accept: (id: number) => http.post(`/api/matches/${id}/accept`), reject: (id: number) => http.post(`/api/matches/${id}/reject`), - received: (dogId: number) => http.get(`/api/matches/received/${dogId}`), + received: (dogId: number) => http.get(`/api/matches/received/${dogId}`), + sent: (dogId: number) => http.get(`/api/matches/sent/${dogId}`), } diff --git a/src/components/MatchChatDialog.vue b/src/components/MatchChatDialog.vue new file mode 100644 index 0000000..7fa90a7 --- /dev/null +++ b/src/components/MatchChatDialog.vue @@ -0,0 +1,144 @@ + + + + + \ No newline at end of file diff --git a/src/layouts/MainLayout.vue b/src/layouts/MainLayout.vue index aea6b4a..4eb4509 100644 --- a/src/layouts/MainLayout.vue +++ b/src/layouts/MainLayout.vue @@ -8,6 +8,37 @@ {{ tierLabel }} + + + + + {{ matching.received.length }} + + + + 받은 매칭 신청 + + 받은 신청이 없어요. + + + + + + + {{ r.requesterDogName }} + {{ r.requesterDogBreed || '견종 미상' }} · 매칭 신청 + + +
+ + +
+
+
+
+
+
+ @@ -46,22 +77,73 @@ + + +