API 명세서

예약

POST /reservations 예약 추가 API

Request

POST /reservations HTTP/1.1
content-type: application/json

{
    "date": "2023-08-05",
    "name": "브라운",
    "timeId": 1
}

Response

HTTP/1.1 201
Content-Type: application/json

{
    "id": 1,
    "name": "브라운",
    "date": "2023-08-05",
    "time" : {
        "id": 1,
        "startAt" : "10:00"
    }
}
GET /reservations 전체 예약 조회 API

Request

GET /reservations HTTP/1.1

Response

HTTP/1.1 200
Content-Type: application/json

[
    {
        "id": 1,
        "name": "브라운",
        "date": "2023-08-05",
        "time": {
            "id": 1,
            "startAt": "10:00"
        }
    },
    {
        "id": 2,
        "name": "구름",
        "date": "2023-08-05",
        "time": {
            "id": 2,
            "startAt": "11:00"
        }
    }
]
DELETE /reservations/{id} 예약 삭제 API

Request

DELETE /reservations/1 HTTP/1.1

Response

HTTP/1.1 204

예약 시간

POST /times 예약 시간 추가 API

Request

POST /times HTTP/1.1
content-type: application/json

{
    "startAt": "10:00"
}

Response

HTTP/1.1 201
Content-Type: application/json

{
    "id": 1,
    "startAt": "10:00"
}
GET /times 전체 예약 시간 조회 API

Request

GET /times HTTP/1.1

Response

HTTP/1.1 200 
Content-Type: application/json

[
   {
        "id": 1,
        "startAt": "10:00"
    },
    {
        "id": 2,
        "startAt": "11:00"
    }
]
DELETE /times/{id} 예약 시간 삭제 API

Request

DELETE /times/1 HTTP/1.1

Response

HTTP/1.1 204