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