Reservation API 문서 - f-lab-edu/at_ticket GitHub Wiki

Reservation API 문서

Table of Contents

  • 예약 조회
    • Request
    • Request Fields
    • Response
    • Response Fields
  • 선예약하기
    • Request
    • Request Fields
    • Response
    • Response Fields
  • 예약하기
    • Request
    • Request Fields
    • Response
    • Response Fields
  • 예약된 좌석 id 리스트 조회
    • Request
    • Request Fields
    • Response
    • Response Fields
  • 선예약된 좌석 id 리스트 조회
    • Request
    • Request Fields
    • Response
    • Response Fields

예약 조회

Request

**GET** /reservations/1 **HTTP/1.1**Content-Type: application/json;charset=UTF-8
Accept: application/json
Host: localhost:8080

Request Fields

Parameter Description
reservationId 예약 id

Response

**HTTP/1.1** 200 OK
Content-Type: application/json
Content-Length: 280

{
  "code" : 200,
  "message" : "요청에 성공하셨습니다.",
  "data" : {
    "reservation" : {
      "id" : 1,
      "userId" : "kimjunbo",
      "seatIds" : [ 1, 2 ],
      "status" : "WAIT_PAY",
      "time" : "2023-11-20T12:12:06.442929",
      "showId" : 1
    }
  }
}

Response Fields

Path Type Description
code Number 결과코드
message String 결과 메세지
data.reservation.id Number 예약 id
data.reservation.userId String 사용자 id
data.reservation.seatIds Array 좌석 id 리스트
data.reservation.status String 예약 상태
data.reservation.time String 예약 시간
data.reservation.showId Number 공연 id

선예약하기

Request

**POST** /reservations/pre **HTTP/1.1**Content-Type: application/json;charset=UTF-8
Accept: application/json
Content-Length: 42
Host: localhost:8080

{
  "showId" : 1,
  "seatIds" : [ 1, 2 ]
}

Request Fields

Path Type Description
showId Number 공연 ID
seatIds Array 좌석 ID 리스트

Response

**HTTP/1.1** 200 OK
Content-Type: application/json
Content-Length: 110

{
  "code" : 200,
  "message" : "요청에 성공하셨습니다.",
  "data" : {
    "reservationId" : 1
  }
}

Response Fields

Path Type Description
code Number 결과코드
message String 결과 메세지
data.reservationId Number 예약 id

예약하기

Request

**POST** /reservations **HTTP/1.1**Content-Type: application/json;charset=UTF-8
Accept: application/json
Content-Length: 61
Host: localhost:8080

{
  "paymentId" : "imp_078249949476",
  "reservationId" : 1
}

Request Fields

Path Type Description
reservationId Number 예약 ID
paymentId String 결제 영수증 ID

Response

**HTTP/1.1** 200 OK
Content-Type: application/json
Content-Length: 110

{
  "code" : 200,
  "message" : "요청에 성공하셨습니다.",
  "data" : {
    "reservationId" : 1
  }
}

Response Fields

Path Type Description
code Number 결과코드
message String 결과 메세지
data.reservationId Number 예약 id

예약된 좌석 id 리스트 조회

Request

**GET** /reservations/show/1/seats **HTTP/1.1**Content-Type: application/json;charset=UTF-8
Accept: application/json
Host: localhost:8080

Request Fields

Parameter Description
showId 공연 id

Response

**HTTP/1.1** 200 OK
Content-Type: application/json
Content-Length: 111

{
  "code" : 200,
  "message" : "요청에 성공하셨습니다.",
  "data" : {
    "seatIds" : [ 1, 2 ]
  }
}

Response Fields

Path Type Description
code Number 결과코드
message String 결과 메세지
data.seatIds Array 좌석 id 리스트

선예약된 좌석 id 리스트 조회

Request

**GET** /reservations/show/1/seats/pre **HTTP/1.1**Content-Type: application/json;charset=UTF-8
Accept: application/json
Host: localhost:8080

Request Fields

Parameter Description
showId 공연 id

Response

**HTTP/1.1** 200 OK
Content-Type: application/json
Content-Length: 111

{
  "code" : 200,
  "message" : "요청에 성공하셨습니다.",
  "data" : {
    "seatIds" : [ 1, 2 ]
  }
}

Response Fields

Path Type Description
code Number 결과코드
message String 결과 메세지
data.seatIds Array 좌석 id 리스트