Skip to content

Latest commit

 

History

History
186 lines (138 loc) · 1.68 KB

API_level1_subway.md

File metadata and controls

186 lines (138 loc) · 1.68 KB

레벨 1 지하철 노선도 미션

HOST : ${URL}/level1/subway

Member

로그인

  • request
POST /login/token

body : {
  email: String,
  password: String,
}
  • response
{
  accessToken: String,
}

내 정보 불러오기

  • request
GET /members/me
header: {
  Authorization: Bearer ${accessToken};
}
  • response
{
  name: String,
  email: String,
}

회원가입

  • request
POST /members

body : {
  email: String,
  name: String,
  password: String,
}
  • response
{
  success: Boolean,
  message: String,
}

이메일 중복체크

  • request
GET /members/check-validation

body : {
  email: String,
}
  • response
{
  message: String,
}
  • 이메일 중복시 status 400, message: '중복된 이메일 입니다.'

Station

역 조회

  • request
GET /stations
  • response
[
  {
    id: Number,
    name: String,
    createdDate: Date,
    updatedDate: Date,
  },
  ...
];

역 추가

  • request
POST /stations
header: {
  Authorization: Bearer ${accessToken};
  Content-Type: application/json;
}
body : {
  name: String,
}
  • response
  {
    id: Number,
    name: String,
    createdDate: Date,
    updatedDate: Date,
  }

역 수정

  • request
PUT /stations/:id
header: {
  Authorization: Bearer ${accessToken};
}
body : {
  name: String,
}
  • response
  {
    id: Number,
    name: String,
    createdDate: Date,
    updatedDate: Date,
  }

역 삭제

  • request
DELETE /stations/:id
header: {
  Authorization: Bearer ${accessToken};
}
  • response
{
  message: String;
}