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

[Team21] BE - Bibi, yeon : API와 OAuth 구현 #74

Open
wants to merge 92 commits into
base: team21
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
5878de8
Update README.md
bibi6666667 May 17, 2021
25d81c4
add : 프로젝트 셋팅 #2
bibi6666667 May 18, 2021
4abbdb9
add : 도메인 객체 만들기 #3
bibi6666667 May 20, 2021
bb89a67
add : ERD 참고해 도메인 객체 만들기 #3
bibi6666667 May 20, 2021
957e138
add : Builder클래스 생성 #3
bibi6666667 May 20, 2021
5885f62
add : DB 테이블 생성 #5
bibi6666667 May 20, 2021
f4759aa
add : schema.sql 생성 #5
bibi6666667 May 20, 2021
727b147
add : data.sql 생성 #5
bibi6666667 May 20, 2021
0632a43
add : db 연결 테스트 #5
bibi6666667 May 20, 2021
a77f435
add : Room 관련 API 생성 #7
bibi6666667 May 21, 2021
7db7388
refactor : Badges->Badge #7
bibi6666667 May 21, 2021
b308635
add : 설정 사항 변경 #7
bibi6666667 May 21, 2021
b2466f0
refactor : 일부 table 이름 수정 #7
bibi6666667 May 21, 2021
da22cee
add : code with me - yeon이 변경하신 사항들 #7
bibi6666667 May 21, 2021
733b694
add : booking DB에 insert 하는 기능 구현 #14
kimnayeon0108 May 24, 2021
fa73b83
add : check_in과 check_out 타입 Date에서 String으로 변경
bibi6666667 May 25, 2021
c8a0064
add : toString 메소드 오버라이딩
bibi6666667 May 25, 2021
93341b9
add : 검색 조건에 맞는 room 반환하는
bibi6666667 May 25, 2021
1e8065c
test : getRoomsByDateAndPriceAndNumberOfPeople 메소드에 대한 테스트
bibi6666667 May 25, 2021
c45b586
refactor : check_in 과 check_out 자료형 변경에 따른 코드 수정
bibi6666667 May 25, 2021
170c729
add : 숙소 조회 기능 구현 중 #7
bibi6666667 May 26, 2021
c01c9a1
add : add getter of type
kimnayeon0108 May 26, 2021
e292814
add : add getter of fields
kimnayeon0108 May 26, 2021
d65b513
add : fix type of list, Room to RoomDTO
kimnayeon0108 May 26, 2021
45b31ac
add : add RoomDTO for Response
kimnayeon0108 May 26, 2021
b9dec3a
remove : remove useless abstract method
kimnayeon0108 May 26, 2021
70a5304
add : fix option type, List to Optional and add getter
kimnayeon0108 May 26, 2021
0641881
add : add getter of field
kimnayeon0108 May 26, 2021
5dff443
add : fix Option type, List to Optional and remove useless logic
kimnayeon0108 May 26, 2021
087ec8e
add : add finding objects of other tables and RowMapper
kimnayeon0108 May 26, 2021
df033a0
add : add showing filtered rooms by searching conditions
kimnayeon0108 May 26, 2021
5659ad0
refactor : fix arguments to change searching requirement
kimnayeon0108 May 26, 2021
fdf63d3
add : combine adult, child, baby as numberOfPeople and add constructor
kimnayeon0108 May 26, 2021
c907c96
add : add BookingRequest as request DTO
kimnayeon0108 May 26, 2021
6bb7669
refactor : fix sql statement and method according to changed properties
kimnayeon0108 May 26, 2021
33e7108
add : fix properties of booking table
kimnayeon0108 May 26, 2021
e42c715
add : fix dummy data
kimnayeon0108 May 26, 2021
cf4631e
add : fix arguments according to changed fields of Booking
kimnayeon0108 May 26, 2021
3bcd280
add : add method
kimnayeon0108 May 27, 2021
99ac0ef
refactor : 불필요한 주석 삭제 #7
bibi6666667 May 27, 2021
c08360f
add : 숙소 예약 기능 구현 완료 #14
bibi6666667 May 27, 2021
756dea4
add : 숙소 예약이 불가할 때 처리할 예외 생성 #14
bibi6666667 May 27, 2021
9fd86a1
add : 숙소 예약 테스트를 위한 데이터 추가 #14
bibi6666667 May 27, 2021
c8aefec
add : Wish 기능 구현 시작 #22
bibi6666667 May 27, 2021
7d06234
add : check_in, check_out 자료형 변경#14
bibi6666667 May 28, 2021
21631b2
add : 테스트용 더미데이터 추가 #14
bibi6666667 May 28, 2021
e2d1185
add : checkIn, checkOut 자료형 변경 #14
bibi6666667 May 28, 2021
88e02c8
add : 숙소 예약 - 날짜 중복확인 기능 구현 #14
bibi6666667 May 28, 2021
a8cfd70
add : 숙소 예약 - 날짜 중복확인 기능 구현 #14
bibi6666667 May 28, 2021
b1a409d
add : 숙소 더미데이터 추가
bibi6666667 May 28, 2021
87ca702
add : room데이터에 필요한 option, thumbnails 데이터 삽입 #29
bibi6666667 May 29, 2021
760aa18
refactor : 불필요한 주석 제거 #22
bibi6666667 May 31, 2021
44b945a
add : 위시리스트 추가 기능 구현(중복확인) #22
bibi6666667 May 31, 2021
0345484
add : 위시리스트 추가 기능 구현(중복확인) by Yeon #22
bibi6666667 May 31, 2021
1107466
add : 위시리스트 중복확인 시 발생시킬 예외 추가 #22
bibi6666667 May 31, 2021
3a83262
add : 위시리스트 삭제 기능 구현 #22
bibi6666667 May 31, 2021
a85dc0f
add : 없는 위시리스트 삭제 요청시 발생할 예외 추가 by Yeon #22
bibi6666667 May 31, 2021
ce78416
add : 없는 위시리스트 삭제 요청시 발생할 예외 추가 #22
bibi6666667 May 31, 2021
d3635af
add : 숙소 예약 취소 기능 구현 #14
bibi6666667 May 31, 2021
8c317ce
add : 숙소 예약 취소 기능 구현 by Yeon #14
bibi6666667 May 31, 2021
e35c3d3
add : 존재하지 않는 예약 취소 시 발생할 예외 추가 #14
bibi6666667 May 31, 2021
c2c6a79
refactor : 상위 예외인 NotFoundException 생성 #14
bibi6666667 May 31, 2021
c2cd56d
refactor : 사용자 아이디를 OAuth를 연결할 `google_id`로 변경 #31
bibi6666667 May 31, 2021
15de5df
refactor : RoomController 로직을 RoomService로 분리 #32
bibi6666667 May 31, 2021
9a0d81f
add : 상위 예외인 NotFoundException 생성
bibi6666667 May 31, 2021
bd1b0c4
add : BookingController의 로직 분리를 위한 BookingService 생성 #33
bibi6666667 May 31, 2021
a5462be
refactor : RoomController의 로직을 RoomService로 분리 #32
bibi6666667 May 31, 2021
980d029
chore : 코드 줄맞춤
bibi6666667 May 31, 2021
1bcc8e3
fix : filtering된 room 반환 기능 버그 수정
kimnayeon0108 May 31, 2021
43d276a
chore : 필요없는 import문 제거
kimnayeon0108 May 31, 2021
8ecf39d
add : 구글 OAuth 액세스토큰 받아오기 #31
bibi6666667 Jun 1, 2021
24f4980
add : 구글 OAuth 액세스토큰 받아오기 by Yeon #31
bibi6666667 Jun 1, 2021
ad90837
add : 구글 OAuth 액세스토큰으로 User 이름 받아오기 #31
bibi6666667 Jun 1, 2021
32f13c8
add : 구글 OAuth 액세스토큰으로 User 이름 받아오기 by Yeon #31
bibi6666667 Jun 1, 2021
7f8d78f
add : 액세스토큰으로 받아온 사용자 정보 저장하기 #31
bibi6666667 Jun 1, 2021
c2f7cb3
add : 액세스토큰으로 받아온 사용자 정보 저장하기 by Yeon #31
bibi6666667 Jun 1, 2021
c576c31
chore : update .gitignore
bibi6666667 Jun 2, 2021
ba2305f
add : CORS 해결을 위한 @CrossOrigin 추가
bibi6666667 Jun 2, 2021
545be97
add : 로그인 기능 구현 - 중복 회원 확인
bibi6666667 Jun 2, 2021
2cd2ccc
add : logger 사용을 위해 User에 toString 추가
bibi6666667 Jun 2, 2021
d7a3b93
add : BookingController의 로직을 BookingService로 분리 #39
bibi6666667 Jun 3, 2021
e2dd2db
add : BookingController의 로직을 BookingService로 분리 #39
bibi6666667 Jun 3, 2021
edd527e
chore : 불필요한 구문 삭제 #39
bibi6666667 Jun 3, 2021
6aedea0
refactor : UserService의 OAuth관련 로직을 OAuthService로 분리 #39
bibi6666667 Jun 3, 2021
a75b4e2
refactor : UserService의 OAuth관련 로직을 OAuthService로 분리 by Yeon #39
bibi6666667 Jun 3, 2021
e942dbc
refactor : RoomDTO -> RoomResponse로 이름 변경 #39
bibi6666667 Jun 3, 2021
65a48b3
refactor : 불필요한 인터페이스 삭제 #39
bibi6666667 Jun 3, 2021
bfa60f3
refactor : 메서드명을 적절하게 수정 #39
bibi6666667 Jun 3, 2021
d17f1e2
refactor : OAuth관련 클래스를 oauth패키지로 이동 #39
bibi6666667 Jun 3, 2021
4014fd2
refactor : 불필요한 인터페이스 제거 by Yeon #39
bibi6666667 Jun 3, 2021
b908a91
chore : 코드 줄맞춤 by Yeon #39
bibi6666667 Jun 3, 2021
8f42ec3
chore : 코드 줄맞춤, 불필요한 주석 제거
bibi6666667 Jun 3, 2021
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
38 changes: 38 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
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/
/build.sh
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@
# airbnb
그룹 프로젝트 #4
Codesquad Masters 2021 - 그룹 프로젝트 #4

---

## Team 21 members

💁‍♀️ Bibi yeon
💁‍♂️ ppamppam Rano

26 changes: 26 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
plugins {
id 'org.springframework.boot' version '2.4.5'
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
id 'java'
}

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

repositories {
mavenCentral()
}

dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-jdbc'
implementation 'org.springframework.boot:spring-boot-starter-jdbc'
implementation 'org.springframework.boot:spring-boot-starter-web'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
runtimeOnly 'mysql:mysql-connector-java'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
}

test {
useJUnitPlatform()
}
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
5 changes: 5 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
185 changes: 185 additions & 0 deletions gradlew
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
#!/usr/bin/env sh

#
# Copyright 2015 the original author or 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 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" "-Xms64m"'

# 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 or MSYS, switch paths to Windows format before running java
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; 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=`expr $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"

exec "$JAVACMD" "$@"
89 changes: 89 additions & 0 deletions gradlew.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem

@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 Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi

@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" "-Xms64m"

@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 execute

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 execute

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

: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 %*

: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 = 'airbnb'
13 changes: 13 additions & 0 deletions src/main/java/com/codesquad/airbnb/AirbnbApplication.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.codesquad.airbnb;

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

@SpringBootApplication
public class AirbnbApplication {

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

}
Loading