Skip to content

Commit

Permalink
Merge branch 'week10' into deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
jinseohyun1228 committed Nov 6, 2024
2 parents 7f1b4d0 + 332bffd commit 19bab83
Show file tree
Hide file tree
Showing 65 changed files with 1,729 additions and 214 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@ out/
logs
.DS_STORE

boomerang/src/main/http/product/http-client.private.env.json
http-client.private.env.json
5 changes: 5 additions & 0 deletions boomerang/Invalidate
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/dev/stdin: ASCII text
Caches: cannot open `Caches' (No such file or directory)
/dev/stdin: very short file (no magic)
and: cannot open `and' (No such file or directory)
Restart: cannot open `Restart' (No such file or directory)
15 changes: 14 additions & 1 deletion boomerang/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ dependencies {
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'com.google.guava:guava:33.2.1-jre'

// token 설정
implementation 'io.jsonwebtoken:jjwt-api:0.11.5'
Expand All @@ -32,13 +33,16 @@ dependencies {
compileOnly 'org.projectlombok:lombok:1.18.30'
annotationProcessor 'org.projectlombok:lombok:1.18.30'

runtimeOnly 'com.h2database:h2'
// MySQL 커넥터
runtimeOnly 'com.mysql:mysql-connector-j'

testImplementation 'org.springframework.boot:spring-boot-starter-test'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'

//시큐리티 설정
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.boot:spring-boot-starter-web'

//테스트를 위한 시큐리티 설정
testImplementation 'org.springframework.security:spring-security-test'

Expand All @@ -50,6 +54,15 @@ dependencies {

// websocket
implementation 'org.springframework.boot:spring-boot-starter-websocket:3.3.4'

// Redis
implementation 'org.springframework.boot:spring-boot-starter-data-redis'

// Email
implementation 'org.springframework.boot:spring-boot-starter-mail'

// Thymeleaf (이메일 템플릿용)
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
}

configurations {
Expand Down
Binary file modified boomerang/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 1 addition & 2 deletions boomerang/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
34 changes: 13 additions & 21 deletions boomerang/gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#

##############################################################################
#
Expand Down Expand Up @@ -57,7 +55,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# 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/.
Expand Down Expand Up @@ -85,9 +83,10 @@ 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 -P "${APP_HOME:-./}" > /dev/null && printf '%s
' "$PWD" ) || exit
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

# 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
Expand Down Expand Up @@ -134,29 +133,26 @@ 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.
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
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=SC2039,SC3045
# 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=SC2039,SC3045
# shellcheck disable=SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -201,15 +197,11 @@ if "$cygwin" || "$msys" ; then
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, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.
# 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" \
Expand Down
22 changes: 10 additions & 12 deletions boomerang/gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem

@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
Expand Down Expand Up @@ -45,11 +43,11 @@ set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute

echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
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

Expand All @@ -59,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto execute

echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
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

Expand Down
61 changes: 48 additions & 13 deletions boomerang/src/main/http/Board.http
Original file line number Diff line number Diff line change
@@ -1,43 +1,78 @@
### get best boards
GET http://localhost:8080/api/v1/board/best?
size=5&board_type=ENTIRE&content_length=10
Cookie: Authorization={{Authorization}}
Authorization: {{Authorization}}


### get boards
GET http://localhost:8080/api/v1/board?
page=0&size=1&sort_direction=DESC&sort_by=id&board_type=ENTIRE&content_length=10
Cookie: Authorization={{Authorization}}
page=0&size=10&sort_direction=DESC&sort_by=id&board_type=ENTIRE&content_length=10
Authorization: {{Authorization}}

### get board
GET http://localhost:8080/api/v1/board/1

### create board
POST http://localhost:8080/api/v1/board
Content-Type: multipart/form-data; boundary=boundary
Authorization: {{Authorization}}

--boundary
Content-Disposition: form-data; name="data";
Content-Type: application/json
Cookie: Authorization={{Authorization}}

{
"title": "Example Title",
"content": "This is an example content for the board.",
"content": "content <img src=? /> <img src=? />",
"board_type": "ENTIRE",
"location": "BUSAN",
"anonymous_status": "PRIVATE"
"location": "BUSAN"
}

--boundary
Content-Disposition: form-data; name="images"; filename="test1.png"
Content-Type: image/png

< /Users/jaebin/Desktop/test1.png

--boundary
Content-Disposition: form-data; name="images"; filename="test2.png"
Content-Type: image/png

< /Users/jaebin/Desktop/test2.png

--boundary--


### update board
PUT http://localhost:8080/api/v1/board/1
PUT http://localhost:8080/api/v1/board/9
Content-Type: multipart/form-data; boundary=boundary
Authorization: {{Authorization}}

--boundary
Content-Disposition: form-data; name="data";
Content-Type: application/json
Cookie: Authorization={{Authorization}}

{
"title": "Example Title",
"content": "a.",
"content": "content <img src=? /> <img src=? />",
"board_type": "ENTIRE",
"location": "BUSAN",
"anonymous_status": "PRIVATE"
"location": "BUSAN"
}

--boundary
Content-Disposition: form-data; name="images"; filename="test1.png"
Content-Type: image/png

< /Users/jaebin/Desktop/test1.png

--boundary
Content-Disposition: form-data; name="images"; filename="test2.png"
Content-Type: image/png

< /Users/jaebin/Desktop/test2.png

--boundary--

### delete board
DELETE http://localhost:8080/api/v1/board/1
Authorization: eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxIiwiZW1haWwiOiJrYWthbzM3Mjk0MzgwNTIiLCJpYXQiOjE3Mjc4NjE2NjUsImV4cCI6MTcyNzg2NDA2NX0.Lc3gVOdsj_D3Zn_y6bvMRipYMCr_IenbLm1XVPi8Rr4
Authorization: {{Authorization}}
19 changes: 19 additions & 0 deletions boomerang/src/main/http/Login.http
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
### http://localhost:8080/api/v1/auth/login 로 access-token 받아오기

### 로그인
POST http://localhost:8080/api/v1/auth/login/kakao
Content-Type: application/json

{
"access_token":"qBoATpfGF3gvId2MBWoCm-yJVsrqbaeQAAAAAQoqJQ4AAAGS9mr3NeiSikwhugC4"
}


### set nickname
PUT http://localhost:8080/api/v1/member/nickname
Content-Type: application/json
Authorization: {{Authorization}}

{
"new_nickname":"aaa"
}
3 changes: 3 additions & 0 deletions boomerang/src/main/java/boomerang/Application.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableAsync;

@SpringBootApplication
@EnableAsync
public class Application {

public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
Expand Down
Loading

0 comments on commit 19bab83

Please sign in to comment.