TIL(5/27)

정성현·2022년 5월 28일
0

항해99

목록 보기
29/33

과제 REST API 작성

회원가입 API(method = POST)

  • request = URL:/users
    body = nickname : string, email : string, password : string, checkPassword : string
  • response = payload

로그인 API(method = POST)GET요청으로하면 URL에 노출이 되므로 POST로 하는게 보안상 좋다.

  • request = URL:/auth
    body = email : string, password : string
  • response = 조회한 뒤 상황에 맞게 메세지 보냄

댓글 목록 조회 API(method = GET) => 로그인을 안해도 조회 가능

  • request = URL:/articles/:user_Id
  • response = payload comment : string

전체 게시글 목록 조회 API(method = GET) => 로그인을 안해도 조회 가능

  • 제목, 작성자명, 작성 날짜를 조회하기
  • 작성날짜를 기준으로 내림차순 정렬하기
  • request = URL:/articles
  • response = title : string, nickname : string, date : string

게시글 조회 API (method = GET) => 로그인을 안해도 조회가능

  • 제목, 작성자명, 작성 내용을 조회하기
  • request = URL:/articles/:user_Id
    param : user_Id : string
  • response = title : string, name : string, comment : string

게시글 작성 API (method = POST) => 로그인을 해야 작성가능

  • 제목, 작성 내용을 입력하기
  • request = URL:/articles
    body = title : string , comment : string, date : Number
  • response = payload

게시글 수정 API (method = PUT)

  • 로그인을 하고 해당 작성자만 수정가능
  • request = URL:/articles/:user_Id/modify,
    param : user_Id, body : comment:string
  • response = body: comment : string,

게시글 삭제 API (method = DELETE)

  • 로그인을 하고 해당 작성자만 삭제가능
  • request = URL:/articles/:user_Id/delete,
    param : user_Id
  • response = 삭제

댓글 작성 API (method = POST)
로그인을 해야 작성 가능

  • request = URL:/articles/:user_Id
  • param : user_Id body : comment : string
  • response = : payload, comment : string , date : date

댓글 수정 API (method = PATCH)
로그인을 해야 수정가능

  • request =URL:/articles/:user_Id/
    아직 덜 완성 하였다. 내일까지 다 만들어야 겠다.
profile
I want to be programmer

0개의 댓글