Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions spring-mvc/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/gradlew text eol=lf
*.bat text eol=crlf
*.jar binary
37 changes: 37 additions & 0 deletions spring-mvc/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
HELP.md
.gradle
build/
!gradle/wrapper/gradle-wrapper.jar
!**/src/main/**/build/
!**/src/test/**/build/

### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
bin/
!**/src/main/**/bin/
!**/src/test/**/bin/

### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
out/
!**/src/main/**/out/
!**/src/test/**/out/

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/

### VS Code ###
.vscode/
44 changes: 44 additions & 0 deletions spring-mvc/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# 과제명
REST API 서버 구현

## ⚙️ 실행 방법
1. IntelliJ에서 프로젝트 열기
2. RestApiServerApplication.java 실행

## 💡 작업 내용
- 엔티티
````
Post
````

- 필드
````
id
title
content
createdAt
````

- 폴더 구조
````
controller
service
dto
repository
entity
````

- Postman 사용하여 전체 API 테스트 캡쳐화 후 제출

## 📡 API 명세 (Spring 과제의 경우)
| Method | URL | 설명 |
| ----- | -------- | -------- |
| POST | /posts | 게시글 생성 |
| GET | /posts | 전체 조회 |
| GET | /posts/{id} | 단건 조회 |
| PUT | /posts/{id} | 수정 |
| DELETE | /posts/{id} | 삭제 |

## 🤔 느낀 점 / 어려웠던 점
- 멋쟁이사자처럼의 'Java 첫 걸음 시작하기 - Sprring Boot의 구조 및 작동 원리, Spring Boot 데이터베이스 연동 및 CRUD API 구현'을 베이스로 참고했습니다.
- 컨트롤러와 DTO를 분리하기 위해 코드에서 형식을 변환하는 과정이 어려웠습니다. 또한 애너테이션(@)의 역할과 수행하는 과정을 이해하는데 있어서 어려웠습니다.
32 changes: 32 additions & 0 deletions spring-mvc/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
plugins {
id 'java'
id 'org.springframework.boot' version '4.0.6'
id 'io.spring.dependency-management' version '1.1.7'
}

group = 'com.task'
version = '0.0.1-SNAPSHOT'

java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}

repositories {
mavenCentral()
}

dependencies {
implementation 'org.springframework.boot:spring-boot-h2console'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-webmvc'
runtimeOnly 'com.h2database:h2'
testImplementation 'org.springframework.boot:spring-boot-starter-data-jpa-test'
testImplementation 'org.springframework.boot:spring-boot-starter-webmvc-test'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}

tasks.named('test') {
useJUnitPlatform()
}
Binary file added spring-mvc/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
7 changes: 7 additions & 0 deletions spring-mvc/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
248 changes: 248 additions & 0 deletions spring-mvc/gradlew

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading