Skip to content

REQUEST & RESPONSE API

hsik0225 edited this page Jun 3, 2020 · 15 revisions

서버 주소

http://3.34.110.161/

GET /api/github/oauth

GitHub OAuth

GET /api/main

메인 화면 출력

Parameters

파라미터가 없다면 모든 결과 출력

변수명 타입 설명
checkInDate String 체크인 날짜
checkOutDate String 체크아웃 날짜
numberOfAdults Integer 어른의 수
numberOfKids Integer 어린이의 수
numberOfBabies Integer 유아의 수
lowestPrice Integer 최저 요금
highestPrice Integer 최고 요금

파라미터가 없을 때 파라미터들의 기본값

{
    "reservationDate": {
        "checkInDate": "-999999999-01-01",
        "checkOutDate": "+999999999-12-31"
    },
    "guest": {
        "numberOfAdults": 0,
        "numberOfKids": 0,
        "numberOfBabies": 0
    },
    "budget": {
        "lowestPrice": 0,
        "highestPrice": 2147483647
    }
}

RESPONSE BODY

{
    "reservationDate": {
        "checkInDate": "2019-01-22",
        "checkOutDate": "2019-01-23"
    },
    "guest": {
        "numberOfAdults": 1,
        "numberOfKids": 0,
        "numberOfBabies": 0
    },
    "budget": {
        "lowestPrice": 0,
        "highestPrice": 2147483647
    }
    "numberOfRooms": 2,
    "room": [
        {
            "roomId": 1,
            "roomName": "Downtown Harbourfront Private Room",
            "country": "Canada",
            "reviewScoresRating": 5.0,
            "price": {
                "originPrice": 470000,
                "salesPrice": 423000,
                "totalPrice": 423000
            },
            "medias": [
                "https://a0.muscache.com/im/pictures/11780344/141c2c88_original.jpg?aki_policy=large"
            ],
            "badge": "슈퍼 호스트",
            "available": true
        },
        {
            "roomId": 2,
            "roomName": "Beautiful home in amazing area!",
            "country": "Canada",
            "reviewScoresRating": 4.85,
            "price": {
                "originPrice": 100000,
                "salesPrice": 100000,
                "totalPrice": 100000
            },
            "medias": [
                "https://a0.muscache.com/im/pictures/11780344/141c2c88_original.jpg?aki_policy=large"
            ],
            "badge": "",
            "available": true
        }
    ]
}

GET /api/main/budget

해당 날짜의 요금 통계 출력

Parameter (필수, NotNull)

변수명 타입 설명
checkInDate String 체크인 날짜
checkOutDate String 체크아웃 날짜

Response Body

{
    "lowestPrice": 55000,
    "highestPrice": 427000,
    "averagePrice": 153330,
    "prices": [
        55000,
        67000,
        72000,
        100000,
        199000,
        427000
    ],
    "counts": [
        0,
        0,
        1,
        2,
        1,
        0,
        0,
        1,
        1
    ]
}

GET /api/main/reservations (필수, NotNull)

선택한 방의 가격 출력

Parameters

변수명 타입 설명
roomId Long 방 Id
checkInDate String 체크인 날짜
checkOutDate String 체크아웃 날짜
numberOfAdults Integer 어른의 수
numberOfKids Integer 어린이의 수
numberOfBabies Integer 유아의 수

RESPONSE BODY

{
    "bill": {
        "salesPrice": 423000,
        "lengthOfStay": 1,
        "priceWithoutFee": 423000,
        "cleaningFee": 85000,
        "securityDeposit": 250000,
        "priceWithFee": 758000
    },
    "review": {
        "numberOfReviews": 2,
        "reviewScoresRating": 5
    }
}

POST /api/main/reservations

선택한 방 예약

Parameters (필수, NotNull)

변수명 타입 설명
roomId Long 방 Id
checkInDate String 체크인 날짜
checkOutDate String 체크아웃 날짜
numberOfAdults Integer 어른의 수
numberOfKids Integer 어린이의 수
numberOfBabies Integer 유아의 수

RESPONSE BODY

없음