Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
2812db9
Feat/ 생성시간 entity
LEEMINGU03 May 29, 2026
db548f5
Feat/ 댓글 entity
LEEMINGU03 May 29, 2026
a5ec1d5
Feat/ 댓글 controller
LEEMINGU03 May 29, 2026
02f50bb
Feat/ 댓글 repository
LEEMINGU03 May 29, 2026
4436698
Feat/ 댓글 요청 dto
LEEMINGU03 May 29, 2026
d53af41
Feat/ 댓글 응답 dto
LEEMINGU03 May 29, 2026
177f215
Feat/ 댓글 service
LEEMINGU03 May 29, 2026
6e6cf29
DOCS/댓글 api postman 캡쳐
LEEMINGU03 May 29, 2026
d571416
DOCS/게시물 api postman 캡쳐
LEEMINGU03 May 29, 2026
36f24ee
DOCS/존재하지 않는 게시물 검색
LEEMINGU03 May 29, 2026
b7e0697
DOCS/댓글 수정 api postman 캡쳐
LEEMINGU03 May 29, 2026
99bb3a3
Feat/ 오류 처리
LEEMINGU03 May 29, 2026
5d65943
Feat/ 게시판 Entity
LEEMINGU03 May 29, 2026
ce3c9c5
Feat/ 게시판 Controller
LEEMINGU03 May 29, 2026
a648112
Feat/ 게시판 생성 dto
LEEMINGU03 May 29, 2026
b7cb564
Feat/ 게시판 Repository
LEEMINGU03 May 29, 2026
cc922a2
Feat/ 게시판 응답 dto
LEEMINGU03 May 29, 2026
171a35d
Feat/ 게시판 service
LEEMINGU03 May 29, 2026
e6e5fdf
Feat/ 게시판 수정 dto
LEEMINGU03 May 29, 2026
91db02c
Feat/ RsData 커스텀
LEEMINGU03 May 29, 2026
42aab84
Docs/ README 작성
LEEMINGU03 May 29, 2026
f246db3
Feat/ 실행
LEEMINGU03 May 29, 2026
5ee60b5
Setting/ 초기세팅
LEEMINGU03 May 29, 2026
53d7742
Feat/ 실행
LEEMINGU03 May 29, 2026
398a64b
Refactor/ 개시물 생성 201 created 수정
LEEMINGU03 Jun 7, 2026
2b0ebbd
Docs/ 개시물 생성 201 created 수정
LEEMINGU03 Jun 7, 2026
3d177fc
Docs/ 삭제
LEEMINGU03 Jun 7, 2026
3b14d6d
Refactor/400 -> 404 not found 수정
LEEMINGU03 Jun 7, 2026
0dcde2b
Refactor/200 -> 201 created 수정
LEEMINGU03 Jun 7, 2026
79e707c
Refactor/공통 리소스 경로로 수정
LEEMINGU03 Jun 7, 2026
f8ac6d3
Refactor/오타 수정
LEEMINGU03 Jun 7, 2026
ae82fa6
Refactor/Transactional 수정
LEEMINGU03 Jun 7, 2026
b7556e5
Refactor/Transactional 수정
LEEMINGU03 Jun 7, 2026
85cbf20
Refactor/API 성공 세부사항 코드 수정
LEEMINGU03 Jun 7, 2026
8f6a63f
Docs/API 성공 세부사항 코드 작성
LEEMINGU03 Jun 7, 2026
e6f4473
Refactor/ 게시물 id 검증
LEEMINGU03 Jun 7, 2026
b272dd8
Docs/ DB 반영 스크린샷
LEEMINGU03 Jun 7, 2026
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 springdb/.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
39 changes: 39 additions & 0 deletions springdb/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
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/

.env
42 changes: 42 additions & 0 deletions springdb/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# 과제명
게시판 + DB연동

## ⚙️ 실행 방법
1. mysql 생성 후 SCHEMAS 생성(board)
2. .env 에 DB정보 입력
3. SpringdbApplication 실행

## 💡 작업 내용
- 게시글 CRUD 구성
- 댓글 CRUD 구성
- MYSQL 연동
- JPA사용

# API 명세

| Method | URI | 설명 |
|--------|-----|------|
| POST | /post | 게시글 생성 |
| GET | /post | 게시글 목록 조회 |
| GET | /post/{id} | 게시글 단건 조회 |
| PUT | /post/{id} | 게시글 수정 |
| DELETE | /post/{id} | 게시글 삭제 |
|Post|/post/{id}/comment| 댓글 추가|
|GET|/post/{id}/comment|댓글 전체 조회|
|GET|post/{id}/comment/{commentId}|댓글 단건 조회|
|PUT|post/{id}/comment/{commentId}|댓글 수정|
|DELETE|post/{id}/comment/{commentId}|댓글 삭제|


# API 성공 세부 사항
- 200-1: 게시물 등록 성공
- 200-2: 게시물 단건 조회 선공
- 200-3: 게시물 수정 조회 선공
- 200-4: 게시물 삭제 선공
- 200-5: 게시물 전체 조회 선공

## 🤔 느낀 점 / 어려웠던 점
- 저번주에 피드백 주신 내용을 중점으로 작성해보았습니다
- jpa를 사용하더라도 DB 구조 설계에 대해서 더욱 학습이 필요하다는 것을 느끼게 되었습니다.
- 게시물도 처음부터 작성해보고 댓글도 만들어보면서 dto의 흐름이나 전체적인 흐름을 알 수 있었습니다.
- domain 계층구조를 사용해서 작성해보았습니다. 이것이 관리하거나 찾기가 더욱 편리한것 같습니다 .
39 changes: 39 additions & 0 deletions springdb/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
plugins {
id 'java'
id 'org.springframework.boot' version '4.0.6'
id 'io.spring.dependency-management' version '1.1.7'
}

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

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

repositories {
mavenCentral()
}

dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.boot:spring-boot-starter-webmvc'
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-data-jpa-test'
testImplementation 'org.springframework.boot:spring-boot-starter-validation-test'
testImplementation 'org.springframework.boot:spring-boot-starter-webmvc-test'
testCompileOnly 'org.projectlombok:lombok'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
testAnnotationProcessor 'org.projectlombok:lombok'
implementation 'com.mysql:mysql-connector-j:8.0.33'
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'

}

tasks.named('test') {
useJUnitPlatform()
}
Binary file added springdb/docs/Comment/deleteComment.png

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

여기에 적힌 resultCode 값 중에 200-1이 눈에 띄는데요. 혹시 HTTP 상태 코드인 200을 기반으로 내부적인 세부 명세(예: 200번 성공 중 첫 번째 케이스)를 정의하려고 하신 걸까요? 어떤 의도로 작성하셨는지 궁금합니다!"

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

같은 성공이여도 어떤 성공인지 세부적으로 분리해보기 위해서 200-1 같은 기능을 넣어보기 위해 연습해보았습니다.
하지만 지금 성공이 전부 200-1 로 되어있어 수정 하였습니다!

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

README에 상세 코드 정보 넣어뒀습니다!

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added springdb/docs/Comment/getAllComment.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added springdb/docs/Comment/getOneComment.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added springdb/docs/Comment/newComment.png

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

현재 게시글 생성 API에서 200 OK를 사용해주신 것으로 보이는데, 200 OK도 요청 성공을 의미하기 때문에 완전히 틀린 것은 아니라고 생각합니다.

다만 게시글 생성처럼 새로운 리소스가 생성되는 경우에는 HTTP 표준상 201 Created를 사용하는 것이 더 의미가 명확합니다. 201 Created는 요청이 성공적으로 처리되었고, 그 결과 새로운 리소스가 생성되었음을 나타내는 상태 코드로 정의되어 있습니다.

혹시 200 OK를 사용하신 특별한 이유가 있으신지 궁금합니다!

@LEEMINGU03 LEEMINGU03 Jun 7, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

성공한 것에 대한 것은 전부 200OK라고 했습니다.
성공한 것도 분류 해서 작성해야하는 것을 망각했습니다.
201 Created로 수정하였습니다.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added springdb/docs/Comment/updateComment.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added springdb/docs/DB/PostDB.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added springdb/docs/DB/commentDB.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added springdb/docs/Post/PostPaging.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added springdb/docs/Post/deletePost.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added springdb/docs/Post/getAll.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added springdb/docs/Post/getOne.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added springdb/docs/Post/newPost.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added springdb/docs/Post/updatePost.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added springdb/docs/notFound404.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added springdb/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
7 changes: 7 additions & 0 deletions springdb/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 springdb/gradlew

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

Loading