| 라이브러리 | 설명 |
|---|---|
| Spring Data JPA | DB 연동 및 ORM 처리 (Entity, Repository 등) |
| Spring Web | Spring MVC 기반 웹 애플리케이션 개발 (Controller, REST API 등) |
| Spring Boot Starter Validation | 유효성 검사용 (@Valid, @NotBlank 등 Jakarta Bean Validation API) |
| Lombok | @Getter, @Setter 등 반복 코드를 줄이기 위한 라이브러리 |
| MySQL Connector | MySQL DB 연동을 위한 JDBC 드라이버 |
| Spring Boot Starter Test | 테스트 기능 제공 (MockMvc, JUnit, Assert 등) |
| JUnit Platform Launcher | 테스트 런타임 실행환경 지원 |
※
spring-boot-starter-web또는spring-boot-starter-data-jpa추가 시
starter-test,junit-platform-launcher같은 테스트 라이브러리도 자동 포함됨.
| 기능 | Method | URL | 요청 데이터 | 요청 예시 | 응답 필드 | 응답 예시 | 상태 코드 |
|---|---|---|---|---|---|---|---|
| 일정 생성 | POST | /events |
Body: userId, title, toDo |
{ "userId": "example", "title": "example", "toDo": "example" } |
userName, title, toDo, createdAt, modifiedAt, id |
{ "userName": "example", "title": "example", "toDo": "example", "createdAt": "example", "modifiedAt": "example", "id": "example" } |
201 CREATED |
| 일정 조회 | GET | /events/{id} |
Path param: id |
/events/example |
userName, title, toDo, createdAt, modifiedAt, id |
{ "userName": "example", "title": "example", "toDo": "example", "createdAt": "example", "modifiedAt": "example", "id": "example" } |
200 OK |
| 일정 수정 | PATCH | /events/{id} |
Path param: id, Body: title, toDo |
{ "title": "example", "toDo": "example" } |
userName, title, toDo, createdAt, modifiedAt, id |
{ "userName": "example", "title": "example", "toDo": "example", "createdAt": "example", "modifiedAt": "example", "id": "example" } |
200 OK |
| 일정 삭제 | DELETE | /users/{userId}/{eventId} |
Path param: userId, eventId |
/users/example/example |
없음 | 없음 | 200 OK |
| 유저 생성 | POST | /users |
Body: userName, userEmail, password |
{ "userName": "example", "userEmail": "example@example.com", "password": "example" } |
userName, userEmail, id |
{ "userName": "example", "userEmail": "example@example.com", "id": "example" } |
201 CREATED |
| 유저 로그인 | POST | /users/login |
Body: userEmail, userPassword |
{ "userEmail": "example@example.com", "userPassword": "example" } |
로그인 성공 메시지 | "example 님 로그인 되셨습니다" |
200 OK |
| 유저 단건 조회 | GET | /users/{id} |
Path param: id |
/users/example |
userName, userEmail, id |
{ "userName": "example", "userEmail": "example@example.com", "id": "example" } |
200 OK |
| 유저 이메일 수정 | PATCH | /users/{id} |
Path param: id, Body: userEmail |
{ "userEmail": "example@example.com" } |
userName, userEmail, id |
{ "userName": "example", "userEmail": "example@example.com", "id": "example" } |
200 OK |
| 유저 삭제 | DELETE | /users/{id} |
Path param: id |
/users/example |
없음 | 없음 | 200 OK |
| 유저의 이벤트 조회 | GET | /users/{userId}/events |
Path param: userId |
/users/example/events |
이벤트 리스트 | [ { "title": "example", "toDo": "example", "createdAt": "example", "modifiedAt": "example", "id": "example" }, ... ] |
200 OK |
// build.gradle
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-validation'
compileOnly 'org.projectlombok:lombok'
runtimeOnly 'com.mysql:mysql-connector-j'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'