-
Notifications
You must be signed in to change notification settings - Fork 206
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
[5기 최정은, 권효승] Spring Boot JPA 게시판 구현 미션 제출합니다. #275
Open
JeongeunChoi
wants to merge
51
commits into
prgrms-be-devcourse:jehs
Choose a base branch
from
hyoguoo:main
base: jehs
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 48 commits
Commits
Show all changes
51 commits
Select commit
Hold shift + click to select a range
6027063
init: init project
hyoguoo b223165
config: yaml 파일 데이터베이스 연결 설정
hyoguoo 63b5c68
feat: BaseEntity 추가
hyoguoo b923f63
feat: User Entity 추가
hyoguoo 8fd8a61
feat: Post Entity 추가
hyoguoo e2e231b
feat: Entity가 생성 시, 생성/수정 시간 자동 설정
JeongeunChoi bd6a35d
feat: 엔터티 setter 삭제 및 builder 설정
JeongeunChoi 46d5028
feat: Post, User Repository 추가
JeongeunChoi 65b60c6
feat: 게시글 생성 서비스 로직 추가
JeongeunChoi 190bae6
feat: 게시글 페이지 조회 및 특정 게시글 조회 서비스 로직 추가
JeongeunChoi 33aa13b
feat: 게시글 수정 서비스 로직 추가
JeongeunChoi b59bdb8
feat: 게시글 관련 Rest API 추가
JeongeunChoi f4fb87a
chore: 실행을 위한 임시 값 수정
JeongeunChoi 51da029
feat: BaseEntity Getter 추가
hyoguoo 10217c9
chore: 코드 복구
hyoguoo 3b68d6c
feat: Post 조회 Response 추가
hyoguoo 2ed642c
feat: User 조회 Response 추가
hyoguoo b449a6e
mod: Post 도메인 그대로 노출되는 것 변경(PostResponse 적용)
hyoguoo 44117f5
feat: 성공 메시지 클래스 추가
JeongeunChoi edfb18a
feat: ResponseEntity 적용
JeongeunChoi 8a7334e
feat: User, Post 커스텀 예외 메시지 및 클래스 생성
JeongeunChoi 94151db
feat: User, Post 커스텀 예외 적용
JeongeunChoi 1921dc3
feat: 예외 처리 컨트롤러 어드바이스 추가
JeongeunChoi 1a9c44d
mod: Post fetch join 적용
JeongeunChoi a98c640
config: database default user insert 쿼리 추가
hyoguoo f793dec
feat: Post Controller API 통합 테스트 추가
hyoguoo ad00ca4
chore: restdocs adoc 파일 설정
JeongeunChoi 9d47d3f
feat: PostControllerTest restdocs 추가
JeongeunChoi 4becb69
feat: 요청 및 응답값 prettyPrint 설정
hyoguoo 0f3fae6
feat: RestDocs request/response fields 추가
hyoguoo 6aaabf5
feat: 에러 발생 시 로깅 추가
hyoguoo e31ae94
feat: 전체 Exception 대상 Handler 추가
hyoguoo e1621ed
feat: Cursor 기반 Post 리스트 조회 구현
hyoguoo 2781796
mod: Cursor 기반 조회 시 Slice 타입으로 변경
hyoguoo 7226a2a
feat: User isSameName 메서드 구현 및 적용
hyoguoo 6ba889b
chore: code reformat 적용
hyoguoo 5be79c1
mod: RequestMapping 제거
hyoguoo fb847a5
mod: RequestMapping 제거 및 SuccessMessage 제네릭 적용
hyoguoo c4f934b
mod: 알 수 없는 에러 발생 시 상세 에러 정보 반환하지 않도록 변경
hyoguoo eeb45ff
chore: 게시글 생성 메서드 Transational 어노테이션 적용
hyoguoo 6232a38
mod: Post 리스트 조회 시 Pageable 객체 대신 필요한 값만 받도록 변경 및 Post 리스트 조회 Respons…
hyoguoo f1cbbe7
mod: 업데이트 시간 애플리케이션 레벨에서 관리되도록 수정
hyoguoo 6d5d2f5
feat: postType ColumnName 명시 추가
hyoguoo de7046e
fix: 정렬 옵션 제거
hyoguoo c6a8683
fix: PagesResponse 명세로 변경
hyoguoo 88c16dd
mod: Post 리스트 조회 시 Slice 객체 대신 필요한 값만 받도록 변경 및 Post 리스트 조회 Response 적용
JeongeunChoi c4ab0e0
chore: 코드 리포멧
hyoguoo 245af97
mod: @EnableJpaAuditing 제거
JeongeunChoi 680e343
refactor: List 조회 Response DTO 제네릭 클래스로 변경
hyoguoo dfc083b
feat: User 엔티티 age 값 객체 생성 및 검증 로직 추가
hyoguoo 6d76b2f
chore: 불필요한 Rest Docs 관련 그래들 설정 삭제
JeongeunChoi File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,249 @@ | ||
# Created by https://www.toptal.com/developers/gitignore/api/java,intellij,macos,windows,visualstudiocode,gradle | ||
# Edit at https://www.toptal.com/developers/gitignore?templates=java,intellij,macos,windows,visualstudiocode,gradle | ||
|
||
### Intellij ### | ||
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider | ||
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 | ||
|
||
# User-specific stuff | ||
.idea | ||
.idea/**/workspace.xml | ||
.idea/**/tasks.xml | ||
.idea/**/usage.statistics.xml | ||
.idea/**/dictionaries | ||
.idea/**/shelf | ||
|
||
# AWS User-specific | ||
.idea/**/aws.xml | ||
|
||
# Generated files | ||
.idea/**/contentModel.xml | ||
|
||
# Sensitive or high-churn files | ||
.idea/**/dataSources/ | ||
.idea/**/dataSources.ids | ||
.idea/**/dataSources.local.xml | ||
.idea/**/sqlDataSources.xml | ||
.idea/**/dynamic.xml | ||
.idea/**/uiDesigner.xml | ||
.idea/**/dbnavigator.xml | ||
|
||
# Gradle | ||
.idea/**/gradle.xml | ||
.idea/**/libraries | ||
|
||
# Gradle and Maven with auto-import | ||
# When using Gradle or Maven with auto-import, you should exclude module files, | ||
# since they will be recreated, and may cause churn. Uncomment if using | ||
# auto-import. | ||
# .idea/artifacts | ||
# .idea/compiler.xml | ||
# .idea/jarRepositories.xml | ||
# .idea/modules.xml | ||
# .idea/*.iml | ||
# .idea/modules | ||
# *.iml | ||
# *.ipr | ||
|
||
# CMake | ||
cmake-build-*/ | ||
|
||
# Mongo Explorer plugin | ||
.idea/**/mongoSettings.xml | ||
|
||
# File-based project format | ||
*.iws | ||
|
||
# IntelliJ | ||
out/ | ||
|
||
# mpeltonen/sbt-idea plugin | ||
.idea_modules/ | ||
|
||
# JIRA plugin | ||
atlassian-ide-plugin.xml | ||
|
||
# Cursive Clojure plugin | ||
.idea/replstate.xml | ||
|
||
# SonarLint plugin | ||
.idea/sonarlint/ | ||
|
||
# Crashlytics plugin (for Android Studio and IntelliJ) | ||
com_crashlytics_export_strings.xml | ||
crashlytics.properties | ||
crashlytics-build.properties | ||
fabric.properties | ||
|
||
# Editor-based Rest Client | ||
.idea/httpRequests | ||
|
||
# Android studio 3.1+ serialized cache file | ||
.idea/caches/build_file_checksums.ser | ||
|
||
### Intellij Patch ### | ||
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721 | ||
|
||
# *.iml | ||
# modules.xml | ||
# .idea/misc.xml | ||
# *.ipr | ||
|
||
# Sonarlint plugin | ||
# https://plugins.jetbrains.com/plugin/7973-sonarlint | ||
.idea/**/sonarlint/ | ||
|
||
# SonarQube Plugin | ||
# https://plugins.jetbrains.com/plugin/7238-sonarqube-community-plugin | ||
.idea/**/sonarIssues.xml | ||
|
||
# Markdown Navigator plugin | ||
# https://plugins.jetbrains.com/plugin/7896-markdown-navigator-enhanced | ||
.idea/**/markdown-navigator.xml | ||
.idea/**/markdown-navigator-enh.xml | ||
.idea/**/markdown-navigator/ | ||
|
||
# Cache file creation bug | ||
# See https://youtrack.jetbrains.com/issue/JBR-2257 | ||
.idea/$CACHE_FILE$ | ||
|
||
# CodeStream plugin | ||
# https://plugins.jetbrains.com/plugin/12206-codestream | ||
.idea/codestream.xml | ||
|
||
# Azure Toolkit for IntelliJ plugin | ||
# https://plugins.jetbrains.com/plugin/8053-azure-toolkit-for-intellij | ||
.idea/**/azureSettings.xml | ||
|
||
### Java ### | ||
# Compiled class file | ||
*.class | ||
|
||
# Log file | ||
*.log | ||
|
||
# BlueJ files | ||
*.ctxt | ||
|
||
# Mobile Tools for Java (J2ME) | ||
.mtj.tmp/ | ||
|
||
# Package Files # | ||
*.jar | ||
*.war | ||
*.nar | ||
*.ear | ||
*.zip | ||
*.tar.gz | ||
*.rar | ||
|
||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml | ||
hs_err_pid* | ||
replay_pid* | ||
|
||
### macOS ### | ||
# General | ||
.DS_Store | ||
.AppleDouble | ||
.LSOverride | ||
|
||
# Icon must end with two \r | ||
Icon | ||
|
||
|
||
# Thumbnails | ||
._* | ||
|
||
# Files that might appear in the root of a volume | ||
.DocumentRevisions-V100 | ||
.fseventsd | ||
.Spotlight-V100 | ||
.TemporaryItems | ||
.Trashes | ||
.VolumeIcon.icns | ||
.com.apple.timemachine.donotpresent | ||
|
||
# Directories potentially created on remote AFP share | ||
.AppleDB | ||
.AppleDesktop | ||
Network Trash Folder | ||
Temporary Items | ||
.apdisk | ||
|
||
### macOS Patch ### | ||
# iCloud generated files | ||
*.icloud | ||
|
||
### VisualStudioCode ### | ||
.vscode/* | ||
!.vscode/settings.json | ||
!.vscode/tasks.json | ||
!.vscode/launch.json | ||
!.vscode/extensions.json | ||
!.vscode/*.code-snippets | ||
|
||
# Local History for Visual Studio Code | ||
.history/ | ||
|
||
# Built Visual Studio Code Extensions | ||
*.vsix | ||
|
||
### VisualStudioCode Patch ### | ||
# Ignore all local history of files | ||
.history | ||
.ionide | ||
|
||
### Windows ### | ||
# Windows thumbnail cache files | ||
Thumbs.db | ||
Thumbs.db:encryptable | ||
ehthumbs.db | ||
ehthumbs_vista.db | ||
|
||
# Dump file | ||
*.stackdump | ||
|
||
# Folder config file | ||
[Dd]esktop.ini | ||
|
||
# Recycle Bin used on file shares | ||
$RECYCLE.BIN/ | ||
|
||
# Windows Installer files | ||
*.cab | ||
*.msi | ||
*.msix | ||
*.msm | ||
*.msp | ||
|
||
# Windows shortcuts | ||
*.lnk | ||
|
||
### Gradle ### | ||
.gradle | ||
**/build/ | ||
!src/**/build/ | ||
|
||
# Ignore Gradle GUI config | ||
gradle-app.setting | ||
|
||
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) | ||
!gradle-wrapper.jar | ||
|
||
# Avoid ignore Gradle wrappper properties | ||
!gradle-wrapper.properties | ||
|
||
# Cache of project | ||
.gradletasknamecache | ||
|
||
# Eclipse Gradle plugin generated files | ||
# Eclipse Core | ||
.project | ||
# JDT-specific (Eclipse Java Development Tools) | ||
.classpath | ||
|
||
### Gradle Patch ### | ||
# Java heap dump | ||
*.hprof | ||
|
||
# End of https://www.toptal.com/developers/gitignore/api/java,intellij,macos,windows,visualstudiocode,gradle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Read Me First | ||
The following was discovered as part of building this project: | ||
|
||
* The original package name 'jehs.springboot-board-jpa' is invalid and this project uses 'jehs.springbootboardjpa' instead. | ||
|
||
# Getting Started | ||
|
||
### Reference Documentation | ||
For further reference, please consider the following sections: | ||
|
||
* [Official Gradle documentation](https://docs.gradle.org) | ||
* [Spring Boot Gradle Plugin Reference Guide](https://docs.spring.io/spring-boot/docs/3.1.5/gradle-plugin/reference/html/) | ||
* [Create an OCI image](https://docs.spring.io/spring-boot/docs/3.1.5/gradle-plugin/reference/html/#build-image) | ||
* [Spring Web](https://docs.spring.io/spring-boot/docs/3.1.5/reference/htmlsingle/index.html#web) | ||
* [Spring REST Docs](https://docs.spring.io/spring-restdocs/docs/current/reference/html5/) | ||
* [Spring Data JPA](https://docs.spring.io/spring-boot/docs/3.1.5/reference/htmlsingle/index.html#data.sql.jpa-and-spring-data) | ||
|
||
### Guides | ||
The following guides illustrate how to use some features concretely: | ||
|
||
* [Building a RESTful Web Service](https://spring.io/guides/gs/rest-service/) | ||
* [Serving Web Content with Spring MVC](https://spring.io/guides/gs/serving-web-content/) | ||
* [Building REST services with Spring](https://spring.io/guides/tutorials/rest/) | ||
* [Accessing data with MySQL](https://spring.io/guides/gs/accessing-data-mysql/) | ||
* [Accessing Data with JPA](https://spring.io/guides/gs/accessing-data-jpa/) | ||
|
||
### Additional Links | ||
These additional references should also help you: | ||
|
||
* [Gradle Build Scans – insights for your project's build](https://scans.gradle.com#gradle) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
plugins { | ||
id 'java' | ||
id 'org.springframework.boot' version '3.1.5' | ||
id 'io.spring.dependency-management' version '1.1.3' | ||
id 'org.asciidoctor.jvm.convert' version '3.3.2' | ||
} | ||
|
||
group = 'jehs' | ||
version = '0.0.1-SNAPSHOT' | ||
|
||
java { | ||
sourceCompatibility = '17' | ||
} | ||
|
||
configurations { | ||
compileOnly { | ||
extendsFrom annotationProcessor | ||
} | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
ext { | ||
set('snippetsDir', file("build/generated-snippets")) | ||
} | ||
|
||
dependencies { | ||
implementation 'org.springframework.boot:spring-boot-starter-data-jpa' | ||
implementation 'org.springframework.boot:spring-boot-starter-web' | ||
compileOnly 'org.projectlombok:lombok' | ||
runtimeOnly 'com.mysql:mysql-connector-j' | ||
annotationProcessor 'org.projectlombok:lombok' | ||
testImplementation 'org.springframework.boot:spring-boot-starter-test' | ||
testImplementation 'org.springframework.restdocs:spring-restdocs-mockmvc' | ||
} | ||
|
||
tasks.named('bootBuildImage') { | ||
builder = 'paketobuildpacks/builder-jammy-base:latest' | ||
} | ||
|
||
tasks.named('test') { | ||
outputs.dir snippetsDir | ||
useJUnitPlatform() | ||
} | ||
|
||
tasks.named('asciidoctor') { | ||
inputs.dir snippetsDir | ||
dependsOn test | ||
} | ||
|
||
asciidoctor { | ||
dependsOn test | ||
inputs.dir snippetsDir | ||
} | ||
|
||
asciidoctor.doFirst { | ||
delete file('src/main/resources/static/docs') | ||
} | ||
|
||
bootJar { | ||
enabled = true | ||
dependsOn asciidoctor | ||
copy { | ||
from file('build/docs/asciidoc') | ||
into file("src/main/resources/static/docs") | ||
} | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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-8.4-bin.zip | ||
networkTimeout=10000 | ||
validateDistributionUrl=true | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
rest docs 관련 설정을 설명해주실 수 있나요 😄
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.
asciidoctor 태스크를 설정하여
snippetsDir에 스니펫들을 저장하고,
test에 의존하도록하여 해당 태스크 실행 전 test가 먼저 실행되도록 하였는데
엇 처음 두개 설정이 동일한 작업이군요..! 수정해두겠습니다 ㅎㅎ
세번째 설정은 asciidoctor 태스크 실행 전에 해당 경로에 있는 파일 삭제하는 작업으로
이전에 생성된 문서를 제거하고 새로운 문서를 생성하기 위해 사용하였습니다.
해당 설정은 파일명 변경 시, 파일이 누적되는 것을 방지하기 위할 수 있으나 이번 프로젝트에서는 불필요한 것 같네요. 수정하도록 하겠습니다!
gradle 설정을 별로 신경쓰지 않았는데
언급해주셔서 다시 보니 불필요한 설정들도 보이네요.. 감사합니다~🙇♀️