diff --git a/HELP.md b/HELP.md
new file mode 100644
index 0000000..72907e6
--- /dev/null
+++ b/HELP.md
@@ -0,0 +1,23 @@
+# Getting Started
+
+### Reference Documentation
+For further reference, please consider the following sections:
+
+* [Official Gradle documentation](https://docs.gradle.org)
+* [Spring Boot Gradle Plugin Reference Guide](https://docs.spring.io/spring-boot/docs/2.7.16/gradle-plugin/reference/html/)
+* [Create an OCI image](https://docs.spring.io/spring-boot/docs/2.7.16/gradle-plugin/reference/html/#build-image)
+* [Spring Web](https://docs.spring.io/spring-boot/docs/2.7.16/reference/htmlsingle/index.html#web)
+
+### Guides
+The following guides illustrate how to use some features concretely:
+
+* [Accessing data with MySQL](https://spring.io/guides/gs/accessing-data-mysql/)
+* [Building a RESTful Web Service](https://spring.io/guides/gs/rest-service/)
+* [Serving Web Content with Spring MVC](https://spring.io/guides/gs/serving-web-content/)
+* [Building REST services with Spring](https://spring.io/guides/tutorials/rest/)
+
+### Additional Links
+These additional references should also help you:
+
+* [Gradle Build Scans – insights for your project's build](https://scans.gradle.com#gradle)
+
diff --git a/build.gradle b/build.gradle
new file mode 100644
index 0000000..2c734c4
--- /dev/null
+++ b/build.gradle
@@ -0,0 +1,33 @@
+plugins {
+ id 'java'
+ id 'org.springframework.boot' version '2.7.16'
+ id 'io.spring.dependency-management' version '1.0.15.RELEASE'
+}
+
+group = 'com.example'
+version = '0.0.1-SNAPSHOT'
+
+java {
+ sourceCompatibility = '11'
+}
+
+repositories {
+ mavenCentral()
+}
+
+dependencies {
+ implementation 'org.springframework.boot:spring-boot-starter-web'
+ runtimeOnly 'com.mysql:mysql-connector-j'
+ implementation 'com.h2database:h2'
+ compileOnly 'org.springframework.boot:spring-boot-starter-data-jpa'
+ testImplementation 'org.springframework.boot:spring-boot-starter-test'
+ implementation 'org.mybatis.spring.boot:mybatis-spring-boot-starter:2.2.0'
+ implementation 'org.springframework.boot:spring-boot-starter-validation'
+
+ compileOnly 'org.projectlombok:lombok:1.18.12'
+ annotationProcessor 'org.projectlombok:lombok:1.18.12'
+}
+
+tasks.named('test') {
+ useJUnitPlatform()
+}
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000..e69de29
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..1237eca
--- /dev/null
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -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
diff --git a/gradlew b/gradlew
new file mode 100644
index 0000000..bbdc6e8
--- /dev/null
+++ b/gradlew
@@ -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" "$@"
diff --git a/gradlew.bat b/gradlew.bat
new file mode 100644
index 0000000..6689b85
--- /dev/null
+++ b/gradlew.bat
@@ -0,0 +1,92 @@
+@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=.
+@rem This is normally unused
+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% equ 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% equ 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!
+set EXIT_CODE=%ERRORLEVEL%
+if %EXIT_CODE% equ 0 set EXIT_CODE=1
+if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
+exit /b %EXIT_CODE%
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/out/production/classes/com/example/ysu/YsuApplication.class b/out/production/classes/com/example/ysu/YsuApplication.class
new file mode 100644
index 0000000..0459508
Binary files /dev/null and b/out/production/classes/com/example/ysu/YsuApplication.class differ
diff --git a/out/production/classes/com/example/ysu/common/CommonUtils.class b/out/production/classes/com/example/ysu/common/CommonUtils.class
new file mode 100644
index 0000000..a45321d
Binary files /dev/null and b/out/production/classes/com/example/ysu/common/CommonUtils.class differ
diff --git a/out/production/classes/com/example/ysu/controller/ReviewController.class b/out/production/classes/com/example/ysu/controller/ReviewController.class
new file mode 100644
index 0000000..40ddc67
Binary files /dev/null and b/out/production/classes/com/example/ysu/controller/ReviewController.class differ
diff --git a/out/production/classes/com/example/ysu/controller/ReviewInsertController.class b/out/production/classes/com/example/ysu/controller/ReviewInsertController.class
new file mode 100644
index 0000000..7eef588
Binary files /dev/null and b/out/production/classes/com/example/ysu/controller/ReviewInsertController.class differ
diff --git a/out/production/classes/com/example/ysu/controller/SelectMenuController.class b/out/production/classes/com/example/ysu/controller/SelectMenuController.class
new file mode 100644
index 0000000..734fc55
Binary files /dev/null and b/out/production/classes/com/example/ysu/controller/SelectMenuController.class differ
diff --git a/out/production/classes/com/example/ysu/model/dao/JacksonConfig.class b/out/production/classes/com/example/ysu/model/dao/JacksonConfig.class
new file mode 100644
index 0000000..ebba848
Binary files /dev/null and b/out/production/classes/com/example/ysu/model/dao/JacksonConfig.class differ
diff --git a/out/production/classes/com/example/ysu/model/dao/ReviewDAO.class b/out/production/classes/com/example/ysu/model/dao/ReviewDAO.class
new file mode 100644
index 0000000..2286dfb
Binary files /dev/null and b/out/production/classes/com/example/ysu/model/dao/ReviewDAO.class differ
diff --git a/out/production/classes/com/example/ysu/model/dao/ReviewInsertDAO.class b/out/production/classes/com/example/ysu/model/dao/ReviewInsertDAO.class
new file mode 100644
index 0000000..6de50be
Binary files /dev/null and b/out/production/classes/com/example/ysu/model/dao/ReviewInsertDAO.class differ
diff --git a/out/production/classes/com/example/ysu/model/dao/SelectMenuDAO.class b/out/production/classes/com/example/ysu/model/dao/SelectMenuDAO.class
new file mode 100644
index 0000000..17695bd
Binary files /dev/null and b/out/production/classes/com/example/ysu/model/dao/SelectMenuDAO.class differ
diff --git a/out/production/classes/com/example/ysu/model/dto/ReviewDTO.class b/out/production/classes/com/example/ysu/model/dto/ReviewDTO.class
new file mode 100644
index 0000000..9171b33
Binary files /dev/null and b/out/production/classes/com/example/ysu/model/dto/ReviewDTO.class differ
diff --git a/out/production/classes/com/example/ysu/model/dto/SelectMenuDTO.class b/out/production/classes/com/example/ysu/model/dto/SelectMenuDTO.class
new file mode 100644
index 0000000..ad3a293
Binary files /dev/null and b/out/production/classes/com/example/ysu/model/dto/SelectMenuDTO.class differ
diff --git a/out/production/classes/com/example/ysu/model/dto/SignupDTO.class b/out/production/classes/com/example/ysu/model/dto/SignupDTO.class
new file mode 100644
index 0000000..4c32253
Binary files /dev/null and b/out/production/classes/com/example/ysu/model/dto/SignupDTO.class differ
diff --git a/out/production/classes/com/example/ysu/service/ReviewInsertService.class b/out/production/classes/com/example/ysu/service/ReviewInsertService.class
new file mode 100644
index 0000000..c87c621
Binary files /dev/null and b/out/production/classes/com/example/ysu/service/ReviewInsertService.class differ
diff --git a/out/production/classes/com/example/ysu/service/ReviewInsertServiceImpl.class b/out/production/classes/com/example/ysu/service/ReviewInsertServiceImpl.class
new file mode 100644
index 0000000..6237003
Binary files /dev/null and b/out/production/classes/com/example/ysu/service/ReviewInsertServiceImpl.class differ
diff --git a/out/production/classes/com/example/ysu/service/ReviewService.class b/out/production/classes/com/example/ysu/service/ReviewService.class
new file mode 100644
index 0000000..55a30c3
Binary files /dev/null and b/out/production/classes/com/example/ysu/service/ReviewService.class differ
diff --git a/out/production/classes/com/example/ysu/service/ReviewServiceImpl.class b/out/production/classes/com/example/ysu/service/ReviewServiceImpl.class
new file mode 100644
index 0000000..672bda6
Binary files /dev/null and b/out/production/classes/com/example/ysu/service/ReviewServiceImpl.class differ
diff --git a/out/production/classes/com/example/ysu/service/SelectMenuService.class b/out/production/classes/com/example/ysu/service/SelectMenuService.class
new file mode 100644
index 0000000..95fb28e
Binary files /dev/null and b/out/production/classes/com/example/ysu/service/SelectMenuService.class differ
diff --git a/out/production/classes/com/example/ysu/service/SelectMenuServiceImpl.class b/out/production/classes/com/example/ysu/service/SelectMenuServiceImpl.class
new file mode 100644
index 0000000..ff24d0e
Binary files /dev/null and b/out/production/classes/com/example/ysu/service/SelectMenuServiceImpl.class differ
diff --git a/out/production/resources/application.properties b/out/production/resources/application.properties
new file mode 100644
index 0000000..825f2b3
--- /dev/null
+++ b/out/production/resources/application.properties
@@ -0,0 +1,13 @@
+# database
+spring.datasource.url: jdbc:mysql://localhost:3306/ysu?characterEncoding=utf8
+spring.datasource.username: root
+spring.datasource.password: 1234
+spring.datasource.driver-class-name: com.mysql.cj.jdbc.Driver
+
+# mybatis
+mybatis.config=mybatis-config.xml
+mybatis.type-aliases-package: com.example.demo.model
+mybatis.mapper-locations: mybatis/mapper/*.xml
+
+spring.servlet.multipart.max-file-size=10MB
+spring.servlet.multipart.max-request-size=10MB
\ No newline at end of file
diff --git a/out/production/resources/mybatis/mapper/ReviewMapper.xml b/out/production/resources/mybatis/mapper/ReviewMapper.xml
new file mode 100644
index 0000000..34fbda2
--- /dev/null
+++ b/out/production/resources/mybatis/mapper/ReviewMapper.xml
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+ INSERT INTO review (u_id, u_name, order_id, menu_id, review_writing, review_star, review_time, review_regist, review_img)
+ SELECT u.u_id, u.u_name, od.order_id, od.menu_id, #{review_writing}, #{review_star}, NOW() as review_time, 1, #{review_img}
+ FROM orders o
+ INNER JOIN orderdetail od ON o.order_id = od.order_id
+ INNER JOIN menu m ON od.menu_id = m.menu_id
+ INNER JOIN users u ON u.u_id = od.u_id
+
+
+ WHERE od.u_id ='2023200014' AND od.order_id=5 AND od.menu_id=5;
+
+
+
+ DELETE FROM REVIEW WHERE review_id=#{review_id};
+
+
\ No newline at end of file
diff --git a/out/production/resources/mybatis/mapper/SelectMenuMapper.xml b/out/production/resources/mybatis/mapper/SelectMenuMapper.xml
new file mode 100644
index 0000000..a445eb8
--- /dev/null
+++ b/out/production/resources/mybatis/mapper/SelectMenuMapper.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/out/production/resources/mybatis/mybatis-config.xml b/out/production/resources/mybatis/mybatis-config.xml
new file mode 100644
index 0000000..90d73a4
--- /dev/null
+++ b/out/production/resources/mybatis/mybatis-config.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/settings.gradle b/settings.gradle
new file mode 100644
index 0000000..8d9902c
--- /dev/null
+++ b/settings.gradle
@@ -0,0 +1 @@
+rootProject.name = 'ysu'
diff --git a/src/main/java/com/example/ysu/YsuApplication.java b/src/main/java/com/example/ysu/YsuApplication.java
new file mode 100644
index 0000000..2b855c0
--- /dev/null
+++ b/src/main/java/com/example/ysu/YsuApplication.java
@@ -0,0 +1,13 @@
+package com.example.ysu;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+@SpringBootApplication
+public class YsuApplication {
+
+ public static void main(String[] args) {
+ SpringApplication.run(YsuApplication.class, args);
+ }
+
+}
diff --git a/src/main/java/com/example/ysu/common/CommonUtils.java b/src/main/java/com/example/ysu/common/CommonUtils.java
new file mode 100644
index 0000000..21ddca8
--- /dev/null
+++ b/src/main/java/com/example/ysu/common/CommonUtils.java
@@ -0,0 +1,29 @@
+package com.example.ysu.common;
+
+import java.util.List;
+import java.util.Map;
+
+public class CommonUtils {
+ /*
+ 공백 또는 null 체크
+ */
+ public static boolean isEmpty(Object obj){
+ if(obj == null) return true;
+ if((obj instanceof String) &&(((String)obj).trim().length() == 0)) {
+ return true;
+ }
+ if (obj instanceof Map) {
+ return ((Map, ?>) obj).isEmpty();
+ }
+ if (obj instanceof Map){
+ return ((Map,?>)obj).isEmpty();
+ }
+ if (obj instanceof List) {
+ return ((List>)obj).isEmpty();
+ }
+ if (obj instanceof Object[]) {
+ return (((Object[])obj).length == 0);
+ }
+ return false;
+ }
+}
diff --git a/src/main/java/com/example/ysu/controller/ReviewController.java b/src/main/java/com/example/ysu/controller/ReviewController.java
new file mode 100644
index 0000000..16ed9fd
--- /dev/null
+++ b/src/main/java/com/example/ysu/controller/ReviewController.java
@@ -0,0 +1,30 @@
+package com.example.ysu.controller;
+
+import com.example.ysu.model.dto.ReviewDTO;
+import com.example.ysu.service.ReviewService;
+import lombok.RequiredArgsConstructor;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.*;
+import java.util.List;
+
+@RequiredArgsConstructor
+@RestController
+public class ReviewController {
+ @Autowired
+ private ReviewService reviewService;
+
+ @GetMapping("/menu/{menu_id}/review")
+ public List reviewList(@PathVariable int menu_id) {
+ return reviewService.reviewList(menu_id);
+ }
+
+ @DeleteMapping("/review/delete/{review_id}")
+ public String reviewDelete(@PathVariable int review_id) {
+ reviewService.reviewDelete(review_id);
+ System.out.print(review_id);
+ return "redirect:/menu";
+ // Review 삭제 로직을 수행
+ }
+}
diff --git a/src/main/java/com/example/ysu/controller/ReviewInsertController.java b/src/main/java/com/example/ysu/controller/ReviewInsertController.java
new file mode 100644
index 0000000..527a0c7
--- /dev/null
+++ b/src/main/java/com/example/ysu/controller/ReviewInsertController.java
@@ -0,0 +1,62 @@
+package com.example.ysu.controller;
+
+import com.example.ysu.model.dto.ReviewDTO;
+import com.example.ysu.service.ReviewInsertService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.http.HttpStatus;
+
+import java.io.File;
+import java.io.IOException;
+
+@RestController
+@RequestMapping("/menu")
+//@RequestMapping
+public class ReviewInsertController {
+ @Autowired
+ private ReviewInsertService reviewInsertService;
+
+ private final String reviewImageUploadPath = "C:/Users/user/ysu/src/pages/img";
+
+ @PostMapping("/{menu_id}/review/write")
+ public ResponseEntity insertDataReview(
+ @RequestParam("review_writing") String review_writing,
+ @RequestParam("review_star") int review_star,
+ @RequestParam(value = "review_img" , required = false) MultipartFile review_img
+ ){
+ try {
+ String fileReviewName = saveImage(review_img);
+
+ ReviewDTO reviewDTO = new ReviewDTO();
+ reviewDTO.setReview_writing(review_writing);
+ reviewDTO.setReview_star(review_star);
+ reviewDTO.setReview_img(fileReviewName);
+
+ reviewInsertService.reviewInsert(reviewDTO);
+ return ResponseEntity.ok("Data successfully");
+ } catch (Exception e){
+ e.printStackTrace();
+ return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body("Failed to insert data");
+ }
+ }
+ private String saveImage(MultipartFile multipartFile) {
+ if(multipartFile != null){
+ try {
+ String originalFileName = multipartFile.getOriginalFilename();
+ String filePath = reviewImageUploadPath + File.separator + originalFileName;
+ File dest = new File(filePath);
+ multipartFile.transferTo(dest);
+ return originalFileName;
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ return null;
+ }
+
+}
diff --git a/src/main/java/com/example/ysu/controller/SelectMenuController.java b/src/main/java/com/example/ysu/controller/SelectMenuController.java
new file mode 100644
index 0000000..54b6581
--- /dev/null
+++ b/src/main/java/com/example/ysu/controller/SelectMenuController.java
@@ -0,0 +1,28 @@
+package com.example.ysu.controller;
+
+import com.example.ysu.model.dto.SelectMenuDTO;
+import com.example.ysu.service.SelectMenuService;
+import lombok.RequiredArgsConstructor;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+@RequiredArgsConstructor
+@RestController
+public class SelectMenuController {
+ private final SelectMenuService selectMenuService;
+
+ @GetMapping("/menu")
+ public List SelectMenuList(){
+ return selectMenuService.SelectMenuList();
+ }
+
+ @GetMapping("/menu/{menuid}")
+ public SelectMenuDTO SelectMenuById(@PathVariable Long menuid) {
+ return selectMenuService.getMenuById(menuid);
+ }
+
+
+}
diff --git a/src/main/java/com/example/ysu/model/dao/JacksonConfig.java b/src/main/java/com/example/ysu/model/dao/JacksonConfig.java
new file mode 100644
index 0000000..a1f4abd
--- /dev/null
+++ b/src/main/java/com/example/ysu/model/dao/JacksonConfig.java
@@ -0,0 +1,20 @@
+package com.example.ysu.model.dao;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.SerializationFeature;
+import com.fasterxml.jackson.databind.util.StdDateFormat;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+@Configuration
+public class JacksonConfig {
+
+ @Bean
+ public ObjectMapper objectMapper() {
+ ObjectMapper objectMapper = new ObjectMapper();
+ objectMapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
+ objectMapper.setDateFormat(new StdDateFormat().withColonInTimeZone(true));
+
+ return objectMapper;
+ }
+}
diff --git a/src/main/java/com/example/ysu/model/dao/ReviewDAO.java b/src/main/java/com/example/ysu/model/dao/ReviewDAO.java
new file mode 100644
index 0000000..9a21cc0
--- /dev/null
+++ b/src/main/java/com/example/ysu/model/dao/ReviewDAO.java
@@ -0,0 +1,19 @@
+package com.example.ysu.model.dao;
+
+import com.example.ysu.model.dto.ReviewDTO;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.session.SqlSession;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+@Mapper
+@Repository
+public interface ReviewDAO {
+ void reviewInsert(ReviewDTO reviewDTO);
+
+ List reviewList(int menu_id);
+
+ void reviewDelete(int review_id);
+}
diff --git a/src/main/java/com/example/ysu/model/dao/ReviewInsertDAO.java b/src/main/java/com/example/ysu/model/dao/ReviewInsertDAO.java
new file mode 100644
index 0000000..33aa33e
--- /dev/null
+++ b/src/main/java/com/example/ysu/model/dao/ReviewInsertDAO.java
@@ -0,0 +1,17 @@
+package com.example.ysu.model.dao;
+
+import com.example.ysu.model.dto.ReviewDTO;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.session.SqlSession;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Repository;
+@Repository
+@Mapper
+public class ReviewInsertDAO {
+ @Autowired
+ private SqlSession sqlSession;
+
+ public void reviewInsertData(ReviewDTO reviewDTO){
+ sqlSession.insert("com.example.ysu.model.dao.ReviewDAO.reviewInsert", reviewDTO);
+ }
+}
diff --git a/src/main/java/com/example/ysu/model/dao/SelectMenuDAO.java b/src/main/java/com/example/ysu/model/dao/SelectMenuDAO.java
new file mode 100644
index 0000000..4a9a5a0
--- /dev/null
+++ b/src/main/java/com/example/ysu/model/dao/SelectMenuDAO.java
@@ -0,0 +1,14 @@
+package com.example.ysu.model.dao;
+
+import com.example.ysu.model.dto.SelectMenuDTO;
+import org.apache.ibatis.annotations.Mapper;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+@Repository
+@Mapper
+public interface SelectMenuDAO {
+ List SelectMenuList();
+ SelectMenuDTO getMenuById(Long menuId);
+}
diff --git a/src/main/java/com/example/ysu/model/dto/ReviewDTO.java b/src/main/java/com/example/ysu/model/dto/ReviewDTO.java
new file mode 100644
index 0000000..8b95b39
--- /dev/null
+++ b/src/main/java/com/example/ysu/model/dto/ReviewDTO.java
@@ -0,0 +1,28 @@
+package com.example.ysu.model.dto;
+import lombok.*;
+import java.util.Date;
+@Setter
+@Getter
+@AllArgsConstructor
+@NoArgsConstructor
+public class ReviewDTO {
+ private String u_id;
+
+ private String u_name;
+
+ private Integer order_id;
+
+ private Integer menu_id;
+
+ private Integer review_id;
+
+ private String review_writing;
+
+ private Integer review_star;
+
+ private Date review_time;
+
+ private Integer review_regist;
+
+ private String review_img;
+}
diff --git a/src/main/java/com/example/ysu/model/dto/SelectMenuDTO.java b/src/main/java/com/example/ysu/model/dto/SelectMenuDTO.java
new file mode 100644
index 0000000..ee100bf
--- /dev/null
+++ b/src/main/java/com/example/ysu/model/dto/SelectMenuDTO.java
@@ -0,0 +1,21 @@
+package com.example.ysu.model.dto;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+
+@Getter
+@Setter
+@NoArgsConstructor
+@AllArgsConstructor
+public class SelectMenuDTO {
+ private int menu_id;
+ private String menu_name; // 메뉴 이름
+ private String menu_corner; // 코너
+ private int menu_price;
+ private int menu_pack; // 포장 여부
+ private String menu_image; // 음식 사진
+ private int menu_sales; // 판매 가능 여부
+ private int menu_regist; // 등록 여부
+}
\ No newline at end of file
diff --git a/src/main/java/com/example/ysu/model/dto/SignupDTO.java b/src/main/java/com/example/ysu/model/dto/SignupDTO.java
new file mode 100644
index 0000000..30b9503
--- /dev/null
+++ b/src/main/java/com/example/ysu/model/dto/SignupDTO.java
@@ -0,0 +1,29 @@
+package com.example.ysu.model.dto;
+
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.Pattern;
+
+@Data
+public class SignupDTO {
+ @NotBlank(message = "이름을 입력해주세요.")
+ @Pattern(regexp="^[ㄱ-ㅎ가-힣a-z]{2,10}$", message = "숫자 또는 특수문자를 제외한 2자이상 입력해주세요.")
+ private String u_name;
+
+ @NotBlank(message="학과는 필수 입력 값 입니다.")
+ @Pattern(regexp = "^[ㄱ-ㅎ가-힣a-z]{2,20}$", message = "숫자 또는 특수문자를 제외한 2자이상 입력해주세요.")
+ private String u_dept;
+
+
+ @NotBlank(message = "학번을 입력해주세요.")
+ @Pattern(regexp = "^[\\d]*$", message = "숫자만 입력해주세요")
+ private String u_id;
+
+ @NotBlank(message = "비밀번호를 입력해주세요.")
+ @Pattern(regexp = "(?=.*[0-9])(?=.*[a-zA-Z]).{8,16}", message = "비밀번호는 8~16자 영문 대 소문자, 숫자, 특수문자를 사용하세요.")
+ private String u_pw;
+}
diff --git a/src/main/java/com/example/ysu/service/ReviewInsertService.java b/src/main/java/com/example/ysu/service/ReviewInsertService.java
new file mode 100644
index 0000000..4f65104
--- /dev/null
+++ b/src/main/java/com/example/ysu/service/ReviewInsertService.java
@@ -0,0 +1,8 @@
+package com.example.ysu.service;
+
+import com.example.ysu.model.dto.ReviewDTO;
+import org.springframework.stereotype.Service;
+@Service
+public interface ReviewInsertService {
+ void reviewInsert(ReviewDTO reviewDTO);
+}
diff --git a/src/main/java/com/example/ysu/service/ReviewInsertServiceImpl.java b/src/main/java/com/example/ysu/service/ReviewInsertServiceImpl.java
new file mode 100644
index 0000000..11eaf18
--- /dev/null
+++ b/src/main/java/com/example/ysu/service/ReviewInsertServiceImpl.java
@@ -0,0 +1,21 @@
+package com.example.ysu.service;
+
+import com.example.ysu.model.dao.ReviewInsertDAO;
+import com.example.ysu.model.dto.ReviewDTO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service
+public class ReviewInsertServiceImpl implements ReviewInsertService{
+ private final ReviewInsertDAO reviewInsertDAO;
+
+ @Autowired
+ public ReviewInsertServiceImpl(ReviewInsertDAO reviewInsertDAO){
+ this.reviewInsertDAO=reviewInsertDAO;
+ }
+
+ @Override
+ public void reviewInsert(ReviewDTO reviewDTO) {
+ reviewInsertDAO.reviewInsertData(reviewDTO);
+ }
+}
diff --git a/src/main/java/com/example/ysu/service/ReviewService.java b/src/main/java/com/example/ysu/service/ReviewService.java
new file mode 100644
index 0000000..aa9805f
--- /dev/null
+++ b/src/main/java/com/example/ysu/service/ReviewService.java
@@ -0,0 +1,11 @@
+package com.example.ysu.service;
+
+import com.example.ysu.model.dto.ReviewDTO;
+
+import java.util.List;
+
+public interface ReviewService {
+ List reviewList(int menu_id);
+
+ void reviewDelete(int review_id);
+}
diff --git a/src/main/java/com/example/ysu/service/ReviewServiceImpl.java b/src/main/java/com/example/ysu/service/ReviewServiceImpl.java
new file mode 100644
index 0000000..32bc435
--- /dev/null
+++ b/src/main/java/com/example/ysu/service/ReviewServiceImpl.java
@@ -0,0 +1,24 @@
+package com.example.ysu.service;
+import com.example.ysu.model.dao.ReviewDAO;
+import com.example.ysu.model.dao.ReviewInsertDAO;
+import com.example.ysu.model.dto.ReviewDTO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import java.util.List;
+
+@Service
+public class ReviewServiceImpl implements ReviewService {
+ @Autowired
+ private ReviewDAO reviewDAO;
+ private ReviewInsertDAO reviewInsertDAO;
+
+ @Override
+ public List reviewList(int menu_id) {
+ return reviewDAO.reviewList(menu_id);
+ }
+
+ @Override
+ public void reviewDelete(int review_id) {
+ reviewDAO.reviewDelete(review_id);
+ }
+}
diff --git a/src/main/java/com/example/ysu/service/SelectMenuService.java b/src/main/java/com/example/ysu/service/SelectMenuService.java
new file mode 100644
index 0000000..5a47f95
--- /dev/null
+++ b/src/main/java/com/example/ysu/service/SelectMenuService.java
@@ -0,0 +1,11 @@
+package com.example.ysu.service;
+
+import com.example.ysu.model.dto.SelectMenuDTO;
+
+import java.util.List;
+
+public interface SelectMenuService {
+ public List SelectMenuList();
+ SelectMenuDTO getMenuById(Long menuId);
+
+}
diff --git a/src/main/java/com/example/ysu/service/SelectMenuServiceImpl.java b/src/main/java/com/example/ysu/service/SelectMenuServiceImpl.java
new file mode 100644
index 0000000..4ea06be
--- /dev/null
+++ b/src/main/java/com/example/ysu/service/SelectMenuServiceImpl.java
@@ -0,0 +1,26 @@
+package com.example.ysu.service;
+
+import com.example.ysu.model.dao.SelectMenuDAO;
+import com.example.ysu.model.dao.SelectMenuDAO;
+import com.example.ysu.model.dto.SelectMenuDTO;
+import lombok.RequiredArgsConstructor;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+@RequiredArgsConstructor
+public class SelectMenuServiceImpl implements SelectMenuService {
+ private final SelectMenuDAO selectMenuDAO;
+
+ @Override
+ public List SelectMenuList() {
+
+ return selectMenuDAO.SelectMenuList();
+ }
+
+ @Override
+ public SelectMenuDTO getMenuById(Long menuId) {
+ return selectMenuDAO.getMenuById(menuId);
+ }
+}
diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties
new file mode 100644
index 0000000..825f2b3
--- /dev/null
+++ b/src/main/resources/application.properties
@@ -0,0 +1,13 @@
+# database
+spring.datasource.url: jdbc:mysql://localhost:3306/ysu?characterEncoding=utf8
+spring.datasource.username: root
+spring.datasource.password: 1234
+spring.datasource.driver-class-name: com.mysql.cj.jdbc.Driver
+
+# mybatis
+mybatis.config=mybatis-config.xml
+mybatis.type-aliases-package: com.example.demo.model
+mybatis.mapper-locations: mybatis/mapper/*.xml
+
+spring.servlet.multipart.max-file-size=10MB
+spring.servlet.multipart.max-request-size=10MB
\ No newline at end of file
diff --git a/src/main/resources/mybatis/mapper/ReviewMapper.xml b/src/main/resources/mybatis/mapper/ReviewMapper.xml
new file mode 100644
index 0000000..34fbda2
--- /dev/null
+++ b/src/main/resources/mybatis/mapper/ReviewMapper.xml
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+ INSERT INTO review (u_id, u_name, order_id, menu_id, review_writing, review_star, review_time, review_regist, review_img)
+ SELECT u.u_id, u.u_name, od.order_id, od.menu_id, #{review_writing}, #{review_star}, NOW() as review_time, 1, #{review_img}
+ FROM orders o
+ INNER JOIN orderdetail od ON o.order_id = od.order_id
+ INNER JOIN menu m ON od.menu_id = m.menu_id
+ INNER JOIN users u ON u.u_id = od.u_id
+
+
+ WHERE od.u_id ='2023200014' AND od.order_id=5 AND od.menu_id=5;
+
+
+
+ DELETE FROM REVIEW WHERE review_id=#{review_id};
+
+
\ No newline at end of file
diff --git a/src/main/resources/mybatis/mapper/SelectMenuMapper.xml b/src/main/resources/mybatis/mapper/SelectMenuMapper.xml
new file mode 100644
index 0000000..a445eb8
--- /dev/null
+++ b/src/main/resources/mybatis/mapper/SelectMenuMapper.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/resources/mybatis/mybatis-config.xml b/src/main/resources/mybatis/mybatis-config.xml
new file mode 100644
index 0000000..90d73a4
--- /dev/null
+++ b/src/main/resources/mybatis/mybatis-config.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/test/java/com/example/ysu/YsuApplicationTests.java b/src/test/java/com/example/ysu/YsuApplicationTests.java
new file mode 100644
index 0000000..c187929
--- /dev/null
+++ b/src/test/java/com/example/ysu/YsuApplicationTests.java
@@ -0,0 +1,13 @@
+package com.example.ysu;
+
+import org.junit.jupiter.api.Test;
+import org.springframework.boot.test.context.SpringBootTest;
+
+@SpringBootTest
+class YsuApplicationTests {
+
+ @Test
+ void contextLoads() {
+ }
+
+}