docs: Frontend 응답 형식 추가 - 형식 변환 필수
- Frontend 기대 형식: {text, sender, timestamp} 배열
- 현재 DB 형식: user_message, robeing_response 한 row
- 각 row를 2개 메시지로 분리 필요
This commit is contained in:
parent
a2660eb703
commit
79758fa496
@ -45,9 +45,24 @@
|
|||||||
{ message_batch_size: 30, max_messages_in_dom: 200 }
|
{ message_batch_size: 30, max_messages_in_dom: 200 }
|
||||||
|
|
||||||
// GET /api/history?before={timestamp}&limit=30
|
// GET /api/history?before={timestamp}&limit=30
|
||||||
{
|
// Frontend 기대 형식 (robeing-api.ts:154-161)
|
||||||
messages: [...], // PostgreSQL conversation_logs에서 조회
|
{
|
||||||
has_more: true
|
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))
|
MAX_MESSAGES_IN_DOM: int = int(os.getenv("MAX_MESSAGES_IN_DOM", 200))
|
||||||
```
|
```
|
||||||
|
|
||||||
### 실제 필요 작업 (간단!)
|
### 실제 필요 작업
|
||||||
1. ✅ 백엔드 대부분 완료 (bbf9c50 커밋)
|
1. ✅ 백엔드 대부분 완료 (bbf9c50 커밋)
|
||||||
2. ⚠️ **rb8001 main.py 수정만 필요**:
|
2. ⚠️ **rb8001 main.py 수정 필요**:
|
||||||
- `/api/messages` 엔드포인트 삭제
|
- `/api/messages` → `/api/history` 이름 변경
|
||||||
- `/api/history` 엔드포인트 추가 (get_paginated_conversations 사용)
|
- **응답 형식 변환 필수**:
|
||||||
|
- DB 각 row를 2개 메시지로 분리 (user, robeing)
|
||||||
|
- text, sender, timestamp 형식 맞추기
|
||||||
|
- 배열로 반환
|
||||||
3. ✅ Frontend 수정 불필요 (이미 /api/history 호출 중)
|
3. ✅ Frontend 수정 불필요 (이미 /api/history 호출 중)
|
||||||
4. ✅ 배포는 Gitea Actions 자동 처리
|
4. ✅ 배포는 Gitea Actions 자동 처리
|
||||||
Loading…
x
Reference in New Issue
Block a user