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

[Zzazan] 1주차 zzazanstagram 기능 구현 #4

Merged
merged 73 commits into from
Aug 19, 2019
Merged
Show file tree
Hide file tree
Changes from 70 commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
20c71a5
init: project 생성
wbluke Aug 12, 2019
b535e2e
init: 프론트 뷰 파일 초기 세팅
wbluke Aug 12, 2019
572737a
[#18] feat: 공통 패키지 및 엔티티 정의
JunHoPark93 Aug 13, 2019
3b6501d
Merge pull request #19 from wbluke/feature/18-common-package-setting
wbluke Aug 13, 2019
bf13e9d
[#15] feat: 게시글 모델 생성
dasistHYOJIN Aug 13, 2019
1add6ef
[#7] feat: Member 엔티티 정의
starkim06 Aug 13, 2019
8ae5520
[#20] refactor: index.html의 눈 모양 아이콘을 게시글 작성 아이콘으로 변경
wbluke Aug 13, 2019
c42bb06
[#20] feat: article을 작성하는 기본적인 페이지 작성
wbluke Aug 13, 2019
95b8923
[#20] feat: article-edit.html의 자바스크립트 틀 작성
wbluke Aug 13, 2019
ba1f455
Merge pull request #21 from wbluke/feature/14-article-frontend
wbluke Aug 13, 2019
d975be9
[#8] feat: 회원가입 기능
starkim06 Aug 13, 2019
6ba9b74
Merge pull request #23 from wbluke/feature/6-member-setting
wbluke Aug 13, 2019
22c876d
[#15] feat: 게시글 작성 기능 구현
dasistHYOJIN Aug 13, 2019
8e9a725
Merge branch 'develop' into feature/14-article-create
dasistHYOJIN Aug 13, 2019
e3a06c8
Merge pull request #25 from wbluke/feature/14-article-create
wbluke Aug 13, 2019
6fbb985
[#22] refactor: 사용하지 않는 js console.log 삭제
wbluke Aug 14, 2019
f6cef7a
[#26] refactor: 8월 13일 리뷰에 따른 리팩토링 적용
starkim06 Aug 14, 2019
5f2ff75
Merge pull request #27 from wbluke/refactor/26-review
JunHoPark93 Aug 14, 2019
797d89e
[#22] feat: zzazanstagram logo navBar에 추가 및 다른 페이지에도 적용
wbluke Aug 14, 2019
a9bca9c
[#29] refactor: 8월 13일 게시글 관련 리뷰에 따른 리팩토링 적용
dasistHYOJIN Aug 14, 2019
a53f71c
[#30] feat: 게시글 작성 페이지와 서버 시스템 연결
dasistHYOJIN Aug 14, 2019
9cf46ae
[#10] feat: 로그인 기능
starkim06 Aug 14, 2019
f4ea6a1
[#15] feat: 게시글 조회 기능 구현
dasistHYOJIN Aug 14, 2019
e6a75cb
[#31] feat: 게시글 조회 페이지와 서버 시스템 연결
dasistHYOJIN Aug 14, 2019
6986556
[#10] refactor: 테스트 중복 제거
starkim06 Aug 14, 2019
bcff14b
[#22] feat: signup 페이지 뷰 작성
wbluke Aug 14, 2019
195db22
Merge branch 'develop' into feature/14-article-show
dasistHYOJIN Aug 14, 2019
3eb2336
Merge pull request #35 from wbluke/feature/14-article-show
wbluke Aug 14, 2019
3d88698
Merge branch 'develop' into feature/6-signup-frontend
wbluke Aug 14, 2019
ffb423d
Merge pull request #33 from wbluke/feature/6-signup-frontend
wbluke Aug 14, 2019
1d1b7d6
Merge branch 'develop' into feature/10-user-login
JunHoPark93 Aug 14, 2019
5f3bbaf
Merge pull request #37 from wbluke/feature/10-user-login
wbluke Aug 14, 2019
30fe6e1
[#39] refactor: 8/14 리팩토링
JunHoPark93 Aug 14, 2019
4c90378
[#39] refactor: 8/14 리팩토링
JunHoPark93 Aug 14, 2019
1a2899a
Merge pull request #40 from wbluke/refactor/39-review
JunHoPark93 Aug 14, 2019
8e9bc8a
[#41] 회원가입 form의 placeholder 한글로 변경 및 정규식 pattern 추가
wbluke Aug 14, 2019
c01abd7
[#41] 회원가입 페이지의 배치 정밀 수정
wbluke Aug 14, 2019
032f8ad
[#41] feat: validate error 메시지 tooltip으로 추가
wbluke Aug 14, 2019
863a2bc
Merge pull request #42 from wbluke/feature/6-signup-frontend-refactor
wbluke Aug 14, 2019
b548d5a
[#24] feat: login.html 페이지 뷰 작성
wbluke Aug 14, 2019
f48418a
Merge pull request #43 from wbluke/feature/6-login-frontend
wbluke Aug 14, 2019
ec25241
[#44] refactor: domain entity에 column 어노테이션 추가
wbluke Aug 15, 2019
a39ec2f
[#44] refactor: 예외 관련 테스트 케이스 추가 및 관련 프로덕션 로직 추가
wbluke Aug 15, 2019
b8b8883
[#44] refactor: LoginController, LoginService를 Member관련 클래스에서 분리
wbluke Aug 15, 2019
07f7f4b
[#44] refactor: Article entity에 Member entity 연관관계 매핑 추가
wbluke Aug 15, 2019
1a09c8a
[#44] refactor: 프론트엔드 로직과 백엔드 로직 연동
wbluke Aug 15, 2019
7bb7820
[#44] refactor: Member package 구조 변경
wbluke Aug 15, 2019
9bd7cc0
Merge pull request #45 from wbluke/feature/6-review-refactor-#44
wbluke Aug 15, 2019
c8d52f8
[#44] refactor: MemberTest에 assertThat import
wbluke Aug 15, 2019
cd2afba
Merge pull request #46 from wbluke/feature/6-review-refactor-#44-fix
wbluke Aug 15, 2019
9f5aeaf
Merge pull request #47 from wbluke/develop
wbluke Aug 15, 2019
540a640
[#50] fix: 사용하지 않는 코드 제거 및 의도하지 않은 오타 등의 코드로직 수정
wbluke Aug 16, 2019
307fe79
[#50] refactor: html 태그에 각각 적용된 style 속성을 별도의 css 파일로 분리:zzazan.css
wbluke Aug 16, 2019
d8d4192
Merge pull request #51 from wbluke/feature/14-review-refactor-fronten…
wbluke Aug 17, 2019
c2ee81e
[#52] refactor: 8/15 피드백 반영
JunHoPark93 Aug 17, 2019
45e6b63
[#52] refactor: 8/15 피드백 반영
JunHoPark93 Aug 17, 2019
5caaace
[#55] refactor: 8/15 게시글 피드백 반영
dasistHYOJIN Aug 17, 2019
cb34def
Merge pull request #56 from wbluke/refactor/55-pr-review
wbluke Aug 17, 2019
183d58e
Merge branch 'develop' into refactor/52-pr-review
dasistHYOJIN Aug 17, 2019
e61f25f
Merge pull request #53 from wbluke/refactor/52-pr-review
dasistHYOJIN Aug 17, 2019
cd492bb
[#57] refactor: 유틸 클래스(SessionKeys) 생성자 private 으로 선언
starkim06 Aug 17, 2019
28e8bfb
[#57] feat: test 용 의존성 추가
starkim06 Aug 17, 2019
ecaf16d
[#57] refactor: Image 클래스에서 Http요청을 통해서 이미지 URL확인로직 제거
starkim06 Aug 17, 2019
10d1acd
[#57] refactor: RequestMapping을 활용하여 중복 Url제거
starkim06 Aug 17, 2019
21ce84b
[#57] refactor: validate 메서드 명 수정
starkim06 Aug 17, 2019
96499af
[#57] refactor: Email, NickName에 대해서 각각 요청하던 쿼리를 합침
starkim06 Aug 17, 2019
9ea9d2c
[#57] refactor: 메서드명 동사로 수정
starkim06 Aug 17, 2019
6619430
[#57] refactor: SessionKeys를 web package로 이동
wbluke Aug 17, 2019
243a54e
Merge pull request #58 from wbluke/refactor/57-review
wbluke Aug 17, 2019
276e3a8
Merge pull request #59 from wbluke/develop
wbluke Aug 17, 2019
297f7d6
[#60] refactor: gradle test 추가
JunHoPark93 Aug 17, 2019
13bf0ce
Merge pull request #61 from wbluke/refactor/60-gradle-test
wbluke Aug 17, 2019
9fef616
Merge pull request #62 from wbluke/develop
wbluke Aug 17, 2019
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
29 changes: 29 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/**/.DS_Store
HELP.md
.gradle
build/
!gradle/wrapper/gradle-wrapper.jar
!**/src/main/**
!**/src/test/**
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
out/
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
### VS Code ###
.vscode/
42 changes: 42 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
plugins {
id 'org.springframework.boot' version '2.1.7.RELEASE'
id 'java'
}

apply plugin: 'io.spring.dependency-management'

group = 'com.woowacourse'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '1.8'

configurations {
developmentOnly
runtimeClasspath {
extendsFrom developmentOnly
}
}

repositories {
mavenCentral()
}

dependencies {
Copy link

@woowahanCU woowahanCU Aug 17, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gradlew 로 build 실행시에는 테스트를 skip하고 있어요.
아래 설정 추가한 이후에 배포해보시겠어요?

test {
    useJUnitPlatform()
}
...
dependencies {
...
    testImplementation 'org.junit.jupiter:junit-jupiter-api:5.3.1'
    testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.3.1'

https://www.baeldung.com/junit-5-gradle

implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.mindrot:jbcrypt:0.3m'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
runtimeOnly 'com.h2database:h2'
runtimeOnly 'mysql:mysql-connector-java'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.junit.jupiter:junit-jupiter-api'
testImplementation('org.springframework.boot:spring-boot-starter-test') {
exclude group: 'junit'
}
testImplementation 'org.springframework.boot:spring-boot-starter-webflux'
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.4.2'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.3.1'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.3.1'
}


Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
6 changes: 6 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#Tue Aug 13 12:28:23 KST 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
172 changes: 172 additions & 0 deletions gradlew
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
#!/usr/bin/env sh

##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################

# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null

APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`

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

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

warn () {
echo "$*"
}

die () {
echo
echo "$*"
echo
exit 1
}

# 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
;;
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"
which java >/dev/null 2>&1 || 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

# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi

# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi

# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`

# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option

if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi

# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=$(save "$@")

# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"

# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi

exec "$JAVACMD" "$@"
84 changes: 84 additions & 0 deletions gradlew.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################

@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m"

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto init

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:init
@rem Get command-line arguments, handling Windows variants

if not "%OS%" == "Windows_NT" goto win9xME_args

:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2

:win9xME_args_slurp
if "x%~1" == "x" goto execute

set CMD_LINE_ARGS=%*

:execute
@rem Setup the command line

set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar

@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%

:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd

:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1

:mainEnd
if "%OS%"=="Windows_NT" endlocal

:omega
1 change: 1 addition & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rootProject.name = 'zzazanstagram'
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.woowacourse.zzazanstagram;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class ZzazanstagramApplication {

public static void main(String[] args) {
SpringApplication.run(ZzazanstagramApplication.class, args);
}

}
31 changes: 31 additions & 0 deletions src/main/java/com/woowacourse/zzazanstagram/config/WebConfig.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package com.woowacourse.zzazanstagram.config;

import com.woowacourse.zzazanstagram.web.interceptor.LoginInterceptor;
import com.woowacourse.zzazanstagram.web.resolver.SessionArgumentResolver;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import java.util.Arrays;
import java.util.List;

@Configuration
@EnableJpaAuditing
public class WebConfig implements WebMvcConfigurer {

private final List<String> excludePatterns = Arrays.asList("/signup", "/members", "/login", "/css/**", "/images/**");

@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(new LoginInterceptor())
.addPathPatterns("/**")
.excludePathPatterns(excludePatterns);
}

@Override
public void addArgumentResolvers(List<HandlerMethodArgumentResolver> resolvers) {
resolvers.add(new SessionArgumentResolver());
}
}
Loading