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

[BE] [팀-18 / Kyu] 리뷰 요청 #51

Open
wants to merge 81 commits into
base: team18
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 69 commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
57f3911
Update README.md
kyupid Apr 19, 2021
97d1844
chore : 기본 설정
kyupid Apr 19, 2021
f7377ec
add : 엔티티 Banchan, Category 추가
kyupid Apr 19, 2021
fb62ccb
add : Entity User 추가
kyupid Apr 19, 2021
d3dc14b
Merge pull request #15 from kyu-kim-kr/add/entity
kyupid Apr 19, 2021
8c62da3
delete : 클래스 User 삭제
kyupid Apr 19, 2021
5cc5704
fix : 클래스 Banchan 수정
kyupid Apr 19, 2021
c036d5b
add : Repo 생성
kyupid Apr 19, 2021
794131a
Merge pull request #16 from kyu-kim-kr/add/repo
kyupid Apr 19, 2021
7934422
chore : spring-data-jdbc 추가
kyupid Apr 19, 2021
cd6efd9
refactor : Banchan의 DeliveryType과 Badge를 객체로 받는
kyupid Apr 20, 2021
e3247f9
add : detail_hash에 값으로 반찬 찾기
kyupid Apr 20, 2021
1e367d5
fix: Category 수정
kyupid Apr 20, 2021
4cf5b7d
add : 기본적인 서비스, 컨트롤러
kyupid Apr 20, 2021
328ad5b
test : 기본 테스트코드 추가
kyupid Apr 20, 2021
0f45318
Merge pull request #22 from kyu-kim-kr/add/service
kyupid Apr 20, 2021
5f188a2
chore : 디비 비번 생성
kyupid Apr 20, 2021
d48ca5f
delete : 클래스 Badge, DeliveryType 삭제
kyupid Apr 20, 2021
5bb829c
fix : delivery_type & badge 타입 String으로 변경
kyupid Apr 20, 2021
c81ab8f
add : BanchanDto 생성
kyupid Apr 20, 2021
d40364e
fix : Controller, Service에서 Entity가 아니라 DTO를 불러오도록 수정
kyupid Apr 20, 2021
c9949d1
fix : BanchanDetail directory
kyupid Apr 20, 2021
31d5520
Merge pull request #26 from kyu-kim-kr/feat/jsonarray
kyupid Apr 20, 2021
cfc49fd
set : Null값이면 JSON 데이터에서 제외하도록 어노테이션 설정
kyupid Apr 21, 2021
ef29e09
feat : String을 배열로 변환해줄때 String이 Null이면 Null로 반환
kyupid Apr 21, 2021
d91be65
add : 필드 tag, BanchanDetail 추가
kyupid Apr 21, 2021
d953f3e
add : BanchanDetail, BanchanDetailDto
kyupid Apr 21, 2021
4a3a18f
feat : 반찬 detail 가져오는 api 구현
kyupid Apr 21, 2021
47edb0f
fix : 필드명 변경
kyupid Apr 22, 2021
853c8a9
feat : 상세페이지 API
kyupid Apr 22, 2021
51307e4
add : 테스트용 toString()
kyupid Apr 22, 2021
a4449d4
add : Reponse시 Null처리 어노테이션
kyupid Apr 22, 2021
d69ee68
fix : String[]을 Set<String>으로 변경
kyupid Apr 22, 2021
c50871a
feat : DataDto 를 추가해서 필드들 배열로 받을 수 있도록
kyupid Apr 22, 2021
cedac8c
refactor : String 에서 Set으로 바꾸는 메서드 중복 코드 줄이기 위해 통합
kyupid Apr 22, 2021
2c6ffd4
rename : 클래스 Data를 명확하게 표현
kyupid Apr 22, 2021
8ca45db
Merge pull request #32 from kyu-kim-kr/feat/detailpage
kyupid Apr 22, 2021
cd5545c
remove : 필요없는 생성자 삭제
kyupid Apr 22, 2021
bce16cc
add : 개별 메인 반찬 이외에 다른 개별 반찬 API
kyupid Apr 22, 2021
c2ae692
add : Banchan에 category_id 필드 추가
kyupid Apr 22, 2021
a5a7b56
add : CategoryDto 추가
kyupid Apr 22, 2021
a4719d5
feat : 카테고리에 따른 반찬들 API
kyupid Apr 22, 2021
43556f5
rename : method
kyupid Apr 23, 2021
cb2b1b8
Merge pull request #36 from kyu-kim-kr/feat/category
kyupid Apr 23, 2021
da543ae
feat : 베스트반찬들 API 구현 Http상태와 카테고리에 따른 리스트들을 응답
kyupid Apr 23, 2021
1dcc49a
rename : method and variable
kyupid Apr 24, 2021
f2003b1
delete : 불필요한 명시
kyupid Apr 24, 2021
426f6ad
rename : typo
kyupid Apr 24, 2021
3130bbf
Merge pull request #40 from kyu-kim-kr/feat/non-category
kyupid Apr 26, 2021
39b0af5
add : 반찬 상세정보 컬럼 추가
kyupid Apr 26, 2021
14eb6d8
delete : detail_section 삭제
kyupid Apr 26, 2021
ea53b25
rename : Message
kyupid Apr 26, 2021
a9f97ec
add : Tag에 따른 반찬들 부르는 API
kyupid Apr 26, 2021
e135ff3
Merge pull request #44 from kyu-kim-kr/feat/taggedbanchan
kyupid Apr 26, 2021
3f268a7
fix : 데이터 구분법 변경
kyupid Apr 26, 2021
96c92e0
Merge pull request #45 from kyu-kim-kr/fix/splitdata
kyupid Apr 26, 2021
9a62860
fix : BanchanDetail 내에 hash를 detail_hash로 변경
kyupid Apr 26, 2021
837bab1
feat : Order 추가
kyupid Apr 27, 2021
5ffe10b
Merge pull request #48 from kyu-kim-kr/feat/order
kyupid Apr 27, 2021
124062a
add : get 추가
kyupid Apr 27, 2021
fce0f5b
Merge pull request #50 from kyu-kim-kr/feat/order
kyupid Apr 27, 2021
1ce5fc0
chore : spring-security & spring-oauth2.0 추가
kyupid Apr 27, 2021
52fbcf8
add : Oauth 설정 추가
kyupid Apr 27, 2021
2954b19
chore : Github Oauth 연동 설정
kyupid Apr 27, 2021
6d3d323
fix : typo
kyupid Apr 27, 2021
76a8ec5
Merge pull request #52 from kyu-kim-kr/feat/github-oauth
kyupid Apr 27, 2021
e0049ae
chore : gradlew
kyupid Apr 27, 2021
6e6c7f4
Merge branch 'feat/github-oauth' into backend
kyupid Apr 27, 2021
7fb1f37
chore : gradle
kyupid Apr 27, 2021
ad3eca9
chore : application.properties
kyupid Apr 27, 2021
2517662
add : Mapping 규칙
kyupid Apr 29, 2021
85db84e
add : gradle related
kyupid Apr 30, 2021
3b2644c
remove : test
kyupid Apr 30, 2021
96f05e8
resolve : problem about merging with gradle.xml
kyupid Apr 30, 2021
7cd7769
Merge branch 'feat/order' into set/aws-approperties
kyupid Apr 30, 2021
44aee23
remove : Oauth related
kyupid Apr 30, 2021
5f61044
add : 주문하기 API
kyupid Apr 30, 2021
31bbc13
Merge pull request #61 from kyu-kim-kr/feat/order
kyupid Apr 30, 2021
7ff3ea1
fix : 매핑정보
kyupid Apr 30, 2021
6349704
Merge pull request #62 from kyu-kim-kr/feat/order
kyupid Apr 30, 2021
ba5cc6b
Merge branch 'team18' into backend
kyupid May 6, 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
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,34 @@
# sidedish
그룹프로젝트 #2

---

## 커밋 메시지 규칙

- feat : 새로운 기능 추가
- fix : 버그 수정
- docs : 문서의 수정
- style : (코드의 수정 없이) 스타일(style)만 변경(들여쓰기 같은 포맷이나 세미콜론을 빼먹은 경우)
- refactor : 코드를 리펙토링
- test : Test 관련한 코드의 추가, 수정
- chore : (코드의 수정 없이) 설정을 변경

커밋은 기본적으로 한글로, 말머리만 영어로

---

## 브랜치 규칙

upstream - dev - FE, BE - 각 브랜치

---

## 프로젝트 관리

![2021-04-19_18-19-57](https://user-images.githubusercontent.com/59721293/115190268-e27e4300-a13b-11eb-962a-ecadd06bae82.jpg)

---

![2021-04-19_18-21-48](https://user-images.githubusercontent.com/59721293/115190453-24a78480-a13c-11eb-9210-8b836843248e.jpg)


16 changes: 16 additions & 0 deletions backend/.idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 26 additions & 0 deletions backend/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 = 'develop.baminchan'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '1.8'

repositories {
mavenCentral()
}

dependencies {
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-oauth2-client', version: '2.1.0.RELEASE'
implementation 'org.springframework.boot:spring-boot-starter-data-jdbc'
implementation 'org.springframework.boot:spring-boot-starter-web'
runtimeOnly 'mysql:mysql-connector-java'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
}

test {
useJUnitPlatform()
}
Binary file added backend/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
5 changes: 5 additions & 0 deletions backend/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.7-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
185 changes: 185 additions & 0 deletions backend/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 backend/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
31 changes: 31 additions & 0 deletions backend/src/main/java/develop/baminchan/SidedishApplication.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package develop.baminchan;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.http.HttpStatus;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.web.authentication.HttpStatusEntryPoint;

@SpringBootApplication
public class SidedishApplication extends WebSecurityConfigurerAdapter {

Choose a reason for hiding this comment

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

Security 설정이 별도 클래스로 독립하면 조금 더 좋을 것 같네요.


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

@Override
protected void configure(HttpSecurity http) throws Exception {
// @formatter:off
http
.authorizeRequests(a -> a
.antMatchers("/", "/error").permitAll()
.anyRequest().authenticated()
)
.exceptionHandling(e -> e
.authenticationEntryPoint(new HttpStatusEntryPoint(HttpStatus.UNAUTHORIZED))
)
.oauth2Login();
// @formatter:on
}
}
Loading