From b25d84ff4f16335833ac769428ce2c5a8af10a46 Mon Sep 17 00:00:00 2001 From: happybell80 Date: Mon, 1 Sep 2025 18:44:10 +0900 Subject: [PATCH] =?UTF-8?q?docs:=20rb8001=20=EB=8C=80=ED=99=94=20=ED=9E=88?= =?UTF-8?q?=EC=8A=A4=ED=86=A0=EB=A6=AC=20=EA=B5=AC=ED=98=84=20=EA=B3=84?= =?UTF-8?q?=ED=9A=8D=20=EC=88=98=EB=A6=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - rb10508_micro 구현 코드 참조 - 현재 상태 분석 및 구현 방향 정리 - API 엔드포인트 추가 계획 --- ...rb8001_chat_history_implementation_plan.md | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 plans/250901_rb8001_chat_history_implementation_plan.md diff --git a/plans/250901_rb8001_chat_history_implementation_plan.md b/plans/250901_rb8001_chat_history_implementation_plan.md new file mode 100644 index 0000000..92a5962 --- /dev/null +++ b/plans/250901_rb8001_chat_history_implementation_plan.md @@ -0,0 +1,62 @@ +# rb8001 카톡 스타일 대화 히스토리 구현 계획 + +## 작성일: 2025-09-01 +## 대상: rb8001 (프로덕션 로빙) +## 참조: rb10508_micro 구현 코드 + +--- + +## 현재 상태 분석 +- **rb10508_micro**: /api/config 엔드포인트 구현됨 (endpoints.py:407) +- **rb8001**: API 엔드포인트 없음 (추가 필요) + +## 수정 필요 파일 + +### 백엔드 (rb8001) +1. `app/core/config.py` - 환경변수 추가 (MESSAGE_BATCH_SIZE=30, USER_MAPPING) +2. `app/state/database.py` - get_paginated_conversations() 함수 추가 +3. `main.py` - /api/config, /api/messages 엔드포인트 추가 +4. `docker-compose.yml` - 환경변수 설정 + +### 프론트엔드 (frontend-customer) +1. `src/services/robeing-api.ts` - getConfig(), getMessages() 함수 추가 +2. `src/components/chat-interface.tsx` - 무한 스크롤, 날짜 구분선 구현 + +--- + +## API 스펙 + +```typescript +// GET /api/config +{ message_batch_size: 30, max_messages_in_dom: 200 } + +// GET /api/messages?before={timestamp}&limit=30 +{ + messages: [...], + has_more: true +} +``` + +--- + +## 주의사항 + +### API 경로 +```python +# main.py에 직접 추가 (rb8001은 router 분리 없음) +@app.get("/api/config") +@app.get("/api/messages") +``` + +### rb10508_micro 참조 코드 +```python +# rb10508_micro/app/config.py:101-103 +MESSAGE_BATCH_SIZE: int = int(os.getenv("MESSAGE_BATCH_SIZE", 30)) +SCROLL_THRESHOLD: int = int(os.getenv("SCROLL_THRESHOLD", 100)) +MAX_MESSAGES_IN_DOM: int = int(os.getenv("MAX_MESSAGES_IN_DOM", 200)) +``` + +### 구현 순서 +1. 백엔드 API 추가 (1시간) +2. 프론트엔드 통합 (1시간) +3. 테스트 및 배포 (30분) \ No newline at end of file