API - HongzCloud/airbnb GitHub Wiki
λ‘κ·ΈμΈ μμ²
POST /login
-
Request
query params
code=asdf3421
typeCode=1(FE) or 2(iOS)
-
Response
200 Ok
{
"name": "Jeong In Ho",
"email": "[email protected]",
"userId": "eNoLJ",
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE2MjA2OTc3MjAsInVzZXJJZCI6ImVOb0xKIn0.Pv8Lfs90B7LRyCqKrob3RGjDtMgAk9ahdB8pRM1MY9Q"
}
400 Bad Request
{
"timestamp": "2021-05-12T08:17:36.148+00:00",
"status": 400,
"error": "Bad Request",
"message": "OAuth μΈμ¦μ μ€ν¨ νμ΅λλ€.",
"path": "/login"
}
λ‘κ·Έμμ μμ²
GET /logout
-
Request
header
Authorization: Bearer {token}
-
Response
200 Ok
401 Unauthorized
{
"timestamp": "2021-05-12T08:20:59.720+00:00",
"status": 401,
"error": "Unauthorized",
"message": "μ ν¨νμ§ μμ ν ν°μ
λλ€.",
"path": "/logout"
}
μμ κ²μ μμ²
GET /houses
-
Request
query prams
checkIn=2021-05-18
checkOut=2021-05-25
minCharge=10000
maxCharge=1000000
guest=3
kid=0
μ μ
latitude=37.566826
μλ
longitude=126.9786567
κ²½λ
-
Response
200 Ok
[
{
"id": 1,
"image": "url",
"location": { // FEλ μμμ μ΄κΈ°κ°
"latitude(μλ)": 37.566826,
"longitude(κ²½λ)": 126.9786567
},
"local": "μμ΄κ΅¬μ μννΈ μ 체",
"name": "Specious and Comfortable cozy bouse #4",
"charge": "15400", // 1λ° κ°λ§
"grade": 4.60,
"review": 270,
"description": "κ°λ¨μ 5λ² μΆκ΅¬μμ λλ³΄λ‘ μ΄λκ°λ₯ν©λλ€. ...",
"options": [
"μ΅λ μΈμ 4λͺ
β’ μΉ¨μ€ 1κ° β’ μΉ¨λ 1κ° β’ μμ€ 1κ°",
"μ£Όλ°© ⒠무μ μΈν°λ· β’ μμ΄μ»¨ β’ ν€μ΄λλΌμ΄κΈ°"
],
"wish": true
},
{
"id": 2,
"image": "url",
"location": {
"latitude(μλ)": 37.566826,
"longitude(κ²½λ)": 126.9786567
},
"local": "μμ΄κ΅¬μ μννΈ μ 체",
"name": "Specious and Comfortable cozy bouse #4",
"charge": "15400", // 1λ° κ°λ§
"grade": 4.60,
"review": 270,
"description": "κ°λ¨μ 5λ² μΆκ΅¬μμ λλ³΄λ‘ μ΄λκ°λ₯ν©λλ€. ...",
"options": [
"μ΅λ μΈμ 4λͺ
β’ μΉ¨μ€ 1κ° β’ μΉ¨λ 1κ° β’ μμ€ 1κ°",
"μ£Όλ°© ⒠무μ μΈν°λ· β’ μμ΄μ»¨ β’ ν€μ΄λλΌμ΄κΈ°"
],
"wish": false
}
]
κ°κ²© λ²μ μμ² (κ·Έλνλ₯Ό 그리기 μν)
GET /houses/charges
-
Request
query prams
checkIn=2021-05-18
checkOut=2021-05-25
latitude=37.566826
μλ
longitude=126.9786567
κ²½λ
-
Response
200 Ok
[
1000, 1000, 1020, 2000, ..., 100000
]
μμ μμΈ νμ΄μ§ μμ² (iosλ§ ν΄λΉ, ꡬμ μ€)
GET /houses/detail/{houseId}
-
Request
header
query string
: houseId
-
Response
200 Ok
{
"name": "Spacious and Comfortable cozy house #4",
"images": ["url", "url", "url"],
"review": 270,
"location": "μμ΄κ΅¬, μμΈ, νκ΅",
"host": "λ μ§λμ€ μ 체 νΈμ€νΈ: Jongλ",
"hostImage": "url",
"options": [
"μ΅λ μΈμ 4λͺ
β’ μΉ¨μ€ 1κ° β’ μΉ¨λ 1κ° β’ μμ€ 1κ°",
"μ£Όλ°© ⒠무μ μΈν°λ· β’ μμ΄μ»¨ β’ ν€μ΄λλΌμ΄κΈ°"
],
"description": "κ°λ¨μ 5λ² μΆκ΅¬μμ λλ³΄λ‘ μ΄λκ°λ₯ν©λλ€. μ§νμ² β¦",
"charge": 72206,
"wish": false
}
μμ μμ½ νμ΄μ§ μμ²
GET /reservation/{houseId}
-
Request
query string: houseId
-
Response
200 Ok
{
"charge": 71466,
"cleaningRatio": 0.02,
"serviceRatio": 7.24,
"discountRatio": 4,
"review": 270
}
μμ μμ½ μμ²
POST /reservation/{houseId}
-
Request
Authorization: Bearer {token}
query string
: houseId
body
{
"date": {
"start": "2021-05-18",
"end": "2021-05-25"
},
"people": {
"guest(μ±μΈ + μ΄λ¦°μ΄)": 3
},
"totalCharge": 1324500
}
-
Response
200 Ok
μμ 리μ€νΈ μμ²
GET /wishes
-
Request
header
Authorization: Bearer {token}
-
Response
200 Ok
[
{
"id": 1,
"name": "λΉλ΄μ§, λΉμ°κ³ λ΄μμ§",
"charge": 308571,
"grade": 4.98,
},
{
"id": 2,
"name": "λΉλ΄μ§, λΉμ°κ³ λ΄μμ§",
"charge": 308571,
"grade": 4.98,
},
]
μμ μμ²
POST /wishes/{houseId}
-
Request
query string: houseId
header
Authorization: Bearer {token}
-
Response
200 Ok
μμ μμ½ λ¦¬μ€νΈ μμ²
GET /reservation
-
Request
header
Authorization: Bearer {token}
-
Response
200 Ok
[
{
"id": 1,
"image": "url",
"date": "2021λ
5μ 17μΌ - 2021λ
6μ 4μΌ",
"location": "μμ΄κ΅¬, μμΈ, νκ΅",
"name": "Specious and Comfortable cozy house #4"
},
{
"id": 2,
"image": "url",
"date": "2021λ
5μ 17μΌ - 2021λ
6μ 4μΌ",
"location": "μμ΄κ΅¬, μμΈ, νκ΅",
"name": "Specious and Comfortable cozy house #4"
},
]
μμ μμ½ μμΈ μ 보 μμ²
GET /reservation/detail/{houseId}
-
Request
`query string: houseId'
header
Authorization: Bearer {token}
-
Response
200 Ok
{
"id": 2,
"images": "[url, url]",
"location": "μμ΄κ΅¬, μμΈ, νκ΅",
"name": "Specious and Comfortable cozy house #4",
"checkIn": "2021λ
5μ 17μΌ μ€ν 4:00",
"checkOut": "2021λ
6μ 4μΌ μ€ν 12:00",
"description": {
"host": "Jongλ",
"option": "μ§μ 체 β’ κ²μ€νΈ 3λͺ
",
"charge": 1488195
}
}
μμ μμ½ μ·¨μ μμ²
DELETE /reservation/{houseId}
-
Request
query string: houseId
header
Authorization: Bearer {token}
-
Response
200 Ok