From 79758fa4962cded85e7f2963ee9891df3a21e94e Mon Sep 17 00:00:00 2001 From: happybell80 Date: Mon, 1 Sep 2025 22:44:34 +0900 Subject: [PATCH] =?UTF-8?q?docs:=20Frontend=20=EC=9D=91=EB=8B=B5=20?= =?UTF-8?q?=ED=98=95=EC=8B=9D=20=EC=B6=94=EA=B0=80=20-=20=ED=98=95?= =?UTF-8?q?=EC=8B=9D=20=EB=B3=80=ED=99=98=20=ED=95=84=EC=88=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Frontend 기대 형식: {text, sender, timestamp} 배열 - 현재 DB 형식: user_message, robeing_response 한 row - 각 row를 2개 메시지로 분리 필요 --- ...rb8001_chat_history_implementation_plan.md | 32 +++++++++++++++---- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/plans/250901_rb8001_chat_history_implementation_plan.md b/plans/250901_rb8001_chat_history_implementation_plan.md index 30db304..54cf4ab 100644 --- a/plans/250901_rb8001_chat_history_implementation_plan.md +++ b/plans/250901_rb8001_chat_history_implementation_plan.md @@ -45,9 +45,24 @@ { message_batch_size: 30, max_messages_in_dom: 200 } // GET /api/history?before={timestamp}&limit=30 -{ - messages: [...], // PostgreSQL conversation_logs에서 조회 - has_more: true +// Frontend 기대 형식 (robeing-api.ts:154-161) +{ + messages: Array<{ + id: string; + text: string; + sender: 'user' | 'robeing'; + timestamp: string; + metadata?: any; + }>; + has_more: boolean; +} + +// 현재 rb8001 /api/messages 반환 형식 (변환 필요!) +{ + "user_message": "...", + "robeing_response": "...", + "timestamp": "...", + "user_id": "..." } ``` @@ -115,10 +130,13 @@ SCROLL_THRESHOLD: int = int(os.getenv("SCROLL_THRESHOLD", 100)) MAX_MESSAGES_IN_DOM: int = int(os.getenv("MAX_MESSAGES_IN_DOM", 200)) ``` -### 실제 필요 작업 (간단!) +### 실제 필요 작업 1. ✅ 백엔드 대부분 완료 (bbf9c50 커밋) -2. ⚠️ **rb8001 main.py 수정만 필요**: - - `/api/messages` 엔드포인트 삭제 - - `/api/history` 엔드포인트 추가 (get_paginated_conversations 사용) +2. ⚠️ **rb8001 main.py 수정 필요**: + - `/api/messages` → `/api/history` 이름 변경 + - **응답 형식 변환 필수**: + - DB 각 row를 2개 메시지로 분리 (user, robeing) + - text, sender, timestamp 형식 맞추기 + - 배열로 반환 3. ✅ Frontend 수정 불필요 (이미 /api/history 호출 중) 4. ✅ 배포는 Gitea Actions 자동 처리 \ No newline at end of file