위시리스트 서비스 (Wishlist)
개요
위시리스트 서비스는 사용자가 관심 있는 상품을 저장하고 관리할 수 있는 기능을 제공합니다. 나중에 구매하려는 상품을 모아두고, 가격 변동이나 재입고 알림을 받을 수 있습니다.
| 항목 | 값 |
|---|---|
| 언어 | Python 3.11 |
| 프레임워크 | FastAPI |
| 데이터베이스 | DocumentDB (MongoDB 호환) |
| 네임스페이스 | mall-services |
| 포트 | 8000 |
| 헬스체크 | GET /health |
아키텍처
API 엔드포인트
위시리스트 API
| 메서드 | 경로 | 설명 |
|---|---|---|
GET | /api/v1/wishlists/{user_id} | 위시리스트 조회 |
POST | /api/v1/wishlists/{user_id}/items | 상품 추가 |
DELETE | /api/v1/wishlists/{user_id}/items/{product_id} | 상품 제거 |
요청/응답 예시
위시리스트 조회
요청:
GET /api/v1/wishlists/user_001
응답:
{
"user_id": "user_001",
"items": [
{
"product_id": "prod_001",
"added_at": "2024-01-15T10:00:00Z",
"note": "생일 선물로 사고 싶음"
},
{
"product_id": "prod_002",
"added_at": "2024-01-14T15:30:00Z",
"note": null
}
],
"created_at": "2024-01-01T00:00:00Z",
"updated_at": "2024-01-15T10:00:00Z"
}
상품 추가
요청:
POST /api/v1/wishlists/user_001/items
Content-Type: application/json
{
"product_id": "prod_003",
"note": "할인할 때 구매 예정"
}
응답 (201 Created):
{
"product_id": "prod_003",
"added_at": "2024-01-15T11:00:00Z",
"note": "할인할 때 구매 예정"
}