Skip to content

Seungmin-J/todo-api-jpa

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Todo App

할일을 작성하고 관리하는 앱

Introduction

할일을 작성하고 관리하는 REST API 입니다. 기본 CRUD 기능을 포함합니다

추가사항

  • 기존의 JDBC 로 데이터베이스 액세스하던 방식에서 JPA 를 사용하는 방식으로 변경되었습니다
  • Member / Comment 에 대한 CRUD
  • 로그인/로그아웃 기능

Tech Stack

  • Language:
    Java

  • Framework:

    Spring
    Spring Boot
    Lombok

  • Database:
    MySQL

  • Tools:
    Git
    GitHub

Installation

리포지토리 클론:

  git clone https://github.com/Seungmin-J/todo-api-jpa.git

API 명세서

Todo API 명세서

1. 일정 생성

Method URL Request Body Response Status
POST /todos json {
"title": "제목",
"contents": "내용",
"createdAt": "LocalDateTime 일정 생성 시간",
"editedAt": "LocalDateTime 일정 수정 시간"
}
TodoResponseDto CREATED : 201
BAD_REQUEST : 400

2. 전체 일정 조회 / 수정일, 작성자명 기준 조회

Method URL Request Param Request Body Response Status
GET /todos page: 페이지 - Page<TodoResponseDto> OK : 200

3. 선택 일정 조회

Method URL PathVariable Request Body Response Status
GET /todos/{id} id: 조회할 일정의 ID - TodoResponseWithCommentsDto OK : 200
NOT_FOUND : 404

4. 선택 일정의 이름 수정

Method URL PathVariable Request Body Response Status
PUT /todos/{id} id: 수정할 일정의 ID json {
"contents": "내용"
}
TodoResponseDto OK : 200
NOT_FOUND : 404

5. 선택 일정 삭제

Method URL PathVariable Response Status
DELETE /todos/{id} id: 삭제할 일정의 ID - OK : 200
BAD_REQUEST : 400
Member API 명세서

1. 회원 가입

Method URL Request Body Response Status
POST /members/signup json {
"memberName": "이름",
"email": "이메일",
"password": "비밀번호"
}
MemberResponseDto OK : 200
BAD_REQUEST : 400

2. 회원 조회 (ID로 조회)

Method URL PathVariable Request Body Response Status
GET /members/{id} id: 조회할 회원의 ID - MemberResponseDto OK : 200
NOT_FOUND : 404

3. 전체 회원 조회

Method URL Request Param Request Body Response Status
GET /members - - List<MemberResponseDto> OK : 200

4. 회원 정보 수정

Method URL PathVariable Request Body Response Status
PUT /members/{id} id: 수정할 회원의 ID json {
"memberName": "이름",
"email": "이메일",
"password": "비밀번호"
}
MemberResponseDto OK : 200
NOT_FOUND : 404

5. 회원 삭제

Method URL PathVariable Response Status
DELETE /members/{id} id: 삭제할 회원의 ID - OK : 200
BAD_REQUEST : 400

6. 로그인

Method URL Request Body Response Status
POST /members/login json {
"email": "이메일",
"password": "비밀번호"
}
"로그인 성공" OK : 200
UNAUTHORIZED : 401

7. 로그아웃

Method URL Request Body Response Status
POST /members/logout - "로그아웃 되었습니다." OK : 200
Comment API 명세서

1. 댓글 생성

Method URL PathVariable Request Body Response Status
POST /todos/{todoId}/comments todoId: 댓글을 추가할 Todo의 ID json {
"contents": "댓글 내용"
}
CommentResponseDto OK : 200
UNAUTHORIZED : 401

2. 댓글 조회 (ID로 조회)

Method URL PathVariable Request Body Response Status
GET /comments/{commentId} commentId: 조회할 댓글의 ID - CommentResponseDto OK : 200
NOT_FOUND : 404

3. 댓글 수정

Method URL PathVariable Request Body Response Status
PUT /comments/{commentId} commentId: 수정할 댓글의 ID json {
"contents": "수정된 댓글 내용"
}
UpdateCommentResponseDto OK : 200
UNAUTHORIZED : 401
NOT_FOUND : 404

4. 댓글 삭제

Method URL PathVariable Response Status
DELETE /comments/{commentId} commentId: 삭제할 댓글의 ID - OK : 200
UNAUTHORIZED : 401
NOT_FOUND : 404

ERD

img.png

Contact

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages