Skip to content
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
wants to merge 51 commits into
base: jehs
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
6027063
init: init project
hyoguoo Nov 22, 2023
b223165
config: yaml 파일 데이터베이스 연결 설정
hyoguoo Nov 22, 2023
63b5c68
feat: BaseEntity 추가
hyoguoo Nov 22, 2023
b923f63
feat: User Entity 추가
hyoguoo Nov 22, 2023
8fd8a61
feat: Post Entity 추가
hyoguoo Nov 22, 2023
e2e231b
feat: Entity가 생성 시, 생성/수정 시간 자동 설정
JeongeunChoi Nov 22, 2023
bd6a35d
feat: 엔터티 setter 삭제 및 builder 설정
JeongeunChoi Nov 22, 2023
46d5028
feat: Post, User Repository 추가
JeongeunChoi Nov 22, 2023
65b60c6
feat: 게시글 생성 서비스 로직 추가
JeongeunChoi Nov 22, 2023
190bae6
feat: 게시글 페이지 조회 및 특정 게시글 조회 서비스 로직 추가
JeongeunChoi Nov 22, 2023
33aa13b
feat: 게시글 수정 서비스 로직 추가
JeongeunChoi Nov 22, 2023
b59bdb8
feat: 게시글 관련 Rest API 추가
JeongeunChoi Nov 22, 2023
f4fb87a
chore: 실행을 위한 임시 값 수정
JeongeunChoi Nov 22, 2023
51da029
feat: BaseEntity Getter 추가
hyoguoo Nov 23, 2023
10217c9
chore: 코드 복구
hyoguoo Nov 23, 2023
3b68d6c
feat: Post 조회 Response 추가
hyoguoo Nov 23, 2023
2ed642c
feat: User 조회 Response 추가
hyoguoo Nov 23, 2023
b449a6e
mod: Post 도메인 그대로 노출되는 것 변경(PostResponse 적용)
hyoguoo Nov 23, 2023
44117f5
feat: 성공 메시지 클래스 추가
JeongeunChoi Nov 23, 2023
edfb18a
feat: ResponseEntity 적용
JeongeunChoi Nov 23, 2023
8a7334e
feat: User, Post 커스텀 예외 메시지 및 클래스 생성
JeongeunChoi Nov 23, 2023
94151db
feat: User, Post 커스텀 예외 적용
JeongeunChoi Nov 23, 2023
1921dc3
feat: 예외 처리 컨트롤러 어드바이스 추가
JeongeunChoi Nov 23, 2023
1a9c44d
mod: Post fetch join 적용
JeongeunChoi Nov 23, 2023
a98c640
config: database default user insert 쿼리 추가
hyoguoo Nov 23, 2023
f793dec
feat: Post Controller API 통합 테스트 추가
hyoguoo Nov 23, 2023
ad00ca4
chore: restdocs adoc 파일 설정
JeongeunChoi Nov 24, 2023
9d47d3f
feat: PostControllerTest restdocs 추가
JeongeunChoi Nov 24, 2023
4becb69
feat: 요청 및 응답값 prettyPrint 설정
hyoguoo Nov 24, 2023
0f3fae6
feat: RestDocs request/response fields 추가
hyoguoo Nov 24, 2023
6aaabf5
feat: 에러 발생 시 로깅 추가
hyoguoo Nov 24, 2023
e31ae94
feat: 전체 Exception 대상 Handler 추가
hyoguoo Nov 24, 2023
e1621ed
feat: Cursor 기반 Post 리스트 조회 구현
hyoguoo Nov 26, 2023
2781796
mod: Cursor 기반 조회 시 Slice 타입으로 변경
hyoguoo Nov 26, 2023
7226a2a
feat: User isSameName 메서드 구현 및 적용
hyoguoo Dec 4, 2023
6ba889b
chore: code reformat 적용
hyoguoo Dec 4, 2023
5be79c1
mod: RequestMapping 제거
hyoguoo Dec 4, 2023
fb847a5
mod: RequestMapping 제거 및 SuccessMessage 제네릭 적용
hyoguoo Dec 4, 2023
c4f934b
mod: 알 수 없는 에러 발생 시 상세 에러 정보 반환하지 않도록 변경
hyoguoo Dec 4, 2023
eeb45ff
chore: 게시글 생성 메서드 Transational 어노테이션 적용
hyoguoo Dec 4, 2023
6232a38
mod: Post 리스트 조회 시 Pageable 객체 대신 필요한 값만 받도록 변경 및 Post 리스트 조회 Respons…
hyoguoo Dec 4, 2023
f1cbbe7
mod: 업데이트 시간 애플리케이션 레벨에서 관리되도록 수정
hyoguoo Dec 4, 2023
6d5d2f5
feat: postType ColumnName 명시 추가
hyoguoo Dec 4, 2023
de7046e
fix: 정렬 옵션 제거
hyoguoo Dec 4, 2023
c6a8683
fix: PagesResponse 명세로 변경
hyoguoo Dec 4, 2023
88c16dd
mod: Post 리스트 조회 시 Slice 객체 대신 필요한 값만 받도록 변경 및 Post 리스트 조회 Response 적용
JeongeunChoi Dec 6, 2023
c4ab0e0
chore: 코드 리포멧
hyoguoo Dec 6, 2023
245af97
mod: @EnableJpaAuditing 제거
JeongeunChoi Dec 11, 2023
680e343
refactor: List 조회 Response DTO 제네릭 클래스로 변경
hyoguoo Dec 12, 2023
dfc083b
feat: User 엔티티 age 값 객체 생성 및 검증 로직 추가
hyoguoo Dec 12, 2023
6d76b2f
chore: 불필요한 Rest Docs 관련 그래들 설정 삭제
JeongeunChoi Dec 12, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
249 changes: 249 additions & 0 deletions .gitignore
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
31 changes: 31 additions & 0 deletions HELP.md
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)

60 changes: 60 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
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()
}

asciidoctor {
dependsOn test
inputs.dir snippetsDir
}

bootJar {
enabled = true
dependsOn asciidoctor
copy {
from file('build/docs/asciidoc')
into file("src/main/resources/static/docs")
}
}
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
7 changes: 7 additions & 0 deletions 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-8.4-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists