diff --git a/.gitignore b/.gitignore index 496ee2c..9ea60f3 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,41 @@ -.DS_Store \ No newline at end of file +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/ + +### 보안처리 ### +.env +application.yml \ No newline at end of file diff --git a/jingjing2/.gitattributes b/jingjing2/.gitattributes new file mode 100644 index 0000000..8af972c --- /dev/null +++ b/jingjing2/.gitattributes @@ -0,0 +1,3 @@ +/gradlew text eol=lf +*.bat text eol=crlf +*.jar binary diff --git a/jingjing2/.gitignore b/jingjing2/.gitignore index e69de29..9ea60f3 100644 --- a/jingjing2/.gitignore +++ b/jingjing2/.gitignore @@ -0,0 +1,41 @@ +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/ + +### 보안처리 ### +.env +application.yml \ No newline at end of file diff --git a/jingjing2/build.gradle b/jingjing2/build.gradle new file mode 100644 index 0000000..1efb1ce --- /dev/null +++ b/jingjing2/build.gradle @@ -0,0 +1,39 @@ +plugins { + id 'java' + id 'org.springframework.boot' version '4.0.5' + id 'io.spring.dependency-management' version '1.1.7' +} + +group = 'com.UmcSpringStudy' +version = '0.0.1-SNAPSHOT' + +java { + toolchain { + languageVersion = JavaLanguageVersion.of(21) + } +} + +repositories { + mavenCentral() +} + +dependencies { + // Web & DevTools + implementation 'org.springframework.boot:spring-boot-starter-web' + developmentOnly 'org.springframework.boot:spring-boot-devtools' + // JPA & MySQL + implementation 'org.springframework.boot:spring-boot-starter-data-jpa' + runtimeOnly 'com.mysql:mysql-connector-j' + // Swagger (Springdoc OpenAPI) + implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.8.5' + // Test + testImplementation 'org.springframework.boot:spring-boot-starter-test' + testRuntimeOnly 'org.junit.platform:junit-platform-launcher' + // Lombok + compileOnly 'org.projectlombok:lombok' + annotationProcessor 'org.projectlombok:lombok' +} + +tasks.named('test') { + useJUnitPlatform() +} diff --git a/jingjing2/gradle/wrapper/gradle-wrapper.jar b/jingjing2/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..d997cfc Binary files /dev/null and b/jingjing2/gradle/wrapper/gradle-wrapper.jar differ diff --git a/jingjing2/gradle/wrapper/gradle-wrapper.properties b/jingjing2/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..c61a118 --- /dev/null +++ b/jingjing2/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/jingjing2/gradlew b/jingjing2/gradlew new file mode 100644 index 0000000..739907d --- /dev/null +++ b/jingjing2/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/jingjing2/gradlew.bat b/jingjing2/gradlew.bat new file mode 100644 index 0000000..c4bdd3a --- /dev/null +++ b/jingjing2/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/jingjing2/settings.gradle b/jingjing2/settings.gradle new file mode 100644 index 0000000..7e212c6 --- /dev/null +++ b/jingjing2/settings.gradle @@ -0,0 +1 @@ +rootProject.name = 'jingjing2' diff --git a/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/Jingjing2Application.java b/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/Jingjing2Application.java new file mode 100644 index 0000000..1e429e5 --- /dev/null +++ b/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/Jingjing2Application.java @@ -0,0 +1,13 @@ +package com.UmcSpringStudy.jingjing2; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class Jingjing2Application { + + public static void main(String[] args) { + SpringApplication.run(Jingjing2Application.class, args); + } + +} diff --git a/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/mission/controller/MissionController.java b/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/mission/controller/MissionController.java new file mode 100644 index 0000000..b41e197 --- /dev/null +++ b/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/mission/controller/MissionController.java @@ -0,0 +1,19 @@ +package com.UmcSpringStudy.jingjing2.domain.mission.controller; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/api/missions") +public class MissionController { + + // 전체 미션 목록 조회 + + // 특정 미션 상세 조회 + + // 신규 미션 생성 + + // 미션 수정 + + // 미션 삭제 +} \ No newline at end of file diff --git a/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/mission/entity/Mission.java b/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/mission/entity/Mission.java new file mode 100644 index 0000000..371e328 --- /dev/null +++ b/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/mission/entity/Mission.java @@ -0,0 +1,17 @@ +package com.UmcSpringStudy.jingjing2.domain.mission.entity; + +import jakarta.persistence.*; +import java.time.LocalDate; +@lombok.Data +@Entity +public class Mission { + @Id @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long msid; + + private String msname; + private String context; + private Double msrate; + private Integer taskCount; + private String reward; + private LocalDate expDate; +} \ No newline at end of file diff --git a/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/mission/repository/MissionRepository.java b/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/mission/repository/MissionRepository.java new file mode 100644 index 0000000..2bb29bc --- /dev/null +++ b/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/mission/repository/MissionRepository.java @@ -0,0 +1,12 @@ +package com.UmcSpringStudy.jingjing2.domain.mission.repository; + +import com.UmcSpringStudy.jingjing2.domain.mission.entity.Mission; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.stereotype.Repository; +import java.util.List; + +@Repository +public interface MissionRepository extends JpaRepository { + // 특정 가게의 미션 목록 조회 + List findAllByStoreStid(Long stid); +} \ No newline at end of file diff --git a/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/review/controller/ReviewController.java b/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/review/controller/ReviewController.java new file mode 100644 index 0000000..563415a --- /dev/null +++ b/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/review/controller/ReviewController.java @@ -0,0 +1,26 @@ +package com.UmcSpringStudy.jingjing2.domain.review.controller; + +import org.springframework.web.bind.annotation.*; + +@RestController +@RequestMapping("/api/reviews") +public class ReviewController { + + // 신규 리뷰 작성 (본문 및 첨부파일 관리 로직 포함) + + // 리뷰 상세 조회 (본문, 이미지, 댓글 목록 통합) + + // 리뷰 수정 + + // 리뷰 삭제 + + /* --- 리뷰 댓글 (SR_review) 및 대댓글 관리 --- */ + + // 특정 리뷰에 댓글 작성 + + // 특정 댓글 수정 + + // 특정 댓글 수정 + + // 특정 댓글 삭제 +} \ No newline at end of file diff --git a/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/review/entity/ReviewComment.java b/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/review/entity/ReviewComment.java new file mode 100644 index 0000000..75c19ec --- /dev/null +++ b/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/review/entity/ReviewComment.java @@ -0,0 +1,18 @@ +package com.UmcSpringStudy.jingjing2.domain.review.entity; + +import jakarta.persistence.*; + +import java.time.LocalDate; +@lombok.Data +@Entity +public class ReviewComment { + @Id @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long smrid; + + private String context; + private LocalDate date; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "srid") + private StoreReview review; +} diff --git a/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/review/entity/StoreReview.java b/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/review/entity/StoreReview.java new file mode 100644 index 0000000..921a609 --- /dev/null +++ b/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/review/entity/StoreReview.java @@ -0,0 +1,26 @@ +package com.UmcSpringStudy.jingjing2.domain.review.entity; + +import com.UmcSpringStudy.jingjing2.domain.store.entity.Store; +import com.UmcSpringStudy.jingjing2.domain.user.entity.User; +import jakarta.persistence.*; +import java.time.LocalDate; +@lombok.Data +@Entity +public class StoreReview { + @Id @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long srid; + + private String title; + private String context; + private Double rate; + private Integer popularity; + private LocalDate createdDate; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "uid") + private User user; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "stid") + private Store store; +} diff --git a/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/review/repository/ReviewCommentRepository.java b/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/review/repository/ReviewCommentRepository.java new file mode 100644 index 0000000..f412723 --- /dev/null +++ b/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/review/repository/ReviewCommentRepository.java @@ -0,0 +1,12 @@ +package com.UmcSpringStudy.jingjing2.domain.review.repository; + +import com.UmcSpringStudy.jingjing2.domain.review.entity.ReviewComment; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.stereotype.Repository; +import java.util.List; + +@Repository +public interface ReviewCommentRepository extends JpaRepository { + // 특정 리뷰에 달린 댓글(답글) 조회 + List findAllByStoreReviewSrid(Long srid); +} \ No newline at end of file diff --git a/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/review/repository/StoreReviewRepository.java b/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/review/repository/StoreReviewRepository.java new file mode 100644 index 0000000..e6dd01c --- /dev/null +++ b/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/review/repository/StoreReviewRepository.java @@ -0,0 +1,15 @@ +package com.UmcSpringStudy.jingjing2.domain.review.repository; + +import com.UmcSpringStudy.jingjing2.domain.review.entity.StoreReview; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.stereotype.Repository; +import java.util.List; + +@Repository +public interface StoreReviewRepository extends JpaRepository { + // 특정 가게의 리뷰 목록 조회 + List findAllByStoreStid(Long stid); + + // 특정 유저가 작성한 리뷰 목록 조회 + List findAllByUserUid(Long uid); +} \ No newline at end of file diff --git a/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/store/controller/StoreController.java b/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/store/controller/StoreController.java new file mode 100644 index 0000000..c355ed6 --- /dev/null +++ b/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/store/controller/StoreController.java @@ -0,0 +1,23 @@ +package com.UmcSpringStudy.jingjing2.domain.store.controller; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.*; + +@RestController +@RequestMapping("/api/stores") +public class StoreController { + + // 가게 목록 조회 (카테고리 필터링 포함) + + // 가게 상세 정보 조회 + + // 특정 가게의 리뷰 목록 조회 (연관 데이터 브릿지 역할) + + // 특정 가게의 미션 목록 조회 (연관 데이터 브릿지 역할) + + // 가게 등록 + + // 가게 수정 + + // 가게 삭제 +} \ No newline at end of file diff --git a/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/store/entity/Store.java b/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/store/entity/Store.java new file mode 100644 index 0000000..43383b4 --- /dev/null +++ b/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/store/entity/Store.java @@ -0,0 +1,16 @@ +package com.UmcSpringStudy.jingjing2.domain.store.entity; + +import jakarta.persistence.*; +import java.math.BigDecimal; +@lombok.Data +@Entity +public class Store { + @Id @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long stid; + + private String name; + private BigDecimal lat; + private BigDecimal lng; + private Double rate; + private String category; +} \ No newline at end of file diff --git a/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/store/entity/StoreImage.java b/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/store/entity/StoreImage.java new file mode 100644 index 0000000..db6b297 --- /dev/null +++ b/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/store/entity/StoreImage.java @@ -0,0 +1,26 @@ +package com.UmcSpringStudy.jingjing2.domain.store.entity; + +import jakarta.persistence.*; +import lombok.*; + +@Entity +@Table(name = "Store_Image") +@Getter +@Setter +@Builder +@NoArgsConstructor(access = AccessLevel.PROTECTED) +@AllArgsConstructor +public class StoreImage { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "siid") + private Long siid; + + @Column(name = "file_url", nullable = false, length = 255) + private String fileUrl; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "stid") + private Store store; +} \ No newline at end of file diff --git a/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/store/repository/StoreImageRepository.java b/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/store/repository/StoreImageRepository.java new file mode 100644 index 0000000..1bf4c8b --- /dev/null +++ b/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/store/repository/StoreImageRepository.java @@ -0,0 +1,12 @@ +package com.UmcSpringStudy.jingjing2.domain.store.repository; + +import com.UmcSpringStudy.jingjing2.domain.store.entity.StoreImage; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.stereotype.Repository; +import java.util.List; + +@Repository +public interface StoreImageRepository extends JpaRepository { + // 특정 가게의 모든 이미지 조회 + List findAllByStoreStid(Long stid); +} \ No newline at end of file diff --git a/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/store/repository/StoreRepository.java b/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/store/repository/StoreRepository.java new file mode 100644 index 0000000..f066586 --- /dev/null +++ b/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/store/repository/StoreRepository.java @@ -0,0 +1,15 @@ +package com.UmcSpringStudy.jingjing2.domain.store.repository; + +import com.UmcSpringStudy.jingjing2.domain.store.entity.Store; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.stereotype.Repository; +import java.util.List; + +@Repository +public interface StoreRepository extends JpaRepository { + // 카테고리별 가게 검색 + List findAllByCategory(String category); + + // 지역별 가게 검색 + List findAllByRegion(String region); +} \ No newline at end of file diff --git a/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/user/controller/UserController.java b/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/user/controller/UserController.java new file mode 100644 index 0000000..2dd320a --- /dev/null +++ b/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/user/controller/UserController.java @@ -0,0 +1,27 @@ +package com.UmcSpringStudy.jingjing2.domain.user.controller; + +import org.springframework.web.bind.annotation.*; + +@RestController +@RequestMapping("/api/users") +public class UserController { + //로컬 로그인 + //회원가입 + //특정 유저 정보 출력 + //특정 유저 정보 수정 + //특정 유저 탈퇴 + //특정 유저 포인트 입출금 내역 출력(페이징 포함) + //특정 유저 포인트 입출금 내역 추가 + //특정 유저 포인트 입출금 내역 수정 + //특정 유저 포인트 입출금 내역 삭제 + //특정 유저 약관, 개인설정 출력 + //특정 유저 약관, 개인설정 설정 + //특정 유저 진행중인 미션 출력 + //특정 유저 진행중인 미션 추가 + //특정 유저 진행중인 미션 수정 + //특정 유저 진행중인 미션 삭제 + //특정 유저 문의 내역 출력 + //특정 유저 문의 내역 수정 + //특정 유저 문의 내역 삭제 + +} \ No newline at end of file diff --git a/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/user/entity/Autorication.java b/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/user/entity/Autorication.java new file mode 100644 index 0000000..0f7f2dd --- /dev/null +++ b/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/user/entity/Autorication.java @@ -0,0 +1,22 @@ +package com.UmcSpringStudy.jingjing2.domain.user.entity; + +import jakarta.persistence.*; +import lombok.*; + +@Entity +@Getter +@Setter +@NoArgsConstructor(access = AccessLevel.PROTECTED) +public class Autorication { + + @Id + private Long uid; + + @OneToOne(fetch = FetchType.LAZY) + @MapsId + @JoinColumn(name = "uid") + private User user; + + private Boolean adAllow; + private Boolean locAllow; +} \ No newline at end of file diff --git a/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/user/entity/IQFile.java b/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/user/entity/IQFile.java new file mode 100644 index 0000000..7f090d2 --- /dev/null +++ b/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/user/entity/IQFile.java @@ -0,0 +1,23 @@ +package com.UmcSpringStudy.jingjing2.domain.user.entity; + +import jakarta.persistence.*; +import lombok.*; + +@Entity +@Table(name = "IQ_File") +@Getter +@Setter +@NoArgsConstructor(access = AccessLevel.PROTECTED) +public class IQFile { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long iqfid; + + @Column(length = 255) + private String fileUrl; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "iqid") + private Inquiry inquiry; +} \ No newline at end of file diff --git a/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/user/entity/Inquiry.java b/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/user/entity/Inquiry.java new file mode 100644 index 0000000..708883c --- /dev/null +++ b/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/user/entity/Inquiry.java @@ -0,0 +1,36 @@ +package com.UmcSpringStudy.jingjing2.domain.user.entity; + +import jakarta.persistence.*; +import lombok.*; +import java.util.ArrayList; +import java.util.List; + +@Entity +@Getter +@Setter +@NoArgsConstructor(access = AccessLevel.PROTECTED) +public class Inquiry { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long iqid; + + @Column(length = 30) + private String title; + + @Column(length = 1000) + private String context; + + @Column(length = 10) + private String category; + + @Column(length = 1000) + private String response; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "uid") + private User user; + + @OneToMany(mappedBy = "inquiry", cascade = CascadeType.ALL) + private List iqFiles = new ArrayList<>(); +} \ No newline at end of file diff --git a/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/user/entity/Interest.java b/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/user/entity/Interest.java new file mode 100644 index 0000000..533a638 --- /dev/null +++ b/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/user/entity/Interest.java @@ -0,0 +1,18 @@ +package com.UmcSpringStudy.jingjing2.domain.user.entity; + +import jakarta.persistence.*; +import lombok.*; + +@Entity +@Getter +@Setter +@NoArgsConstructor(access = AccessLevel.PROTECTED) +public class Interest { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long itid; + + @Column(columnDefinition = "TEXT") + private String context; +} \ No newline at end of file diff --git a/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/user/entity/Setting.java b/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/user/entity/Setting.java new file mode 100644 index 0000000..bc89573 --- /dev/null +++ b/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/user/entity/Setting.java @@ -0,0 +1,23 @@ +package com.UmcSpringStudy.jingjing2.domain.user.entity; + +import jakarta.persistence.*; +import lombok.*; + +@Entity +@Getter +@Setter +@NoArgsConstructor(access = AccessLevel.PROTECTED) +public class Setting { + + @Id + private Long uid; + + @OneToOne(fetch = FetchType.LAZY) + @MapsId + @JoinColumn(name = "uid") + private User user; + + private Boolean eventNotice; + private Boolean reviewNotice; + private Boolean iqNotice; +} \ No newline at end of file diff --git a/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/user/entity/Transaction.java b/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/user/entity/Transaction.java new file mode 100644 index 0000000..496bcb0 --- /dev/null +++ b/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/user/entity/Transaction.java @@ -0,0 +1,33 @@ +package com.UmcSpringStudy.jingjing2.domain.user.entity; + +import com.UmcSpringStudy.jingjing2.domain.user.enums.TransactionType; +import jakarta.persistence.*; +import lombok.*; + +@Entity +@Getter +@Setter +@Builder +@NoArgsConstructor(access = AccessLevel.PROTECTED) +@AllArgsConstructor +public class Transaction { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long tsid; + + @Column(length = 30) + private String title; + + @Column(length = 100) + private String context; + + private Integer amount; + + @Enumerated(EnumType.STRING) + private TransactionType type; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "uid") + private User user; +} \ No newline at end of file diff --git a/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/user/entity/User.java b/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/user/entity/User.java new file mode 100644 index 0000000..2998f05 --- /dev/null +++ b/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/user/entity/User.java @@ -0,0 +1,64 @@ +package com.UmcSpringStudy.jingjing2.domain.user.entity; + +import com.UmcSpringStudy.jingjing2.domain.user.enums.Provider; +import jakarta.persistence.*; +import lombok.*; +import java.time.LocalDate; +import java.util.ArrayList; +import java.util.List; + +@Entity +@Getter +@Setter +@Builder +@NoArgsConstructor(access = AccessLevel.PROTECTED) +@AllArgsConstructor +public class User { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long uid; + + @Column(nullable = false, length = 100) + private String sub; + + @Enumerated(EnumType.STRING) + @Column(columnDefinition = "VARCHAR(10)") + private Provider provider; + + @Column(length = 1) + private String sex; + + @Column(length = 20) + private String username; + + private LocalDate birth; + + @Column(length = 100) + private String address; + + @Column(length = 100) + private String email; + + @Column(length = 13) + private String phone; + + private Integer point; + + @Column(name = "CM_count") + private Integer cmCount; + + private LocalDate created; + + @Column(name = "Field") + private LocalDate field; + + @OneToOne(mappedBy = "user", cascade = CascadeType.ALL) + private Setting setting; + + @OneToOne(mappedBy = "user", cascade = CascadeType.ALL) + private Autorication autorication; + + @OneToMany(mappedBy = "user", cascade = CascadeType.ALL) + private List userInterests = new ArrayList<>(); +} \ No newline at end of file diff --git a/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/user/entity/UserInterest.java b/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/user/entity/UserInterest.java new file mode 100644 index 0000000..f4a36d8 --- /dev/null +++ b/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/user/entity/UserInterest.java @@ -0,0 +1,23 @@ +package com.UmcSpringStudy.jingjing2.domain.user.entity; + +import jakarta.persistence.*; +import lombok.*; + +@Entity +@Getter +@Setter +@NoArgsConstructor(access = AccessLevel.PROTECTED) +public class UserInterest { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long rtid; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "uid") + private User user; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "itid") + private Interest interest; +} \ No newline at end of file diff --git a/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/user/entity/UserMission.java b/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/user/entity/UserMission.java new file mode 100644 index 0000000..41ea403 --- /dev/null +++ b/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/user/entity/UserMission.java @@ -0,0 +1,35 @@ +package com.UmcSpringStudy.jingjing2.domain.user.entity; + +import com.UmcSpringStudy.jingjing2.domain.mission.entity.Mission; +import com.UmcSpringStudy.jingjing2.domain.user.enums.MissionStatus; +import jakarta.persistence.*; +import lombok.*; + +@Entity +@Table(name = "User_Mission") +@Getter +@Setter +@Builder +@NoArgsConstructor(access = AccessLevel.PROTECTED) +@AllArgsConstructor +public class UserMission { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "umid") + private Long umid; + + @Enumerated(EnumType.STRING) + @Column(name = "is_complete", columnDefinition = "VARCHAR(15)") + private MissionStatus isComplete; // enum: COMPLETE, PROGRESS, FAIL + + private Integer progress; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "uid") + private User user; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "msid") + private Mission mission; +} \ No newline at end of file diff --git a/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/user/enums/MissionStatus.java b/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/user/enums/MissionStatus.java new file mode 100644 index 0000000..06d7788 --- /dev/null +++ b/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/user/enums/MissionStatus.java @@ -0,0 +1,9 @@ +package com.UmcSpringStudy.jingjing2.domain.user.enums; + +/** + * 유저별 미션 진행 상태 + * ERD: complete, progress, fail + */ +public enum MissionStatus { + COMPLETE, PROGRESS, FAIL +} \ No newline at end of file diff --git a/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/user/enums/Provider.java b/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/user/enums/Provider.java new file mode 100644 index 0000000..945f1f4 --- /dev/null +++ b/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/user/enums/Provider.java @@ -0,0 +1,9 @@ +package com.UmcSpringStudy.jingjing2.domain.user.enums; + +/** + * 유저 소셜 로그인 제공자 + * ERD: naver, google + */ +public enum Provider { + NAVER, GOOGLE +} \ No newline at end of file diff --git a/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/user/enums/TransactionType.java b/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/user/enums/TransactionType.java new file mode 100644 index 0000000..b4d08d1 --- /dev/null +++ b/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/user/enums/TransactionType.java @@ -0,0 +1,9 @@ +package com.UmcSpringStudy.jingjing2.domain.user.enums; + +/** + * 포인트 입출금 타입 + * ERD: plus, minus + */ +public enum TransactionType { + PLUS, MINUS +} \ No newline at end of file diff --git a/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/user/repository/AutoricationRepository.java b/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/user/repository/AutoricationRepository.java new file mode 100644 index 0000000..d03a2e5 --- /dev/null +++ b/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/user/repository/AutoricationRepository.java @@ -0,0 +1,10 @@ +package com.UmcSpringStudy.jingjing2.domain.user.repository; + +import com.UmcSpringStudy.jingjing2.domain.user.entity.Autorication; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.stereotype.Repository; + +// 5. Autorication (User와 1:1) +@Repository +public interface AutoricationRepository extends JpaRepository { +} diff --git a/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/user/repository/IQFileRepository.java b/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/user/repository/IQFileRepository.java new file mode 100644 index 0000000..0060cf7 --- /dev/null +++ b/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/user/repository/IQFileRepository.java @@ -0,0 +1,10 @@ +package com.UmcSpringStudy.jingjing2.domain.user.repository; + +import com.UmcSpringStudy.jingjing2.domain.user.entity.IQFile; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.stereotype.Repository; + +// 9. IQFile +@Repository +public interface IQFileRepository extends JpaRepository { +} diff --git a/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/user/repository/InquiryRepository.java b/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/user/repository/InquiryRepository.java new file mode 100644 index 0000000..1ac0074 --- /dev/null +++ b/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/user/repository/InquiryRepository.java @@ -0,0 +1,13 @@ +package com.UmcSpringStudy.jingjing2.domain.user.repository; + +import com.UmcSpringStudy.jingjing2.domain.user.entity.Inquiry; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.stereotype.Repository; + +import java.util.List; + +// 8. Inquiry +@Repository +public interface InquiryRepository extends JpaRepository { + List findAllByUserUid(Long uid); +} diff --git a/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/user/repository/InterestRepository.java b/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/user/repository/InterestRepository.java new file mode 100644 index 0000000..4804b74 --- /dev/null +++ b/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/user/repository/InterestRepository.java @@ -0,0 +1,10 @@ +package com.UmcSpringStudy.jingjing2.domain.user.repository; + +import com.UmcSpringStudy.jingjing2.domain.user.entity.Interest; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.stereotype.Repository; + +// 6. Interest +@Repository +public interface InterestRepository extends JpaRepository { +} diff --git a/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/user/repository/SettingRepository.java b/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/user/repository/SettingRepository.java new file mode 100644 index 0000000..28de1a8 --- /dev/null +++ b/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/user/repository/SettingRepository.java @@ -0,0 +1,10 @@ +package com.UmcSpringStudy.jingjing2.domain.user.repository; + +import com.UmcSpringStudy.jingjing2.domain.user.entity.Setting; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.stereotype.Repository; + +// 4. Setting (User와 1:1) +@Repository +public interface SettingRepository extends JpaRepository { +} diff --git a/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/user/repository/TransactionRepository.java b/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/user/repository/TransactionRepository.java new file mode 100644 index 0000000..b3c6036 --- /dev/null +++ b/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/user/repository/TransactionRepository.java @@ -0,0 +1,13 @@ +package com.UmcSpringStudy.jingjing2.domain.user.repository; + +import com.UmcSpringStudy.jingjing2.domain.user.entity.Transaction; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.stereotype.Repository; + +import java.util.List; + +// 2. Transaction +@Repository +public interface TransactionRepository extends JpaRepository { + List findAllByUserUid(Long uid); // 특정 유저의 거래 내역 조회 +} diff --git a/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/user/repository/UserInterestRepository.java b/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/user/repository/UserInterestRepository.java new file mode 100644 index 0000000..e8f995d --- /dev/null +++ b/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/user/repository/UserInterestRepository.java @@ -0,0 +1,13 @@ +package com.UmcSpringStudy.jingjing2.domain.user.repository; + +import com.UmcSpringStudy.jingjing2.domain.user.entity.UserInterest; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.stereotype.Repository; + +import java.util.List; + +// 7. UserInterest +@Repository +public interface UserInterestRepository extends JpaRepository { + List findAllByUserUid(Long uid); +} diff --git a/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/user/repository/UserMissionRepository.java b/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/user/repository/UserMissionRepository.java new file mode 100644 index 0000000..22bf027 --- /dev/null +++ b/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/user/repository/UserMissionRepository.java @@ -0,0 +1,13 @@ +package com.UmcSpringStudy.jingjing2.domain.user.repository; + +import com.UmcSpringStudy.jingjing2.domain.user.entity.UserMission; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.stereotype.Repository; + +import java.util.List; + +// 3. UserMission +@Repository +public interface UserMissionRepository extends JpaRepository { + List findAllByUserUid(Long uid); +} diff --git a/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/user/repository/UserRepository.java b/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/user/repository/UserRepository.java new file mode 100644 index 0000000..540565c --- /dev/null +++ b/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/domain/user/repository/UserRepository.java @@ -0,0 +1,14 @@ +package com.UmcSpringStudy.jingjing2.domain.user.repository; + +import com.UmcSpringStudy.jingjing2.domain.user.entity.*; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.stereotype.Repository; +import java.util.List; +import java.util.Optional; + +// 1. User +@Repository +public interface UserRepository extends JpaRepository { + Optional findByEmail(String email); // 로컬 로그인 등을 위한 이메일 검색 +} + diff --git a/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/global/config/SwaggerConfig.java b/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/global/config/SwaggerConfig.java new file mode 100644 index 0000000..332e4e6 --- /dev/null +++ b/jingjing2/src/main/java/com/UmcSpringStudy/jingjing2/global/config/SwaggerConfig.java @@ -0,0 +1,40 @@ +package com.UmcSpringStudy.jingjing2.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() { + // API 기본 정보 설정 + Info info = new Info() + .title("UMC 10th Study API") + .description("UMC 10기 Jingjing2 프로젝트 Swagger 명세서입니다.") + .version("0.0.1"); + + // JWT 토큰 헤더 인증 방식 설정 + String securitySchemeName = "JWT TOKEN"; + SecurityRequirement securityRequirement = new SecurityRequirement().addList(securitySchemeName); + + Components components = new Components() + .addSecuritySchemes(securitySchemeName, new SecurityScheme() + .name(securitySchemeName) + .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/jingjing2/src/test/java/com/UmcSpringStudy/jingjing2/Jingjing2ApplicationTests.java b/jingjing2/src/test/java/com/UmcSpringStudy/jingjing2/Jingjing2ApplicationTests.java new file mode 100644 index 0000000..5a7751a --- /dev/null +++ b/jingjing2/src/test/java/com/UmcSpringStudy/jingjing2/Jingjing2ApplicationTests.java @@ -0,0 +1,13 @@ +package com.UmcSpringStudy.jingjing2; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class Jingjing2ApplicationTests { + + @Test + void contextLoads() { + } + +}