Skip to content

구현 : users

오주환 edited this page Jul 29, 2022 · 1 revision

users 에 대한 상세 구현 문서입니다.

기능 목록

  1. 회원가입
  2. 회원 로그인
  3. 회원정보 수정
  4. 회원탈퇴
  5. 회원 정보 상세 조회





회원가입

URL

POST http://localhost:3000/api/users/register

Request

{ 
  "name" : "삐룸",
  "email" : "[email protected]",
  "password" : "1234"
}

Response

{
    "status": 200,
    "isSuccess": true,
    "message": "성공"
}

Validation Check

  • password : 공백불가, 영문/숫자/특수문자 1개씩 포함되어있는 6자 이상 12자 이하의 비밀번호





회원 로그인

URL

POST http://localhost:3000/api/users/login

Request

{ 
  "email" : "[email protected]",
  "password" : "1234"
}

Response

{
    "status": 200,
    "isSuccess": true,
    "accessToken": "abcdef"
}

Validation Check

  • email: 공백불가, @ 필수 포함




회원정보 수정

URL

PATCH http://localhost:3000/api/users

Request

{ 
  "name" : "삐룸",
  "password" : "1234",
  "department" : "개발2팀"
}

Response

{
    "status": 200,
    "isSuccess": true,
    "message": "성공"
}

Validation Check

  • department: 영어 불가능




회원탈퇴

URL

DELETE http://localhost:3000/api/users

Response

{
    "status": 200,
    "isSuccess": true,
    "message": "성공"
}




회원정보 상세조회

URL

GET http://localhost:3000/api/users/1

Response

{
    "status": 200,
    "isSuccess": true,
    "message": "성공",
    "data" : {"name" : "삐룸", "email" : "[email protected]", "department" : "개발2팀"}
}