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기 김용상] SpringBoot Part3 Weekly Mission 제출합니다. #953

Open
wants to merge 110 commits into
base: yongnyeo/3
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 109 commits
Commits
Show all changes
110 commits
Select commit Hold shift + click to select a range
06dfbed
init: 프로젝트 초기 설정
YongNyeo Oct 16, 2023
d08904e
feat: 애플리케이션 시작
YongNyeo Oct 18, 2023
e0c05c6
feat: 최상단 컨트롤러 생성
YongNyeo Oct 18, 2023
6d78a88
feat: 최상단 메뉴타입 생성
YongNyeo Oct 18, 2023
07a6880
feat: 바우처 컨트롤러 생성
YongNyeo Oct 18, 2023
412ab6d
feat: 바우처 컨트롤러의 메뉴타입 생성
YongNyeo Oct 18, 2023
1c15ca8
feat: 고객 컨트롤러 생성
YongNyeo Oct 18, 2023
5f160c0
feat: 고객 컨트롤러의 메뉴타입 생성
YongNyeo Oct 18, 2023
b0f5eac
feat: 바우처 도메인 생성
YongNyeo Oct 18, 2023
6dc0f91
feat: 고객 도메인 생성
YongNyeo Oct 18, 2023
e1a09e6
feat: 바우처 서비스 생성
YongNyeo Oct 18, 2023
dcda92b
feat: 고객 서비스 생성
YongNyeo Oct 18, 2023
079cfb2
feat: 바우처 레포지토리 생성
YongNyeo Oct 18, 2023
a17ddf4
feat: 고객 레포지토리 생성
YongNyeo Oct 18, 2023
b39bfad
feat: 예외 타입 생성
YongNyeo Oct 18, 2023
2136d6f
feat: 입력값 검증기 생성
YongNyeo Oct 18, 2023
db26de7
feat: 파일 입출력 매니저 생성
YongNyeo Oct 18, 2023
8c2ae7f
feat: 콘솔 입출력 매니저 생성
YongNyeo Oct 18, 2023
38ee668
chore: 필요 resource 파일 추가
YongNyeo Oct 18, 2023
063c089
refactor: 오타 수정
YongNyeo Oct 19, 2023
23393d2
refactor: 오타 수정
YongNyeo Oct 19, 2023
f318d01
Merge branch 'main' of https://github.com/YongNyeo/springboot-basic i…
YongNyeo Oct 19, 2023
84127ec
refactor: 바우처의 percent 입력값 검증 추가
YongNyeo Oct 19, 2023
6946738
refactor: CustomerRepository 내 불필요한 필드 제거
YongNyeo Oct 20, 2023
27ee088
refactor: stream.forEach-> forEach 로 수정
YongNyeo Oct 20, 2023
978183b
refactor: scanner.nextInt() 이용
YongNyeo Oct 20, 2023
b08ab1f
refactor: private static final 변수 위치 변경
YongNyeo Oct 20, 2023
cc0e5be
refactor: Customer의 final 키워드 추가 및 불필요한 메서드 정리
YongNyeo Oct 20, 2023
e726870
refactor: Voucher의 불필요한 메서드 제거
YongNyeo Oct 20, 2023
b90360c
refactor: vouchers 필드에 final 키워드 추가
YongNyeo Oct 20, 2023
7dee6d9
refactor: validation 내 불필요한 로직 제거
YongNyeo Oct 20, 2023
e573671
feat: Voucher create dto 생성
YongNyeo Oct 20, 2023
16e2d1f
refactor: ConsoleInput이 입력받기와 값의 포맷 검증기능만 하도록 수정
YongNyeo Oct 20, 2023
c319e05
refactor: ConsoleOutput의 Bean등록과 기능추가
YongNyeo Oct 20, 2023
12e4038
refactor: InputValidation의 Bean등록과 기능 추가
YongNyeo Oct 20, 2023
d0bb019
refactor: FrontController에서 Voucher메뉴와 Customer메뉴를 모두 담당하도록 수정
YongNyeo Oct 20, 2023
b84387a
refactor: VoucherController은 입력된 메뉴에 대한 동작하도록 수정
YongNyeo Oct 20, 2023
05de375
refactor: CustomerController은 입력된 메뉴에 대한 동작하도록 수정
YongNyeo Oct 20, 2023
84d4331
refactor: VoucherService에서 dto->domain 변환과 domain에 대한 값 검증을 시도하도록 수정
YongNyeo Oct 20, 2023
a1616a9
refactor: FrontController의 메뉴 추가 및 switch-case문 도입
YongNyeo Oct 26, 2023
5bde063
refactor: CustomerController의 메서드 추가 및 메뉴Enum 추가
YongNyeo Oct 26, 2023
cc4ec30
refactor: VoucherController의 메서드 추가 및 메뉴Enum 추가
YongNyeo Oct 26, 2023
068363e
feat: WalletController에 메서드 구현 및 메뉴Enum 구현
YongNyeo Oct 26, 2023
fd74e30
refactor: 도메인 Customer내 필요 메서드 및 필드 추가
YongNyeo Oct 26, 2023
79501d0
feat: 도메인 Wallet 추가
YongNyeo Oct 26, 2023
6c56812
feat: Controller -> Service로 넘겨주기 위한 Dto 생성
YongNyeo Oct 26, 2023
f605f8f
refactor: 예외 enum 추가
YongNyeo Oct 26, 2023
36c18d2
refactor: 입출력 메서드 추가
YongNyeo Oct 26, 2023
820b58a
refactor: 입력값에 대한 검증 범위 변경 및 추가
YongNyeo Oct 26, 2023
a543944
refactor: FileManager내 blackList 메서드 수정
YongNyeo Oct 26, 2023
fdafd5d
refactor: yaml 파일에 데이터소스 추가
YongNyeo Oct 26, 2023
d4589a3
feat: SQL쿼리로 테이블 생성 및 레코드 초기 설정
YongNyeo Oct 26, 2023
39387bb
refactor: csv 파일 구조 변경
YongNyeo Oct 26, 2023
bc15d2b
test: customerService에 대한 test추가
YongNyeo Oct 26, 2023
44739fe
test: VoucherService에 대한 test 추가
YongNyeo Oct 26, 2023
7e76418
test: WalletService에 대한 test 추가
YongNyeo Oct 26, 2023
f29b7e8
test: CustomerRepository에 대한 test 추가
YongNyeo Oct 26, 2023
d4dbc10
test: VoucherRepository에 대한 test 추가
YongNyeo Oct 26, 2023
28a6d75
test: WalletRepository에 대한 test 추가
YongNyeo Oct 26, 2023
dbd3ca2
feat: 테스트시 필요한 정보 추가
YongNyeo Oct 26, 2023
a640858
chore: gradle 필요 의존성 추가
YongNyeo Oct 26, 2023
e37311d
refactor: CustomerRepository 에 필요 메서드 추가
YongNyeo Oct 26, 2023
8ffee0a
refactor: VoucherRepository 에 필요 메서드 추가
YongNyeo Oct 26, 2023
88e67a5
feat: CustomerFileRepository 추가
YongNyeo Oct 26, 2023
b3152da
feat: JdbcCustomerRepository 추가
YongNyeo Oct 26, 2023
6dcac91
feat: JdbcCustomerRepository에서 사용하는 쿼리 모음 추가
YongNyeo Oct 26, 2023
dec0572
refactor: FileVoucherRepository 내 필요한 메서드 추가
YongNyeo Oct 26, 2023
b69d9cc
refactor: MemoryVoucherRepository 내 필요한 메서드 추가
YongNyeo Oct 26, 2023
1064947
feat: JdbcVoucherRepository 추가
YongNyeo Oct 26, 2023
8fa620b
feat: JdbcVoucherRepository에서 필요한 쿼리 모음 추가
YongNyeo Oct 26, 2023
a56c7d3
feat: WalletRepository인터페이스 추가
YongNyeo Oct 26, 2023
2eaf829
feat: JdbcWalletRepository 추가
YongNyeo Oct 26, 2023
32b0e0b
feat: JdbcWalletRepository에서 필요한 쿼리 모음 추가
YongNyeo Oct 26, 2023
a3e8bc8
refactor: CustomerService 내 필요 메서드 추가
YongNyeo Oct 26, 2023
b06bdb4
refactor: VoucherService가 내 필요 메서드 추가
YongNyeo Oct 26, 2023
66ac985
feat: WalletService 추가
YongNyeo Oct 26, 2023
1ef917c
refactor: test시 필요한 파일 경로 추가
YongNyeo Oct 26, 2023
00d8393
refactor: 람다식 -> 메서드 참조로 수정
YongNyeo Oct 27, 2023
e7120e4
refactor: LoggerFactory -> @Slf4j 로 모두 변경
YongNyeo Oct 27, 2023
9d45a8a
refactor: FrontController내 불필요한 코드 제거
YongNyeo Oct 27, 2023
6fe2b03
refactor: Wallet 의 필드를 카멜케이스로 수정
YongNyeo Oct 27, 2023
b7827fa
refactor: final 추가
YongNyeo Oct 27, 2023
7e8202f
refactor: KeyHolder 추가 및 불필요한 쿼리 삭제
YongNyeo Oct 27, 2023
6a8a1af
refactor: 불필요한 코드 제거
YongNyeo Oct 28, 2023
1245702
refactor: Optional의 of를 ofNullable로 변경
YongNyeo Oct 28, 2023
4bcd1e0
refactor: 읽기전용 @Transactional(readOnly=true) 추가
YongNyeo Oct 28, 2023
ac011cf
refactor: voucher Percent 검증 위치 변경
YongNyeo Oct 28, 2023
5f60899
refactor: 레이어별 역할 변경으로 인한 테스트 코드 수정
YongNyeo Oct 28, 2023
0e31b6e
refactor: scanner 생성자 할당->필드 할당으로 변경
YongNyeo Oct 28, 2023
0431553
refactor: console 입출력 부분 공통로직으로 리팩토링
YongNyeo Oct 28, 2023
76b98b9
refactor: menu 타입 검증을 컨트롤러에서 enumType으로 위임
YongNyeo Oct 28, 2023
f6e9459
refactor: 적절한 상태검증과 행위검증 변경 및 DisplayName 수정
YongNyeo Oct 28, 2023
0d393fc
refactor: schema 필드 속성 변경
YongNyeo Oct 28, 2023
cc9bc7d
refactor: 불필요한 코드 제거 및 예외상황 추가
YongNyeo Oct 28, 2023
a24a411
refactor: 바우처 값 검증 위치 변경
YongNyeo Oct 28, 2023
3fa46ed
refactor: 3항 연산자 변경
YongNyeo Oct 31, 2023
e9f7ebf
refactor: voucher 내 created_at 생성
YongNyeo Nov 2, 2023
b45172c
refactor: voucherRepository 내 메서드 추가
YongNyeo Nov 2, 2023
1c7250d
refactor: WalletRepository 내 필요 메서드 추가
YongNyeo Nov 2, 2023
c4815ba
refactor: service 레이어에 필요 메서드 추가
YongNyeo Nov 2, 2023
a9355d4
refactor: 파일 내 created_at 시간 추가
YongNyeo Nov 2, 2023
a73ba65
feat: WebVoucherController, ApiVoucherController 구현
YongNyeo Nov 2, 2023
a237e1e
feat: WebWalletController 구현
YongNyeo Nov 2, 2023
7d59d19
refactor: profile 수정
YongNyeo Nov 2, 2023
0b8fa34
refactor: schema 변경
YongNyeo Nov 2, 2023
bdd9a92
refactor: created_at 추가로 인한 테스트코드 변경
YongNyeo Nov 2, 2023
bd67111
feat: api controller 테스트 추가(변경중)
YongNyeo Nov 2, 2023
fc92cb5
feat: gradle 의존성 추가
YongNyeo Nov 2, 2023
7e1dad1
feat: 예외 처리 추가
YongNyeo Nov 2, 2023
1d2ce07
feat: templates 파일 추가
YongNyeo Nov 5, 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
37 changes: 37 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
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/
36 changes: 36 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
plugins {
id 'java'
id 'org.springframework.boot' version '3.1.4'
id 'io.spring.dependency-management' version '1.1.3'
}

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

java {
sourceCompatibility = '17'
}

repositories {
mavenCentral()
}

dependencies {
implementation 'org.springframework.boot:spring-boot-starter'
implementation 'org.springframework.boot:spring-boot-starter-jdbc'
implementation 'org.projectlombok:lombok:1.18.22'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.mockito:mockito-core:4.8.0'

annotationProcessor 'org.projectlombok:lombok'

implementation 'com.mysql:mysql-connector-j:8.1.0'


}

tasks.named('test') {
useJUnitPlatform()
}
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.3-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
249 changes: 249 additions & 0 deletions gradlew
Original file line number Diff line number Diff line change
@@ -0,0 +1,249 @@
#!/bin/sh

#
# Copyright © 2015-2021 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

##############################################################################
#
# Gradle start up script for POSIX generated by Gradle.
#
# Important for running:
#
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
# noncompliant, but you have some other compliant shell such as ksh or
# bash, then to run this script, type that shell name before the whole
# command line, like:
#
# ksh Gradle
#
# Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features:
# * functions;
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
#
# Important for patching:
#
# (2) This script targets any POSIX shell, so it avoids extensions provided
# by Bash, Ksh, etc; in particular arrays are avoided.
#
# The "traditional" practice of packing multiple parameters into a
# space-separated string is a well documented source of bugs and security
# problems, so this is (mostly) avoided, by progressively accumulating
# options in "$@", and eventually passing that to Java.
#
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
# see the in-line comments for details.
#
# There are tweaks for specific operating systems such as AIX, CygWin,
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
#
##############################################################################

# Attempt to set APP_HOME

# Resolve links: $0 may be a link
app_path=$0

# Need this for daisy-chained symlinks.
while
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
[ -h "$app_path" ]
do
ls=$( ls -ld "$app_path" )
link=${ls#*' -> '}
case $link in #(
/*) app_path=$link ;; #(
*) app_path=$APP_HOME$link ;;
esac
done

# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum

warn () {
echo "$*"
} >&2

die () {
echo
echo "$*"
echo
exit 1
} >&2

# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "$( uname )" in #(
CYGWIN* ) cygwin=true ;; #(
Darwin* ) darwin=true ;; #(
MSYS* | MINGW* ) msys=true ;; #(
NONSTOP* ) nonstop=true ;;
esac

CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar


# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD=$JAVA_HOME/jre/sh/java
else
JAVACMD=$JAVA_HOME/bin/java
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME

Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD=java
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.

Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi

# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
fi

# Collect all arguments for the java command, stacking in reverse order:
# * args from the command line
# * the main class name
# * -classpath
# * -D...appname settings
# * --module-path (only if needed)
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.

# For Cygwin or MSYS, switch paths to Windows format before running java
if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )

JAVACMD=$( cygpath --unix "$JAVACMD" )

# Now convert the arguments - kludge to limit ourselves to /bin/sh
for arg do
if
case $arg in #(
-*) false ;; # don't mess with options #(
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
[ -e "$t" ] ;; #(
*) false ;;
esac
then
arg=$( cygpath --path --ignore --mixed "$arg" )
fi
# Roll the args list around exactly as many times as the number of
# args, so each arg winds up back in the position where it started, but
# possibly modified.
#
# NB: a `for` loop captures its iteration list before it begins, so
# changing the positional parameters here affects neither the number of
# iterations, nor the values presented in `arg`.
shift # remove old arg
set -- "$@" "$arg" # push replacement arg
done
fi


# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.

set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
"$@"

# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi

# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
#
# In Bash we could simply go:
#
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
# set -- "${ARGS[@]}" "$@"
#
# but POSIX shell has neither arrays nor command substitution, so instead we
# post-process each arg (as a line of input to sed) to backslash-escape any
# character that might be a shell metacharacter, then use eval to reverse
# that process (while maintaining the separation between arguments), and wrap
# the whole thing up as a single "set" statement.
#
# This will of course break if any of these variables contains a newline or
# an unmatched quote.
#

eval "set -- $(
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
xargs -n1 |
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
tr '\n' ' '
)" '"$@"'

exec "$JAVACMD" "$@"