/api/chatbotPOST /api/chatbot/chat
| 헤더 | 필수 | 설명 |
|---|---|---|
| Content-Type | Y | application/json |
| X-USER-ID | Y | 사용자 구분을 위한 고유 식별자 (UUID 등) |
| 필드명 | 타입 | 필수 | 설명 |
|---|---|---|---|
| latitude | number | Y | 사용자의 위도 (소수점) |
| longitude | number | Y | 사용자의 경도 (소수점) |
| user_input | string | Y | “반경 2km 이내 카페 추천해줘” 처럼 자연어로 장소 조건 입력 |
| displayed_place_ids | array | N | (추가 요청 시) 이미 화면에 표시된 place_id 목록. 중복 추천 방지용 |
| is_more_request | boolean | N | (추가 요청 시) true로 설정하면 기존 검색 기준 유지하고 다음 페이지 결과 요청 |
POST /api/chatbot/chat
Content-Type: application/json
X-USER-ID: test-user-id
{
"latitude": 37.5061,
"longitude": 126.9601,
"user_input": "반경 2km 이내의 카페 추천해줘"
}
200 OK
400 Bad Request (위치 정보나 입력 값 validation 실패 시)| 필드명 | 타입 | 설명 |
|---|---|---|
| recommendations | array | 추천 장소 리스트 (최대 5개) |
| last_request | object | 내부적으로 저장된 마지막 검색 파라미터 |
| display_message | string | 실제 처리된 사용자 요청 메시지 (파싱된 메시지 대신 원본 표시용) |
| search_status | object | 검색 진행 상태 (비동기 처리 중 상태 표시) |
recommendations 항목 구조| 필드명 | 타입 | 설명 |
|---|---|---|
| category | string | 검색된 장소의 카테고리 (예: “카페”) |
| title | string | 장소 이름 |
| address | string | 주소 |
| rating | number | 평점 (없으면 "-" 문자열) |
| distance | integer | 사용자의 좌표에서 장소까지의 거리 (미터) |
| transit_time | string | 대중교통 이동 예상 시간 (예: “10분”) |
| directions_url | string | 구글맵 길찾기 URL |
{
"recommendations": [
{
"category": "카페",
"title": "루프탑 카페",
"address": "서울시 강남구 테헤란로 123",
"rating": 4.3,
"distance": 850,
"transit_time": "12분",
"directions_url": "<https://maps.google.com/?.>.."
}
],
"last_request": {
"latitude": "37.5061",
"longitude": "126.9601",
"radius": 2000,
"categories": ["카페"],
"sort_by": "rating"
},
"display_message": "반경 2km 이내의 카페 추천해줘",
"search_status": {
"is_searching": false,
"message": "검색이 완료되었습니다."
}
}
| 필드명 | 타입 | 필수 | 설명 |
|---|---|---|---|
| latitude | number | Y | 사용자의 위도 |
| longitude | number | Y | 사용자의 경도 |
| user_input | string | Y | 추천받고 싶은 장소에 대한 자연어 입력 |
| displayed_place_ids | array | N | (추가 추천 시) 이미 추천된 place_id |
app.py/login 엔드포인트를 호출하여 Google OAuth 인증 페이지로 리다이렉트/login/callback에서 토큰 수신 및 사용자 프로필 확인/logout 호출 시 세션 종료 후 홈으로 리다이렉트/ (홈)에서는 로그인 상태에 따라 환영 메시지 또는 로그인 버튼 표시| 구분 | 값 | 설명 |
|---|---|---|
| 콘텐츠 타입 | text/html 또는 application/json |
홈과 리다이렉트는 HTML, 에러는 JSON |
| 인증 | 쿠키 기반 세션 (Flask-Login) |
로그인 상태는 세션 쿠키로 관리 |
| 성공 응답 | 200 OK, 302 Redirect |
페이지 렌더링 또는 리다이렉트 |
| 에러 응답 | 400 Bad Request<br>403 Forbidden<br>500 Internal Server Error |
아래 에러 코드 참조 |