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