-
Notifications
You must be signed in to change notification settings - Fork 0
[게시판 + DB연동] 이민구 제출합니다. #41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: LEEMINGU03
Are you sure you want to change the base?
Changes from all commits
2812db9
db548f5
a5ec1d5
02f50bb
4436698
d53af41
177f215
6e6cf29
d571416
36f24ee
b7e0697
99bb3a3
5d65943
ce3c9c5
a648112
b7cb564
cc922a2
171a35d
e6e5fdf
91db02c
42aab84
f246db3
5ee60b5
53d7742
398a64b
2b0ebbd
3d177fc
3b14d6d
0dcde2b
79e707c
f8ac6d3
ae82fa6
b7556e5
85cbf20
8f6a63f
e6f4473
b272dd8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| /gradlew text eol=lf | ||
| *.bat text eol=crlf | ||
| *.jar binary |
| 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 |
| 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 계층구조를 사용해서 작성해보았습니다. 이것이 관리하거나 찾기가 더욱 편리한것 같습니다 . |
| 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() | ||
| } |
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 현재 게시글 생성 API에서 200 OK를 사용해주신 것으로 보이는데, 200 OK도 요청 성공을 의미하기 때문에 완전히 틀린 것은 아니라고 생각합니다. 다만 게시글 생성처럼 새로운 리소스가 생성되는 경우에는 HTTP 표준상 201 Created를 사용하는 것이 더 의미가 명확합니다. 201 Created는 요청이 성공적으로 처리되었고, 그 결과 새로운 리소스가 생성되었음을 나타내는 상태 코드로 정의되어 있습니다. 혹시 200 OK를 사용하신 특별한 이유가 있으신지 궁금합니다!
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 성공한 것에 대한 것은 전부 200OK라고 했습니다. |
| 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 |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
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번 성공 중 첫 번째 케이스)를 정의하려고 하신 걸까요? 어떤 의도로 작성하셨는지 궁금합니다!"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
같은 성공이여도 어떤 성공인지 세부적으로 분리해보기 위해서 200-1 같은 기능을 넣어보기 위해 연습해보았습니다.
하지만 지금 성공이 전부 200-1 로 되어있어 수정 하였습니다!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
README에 상세 코드 정보 넣어뒀습니다!