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 게시판 구현 미션 제출합니다. #278

Open
wants to merge 89 commits into
base: injae&hyeonwoo
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
b7821b8
init: initialize the project
IjjS Nov 20, 2023
55974ec
feat: defint entities
IjjS Nov 21, 2023
9bc80e2
chore: configure the datasource
IjjS Nov 21, 2023
8391918
chore: configure the datasource
IjjS Nov 21, 2023
1976759
fix: remove last comma
ASak1104 Nov 21, 2023
91b19d6
fix: change generate strategy
ASak1104 Nov 21, 2023
1c4b600
Merge branch 'main' of https://github.com/spring-comes-to-us/springbo…
IjjS Nov 21, 2023
6794825
fix: allow null value for author and modifier
ASak1104 Nov 21, 2023
fe828a6
fix: change primitive type to wrapper
ASak1104 Nov 21, 2023
a450a44
chore: add faker dependency
ASak1104 Nov 21, 2023
8adcfe9
test: user instance test
ASak1104 Nov 21, 2023
670ffc4
Merge branch 'main' of https://github.com/spring-comes-to-us/springbo…
IjjS Nov 21, 2023
bfa82a4
chore: fix typo
ASak1104 Nov 21, 2023
9ea8acd
Merge branch 'main' of https://github.com/spring-comes-to-us/springbo…
IjjS Nov 21, 2023
6a7a416
chore: add foreign key to users
IjjS Nov 21, 2023
b5098b8
enhance: add mappings to post and user
IjjS Nov 21, 2023
fa95ab1
test: test simple mapping test of user and posts
IjjS Nov 21, 2023
00c2636
fix: fix auditing strategy
IjjS Nov 22, 2023
0a122a1
refactor: enhance readability
IjjS Nov 22, 2023
1a7dadd
test: fix incorrect exception thrown
IjjS Nov 22, 2023
c2b1477
feat: implement jpa repository
IjjS Nov 22, 2023
086071c
feat: add create and find all services of user
IjjS Nov 22, 2023
0b9c79b
chore: specify properties
ASak1104 Nov 22, 2023
257d93b
refactor: change the purpose of dto
ASak1104 Nov 22, 2023
1012a54
feat: add user controller
ASak1104 Nov 22, 2023
c154bf7
feat: add getter
ASak1104 Nov 22, 2023
5cdba05
refactor: change return type to dto
ASak1104 Nov 22, 2023
d4245bd
test: add post test
IjjS Nov 23, 2023
9a45326
test: rename to reasonable test method names
IjjS Nov 23, 2023
f97f9cb
Merge branch 'main' of https://github.com/spring-comes-to-us/springbo…
IjjS Nov 23, 2023
9d1c012
feat: add create post service
IjjS Nov 23, 2023
ff6034e
feat: add create post controller
IjjS Nov 23, 2023
222fff6
style: reformat dtos
ASak1104 Nov 23, 2023
21bfa97
style: rename method
ASak1104 Nov 23, 2023
f3a7cd2
feat: add validation
ASak1104 Nov 23, 2023
f1f3632
feat: add case of no content
ASak1104 Nov 23, 2023
aa5fbbd
test: user controller
ASak1104 Nov 23, 2023
b781b1e
chore: add spring validation dependency
ASak1104 Nov 23, 2023
e256ccd
test: add bdd comment
ASak1104 Nov 23, 2023
6c93577
refactor: accept json format from the http request
IjjS Nov 23, 2023
fe747cf
feat: add find post by id feature
IjjS Nov 23, 2023
f75fd7d
test: add create and find post by id tests
IjjS Nov 23, 2023
448c21d
test: change when then return pattern to given will return
IjjS Nov 23, 2023
90cfd15
test: test find post by id
IjjS Nov 23, 2023
b2d80a7
fix: append transactional to pass actual object rather than proxy object
IjjS Nov 23, 2023
28813b2
feat: add update post method
ASak1104 Nov 23, 2023
7fc0d02
feat: add update post feature
ASak1104 Nov 23, 2023
1fe2951
test: add update tests of title and content
ASak1104 Nov 23, 2023
5f6fc3a
test: update post service test
ASak1104 Nov 23, 2023
1d41ba6
test: update post controller test
ASak1104 Nov 23, 2023
2f6c13e
refactor: remove unnecessary field
ASak1104 Nov 23, 2023
192d3b6
test: compare updated at
ASak1104 Nov 23, 2023
53f8cef
feat: implement controller advice and corresponding response
IjjS Nov 23, 2023
c5cf45f
enhance: add valid to request for user
IjjS Nov 23, 2023
46ab464
test: invalid user name test
IjjS Nov 23, 2023
e0063cd
style: set exception messages
IjjS Nov 23, 2023
f3856f9
test: negative age test
IjjS Nov 23, 2023
26e4e74
feat: add validation to post requests
IjjS Nov 23, 2023
058b8d4
style: unify record convention
IjjS Nov 23, 2023
8fc3bd9
test: fix number range not to be negative
IjjS Nov 23, 2023
dd35978
fix: allow id to zero
ASak1104 Nov 23, 2023
d5d438b
fix: id type to wrapper class
ASak1104 Nov 23, 2023
e096625
style: add http method type on test display name
ASak1104 Nov 23, 2023
46140bb
test: add create post request validation
ASak1104 Nov 23, 2023
4100647
test: add update post request validation
ASak1104 Nov 23, 2023
4ce1881
feat: add pagination feature
ASak1104 Nov 23, 2023
e61d382
feat: add page response dto
ASak1104 Nov 23, 2023
0c3b249
test: add get page of posts
IjjS Nov 23, 2023
6bea576
refactor: set default page size in yaml properties
IjjS Nov 23, 2023
76451d5
test: add find posts paged
IjjS Nov 23, 2023
6e5cdeb
chore: add asciidoc dependencies and task definitions
IjjS Nov 24, 2023
bd71f4c
feat: add post controller documentation
IjjS Nov 24, 2023
f606f15
feat: add post controller documentation
IjjS Nov 24, 2023
95cfd91
test: separate docs tests
ASak1104 Nov 24, 2023
405736f
test: add thread sleep before updating post
ASak1104 Nov 24, 2023
6fa6390
style: reformat blank line convention
ASak1104 Nov 24, 2023
3dcfe85
test: remove unnecessary print
ASak1104 Nov 24, 2023
7f6ce0d
test: set post content to nullable field
ASak1104 Nov 24, 2023
885ff42
test: add user controller rest docs test
ASak1104 Nov 24, 2023
6864f67
test: add thread sleep before updating post content
ASak1104 Nov 24, 2023
5213ca5
docs: add user api rest docs
ASak1104 Nov 24, 2023
d552593
refactor: change error message to constant
ASak1104 Nov 24, 2023
06b670c
feat: add no such element exception handler
ASak1104 Nov 24, 2023
32b85e9
test: add message validation
ASak1104 Nov 24, 2023
2547eeb
test: add tests no such user and post
ASak1104 Nov 24, 2023
ea18cd5
test: add rest docs about not exist post detail
ASak1104 Nov 24, 2023
2611601
test: rollback post content field type
ASak1104 Nov 24, 2023
ec83d42
add rest docs about updating not exist post
ASak1104 Nov 24, 2023
4ed70ec
add rest docs about not exist user post
ASak1104 Nov 24, 2023
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
205 changes: 205 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,205 @@
# Created by https://www.toptal.com/developers/gitignore/api/intellij+all,gradle,java,macos,windows
# Edit at https://www.toptal.com/developers/gitignore?templates=intellij+all,gradle,java,macos,windows

### Intellij+all ###
# 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/**/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/
Help.md

# 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+all Patch ###
# Ignore everything but code style settings and run configurations
# that are supposed to be shared within teams.

.idea/*

!.idea/codeStyles
!.idea/runConfigurations

### 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

### 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/intellij+all,gradle,java,macos,windows
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM mysql:latest

ADD schema.sql /docker-entrypoint-initdb.d/

EXPOSE 3306
68 changes: 68 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
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 = 'com.devcourse'
version = '0.0.1-SNAPSHOT'

java {
sourceCompatibility = '17'
}

configurations {
compileOnly {
extendsFrom annotationProcessor
}
asciidoctorExt
}

ext {
snippetsDir = file('build/generated-snippets')
}

repositories {
mavenCentral()
}

dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-validation'
compileOnly 'org.projectlombok:lombok'
runtimeOnly 'com.mysql:mysql-connector-j'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'com.github.javafaker:javafaker:1.0.2'
testImplementation 'org.springframework.restdocs:spring-restdocs-mockmvc'
asciidoctorExt 'org.springframework.restdocs:spring-restdocs-asciidoctor'
}

tasks.named('bootBuildImage') {
builder = 'paketobuildpacks/builder-jammy-base:latest'
}

tasks.named('test') {
useJUnitPlatform()
outputs.dir snippetsDir
}

asciidoctor {
inputs.dir snippetsDir
configurations 'asciidoctorExt'
sources {
include 'index.adoc'
}
dependsOn test
outputDir 'src/docs/asciidoc'
}

bootJar {
dependsOn asciidoctor
copy {
from "${asciidoctor.outputDir}"
into 'build/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
Loading