Spring_Lv2 블로그

지인·2023년 6월 29일
0

프로젝트

목록 보기
5/17

🐰 개인 과제


요구사항

  1. 전체 게시글 목록 조회 API
    • 제목, 작성자명(username), 작성 내용, 작성 날짜를 조회하기
    • 작성 날짜 기준 내림차순으로 정렬하기
  2. 게시글 작성 API
    • 토큰을 검사하여, 유효한 토큰일 경우에만 게시글 작성 가능
    • 제목, 작성 내용을 저장하고
    • 저장된 게시글을 Client 로 반환하기(username은 로그인 된 사용자)
  3. 선택한 게시글 조회 API
    • 선택한 게시글의 제목, 작성자명(username), 작성 날짜, 작성 내용을 조회하기
      (검색 기능이 아닙니다. 간단한 게시글 조회만 구현해주세요.)
  4. 선택한 게시글 수정 API
    • 수정을 요청할 때 수정할 데이터와 비밀번호를 같이 보내서 서버에서 비밀번호 일치 여부를 확인 한 후
    • 토큰을 검사한 후, 유효한 토큰이면서 해당 사용자가 작성한 게시글만 수정 가능
    • 제목, 작성 내용을 수정하고 수정된 게시글을 Client 로 반환하기
  5. 선택한 게시글 삭제 API
    • 삭제를 요청할 때 비밀번호를 같이 보내서 서버에서 비밀번호 일치 여부를 확인 한 후
    • 토큰을 검사한 후, 유효한 토큰이면서 해당 사용자가 작성한 게시글만 삭제 가능
    • 선택한 게시글을 삭제하고 Client 로 성공했다는 메시지, 상태코드 반환하기

Use Case


API 명세서

기능URLMethodRequestResponse
회원 가입/api/user/signupPOST      {
"username":"username",
"password":"password"
}
{
"msg":"회원가입 성공",
"statusCode":200
}
로그인/api/user/loginPOST{
"username":"username",
"password":"password"
}
{
"msg":"로그인 성공",
"statusCode":200
}
게시글 작성/api/postPOST{
"title":"title",
"content":"content"
}
{
"createdAt":"2023-06-16T12:43:01.226062”,
"modifiedAt":"2023-06-16T12:43:01.226062",
"title":"title",
"username":"username",
"content":"content",
"password":"password",
"id":id
}
게시글 목록 조회/api/postGET-{
"postList":[{"createdAt":"2023-06-16T12:43:01.226062”,
"modifiedAt" = "2023-06-16T12:43:01.226062",
"title":"title2",
"username":"username2",
"content":"content2",
"id":id
}
]
}
게시글 상세 조회/api/post/{id}GET-{
"createdAt":"2023-06-16T12:43:01.226062”,
"modifiedAt":"2023-06-16T12:43:01.226062",
"title":"title",
"userName":"userName",
"content":"content",
"id":id
}
게시글 수정/api/post/{id}/{password}PUT{
"title":"title”,
"content":"content"
}

"createdAt":"2023-06-16T12:43:01.226062”,
"modifiedAt":"2023-06-16T12:43:01.226062",
"title":"title",
"username":"username",
"content":"content",
"password":"password",
"id":id
게시글 삭제/api/post/{id}/{password}DELETE-{
"msg":"게시글 삭제 성공"
}


Github

spring_Lv2

profile
열쩡

0개의 댓글