diff --git a/.idea/.gitignore b/.idea/.gitignore
new file mode 100644
index 0000000..c79ce29
--- /dev/null
+++ b/.idea/.gitignore
@@ -0,0 +1,10 @@
+# 디폴트 무시된 파일
+/shelf/
+/workspace.xml
+# 에디터 기반 HTTP 클라이언트 요청
+/httpRequests/
+# 환경에 따라 달라지는 Maven 홈 디렉터리
+/mavenHomeManager.xml
+# Datasource local storage ignored files
+/dataSources/
+/dataSources.local.xml
diff --git a/.idea/10th_SpringBoot_B.iml b/.idea/10th_SpringBoot_B.iml
new file mode 100644
index 0000000..d6ebd48
--- /dev/null
+++ b/.idea/10th_SpringBoot_B.iml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/compiler.xml b/.idea/compiler.xml
new file mode 100644
index 0000000..3fe0d38
--- /dev/null
+++ b/.idea/compiler.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
new file mode 100644
index 0000000..4635b22
--- /dev/null
+++ b/.idea/gradle.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..c40b155
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
new file mode 100644
index 0000000..0bdfc3c
--- /dev/null
+++ b/.idea/modules.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules/umc10th_wony.main.iml b/.idea/modules/umc10th_wony.main.iml
new file mode 100644
index 0000000..23d8213
--- /dev/null
+++ b/.idea/modules/umc10th_wony.main.iml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000..35eb1dd
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/umc10th_wony/.gitattributes b/umc10th_wony/.gitattributes
new file mode 100644
index 0000000..8af972c
--- /dev/null
+++ b/umc10th_wony/.gitattributes
@@ -0,0 +1,3 @@
+/gradlew text eol=lf
+*.bat text eol=crlf
+*.jar binary
diff --git a/umc10th_wony/.gitignore b/umc10th_wony/.gitignore
new file mode 100644
index 0000000..c2065bc
--- /dev/null
+++ b/umc10th_wony/.gitignore
@@ -0,0 +1,37 @@
+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/
diff --git a/umc10th_wony/build.gradle b/umc10th_wony/build.gradle
new file mode 100644
index 0000000..20b3a39
--- /dev/null
+++ b/umc10th_wony/build.gradle
@@ -0,0 +1,41 @@
+plugins {
+ id 'java'
+ id 'org.springframework.boot' version '4.0.5'
+ id 'io.spring.dependency-management' version '1.1.7'
+}
+
+group = 'com.example'
+version = '0.0.1-SNAPSHOT'
+description = 'umc10th_wony'
+
+java {
+ toolchain {
+ languageVersion = JavaLanguageVersion.of(21)
+ }
+}
+
+repositories {
+ mavenCentral()
+}
+
+dependencies {
+ implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
+ implementation 'org.springframework.boot:spring-boot-starter-webmvc'
+ implementation 'org.springframework.boot:spring-boot-starter-security'
+ compileOnly 'org.projectlombok:lombok'
+ runtimeOnly 'com.mysql:mysql-connector-j'
+ annotationProcessor 'org.projectlombok:lombok'
+ testImplementation 'org.springframework.boot:spring-boot-starter-data-jpa-test'
+ testImplementation 'org.springframework.boot:spring-boot-starter-webmvc-test'
+ testCompileOnly 'org.projectlombok:lombok'
+ testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
+ testAnnotationProcessor 'org.projectlombok:lombok'
+
+ // Swagger
+ implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:3.0.1'
+ implementation 'org.springdoc:springdoc-openapi-starter-webmvc-api:3.0.1'
+}
+
+tasks.named('test') {
+ useJUnitPlatform()
+}
diff --git a/umc10th_wony/gradle/wrapper/gradle-wrapper.jar b/umc10th_wony/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000..d997cfc
Binary files /dev/null and b/umc10th_wony/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/umc10th_wony/gradle/wrapper/gradle-wrapper.properties b/umc10th_wony/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..c61a118
--- /dev/null
+++ b/umc10th_wony/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,7 @@
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.1-bin.zip
+networkTimeout=10000
+validateDistributionUrl=true
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
diff --git a/umc10th_wony/gradlew b/umc10th_wony/gradlew
new file mode 100644
index 0000000..739907d
--- /dev/null
+++ b/umc10th_wony/gradlew
@@ -0,0 +1,248 @@
+#!/bin/sh
+
+#
+# Copyright © 2015 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.
+#
+# SPDX-License-Identifier: Apache-2.0
+#
+
+##############################################################################
+#
+# 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/2d6327017519d23b96af35865dc997fcb544fb40/platforms/jvm/plugins-application/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 -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || 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
+
+
+
+# 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=SC2039,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
+ 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" )
+
+ 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 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.
+
+set -- \
+ "-Dorg.gradle.appname=$APP_BASE_NAME" \
+ -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
+ "$@"
+
+# 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/umc10th_wony/gradlew.bat b/umc10th_wony/gradlew.bat
new file mode 100644
index 0000000..c4bdd3a
--- /dev/null
+++ b/umc10th_wony/gradlew.bat
@@ -0,0 +1,93 @@
+@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
+@rem SPDX-License-Identifier: Apache-2.0
+@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. 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
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+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
+
+goto fail
+
+:execute
+@rem Setup the command line
+
+
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
+
+: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/umc10th_wony/settings.gradle b/umc10th_wony/settings.gradle
new file mode 100644
index 0000000..e926390
--- /dev/null
+++ b/umc10th_wony/settings.gradle
@@ -0,0 +1 @@
+rootProject.name = 'umc10th_wony'
diff --git a/umc10th_wony/src/main/java/com/example/umc10th_wony/Umc10thWonyApplication.java b/umc10th_wony/src/main/java/com/example/umc10th_wony/Umc10thWonyApplication.java
new file mode 100644
index 0000000..38bd4e9
--- /dev/null
+++ b/umc10th_wony/src/main/java/com/example/umc10th_wony/Umc10thWonyApplication.java
@@ -0,0 +1,13 @@
+package com.example.umc10th_wony;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+@SpringBootApplication
+public class Umc10thWonyApplication {
+
+ public static void main(String[] args) {
+ SpringApplication.run(Umc10thWonyApplication.class, args);
+ }
+
+}
diff --git a/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/member/controller/MemberController.java b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/member/controller/MemberController.java
new file mode 100644
index 0000000..6c4b505
--- /dev/null
+++ b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/member/controller/MemberController.java
@@ -0,0 +1,70 @@
+package com.example.umc10th_wony.domain.member.controller;
+
+import com.example.umc10th_wony.domain.member.dto.MemberSignupRequest;
+import com.example.umc10th_wony.domain.member.dto.MemberInfoResponse;
+import com.example.umc10th_wony.domain.member.dto.MemberSignupResponse;
+
+import com.example.umc10th_wony.domain.member.dto.MyPageResponse;
+import com.example.umc10th_wony.domain.member.service.MemberService;
+import com.example.umc10th_wony.global.apiPayload.ApiResponse;
+import com.example.umc10th_wony.domain.member.exception.code.MemberSuccessCode;
+import com.example.umc10th_wony.global.security.LoginMember;
+
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import jakarta.validation.Valid;
+import lombok.RequiredArgsConstructor;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.*;
+
+@Tag(name = "Member API", description = "회원 관련 API")
+@RestController
+@RequiredArgsConstructor
+@RequestMapping("/api/members")
+public class MemberController {
+ // 1. 회원가입
+ @Operation(summary = "회원가입", description = "이메일 + 비밀번호로 회원을 등록합니다.")
+ @PostMapping("/signup")
+ public ResponseEntity> signup(
+ @Valid @RequestBody MemberSignupRequest request
+ ) {
+ // TODO: memberService.signup(request)
+ MemberSignupResponse result = MemberSignupResponse.builder()
+ .memberId(1L)
+ .email(request.getEmail())
+ .nickname(request.getNickname())
+ .build();
+ return ResponseEntity.status(201)
+ .body(ApiResponse.onSuccess(MemberSuccessCode.SIGNUP_SUCCESS, result));
+ }
+
+ // 2. 내 정보 조회
+// @Operation(summary = "내 정보 조회", description = "JWT 토큰으로 인증된 현재 회원의 정보를 반환합니다.")
+// @GetMapping("/me")
+// public ResponseEntity> getMyInfo(
+// @Parameter(hidden = true) @LoginMember Long memberId
+// ) {
+// // TODO: memberService.getMyInfo(memberId)
+// MemberInfoResponse result = MemberInfoResponse.builder()
+// .memberId(memberId)
+// .email("example@email.com")
+// .nickname("닉네임")
+// .completedMissionCount(5)
+// .writtenReviewCount(3)
+// .build();
+// return ResponseEntity.ok(ApiResponse.onSuccess(MemberSuccessCode.MEMBER_FOUND, result));
+// }
+
+ private final MemberService memberService;
+
+ @GetMapping("/mypage")
+ public ApiResponse getMyPage(
+ @Parameter(hidden = true) @LoginMember Long memberId
+ ) {
+ return ApiResponse.onSuccess(
+ MemberSuccessCode.MEMBER_FOUND,
+ memberService.getMyPage(memberId)
+ );
+ }
+}
diff --git a/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/member/converter/MemberConverter.java b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/member/converter/MemberConverter.java
new file mode 100644
index 0000000..113c250
--- /dev/null
+++ b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/member/converter/MemberConverter.java
@@ -0,0 +1,4 @@
+package com.example.umc10th_wony.domain.member.converter;
+
+public class MemberConverter {
+}
diff --git a/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/member/dto/MemberInfoResponse.java b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/member/dto/MemberInfoResponse.java
new file mode 100644
index 0000000..2b21a63
--- /dev/null
+++ b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/member/dto/MemberInfoResponse.java
@@ -0,0 +1,22 @@
+package com.example.umc10th_wony.domain.member.dto;
+
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+
+import java.time.LocalDateTime;
+
+@Getter
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class MemberInfoResponse {
+
+ private Long memberId;
+ private String email;
+ private String nickname;
+ private int completedMissionCount; // 완료한 미션 수
+ private int writtenReviewCount; // 작성한 리뷰 수
+ private LocalDateTime createdAt;
+}
diff --git a/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/member/dto/MemberReqDTO.java b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/member/dto/MemberReqDTO.java
new file mode 100644
index 0000000..d6b6dcb
--- /dev/null
+++ b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/member/dto/MemberReqDTO.java
@@ -0,0 +1,5 @@
+package com.example.umc10th_wony.domain.member.dto;
+
+public class MemberReqDTO {
+
+}
diff --git a/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/member/dto/MemberResDTO.java b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/member/dto/MemberResDTO.java
new file mode 100644
index 0000000..18b5a59
--- /dev/null
+++ b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/member/dto/MemberResDTO.java
@@ -0,0 +1,4 @@
+package com.example.umc10th_wony.domain.member.dto;
+
+public class MemberResDTO {
+}
diff --git a/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/member/dto/MemberSignupRequest.java b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/member/dto/MemberSignupRequest.java
new file mode 100644
index 0000000..692ec8c
--- /dev/null
+++ b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/member/dto/MemberSignupRequest.java
@@ -0,0 +1,29 @@
+package com.example.umc10th_wony.domain.member.dto;
+
+import jakarta.validation.constraints.Email;
+import jakarta.validation.constraints.NotBlank;
+import jakarta.validation.constraints.Pattern;
+import jakarta.validation.constraints.Size;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+
+@Getter
+@NoArgsConstructor
+public class MemberSignupRequest {
+
+ @NotBlank(message = "이메일은 필수입니다.")
+ @Email(message = "올바른 이메일 형식이 아닙니다.")
+ private String email;
+
+ @NotBlank(message = "비밀번호는 필수입니다.")
+ @Size(min = 8, max = 20, message = "비밀번호는 8자 이상 20자 이하여야 합니다.")
+ @Pattern(
+ regexp = "^(?=.*[A-Za-z])(?=.*\\d)(?=.*[@$!%*#?&])[A-Za-z\\d@$!%*#?&]{8,}$",
+ message = "비밀번호는 영문, 숫자, 특수문자를 각각 1개 이상 포함해야 합니다."
+ )
+ private String password;
+
+ @NotBlank(message = "닉네임은 필수입니다.")
+ @Size(min = 2, max = 10, message = "닉네임은 2자 이상 10자 이하여야 합니다.")
+ private String nickname;
+}
\ No newline at end of file
diff --git a/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/member/dto/MemberSignupResponse.java b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/member/dto/MemberSignupResponse.java
new file mode 100644
index 0000000..237e5a3
--- /dev/null
+++ b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/member/dto/MemberSignupResponse.java
@@ -0,0 +1,17 @@
+package com.example.umc10th_wony.domain.member.dto;
+
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+
+@Getter
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class MemberSignupResponse {
+
+ private Long memberId;
+ private String email;
+ private String nickname;
+}
diff --git a/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/member/dto/MyPageResponse.java b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/member/dto/MyPageResponse.java
new file mode 100644
index 0000000..f90ce37
--- /dev/null
+++ b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/member/dto/MyPageResponse.java
@@ -0,0 +1,20 @@
+package com.example.umc10th_wony.domain.member.dto;
+
+import lombok.Builder;
+import lombok.Getter;
+
+@Getter
+@Builder
+public class MyPageResponse {
+
+ private Long memberId;
+ private String nickname;
+ private String email;
+
+ private String phoneNumber;
+ private Boolean isPhoneVerified;
+
+ private Integer point;
+
+ private Long reviewCount;
+}
\ No newline at end of file
diff --git a/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/member/entity/Food.java b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/member/entity/Food.java
new file mode 100644
index 0000000..cd9d34f
--- /dev/null
+++ b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/member/entity/Food.java
@@ -0,0 +1,4 @@
+package com.example.umc10th_wony.domain.member.entity;
+
+public class Food {
+}
diff --git a/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/member/entity/Member.java b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/member/entity/Member.java
new file mode 100644
index 0000000..904db42
--- /dev/null
+++ b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/member/entity/Member.java
@@ -0,0 +1,88 @@
+package com.example.umc10th_wony.domain.member.entity;
+
+import com.example.umc10th_wony.domain.member.enums.Gender;
+import com.example.umc10th_wony.domain.member.enums.SocialType;
+import com.example.umc10th_wony.domain.mission.entity.mapping.MemberMission;
+import com.example.umc10th_wony.domain.review.entity.Review;
+import jakarta.persistence.*;
+import lombok.*;
+
+import java.time.LocalDateTime;
+import java.util.ArrayList;
+import java.util.List;
+
+@Entity
+@Table(name = "member")
+@Getter
+@NoArgsConstructor(access = AccessLevel.PROTECTED)
+@AllArgsConstructor
+@Builder
+public class Member {
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ private Long id;
+
+ @Column(nullable = false, unique = true, length = 100)
+ private String email;
+
+ @Column(nullable = false, length = 50)
+ private String nickname;
+
+ @Column(nullable = true, length = 20)
+ private String phoneNumber;
+
+ @Column(nullable = false)
+ private Boolean isPhoneVerified;
+
+ @Column(nullable = false)
+ private Integer point;
+
+ @Column(nullable = true, length = 100)
+ private String password;
+
+ @Enumerated(EnumType.STRING)
+ @Column(nullable = true)
+ private Gender gender;
+
+ @Enumerated(EnumType.STRING)
+ @Column(nullable = true)
+ private SocialType socialType;
+
+ @Column(nullable = false, updatable = false)
+ private LocalDateTime createdAt;
+
+ @Column(nullable = true)
+ private LocalDateTime updatedAt;
+
+ @Column(nullable = true)
+ private LocalDateTime deletedAt;
+
+ // 내가 수행한 미션들
+ @OneToMany(mappedBy = "member", cascade = CascadeType.ALL, orphanRemoval = true)
+ private List memberMissionList = new ArrayList<>();
+
+ // 내가 작성한 리뷰들
+ @OneToMany(mappedBy = "member", cascade = CascadeType.ALL, orphanRemoval = true)
+ private List reviewList = new ArrayList<>();
+
+ @PrePersist
+ protected void onCreate() {
+ this.createdAt = java.time.LocalDateTime.now();
+ if (this.isPhoneVerified == null) this.isPhoneVerified = false;
+ if (this.point == null) this.point = 0;
+ }
+
+ @PreUpdate
+ protected void onUpdate() {
+ this.updatedAt = LocalDateTime.now();
+ }
+
+// public void addMemberMission(MemberMission memberMission) {
+// this.memberMissionList.add(memberMission);
+// }
+//
+// public void addReview(Review review) {
+// this.reviewList.add(review);
+// }
+}
\ No newline at end of file
diff --git a/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/member/entity/Term.java b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/member/entity/Term.java
new file mode 100644
index 0000000..dd022de
--- /dev/null
+++ b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/member/entity/Term.java
@@ -0,0 +1,4 @@
+package com.example.umc10th_wony.domain.member.entity;
+
+public class Term {
+}
diff --git a/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/member/entity/mapping/MemberFood.java b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/member/entity/mapping/MemberFood.java
new file mode 100644
index 0000000..7c88a47
--- /dev/null
+++ b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/member/entity/mapping/MemberFood.java
@@ -0,0 +1,4 @@
+package com.example.umc10th_wony.domain.member.entity.mapping;
+
+public class MemberFood {
+}
diff --git a/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/member/entity/mapping/MemberTrem.java b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/member/entity/mapping/MemberTrem.java
new file mode 100644
index 0000000..2b5221b
--- /dev/null
+++ b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/member/entity/mapping/MemberTrem.java
@@ -0,0 +1,4 @@
+package com.example.umc10th_wony.domain.member.entity.mapping;
+
+public class MemberTrem {
+}
diff --git a/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/member/enums/Gender.java b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/member/enums/Gender.java
new file mode 100644
index 0000000..420d741
--- /dev/null
+++ b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/member/enums/Gender.java
@@ -0,0 +1,4 @@
+package com.example.umc10th_wony.domain.member.enums;
+
+public enum Gender {
+}
diff --git a/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/member/enums/SocialType.java b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/member/enums/SocialType.java
new file mode 100644
index 0000000..9375157
--- /dev/null
+++ b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/member/enums/SocialType.java
@@ -0,0 +1,4 @@
+package com.example.umc10th_wony.domain.member.enums;
+
+public enum SocialType {
+}
diff --git a/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/member/enums/Term.java b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/member/enums/Term.java
new file mode 100644
index 0000000..a26d950
--- /dev/null
+++ b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/member/enums/Term.java
@@ -0,0 +1,4 @@
+package com.example.umc10th_wony.domain.member.enums;
+
+public enum Term {
+}
diff --git a/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/member/exception/MemberException.java b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/member/exception/MemberException.java
new file mode 100644
index 0000000..893b28d
--- /dev/null
+++ b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/member/exception/MemberException.java
@@ -0,0 +1,11 @@
+package com.example.umc10th_wony.domain.member.exception;
+
+import com.example.umc10th_wony.global.apiPayload.exception.ProjectException;
+import com.example.umc10th_wony.domain.member.exception.code.MemberErrorCode;
+
+public class MemberException extends ProjectException {
+
+ public MemberException(MemberErrorCode errorCode) {
+ super(errorCode);
+ }
+}
\ No newline at end of file
diff --git a/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/member/exception/code/MemberErrorCode.java b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/member/exception/code/MemberErrorCode.java
new file mode 100644
index 0000000..6d71c78
--- /dev/null
+++ b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/member/exception/code/MemberErrorCode.java
@@ -0,0 +1,19 @@
+package com.example.umc10th_wony.domain.member.exception.code;
+
+import com.example.umc10th_wony.global.apiPayload.code.BaseErrorCode;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import org.springframework.http.HttpStatus;
+
+@Getter
+@AllArgsConstructor
+public enum MemberErrorCode implements BaseErrorCode {
+
+ MEMBER_NOT_FOUND(HttpStatus.NOT_FOUND, "MEMBER404_1", "해당 회원을 찾을 수 없습니다."),
+ EMAIL_ALREADY_EXISTS(HttpStatus.CONFLICT, "MEMBER409_1", "이미 사용 중인 이메일입니다."),
+ INVALID_PASSWORD(HttpStatus.UNAUTHORIZED, "MEMBER401_1", "비밀번호가 올바르지 않습니다.");
+
+ private final HttpStatus status;
+ private final String code;
+ private final String message;
+}
\ No newline at end of file
diff --git a/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/member/exception/code/MemberSuccessCode.java b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/member/exception/code/MemberSuccessCode.java
new file mode 100644
index 0000000..d28ec63
--- /dev/null
+++ b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/member/exception/code/MemberSuccessCode.java
@@ -0,0 +1,18 @@
+package com.example.umc10th_wony.domain.member.exception.code;
+
+import com.example.umc10th_wony.global.apiPayload.code.BaseSuccessCode;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import org.springframework.http.HttpStatus;
+
+@Getter
+@AllArgsConstructor
+public enum MemberSuccessCode implements BaseSuccessCode {
+
+ SIGNUP_SUCCESS(HttpStatus.CREATED, "MEMBER201_1", "회원가입에 성공했습니다."),
+ MEMBER_FOUND(HttpStatus.OK, "MEMBER200_1", "성공적으로 유저를 조회했습니다.");
+
+ private final HttpStatus status;
+ private final String code;
+ private final String message;
+}
diff --git a/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/member/repository/MemberRepository.java b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/member/repository/MemberRepository.java
new file mode 100644
index 0000000..f8dbb5d
--- /dev/null
+++ b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/member/repository/MemberRepository.java
@@ -0,0 +1,16 @@
+package com.example.umc10th_wony.domain.member.repository;
+
+import com.example.umc10th_wony.domain.member.entity.Member;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.Query;
+import org.springframework.data.repository.query.Param;
+
+public interface MemberRepository extends JpaRepository {
+
+ @Query("""
+ SELECT COUNT(r)
+ FROM Review r
+ WHERE r.member.id = :memberId
+ """)
+ Long countReviews(@Param("memberId") Long memberId);
+}
diff --git a/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/member/service/MemberService.java b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/member/service/MemberService.java
new file mode 100644
index 0000000..042163c
--- /dev/null
+++ b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/member/service/MemberService.java
@@ -0,0 +1,36 @@
+package com.example.umc10th_wony.domain.member.service;
+
+import com.example.umc10th_wony.domain.member.dto.MyPageResponse;
+import com.example.umc10th_wony.domain.member.entity.Member;
+import com.example.umc10th_wony.domain.member.exception.MemberException;
+import com.example.umc10th_wony.domain.member.exception.code.MemberErrorCode;
+import com.example.umc10th_wony.domain.member.repository.MemberRepository;
+import lombok.RequiredArgsConstructor;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+@Service
+@RequiredArgsConstructor
+public class MemberService {
+
+ private final MemberRepository memberRepository;
+
+ @Transactional(readOnly = true)
+ public MyPageResponse getMyPage(Long memberId) {
+
+ Member member = memberRepository.findById(memberId)
+ .orElseThrow(() -> new MemberException(MemberErrorCode.MEMBER_NOT_FOUND));
+
+ Long reviewCount = memberRepository.countReviews(memberId);
+
+ return MyPageResponse.builder()
+ .memberId(member.getId())
+ .nickname(member.getNickname())
+ .email(member.getEmail())
+ .phoneNumber(member.getPhoneNumber())
+ .isPhoneVerified(member.getIsPhoneVerified())
+ .point(member.getPoint())
+ .reviewCount(reviewCount)
+ .build();
+ }
+}
diff --git a/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/mission/controller/MissionController.java b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/mission/controller/MissionController.java
new file mode 100644
index 0000000..786a2f9
--- /dev/null
+++ b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/mission/controller/MissionController.java
@@ -0,0 +1,143 @@
+package com.example.umc10th_wony.domain.mission.controller;
+
+import com.example.umc10th_wony.domain.mission.dto.*;
+
+import com.example.umc10th_wony.domain.mission.enums.MissionStatus;
+import com.example.umc10th_wony.global.apiPayload.ApiResponse;
+import com.example.umc10th_wony.domain.mission.exception.code.MissionSuccessCode;
+import com.example.umc10th_wony.global.pagination.CursorPageResponse;
+import com.example.umc10th_wony.domain.mission.service.MissionService;
+import com.example.umc10th_wony.global.security.LoginMember;
+
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import jakarta.validation.Valid;
+import lombok.RequiredArgsConstructor;
+import org.springframework.data.domain.Page;
+import org.springframework.data.domain.PageRequest;
+import org.springframework.data.domain.Pageable;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+@Tag(name = "Mission API", description = "미션 관련 API")
+@RestController
+@RequiredArgsConstructor
+@RequestMapping("/api")
+public class MissionController {
+ private final MissionService missionService;
+
+ // 1. 지역별 미션 목록 조회
+ @Operation(summary = "지역별 미션 목록 조회", description = "특정 지역의 미션 목록을 조회합니다.")
+ @GetMapping("/missions")
+ public ResponseEntity>> getMissionsByRegion(
+ @Parameter(description = "지역명 (예: 공릉동)", required = true) @RequestParam String region
+ ) {
+ // TODO: missionService.getMissionsByRegion(region)
+ List result = List.of(MissionResponse.builder()
+ .missionId(1L).missionTitle("공릉동 미션 예시").description("미션 설명")
+ .region(region).reward(1000).status("OPEN").build());
+ return ResponseEntity.ok(ApiResponse.onSuccess(MissionSuccessCode.MISSION_LIST_FOUND, result));
+ }
+
+ // 2. 내 미션 목록 조회
+ @Operation(summary = "내 미션 목록 조회", description = "현재 로그인한 회원이 참여 중인 미션 목록을 반환합니다.")
+ @GetMapping("/missions/me")
+ public ResponseEntity>> getMyMissions(
+ @Parameter(hidden = true) @LoginMember Long memberId
+ ) {
+ // TODO: missionService.getMyMissions(memberId)
+ List result = List.of(MissionResponse.builder()
+ .missionId(2L).missionTitle("내 미션 예시").description("미션 설명")
+ .region("공릉동").reward(500).status("IN_PROGRESS").build());
+ return ResponseEntity.ok(ApiResponse.onSuccess(MissionSuccessCode.MISSION_LIST_FOUND, result));
+ }
+
+ // 3. 미션 완료 처리
+ @Operation(summary = "미션 완료 처리", description = "특정 미션을 완료 처리합니다. JWT에서 회원 ID를 추출합니다.")
+ @PatchMapping("/missions/{missionId}/complete")
+ public ResponseEntity> completeMission(
+ @Parameter(description = "완료할 미션 ID") @PathVariable Long missionId,
+ @Valid @RequestBody MissionCompleteRequest request,
+ @Parameter(hidden = true) @LoginMember Long memberId
+ ) {
+ // TODO: missionService.completeMission(missionId, memberId, request)
+ MissionCompleteResponse result = MissionCompleteResponse.builder()
+ .missionId(missionId).memberId(memberId).status("COMPLETED").rewardPoint(1000).build();
+ return ResponseEntity.ok(ApiResponse.onSuccess(MissionSuccessCode.MISSION_COMPLETED, result));
+ }
+
+ // 4. 리뷰 작성
+ @Operation(summary = "리뷰 작성", description = "완료된 미션에 대해 별점과 텍스트로 리뷰를 작성합니다.")
+ @PostMapping("/reviews")
+ public ResponseEntity> createReview(
+ @Valid @RequestBody ReviewCreateRequest request,
+ @Parameter(hidden = true) @LoginMember Long memberId
+ ) {
+ // TODO: reviewService.createReview(request, memberId)
+ ReviewResponse result = ReviewResponse.builder()
+ .reviewId(1L).missionId(request.getMissionId()).memberId(memberId)
+ .rating(request.getRating()).content(request.getContent()).build();
+ return ResponseEntity.status(201)
+ .body(ApiResponse.onSuccess(MissionSuccessCode.REVIEW_CREATED, result));
+ }
+
+ // 5. 가게 미션 생성
+ @Operation(summary = "가게 미션 생성", description = "특정 가게에 미션을 생성합니다.")
+ @PostMapping("/v1/stores/{storeId}/missions")
+ public ResponseEntity> createMission(
+ @Parameter(description = "가게 ID") @PathVariable Long storeId,
+ @Valid @RequestBody MissionCreateRequest request
+ ) {
+ // TODO: missionService.createMission(storeId, request)
+
+ return ResponseEntity.ok(
+ ApiResponse.onSuccess(MissionSuccessCode.MISSION_CREATED, null)
+ );
+ }
+
+ // 6. 가게 내 미션 조회
+ @Operation(summary = "가게 내 미션 조회", description = "특정 가게의 미션 목록을 조회합니다.")
+ @GetMapping("/v1/stores/{storeId}/missions")
+ public ResponseEntity>> getMissions(
+ @PathVariable Long storeId,
+
+ @RequestParam(required = false)
+ String cursor,
+
+ @RequestParam(defaultValue = "10")
+ Integer size
+ ) {
+
+ return ResponseEntity.ok(
+ ApiResponse.onSuccess(
+ MissionSuccessCode.STORE_MISSION_LIST_FOUND,
+ missionService.getMissions(
+ storeId,
+ cursor,
+ size
+ )
+ )
+ );
+ }
+
+ // 7. 내가 진행 중인 미션 조회
+ @Operation(summary = "내가 진행 중인 미션 조회", description = "내가 진행 중인 미션 목록을 조회합니다.")
+ @GetMapping("/missions/me/in-progress")
+ public ResponseEntity>> getMyInProgressMissions(
+ @Parameter(hidden = true) @LoginMember Long memberId,
+ @RequestParam(defaultValue = "0") int page,
+ @RequestParam(defaultValue = "10") int size
+ ) {
+ Pageable pageable = PageRequest.of(page, size);
+
+ return ResponseEntity.ok(
+ ApiResponse.onSuccess(
+ MissionSuccessCode.MISSION_LIST_FOUND,
+ missionService.getMyMissions(memberId, MissionStatus.IN_PROGRESS, pageable)
+ )
+ );
+ }
+}
diff --git a/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/mission/converter/MissionConverter.java b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/mission/converter/MissionConverter.java
new file mode 100644
index 0000000..f975776
--- /dev/null
+++ b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/mission/converter/MissionConverter.java
@@ -0,0 +1,57 @@
+package com.example.umc10th_wony.domain.mission.converter;
+
+import com.example.umc10th_wony.domain.mission.dto.HomeMissionResponse;
+import com.example.umc10th_wony.domain.mission.dto.MissionCreateRequest;
+import com.example.umc10th_wony.domain.mission.dto.MissionResponse;
+import com.example.umc10th_wony.domain.mission.entity.Mission;
+import com.example.umc10th_wony.domain.mission.entity.Store;
+import com.example.umc10th_wony.domain.mission.entity.mapping.MemberMission;
+
+public class MissionConverter {
+
+ public static MissionResponse toResponse(MemberMission mm) {
+ return MissionResponse.builder()
+ .missionId(mm.getMission().getId())
+ .missionTitle(mm.getMission().getTitle())
+ .reward(mm.getMission().getReward())
+ .build();
+ }
+
+ public static HomeMissionResponse toHomeResponse(Mission mission) {
+ return HomeMissionResponse.builder()
+ .missionId(mission.getId())
+ .missionTitle(mission.getTitle())
+ .reward(mission.getReward())
+ .storeName(mission.getStore().getName())
+ .build();
+ }
+
+ // 가게 미션 생성
+ public static Mission toMission(
+ Store store,
+ MissionCreateRequest dto
+ ) {
+
+ return Mission.builder()
+ .store(store)
+ .title(dto.getMissionTitle())
+ .description(dto.getDescription())
+ .conditional(dto.getConditional())
+ .reward(dto.getReward())
+ .deadline(dto.getDeadline())
+ .build();
+ }
+
+ // 가게 내 미션 조회
+ public static MissionResponse.GetMission toGetMission(
+ Mission mission
+ ) {
+
+ return MissionResponse.GetMission.builder()
+ .missionId(mission.getId())
+ .reward(mission.getReward())
+ .conditional(mission.getConditional())
+ .deadline(mission.getDeadline())
+ .build();
+ }
+}
\ No newline at end of file
diff --git a/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/mission/dto/HomeMissionResponse.java b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/mission/dto/HomeMissionResponse.java
new file mode 100644
index 0000000..603dbba
--- /dev/null
+++ b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/mission/dto/HomeMissionResponse.java
@@ -0,0 +1,14 @@
+package com.example.umc10th_wony.domain.mission.dto;
+
+import lombok.Builder;
+import lombok.Getter;
+
+@Getter
+@Builder
+public class HomeMissionResponse {
+
+ private Long missionId;
+ private String missionTitle;
+ private Integer reward;
+ private String storeName;
+}
diff --git a/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/mission/dto/MissionCompleteRequest.java b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/mission/dto/MissionCompleteRequest.java
new file mode 100644
index 0000000..233228f
--- /dev/null
+++ b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/mission/dto/MissionCompleteRequest.java
@@ -0,0 +1,13 @@
+package com.example.umc10th_wony.domain.mission.dto;
+
+import jakarta.validation.constraints.NotBlank;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+
+@Getter
+@NoArgsConstructor
+public class MissionCompleteRequest {
+
+ @NotBlank(message = "미션 완료 인증 내용은 필수입니다.")
+ private String proof; // 인증 내용 (텍스트 or 이미지 URL 등)
+}
diff --git a/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/mission/dto/MissionCompleteResponse.java b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/mission/dto/MissionCompleteResponse.java
new file mode 100644
index 0000000..93f24dc
--- /dev/null
+++ b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/mission/dto/MissionCompleteResponse.java
@@ -0,0 +1,21 @@
+package com.example.umc10th_wony.domain.mission.dto;
+
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+
+import java.time.LocalDateTime;
+
+@Getter
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class MissionCompleteResponse {
+
+ private Long missionId;
+ private Long memberId;
+ private String status; // COMPLETED
+ private int rewardPoint; // 지급된 보상 포인트
+ private LocalDateTime completedAt;
+}
diff --git a/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/mission/dto/MissionCreateRequest.java b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/mission/dto/MissionCreateRequest.java
new file mode 100644
index 0000000..3cd52d4
--- /dev/null
+++ b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/mission/dto/MissionCreateRequest.java
@@ -0,0 +1,30 @@
+package com.example.umc10th_wony.domain.mission.dto;
+
+import jakarta.validation.constraints.*;
+import lombok.Getter;
+
+import java.time.LocalDate;
+
+@Getter
+public class MissionCreateRequest {
+
+ @NotBlank(message = "미션 제목은 필수입니다.")
+ @Size(max = 30, message = "미션 제목은 30자 이하로 입력해주세요.")
+ private String missionTitle;
+
+ @NotBlank(message = "미션 설명은 필수입니다.")
+ @Size(max = 200, message = "미션 설명은 200자 이하로 입력해주세요.")
+ private String description;
+
+ @NotBlank(message = "미션 조건은 필수입니다.")
+ @Size(max = 100, message = "미션 조건은 100자 이하로 입력해주세요.")
+ private String conditional;
+
+ @NotNull(message = "보상 포인트는 필수입니다.")
+ @Min(value = 0, message = "보상 포인트는 0 이상이어야 합니다.")
+ private Integer reward;
+
+ @NotNull(message = "마감일은 필수입니다.")
+ @Future(message = "마감일은 현재보다 이후 날짜여야 합니다.")
+ private LocalDate deadline;
+}
\ No newline at end of file
diff --git a/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/mission/dto/MissionResponse.java b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/mission/dto/MissionResponse.java
new file mode 100644
index 0000000..737ca9b
--- /dev/null
+++ b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/mission/dto/MissionResponse.java
@@ -0,0 +1,34 @@
+package com.example.umc10th_wony.domain.mission.dto;
+
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+
+@Getter
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class MissionResponse {
+
+ private Long missionId;
+ private String missionTitle;
+ private String description;
+ private String region; // 지역명
+ private int reward; // 보상 포인트
+ private String status; // OPEN / IN_PROGRESS / COMPLETED
+ private LocalDate deadline;
+ private LocalDate createdAt;
+
+ // 가게 내 미션 조회
+ @Builder
+ public record GetMission(
+ Long missionId,
+ Integer reward,
+ String conditional,
+ LocalDate deadline
+ ) {}
+}
diff --git a/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/mission/dto/ReviewCreateRequest.java b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/mission/dto/ReviewCreateRequest.java
new file mode 100644
index 0000000..69ea8a0
--- /dev/null
+++ b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/mission/dto/ReviewCreateRequest.java
@@ -0,0 +1,22 @@
+package com.example.umc10th_wony.domain.mission.dto;
+
+import jakarta.validation.constraints.*;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+
+@Getter
+@NoArgsConstructor
+public class ReviewCreateRequest {
+
+ @NotNull(message = "미션 ID는 필수입니다.")
+ private Long missionId;
+
+ @NotNull(message = "별점은 필수입니다.")
+ @Min(value = 1, message = "별점은 1점 이상이어야 합니다.")
+ @Max(value = 5, message = "별점은 5점 이하여야 합니다.")
+ private Integer rating;
+
+ @NotBlank(message = "리뷰 내용은 필수입니다.")
+ @Size(min = 5, max = 500, message = "리뷰 내용은 5자 이상 500자 이하여야 합니다.")
+ private String content;
+}
diff --git a/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/mission/dto/ReviewResponse.java b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/mission/dto/ReviewResponse.java
new file mode 100644
index 0000000..ae3269a
--- /dev/null
+++ b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/mission/dto/ReviewResponse.java
@@ -0,0 +1,24 @@
+package com.example.umc10th_wony.domain.mission.dto;
+
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+
+import java.time.LocalDateTime;
+
+@Getter
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class ReviewResponse {
+
+ private Long reviewId;
+ private Long missionId;
+ private String missionTitle;
+ private Long memberId;
+ private String memberNickname;
+ private int rating;
+ private String content;
+ private LocalDateTime createdAt;
+}
diff --git a/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/mission/entity/Location.java b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/mission/entity/Location.java
new file mode 100644
index 0000000..a42db21
--- /dev/null
+++ b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/mission/entity/Location.java
@@ -0,0 +1,19 @@
+package com.example.umc10th_wony.domain.mission.entity;
+
+import jakarta.persistence.*;
+import lombok.*;
+
+@Entity
+@Getter
+@NoArgsConstructor(access = AccessLevel.PROTECTED)
+@AllArgsConstructor
+@Builder
+public class Location {
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ private Long id;
+
+ @Column(nullable = false)
+ private String name;
+}
diff --git a/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/mission/entity/Mission.java b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/mission/entity/Mission.java
new file mode 100644
index 0000000..3554fc3
--- /dev/null
+++ b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/mission/entity/Mission.java
@@ -0,0 +1,38 @@
+package com.example.umc10th_wony.domain.mission.entity;
+
+import jakarta.persistence.*;
+import lombok.*;
+
+import java.time.LocalDate;
+
+@Entity
+@Getter
+@NoArgsConstructor(access = AccessLevel.PROTECTED)
+@AllArgsConstructor
+@Builder
+public class Mission {
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ private Long id;
+
+ @Column(nullable = false)
+ private String title;
+
+ @Column(nullable = false)
+ private Integer reward;
+
+ @Column(nullable = false)
+ private String description;
+
+ @Column(nullable = false)
+ private String conditional;
+
+ @Column(nullable = false)
+ private LocalDate deadline;
+
+ // 어떤 가게 미션인지
+ @ManyToOne(fetch = FetchType.LAZY)
+ @JoinColumn(name = "store_id", nullable = false)
+ private Store store;
+}
diff --git a/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/mission/entity/Store.java b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/mission/entity/Store.java
new file mode 100644
index 0000000..9d23dfc
--- /dev/null
+++ b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/mission/entity/Store.java
@@ -0,0 +1,24 @@
+package com.example.umc10th_wony.domain.mission.entity;
+
+import jakarta.persistence.*;
+import lombok.*;
+
+@Entity
+@Getter
+@NoArgsConstructor(access = AccessLevel.PROTECTED)
+@AllArgsConstructor
+@Builder
+public class Store {
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ private Long id;
+
+ @Column(nullable = false)
+ private String name;
+
+ // 가게 위치
+ @ManyToOne(fetch = FetchType.LAZY)
+ @JoinColumn(name = "location_id", nullable = false)
+ private Location location;
+}
diff --git a/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/mission/entity/mapping/MemberMission.java b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/mission/entity/mapping/MemberMission.java
new file mode 100644
index 0000000..7b4ea99
--- /dev/null
+++ b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/mission/entity/mapping/MemberMission.java
@@ -0,0 +1,31 @@
+package com.example.umc10th_wony.domain.mission.entity.mapping;
+
+import com.example.umc10th_wony.domain.member.entity.Member;
+import com.example.umc10th_wony.domain.mission.entity.Mission;
+import com.example.umc10th_wony.domain.mission.enums.MissionStatus;
+import jakarta.persistence.*;
+import lombok.*;
+
+@Entity
+@Getter
+@NoArgsConstructor(access = AccessLevel.PROTECTED)
+@AllArgsConstructor
+@Builder
+public class MemberMission {
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ private Long id;
+
+ @ManyToOne(fetch = FetchType.LAZY)
+ @JoinColumn(name = "member_id", nullable = false)
+ private Member member;
+
+ @ManyToOne(fetch = FetchType.LAZY)
+ @JoinColumn(name = "mission_id", nullable = false)
+ private Mission mission;
+
+ @Enumerated(EnumType.STRING)
+ @Column(nullable = false)
+ private MissionStatus status; // IN_PROGRESS, COMPLETED
+}
diff --git a/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/mission/enums/Address.java b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/mission/enums/Address.java
new file mode 100644
index 0000000..91a8b74
--- /dev/null
+++ b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/mission/enums/Address.java
@@ -0,0 +1,4 @@
+package com.example.umc10th_wony.domain.mission.enums;
+
+public enum Address {
+}
diff --git a/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/mission/enums/MissionStatus.java b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/mission/enums/MissionStatus.java
new file mode 100644
index 0000000..1143986
--- /dev/null
+++ b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/mission/enums/MissionStatus.java
@@ -0,0 +1,6 @@
+package com.example.umc10th_wony.domain.mission.enums;
+
+public enum MissionStatus {
+ IN_PROGRESS,
+ COMPLETED
+}
diff --git a/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/mission/exception/MissionException.java b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/mission/exception/MissionException.java
new file mode 100644
index 0000000..83fa96c
--- /dev/null
+++ b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/mission/exception/MissionException.java
@@ -0,0 +1,11 @@
+package com.example.umc10th_wony.domain.mission.exception;
+
+import com.example.umc10th_wony.domain.mission.exception.code.MissionErrorCode;
+import com.example.umc10th_wony.global.apiPayload.exception.ProjectException;
+
+public class MissionException extends ProjectException {
+
+ public MissionException(MissionErrorCode errorCode) {
+ super(errorCode);
+ }
+}
diff --git a/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/mission/exception/StoreException.java b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/mission/exception/StoreException.java
new file mode 100644
index 0000000..edaa4f8
--- /dev/null
+++ b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/mission/exception/StoreException.java
@@ -0,0 +1,10 @@
+package com.example.umc10th_wony.domain.mission.exception;
+
+import com.example.umc10th_wony.global.apiPayload.code.BaseErrorCode;
+import com.example.umc10th_wony.global.apiPayload.exception.ProjectException;
+
+public class StoreException extends ProjectException {
+ public StoreException(BaseErrorCode code) {
+ super(code);
+ }
+}
diff --git a/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/mission/exception/code/MissionErrorCode.java b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/mission/exception/code/MissionErrorCode.java
new file mode 100644
index 0000000..5c43370
--- /dev/null
+++ b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/mission/exception/code/MissionErrorCode.java
@@ -0,0 +1,19 @@
+package com.example.umc10th_wony.domain.mission.exception.code;
+
+import com.example.umc10th_wony.global.apiPayload.code.BaseErrorCode;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import org.springframework.http.HttpStatus;
+
+@Getter
+@AllArgsConstructor
+public enum MissionErrorCode implements BaseErrorCode {
+
+ MISSION_NOT_FOUND(HttpStatus.NOT_FOUND, "MISSION404_1", "해당 미션을 찾을 수 없습니다."),
+ ALREADY_COMPLETED(HttpStatus.CONFLICT, "MISSION409_1", "이미 완료된 미션입니다."),
+ NOT_PARTICIPATING(HttpStatus.FORBIDDEN, "MISSION403_1", "참여 중인 미션이 아닙니다.");
+
+ private final HttpStatus status;
+ private final String code;
+ private final String message;
+}
diff --git a/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/mission/exception/code/MissionSuccessCode.java b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/mission/exception/code/MissionSuccessCode.java
new file mode 100644
index 0000000..8d1dfb8
--- /dev/null
+++ b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/mission/exception/code/MissionSuccessCode.java
@@ -0,0 +1,23 @@
+package com.example.umc10th_wony.domain.mission.exception.code;
+
+import com.example.umc10th_wony.global.apiPayload.code.BaseSuccessCode;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import org.springframework.http.HttpStatus;
+
+@Getter
+@AllArgsConstructor
+public enum MissionSuccessCode implements BaseSuccessCode {
+
+ MISSION_LIST_FOUND(HttpStatus.OK, "MISSION200_1", "미션 목록 조회에 성공했습니다."),
+ MISSION_COMPLETED(HttpStatus.OK, "MISSION200_2", "미션이 완료 처리되었습니다."),
+ MISSION_CREATED(HttpStatus.OK, "MISSION200_3", "미션 생성에 성공했습니다."),
+
+ STORE_MISSION_LIST_FOUND(HttpStatus.OK, "MISSION200_4", "가게 미션 조회에 성공했습니다."),
+ REVIEW_CREATED(HttpStatus.CREATED, "MISSION201_1", "리뷰 작성에 성공했습니다.");
+
+ private final HttpStatus status;
+ private final String code;
+ private final String message;
+}
+
diff --git a/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/mission/exception/code/StoreErrorCode.java b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/mission/exception/code/StoreErrorCode.java
new file mode 100644
index 0000000..68d4cf4
--- /dev/null
+++ b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/mission/exception/code/StoreErrorCode.java
@@ -0,0 +1,20 @@
+package com.example.umc10th_wony.domain.mission.exception.code;
+
+import com.example.umc10th_wony.global.apiPayload.code.BaseErrorCode;
+import lombok.Getter;
+import lombok.RequiredArgsConstructor;
+import org.springframework.http.HttpStatus;
+
+@Getter
+@RequiredArgsConstructor
+public enum StoreErrorCode implements BaseErrorCode {
+
+ NOT_FOUND(HttpStatus.NOT_FOUND,
+ "STORE404_1",
+ "해당 가게가 존재하지 않습니다."),
+ ;
+
+ private final HttpStatus status;
+ private final String code;
+ private final String message;
+}
diff --git a/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/mission/repository/MemberMissionRepository.java b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/mission/repository/MemberMissionRepository.java
new file mode 100644
index 0000000..bd02b60
--- /dev/null
+++ b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/mission/repository/MemberMissionRepository.java
@@ -0,0 +1,23 @@
+package com.example.umc10th_wony.domain.mission.repository;
+
+import com.example.umc10th_wony.domain.mission.entity.mapping.MemberMission;
+import com.example.umc10th_wony.domain.mission.enums.MissionStatus;
+import org.springframework.data.domain.Page;
+import org.springframework.data.domain.Pageable;
+import org.springframework.data.jpa.repository.*;
+import org.springframework.data.repository.query.Param;
+
+public interface MemberMissionRepository extends JpaRepository {
+ @Query("""
+ SELECT mm
+ FROM MemberMission mm
+ JOIN FETCH mm.mission m
+ WHERE mm.member.id = :memberId
+ AND mm.status = :status
+ """)
+ Page findByMemberAndStatus(
+ @Param("memberId") Long memberId,
+ @Param("status") MissionStatus status,
+ Pageable pageable
+ );
+}
diff --git a/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/mission/repository/MissionRepository.java b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/mission/repository/MissionRepository.java
new file mode 100644
index 0000000..e4c7fdd
--- /dev/null
+++ b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/mission/repository/MissionRepository.java
@@ -0,0 +1,37 @@
+package com.example.umc10th_wony.domain.mission.repository;
+
+import com.example.umc10th_wony.domain.mission.entity.Mission;
+import org.springframework.data.domain.Page;
+import org.springframework.data.domain.Pageable;
+import org.springframework.data.jpa.repository.*;
+import org.springframework.data.repository.query.Param;
+
+import java.util.List;
+
+public interface MissionRepository extends JpaRepository {
+
+ @Query("""
+ SELECT m
+ FROM Mission m
+ JOIN FETCH m.store s
+ JOIN FETCH s.location l
+ WHERE l.id = :locationId
+ """)
+ Page findByLocation(
+ @Param("locationId") Long locationId,
+ Pageable pageable
+ );
+
+ // 첫 조회
+ List findByStore_IdOrderByIdDesc(
+ Long storeId,
+ Pageable pageable
+ );
+
+ // cursor 이후 조회
+ List findByStore_IdAndIdLessThanOrderByIdDesc(
+ Long storeId,
+ Long cursorId,
+ Pageable pageable
+ );
+}
\ No newline at end of file
diff --git a/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/mission/repository/StoreRepository.java b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/mission/repository/StoreRepository.java
new file mode 100644
index 0000000..b74bfee
--- /dev/null
+++ b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/mission/repository/StoreRepository.java
@@ -0,0 +1,8 @@
+package com.example.umc10th_wony.domain.mission.repository;
+
+import com.example.umc10th_wony.domain.mission.entity.Store;
+import org.springframework.data.jpa.repository.JpaRepository;
+
+public interface StoreRepository extends JpaRepository {
+
+}
diff --git a/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/mission/service/MissionService.java b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/mission/service/MissionService.java
new file mode 100644
index 0000000..6400d88
--- /dev/null
+++ b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/mission/service/MissionService.java
@@ -0,0 +1,126 @@
+package com.example.umc10th_wony.domain.mission.service;
+
+import com.example.umc10th_wony.domain.mission.converter.MissionConverter;
+import com.example.umc10th_wony.domain.mission.dto.HomeMissionResponse;
+import com.example.umc10th_wony.domain.mission.dto.MissionCreateRequest;
+import com.example.umc10th_wony.domain.mission.dto.MissionResponse;
+import com.example.umc10th_wony.domain.mission.entity.Mission;
+import com.example.umc10th_wony.domain.mission.entity.Store;
+import com.example.umc10th_wony.domain.mission.entity.mapping.MemberMission;
+import com.example.umc10th_wony.domain.mission.enums.MissionStatus;
+import com.example.umc10th_wony.domain.mission.exception.StoreException;
+import com.example.umc10th_wony.domain.mission.exception.code.StoreErrorCode;
+import com.example.umc10th_wony.domain.mission.repository.MemberMissionRepository;
+import com.example.umc10th_wony.domain.mission.repository.MissionRepository;
+import com.example.umc10th_wony.domain.mission.repository.StoreRepository;
+import com.example.umc10th_wony.global.pagination.CursorPageResponse;
+import lombok.RequiredArgsConstructor;
+import org.springframework.data.domain.Page;
+import org.springframework.data.domain.PageRequest;
+import org.springframework.data.domain.Pageable;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+
+@Service
+@RequiredArgsConstructor
+public class MissionService {
+
+ private final MemberMissionRepository memberMissionRepository;
+ private final MissionRepository missionRepository;
+ private final StoreRepository storeRepository;
+
+ @Transactional
+ public void createMission(Long storeId, MissionCreateRequest request) {
+
+ Store store = storeRepository.findById(storeId)
+ .orElseThrow(() -> new StoreException(StoreErrorCode.NOT_FOUND));
+
+ Mission mission = MissionConverter.toMission(store, request);
+
+ missionRepository.save(mission);
+ }
+
+ @Transactional(readOnly = true)
+ public Page getMyMissions(Long memberId, MissionStatus status, Pageable pageable) {
+
+ Page missions =
+ memberMissionRepository.findByMemberAndStatus(memberId, status, pageable);
+
+ return missions.map(MissionConverter::toResponse);
+ }
+
+ @Transactional(readOnly = true)
+ public Page getHomeMissions(Long locationId, Pageable pageable) {
+
+ Page missions =
+ missionRepository.findByLocation(locationId, pageable);
+
+ return missions.map(MissionConverter::toHomeResponse);
+ }
+
+ // 가게 내 미션 조회(페이지네이션 없음, 주석 처리)
+// @Transactional(readOnly = true)
+// public List getMissions(Long storeId) {
+//
+// List missionList = missionRepository.findAllByStore_Id(storeId);
+//
+// return missionList.stream()
+// .map(MissionConverter::toGetMission)
+// .toList();
+// }
+
+ @Transactional(readOnly = true)
+ public CursorPageResponse getMissions(
+ Long storeId,
+ String cursor,
+ Integer size
+ ) {
+
+ Pageable pageable = PageRequest.of(0, size);
+
+ List missions;
+
+ // 첫 조회
+ if (cursor == null || cursor.isBlank()) {
+
+ missions = missionRepository
+ .findByStore_IdOrderByIdDesc(storeId, pageable);
+
+ } else {
+
+ Long cursorId = Long.parseLong(cursor);
+
+ missions = missionRepository
+ .findByStore_IdAndIdLessThanOrderByIdDesc(
+ storeId,
+ cursorId,
+ pageable
+ );
+ }
+
+ List content =
+ missions.stream()
+ .map(MissionConverter::toGetMission)
+ .toList();
+
+ boolean hasNext = missions.size() == size;
+
+ String nextCursor = null;
+
+ if (!missions.isEmpty()) {
+ nextCursor =
+ String.valueOf(
+ missions.get(missions.size() - 1).getId()
+ );
+ }
+
+ return CursorPageResponse.builder()
+ .content(content)
+ .hasNext(hasNext)
+ .nextCursor(nextCursor)
+ .size(content.size())
+ .build();
+ }
+}
diff --git a/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/review/controller/ReviewController.java b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/review/controller/ReviewController.java
new file mode 100644
index 0000000..5ceb740
--- /dev/null
+++ b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/review/controller/ReviewController.java
@@ -0,0 +1,27 @@
+package com.example.umc10th_wony.domain.review.controller;
+
+import com.example.umc10th_wony.domain.review.dto.ReviewReqDTO;
+import com.example.umc10th_wony.domain.review.dto.ReviewResDTO;
+import com.example.umc10th_wony.domain.review.exception.code.ReviewSuccessCode;
+import com.example.umc10th_wony.global.apiPayload.ApiResponse;
+import com.example.umc10th_wony.domain.review.service.ReviewService;
+import lombok.RequiredArgsConstructor;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequiredArgsConstructor
+@RequestMapping("/reviews")
+public class ReviewController {
+ private final ReviewService reviewService;
+
+ // 리뷰 작성
+ @PostMapping
+ public ApiResponse createReview(@RequestBody ReviewReqDTO request) {
+ return ApiResponse.onSuccess(
+ ReviewSuccessCode.REVIEW_CREATED,
+ reviewService.createReview(request));
+ }
+}
diff --git a/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/review/converter/ReviewConverter.java b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/review/converter/ReviewConverter.java
new file mode 100644
index 0000000..e4675a1
--- /dev/null
+++ b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/review/converter/ReviewConverter.java
@@ -0,0 +1,38 @@
+package com.example.umc10th_wony.domain.review.converter;
+
+import com.example.umc10th_wony.domain.review.dto.ReviewReqDTO;
+import com.example.umc10th_wony.domain.mission.entity.Mission;
+import com.example.umc10th_wony.domain.member.entity.Member;
+import com.example.umc10th_wony.domain.review.dto.ReviewResDTO;
+import com.example.umc10th_wony.domain.review.entity.Review;
+
+public class ReviewConverter {
+
+ public static Review toEntity(ReviewReqDTO dto, Member member, Mission mission) {
+ return Review.builder()
+ .content(dto.getContent())
+ .score(dto.getScore())
+ .member(member)
+ .mission(mission)
+ .build();
+ }
+
+ public static ReviewResDTO toResponse(Review review) {
+ return ReviewResDTO.builder()
+ .reviewId(review.getId())
+ .content(review.getContent())
+ .score(review.getScore())
+ .build();
+ }
+
+ public static ReviewResDTO.MyReviewResponse toMyReviewResponse(Review review) {
+ return ReviewResDTO.MyReviewResponse.builder()
+ .reviewId(review.getId())
+ .missionId(review.getMission().getId())
+ .storeName(review.getMission().getStore().getName())
+ .score(review.getScore())
+ .content(review.getContent())
+ .createdAt(review.getCreatedAt())
+ .build();
+ }
+}
diff --git a/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/review/dto/ReviewReqDTO.java b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/review/dto/ReviewReqDTO.java
new file mode 100644
index 0000000..d198ea2
--- /dev/null
+++ b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/review/dto/ReviewReqDTO.java
@@ -0,0 +1,12 @@
+package com.example.umc10th_wony.domain.review.dto;
+
+import lombok.Getter;
+
+@Getter
+public class ReviewReqDTO {
+
+ private Long memberId;
+ private Long missionId;
+ private String content;
+ private Integer score;
+}
diff --git a/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/review/dto/ReviewResDTO.java b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/review/dto/ReviewResDTO.java
new file mode 100644
index 0000000..827c403
--- /dev/null
+++ b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/review/dto/ReviewResDTO.java
@@ -0,0 +1,25 @@
+package com.example.umc10th_wony.domain.review.dto;
+
+import lombok.Builder;
+import lombok.Getter;
+
+import java.time.LocalDateTime;
+
+@Getter
+@Builder
+public class ReviewResDTO {
+
+ private Long reviewId;
+ private String content;
+ private Integer score;
+
+ @Builder
+ public record MyReviewResponse (
+ Long reviewId,
+ Long missionId,
+ String storeName,
+ Integer score,
+ String content,
+ LocalDateTime createdAt
+ ) {}
+}
diff --git a/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/review/entity/Reply.java b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/review/entity/Reply.java
new file mode 100644
index 0000000..95a25b2
--- /dev/null
+++ b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/review/entity/Reply.java
@@ -0,0 +1,4 @@
+package com.example.umc10th_wony.domain.review.entity;
+
+public class Reply {
+}
diff --git a/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/review/entity/Review.java b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/review/entity/Review.java
new file mode 100644
index 0000000..e4fcc07
--- /dev/null
+++ b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/review/entity/Review.java
@@ -0,0 +1,37 @@
+package com.example.umc10th_wony.domain.review.entity;
+
+import com.example.umc10th_wony.domain.member.entity.Member;
+import com.example.umc10th_wony.domain.mission.entity.Mission;
+import com.example.umc10th_wony.global.entity.BaseEntity;
+import jakarta.persistence.*;
+import lombok.*;
+
+@Entity
+@Getter
+@NoArgsConstructor(access = AccessLevel.PROTECTED)
+@AllArgsConstructor
+@Builder
+public class Review extends BaseEntity {
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ private Long id;
+
+ // 리뷰 내용
+ @Column(nullable = false)
+ private String content;
+
+ // 평점
+ @Column(nullable = false)
+ private Integer score;
+
+ // 작성자
+ @ManyToOne(fetch = FetchType.LAZY)
+ @JoinColumn(name = "member_id", nullable = false)
+ private Member member;
+
+ // 어떤 미션에 대한 리뷰인지
+ @ManyToOne(fetch = FetchType.LAZY)
+ @JoinColumn(name = "mission_id", nullable = false)
+ private Mission mission;
+}
diff --git a/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/review/entity/ReviewPhoto.java b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/review/entity/ReviewPhoto.java
new file mode 100644
index 0000000..470c619
--- /dev/null
+++ b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/review/entity/ReviewPhoto.java
@@ -0,0 +1,4 @@
+package com.example.umc10th_wony.domain.review.entity;
+
+public class ReviewPhoto {
+}
diff --git a/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/review/exception/ReviewException.java b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/review/exception/ReviewException.java
new file mode 100644
index 0000000..922eb0a
--- /dev/null
+++ b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/review/exception/ReviewException.java
@@ -0,0 +1,7 @@
+package com.example.umc10th_wony.domain.review.exception;
+
+public class ReviewException extends RuntimeException {
+ public ReviewException(String message) {
+ super(message);
+ }
+}
diff --git a/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/review/exception/code/ReviewErrorCode.java b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/review/exception/code/ReviewErrorCode.java
new file mode 100644
index 0000000..5e51244
--- /dev/null
+++ b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/review/exception/code/ReviewErrorCode.java
@@ -0,0 +1,4 @@
+package com.example.umc10th_wony.domain.review.exception.code;
+
+public enum ReviewErrorCode {
+}
diff --git a/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/review/exception/code/ReviewSuccessCode.java b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/review/exception/code/ReviewSuccessCode.java
new file mode 100644
index 0000000..2dce077
--- /dev/null
+++ b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/review/exception/code/ReviewSuccessCode.java
@@ -0,0 +1,17 @@
+package com.example.umc10th_wony.domain.review.exception.code;
+
+import com.example.umc10th_wony.global.apiPayload.code.BaseSuccessCode;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import org.springframework.http.HttpStatus;
+
+@Getter
+@AllArgsConstructor
+public enum ReviewSuccessCode implements BaseSuccessCode {
+
+ REVIEW_CREATED(HttpStatus.CREATED, "REVIEW200_1", "리뷰 생성에 성공했습니다.");
+
+ private final HttpStatus status;
+ private final String code;
+ private final String message;
+}
\ No newline at end of file
diff --git a/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/review/repository/ReviewRepository.java b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/review/repository/ReviewRepository.java
new file mode 100644
index 0000000..c95b78f
--- /dev/null
+++ b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/review/repository/ReviewRepository.java
@@ -0,0 +1,49 @@
+package com.example.umc10th_wony.domain.review.repository;
+
+import com.example.umc10th_wony.domain.review.entity.Review;
+import org.springframework.data.domain.Pageable;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.Query;
+import org.springframework.data.repository.query.Param;
+
+import java.util.List;
+
+public interface ReviewRepository extends JpaRepository {
+
+ // ID순 첫 조회
+ List findByMember_IdOrderByIdDesc(
+ Long memberId,
+ Pageable pageable
+ );
+
+ // ID순 커서 조회
+ List findByMember_IdAndIdLessThanOrderByIdDesc(
+ Long memberId,
+ Long cursorId,
+ Pageable pageable
+ );
+
+ // SCORE순 첫 조회
+ List findByMember_IdOrderByScoreDescIdDesc(
+ Long memberId,
+ Pageable pageable
+ );
+
+ // SCORE순 커서 조회
+ @Query("""
+ SELECT r
+ FROM Review r
+ WHERE r.member.id = :memberId
+ AND (
+ r.score < :score
+ OR (r.score = :score AND r.id < :reviewId)
+ )
+ ORDER BY r.score DESC, r.id DESC
+ """)
+ List findByScoreCursor(
+ @Param("memberId") Long memberId,
+ @Param("score") Integer score,
+ @Param("reviewId") Long reviewId,
+ Pageable pageable
+ );
+}
\ No newline at end of file
diff --git a/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/review/service/ReviewService.java b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/review/service/ReviewService.java
new file mode 100644
index 0000000..797ea3f
--- /dev/null
+++ b/umc10th_wony/src/main/java/com/example/umc10th_wony/domain/review/service/ReviewService.java
@@ -0,0 +1,104 @@
+package com.example.umc10th_wony.domain.review.service;
+
+import com.example.umc10th_wony.domain.member.entity.Member;
+import com.example.umc10th_wony.domain.member.exception.MemberException;
+import com.example.umc10th_wony.domain.member.exception.code.MemberErrorCode;
+import com.example.umc10th_wony.domain.member.repository.MemberRepository;
+import com.example.umc10th_wony.domain.mission.entity.Mission;
+import com.example.umc10th_wony.domain.mission.exception.MissionException;
+import com.example.umc10th_wony.domain.mission.exception.code.MissionErrorCode;
+import com.example.umc10th_wony.domain.mission.repository.MissionRepository;
+import com.example.umc10th_wony.domain.review.converter.ReviewConverter;
+import com.example.umc10th_wony.domain.review.dto.ReviewReqDTO;
+import com.example.umc10th_wony.domain.review.dto.ReviewResDTO;
+import com.example.umc10th_wony.domain.review.entity.Review;
+import com.example.umc10th_wony.domain.review.repository.ReviewRepository;
+import com.example.umc10th_wony.global.pagination.CursorPageResponse;
+import org.springframework.transaction.annotation.Transactional;
+import lombok.RequiredArgsConstructor;
+import org.springframework.data.domain.PageRequest;
+import org.springframework.data.domain.Pageable;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+@RequiredArgsConstructor
+public class ReviewService {
+ private final ReviewRepository reviewRepository;
+ private final MemberRepository memberRepository;
+ private final MissionRepository missionRepository;
+
+ @Transactional
+ public ReviewResDTO createReview(ReviewReqDTO request) {
+
+ Member member = memberRepository.findById(request.getMemberId())
+ .orElseThrow(() -> new MemberException(MemberErrorCode.MEMBER_NOT_FOUND));
+
+ Mission mission = missionRepository.findById(request.getMissionId())
+ .orElseThrow(() -> new MissionException(MissionErrorCode.MISSION_NOT_FOUND));
+
+ Review review = ReviewConverter.toEntity(request, member, mission);
+
+ reviewRepository.save(review);
+
+ return ReviewConverter.toResponse(review);
+ }
+
+ @Transactional(readOnly = true)
+ public CursorPageResponse getMyReviews(
+ Long memberId,
+ String sort,
+ String cursor,
+ Integer size
+ ) {
+ Pageable pageable = PageRequest.of(0, size);
+ List reviews;
+
+ if ("SCORE".equalsIgnoreCase(sort)) {
+ if (cursor == null || cursor.isBlank()) {
+ reviews = reviewRepository.findByMember_IdOrderByScoreDescIdDesc(memberId, pageable);
+ } else {
+ String[] cursorParts = cursor.split(":");
+ Integer score = Integer.parseInt(cursorParts[0]);
+ Long reviewId = Long.parseLong(cursorParts[1]);
+
+ reviews = reviewRepository.findByScoreCursor(memberId, score, reviewId, pageable);
+ }
+ } else {
+ if (cursor == null || cursor.isBlank()) {
+ reviews = reviewRepository.findByMember_IdOrderByIdDesc(memberId, pageable);
+ } else {
+ Long cursorId = Long.parseLong(cursor);
+ reviews = reviewRepository.findByMember_IdAndIdLessThanOrderByIdDesc(
+ memberId,
+ cursorId,
+ pageable
+ );
+ }
+ }
+
+ List content = reviews.stream()
+ .map(ReviewConverter::toMyReviewResponse)
+ .toList();
+
+ String nextCursor = null;
+
+ if (!reviews.isEmpty()) {
+ Review last = reviews.get(reviews.size() - 1);
+
+ if ("SCORE".equalsIgnoreCase(sort)) {
+ nextCursor = last.getScore() + ":" + last.getId();
+ } else {
+ nextCursor = String.valueOf(last.getId());
+ }
+ }
+
+ return CursorPageResponse.builder()
+ .content(content)
+ .hasNext(reviews.size() == size)
+ .nextCursor(nextCursor)
+ .size(content.size())
+ .build();
+ }
+}
diff --git a/umc10th_wony/src/main/java/com/example/umc10th_wony/global/apiPayload/ApiResponse.java b/umc10th_wony/src/main/java/com/example/umc10th_wony/global/apiPayload/ApiResponse.java
new file mode 100644
index 0000000..84804c6
--- /dev/null
+++ b/umc10th_wony/src/main/java/com/example/umc10th_wony/global/apiPayload/ApiResponse.java
@@ -0,0 +1,47 @@
+package com.example.umc10th_wony.global.apiPayload;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import com.example.umc10th_wony.global.apiPayload.code.BaseErrorCode;
+import com.example.umc10th_wony.global.apiPayload.code.BaseSuccessCode;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+
+@Getter
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+@JsonPropertyOrder({"isSuccess", "code", "message", "result"})
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class ApiResponse {
+
+ @JsonProperty("isSuccess")
+ private Boolean isSuccess;
+
+ private String code;
+ private String message;
+ private T result;
+
+ // 성공
+ public static ApiResponse onSuccess(BaseSuccessCode successCode, T result) {
+ return ApiResponse.builder()
+ .isSuccess(true)
+ .code(successCode.getCode())
+ .message(successCode.getMessage())
+ .result(result)
+ .build();
+ }
+
+ // 실패
+ public static ApiResponse onFailure(BaseErrorCode errorCode, T result) {
+ return ApiResponse.builder()
+ .isSuccess(false)
+ .code(errorCode.getCode())
+ .message(errorCode.getMessage())
+ .result(result)
+ .build();
+ }
+}
diff --git a/umc10th_wony/src/main/java/com/example/umc10th_wony/global/apiPayload/code/BaseErrorCode.java b/umc10th_wony/src/main/java/com/example/umc10th_wony/global/apiPayload/code/BaseErrorCode.java
new file mode 100644
index 0000000..c0f5674
--- /dev/null
+++ b/umc10th_wony/src/main/java/com/example/umc10th_wony/global/apiPayload/code/BaseErrorCode.java
@@ -0,0 +1,9 @@
+package com.example.umc10th_wony.global.apiPayload.code;
+
+import org.springframework.http.HttpStatus;
+
+public interface BaseErrorCode {
+ HttpStatus getStatus();
+ String getCode();
+ String getMessage();
+}
\ No newline at end of file
diff --git a/umc10th_wony/src/main/java/com/example/umc10th_wony/global/apiPayload/code/BaseSuccessCode.java b/umc10th_wony/src/main/java/com/example/umc10th_wony/global/apiPayload/code/BaseSuccessCode.java
new file mode 100644
index 0000000..dfcee20
--- /dev/null
+++ b/umc10th_wony/src/main/java/com/example/umc10th_wony/global/apiPayload/code/BaseSuccessCode.java
@@ -0,0 +1,9 @@
+package com.example.umc10th_wony.global.apiPayload.code;
+
+import org.springframework.http.HttpStatus;
+
+public interface BaseSuccessCode {
+ HttpStatus getStatus();
+ String getCode();
+ String getMessage();
+}
diff --git a/umc10th_wony/src/main/java/com/example/umc10th_wony/global/apiPayload/code/GeneralErrorCode.java b/umc10th_wony/src/main/java/com/example/umc10th_wony/global/apiPayload/code/GeneralErrorCode.java
new file mode 100644
index 0000000..722ce35
--- /dev/null
+++ b/umc10th_wony/src/main/java/com/example/umc10th_wony/global/apiPayload/code/GeneralErrorCode.java
@@ -0,0 +1,22 @@
+package com.example.umc10th_wony.global.apiPayload.code;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import org.springframework.http.HttpStatus;
+
+@Getter
+@AllArgsConstructor
+public enum GeneralErrorCode implements BaseErrorCode {
+
+ // 공통 에러
+ BAD_REQUEST(HttpStatus.BAD_REQUEST, "COMMON400", "잘못된 요청입니다."),
+ UNAUTHORIZED(HttpStatus.UNAUTHORIZED, "COMMON401", "인증이 필요합니다."),
+ FORBIDDEN(HttpStatus.FORBIDDEN, "COMMON403", "접근 권한이 없습니다."),
+ NOT_FOUND(HttpStatus.NOT_FOUND, "COMMON404", "요청한 리소스를 찾을 수 없습니다."),
+ METHOD_NOT_ALLOWED(HttpStatus.METHOD_NOT_ALLOWED, "COMMON405", "지원하지 않는 HTTP 메서드입니다."),
+ INTERNAL_SERVER_ERROR(HttpStatus.INTERNAL_SERVER_ERROR, "COMMON500", "서버 내부 오류가 발생했습니다.");
+
+ private final HttpStatus status;
+ private final String code;
+ private final String message;
+}
diff --git a/umc10th_wony/src/main/java/com/example/umc10th_wony/global/apiPayload/code/GeneralSuccessCode.java b/umc10th_wony/src/main/java/com/example/umc10th_wony/global/apiPayload/code/GeneralSuccessCode.java
new file mode 100644
index 0000000..05923b3
--- /dev/null
+++ b/umc10th_wony/src/main/java/com/example/umc10th_wony/global/apiPayload/code/GeneralSuccessCode.java
@@ -0,0 +1,17 @@
+package com.example.umc10th_wony.global.apiPayload.code;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import org.springframework.http.HttpStatus;
+
+@Getter
+@AllArgsConstructor
+public enum GeneralSuccessCode implements BaseSuccessCode {
+
+ OK(HttpStatus.OK, "COMMON200", "요청에 성공했습니다."),
+ CREATED(HttpStatus.CREATED, "COMMON201", "리소스가 성공적으로 생성되었습니다.");
+
+ private final HttpStatus status;
+ private final String code;
+ private final String message;
+}
diff --git a/umc10th_wony/src/main/java/com/example/umc10th_wony/global/apiPayload/exception/GeneralExceptionAdvice.java b/umc10th_wony/src/main/java/com/example/umc10th_wony/global/apiPayload/exception/GeneralExceptionAdvice.java
new file mode 100644
index 0000000..20c0f1e
--- /dev/null
+++ b/umc10th_wony/src/main/java/com/example/umc10th_wony/global/apiPayload/exception/GeneralExceptionAdvice.java
@@ -0,0 +1,93 @@
+package com.example.umc10th_wony.global.apiPayload.exception;
+
+import com.example.umc10th_wony.global.apiPayload.ApiResponse;
+import com.example.umc10th_wony.global.apiPayload.code.BaseErrorCode;
+import com.example.umc10th_wony.global.apiPayload.code.GeneralErrorCode;
+
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.HttpRequestMethodNotSupportedException;
+import org.springframework.web.bind.MethodArgumentNotValidException;
+import org.springframework.web.bind.MissingServletRequestParameterException;
+import org.springframework.web.bind.annotation.ExceptionHandler;
+import org.springframework.web.bind.annotation.RestControllerAdvice;
+import org.springframework.web.servlet.NoHandlerFoundException;
+
+import java.util.HashMap;
+import java.util.Map;
+
+@RestControllerAdvice
+public class GeneralExceptionAdvice {
+
+ // 프로젝트에서 직접 던진 예외 (도메인 Exception 포함)
+ @ExceptionHandler(ProjectException.class)
+ public ResponseEntity> handleProjectException(ProjectException e) {
+ BaseErrorCode errorCode = e.getErrorCode();
+ return ResponseEntity.status(errorCode.getStatus())
+ .body(ApiResponse.onFailure(errorCode, null));
+ }
+
+ // @Valid 검증 실패
+// @ExceptionHandler(MethodArgumentNotValidException.class)
+// public ResponseEntity> handleValidException(MethodArgumentNotValidException e) {
+// String errorMessage = e.getBindingResult().getAllErrors().get(0).getDefaultMessage();
+// BaseErrorCode code = GeneralErrorCode.BAD_REQUEST;
+// return ResponseEntity.status(code.getStatus())
+// .body(ApiResponse.onFailure(code, errorMessage));
+// }
+
+ // @Valid 검증 실패 예외 처리
+ @ExceptionHandler(MethodArgumentNotValidException.class)
+ public ResponseEntity>> handleMethodArgumentNotValidException(
+ MethodArgumentNotValidException e
+ ) {
+
+ Map errors = new HashMap<>();
+
+ e.getBindingResult()
+ .getFieldErrors()
+ .forEach(error -> {
+ errors.put(
+ error.getField(),
+ error.getDefaultMessage()
+ );
+ });
+
+ BaseErrorCode code = GeneralErrorCode.BAD_REQUEST;
+
+ return ResponseEntity
+ .status(code.getStatus())
+ .body(ApiResponse.onFailure(code, errors));
+ }
+
+ // 필수 Query Parameter 누락
+ @ExceptionHandler(MissingServletRequestParameterException.class)
+ public ResponseEntity> handleMissingParam(MissingServletRequestParameterException e) {
+ BaseErrorCode code = GeneralErrorCode.BAD_REQUEST;
+ return ResponseEntity.status(code.getStatus())
+ .body(ApiResponse.onFailure(code, e.getMessage()));
+ }
+
+ // 존재하지 않는 URI
+ @ExceptionHandler(NoHandlerFoundException.class)
+ public ResponseEntity> handleNoHandler(NoHandlerFoundException e) {
+ BaseErrorCode code = GeneralErrorCode.NOT_FOUND;
+ return ResponseEntity.status(code.getStatus())
+ .body(ApiResponse.onFailure(code, null));
+ }
+
+ // 지원하지 않는 HTTP 메서드
+ @ExceptionHandler(HttpRequestMethodNotSupportedException.class)
+ public ResponseEntity> handleMethodNotSupported(HttpRequestMethodNotSupportedException e) {
+ BaseErrorCode code = GeneralErrorCode.METHOD_NOT_ALLOWED;
+ return ResponseEntity.status(code.getStatus())
+ .body(ApiResponse.onFailure(code, null));
+ }
+
+ // 그 외 정의되지 않은 모든 예외
+ @ExceptionHandler(Exception.class)
+ public ResponseEntity> handleException(Exception e) {
+ BaseErrorCode code = GeneralErrorCode.INTERNAL_SERVER_ERROR;
+ return ResponseEntity.status(code.getStatus())
+ .body(ApiResponse.onFailure(code, e.getMessage()));
+ }
+}
diff --git a/umc10th_wony/src/main/java/com/example/umc10th_wony/global/apiPayload/exception/ProjectException.java b/umc10th_wony/src/main/java/com/example/umc10th_wony/global/apiPayload/exception/ProjectException.java
new file mode 100644
index 0000000..8000744
--- /dev/null
+++ b/umc10th_wony/src/main/java/com/example/umc10th_wony/global/apiPayload/exception/ProjectException.java
@@ -0,0 +1,15 @@
+package com.example.umc10th_wony.global.apiPayload.exception;
+
+import com.example.umc10th_wony.global.apiPayload.code.BaseErrorCode;
+import lombok.Getter;
+
+@Getter
+public class ProjectException extends RuntimeException {
+
+ private final BaseErrorCode errorCode;
+
+ public ProjectException(BaseErrorCode errorCode) {
+ super(errorCode.getMessage());
+ this.errorCode = errorCode;
+ }
+}
\ No newline at end of file
diff --git a/umc10th_wony/src/main/java/com/example/umc10th_wony/global/config/SecurityConfig.java b/umc10th_wony/src/main/java/com/example/umc10th_wony/global/config/SecurityConfig.java
new file mode 100644
index 0000000..319f408
--- /dev/null
+++ b/umc10th_wony/src/main/java/com/example/umc10th_wony/global/config/SecurityConfig.java
@@ -0,0 +1,25 @@
+package com.example.umc10th_wony.global.config;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.security.config.annotation.web.builders.HttpSecurity;
+import org.springframework.security.web.SecurityFilterChain;
+
+@Configuration
+public class SecurityConfig {
+
+ @Bean
+ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
+ http
+ .csrf(csrf -> csrf.disable())
+ .authorizeHttpRequests(auth -> auth
+ .requestMatchers(
+ "/swagger-ui/**",
+ "/v3/api-docs/**"
+ ).permitAll()
+ .anyRequest().authenticated()
+ );
+
+ return http.build();
+ }
+}
diff --git a/umc10th_wony/src/main/java/com/example/umc10th_wony/global/config/SwaggerConfig.java b/umc10th_wony/src/main/java/com/example/umc10th_wony/global/config/SwaggerConfig.java
new file mode 100644
index 0000000..4984c39
--- /dev/null
+++ b/umc10th_wony/src/main/java/com/example/umc10th_wony/global/config/SwaggerConfig.java
@@ -0,0 +1,36 @@
+package com.example.umc10th_wony.global.config;
+
+import io.swagger.v3.oas.models.Components;
+import io.swagger.v3.oas.models.OpenAPI;
+import io.swagger.v3.oas.models.info.Info;
+import io.swagger.v3.oas.models.security.SecurityRequirement;
+import io.swagger.v3.oas.models.security.SecurityScheme;
+import io.swagger.v3.oas.models.servers.Server;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+@Configuration
+public class SwaggerConfig {
+
+ @Bean
+ public OpenAPI swagger() {
+ Info info = new Info().title("UMC10th").description("10기 Swagger").version("0.0.1");
+
+ // JWT 토큰 헤더 방식
+ String securityScheme = "JWT TOKEN";
+ SecurityRequirement securityRequirement = new SecurityRequirement().addList(securityScheme);
+
+ Components components = new Components()
+ .addSecuritySchemes(securityScheme, new SecurityScheme()
+ .name(securityScheme)
+ .type(SecurityScheme.Type.HTTP)
+ .scheme("Bearer")
+ .bearerFormat("JWT"));
+
+ return new OpenAPI()
+ .info(info)
+ .addServersItem(new Server().url("/"))
+ .addSecurityItem(securityRequirement)
+ .components(components);
+ }
+}
\ No newline at end of file
diff --git a/umc10th_wony/src/main/java/com/example/umc10th_wony/global/entity/BaseEntity.java b/umc10th_wony/src/main/java/com/example/umc10th_wony/global/entity/BaseEntity.java
new file mode 100644
index 0000000..d259b77
--- /dev/null
+++ b/umc10th_wony/src/main/java/com/example/umc10th_wony/global/entity/BaseEntity.java
@@ -0,0 +1,24 @@
+package com.example.umc10th_wony.global.entity;
+
+import jakarta.persistence.Column;
+import jakarta.persistence.EntityListeners;
+import jakarta.persistence.MappedSuperclass;
+import lombok.Getter;
+import org.springframework.data.annotation.CreatedDate;
+import org.springframework.data.annotation.LastModifiedDate;
+import org.springframework.data.jpa.domain.support.AuditingEntityListener;
+
+import java.time.LocalDateTime;
+
+@Getter
+@MappedSuperclass
+@EntityListeners(AuditingEntityListener.class)
+public abstract class BaseEntity {
+
+ @CreatedDate
+ @Column(updatable = false)
+ private LocalDateTime createdAt;
+
+ @LastModifiedDate
+ private LocalDateTime updatedAt;
+}
diff --git a/umc10th_wony/src/main/java/com/example/umc10th_wony/global/pagination/CursorPageResponse.java b/umc10th_wony/src/main/java/com/example/umc10th_wony/global/pagination/CursorPageResponse.java
new file mode 100644
index 0000000..8824fcb
--- /dev/null
+++ b/umc10th_wony/src/main/java/com/example/umc10th_wony/global/pagination/CursorPageResponse.java
@@ -0,0 +1,22 @@
+package com.example.umc10th_wony.global.pagination;
+
+import lombok.Builder;
+import lombok.Getter;
+
+import java.util.List;
+
+@Getter
+@Builder
+public class CursorPageResponse {
+
+ private List content;
+
+ // 다음 페이지 존재 여부
+ private Boolean hasNext;
+
+ // 다음 요청 때 사용할 cursor
+ private String nextCursor;
+
+ // 현재 데이터 개수
+ private Integer size;
+}
diff --git a/umc10th_wony/src/main/java/com/example/umc10th_wony/global/security/LoginMember.java b/umc10th_wony/src/main/java/com/example/umc10th_wony/global/security/LoginMember.java
new file mode 100644
index 0000000..7b7a4ca
--- /dev/null
+++ b/umc10th_wony/src/main/java/com/example/umc10th_wony/global/security/LoginMember.java
@@ -0,0 +1,16 @@
+package com.example.umc10th_wony.global.security;
+
+import org.springframework.security.core.annotation.AuthenticationPrincipal;
+
+import java.lang.annotation.*;
+
+/**
+ * 컨트롤러 파라미터에서 JWT로부터 추출한 현재 로그인 회원 ID를 주입받기 위한 커스텀 어노테이션
+ * 사용 예시: public ResponseEntity> myMethod(@LoginMember Long memberId)
+ */
+@Target(ElementType.PARAMETER)
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+@AuthenticationPrincipal(expression = "#this == 'anonymousUser' ? null : memberId")
+public @interface LoginMember {
+}
diff --git a/umc10th_wony/src/main/resources/application.properties b/umc10th_wony/src/main/resources/application.properties
new file mode 100644
index 0000000..45603bb
--- /dev/null
+++ b/umc10th_wony/src/main/resources/application.properties
@@ -0,0 +1 @@
+spring.application.name=umc10th_wony
diff --git a/umc10th_wony/src/main/resources/application.yml b/umc10th_wony/src/main/resources/application.yml
new file mode 100644
index 0000000..c77f22c
--- /dev/null
+++ b/umc10th_wony/src/main/resources/application.yml
@@ -0,0 +1,19 @@
+spring:
+ application:
+ name: "umc10th_wony" # "umc10th"
+
+ datasource:
+ driver-class-name: com.mysql.cj.jdbc.Driver # MySQL JDBC 드라이버 클래스 이름
+ url: ${DB_URL} # jdbc:mysql://localhost:3306/{데이터베이스명}
+ username: ${DB_USER} # MySQL 유저 이름
+ password: ${DB_PW} # MySQL 비밀번호
+
+ jpa:
+ database: mysql # 사용할 데이터베이스 유형 지정 (MySQL)
+ database-platform: org.hibernate.dialect.MySQLDialect # Hibernate에서 사용할 MySQL 방언(dialect) 설정
+ show-sql: true # 실행된 SQL 쿼리를 콘솔에 출력할지 여부 설정
+ hibernate:
+ ddl-auto: update # 애플리케이션 실행 시 데이터베이스 스키마의 상태를 설정
+ properties:
+ hibernate:
+ format_sql: true # 출력되는 SQL 쿼리를 보기 좋게 포맷팅spring:
\ No newline at end of file
diff --git a/umc10th_wony/src/test/java/com/example/umc10th_wony/Umc10thWonyApplicationTests.java b/umc10th_wony/src/test/java/com/example/umc10th_wony/Umc10thWonyApplicationTests.java
new file mode 100644
index 0000000..6e2d26d
--- /dev/null
+++ b/umc10th_wony/src/test/java/com/example/umc10th_wony/Umc10thWonyApplicationTests.java
@@ -0,0 +1,13 @@
+package com.example.umc10th_wony;
+
+import org.junit.jupiter.api.Test;
+import org.springframework.boot.test.context.SpringBootTest;
+
+@SpringBootTest
+class Umc10thWonyApplicationTests {
+
+ @Test
+ void contextLoads() {
+ }
+
+}