forked from codesquad-members-2022/airbnb
-
Notifications
You must be signed in to change notification settings - Fork 1
API 설계
HongJungKim(이든) edited this page May 25, 2022
·
1 revision
GET: /search?checkIn=”yyyy.mm:dd”&
API 설명: 검색 결과 요청 및 검색 결과 반환
params
- checkIn: “yyyy.mm:dd” (string)
- checkOut: “yyyy.mm:dd” (string)
- minFee: 999999 (number)
- maxFee: 999999 (number)
- guests: { adult: 8 (number) child: 8 (number) baby: 8 (number) }
- location: { latitude: 37.391383437711966 (number) longitude: 127.09639287816465 (number) }
Request
없음
Response
{
data: [
{
userId:
"uuid" (unique string)
roomId: "uuid" (unique string)
image: "aasdfasdfs" (string)
address: "서초구..." (string)
location: {
latitude: 37.391383437711966 (number)
longitude: 127.09639287816465 (number)
}
name: "Spacious cozy house" (string)
option: {
capacity: 3,
roomType: '원룸'
bedNum: 1,
bathroomNum: 1,
etc: [
주방, 무선 인터넷, 에어컨, 헤어드라이어
]
} (object)
rate: 4.80 (number)
reviewNum: 127 (number)
overnightPrice: 80000 (numer)
totalPrice: 2400000 (number)
},
{ /*...*/ },
{ /*...*/ },
{ /*...*/ }...
]
}
API 설명: 숙소 예약하기, 해당 숙소의 id, 체크인, 체크아웃, 숙박인원, 인원을 request로 보내고 예약을 성공하면 유저의 예약리스트를 보내준다.
Request
{
data: [
{
userId: "uuid" (unique string)
roomId: "uuid" (unique string)
checkIn: “yyyy.mm:dd” (string)
checkOut: “yyyy.mm:dd” (string)
guests: {
adult: 8 (number)
child: 8 (number)
baby: 8 (number)
}
}
]
}
Response
{
data: [
{
// 업데이트된 유저 정보
userId: "uuid" (unique string)
reservationList: [{},{}]
}
]
}