diff --git a/.gradle/8.14.3/checksums/checksums.lock b/.gradle/8.14.3/checksums/checksums.lock new file mode 100644 index 0000000..eaaf308 Binary files /dev/null and b/.gradle/8.14.3/checksums/checksums.lock differ diff --git a/.gradle/8.14.3/checksums/md5-checksums.bin b/.gradle/8.14.3/checksums/md5-checksums.bin new file mode 100644 index 0000000..10f9348 Binary files /dev/null and b/.gradle/8.14.3/checksums/md5-checksums.bin differ diff --git a/.gradle/8.14.3/checksums/sha1-checksums.bin b/.gradle/8.14.3/checksums/sha1-checksums.bin new file mode 100644 index 0000000..68fc3b2 Binary files /dev/null and b/.gradle/8.14.3/checksums/sha1-checksums.bin differ diff --git a/.gradle/8.14.3/executionHistory/executionHistory.bin b/.gradle/8.14.3/executionHistory/executionHistory.bin new file mode 100644 index 0000000..2f8766a Binary files /dev/null and b/.gradle/8.14.3/executionHistory/executionHistory.bin differ diff --git a/.gradle/8.14.3/executionHistory/executionHistory.lock b/.gradle/8.14.3/executionHistory/executionHistory.lock new file mode 100644 index 0000000..e718b95 Binary files /dev/null and b/.gradle/8.14.3/executionHistory/executionHistory.lock differ diff --git a/.gradle/8.14.3/fileChanges/last-build.bin b/.gradle/8.14.3/fileChanges/last-build.bin new file mode 100644 index 0000000..f76dd23 Binary files /dev/null and b/.gradle/8.14.3/fileChanges/last-build.bin differ diff --git a/.gradle/8.14.3/fileHashes/fileHashes.bin b/.gradle/8.14.3/fileHashes/fileHashes.bin new file mode 100644 index 0000000..c928ce2 Binary files /dev/null and b/.gradle/8.14.3/fileHashes/fileHashes.bin differ diff --git a/.gradle/8.14.3/fileHashes/fileHashes.lock b/.gradle/8.14.3/fileHashes/fileHashes.lock new file mode 100644 index 0000000..71af0c4 Binary files /dev/null and b/.gradle/8.14.3/fileHashes/fileHashes.lock differ diff --git a/.gradle/8.14.3/fileHashes/resourceHashesCache.bin b/.gradle/8.14.3/fileHashes/resourceHashesCache.bin new file mode 100644 index 0000000..0009375 Binary files /dev/null and b/.gradle/8.14.3/fileHashes/resourceHashesCache.bin differ diff --git a/.gradle/8.14.3/gc.properties b/.gradle/8.14.3/gc.properties new file mode 100644 index 0000000..e69de29 diff --git a/.gradle/buildOutputCleanup/buildOutputCleanup.lock b/.gradle/buildOutputCleanup/buildOutputCleanup.lock new file mode 100644 index 0000000..349d6cb Binary files /dev/null and b/.gradle/buildOutputCleanup/buildOutputCleanup.lock differ diff --git a/.gradle/buildOutputCleanup/cache.properties b/.gradle/buildOutputCleanup/cache.properties new file mode 100644 index 0000000..65d3476 --- /dev/null +++ b/.gradle/buildOutputCleanup/cache.properties @@ -0,0 +1,2 @@ +#Sat Sep 27 21:37:14 KST 2025 +gradle.version=8.14.3 diff --git a/.gradle/buildOutputCleanup/outputFiles.bin b/.gradle/buildOutputCleanup/outputFiles.bin new file mode 100644 index 0000000..ae52934 Binary files /dev/null and b/.gradle/buildOutputCleanup/outputFiles.bin differ diff --git a/.gradle/file-system.probe b/.gradle/file-system.probe new file mode 100644 index 0000000..8e7d70b Binary files /dev/null and b/.gradle/file-system.probe differ diff --git a/.gradle/vcs-1/gc.properties b/.gradle/vcs-1/gc.properties new file mode 100644 index 0000000..e69de29 diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..af3608d --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/dataSources.xml b/.idea/dataSources.xml new file mode 100644 index 0000000..324cca4 --- /dev/null +++ b/.idea/dataSources.xml @@ -0,0 +1,17 @@ + + + + + mysql_aurora.aws_wrapper + true + software.amazon.jdbc.Driver + jdbc:aws-wrapper:mysql://localhost:3306 + + + + + + $ProjectFileDir$ + + + \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..534a2c5 --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml new file mode 100644 index 0000000..05eca02 --- /dev/null +++ b/.idea/gradle.xml @@ -0,0 +1,17 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..b5bc6d6 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/HELP.md b/HELP.md new file mode 100644 index 0000000..3d2d617 --- /dev/null +++ b/HELP.md @@ -0,0 +1,28 @@ +# Getting Started + +### Reference Documentation + +For further reference, please consider the following sections: + +* [Official Gradle documentation](https://docs.gradle.org) +* [Spring Boot Gradle Plugin Reference Guide](https://docs.spring.io/spring-boot/3.5.6/gradle-plugin) +* [Create an OCI image](https://docs.spring.io/spring-boot/3.5.6/gradle-plugin/packaging-oci-image.html) +* [Spring Data JPA](https://docs.spring.io/spring-boot/3.5.6/reference/data/sql.html#data.sql.jpa-and-spring-data) +* [Spring Web](https://docs.spring.io/spring-boot/3.5.6/reference/web/servlet.html) + +### Guides + +The following guides illustrate how to use some features concretely: + +* [Accessing Data with JPA](https://spring.io/guides/gs/accessing-data-jpa/) +* [Accessing data with MySQL](https://spring.io/guides/gs/accessing-data-mysql/) +* [Building a RESTful Web Service](https://spring.io/guides/gs/rest-service/) +* [Serving Web Content with Spring MVC](https://spring.io/guides/gs/serving-web-content/) +* [Building REST services with Spring](https://spring.io/guides/tutorials/rest/) + +### Additional Links + +These additional references should also help you: + +* [Gradle Build Scans – insights for your project's build](https://scans.gradle.com#gradle) + diff --git a/Kim-DongH/chapter5/.gitattributes b/Kim-DongH/chapter5/.gitattributes new file mode 100644 index 0000000..8af972c --- /dev/null +++ b/Kim-DongH/chapter5/.gitattributes @@ -0,0 +1,3 @@ +/gradlew text eol=lf +*.bat text eol=crlf +*.jar binary diff --git a/Kim-DongH/chapter5/.gitignore b/Kim-DongH/chapter5/.gitignore new file mode 100644 index 0000000..c2065bc --- /dev/null +++ b/Kim-DongH/chapter5/.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/Kim-DongH/chapter5/build.gradle b/Kim-DongH/chapter5/build.gradle new file mode 100644 index 0000000..6f6eeee --- /dev/null +++ b/Kim-DongH/chapter5/build.gradle @@ -0,0 +1,39 @@ +plugins { + id 'java' + id 'org.springframework.boot' version '3.5.6' + id 'io.spring.dependency-management' version '1.1.7' +} + +group = 'com.example' +version = '0.0.1-SNAPSHOT' +description = 'umc9th' + +java { + toolchain { + languageVersion = JavaLanguageVersion.of(25) + } +} + +configurations { + compileOnly { + extendsFrom annotationProcessor + } +} + +repositories { + mavenCentral() +} + +dependencies { + implementation 'org.springframework.boot:spring-boot-starter-data-jpa' + implementation 'org.springframework.boot:spring-boot-starter-web' + compileOnly 'org.projectlombok:lombok' + runtimeOnly 'com.mysql:mysql-connector-j' + annotationProcessor 'org.projectlombok:lombok' + testImplementation 'org.springframework.boot:spring-boot-starter-test' + testRuntimeOnly 'org.junit.platform:junit-platform-launcher' +} + +tasks.named('test') { + useJUnitPlatform() +} diff --git a/Kim-DongH/chapter5/gradle/wrapper/gradle-wrapper.jar b/Kim-DongH/chapter5/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..1b33c55 Binary files /dev/null and b/Kim-DongH/chapter5/gradle/wrapper/gradle-wrapper.jar differ diff --git a/Kim-DongH/chapter5/gradle/wrapper/gradle-wrapper.properties b/Kim-DongH/chapter5/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..d4081da --- /dev/null +++ b/Kim-DongH/chapter5/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,7 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip +networkTimeout=10000 +validateDistributionUrl=true +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/Kim-DongH/chapter5/gradlew b/Kim-DongH/chapter5/gradlew new file mode 100644 index 0000000..23d15a9 --- /dev/null +++ b/Kim-DongH/chapter5/gradlew @@ -0,0 +1,251 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# 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/HEAD/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 + +CLASSPATH="\\\"\\\"" + + +# 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" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and 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" \ + -classpath "$CLASSPATH" \ + -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/Kim-DongH/chapter5/gradlew.bat b/Kim-DongH/chapter5/gradlew.bat new file mode 100644 index 0000000..db3a6ac --- /dev/null +++ b/Kim-DongH/chapter5/gradlew.bat @@ -0,0 +1,94 @@ +@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 + +set CLASSPATH= + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -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/Kim-DongH/chapter5/settings.gradle b/Kim-DongH/chapter5/settings.gradle new file mode 100644 index 0000000..0ec607f --- /dev/null +++ b/Kim-DongH/chapter5/settings.gradle @@ -0,0 +1 @@ +rootProject.name = 'umc9th' diff --git a/Kim-DongH/chapter5/src/main/java/com/example/umc9th/domain/member/dto/MyPageSummary.java b/Kim-DongH/chapter5/src/main/java/com/example/umc9th/domain/member/dto/MyPageSummary.java new file mode 100644 index 0000000..75b8bff --- /dev/null +++ b/Kim-DongH/chapter5/src/main/java/com/example/umc9th/domain/member/dto/MyPageSummary.java @@ -0,0 +1,10 @@ +package com.example.umc9th.domain.member.dto; + +public record MyPageSummary( + Long memberId, + String name, + String email, // phoneNumber로 바꿨다면 여기도 동일 + Integer point, + Long reviewCount, + Long likedFoodKinds +) {} diff --git a/Kim-DongH/chapter5/src/main/java/com/example/umc9th/domain/member/entity/Food.java b/Kim-DongH/chapter5/src/main/java/com/example/umc9th/domain/member/entity/Food.java new file mode 100644 index 0000000..a7eb114 --- /dev/null +++ b/Kim-DongH/chapter5/src/main/java/com/example/umc9th/domain/member/entity/Food.java @@ -0,0 +1,31 @@ +package com.example.umc9th.domain.member.entity; + +import com.example.umc9th.domain.member.enums.FoodName; +import com.example.umc9th.domain.member.entity.mapping.MemberFood; +import com.example.umc9th.global.entity.BaseEntity; +import jakarta.persistence.*; +import lombok.*; +import java.util.ArrayList; +import java.util.List; + +@Entity +@Builder +@NoArgsConstructor(access = AccessLevel.PROTECTED) +@AllArgsConstructor(access = AccessLevel.PRIVATE) +@Getter +@Table(name = "food") + +public class Food extends BaseEntity { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + @Column(name = "name") + @Enumerated(EnumType.STRING) + private FoodName name; + + @OneToMany(mappedBy = "food", cascade = CascadeType.ALL, orphanRemoval = true) + private List likedBy = new ArrayList<>(); + +} diff --git a/Kim-DongH/chapter5/src/main/java/com/example/umc9th/domain/member/entity/Member.java b/Kim-DongH/chapter5/src/main/java/com/example/umc9th/domain/member/entity/Member.java new file mode 100644 index 0000000..ce8848d --- /dev/null +++ b/Kim-DongH/chapter5/src/main/java/com/example/umc9th/domain/member/entity/Member.java @@ -0,0 +1,84 @@ +package com.example.umc9th.domain.member.entity; + +import com.example.umc9th.domain.member.entity.mapping.MemberFood; +import com.example.umc9th.domain.member.entity.mapping.MemberTerm; +import com.example.umc9th.domain.member.enums.Gender; +import com.example.umc9th.domain.review.entity.Review; +import com.example.umc9th.domain.review.entity.Reply; +import com.example.umc9th.global.auth.enums.SocialType; +import com.example.umc9th.global.entity.BaseEntity; +import jakarta.persistence.*; +import lombok.*; +import org.springframework.data.annotation.CreatedDate; +import org.springframework.data.annotation.LastModifiedDate; +import org.springframework.data.jpa.domain.support.AuditingEntityListener; +import java.util.List; +import java.util.ArrayList; + +import java.time.LocalDate; +import java.time.LocalDateTime; + +@Entity +@Builder +@NoArgsConstructor(access = AccessLevel.PROTECTED) +@AllArgsConstructor(access = AccessLevel.PRIVATE) +@Getter +@Table(name = "member") +@EntityListeners(AuditingEntityListener.class) +public class Member extends BaseEntity { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + @Column(name = "name", length = 3, nullable = false) + private String name; + + @Column(name = "gender", nullable = false, length = 2) + @Enumerated(EnumType.STRING) + @Builder.Default + private Gender gender = Gender.NONE; + + @Column(name = "birth", nullable = false) + private LocalDate birth; + + @Column(nullable = false, length = 20) + private String address; + + @Column(nullable = false, length = 20) + private String detailAddress; + + @Enumerated(EnumType.STRING) + @Column(nullable = false, length = 10) + private SocialType socialType; + + @Column(nullable = false, length = 100) + private String socialId; // OAuth UID + + @Column(nullable = false, length = 100, unique = true) + private String email; + + @Column(nullable = false, length = 15) + private String phoneNumber; + + @Column(nullable = false) + private Integer point = 0; + + private LocalDateTime deletedAt; + + + // 1:N + @OneToMany(mappedBy = "member", cascade = CascadeType.ALL, orphanRemoval = true) + private List reviews = new ArrayList<>(); + + @OneToMany(mappedBy = "member", cascade = CascadeType.ALL, orphanRemoval = true) + private List replies = new ArrayList<>(); + + // N:M (조인 엔티티) + @OneToMany(mappedBy = "member", cascade = CascadeType.ALL, orphanRemoval = true) + private List likedFoods = new ArrayList<>(); + + @OneToMany(mappedBy = "member", cascade = CascadeType.ALL, orphanRemoval = true) + private List agreedTerms = new ArrayList<>(); + +} diff --git a/Kim-DongH/chapter5/src/main/java/com/example/umc9th/domain/member/entity/Term.java b/Kim-DongH/chapter5/src/main/java/com/example/umc9th/domain/member/entity/Term.java new file mode 100644 index 0000000..637a4c9 --- /dev/null +++ b/Kim-DongH/chapter5/src/main/java/com/example/umc9th/domain/member/entity/Term.java @@ -0,0 +1,32 @@ +package com.example.umc9th.domain.member.entity; + +import com.example.umc9th.domain.member.enums.TermName; +import com.example.umc9th.domain.member.entity.mapping.MemberTerm; +import com.example.umc9th.domain.member.enums.TermName; +import com.example.umc9th.global.entity.BaseEntity; +import jakarta.persistence.*; +import lombok.*; +import java.util.List; +import java.util.ArrayList; + + +@Entity +@Builder +@NoArgsConstructor(access = AccessLevel.PROTECTED) +@AllArgsConstructor(access = AccessLevel.PRIVATE) +@Getter +@Table(name = "term") +public class Term extends BaseEntity { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + @Column(name = "name") + @Enumerated(EnumType.STRING) + private TermName name; + + @OneToMany(mappedBy = "term", cascade = CascadeType.ALL, orphanRemoval = true) + private List agreedBy = new ArrayList<>(); + +} diff --git a/Kim-DongH/chapter5/src/main/java/com/example/umc9th/domain/member/entity/mapping/MemberFood.java b/Kim-DongH/chapter5/src/main/java/com/example/umc9th/domain/member/entity/mapping/MemberFood.java new file mode 100644 index 0000000..2c4ce07 --- /dev/null +++ b/Kim-DongH/chapter5/src/main/java/com/example/umc9th/domain/member/entity/mapping/MemberFood.java @@ -0,0 +1,30 @@ +package com.example.umc9th.domain.member.entity.mapping; + +import com.example.umc9th.domain.member.entity.Food; +import com.example.umc9th.domain.member.entity.Member; +import com.example.umc9th.global.entity.BaseEntity; +import jakarta.persistence.*; +import lombok.*; +import org.springframework.boot.autoconfigure.web.WebProperties; + +@Entity +@Builder +@NoArgsConstructor(access = AccessLevel.PROTECTED) +@AllArgsConstructor(access = AccessLevel.PRIVATE) +@Getter +@Table(name = "member_food") +public class MemberFood { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "member_id") + private Member member; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "food_id") + private Food food; + +} diff --git a/Kim-DongH/chapter5/src/main/java/com/example/umc9th/domain/member/entity/mapping/MemberTerm.java b/Kim-DongH/chapter5/src/main/java/com/example/umc9th/domain/member/entity/mapping/MemberTerm.java new file mode 100644 index 0000000..eb91742 --- /dev/null +++ b/Kim-DongH/chapter5/src/main/java/com/example/umc9th/domain/member/entity/mapping/MemberTerm.java @@ -0,0 +1,27 @@ +package com.example.umc9th.domain.member.entity.mapping; + +import com.example.umc9th.domain.member.entity.Member; +import com.example.umc9th.domain.member.entity.Term; +import com.example.umc9th.global.entity.BaseEntity; +import jakarta.persistence.*; + +@Entity +@Table(name = "member_term", + indexes = { + @Index(name="idx_member_term_member", columnList="member_id"), + @Index(name="idx_member_term_term", columnList="term_id") + }) + +public class MemberTerm extends BaseEntity { + + @Id @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long memberTermId; + + @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "member_id", nullable = false) + private Member member; + + @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "term_id", nullable = false) + private Term term; + + +} diff --git a/Kim-DongH/chapter5/src/main/java/com/example/umc9th/domain/member/enums/FoodName.java b/Kim-DongH/chapter5/src/main/java/com/example/umc9th/domain/member/enums/FoodName.java new file mode 100644 index 0000000..7d540a7 --- /dev/null +++ b/Kim-DongH/chapter5/src/main/java/com/example/umc9th/domain/member/enums/FoodName.java @@ -0,0 +1,5 @@ +package com.example.umc9th.domain.member.enums; + +public enum FoodName { + KOREAN, JAPANESE, CHINESE, WESTERN, ETC +} diff --git a/Kim-DongH/chapter5/src/main/java/com/example/umc9th/domain/member/enums/Gender.java b/Kim-DongH/chapter5/src/main/java/com/example/umc9th/domain/member/enums/Gender.java new file mode 100644 index 0000000..b84e197 --- /dev/null +++ b/Kim-DongH/chapter5/src/main/java/com/example/umc9th/domain/member/enums/Gender.java @@ -0,0 +1,7 @@ +package com.example.umc9th.domain.member.enums; + +public enum Gender { + MALE, + FEMALE, + NONE +} diff --git a/Kim-DongH/chapter5/src/main/java/com/example/umc9th/domain/member/enums/TermName.java b/Kim-DongH/chapter5/src/main/java/com/example/umc9th/domain/member/enums/TermName.java new file mode 100644 index 0000000..db0e6a8 --- /dev/null +++ b/Kim-DongH/chapter5/src/main/java/com/example/umc9th/domain/member/enums/TermName.java @@ -0,0 +1,5 @@ +package com.example.umc9th.domain.member.enums; + +public enum TermName { + AGE, SERVICE, PRIVACY, LOCATION, MARKETING +} diff --git a/Kim-DongH/chapter5/src/main/java/com/example/umc9th/domain/member/repository/MemberRepository.java b/Kim-DongH/chapter5/src/main/java/com/example/umc9th/domain/member/repository/MemberRepository.java new file mode 100644 index 0000000..8347f4e --- /dev/null +++ b/Kim-DongH/chapter5/src/main/java/com/example/umc9th/domain/member/repository/MemberRepository.java @@ -0,0 +1,27 @@ +package com.example.umc9th.domain.member.repository; + +import com.example.umc9th.domain.member.dto.MyPageSummary; +import com.example.umc9th.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; + +import java.util.Optional; + +public interface MemberRepository extends JpaRepository { + + // soft delete 미적용 + 요약 정보를 한 번에 + @Query(""" + select new com.example.umc9th.domain.member.dto.MyPageSummary( + m.id, m.name, m.email, m.point, + (select count(r) from Review r where r.member.id = m.id), + (select count(distinct mf.food.id) from MemberFood mf where mf.member.id = m.id) + ) + from Member m + where m.id = :memberId and m.deletedAt is null + """) + Optional loadMyPageSummary(@Param("memberId") Long memberId); + + Optional findByNameAndDeletedAtIsNull(String name); +} + diff --git a/Kim-DongH/chapter5/src/main/java/com/example/umc9th/domain/mission/dto/MyMissionItem.java b/Kim-DongH/chapter5/src/main/java/com/example/umc9th/domain/mission/dto/MyMissionItem.java new file mode 100644 index 0000000..fde1fca --- /dev/null +++ b/Kim-DongH/chapter5/src/main/java/com/example/umc9th/domain/mission/dto/MyMissionItem.java @@ -0,0 +1,16 @@ +package com.example.umc9th.domain.mission.dto; + +import java.time.LocalDateTime; +import lombok.AllArgsConstructor; +import lombok.Getter; + +@Getter +@AllArgsConstructor +public class MyMissionItem { + private final Long missionId; + private final String title; + private final String storeName; + private final String status; // enum이면 타입을 enum으로 바꿔도 됨 + private final LocalDateTime updatedAt; +} + diff --git a/Kim-DongH/chapter5/src/main/java/com/example/umc9th/domain/mission/entity/MemberMission.java b/Kim-DongH/chapter5/src/main/java/com/example/umc9th/domain/mission/entity/MemberMission.java new file mode 100644 index 0000000..02c66d5 --- /dev/null +++ b/Kim-DongH/chapter5/src/main/java/com/example/umc9th/domain/mission/entity/MemberMission.java @@ -0,0 +1,26 @@ +package com.example.umc9th.domain.mission.entity; + +import com.example.umc9th.domain.member.entity.Member; +import jakarta.persistence.*; + +@Entity +@Table(name = "member_mission", + uniqueConstraints = @UniqueConstraint(name="uk_member_mission", columnNames = {"member_id","mission_id"}), + indexes = { + @Index(name="idx_member_mission_member", columnList="member_id"), + @Index(name="idx_member_mission_mission", columnList="mission_id") + }) +public class MemberMission { + @Id @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long memberMissionId; + + @Column(nullable = false) + private Boolean isComplete = Boolean.FALSE; + + @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "mission_id", nullable = false) + private Mission mission; + + @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "member_id", nullable = false) + private com.example.umc9th.domain.member.entity.Member member; + +} diff --git a/Kim-DongH/chapter5/src/main/java/com/example/umc9th/domain/mission/entity/Mission.java b/Kim-DongH/chapter5/src/main/java/com/example/umc9th/domain/mission/entity/Mission.java new file mode 100644 index 0000000..2343acd --- /dev/null +++ b/Kim-DongH/chapter5/src/main/java/com/example/umc9th/domain/mission/entity/Mission.java @@ -0,0 +1,28 @@ +package com.example.umc9th.domain.mission.entity; + +import com.example.umc9th.domain.store.entity.Store; +import com.example.umc9th.global.entity.BaseEntity; +import jakarta.persistence.*; +import java.time.LocalDate; + +@Entity +@Table(name = "mission", + indexes = @Index(name="idx_mission_store", columnList="store_id")) +public class Mission extends BaseEntity { + @Id @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long missionId; + + @Column(nullable = false) + private LocalDate deadline; + + @Column(nullable = false, length = 100) + private String condition; + + @Column(nullable = false) + private Integer cost; + + @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "store_id", nullable = false) + private Store store; + +} + diff --git a/Kim-DongH/chapter5/src/main/java/com/example/umc9th/domain/mission/repository/HomeQueryRepository.java b/Kim-DongH/chapter5/src/main/java/com/example/umc9th/domain/mission/repository/HomeQueryRepository.java new file mode 100644 index 0000000..cccf28a --- /dev/null +++ b/Kim-DongH/chapter5/src/main/java/com/example/umc9th/domain/mission/repository/HomeQueryRepository.java @@ -0,0 +1,24 @@ +package com.example.umc9th.domain.mission.repository; + +import com.example.umc9th.domain.store.dto.HomeMissionItem; +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 HomeQueryRepository extends JpaRepository { + + @Query(""" + select new com.example.umc9th.domain.store.dto.HomeMissionItem( + m.id, m.title, s.name, s.region.name + ) + from Mission m + join m.store s + where s.region.id = :regionId + and m.status = 'OPEN' + order by m.createdAt desc + """) + Page findOpenMissionsByRegion(@Param("regionId") Long regionId, Pageable pageable); +} + + diff --git a/Kim-DongH/chapter5/src/main/java/com/example/umc9th/domain/mission/repository/MissionRepository.java b/Kim-DongH/chapter5/src/main/java/com/example/umc9th/domain/mission/repository/MissionRepository.java new file mode 100644 index 0000000..b999ca3 --- /dev/null +++ b/Kim-DongH/chapter5/src/main/java/com/example/umc9th/domain/mission/repository/MissionRepository.java @@ -0,0 +1,29 @@ +package com.example.umc9th.domain.mission.repository; + +import com.example.umc9th.domain.mission.dto.MyMissionItem; +import com.example.umc9th.domain.mission.dto.*; +import com.example.umc9th.domain.mission.entity.Mission; +import com.example.umc9th.domain.store.dto.HomeMissionItem; +import com.example.umc9th.domain.store.enums.Address; +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 MissionRepository extends JpaRepository { + + @Query(""" + select new com.example.umc9th.domain.mission.dto.MyMissionItem( + mm.mission.id, mm.mission.title, s.name, cast(mm.status as string), mm.updatedAt + ) + from MemberMission mm + join mm.mission m + join m.store s + where mm.member.id = :memberId and cast(mm.status as string) = :status + order by mm.updatedAt desc + """) + Page findMyMissions(@Param("memberId") Long memberId, + @Param("status") String status, + Pageable pageable); +} + diff --git a/Kim-DongH/chapter5/src/main/java/com/example/umc9th/domain/review/entity/Reply.java b/Kim-DongH/chapter5/src/main/java/com/example/umc9th/domain/review/entity/Reply.java new file mode 100644 index 0000000..dd1e905 --- /dev/null +++ b/Kim-DongH/chapter5/src/main/java/com/example/umc9th/domain/review/entity/Reply.java @@ -0,0 +1,28 @@ +package com.example.umc9th.domain.review.entity; + +import com.example.umc9th.domain.member.entity.Member; +import com.example.umc9th.global.entity.BaseEntity; +import jakarta.persistence.*; + +@Entity +@Table(name = "reply", + indexes = { + @Index(name="idx_reply_review", columnList="review_id"), + @Index(name="idx_reply_member", columnList="member_id") + }) + +public class Reply extends BaseEntity { + @Id @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long replyId; + + @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "review_id", nullable = false) + private Review review; + + @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "member_id", nullable = false) + private Member member; + + @Lob + @Column(nullable = false) + private String content; + +} diff --git a/Kim-DongH/chapter5/src/main/java/com/example/umc9th/domain/review/entity/Review.java b/Kim-DongH/chapter5/src/main/java/com/example/umc9th/domain/review/entity/Review.java new file mode 100644 index 0000000..8f5e7b8 --- /dev/null +++ b/Kim-DongH/chapter5/src/main/java/com/example/umc9th/domain/review/entity/Review.java @@ -0,0 +1,44 @@ +package com.example.umc9th.domain.review.entity; + +import com.example.umc9th.domain.member.entity.Member; +import com.example.umc9th.domain.store.entity.Store; +import com.example.umc9th.global.entity.BaseEntity; +import jakarta.persistence.*; +import java.util.ArrayList; +import java.util.List; + +@Entity +@Table(name = "review", + indexes = { + @Index(name="idx_review_member", columnList="member_id"), + @Index(name="idx_review_store", columnList="store_id") + }) + +public class Review extends BaseEntity { + + @Id @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long reviewId; + + @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "member_id", nullable = false) + private Member member; + + @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "store_id", nullable = false) + private Store store; + + @Column(nullable = false) + private Float rating; + + @Column(nullable = false) + private Integer likeCount = 0; + + @Lob + @Column(nullable = false) + private String content; + + @OneToMany(mappedBy = "review", cascade = CascadeType.ALL, orphanRemoval = true) + private List replies = new ArrayList<>(); + + @OneToMany(mappedBy = "review", cascade = CascadeType.ALL, orphanRemoval = true) + private List photos = new ArrayList<>(); + +} diff --git a/Kim-DongH/chapter5/src/main/java/com/example/umc9th/domain/review/entity/ReviewPhoto.java b/Kim-DongH/chapter5/src/main/java/com/example/umc9th/domain/review/entity/ReviewPhoto.java new file mode 100644 index 0000000..4ead3a6 --- /dev/null +++ b/Kim-DongH/chapter5/src/main/java/com/example/umc9th/domain/review/entity/ReviewPhoto.java @@ -0,0 +1,20 @@ +package com.example.umc9th.domain.review.entity; + +import com.example.umc9th.global.entity.BaseEntity; +import jakarta.persistence.*; + +@Entity +@Table(name = "review_photo", + indexes = @Index(name="idx_review_photo_review", columnList="review_id")) + +public class ReviewPhoto extends BaseEntity { + @Id @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long reviewPhotoId; + + @Column(nullable = false, length = 255) + private String photoUrl; + + @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "review_id", nullable = false) + private Review review; + +} diff --git a/Kim-DongH/chapter5/src/main/java/com/example/umc9th/domain/review/repository/ReviewRepository.java b/Kim-DongH/chapter5/src/main/java/com/example/umc9th/domain/review/repository/ReviewRepository.java new file mode 100644 index 0000000..19568d8 --- /dev/null +++ b/Kim-DongH/chapter5/src/main/java/com/example/umc9th/domain/review/repository/ReviewRepository.java @@ -0,0 +1,16 @@ +package com.example.umc9th.domain.review.repository; + +import com.example.umc9th.domain.review.entity.Review; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.data.jpa.repository.EntityGraph; +import org.springframework.data.jpa.repository.JpaRepository; + +public interface ReviewRepository extends JpaRepository { + + @EntityGraph(attributePaths = {"store"}) + Page findByMember_IdOrderByCreatedAtDesc(Long memberId, Pageable pageable); + + @EntityGraph(attributePaths = {"member"}) + Page findByStore_IdOrderByCreatedAtDesc(Long storeId, Pageable pageable); +} diff --git a/Kim-DongH/chapter5/src/main/java/com/example/umc9th/domain/store/dto/HomeMissionItem.java b/Kim-DongH/chapter5/src/main/java/com/example/umc9th/domain/store/dto/HomeMissionItem.java new file mode 100644 index 0000000..d203d92 --- /dev/null +++ b/Kim-DongH/chapter5/src/main/java/com/example/umc9th/domain/store/dto/HomeMissionItem.java @@ -0,0 +1,7 @@ +package com.example.umc9th.domain.store.dto; + +import com.example.umc9th.domain.store.enums.Address; + +public record HomeMissionItem( + Long missionId, String title, String storeName, Address address +) {} diff --git a/Kim-DongH/chapter5/src/main/java/com/example/umc9th/domain/store/entity/Location.java b/Kim-DongH/chapter5/src/main/java/com/example/umc9th/domain/store/entity/Location.java new file mode 100644 index 0000000..c706b54 --- /dev/null +++ b/Kim-DongH/chapter5/src/main/java/com/example/umc9th/domain/store/entity/Location.java @@ -0,0 +1,14 @@ +package com.example.umc9th.domain.store.entity; + +import jakarta.persistence.*; + +@Entity +@Table(name = "location") +public class Location { + @Id @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long locationId; + + @Column(nullable = false, length = 30) + private String name; + +} diff --git a/Kim-DongH/chapter5/src/main/java/com/example/umc9th/domain/store/entity/Store.java b/Kim-DongH/chapter5/src/main/java/com/example/umc9th/domain/store/entity/Store.java new file mode 100644 index 0000000..72b091e --- /dev/null +++ b/Kim-DongH/chapter5/src/main/java/com/example/umc9th/domain/store/entity/Store.java @@ -0,0 +1,29 @@ +package com.example.umc9th.domain.store.entity; + +import com.example.umc9th.global.entity.BaseEntity; +import jakarta.persistence.*; + +@Entity +@Table(name = "store", + indexes = @Index(name="idx_store_location", columnList="location_id")) +public class Store extends BaseEntity { + @Id @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long storeId; + + @Column(nullable = false, length = 50) + private String name; + + @Column(nullable = false, length = 20) + private String managerNumber; + + @Column(nullable = false, length = 30) + private String address; + + @Column(nullable = false, length = 30) + private String detailAddress; + + @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "location_id", nullable = false) + private Location location; + +} + diff --git a/Kim-DongH/chapter5/src/main/java/com/example/umc9th/domain/store/enums/Address.java b/Kim-DongH/chapter5/src/main/java/com/example/umc9th/domain/store/enums/Address.java new file mode 100644 index 0000000..8162bce --- /dev/null +++ b/Kim-DongH/chapter5/src/main/java/com/example/umc9th/domain/store/enums/Address.java @@ -0,0 +1,4 @@ +package com.example.umc9th.domain.store.enums; + +public class Address { +} diff --git a/Kim-DongH/chapter5/src/main/java/com/example/umc9th/domain/store/repository/StoreRepository.java b/Kim-DongH/chapter5/src/main/java/com/example/umc9th/domain/store/repository/StoreRepository.java new file mode 100644 index 0000000..09a1c4e --- /dev/null +++ b/Kim-DongH/chapter5/src/main/java/com/example/umc9th/domain/store/repository/StoreRepository.java @@ -0,0 +1,11 @@ +package com.example.umc9th.domain.store.repository; + +import com.example.umc9th.domain.store.entity.Store; +import com.example.umc9th.domain.store.enums.Address; +import org.springframework.data.domain.*; +import org.springframework.data.jpa.repository.JpaRepository; + +public interface StoreRepository extends JpaRepository { + Page findByAddress(Address address, Pageable pageable); +} + diff --git a/Kim-DongH/chapter5/src/main/java/com/example/umc9th/global/Umc9thApplication.java b/Kim-DongH/chapter5/src/main/java/com/example/umc9th/global/Umc9thApplication.java new file mode 100644 index 0000000..ac77f9e --- /dev/null +++ b/Kim-DongH/chapter5/src/main/java/com/example/umc9th/global/Umc9thApplication.java @@ -0,0 +1,15 @@ +package com.example.umc9th.global; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.data.jpa.repository.config.EnableJpaAuditing; + +@SpringBootApplication +@EnableJpaAuditing +public class Umc9thApplication { + + public static void main(String[] args) { + SpringApplication.run(Umc9thApplication.class, args); + } + +} diff --git a/Kim-DongH/chapter5/src/main/java/com/example/umc9th/global/auth/enums/Gender.java b/Kim-DongH/chapter5/src/main/java/com/example/umc9th/global/auth/enums/Gender.java new file mode 100644 index 0000000..aa450b8 --- /dev/null +++ b/Kim-DongH/chapter5/src/main/java/com/example/umc9th/global/auth/enums/Gender.java @@ -0,0 +1,7 @@ +package com.example.umc9th.global.auth.enums; + +public enum Gender { + MALE, + FEMALE, + NONE +} diff --git a/Kim-DongH/chapter5/src/main/java/com/example/umc9th/global/auth/enums/SocialType.java b/Kim-DongH/chapter5/src/main/java/com/example/umc9th/global/auth/enums/SocialType.java new file mode 100644 index 0000000..7a76172 --- /dev/null +++ b/Kim-DongH/chapter5/src/main/java/com/example/umc9th/global/auth/enums/SocialType.java @@ -0,0 +1,10 @@ +package com.example.umc9th.global.auth.enums; + +public enum SocialType { + KAKAO, + GOOGLE, + NAVER, + APPLE, + FACEBOOK, + TWITTER +} diff --git a/Kim-DongH/chapter5/src/main/java/com/example/umc9th/global/entity/BaseEntity.java b/Kim-DongH/chapter5/src/main/java/com/example/umc9th/global/entity/BaseEntity.java new file mode 100644 index 0000000..57e15d1 --- /dev/null +++ b/Kim-DongH/chapter5/src/main/java/com/example/umc9th/global/entity/BaseEntity.java @@ -0,0 +1,26 @@ +package com.example.umc9th.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; +import jakarta.persistence.*; + +@MappedSuperclass +@EntityListeners(AuditingEntityListener.class) +@Getter +public abstract class BaseEntity { + + @CreatedDate + @Column(name = "Created_at", nullable = false) + private LocalDateTime createdAt; + + @LastModifiedDate + @Column(name = "Updated_at", nullable = false) + private LocalDateTime updatedAt; + +} \ No newline at end of file diff --git a/Kim-DongH/chapter5/src/main/resources/application.yml b/Kim-DongH/chapter5/src/main/resources/application.yml new file mode 100644 index 0000000..b420e20 --- /dev/null +++ b/Kim-DongH/chapter5/src/main/resources/application.yml @@ -0,0 +1,19 @@ +spring: + application: + name: "umc9th" # "umc9th" + + 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: create # 애플리케이션 실행 시 데이터베이스 스키마의 상태를 설정 + properties: + hibernate: + format_sql: true # 출력되는 SQL 쿼리를 보기 좋게 포맷팅 diff --git a/Kim-DongH/chapter5/src/test/java/com/example/umc9th/Umc9thApplicationTests.java b/Kim-DongH/chapter5/src/test/java/com/example/umc9th/Umc9thApplicationTests.java new file mode 100644 index 0000000..a96d2a7 --- /dev/null +++ b/Kim-DongH/chapter5/src/test/java/com/example/umc9th/Umc9thApplicationTests.java @@ -0,0 +1,13 @@ +package com.example.umc9th; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class Umc9thApplicationTests { + + @Test + void contextLoads() { + } + +} diff --git a/build/classes/java/main/com/example/umc9th/domain/member/dto/MyPageSummary.class b/build/classes/java/main/com/example/umc9th/domain/member/dto/MyPageSummary.class new file mode 100644 index 0000000..5398f7c Binary files /dev/null and b/build/classes/java/main/com/example/umc9th/domain/member/dto/MyPageSummary.class differ diff --git a/build/classes/java/main/com/example/umc9th/domain/member/entity/Food$FoodBuilder.class b/build/classes/java/main/com/example/umc9th/domain/member/entity/Food$FoodBuilder.class new file mode 100644 index 0000000..63f0bfa Binary files /dev/null and b/build/classes/java/main/com/example/umc9th/domain/member/entity/Food$FoodBuilder.class differ diff --git a/build/classes/java/main/com/example/umc9th/domain/member/entity/Food.class b/build/classes/java/main/com/example/umc9th/domain/member/entity/Food.class new file mode 100644 index 0000000..08e730b Binary files /dev/null and b/build/classes/java/main/com/example/umc9th/domain/member/entity/Food.class differ diff --git a/build/classes/java/main/com/example/umc9th/domain/member/entity/Member$MemberBuilder.class b/build/classes/java/main/com/example/umc9th/domain/member/entity/Member$MemberBuilder.class new file mode 100644 index 0000000..2aa17c7 Binary files /dev/null and b/build/classes/java/main/com/example/umc9th/domain/member/entity/Member$MemberBuilder.class differ diff --git a/build/classes/java/main/com/example/umc9th/domain/member/entity/Member.class b/build/classes/java/main/com/example/umc9th/domain/member/entity/Member.class new file mode 100644 index 0000000..34f6564 Binary files /dev/null and b/build/classes/java/main/com/example/umc9th/domain/member/entity/Member.class differ diff --git a/build/classes/java/main/com/example/umc9th/domain/member/entity/Term$TermBuilder.class b/build/classes/java/main/com/example/umc9th/domain/member/entity/Term$TermBuilder.class new file mode 100644 index 0000000..78c2930 Binary files /dev/null and b/build/classes/java/main/com/example/umc9th/domain/member/entity/Term$TermBuilder.class differ diff --git a/build/classes/java/main/com/example/umc9th/domain/member/entity/Term.class b/build/classes/java/main/com/example/umc9th/domain/member/entity/Term.class new file mode 100644 index 0000000..9d00d09 Binary files /dev/null and b/build/classes/java/main/com/example/umc9th/domain/member/entity/Term.class differ diff --git a/build/classes/java/main/com/example/umc9th/domain/member/entity/mapping/MemberFood$MemberFoodBuilder.class b/build/classes/java/main/com/example/umc9th/domain/member/entity/mapping/MemberFood$MemberFoodBuilder.class new file mode 100644 index 0000000..1a5cecf Binary files /dev/null and b/build/classes/java/main/com/example/umc9th/domain/member/entity/mapping/MemberFood$MemberFoodBuilder.class differ diff --git a/build/classes/java/main/com/example/umc9th/domain/member/entity/mapping/MemberFood.class b/build/classes/java/main/com/example/umc9th/domain/member/entity/mapping/MemberFood.class new file mode 100644 index 0000000..5415775 Binary files /dev/null and b/build/classes/java/main/com/example/umc9th/domain/member/entity/mapping/MemberFood.class differ diff --git a/build/classes/java/main/com/example/umc9th/domain/member/entity/mapping/MemberTerm.class b/build/classes/java/main/com/example/umc9th/domain/member/entity/mapping/MemberTerm.class new file mode 100644 index 0000000..7846059 Binary files /dev/null and b/build/classes/java/main/com/example/umc9th/domain/member/entity/mapping/MemberTerm.class differ diff --git a/build/classes/java/main/com/example/umc9th/domain/member/enums/FoodName.class b/build/classes/java/main/com/example/umc9th/domain/member/enums/FoodName.class new file mode 100644 index 0000000..6420fe6 Binary files /dev/null and b/build/classes/java/main/com/example/umc9th/domain/member/enums/FoodName.class differ diff --git a/build/classes/java/main/com/example/umc9th/domain/member/enums/Gender.class b/build/classes/java/main/com/example/umc9th/domain/member/enums/Gender.class new file mode 100644 index 0000000..54df683 Binary files /dev/null and b/build/classes/java/main/com/example/umc9th/domain/member/enums/Gender.class differ diff --git a/build/classes/java/main/com/example/umc9th/domain/member/enums/TermName.class b/build/classes/java/main/com/example/umc9th/domain/member/enums/TermName.class new file mode 100644 index 0000000..e04000c Binary files /dev/null and b/build/classes/java/main/com/example/umc9th/domain/member/enums/TermName.class differ diff --git a/build/classes/java/main/com/example/umc9th/domain/member/repository/MemberRepository.class b/build/classes/java/main/com/example/umc9th/domain/member/repository/MemberRepository.class new file mode 100644 index 0000000..0fd3894 Binary files /dev/null and b/build/classes/java/main/com/example/umc9th/domain/member/repository/MemberRepository.class differ diff --git a/build/classes/java/main/com/example/umc9th/domain/mission/dto/MyMissionItem.class b/build/classes/java/main/com/example/umc9th/domain/mission/dto/MyMissionItem.class new file mode 100644 index 0000000..4815c96 Binary files /dev/null and b/build/classes/java/main/com/example/umc9th/domain/mission/dto/MyMissionItem.class differ diff --git a/build/classes/java/main/com/example/umc9th/domain/mission/entity/MemberMission.class b/build/classes/java/main/com/example/umc9th/domain/mission/entity/MemberMission.class new file mode 100644 index 0000000..1303b64 Binary files /dev/null and b/build/classes/java/main/com/example/umc9th/domain/mission/entity/MemberMission.class differ diff --git a/build/classes/java/main/com/example/umc9th/domain/mission/entity/Mission.class b/build/classes/java/main/com/example/umc9th/domain/mission/entity/Mission.class new file mode 100644 index 0000000..82b550a Binary files /dev/null and b/build/classes/java/main/com/example/umc9th/domain/mission/entity/Mission.class differ diff --git a/build/classes/java/main/com/example/umc9th/domain/mission/repository/HomeQueryRepository.class b/build/classes/java/main/com/example/umc9th/domain/mission/repository/HomeQueryRepository.class new file mode 100644 index 0000000..d351512 Binary files /dev/null and b/build/classes/java/main/com/example/umc9th/domain/mission/repository/HomeQueryRepository.class differ diff --git a/build/classes/java/main/com/example/umc9th/domain/mission/repository/MissionRepository.class b/build/classes/java/main/com/example/umc9th/domain/mission/repository/MissionRepository.class new file mode 100644 index 0000000..0ff4e70 Binary files /dev/null and b/build/classes/java/main/com/example/umc9th/domain/mission/repository/MissionRepository.class differ diff --git a/build/classes/java/main/com/example/umc9th/domain/review/entity/Reply.class b/build/classes/java/main/com/example/umc9th/domain/review/entity/Reply.class new file mode 100644 index 0000000..4350889 Binary files /dev/null and b/build/classes/java/main/com/example/umc9th/domain/review/entity/Reply.class differ diff --git a/build/classes/java/main/com/example/umc9th/domain/review/entity/Review.class b/build/classes/java/main/com/example/umc9th/domain/review/entity/Review.class new file mode 100644 index 0000000..ecbaa08 Binary files /dev/null and b/build/classes/java/main/com/example/umc9th/domain/review/entity/Review.class differ diff --git a/build/classes/java/main/com/example/umc9th/domain/review/entity/ReviewPhoto.class b/build/classes/java/main/com/example/umc9th/domain/review/entity/ReviewPhoto.class new file mode 100644 index 0000000..951985e Binary files /dev/null and b/build/classes/java/main/com/example/umc9th/domain/review/entity/ReviewPhoto.class differ diff --git a/build/classes/java/main/com/example/umc9th/domain/review/repository/ReviewRepository.class b/build/classes/java/main/com/example/umc9th/domain/review/repository/ReviewRepository.class new file mode 100644 index 0000000..4419882 Binary files /dev/null and b/build/classes/java/main/com/example/umc9th/domain/review/repository/ReviewRepository.class differ diff --git a/build/classes/java/main/com/example/umc9th/domain/store/dto/HomeMissionItem.class b/build/classes/java/main/com/example/umc9th/domain/store/dto/HomeMissionItem.class new file mode 100644 index 0000000..5528397 Binary files /dev/null and b/build/classes/java/main/com/example/umc9th/domain/store/dto/HomeMissionItem.class differ diff --git a/build/classes/java/main/com/example/umc9th/domain/store/entity/Location.class b/build/classes/java/main/com/example/umc9th/domain/store/entity/Location.class new file mode 100644 index 0000000..72ce415 Binary files /dev/null and b/build/classes/java/main/com/example/umc9th/domain/store/entity/Location.class differ diff --git a/build/classes/java/main/com/example/umc9th/domain/store/entity/Store.class b/build/classes/java/main/com/example/umc9th/domain/store/entity/Store.class new file mode 100644 index 0000000..318a169 Binary files /dev/null and b/build/classes/java/main/com/example/umc9th/domain/store/entity/Store.class differ diff --git a/build/classes/java/main/com/example/umc9th/domain/store/enums/Address.class b/build/classes/java/main/com/example/umc9th/domain/store/enums/Address.class new file mode 100644 index 0000000..a3641ac Binary files /dev/null and b/build/classes/java/main/com/example/umc9th/domain/store/enums/Address.class differ diff --git a/build/classes/java/main/com/example/umc9th/domain/store/repository/StoreRepository.class b/build/classes/java/main/com/example/umc9th/domain/store/repository/StoreRepository.class new file mode 100644 index 0000000..9ae4006 Binary files /dev/null and b/build/classes/java/main/com/example/umc9th/domain/store/repository/StoreRepository.class differ diff --git a/build/classes/java/main/com/example/umc9th/global/Umc9thApplication.class b/build/classes/java/main/com/example/umc9th/global/Umc9thApplication.class new file mode 100644 index 0000000..efa8c37 Binary files /dev/null and b/build/classes/java/main/com/example/umc9th/global/Umc9thApplication.class differ diff --git a/build/classes/java/main/com/example/umc9th/global/auth/enums/Gender.class b/build/classes/java/main/com/example/umc9th/global/auth/enums/Gender.class new file mode 100644 index 0000000..faf8b4c Binary files /dev/null and b/build/classes/java/main/com/example/umc9th/global/auth/enums/Gender.class differ diff --git a/build/classes/java/main/com/example/umc9th/global/auth/enums/SocialType.class b/build/classes/java/main/com/example/umc9th/global/auth/enums/SocialType.class new file mode 100644 index 0000000..18bff92 Binary files /dev/null and b/build/classes/java/main/com/example/umc9th/global/auth/enums/SocialType.class differ diff --git a/build/classes/java/main/com/example/umc9th/global/entity/BaseEntity.class b/build/classes/java/main/com/example/umc9th/global/entity/BaseEntity.class new file mode 100644 index 0000000..4cd1ec6 Binary files /dev/null and b/build/classes/java/main/com/example/umc9th/global/entity/BaseEntity.class differ diff --git a/build/classes/java/test/com/example/umc9th/Umc9thApplicationTests.class b/build/classes/java/test/com/example/umc9th/Umc9thApplicationTests.class new file mode 100644 index 0000000..bcec3c2 Binary files /dev/null and b/build/classes/java/test/com/example/umc9th/Umc9thApplicationTests.class differ diff --git a/build/reports/problems/problems-report.html b/build/reports/problems/problems-report.html new file mode 100644 index 0000000..1f5c969 --- /dev/null +++ b/build/reports/problems/problems-report.html @@ -0,0 +1,663 @@ + + + + + + + + + + + + + Gradle Configuration Cache + + + +
+ +
+ Loading... +
+ + + + + + diff --git a/build/resources/main/application.yml b/build/resources/main/application.yml new file mode 100644 index 0000000..b420e20 --- /dev/null +++ b/build/resources/main/application.yml @@ -0,0 +1,19 @@ +spring: + application: + name: "umc9th" # "umc9th" + + 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: create # 애플리케이션 실행 시 데이터베이스 스키마의 상태를 설정 + properties: + hibernate: + format_sql: true # 출력되는 SQL 쿼리를 보기 좋게 포맷팅 diff --git a/build/tmp/compileJava/previous-compilation-data.bin b/build/tmp/compileJava/previous-compilation-data.bin new file mode 100644 index 0000000..9f4644f Binary files /dev/null and b/build/tmp/compileJava/previous-compilation-data.bin differ diff --git a/build/tmp/compileTestJava/previous-compilation-data.bin b/build/tmp/compileTestJava/previous-compilation-data.bin new file mode 100644 index 0000000..117ddd1 Binary files /dev/null and b/build/tmp/compileTestJava/previous-compilation-data.bin differ