diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md deleted file mode 100644 index 497c7e3..0000000 --- a/.github/pull_request_template.md +++ /dev/null @@ -1,25 +0,0 @@ -## 배운 내용 - -이번 강의에서 어떤 것을 배웠나요? - -- -- - -## 어려웠던 점 - -강의에서 어려웠던 점을 자유롭게 메모해주세요 - -- -- - -## 스터디원들과 공유하고자 하는 점 - -스터디원들이 알았으면 하는 점, 혹은 함께 토론하고자 하는 내용이 있으면 적어주세요 - -- -- - -## 강의 수강 완료 사진 - -- -- \ No newline at end of file diff --git a/.gitignore b/.gitignore deleted file mode 100644 index e3e233b..0000000 --- a/.gitignore +++ /dev/null @@ -1,261 +0,0 @@ -# Created by https://www.toptal.com/developers/gitignore/api/macos,windows,gradle,java,intellij+iml,intellij+all -# Edit at https://www.toptal.com/developers/gitignore?templates=macos,windows,gradle,java,intellij+iml,intellij+all - -### Intellij+all ### -# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider -# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 - -# User-specific stuff -.idea/**/workspace.xml -.idea/**/tasks.xml -.idea/**/usage.statistics.xml -.idea/**/dictionaries -.idea/**/shelf - -# AWS User-specific -.idea/**/aws.xml - -# Generated files -.idea/**/contentModel.xml - -# Sensitive or high-churn files -.idea/**/dataSources/ -.idea/**/dataSources.ids -.idea/**/dataSources.local.xml -.idea/**/sqlDataSources.xml -.idea/**/dynamic.xml -.idea/**/uiDesigner.xml -.idea/**/dbnavigator.xml - -# Gradle -.idea/**/gradle.xml -.idea/**/libraries - -# Gradle and Maven with auto-import -# When using Gradle or Maven with auto-import, you should exclude module files, -# since they will be recreated, and may cause churn. Uncomment if using -# auto-import. -# .idea/artifacts -# .idea/compiler.xml -# .idea/jarRepositories.xml -# .idea/modules.xml -# .idea/*.iml -# .idea/modules -# *.iml -# *.ipr - -# CMake -cmake-build-*/ - -# Mongo Explorer plugin -.idea/**/mongoSettings.xml - -# File-based project format -*.iws - -# IntelliJ -out/ - -# mpeltonen/sbt-idea plugin -.idea_modules/ - -# JIRA plugin -atlassian-ide-plugin.xml - -# Cursive Clojure plugin -.idea/replstate.xml - -# SonarLint plugin -.idea/sonarlint/ - -# Crashlytics plugin (for Android Studio and IntelliJ) -com_crashlytics_export_strings.xml -crashlytics.properties -crashlytics-build.properties -fabric.properties - -# Editor-based Rest Client -.idea/httpRequests - -# Android studio 3.1+ serialized cache file -.idea/caches/build_file_checksums.ser - -### Intellij+all Patch ### -# Ignore everything but code style settings and run configurations -# that are supposed to be shared within teams. - -.idea/* - -!.idea/codeStyles -!.idea/runConfigurations - -### Intellij+iml ### -# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider -# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 - -# User-specific stuff - -# AWS User-specific - -# Generated files - -# Sensitive or high-churn files - -# Gradle - -# Gradle and Maven with auto-import -# When using Gradle or Maven with auto-import, you should exclude module files, -# since they will be recreated, and may cause churn. Uncomment if using -# auto-import. -# .idea/artifacts -# .idea/compiler.xml -# .idea/jarRepositories.xml -# .idea/modules.xml -# .idea/*.iml -# .idea/modules -# *.iml -# *.ipr - -# CMake - -# Mongo Explorer plugin - -# File-based project format - -# IntelliJ - -# mpeltonen/sbt-idea plugin - -# JIRA plugin - -# Cursive Clojure plugin - -# SonarLint plugin - -# Crashlytics plugin (for Android Studio and IntelliJ) - -# Editor-based Rest Client - -# Android studio 3.1+ serialized cache file - -### Intellij+iml Patch ### -# Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-249601023 - -*.iml -modules.xml -.idea/misc.xml -*.ipr - -### Java ### -# Compiled class file -*.class - -# Log file -*.log - -# BlueJ files -*.ctxt - -# Mobile Tools for Java (J2ME) -.mtj.tmp/ - -# Package Files # -*.jar -*.war -*.nar -*.ear -*.zip -*.tar.gz -*.rar - -# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml -hs_err_pid* -replay_pid* - -### macOS ### -# General -.DS_Store -.AppleDouble -.LSOverride - -# Icon must end with two \r -Icon - - -# Thumbnails -._* - -# Files that might appear in the root of a volume -.DocumentRevisions-V100 -.fseventsd -.Spotlight-V100 -.TemporaryItems -.Trashes -.VolumeIcon.icns -.com.apple.timemachine.donotpresent - -# Directories potentially created on remote AFP share -.AppleDB -.AppleDesktop -Network Trash Folder -Temporary Items -.apdisk - -### macOS Patch ### -# iCloud generated files -*.icloud - -### Windows ### -# Windows thumbnail cache files -Thumbs.db -Thumbs.db:encryptable -ehthumbs.db -ehthumbs_vista.db - -# Dump file -*.stackdump - -# Folder config file -[Dd]esktop.ini - -# Recycle Bin used on file shares -$RECYCLE.BIN/ - -# Windows Installer files -*.cab -*.msi -*.msix -*.msm -*.msp - -# Windows shortcuts -*.lnk - -### Gradle ### -.gradle -**/build/ -!src/**/build/ - -# Ignore Gradle GUI config -gradle-app.setting - -# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) -!gradle-wrapper.jar - -# Avoid ignore Gradle wrappper properties -!gradle-wrapper.properties - -# Cache of project -.gradletasknamecache - -# Eclipse Gradle plugin generated files -# Eclipse Core -.project -# JDT-specific (Eclipse Java Development Tools) -.classpath - -### Gradle Patch ### -# Java heap dump -*.hprof - -# End of https://www.toptal.com/developers/gitignore/api/macos,windows,gradle,java,intellij+iml,intellij+all diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 849f79e..0000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "java.compile.nullAnalysis.mode": "automatic" -} diff --git a/README.md b/README.md deleted file mode 100644 index ead0a99..0000000 --- a/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# JavaSpring-Study -자바/스프링 스터디 diff --git a/daun/.idea/.gitignore b/daun/.idea/.gitignore deleted file mode 100644 index 13566b8..0000000 --- a/daun/.idea/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml -# Editor-based HTTP Client requests -/httpRequests/ -# Datasource local storage ignored files -/dataSources/ -/dataSources.local.xml diff --git a/daun/.idea/misc.xml b/daun/.idea/misc.xml deleted file mode 100644 index a818314..0000000 --- a/daun/.idea/misc.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/daun/.idea/vcs.xml b/daun/.idea/vcs.xml deleted file mode 100644 index 6c0b863..0000000 --- a/daun/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/daun/BOJ/.idea/vcs.xml b/daun/BOJ/.idea/vcs.xml deleted file mode 100644 index b2bdec2..0000000 --- a/daun/BOJ/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/daun/BOJ/.idea/workspace.xml b/daun/BOJ/.idea/workspace.xml deleted file mode 100644 index a7f9aff..0000000 --- a/daun/BOJ/.idea/workspace.xml +++ /dev/null @@ -1,85 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - { - "associatedIndex": 4 -} - - - - - - - - - - - - - - 1695625918147 - - - - - - \ No newline at end of file diff --git a/daun/hello-spring/.gitignore b/daun/hello-spring/.gitignore deleted file mode 100644 index c2065bc..0000000 --- a/daun/hello-spring/.gitignore +++ /dev/null @@ -1,37 +0,0 @@ -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/daun/hello-spring/build.gradle b/daun/hello-spring/build.gradle deleted file mode 100644 index 99fbc83..0000000 --- a/daun/hello-spring/build.gradle +++ /dev/null @@ -1,32 +0,0 @@ -plugins { - id 'java' - id 'org.springframework.boot' version '2.7.15' - id 'io.spring.dependency-management' version '1.0.15.RELEASE' -} - -group = 'hello' -version = '0.0.1-SNAPSHOT' - -java { - sourceCompatibility = '11' -} - -repositories { - mavenCentral() -} - -dependencies { - implementation 'org.springframework.boot:spring-boot-starter-thymeleaf' - implementation 'org.springframework.boot:spring-boot-starter-web' - //implementation 'org.springframework.boot:spring-boot-starter-jdbc' - implementation 'org.springframework.boot:spring-boot-starter-data-jpa' - - runtimeOnly 'com.h2database:h2' - testImplementation ('org.springframework.boot:spring-boot-starter-test'){ - exclude group: 'org.junit.vintage', module: 'junit-vintage-engine' - } -} - -tasks.named('test') { - useJUnitPlatform() -} diff --git a/daun/hello-spring/gradle/wrapper/gradle-wrapper.jar b/daun/hello-spring/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index 033e24c..0000000 Binary files a/daun/hello-spring/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/daun/hello-spring/gradle/wrapper/gradle-wrapper.properties b/daun/hello-spring/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 9f4197d..0000000 --- a/daun/hello-spring/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,7 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip -networkTimeout=10000 -validateDistributionUrl=true -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists diff --git a/daun/hello-spring/gradlew b/daun/hello-spring/gradlew deleted file mode 100644 index fcb6fca..0000000 --- a/daun/hello-spring/gradlew +++ /dev/null @@ -1,248 +0,0 @@ -#!/bin/sh - -# -# Copyright © 2015-2021 the original authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -############################################################################## -# -# Gradle start up script for POSIX generated by Gradle. -# -# Important for running: -# -# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is -# noncompliant, but you have some other compliant shell such as ksh or -# bash, then to run this script, type that shell name before the whole -# command line, like: -# -# ksh Gradle -# -# Busybox and similar reduced shells will NOT work, because this script -# requires all of these POSIX shell features: -# * functions; -# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», -# «${var#prefix}», «${var%suffix}», and «$( cmd )»; -# * compound commands having a testable exit status, especially «case»; -# * various built-in commands including «command», «set», and «ulimit». -# -# Important for patching: -# -# (2) This script targets any POSIX shell, so it avoids extensions provided -# by Bash, Ksh, etc; in particular arrays are avoided. -# -# The "traditional" practice of packing multiple parameters into a -# space-separated string is a well documented source of bugs and security -# problems, so this is (mostly) avoided, by progressively accumulating -# options in "$@", and eventually passing that to Java. -# -# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, -# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; -# see the in-line comments for details. -# -# There are tweaks for specific operating systems such as AIX, CygWin, -# Darwin, MinGW, and NonStop. -# -# (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt -# within the Gradle project. -# -# You can find Gradle at https://github.com/gradle/gradle/. -# -############################################################################## - -# Attempt to set APP_HOME - -# Resolve links: $0 may be a link -app_path=$0 - -# Need this for daisy-chained symlinks. -while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] -do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac -done - -# This is normally unused -# shellcheck disable=SC2034 -APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum - -warn () { - echo "$*" -} >&2 - -die () { - echo - echo "$*" - echo - exit 1 -} >&2 - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -nonstop=false -case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; -esac - -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar - - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD=java - if ! command -v java >/dev/null 2>&1 - then - die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -fi - -# Increase the maximum file descriptors if we can. -if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac -fi - -# Collect all arguments for the java command, stacking in reverse order: -# * args from the command line -# * the main class name -# * -classpath -# * -D...appname settings -# * --module-path (only if needed) -# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. - -# For Cygwin or MSYS, switch paths to Windows format before running java -if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - - JAVACMD=$( cygpath --unix "$JAVACMD" ) - - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done -fi - - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' - -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. - -set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" - -# Stop when "xargs" is not available. -if ! command -v xargs >/dev/null 2>&1 -then - die "xargs is not available" -fi - -# Use "xargs" to parse quoted args. -# -# With -n1 it outputs one arg per line, with the quotes and backslashes removed. -# -# In Bash we could simply go: -# -# readarray ARGS < <( xargs -n1 <<<"$var" ) && -# set -- "${ARGS[@]}" "$@" -# -# but POSIX shell has neither arrays nor command substitution, so instead we -# post-process each arg (as a line of input to sed) to backslash-escape any -# character that might be a shell metacharacter, then use eval to reverse -# that process (while maintaining the separation between arguments), and wrap -# the whole thing up as a single "set" statement. -# -# This will of course break if any of these variables contains a newline or -# an unmatched quote. -# - -eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' - -exec "$JAVACMD" "$@" diff --git a/daun/hello-spring/gradlew.bat b/daun/hello-spring/gradlew.bat deleted file mode 100644 index 93e3f59..0000000 --- a/daun/hello-spring/gradlew.bat +++ /dev/null @@ -1,92 +0,0 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem - -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* - -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/daun/hello-spring/settings.gradle b/daun/hello-spring/settings.gradle deleted file mode 100644 index 69a39da..0000000 --- a/daun/hello-spring/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -rootProject.name = 'hello-spring' diff --git a/daun/hello-spring/sql/ddl.sql b/daun/hello-spring/sql/ddl.sql deleted file mode 100644 index b20616c..0000000 --- a/daun/hello-spring/sql/ddl.sql +++ /dev/null @@ -1,7 +0,0 @@ -drop table if exists member CASCADE; -create table member -( - id bigint generated by default as identity, - name varchar(255), - primary key (id) -); \ No newline at end of file diff --git a/daun/hello-spring/src/main/java/hello/hellospring/AOP/TimeTraceAop.java b/daun/hello-spring/src/main/java/hello/hellospring/AOP/TimeTraceAop.java deleted file mode 100644 index fa47634..0000000 --- a/daun/hello-spring/src/main/java/hello/hellospring/AOP/TimeTraceAop.java +++ /dev/null @@ -1,24 +0,0 @@ -package hello.hellospring.AOP; - -import org.aspectj.lang.ProceedingJoinPoint; -import org.aspectj.lang.annotation.Around; -import org.aspectj.lang.annotation.Aspect; -import org.springframework.stereotype.Component; - -@Aspect -@Component -public class TimeTraceAop { - - @Around("execution(* hello.hellospring..*(..))") - public Object execute(ProceedingJoinPoint joinPoint) throws Throwable{ - long start = System.currentTimeMillis(); - System.out.println("START: " + joinPoint.toString()); - try{ - return joinPoint.proceed(); - }finally { - long finish = System.currentTimeMillis(); - long timeMs = finish - start; - System.out.println("START: " + joinPoint.toString() + " " + timeMs + "ms"); - } - } -} diff --git a/daun/hello-spring/src/main/java/hello/hellospring/HelloSpringApplication.java b/daun/hello-spring/src/main/java/hello/hellospring/HelloSpringApplication.java deleted file mode 100644 index f0f0fd4..0000000 --- a/daun/hello-spring/src/main/java/hello/hellospring/HelloSpringApplication.java +++ /dev/null @@ -1,13 +0,0 @@ -package hello.hellospring; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; - -@SpringBootApplication -public class HelloSpringApplication { - - public static void main(String[] args) { - SpringApplication.run(HelloSpringApplication.class, args); - } - -} diff --git a/daun/hello-spring/src/main/java/hello/hellospring/SpringConfig.java b/daun/hello-spring/src/main/java/hello/hellospring/SpringConfig.java deleted file mode 100644 index b0e4b7b..0000000 --- a/daun/hello-spring/src/main/java/hello/hellospring/SpringConfig.java +++ /dev/null @@ -1,35 +0,0 @@ -package hello.hellospring; -import hello.hellospring.AOP.TimeTraceAop; -import hello.hellospring.repository.*; -import hello.hellospring.service.MemberService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -@Configuration -public class SpringConfig { - private final MemberRepository memberRepository; - - @Autowired - public SpringConfig(MemberRepository memberRepository) { - this.memberRepository = memberRepository; - } - - @Bean - public MemberService memberService() { - return new MemberService(memberRepository); - } - -// @Bean -// public TimeTraceAop timeTraceAop(){ -// return new TimeTraceAop(); -// } -// @Bean -// public MemberRepository memberRepository() { -//// return new MemoryMemberRepository(); -//// return new JdbcMemberRepository(dataSource); -//// return new JdbcTemplateMemberRepository(dataSource); -//// return new JpaMemberRepository(em); -// -// } -} \ No newline at end of file diff --git a/daun/hello-spring/src/main/java/hello/hellospring/controller/HelloController.java b/daun/hello-spring/src/main/java/hello/hellospring/controller/HelloController.java deleted file mode 100644 index bb9e0a1..0000000 --- a/daun/hello-spring/src/main/java/hello/hellospring/controller/HelloController.java +++ /dev/null @@ -1,46 +0,0 @@ -package hello.hellospring.controller; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; - -@Controller -public class HelloController { - @GetMapping("hello") - public String hello(Model model) { - model.addAttribute("data", "hello!!"); - return "hello"; - } - - @GetMapping("hello-mvc") - public String helloMvc(@RequestParam("name") String name, Model model) { - model.addAttribute("name", name); - return "hello-template"; - } - - @GetMapping("hello-string") - @ResponseBody - public String helloString(@RequestParam("name") String name){ - return "hello " + name; //name이 spring이라면 "hello spring" - } - - @GetMapping("hello-api") - @ResponseBody - public Hello helloApi(@RequestParam("name") String name) { - Hello hello = new Hello(); - hello.setName(name); - return hello; - } - static class Hello { - private String name; - public String getName() { - return name; - } - public void setName(String name) { - this.name = name; - } - } -} - diff --git a/daun/hello-spring/src/main/java/hello/hellospring/controller/HomeController.java b/daun/hello-spring/src/main/java/hello/hellospring/controller/HomeController.java deleted file mode 100644 index d74d0cc..0000000 --- a/daun/hello-spring/src/main/java/hello/hellospring/controller/HomeController.java +++ /dev/null @@ -1,13 +0,0 @@ -package hello.hellospring.controller; - -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.GetMapping; - -@Controller -public class HomeController { - - @GetMapping("/") - public String home(){ - return "home"; - } -} diff --git a/daun/hello-spring/src/main/java/hello/hellospring/controller/MemberController.java b/daun/hello-spring/src/main/java/hello/hellospring/controller/MemberController.java deleted file mode 100644 index b3aea34..0000000 --- a/daun/hello-spring/src/main/java/hello/hellospring/controller/MemberController.java +++ /dev/null @@ -1,45 +0,0 @@ -package hello.hellospring.controller; - -import hello.hellospring.domain.Member; -import hello.hellospring.service.MemberService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; - -import java.util.List; - -@Controller -public class MemberController { - - private final MemberService memberService; - - @Autowired - public MemberController(MemberService memberService) { - this.memberService = memberService; - } - @GetMapping(value = "/members/new") - public String createForm() { - return "members/createMemberForm"; - } - - @PostMapping(value = "/members/new") - public String create(MemberForm form) { - Member member = new Member(); - member.setName(form.getName()); - - System.out.println("member = " + member.getName()); - - memberService.join(member); - - return "redirect:/"; - } - - @GetMapping("/members") - public String list(Model model){ - List members = memberService.findMembers(); - model.addAttribute("members", members); - return "members/memberList"; - } -} diff --git a/daun/hello-spring/src/main/java/hello/hellospring/controller/MemberForm.java b/daun/hello-spring/src/main/java/hello/hellospring/controller/MemberForm.java deleted file mode 100644 index ee80768..0000000 --- a/daun/hello-spring/src/main/java/hello/hellospring/controller/MemberForm.java +++ /dev/null @@ -1,13 +0,0 @@ -package hello.hellospring.controller; - -public class MemberForm { - private String name; - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } -} diff --git a/daun/hello-spring/src/main/java/hello/hellospring/domain/Member.java b/daun/hello-spring/src/main/java/hello/hellospring/domain/Member.java deleted file mode 100644 index d64b60b..0000000 --- a/daun/hello-spring/src/main/java/hello/hellospring/domain/Member.java +++ /dev/null @@ -1,23 +0,0 @@ -package hello.hellospring.domain; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -@Entity -public class Member { - @Id @GeneratedValue(strategy = GenerationType.IDENTITY) - private Long id; - private String name; - public Long getId() { - return id; - } - public void setId(Long id) { - this.id = id; - } - public String getName() { - return name; - } - public void setName(String name) { - this.name = name; - } -} \ No newline at end of file diff --git a/daun/hello-spring/src/main/java/hello/hellospring/repository/JdbcMemberRepository.java b/daun/hello-spring/src/main/java/hello/hellospring/repository/JdbcMemberRepository.java deleted file mode 100644 index 5723959..0000000 --- a/daun/hello-spring/src/main/java/hello/hellospring/repository/JdbcMemberRepository.java +++ /dev/null @@ -1,142 +0,0 @@ -package hello.hellospring.repository; -import hello.hellospring.domain.Member; -import org.springframework.jdbc.datasource.DataSourceUtils; -import javax.sql.DataSource; -import java.sql.*; -import java.util.ArrayList; -import java.util.List; -import java.util.Optional; -public class JdbcMemberRepository implements MemberRepository { - private final DataSource dataSource; - public JdbcMemberRepository(DataSource dataSource) { - this.dataSource = dataSource; - } - @Override - public Member save(Member member) { - String sql = "insert into member(name) values(?)"; - Connection conn = null; - PreparedStatement pstmt = null; - ResultSet rs = null; - try { - conn = getConnection(); - pstmt = conn.prepareStatement(sql, - Statement.RETURN_GENERATED_KEYS); - pstmt.setString(1, member.getName()); - pstmt.executeUpdate(); - rs = pstmt.getGeneratedKeys(); - if (rs.next()) { - member.setId(rs.getLong(1)); - } else { - throw new SQLException("id 조회 실패"); - } - return member; - } catch (Exception e) { - throw new IllegalStateException(e); - } finally { - close(conn, pstmt, rs); - } - } - @Override - public Optional findById(Long id) { - String sql = "select * from member where id = ?"; - Connection conn = null; - PreparedStatement pstmt = null; - ResultSet rs = null; - try { - conn = getConnection(); - pstmt = conn.prepareStatement(sql); - pstmt.setLong(1, id); - rs = pstmt.executeQuery(); - if(rs.next()) { - Member member = new Member(); - member.setId(rs.getLong("id")); - member.setName(rs.getString("name")); - return Optional.of(member); - } else { - return Optional.empty(); - } - } catch (Exception e) { - throw new IllegalStateException(e); - } finally { - close(conn, pstmt, rs); - } - } - @Override - public List findAll() { - String sql = "select * from member"; - Connection conn = null; - PreparedStatement pstmt = null; - ResultSet rs = null; - try { - conn = getConnection(); - pstmt = conn.prepareStatement(sql); - rs = pstmt.executeQuery(); - List members = new ArrayList<>(); - while(rs.next()) { - Member member = new Member(); - member.setId(rs.getLong("id")); - member.setName(rs.getString("name")); - members.add(member); - } - return members; - } catch (Exception e) { - throw new IllegalStateException(e); - } finally { - close(conn, pstmt, rs); - } - } - @Override - public Optional findByName(String name) { - String sql = "select * from member where name = ?"; - Connection conn = null; - PreparedStatement pstmt = null; - ResultSet rs = null; - try { - conn = getConnection(); - pstmt = conn.prepareStatement(sql); - pstmt.setString(1, name); - rs = pstmt.executeQuery(); - if(rs.next()) { - Member member = new Member(); - member.setId(rs.getLong("id")); - member.setName(rs.getString("name")); - return Optional.of(member); - } - return Optional.empty(); - } catch (Exception e) { - throw new IllegalStateException(e); - } finally { - close(conn, pstmt, rs); - } - } - private Connection getConnection() { - return DataSourceUtils.getConnection(dataSource); - } - private void close(Connection conn, PreparedStatement pstmt, ResultSet rs) - { - try { - if (rs != null) { - rs.close(); - } - } catch (SQLException e) { - e.printStackTrace(); - } - try { - if (pstmt != null) { - pstmt.close(); - } - } catch (SQLException e) { - e.printStackTrace(); - } - try { - if (conn != null) { - close(conn); - } - } catch (SQLException e) { - e.printStackTrace(); - } - } - private void close(Connection conn) throws SQLException { - DataSourceUtils.releaseConnection(conn, dataSource); - } -} \ No newline at end of file diff --git a/daun/hello-spring/src/main/java/hello/hellospring/repository/JdbcTemplateMemberRepository.java b/daun/hello-spring/src/main/java/hello/hellospring/repository/JdbcTemplateMemberRepository.java deleted file mode 100644 index eaeb96c..0000000 --- a/daun/hello-spring/src/main/java/hello/hellospring/repository/JdbcTemplateMemberRepository.java +++ /dev/null @@ -1,52 +0,0 @@ -package hello.hellospring.repository; -import hello.hellospring.domain.Member; -import org.springframework.jdbc.core.JdbcTemplate; -import org.springframework.jdbc.core.RowMapper; -import org.springframework.jdbc.core.namedparam.MapSqlParameterSource; -import org.springframework.jdbc.core.simple.SimpleJdbcInsert; -import javax.sql.DataSource; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Optional; -public class JdbcTemplateMemberRepository implements MemberRepository { - private final JdbcTemplate jdbcTemplate; - public JdbcTemplateMemberRepository(DataSource dataSource) { - jdbcTemplate = new JdbcTemplate(dataSource); - } - @Override - public Member save(Member member) { - SimpleJdbcInsert jdbcInsert = new SimpleJdbcInsert(jdbcTemplate); - jdbcInsert.withTableName("member").usingGeneratedKeyColumns("id"); - Map parameters = new HashMap<>(); - parameters.put("name", member.getName()); - Number key = jdbcInsert.executeAndReturnKey(new - MapSqlParameterSource(parameters)); - member.setId(key.longValue()); - return member; - } - @Override - public Optional findById(Long id) { - List result = jdbcTemplate.query("select * from member where id = ?", memberRowMapper(), id); - return result.stream().findAny(); - } - @Override - public List findAll() { - return jdbcTemplate.query("select * from member", memberRowMapper()); - } - @Override - public Optional findByName(String name) { - List result = jdbcTemplate.query("select * from member where name = ?", memberRowMapper(), name); - return result.stream().findAny(); - } - private RowMapper memberRowMapper() { - return (rs, rowNum) -> { - Member member = new Member(); - member.setId(rs.getLong("id")); - member.setName(rs.getString("name")); - return member; - }; - } -} \ No newline at end of file diff --git a/daun/hello-spring/src/main/java/hello/hellospring/repository/JpaMemberRepository.java b/daun/hello-spring/src/main/java/hello/hellospring/repository/JpaMemberRepository.java deleted file mode 100644 index 3d97919..0000000 --- a/daun/hello-spring/src/main/java/hello/hellospring/repository/JpaMemberRepository.java +++ /dev/null @@ -1,29 +0,0 @@ -package hello.hellospring.repository; -import hello.hellospring.domain.Member; -import javax.persistence.EntityManager; -import java.util.List; -import java.util.Optional; -public class JpaMemberRepository implements MemberRepository { - private final EntityManager em; - public JpaMemberRepository(EntityManager em) { - this.em = em; - } - public Member save(Member member) { - em.persist(member); - return member; - } - public Optional findById(Long id) { - Member member = em.find(Member.class, id); - return Optional.ofNullable(member); - } - public List findAll() { - return em.createQuery("select m from Member m", Member.class) - .getResultList(); - } - public Optional findByName(String name) { - List result = em.createQuery("select m from Member m where m.name = :name", Member.class) - .setParameter("name", name) - .getResultList(); - return result.stream().findAny(); - } -} \ No newline at end of file diff --git a/daun/hello-spring/src/main/java/hello/hellospring/repository/MemberRepository.java b/daun/hello-spring/src/main/java/hello/hellospring/repository/MemberRepository.java deleted file mode 100644 index 0b196cb..0000000 --- a/daun/hello-spring/src/main/java/hello/hellospring/repository/MemberRepository.java +++ /dev/null @@ -1,12 +0,0 @@ -package hello.hellospring.repository; - -import hello.hellospring.domain.Member; - -import java.util.List; -import java.util.Optional; -public interface MemberRepository { - Member save(Member member); - Optional findById(Long id); - Optional findByName(String name); - List findAll(); -} diff --git a/daun/hello-spring/src/main/java/hello/hellospring/repository/MemoryMemberRepository.java b/daun/hello-spring/src/main/java/hello/hellospring/repository/MemoryMemberRepository.java deleted file mode 100644 index 2434846..0000000 --- a/daun/hello-spring/src/main/java/hello/hellospring/repository/MemoryMemberRepository.java +++ /dev/null @@ -1,40 +0,0 @@ -package hello.hellospring.repository; - -import hello.hellospring.domain.Member; - -import java.util.*; - - -public class MemoryMemberRepository implements MemberRepository{ - - private static Map store = new HashMap<>(); - private static long sequence = 0L; - - @Override - public Member save(Member member) { - member.setId(++sequence); - store.put(member.getId(), member); - return member; - } - - @Override - public Optional findById(Long id) { - return Optional.ofNullable(store.get(id)); - } - - @Override - public Optional findByName(String name) { - return store.values().stream() - .filter(member -> member.getName().equals(name)) - .findAny(); - } - - @Override - public List findAll() { - return new ArrayList<>(store.values()); - } - - public void clearStore(){ - store.clear(); - } -} diff --git a/daun/hello-spring/src/main/java/hello/hellospring/repository/SpringDataJpaMemberRepository.java b/daun/hello-spring/src/main/java/hello/hellospring/repository/SpringDataJpaMemberRepository.java deleted file mode 100644 index 00d9682..0000000 --- a/daun/hello-spring/src/main/java/hello/hellospring/repository/SpringDataJpaMemberRepository.java +++ /dev/null @@ -1,13 +0,0 @@ -package hello.hellospring.repository; - -import hello.hellospring.domain.Member; -import org.springframework.data.jpa.repository.JpaRepository; - -import java.util.Optional; - -public interface SpringDataJpaMemberRepository extends JpaRepository, MemberRepository { - - //JPQL select m from Member m where m.name = ? - @Override - Optional findByName(String name); -} diff --git a/daun/hello-spring/src/main/java/hello/hellospring/service/MemberService.java b/daun/hello-spring/src/main/java/hello/hellospring/service/MemberService.java deleted file mode 100644 index 617e490..0000000 --- a/daun/hello-spring/src/main/java/hello/hellospring/service/MemberService.java +++ /dev/null @@ -1,55 +0,0 @@ -package hello.hellospring.service; - -import hello.hellospring.domain.Member; -import hello.hellospring.repository.MemberRepository; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import javax.transaction.Transactional; -import java.util.List; -import java.util.Optional; - -@Transactional -public class MemberService { - - private final MemberRepository memberRepository; - public MemberService(MemberRepository memberRepository) { - this.memberRepository = memberRepository; - } - - /** - * 회원가입 - */ - public Long join(Member member){ - - long start = System.currentTimeMillis(); - - try { - validateDuplicateMember(member); //중복 회원 검증 - memberRepository.save(member); - return member.getId(); - }finally { - long finish = System.currentTimeMillis(); - long timeMs = finish - start; - System.out.println("join = " + timeMs + "ms"); - } - //같은 이름이 있는 중복 회원X - } - - private void validateDuplicateMember(Member member) { - memberRepository.findByName(member.getName()) - .ifPresent(m -> { - throw new IllegalStateException("이미 존재하는 회원입니다."); - }); - } - - /** - * 전체 회원 조회 - */ - public List findMembers(){ - return memberRepository.findAll(); - } - public Optional findOne(Long memberId) - {return memberRepository.findById(memberId); - } -} diff --git a/daun/hello-spring/src/main/resources/application.properties b/daun/hello-spring/src/main/resources/application.properties deleted file mode 100644 index 8e34fa9..0000000 --- a/daun/hello-spring/src/main/resources/application.properties +++ /dev/null @@ -1,5 +0,0 @@ -spring.datasource.url=jdbc:h2:tcp://localhost/~/test -spring.datasource.driver-class-name=org.h2.Driver -spring.datasource.username=sa -spring.jpa.show-sql=true -spring.jpa.hibernate.ddl-auto=none \ No newline at end of file diff --git a/daun/hello-spring/src/main/resources/static/hello-static.html b/daun/hello-spring/src/main/resources/static/hello-static.html deleted file mode 100644 index 68254b2..0000000 --- a/daun/hello-spring/src/main/resources/static/hello-static.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - static content - - - -정적 컨텐츠 입니다. - - \ No newline at end of file diff --git a/daun/hello-spring/src/main/resources/static/index.html b/daun/hello-spring/src/main/resources/static/index.html deleted file mode 100644 index 3bf7dfa..0000000 --- a/daun/hello-spring/src/main/resources/static/index.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - Hello - - - -Hello -hello - - \ No newline at end of file diff --git a/daun/hello-spring/src/main/resources/templates/hello-template.html b/daun/hello-spring/src/main/resources/templates/hello-template.html deleted file mode 100644 index 66c25d8..0000000 --- a/daun/hello-spring/src/main/resources/templates/hello-template.html +++ /dev/null @@ -1,5 +0,0 @@ - - -

hello! empty

- - \ No newline at end of file diff --git a/daun/hello-spring/src/main/resources/templates/hello.html b/daun/hello-spring/src/main/resources/templates/hello.html deleted file mode 100644 index 81f8f1c..0000000 --- a/daun/hello-spring/src/main/resources/templates/hello.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - Hello - - - -

안녕하세요. 손님

- - \ No newline at end of file diff --git a/daun/hello-spring/src/main/resources/templates/home.html b/daun/hello-spring/src/main/resources/templates/home.html deleted file mode 100644 index 109d59d..0000000 --- a/daun/hello-spring/src/main/resources/templates/home.html +++ /dev/null @@ -1,15 +0,0 @@ - - - -
-
-

Hello Spring

-

회원 기능

-

- 회원 가입 - 회원 목록 -

-
-
- - \ No newline at end of file diff --git a/daun/hello-spring/src/main/resources/templates/members/createMemberForm.html b/daun/hello-spring/src/main/resources/templates/members/createMemberForm.html deleted file mode 100644 index f7c2486..0000000 --- a/daun/hello-spring/src/main/resources/templates/members/createMemberForm.html +++ /dev/null @@ -1,15 +0,0 @@ - - - -
-
-
- - -
- -
-
- - \ No newline at end of file diff --git a/daun/hello-spring/src/main/resources/templates/members/memberList.html b/daun/hello-spring/src/main/resources/templates/members/memberList.html deleted file mode 100644 index 31aaf5e..0000000 --- a/daun/hello-spring/src/main/resources/templates/members/memberList.html +++ /dev/null @@ -1,23 +0,0 @@ - - - -
-
- - - - - - - - - - - - - -
#이름
-
-
- - \ No newline at end of file diff --git a/daun/hello-spring/src/test/java/hello/hellospring/HelloSpringApplicationTests.java b/daun/hello-spring/src/test/java/hello/hellospring/HelloSpringApplicationTests.java deleted file mode 100644 index 87d37cf..0000000 --- a/daun/hello-spring/src/test/java/hello/hellospring/HelloSpringApplicationTests.java +++ /dev/null @@ -1,13 +0,0 @@ -package hello.hellospring; - -import org.junit.jupiter.api.Test; -import org.springframework.boot.test.context.SpringBootTest; - -@SpringBootTest -class HelloSpringApplicationTests { - - @Test - void contextLoads() { - } - -} diff --git a/daun/hello-spring/src/test/java/hello/hellospring/repository/MemoryMemberRepositoryTest.java b/daun/hello-spring/src/test/java/hello/hellospring/repository/MemoryMemberRepositoryTest.java deleted file mode 100644 index 76092ce..0000000 --- a/daun/hello-spring/src/test/java/hello/hellospring/repository/MemoryMemberRepositoryTest.java +++ /dev/null @@ -1,55 +0,0 @@ -package hello.hellospring.repository; -import hello.hellospring.domain.Member; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.Test; -import java.util.List; -import java.util.Optional; -import static org.assertj.core.api.Assertions.*; -class MemoryMemberRepositoryTest { - MemoryMemberRepository repository = new MemoryMemberRepository(); - - @AfterEach - public void afterEach(){ - repository.clearStore(); - } - - @Test - public void save() { - //given - Member member = new Member(); - member.setName("spring"); - //when - repository.save(member); - //then - Member result = repository.findById(member.getId()).get(); - assertThat(result).isEqualTo(member); - } - @Test - public void findByName() { - //given - Member member1 = new Member(); - member1.setName("spring1"); - repository.save(member1); - Member member2 = new Member(); - member2.setName("spring2"); - repository.save(member2); - //when - Member result = repository.findByName("spring1").get(); - //then - assertThat(result).isEqualTo(member1); - } - @Test - public void findAll() { - //given - Member member1 = new Member(); - member1.setName("spring1"); - repository.save(member1); - Member member2 = new Member(); - member2.setName("spring2"); - repository.save(member2); - //when - List result = repository.findAll(); - //then - assertThat(result.size()).isEqualTo(2); - } -} diff --git a/daun/hello-spring/src/test/java/hello/hellospring/service/MemberServiceIntegrationTest.java b/daun/hello-spring/src/test/java/hello/hellospring/service/MemberServiceIntegrationTest.java deleted file mode 100644 index 397a462..0000000 --- a/daun/hello-spring/src/test/java/hello/hellospring/service/MemberServiceIntegrationTest.java +++ /dev/null @@ -1,41 +0,0 @@ -package hello.hellospring.service; -import hello.hellospring.domain.Member; -import hello.hellospring.repository.MemberRepository; -import org.junit.jupiter.api.Test; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.annotation.Commit; -import org.springframework.transaction.annotation.Transactional; -import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertThrows; -@SpringBootTest -@Transactional -class MemberServiceIntegrationTest { - @Autowired MemberService memberService; - @Autowired MemberRepository memberRepository; - @Test - public void 회원가입() throws Exception { - //Given - Member member = new Member(); - member.setName("hello"); - //When - Long saveId = memberService.join(member); - //Then - Member findMember = memberRepository.findById(saveId).get(); - assertEquals(member.getName(), findMember.getName()); - } - @Test - public void 중복_회원_예외() throws Exception { - //Given - Member member1 = new Member(); - member1.setName("spring"); - Member member2 = new Member(); - member2.setName("spring"); - //When - memberService.join(member1); - IllegalStateException e = assertThrows(IllegalStateException.class, - () -> memberService.join(member2));//예외가 발생해야 한다. - assertThat(e.getMessage()).isEqualTo("이미 존재하는 회원입니다."); - } -} diff --git a/daun/hello-spring/src/test/java/hello/hellospring/service/MemberServiceTest.java b/daun/hello-spring/src/test/java/hello/hellospring/service/MemberServiceTest.java deleted file mode 100644 index ad14852..0000000 --- a/daun/hello-spring/src/test/java/hello/hellospring/service/MemberServiceTest.java +++ /dev/null @@ -1,75 +0,0 @@ -package hello.hellospring.service; - -import hello.hellospring.domain.Member; -import hello.hellospring.repository.MemoryMemberRepository; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -import static org.assertj.core.api.Assertions.*; -import static org.junit.jupiter.api.Assertions.*; - -class MemberServiceTest { - - MemberService memberService; - MemoryMemberRepository memberRepository; - - @BeforeEach - public void beforEach(){ - memberRepository = new MemoryMemberRepository(); - memberService = new MemberService(memberRepository); - } - - - @AfterEach - public void afterEach(){ - memberRepository.clearStore(); - } - - @Test - void 회원가입() { - //given - Member member = new Member(); - member.setName("spring"); - - //when - Long saveId = memberService.join(member); - - //then - Member findMember = memberService.findOne(saveId).get(); - assertThat(member.getName()).isEqualTo(findMember.getName()); - } - - @Test - public void 중복_회원_예외(){ - //given - Member member1 = new Member(); - member1.setName("spring"); - - Member member2 = new Member(); - member2.setName("spring"); - - //when - memberService.join(member1); - IllegalStateException e = assertThrows(IllegalStateException.class, () -> memberService.join(member2)); - - assertThat(e.getMessage()).isEqualTo("이미 존재하는 회원입니다."); - -// try { -// memberService.join(member2); -// fail(); -// }catch (IllegalStateException e){ -// assertThat(e.getMessage()).isEqualTo("이미 존재하는 회원입니다."); -// } - - //then - } - - @Test - void findMembers() { - } - - @Test - void findOne() { - } -} \ No newline at end of file diff --git a/daun/untitled/.gitignore b/daun/untitled/.gitignore deleted file mode 100644 index f68d109..0000000 --- a/daun/untitled/.gitignore +++ /dev/null @@ -1,29 +0,0 @@ -### IntelliJ IDEA ### -out/ -!**/src/main/**/out/ -!**/src/test/**/out/ - -### Eclipse ### -.apt_generated -.classpath -.factorypath -.project -.settings -.springBeans -.sts4-cache -bin/ -!**/src/main/**/bin/ -!**/src/test/**/bin/ - -### NetBeans ### -/nbproject/private/ -/nbbuild/ -/dist/ -/nbdist/ -/.nb-gradle/ - -### VS Code ### -.vscode/ - -### Mac OS ### -.DS_Store \ No newline at end of file diff --git a/daun/untitled/.idea/.gitignore b/daun/untitled/.idea/.gitignore deleted file mode 100644 index 13566b8..0000000 --- a/daun/untitled/.idea/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml -# Editor-based HTTP Client requests -/httpRequests/ -# Datasource local storage ignored files -/dataSources/ -/dataSources.local.xml diff --git a/daun/untitled/.idea/misc.xml b/daun/untitled/.idea/misc.xml deleted file mode 100644 index 07115cd..0000000 --- a/daun/untitled/.idea/misc.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/daun/untitled/.idea/uiDesigner.xml b/daun/untitled/.idea/uiDesigner.xml deleted file mode 100644 index 2b63946..0000000 --- a/daun/untitled/.idea/uiDesigner.xml +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/daun/untitled/.idea/vcs.xml b/daun/untitled/.idea/vcs.xml deleted file mode 100644 index b2bdec2..0000000 --- a/daun/untitled/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/daun/untitled/src/Main.java b/daun/untitled/src/Main.java deleted file mode 100644 index 3e59c38..0000000 --- a/daun/untitled/src/Main.java +++ /dev/null @@ -1,5 +0,0 @@ -public class Main { - public static void main(String[] args) { - System.out.println("Hello world!"); - } -} \ No newline at end of file diff --git a/daun/untitled/src/java_10818/Main.java b/daun/untitled/src/java_10818/Main.java deleted file mode 100644 index 3c76253..0000000 --- a/daun/untitled/src/java_10818/Main.java +++ /dev/null @@ -1,39 +0,0 @@ -package java_10818; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Scanner; - -public class Main { - public static void main(String[] args) { - Scanner scanner = new Scanner(System.in); - int N = scanner.nextInt(); - int[] arr = new int[N]; - for (int i = 0; i < N; i++) { - arr[i] = scanner.nextInt(); - } - Arrays.sort(arr); - System.out.println(arr[0] + " " + arr[N - 1]); - - /* - Scanner scanner1 = new Scanner(System.in); - List List = new ArrayList(); - for(int i = 0; i < N; i++) { - List.add(String.valueOf(scanner1.nextInt())); - } - int max = 0; - int min = Integer.parseInt(List.get(0)); - for(int i = 0; i < N; i++){ - if(max < Integer.parseInt(List.get(i))){ - max = Integer.parseInt(List.get(i)); - } - if(min > Integer.parseInt(List.get(i))){ - min = Integer.parseInt(List.get(i)); - } - } - System.out.println(min + " " + max); - } - */ - } -} diff --git a/daun/untitled/src/java_10926/Main.java b/daun/untitled/src/java_10926/Main.java deleted file mode 100644 index ad9207e..0000000 --- a/daun/untitled/src/java_10926/Main.java +++ /dev/null @@ -1,11 +0,0 @@ -package java_10926; - -import java.util.Scanner; - -public class Main { - public static void main(String[] args){ - Scanner scanner = new Scanner(System.in); - String id = scanner.nextLine(); - System.out.println(id + "??!"); - } -} diff --git a/daun/untitled/src/java_1110/Main.java b/daun/untitled/src/java_1110/Main.java deleted file mode 100644 index c77c287..0000000 --- a/daun/untitled/src/java_1110/Main.java +++ /dev/null @@ -1,24 +0,0 @@ -package java_1110; -import java.util.Scanner; -public class Main { - public static void main(String[] args) { - Scanner scanner = new Scanner(System.in); - int n = scanner.nextInt(); - scanner.close(); - - int num = n; - int cn = 0; - - while (true) { - int a = num / 10; - int b = num % 10; - int c = (a + b) % 10; - num = (b * 10) + c; - cn++; - if (num == n) { - break; - } - } - System.out.println(cn); - } -} diff --git a/daun/untitled/src/java_11721/TimeCalculator.java b/daun/untitled/src/java_11721/TimeCalculator.java deleted file mode 100644 index dee3d04..0000000 --- a/daun/untitled/src/java_11721/TimeCalculator.java +++ /dev/null @@ -1,17 +0,0 @@ -package java_11721; -import java.util.Scanner; - -public class TimeCalculator { - public static void main(String []args){ - Scanner scanner = new Scanner(System.in); - String N = scanner.next(); - scanner.close(); - - for(int i = 0; i < N.length(); i++){ - System.out.print(N.charAt(i)); - if(i % 10 == 9){ - System.out.println(); - } - } - } -} diff --git a/daun/untitled/src/java_2443/Main.java b/daun/untitled/src/java_2443/Main.java deleted file mode 100644 index 8540bd3..0000000 --- a/daun/untitled/src/java_2443/Main.java +++ /dev/null @@ -1,20 +0,0 @@ -package java_2443; -import java.util.Scanner; - -public class Main { - public static void main(String[] args) { - Scanner scanner = new Scanner(System.in); - int n = scanner.nextInt(); - scanner.close(); - for (int i = n; i > 0; i--) { - for (int j = 1; j <= n + i - 1; j++) { - if (j <= n - i) { - System.out.print(" "); - } else { - System.out.print("*"); - } - } - System.out.println(); - } - } -} diff --git a/daun/untitled/src/java_25314/Main.java b/daun/untitled/src/java_25314/Main.java deleted file mode 100644 index e3bfbe1..0000000 --- a/daun/untitled/src/java_25314/Main.java +++ /dev/null @@ -1,24 +0,0 @@ -package java_25314; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Scanner; - -public class Main { - public static void main(String[] args){ - Scanner scanner = new Scanner(System.in); - int N = scanner.nextInt(); - int n = N / 4; - System.out.println("long ".repeat(n) + "int"); - /* - List List = new ArrayList(); - for (int i = 0; i < N; i++){ - List.add("long "); - } - List.add("int"); - for(int i = 0; i<(N + 1); i++) { - System.out.println(List.get(i)); - }*/ - } -} diff --git a/daun/untitled/src/java_2587/Main.java b/daun/untitled/src/java_2587/Main.java deleted file mode 100644 index 0f73d4b..0000000 --- a/daun/untitled/src/java_2587/Main.java +++ /dev/null @@ -1,20 +0,0 @@ -package java_2587; - -import java.util.Arrays; -import java.util.Scanner; - -public class Main { - public static void main(String[] args){ - Scanner scanner = new Scanner(System.in); - // int N = scanner.nextInt(); - int[] arr = new int[5]; - int sum = 0; - for(int i = 0; i < 5; i++){ - arr[i] = scanner.nextInt(); - sum = sum + arr[i]; - } - Arrays.sort(arr); - System.out.println(sum / 5); - System.out.println(arr[2]); - } -} diff --git a/daun/untitled/src/java_27866/Main.java b/daun/untitled/src/java_27866/Main.java deleted file mode 100644 index 4b4ca7c..0000000 --- a/daun/untitled/src/java_27866/Main.java +++ /dev/null @@ -1,14 +0,0 @@ -package java_27866; - -import java.util.Scanner; - -public class Main { - public static void main(String[] args){ - Scanner scanner = new Scanner(System.in); - String S = scanner.nextLine(); - int i = scanner.nextInt(); - String[] list; - list = S.split(""); - System.out.println(list[i - 1]); - } -} diff --git a/daun/untitled/src/java_2839/Main.java b/daun/untitled/src/java_2839/Main.java deleted file mode 100644 index 02b9331..0000000 --- a/daun/untitled/src/java_2839/Main.java +++ /dev/null @@ -1,25 +0,0 @@ -package java_2839; -import java.util.Scanner; - -public class Main { - public static void main(String []args){ - Scanner scanner = new Scanner(System.in); - int n = scanner.nextInt(); - int bag = 0; - while(n != 0) { - if(n < 3){ - bag = -1; - break; - } - if(n % 5 ==0){ - n -= 5; - bag++; - } - else{ - n -= 3; - bag++; - } - } - System.out.println(bag); - } -} diff --git a/daun/untitled/src/java_2884/TimeCalculator.java b/daun/untitled/src/java_2884/TimeCalculator.java deleted file mode 100644 index a739325..0000000 --- a/daun/untitled/src/java_2884/TimeCalculator.java +++ /dev/null @@ -1,55 +0,0 @@ -package java_2884; -import java.util.Scanner; - -public class TimeCalculator { - private int time; // private 변수 - private int min; - - public TimeCalculator(int time, int min) { //생성자를 만들어 입력된 시간과 분을 초기화 - this.time = time; - this.min = min; - } - - public int getTime() { // time 변수의 값 반환 - return time; - } - - public void setTime(int time) { // time 변수의 값 설정 - this.time = time; - } - - public int getMin() { //min 변수의 값 반환 - return min; - } - - public void setMin(int min) { // min 변수의 값 설정 - this.min = min; - } - - - public void calculateTime() { // 인스턴스 메소드 - if (min < 45 && time != 0) { - time = time - 1; - min = min - 45 + 60; - } else if (min >= 45 && time == 0) { - min = min - 45; - } else if (time == 0 && min < 45) { - time = 23; - min = min - 45 + 60; - } else if (time != 0 && min >= 45) { - min = min - 45; - } - } - - public static void main(String[] args) { - Scanner scanner = new Scanner(System.in); - - int time = scanner.nextInt(); - int min = scanner.nextInt(); - - TimeCalculator calculator = new TimeCalculator(time, min); - calculator.calculateTime(); - - System.out.println(calculator.getTime() + " " + calculator.getMin()); - } -} diff --git a/dongjae/BOJ/.gitignore b/dongjae/BOJ/.gitignore deleted file mode 100644 index f68d109..0000000 --- a/dongjae/BOJ/.gitignore +++ /dev/null @@ -1,29 +0,0 @@ -### IntelliJ IDEA ### -out/ -!**/src/main/**/out/ -!**/src/test/**/out/ - -### Eclipse ### -.apt_generated -.classpath -.factorypath -.project -.settings -.springBeans -.sts4-cache -bin/ -!**/src/main/**/bin/ -!**/src/test/**/bin/ - -### NetBeans ### -/nbproject/private/ -/nbbuild/ -/dist/ -/nbdist/ -/.nb-gradle/ - -### VS Code ### -.vscode/ - -### Mac OS ### -.DS_Store \ No newline at end of file diff --git a/dongjae/BOJ/.idea/.gitignore b/dongjae/BOJ/.idea/.gitignore deleted file mode 100644 index 13566b8..0000000 --- a/dongjae/BOJ/.idea/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml -# Editor-based HTTP Client requests -/httpRequests/ -# Datasource local storage ignored files -/dataSources/ -/dataSources.local.xml diff --git a/dongjae/BOJ/.idea/misc.xml b/dongjae/BOJ/.idea/misc.xml deleted file mode 100644 index 07115cd..0000000 --- a/dongjae/BOJ/.idea/misc.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/dongjae/BOJ/.idea/vcs.xml b/dongjae/BOJ/.idea/vcs.xml deleted file mode 100644 index b2bdec2..0000000 --- a/dongjae/BOJ/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/dongjae/BOJ/src/java_10810/Main.java b/dongjae/BOJ/src/java_10810/Main.java deleted file mode 100644 index 8d5182c..0000000 --- a/dongjae/BOJ/src/java_10810/Main.java +++ /dev/null @@ -1,30 +0,0 @@ -package java_10810; - -import java.util.Scanner; - -public class Main { - public static void main(String[] args) { - Scanner input = new Scanner(System.in); - - int n = input.nextInt(); - int m = input.nextInt(); - - int[] array = new int[n]; - - int a, b, k; - - for(int i=0; i chicken = new ArrayList<>(); - public static ArrayList house = new ArrayList<>(); - - public static ArrayList> chickenList = new ArrayList<>(); - - public static void comb(ArrayList arr, boolean[] visited, int depth, int r) { - // 다 뽑았을 경우 - if (r == 0) { - ArrayList temp = new ArrayList<>(); - for (int i = 0; i < arr.size(); i++) { - if (visited[i]) temp.add(arr.get(i)); - } - chickenList.add(temp); - return; - } - // 배열 끝까지 확인했을 경우 - if (depth == arr.size()) return; - else { - visited[depth] = true; - comb(arr, visited, depth + 1, r - 1); - - visited[depth] = false; - comb(arr, visited, depth + 1, r); - } - } - - public static int getSum(ArrayList candidates) { - int result = 0; - for (int i = 0; i < house.size(); i++) { - int hx = house.get(i).getX(); - int hy = house.get(i).getY(); - int temp = (int) 1e9; - for (int j = 0; j < candidates.size(); j++) { - int cx = candidates.get(j).getX(); - int cy = candidates.get(j).getY(); - temp = Math.min(temp, Math.abs(hx - cx) + Math.abs(hy - cy)); - } - result += temp; - } - return result; - } - - public static void main(String[] args) { - Scanner sc = new Scanner(System.in); - n = sc.nextInt(); - m = sc.nextInt(); - - for (int r = 0; r < n; r++) { - for (int c = 0; c < n; c++) { - map[r][c] = sc.nextInt(); - if (map[r][c] == 2) chicken.add(new Position(r, c)); - else if (map[r][c] == 1) house.add(new Position(r, c)); - } - } - - boolean[] visited = new boolean[chicken.size()]; - comb(chicken, visited, 0, m); - - int result = (int) 1e9; - for (int i = 0; i < chickenList.size(); i++) { - result = Math.min(result, getSum(chickenList.get(i))); - } - System.out.println(result); - } -} \ No newline at end of file diff --git a/dongjae/BOJ/src/java_18108/Main.java b/dongjae/BOJ/src/java_18108/Main.java deleted file mode 100644 index e73d83a..0000000 --- a/dongjae/BOJ/src/java_18108/Main.java +++ /dev/null @@ -1,13 +0,0 @@ -package java_18108; - -import java.util.*; - -public class Main { - public static void main(String[] args) { - Scanner sc = new Scanner(System.in); - int y = sc.nextInt(); - int result = y - 543; - - System.out.println(result); - } -} \ No newline at end of file diff --git a/dongjae/BOJ/src/java_2439/Main.java b/dongjae/BOJ/src/java_2439/Main.java deleted file mode 100644 index af4de3f..0000000 --- a/dongjae/BOJ/src/java_2439/Main.java +++ /dev/null @@ -1,20 +0,0 @@ -package java_2439; - -import java.util.*; - -public class Main { - public static void main(String[] args) { - Scanner sc = new Scanner(System.in); - int n = sc.nextInt(); - - for (int i = 1; i <= n; i++) { - for (int j = n - i; j > 0; j--) { - System.out.print(" "); - } - for (int k = 0; k < i; k++) { - System.out.print("*"); - } - System.out.println(); - } - } -} \ No newline at end of file diff --git a/dongjae/BOJ/src/java_2734/Main.java b/dongjae/BOJ/src/java_2734/Main.java deleted file mode 100644 index 5a87d3b..0000000 --- a/dongjae/BOJ/src/java_2734/Main.java +++ /dev/null @@ -1,12 +0,0 @@ -package java_2734; - -import java.util.Scanner; - -public class Main { - public static void main(String[] args) { - Scanner sc = new Scanner(System.in); - - String word = sc.next(); - System.out.println(word.length()); - } -} diff --git a/dongjae/BOJ/src/java_27866/Main.java b/dongjae/BOJ/src/java_27866/Main.java deleted file mode 100644 index ac20e29..0000000 --- a/dongjae/BOJ/src/java_27866/Main.java +++ /dev/null @@ -1,14 +0,0 @@ -package java_27866; - -import java.util.Scanner; - -public class Main { - public static void main(String[] args) { - Scanner sc = new Scanner(System.in); - - String word = sc.next(); - int index = sc.nextInt(); - - System.out.println(word.charAt(index - 1)); - } -} diff --git a/dongjae/BOJ/src/java_3190/Main.java b/dongjae/BOJ/src/java_3190/Main.java deleted file mode 100644 index 2e1e562..0000000 --- a/dongjae/BOJ/src/java_3190/Main.java +++ /dev/null @@ -1,119 +0,0 @@ -package java_3190; - -import java.util.*; - -// chap12 구현문제 328p 뱀 -class Node { - private int time; - private String direction; - - public Node(int time, String direction) { - this.time = time; - this.direction = direction; - } - - public int getTime() { - return this.time; - } - - public String getDirection() { - return this.direction; - } -} - -class Position { - private int x; - private int y; - - public Position(int x, int y) { - this.x = x; - this.y = y; - } - - public int getX() { - return x; - } - - public int getY() { - return y; - } -} - -public class Main { - public static int n, k, l; - public static int[][] map = new int[101][101]; - public static ArrayList rotateInfo = new ArrayList<>(); - - public static int[] dx = {0, -1, 0, 1}; - public static int[] dy = {1, 0, -1, 0}; - - public static int turn(String c, int direction) { - int newDirection; - if (c.equals("L")) { - newDirection = (direction + 1) % 4; - } else { - newDirection = ((direction) == 0) ? 3 : direction - 1; - } - return newDirection; - } - - public static int simulate() { - int x = 1, y = 1; - map[x][y] = 2; - int direction = 0; - int time = 0; - int index = 0; - Queue queue = new LinkedList<>(); - queue.offer(new Position(x, y)); - - while (true) { - int nx = x + dx[direction]; - int ny = y + dy[direction]; - if (1 <= nx && nx <= n && 1 <= ny && ny <= n && map[nx][ny] != 2) { - if (map[nx][ny] == 0) { - map[nx][ny] = 2; - queue.offer(new Position(nx, ny)); - Position prev = queue.poll(); - map[prev.getX()][prev.getY()] = 0; - } - if (map[nx][ny] == 1) { - map[nx][ny] = 2; - queue.offer(new Position(nx, ny)); - } - } else { - time += 1; - break; - } - x = nx; - y = ny; - time += 1; - if (index < l && rotateInfo.get(index).getTime() == time) { - direction = turn(rotateInfo.get(index).getDirection(), direction); - index += 1; - } - } - - return time; - } - - public static void main(String[] args) { - Scanner sc = new Scanner(System.in); - n = sc.nextInt(); - k = sc.nextInt(); - for (int i = 0; i < k; i++) { - int x = sc.nextInt(); - int y = sc.nextInt(); - map[x][y] = 1; - } - - l = sc.nextInt(); - for (int i = 0; i < l; i++) { - int x = sc.nextInt(); - String c = sc.next(); - rotateInfo.add(new Node(x, c)); - } - - int result = simulate(); - System.out.println(result); - } -} \ No newline at end of file diff --git a/dongjae/hello-spring/hello-spring/.gitignore b/dongjae/hello-spring/hello-spring/.gitignore deleted file mode 100644 index c2065bc..0000000 --- a/dongjae/hello-spring/hello-spring/.gitignore +++ /dev/null @@ -1,37 +0,0 @@ -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/dongjae/hello-spring/hello-spring/build.gradle b/dongjae/hello-spring/hello-spring/build.gradle deleted file mode 100644 index bf7e058..0000000 --- a/dongjae/hello-spring/hello-spring/build.gradle +++ /dev/null @@ -1,26 +0,0 @@ -plugins { - id 'java' - id 'org.springframework.boot' version '3.0.1' - id 'io.spring.dependency-management' version '1.1.0' -} - -group = 'hello' -version = '0.0.1-SNAPSHOT' -sourceCompatibility = '17' - -repositories { - mavenCentral() -} - -dependencies { - implementation 'org.springframework.boot:spring-boot-starter-thymeleaf' - implementation 'org.springframework.boot:spring-boot-starter-web' -// implementation 'org.springframework.boot:spring-boot-starter-jdbc' - implementation 'org.springframework.boot:spring-boot-starter-data-jpa' - runtimeOnly 'com.h2database:h2' - testImplementation 'org.springframework.boot:spring-boot-starter-test' -} - -tasks.named('test') { - useJUnitPlatform() -} diff --git a/dongjae/hello-spring/hello-spring/gradle/wrapper/gradle-wrapper.jar b/dongjae/hello-spring/hello-spring/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index 249e583..0000000 Binary files a/dongjae/hello-spring/hello-spring/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/dongjae/hello-spring/hello-spring/gradle/wrapper/gradle-wrapper.properties b/dongjae/hello-spring/hello-spring/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 070cb70..0000000 --- a/dongjae/hello-spring/hello-spring/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,5 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists diff --git a/dongjae/hello-spring/hello-spring/gradlew b/dongjae/hello-spring/hello-spring/gradlew deleted file mode 100644 index a69d9cb..0000000 --- a/dongjae/hello-spring/hello-spring/gradlew +++ /dev/null @@ -1,240 +0,0 @@ -#!/bin/sh - -# -# Copyright © 2015-2021 the original authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -############################################################################## -# -# Gradle start up script for POSIX generated by Gradle. -# -# Important for running: -# -# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is -# noncompliant, but you have some other compliant shell such as ksh or -# bash, then to run this script, type that shell name before the whole -# command line, like: -# -# ksh Gradle -# -# Busybox and similar reduced shells will NOT work, because this script -# requires all of these POSIX shell features: -# * functions; -# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», -# «${var#prefix}», «${var%suffix}», and «$( cmd )»; -# * compound commands having a testable exit status, especially «case»; -# * various built-in commands including «command», «set», and «ulimit». -# -# Important for patching: -# -# (2) This script targets any POSIX shell, so it avoids extensions provided -# by Bash, Ksh, etc; in particular arrays are avoided. -# -# The "traditional" practice of packing multiple parameters into a -# space-separated string is a well documented source of bugs and security -# problems, so this is (mostly) avoided, by progressively accumulating -# options in "$@", and eventually passing that to Java. -# -# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, -# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; -# see the in-line comments for details. -# -# There are tweaks for specific operating systems such as AIX, CygWin, -# Darwin, MinGW, and NonStop. -# -# (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt -# within the Gradle project. -# -# You can find Gradle at https://github.com/gradle/gradle/. -# -############################################################################## - -# Attempt to set APP_HOME - -# Resolve links: $0 may be a link -app_path=$0 - -# Need this for daisy-chained symlinks. -while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] -do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac -done - -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" -APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum - -warn () { - echo "$*" -} >&2 - -die () { - echo - echo "$*" - echo - exit 1 -} >&2 - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -nonstop=false -case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; -esac - -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar - - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - 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 - -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. - -set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" - -# Stop when "xargs" is not available. -if ! command -v xargs >/dev/null 2>&1 -then - die "xargs is not available" -fi - -# Use "xargs" to parse quoted args. -# -# With -n1 it outputs one arg per line, with the quotes and backslashes removed. -# -# In Bash we could simply go: -# -# readarray ARGS < <( xargs -n1 <<<"$var" ) && -# set -- "${ARGS[@]}" "$@" -# -# but POSIX shell has neither arrays nor command substitution, so instead we -# post-process each arg (as a line of input to sed) to backslash-escape any -# character that might be a shell metacharacter, then use eval to reverse -# that process (while maintaining the separation between arguments), and wrap -# the whole thing up as a single "set" statement. -# -# This will of course break if any of these variables contains a newline or -# an unmatched quote. -# - -eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' - -exec "$JAVACMD" "$@" diff --git a/dongjae/hello-spring/hello-spring/gradlew.bat b/dongjae/hello-spring/hello-spring/gradlew.bat deleted file mode 100644 index f127cfd..0000000 --- a/dongjae/hello-spring/hello-spring/gradlew.bat +++ /dev/null @@ -1,91 +0,0 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem - -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* - -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/dongjae/hello-spring/hello-spring/settings.gradle b/dongjae/hello-spring/hello-spring/settings.gradle deleted file mode 100644 index 69a39da..0000000 --- a/dongjae/hello-spring/hello-spring/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -rootProject.name = 'hello-spring' diff --git a/dongjae/hello-spring/hello-spring/sql/ddl.sql b/dongjae/hello-spring/hello-spring/sql/ddl.sql deleted file mode 100644 index be71361..0000000 --- a/dongjae/hello-spring/hello-spring/sql/ddl.sql +++ /dev/null @@ -1,7 +0,0 @@ -drop table id exists member cascade; -create table member -( - id bigint generated by default as identity, - name varchar(255), - primary key (id) -); \ No newline at end of file diff --git a/dongjae/hello-spring/hello-spring/src/main/java/hello/hellospring/HelloSpringApplication.java b/dongjae/hello-spring/hello-spring/src/main/java/hello/hellospring/HelloSpringApplication.java deleted file mode 100644 index b792abd..0000000 --- a/dongjae/hello-spring/hello-spring/src/main/java/hello/hellospring/HelloSpringApplication.java +++ /dev/null @@ -1,15 +0,0 @@ -package hello.hellospring; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; - -@SpringBootApplication -public class HelloSpringApplication { - - public static void main(String[] args) { - - SpringApplication.run(HelloSpringApplication.class, args); - - } - -} diff --git a/dongjae/hello-spring/hello-spring/src/main/java/hello/hellospring/SpringConfig.java b/dongjae/hello-spring/hello-spring/src/main/java/hello/hellospring/SpringConfig.java deleted file mode 100644 index 5830c2c..0000000 --- a/dongjae/hello-spring/hello-spring/src/main/java/hello/hellospring/SpringConfig.java +++ /dev/null @@ -1,37 +0,0 @@ -package hello.hellospring; - -import hello.hellospring.aop.TimeTraceAop; -import hello.hellospring.repository.*; -import hello.hellospring.service.MemberService; -import jakarta.persistence.EntityManager; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -import javax.sql.DataSource; - -@Configuration -public class SpringConfig { - - private final MemberRepository memberRepository; - - @Autowired - public SpringConfig(MemberRepository memberRepository) { - this.memberRepository = memberRepository; - } - - @Bean - public MemberService memberService() { - return new MemberService(memberRepository); - } - - - /* - @Bean - public MemberRepository memberRepository() { - return new JdbcMemberRepository(dataSource); - return new JdbcTemplateMemberRepository(dataSource); - return new JpaMemberRepository(em); - } - */ -} \ No newline at end of file diff --git a/dongjae/hello-spring/hello-spring/src/main/java/hello/hellospring/aop/TimeTraceAop.java b/dongjae/hello-spring/hello-spring/src/main/java/hello/hellospring/aop/TimeTraceAop.java deleted file mode 100644 index 2377fca..0000000 --- a/dongjae/hello-spring/hello-spring/src/main/java/hello/hellospring/aop/TimeTraceAop.java +++ /dev/null @@ -1,28 +0,0 @@ -package hello.hellospring.aop; - -import org.aspectj.lang.ProceedingJoinPoint; -import org.aspectj.lang.annotation.Around; -import org.aspectj.lang.annotation.Aspect; -import org.springframework.stereotype.Component; - -@Component -@Aspect -public class TimeTraceAop { - - @Around("execution(* hello.hellospring..*(..))") - public Object execute(ProceedingJoinPoint joinPoint) throws Throwable { - - long start = System.currentTimeMillis(); - - System.out.println("START: " + joinPoint.toString()); - - try { - return joinPoint.proceed(); - } finally { - long finish = System.currentTimeMillis(); - long timeMs = finish - start; - - System.out.println("END: " + joinPoint.toString() + " " + timeMs + "ms"); - } - } -} diff --git a/dongjae/hello-spring/hello-spring/src/main/java/hello/hellospring/controller/HelloController.java b/dongjae/hello-spring/hello-spring/src/main/java/hello/hellospring/controller/HelloController.java deleted file mode 100644 index a99c532..0000000 --- a/dongjae/hello-spring/hello-spring/src/main/java/hello/hellospring/controller/HelloController.java +++ /dev/null @@ -1,53 +0,0 @@ -package hello.hellospring.controller; - -import org.springframework.ui.Model; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; - -@Controller -public class HelloController { - - @GetMapping("hello") - public String hello(Model model) { - model.addAttribute("data", "hello"); - return "hello"; - } - - @GetMapping("hello-mvc") - public String helloMvc(@RequestParam("name") String name, Model model) { - model.addAttribute("name", name); - return "hello-template"; - } - - @GetMapping("hello-string") - @ResponseBody - public String helloString(@RequestParam("name") String name) { - return "hello " + name; - } - - @GetMapping("hello-api") - @ResponseBody - public Hello helloApi(@RequestParam("name") String name) { - Hello hello = new Hello(); - hello.setName(name); - return hello; - } - - static class Hello { - private String name; - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - - - } - -} diff --git a/dongjae/hello-spring/hello-spring/src/main/java/hello/hellospring/controller/HomeController.java b/dongjae/hello-spring/hello-spring/src/main/java/hello/hellospring/controller/HomeController.java deleted file mode 100644 index c6f1850..0000000 --- a/dongjae/hello-spring/hello-spring/src/main/java/hello/hellospring/controller/HomeController.java +++ /dev/null @@ -1,13 +0,0 @@ -package hello.hellospring.controller; - -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.GetMapping; - -@Controller -public class HomeController { - - @GetMapping("/") - public String home() { - return "home"; - } -} diff --git a/dongjae/hello-spring/hello-spring/src/main/java/hello/hellospring/controller/MemberController.java b/dongjae/hello-spring/hello-spring/src/main/java/hello/hellospring/controller/MemberController.java deleted file mode 100644 index c59706c..0000000 --- a/dongjae/hello-spring/hello-spring/src/main/java/hello/hellospring/controller/MemberController.java +++ /dev/null @@ -1,46 +0,0 @@ -package hello.hellospring.controller; - -import hello.hellospring.domain.Member; -import hello.hellospring.service.MemberService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; - -import java.util.List; - -@Controller -public class MemberController { - - private final MemberService memberService; - - @Autowired - public MemberController(MemberService memberService) { - this.memberService = memberService; - } - - @GetMapping(value = "/members/new") - public String createForm() { - return "members/createMemberForm"; - } - - @PostMapping(value = "/members/new") - public String create(MemberForm form) { - - Member member = new Member(); - member.setName(form.getName()); - - memberService.join(member); - - return "redirect:/"; - } - - @GetMapping(value = "/members") - public String list(Model model) { - List members = memberService.findMembers(); - model.addAttribute("members", members); - return "members/memberList"; - } - -} diff --git a/dongjae/hello-spring/hello-spring/src/main/java/hello/hellospring/controller/MemberForm.java b/dongjae/hello-spring/hello-spring/src/main/java/hello/hellospring/controller/MemberForm.java deleted file mode 100644 index 301a7ad..0000000 --- a/dongjae/hello-spring/hello-spring/src/main/java/hello/hellospring/controller/MemberForm.java +++ /dev/null @@ -1,13 +0,0 @@ -package hello.hellospring.controller; - -public class MemberForm { - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - private String name; -} diff --git a/dongjae/hello-spring/hello-spring/src/main/java/hello/hellospring/domain/Member.java b/dongjae/hello-spring/hello-spring/src/main/java/hello/hellospring/domain/Member.java deleted file mode 100644 index a0fcc3d..0000000 --- a/dongjae/hello-spring/hello-spring/src/main/java/hello/hellospring/domain/Member.java +++ /dev/null @@ -1,27 +0,0 @@ -package hello.hellospring.domain; - -import jakarta.persistence.*; - -@Entity -public class Member { - @Id @GeneratedValue(strategy = GenerationType.IDENTITY) - private Long id; - - private String name; - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } -} diff --git a/dongjae/hello-spring/hello-spring/src/main/java/hello/hellospring/repository/JdbcMemberRepository.java b/dongjae/hello-spring/hello-spring/src/main/java/hello/hellospring/repository/JdbcMemberRepository.java deleted file mode 100644 index 08da02c..0000000 --- a/dongjae/hello-spring/hello-spring/src/main/java/hello/hellospring/repository/JdbcMemberRepository.java +++ /dev/null @@ -1,173 +0,0 @@ -package hello.hellospring.repository; - -import hello.hellospring.domain.Member; -import org.springframework.jdbc.datasource.DataSourceUtils; - -import javax.sql.DataSource; -import java.sql.*; -import java.util.ArrayList; -import java.util.List; -import java.util.Optional; - -public class JdbcMemberRepository implements MemberRepository { - - private final DataSource dataSource; - - public JdbcMemberRepository(DataSource dataSource) { - this.dataSource = dataSource; - } - - @Override - public Member save(Member member) { - String sql = "insert into member(name) values(?)"; - - Connection conn = null; - PreparedStatement pstmt = null; - ResultSet rs = null; - - try { - conn = getConnection(); - pstmt = conn.prepareStatement(sql, Statement.RETURN_GENERATED_KEYS); - - pstmt.setString(1, member.getName()); - - pstmt.executeUpdate(); - rs = pstmt.getGeneratedKeys(); - - if(rs.next()) { - member.setId(rs.getLong(1)); - } else { - throw new SQLException("id 조회 실패"); - } - return member; - } catch (Exception e) { - throw new IllegalStateException(e); - } finally { - close(conn, pstmt, rs); - } - } - - @Override - public Optional findByName(String name) { - String sql = "select * from member where name = ?"; - - Connection conn = null; - PreparedStatement pstmt = null; - ResultSet rs = null; - - try { - conn = getConnection(); - pstmt = conn.prepareStatement(sql); - pstmt.setString(1, name); - - rs = pstmt.executeQuery(); - - if(rs.next()) { - Member member = new Member(); - member.setId(rs.getLong("id")); - member.setName(rs.getString("name")); - return Optional.of(member); - } else { - return Optional.empty(); - } - } catch (Exception e) { - throw new IllegalStateException(e); - } finally { - close(conn, pstmt, rs); - } - - } - - @Override - public Optional findById(Long id) { - String sql = "select * from member where id = ?"; - - Connection conn = null; - PreparedStatement pstmt = null; - ResultSet rs = null; - - try { - conn = getConnection(); - pstmt = conn.prepareStatement(sql); - pstmt.setLong(1, id); - - rs = pstmt.executeQuery(); - - if(rs.next()) { - Member member = new Member(); - member.setId(rs.getLong("id")); - member.setName(rs.getString("name")); - return Optional.of(member); - } else { - return Optional.empty(); - } - } catch (Exception e) { - throw new IllegalStateException(e); - } finally { - close(conn, pstmt, rs); - } - - } - - @Override - public List findAll() { - String sql = "select * from member"; - - Connection conn = null; - PreparedStatement pstmt = null; - ResultSet rs = null; - - try { - conn = getConnection(); - pstmt = conn.prepareStatement(sql); - - rs = pstmt.executeQuery(); - - List members = new ArrayList<>(); - while(rs.next()) { - Member member = new Member(); - member.setId(rs.getLong("id")); - member.setName(rs.getString("name")); - members.add(member); - } - - return members; - } catch (Exception e) { - throw new IllegalStateException(e); - } finally { - close(conn, pstmt, rs); - } - } - - private Connection getConnection() { - return DataSourceUtils.getConnection(dataSource); - } - - private void close(Connection conn, PreparedStatement pstmt, ResultSet rs) { - try { - if (rs != null) { - rs.close(); - } - } catch(SQLException e){ - e.printStackTrace(); - } - try { - if (pstmt != null) { - pstmt.close(); - } - } catch(SQLException e){ - e.printStackTrace(); - } - try { - if (conn != null) { - conn.close(); - } - } catch(SQLException e) { - e.printStackTrace(); - } - } - - private void close(Connection conn) throws SQLException { - DataSourceUtils.releaseConnection(conn, dataSource); - } -} diff --git a/dongjae/hello-spring/hello-spring/src/main/java/hello/hellospring/repository/JdbcTemplateMemberRepository.java b/dongjae/hello-spring/hello-spring/src/main/java/hello/hellospring/repository/JdbcTemplateMemberRepository.java deleted file mode 100644 index c2ad2da..0000000 --- a/dongjae/hello-spring/hello-spring/src/main/java/hello/hellospring/repository/JdbcTemplateMemberRepository.java +++ /dev/null @@ -1,64 +0,0 @@ -package hello.hellospring.repository; - -import hello.hellospring.domain.Member; -import org.springframework.jdbc.core.JdbcTemplate; -import org.springframework.jdbc.core.RowMapper; -import org.springframework.jdbc.core.namedparam.MapSqlParameterSource; -import org.springframework.jdbc.core.simple.SimpleJdbcInsert; - -import javax.sql.DataSource; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Optional; - -public class JdbcTemplateMemberRepository implements MemberRepository { - - private final JdbcTemplate jdbcTemplate; - - public JdbcTemplateMemberRepository(DataSource dataSource) { - jdbcTemplate = new JdbcTemplate(dataSource); - } - - @Override - public Member save(Member member) { - SimpleJdbcInsert jdbcInsert = new SimpleJdbcInsert(jdbcTemplate); - jdbcInsert.withTableName("member").usingGeneratedKeyColumns("id"); - - Map parameters = new HashMap<>(); - parameters.put("name", member.getName()); - - Number key = jdbcInsert.executeAndReturnKey(new MapSqlParameterSource(parameters)); - member.setId(key.longValue()); - return member; - } - - @Override - public Optional findByName(String name) { - List result = jdbcTemplate.query("select * from member where name = ?", memberRowMapper(), name); - return result.stream().findAny(); - } - - @Override - public Optional findById(Long id) { - List result = jdbcTemplate.query("select * from member where id = ?", memberRowMapper(), id); - return result.stream().findAny(); - } - - @Override - public List findAll() { - return jdbcTemplate.query("select * from member", memberRowMapper()); - } - - private RowMapper memberRowMapper() { - return (rs, rowNum) -> { - Member member = new Member(); - member.setId(rs.getLong("id")); - member.setName(rs.getString("name")); - return member; - }; - } - -} diff --git a/dongjae/hello-spring/hello-spring/src/main/java/hello/hellospring/repository/JpaMemberRepository.java b/dongjae/hello-spring/hello-spring/src/main/java/hello/hellospring/repository/JpaMemberRepository.java deleted file mode 100644 index ccbe662..0000000 --- a/dongjae/hello-spring/hello-spring/src/main/java/hello/hellospring/repository/JpaMemberRepository.java +++ /dev/null @@ -1,44 +0,0 @@ -package hello.hellospring.repository; - -import hello.hellospring.domain.Member; - -import jakarta.persistence.EntityManager; -import java.util.List; -import java.util.Optional; - -public class JpaMemberRepository implements MemberRepository { - - private final EntityManager em; - - public JpaMemberRepository(EntityManager em) { - this.em = em; - } - - @Override - public Member save(Member member) { - em.persist(member); - return member; - } - - @Override - public Optional findByName(String name) { - List result = em.createQuery("select m from Member m where m.name = :name", Member.class) - .setParameter("name", name) - .getResultList(); - - return result.stream().findAny(); - } - - @Override - public Optional findById(Long id) { - Member member = em.find(Member.class, id); - return Optional.ofNullable(member); - } - - @Override - public List findAll() { - return em.createQuery("select m from Member m", Member.class) - .getResultList(); - - } -} diff --git a/dongjae/hello-spring/hello-spring/src/main/java/hello/hellospring/repository/MemberRepository.java b/dongjae/hello-spring/hello-spring/src/main/java/hello/hellospring/repository/MemberRepository.java deleted file mode 100644 index 5791f83..0000000 --- a/dongjae/hello-spring/hello-spring/src/main/java/hello/hellospring/repository/MemberRepository.java +++ /dev/null @@ -1,13 +0,0 @@ -package hello.hellospring.repository; - -import hello.hellospring.domain.Member; - -import java.util.List; -import java.util.Optional; - -public interface MemberRepository { - Member save(Member member); - Optional findByName(String name); - Optional findById(Long id); - List findAll(); -} diff --git a/dongjae/hello-spring/hello-spring/src/main/java/hello/hellospring/repository/MemoryMemberRepository.java b/dongjae/hello-spring/hello-spring/src/main/java/hello/hellospring/repository/MemoryMemberRepository.java deleted file mode 100644 index f88bf11..0000000 --- a/dongjae/hello-spring/hello-spring/src/main/java/hello/hellospring/repository/MemoryMemberRepository.java +++ /dev/null @@ -1,39 +0,0 @@ -package hello.hellospring.repository; - -import hello.hellospring.domain.Member; -import org.springframework.stereotype.Repository; - -import java.util.*; -public class MemoryMemberRepository implements MemberRepository { - - private Map store = new HashMap<>(); - private Long sequence = 0L; - - @Override - public Member save(Member member) { - member.setId(++sequence); - store.put(member.getId(), member); - return member; - } - - @Override - public Optional findById(Long id) { - return Optional.ofNullable(store.get(id)); - } - - @Override - public List findAll() { - return new ArrayList<>(store.values()); - } - - @Override - public Optional findByName(String name) { - return store.values().stream() - .filter(member -> member.getName().equals(name)) - .findAny(); - } - - public void clearStore() { - store.clear(); - } -} \ No newline at end of file diff --git a/dongjae/hello-spring/hello-spring/src/main/java/hello/hellospring/repository/SpringDataJpaMemberRepository.java b/dongjae/hello-spring/hello-spring/src/main/java/hello/hellospring/repository/SpringDataJpaMemberRepository.java deleted file mode 100644 index e34549e..0000000 --- a/dongjae/hello-spring/hello-spring/src/main/java/hello/hellospring/repository/SpringDataJpaMemberRepository.java +++ /dev/null @@ -1,12 +0,0 @@ -package hello.hellospring.repository; - -import hello.hellospring.domain.Member; -import org.springframework.data.jpa.repository.JpaRepository; - -import java.util.Optional; - -public interface SpringDataJpaMemberRepository extends JpaRepository, MemberRepository { - - @Override - Optional findByName(String name); -} diff --git a/dongjae/hello-spring/hello-spring/src/main/java/hello/hellospring/service/MemberService.java b/dongjae/hello-spring/hello-spring/src/main/java/hello/hellospring/service/MemberService.java deleted file mode 100644 index 260071a..0000000 --- a/dongjae/hello-spring/hello-spring/src/main/java/hello/hellospring/service/MemberService.java +++ /dev/null @@ -1,47 +0,0 @@ -package hello.hellospring.service; - -import hello.hellospring.domain.Member; -import hello.hellospring.repository.MemberRepository; -import hello.hellospring.repository.MemoryMemberRepository; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import java.util.List; -import java.util.Optional; -@Transactional -public class MemberService { - //Test 파일 자동 생성 : ctrl + shift + T - - MemberRepository memberRepository; - public MemberService(MemberRepository memberRepository) { - this.memberRepository = memberRepository; - } - - /* - 회원가입 - */ - public Long join(Member member) { - validateDuplicateMember(member); - memberRepository.save(member); - return member.getId(); - } - - private void validateDuplicateMember(Member member) { - memberRepository.findByName(member.getName()) - .ifPresent(member1 -> { - throw new IllegalStateException("이미 존재하는 회원입니다."); - }); - } - - /* - 전체회원 조회 - */ - public List findMembers() { - return memberRepository.findAll(); - } - - public Optional findOne(Long memberId) { - return memberRepository.findById(memberId); - } -} \ No newline at end of file diff --git a/dongjae/hello-spring/hello-spring/src/main/resources/application.properties b/dongjae/hello-spring/hello-spring/src/main/resources/application.properties deleted file mode 100644 index 66ed5e2..0000000 --- a/dongjae/hello-spring/hello-spring/src/main/resources/application.properties +++ /dev/null @@ -1,7 +0,0 @@ -server.port.regexp={8080} -spring.datasource.url=jdbc:h2:tcp://localhost/~/test -spring.datasource.driver-class-name=org.h2.Driver -spring.datasource.username=sa -logging.level.org.hibernate.SQL=debug -spring.jpa.show-sql=true -spring.jpa.hibernate.ddl-auto=none \ No newline at end of file diff --git a/dongjae/hello-spring/hello-spring/src/main/resources/static/hello-static.html b/dongjae/hello-spring/hello-spring/src/main/resources/static/hello-static.html deleted file mode 100644 index b074141..0000000 --- a/dongjae/hello-spring/hello-spring/src/main/resources/static/hello-static.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - static content - - -정적 컨텐츠 입니다. - - \ No newline at end of file diff --git a/dongjae/hello-spring/hello-spring/src/main/resources/static/index.html b/dongjae/hello-spring/hello-spring/src/main/resources/static/index.html deleted file mode 100644 index 5aac817..0000000 --- a/dongjae/hello-spring/hello-spring/src/main/resources/static/index.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - WEB1 - CSS - - - - -

WEB

-
-
    -
  1. HTML
  2. -
  3. CSS
  4. -
  5. JavaScript
  6. -
-
-

CSS란 무엇인가?

-

- Cascading Style Sheets (CSS) is a style sheet language used for describing the presentation of a document written in a markup language such as HTML or XML (including XML dialects such as SVG, MathML or XHTML). CSS is a cornerstone technology of the World Wide Web, alongside HTML and JavaScript. -

-
-
-hello - - diff --git a/dongjae/hello-spring/hello-spring/src/main/resources/templates/hello-template.html b/dongjae/hello-spring/hello-spring/src/main/resources/templates/hello-template.html deleted file mode 100644 index 2ebcdd2..0000000 --- a/dongjae/hello-spring/hello-spring/src/main/resources/templates/hello-template.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - Hello-Template - - -

hello! empty

- - \ No newline at end of file diff --git a/dongjae/hello-spring/hello-spring/src/main/resources/templates/hello.html b/dongjae/hello-spring/hello-spring/src/main/resources/templates/hello.html deleted file mode 100644 index f4dab1a..0000000 --- a/dongjae/hello-spring/hello-spring/src/main/resources/templates/hello.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - Hello - - -

안녕하세요. 손님

- - \ No newline at end of file diff --git a/dongjae/hello-spring/hello-spring/src/main/resources/templates/home.html b/dongjae/hello-spring/hello-spring/src/main/resources/templates/home.html deleted file mode 100644 index 064c3f7..0000000 --- a/dongjae/hello-spring/hello-spring/src/main/resources/templates/home.html +++ /dev/null @@ -1,15 +0,0 @@ - - - -
-
-

Hello Spring

-

회원 기능

-

- 회원 가입 - 회원 목록 -

-
-
- - \ No newline at end of file diff --git a/dongjae/hello-spring/hello-spring/src/main/resources/templates/members/createMemberForm.html b/dongjae/hello-spring/hello-spring/src/main/resources/templates/members/createMemberForm.html deleted file mode 100644 index 10b6f60..0000000 --- a/dongjae/hello-spring/hello-spring/src/main/resources/templates/members/createMemberForm.html +++ /dev/null @@ -1,14 +0,0 @@ - - - -
-
-
- - -
- -
-
- - \ No newline at end of file diff --git a/dongjae/hello-spring/hello-spring/src/main/resources/templates/members/memberList.html b/dongjae/hello-spring/hello-spring/src/main/resources/templates/members/memberList.html deleted file mode 100644 index 70611ef..0000000 --- a/dongjae/hello-spring/hello-spring/src/main/resources/templates/members/memberList.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - -
-
- - - - - - - - - - - - - -
#이름
-
-
- - - \ No newline at end of file diff --git a/dongjae/hello-spring/hello-spring/src/test/java/hello/hellospring/HelloSpringApplicationTests.java b/dongjae/hello-spring/hello-spring/src/test/java/hello/hellospring/HelloSpringApplicationTests.java deleted file mode 100644 index 87d37cf..0000000 --- a/dongjae/hello-spring/hello-spring/src/test/java/hello/hellospring/HelloSpringApplicationTests.java +++ /dev/null @@ -1,13 +0,0 @@ -package hello.hellospring; - -import org.junit.jupiter.api.Test; -import org.springframework.boot.test.context.SpringBootTest; - -@SpringBootTest -class HelloSpringApplicationTests { - - @Test - void contextLoads() { - } - -} diff --git a/dongjae/hello-spring/hello-spring/src/test/java/hello/hellospring/repository/MemoryMemberRepositoryTest.java b/dongjae/hello-spring/hello-spring/src/test/java/hello/hellospring/repository/MemoryMemberRepositoryTest.java deleted file mode 100644 index f075e39..0000000 --- a/dongjae/hello-spring/hello-spring/src/test/java/hello/hellospring/repository/MemoryMemberRepositoryTest.java +++ /dev/null @@ -1,67 +0,0 @@ -package hello.hellospring.repository; - -import hello.hellospring.domain.Member; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.Test; - -import static org.assertj.core.api.Assertions.*; -import java.util.*; - -public class MemoryMemberRepositoryTest { - MemoryMemberRepository repository = new MemoryMemberRepository(); - - @AfterEach - public void afterEach() { - repository.clearStore(); - } - - @Test - public void save() { - //given - Member member = new Member(); - member.setName("Dong-Jae"); - - //when - repository.save(member); - - //then - Member result = repository.findById(member.getId()).get(); - assertThat(result).isEqualTo(member); - } - - @Test - public void findByName() { - //given - Member member1 = new Member(); - member1.setName("Dong-Jae"); - repository.save(member1); - - Member member2 = new Member(); - member2.setName("Crayon"); - repository.save(member2); - - //when - Member result = repository.findByName("Crayon").get(); - - //then - assertThat(result).isEqualTo(member2); - } - - @Test - public void findAll() { - //given - Member member1 = new Member(); - member1.setName("Dong-Jae"); - repository.save(member1); - - Member member2 = new Member(); - member2.setName("Crayon"); - repository.save(member2); - - //when - List result = repository.findAll(); - - //then - assertThat(result.size()).isEqualTo(2); - } -} \ No newline at end of file diff --git a/dongjae/hello-spring/hello-spring/src/test/java/hello/hellospring/service/MemberServiceIntegrationTest.java b/dongjae/hello-spring/hello-spring/src/test/java/hello/hellospring/service/MemberServiceIntegrationTest.java deleted file mode 100644 index 64b54db..0000000 --- a/dongjae/hello-spring/hello-spring/src/test/java/hello/hellospring/service/MemberServiceIntegrationTest.java +++ /dev/null @@ -1,50 +0,0 @@ -package hello.hellospring.service; - -import hello.hellospring.domain.Member; -import hello.hellospring.repository.MemberRepository; -import org.junit.jupiter.api.Test; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.transaction.annotation.Transactional; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertThrows; - -@SpringBootTest -@Transactional -public class MemberServiceIntegrationTest { - @Autowired MemberService memberService; - @Autowired MemberRepository memberRepository; - - @Test - public void join() throws Exception { - // given - Member member = new Member(); - member.setName("hello"); - - // when - Long saveId = memberService.join(member); - - // then - Member saveMember = memberRepository.findById(saveId).get(); - assertEquals(member.getName(), saveMember.getName()); - } - - @Test - public void validateDuplicateMember() throws Exception { - // given - Member member1 = new Member(); - member1.setName("spring"); - - Member member2 = new Member(); - member2.setName("spring"); - - // when - memberService.join(member1); - IllegalStateException e = assertThrows(IllegalStateException.class, - () -> memberService.join(member2)); - - assertThat(e.getMessage()).isEqualTo("이미 존재하는 회원입니다."); - } -} diff --git a/dongjae/hello-spring/hello-spring/src/test/java/hello/hellospring/service/MemberServiceTest.java b/dongjae/hello-spring/hello-spring/src/test/java/hello/hellospring/service/MemberServiceTest.java deleted file mode 100644 index a5f2c26..0000000 --- a/dongjae/hello-spring/hello-spring/src/test/java/hello/hellospring/service/MemberServiceTest.java +++ /dev/null @@ -1,59 +0,0 @@ -package hello.hellospring.service; - -import hello.hellospring.domain.Member; -import hello.hellospring.repository.MemoryMemberRepository; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -import static org.junit.jupiter.api.Assertions.*; -import static org.assertj.core.api.Assertions.*; - -public class MemberServiceTest { - - MemberService memberService; - MemoryMemberRepository memberRepository; - - @BeforeEach - public void beforeEach() { - memberRepository = new MemoryMemberRepository(); - memberService = new MemberService(memberRepository); - } - - @AfterEach - public void afterEach() { - memberRepository.clearStore(); - } - - @Test - public void join() throws Exception { - // given - Member member = new Member(); - member.setName("hello"); - - // when - Long saveId = memberService.join(member); - - // then - Member saveMember = memberRepository.findById(saveId).get(); - assertEquals(saveMember.getName(), member.getName()); - } - - @Test - public void validateDuplicateMember() throws Exception { - // given - Member member1 = new Member(); - member1.setName("spring"); - - Member member2 = new Member(); - member2.setName("spring"); - - // when - memberService.join(member1); - IllegalStateException e = assertThrows(IllegalStateException.class, - () -> memberService.join(member2)); - - assertThat(e.getMessage()).isEqualTo("이미 존재하는 회원입니다."); - } - -} \ No newline at end of file diff --git a/gaeul/.idea/.gitignore b/gaeul/.idea/.gitignore deleted file mode 100644 index 13566b8..0000000 --- a/gaeul/.idea/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml -# Editor-based HTTP Client requests -/httpRequests/ -# Datasource local storage ignored files -/dataSources/ -/dataSources.local.xml diff --git a/gaeul/.idea/misc.xml b/gaeul/.idea/misc.xml deleted file mode 100644 index 639900d..0000000 --- a/gaeul/.idea/misc.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/gaeul/.idea/vcs.xml b/gaeul/.idea/vcs.xml deleted file mode 100644 index 6c0b863..0000000 --- a/gaeul/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/gaeul/BOJ/.idea/.gitignore b/gaeul/BOJ/.idea/.gitignore deleted file mode 100644 index 13566b8..0000000 --- a/gaeul/BOJ/.idea/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml -# Editor-based HTTP Client requests -/httpRequests/ -# Datasource local storage ignored files -/dataSources/ -/dataSources.local.xml diff --git a/gaeul/BOJ/.idea/misc.xml b/gaeul/BOJ/.idea/misc.xml deleted file mode 100644 index 639900d..0000000 --- a/gaeul/BOJ/.idea/misc.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/gaeul/BOJ/.idea/vcs.xml b/gaeul/BOJ/.idea/vcs.xml deleted file mode 100644 index b2bdec2..0000000 --- a/gaeul/BOJ/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git "a/gaeul/BOJ/1\354\243\274\354\260\250/.gitignore" "b/gaeul/BOJ/1\354\243\274\354\260\250/.gitignore" deleted file mode 100644 index f68d109..0000000 --- "a/gaeul/BOJ/1\354\243\274\354\260\250/.gitignore" +++ /dev/null @@ -1,29 +0,0 @@ -### IntelliJ IDEA ### -out/ -!**/src/main/**/out/ -!**/src/test/**/out/ - -### Eclipse ### -.apt_generated -.classpath -.factorypath -.project -.settings -.springBeans -.sts4-cache -bin/ -!**/src/main/**/bin/ -!**/src/test/**/bin/ - -### NetBeans ### -/nbproject/private/ -/nbbuild/ -/dist/ -/nbdist/ -/.nb-gradle/ - -### VS Code ### -.vscode/ - -### Mac OS ### -.DS_Store \ No newline at end of file diff --git "a/gaeul/BOJ/1\354\243\274\354\260\250/.idea/.gitignore" "b/gaeul/BOJ/1\354\243\274\354\260\250/.idea/.gitignore" deleted file mode 100644 index 13566b8..0000000 --- "a/gaeul/BOJ/1\354\243\274\354\260\250/.idea/.gitignore" +++ /dev/null @@ -1,8 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml -# Editor-based HTTP Client requests -/httpRequests/ -# Datasource local storage ignored files -/dataSources/ -/dataSources.local.xml diff --git "a/gaeul/BOJ/1\354\243\274\354\260\250/.idea/misc.xml" "b/gaeul/BOJ/1\354\243\274\354\260\250/.idea/misc.xml" deleted file mode 100644 index ef89d98..0000000 --- "a/gaeul/BOJ/1\354\243\274\354\260\250/.idea/misc.xml" +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git "a/gaeul/BOJ/1\354\243\274\354\260\250/.idea/modules.xml" "b/gaeul/BOJ/1\354\243\274\354\260\250/.idea/modules.xml" deleted file mode 100644 index 97bbdb5..0000000 --- "a/gaeul/BOJ/1\354\243\274\354\260\250/.idea/modules.xml" +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git "a/gaeul/BOJ/1\354\243\274\354\260\250/.idea/vcs.xml" "b/gaeul/BOJ/1\354\243\274\354\260\250/.idea/vcs.xml" deleted file mode 100644 index def3818..0000000 --- "a/gaeul/BOJ/1\354\243\274\354\260\250/.idea/vcs.xml" +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git "a/gaeul/BOJ/1\354\243\274\354\260\250/_2week_BOJ.iml" "b/gaeul/BOJ/1\354\243\274\354\260\250/_2week_BOJ.iml" deleted file mode 100644 index c90834f..0000000 --- "a/gaeul/BOJ/1\354\243\274\354\260\250/_2week_BOJ.iml" +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git "a/gaeul/BOJ/1\354\243\274\354\260\250/src/Main.java" "b/gaeul/BOJ/1\354\243\274\354\260\250/src/Main.java" deleted file mode 100644 index 6ca7944..0000000 --- "a/gaeul/BOJ/1\354\243\274\354\260\250/src/Main.java" +++ /dev/null @@ -1,65 +0,0 @@ -import java.util.Scanner; - -//1번 -public class Main { - public static void main(String[] args) { - System.out.println("Hello World!"); - } -} - -//2번 -public class Main { - public static void main(String[] args){ - - Scanner sc = new Scanner(System.in); - - int A, B; - A = sc.nextInt(); - B = sc.nextInt(); - - System.out.println(A+B); - } -} - -//3번 -public class Main { - public static void main(String[] args){ - - Scanner sc = new Scanner(System.in); - - int A, B; - A = sc.nextInt(); - B = sc.nextInt(); - - System.out.println(A-B); - } -} - -//4번 -public class Main { - public static void main(String[] args){ - - Scanner sc = new Scanner(System.in); - - int A, B; - A = sc.nextInt(); - B = sc.nextInt(); - - System.out.println(A*B); - } -} - -//5번 참고: https://blog.naver.com/mnnyng/223168953452 -public class Main { - public static void main(String[] args) { - - Scanner sc = new Scanner(System.in); - - int a, b; - a = sc.nextInt(); - b = sc.nextInt(); - - double div = (double) a / b; - System.out.println(div); - } -} \ No newline at end of file diff --git "a/gaeul/BOJ/BOJ \354\235\270\354\246\235/1\354\243\274\354\260\250_\353\260\261\354\244\2005\353\254\270\354\240\234.jpg" "b/gaeul/BOJ/BOJ \354\235\270\354\246\235/1\354\243\274\354\260\250_\353\260\261\354\244\2005\353\254\270\354\240\234.jpg" deleted file mode 100644 index 517bc47..0000000 Binary files "a/gaeul/BOJ/BOJ \354\235\270\354\246\235/1\354\243\274\354\260\250_\353\260\261\354\244\2005\353\254\270\354\240\234.jpg" and /dev/null differ diff --git "a/gaeul/BOJ/BOJ \354\235\270\354\246\235/2\354\243\274\354\260\250_\353\260\261\354\244\2005\353\254\270\354\240\234.jpg" "b/gaeul/BOJ/BOJ \354\235\270\354\246\235/2\354\243\274\354\260\250_\353\260\261\354\244\2005\353\254\270\354\240\234.jpg" deleted file mode 100644 index b5c7224..0000000 Binary files "a/gaeul/BOJ/BOJ \354\235\270\354\246\235/2\354\243\274\354\260\250_\353\260\261\354\244\2005\353\254\270\354\240\234.jpg" and /dev/null differ diff --git "a/gaeul/BOJ/BOJ \354\235\270\354\246\235/3\354\243\274\354\260\250_\353\260\261\354\244\2005\353\254\270\354\240\234.jpg" "b/gaeul/BOJ/BOJ \354\235\270\354\246\235/3\354\243\274\354\260\250_\353\260\261\354\244\2005\353\254\270\354\240\234.jpg" deleted file mode 100644 index e24f81e..0000000 Binary files "a/gaeul/BOJ/BOJ \354\235\270\354\246\235/3\354\243\274\354\260\250_\353\260\261\354\244\2005\353\254\270\354\240\234.jpg" and /dev/null differ diff --git "a/gaeul/BOJ/BOJ \354\235\270\354\246\235/46\354\243\274\354\260\250_\353\260\261\354\244\2005\353\254\270\354\240\234.png" "b/gaeul/BOJ/BOJ \354\235\270\354\246\235/46\354\243\274\354\260\250_\353\260\261\354\244\2005\353\254\270\354\240\234.png" deleted file mode 100644 index 8b1f8e0..0000000 Binary files "a/gaeul/BOJ/BOJ \354\235\270\354\246\235/46\354\243\274\354\260\250_\353\260\261\354\244\2005\353\254\270\354\240\234.png" and /dev/null differ diff --git a/gaeul/BOJ/BOJ/.gitignore b/gaeul/BOJ/BOJ/.gitignore deleted file mode 100644 index f68d109..0000000 --- a/gaeul/BOJ/BOJ/.gitignore +++ /dev/null @@ -1,29 +0,0 @@ -### IntelliJ IDEA ### -out/ -!**/src/main/**/out/ -!**/src/test/**/out/ - -### Eclipse ### -.apt_generated -.classpath -.factorypath -.project -.settings -.springBeans -.sts4-cache -bin/ -!**/src/main/**/bin/ -!**/src/test/**/bin/ - -### NetBeans ### -/nbproject/private/ -/nbbuild/ -/dist/ -/nbdist/ -/.nb-gradle/ - -### VS Code ### -.vscode/ - -### Mac OS ### -.DS_Store \ No newline at end of file diff --git a/gaeul/BOJ/BOJ/.idea/.gitignore b/gaeul/BOJ/BOJ/.idea/.gitignore deleted file mode 100644 index 13566b8..0000000 --- a/gaeul/BOJ/BOJ/.idea/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml -# Editor-based HTTP Client requests -/httpRequests/ -# Datasource local storage ignored files -/dataSources/ -/dataSources.local.xml diff --git a/gaeul/BOJ/BOJ/.idea/misc.xml b/gaeul/BOJ/BOJ/.idea/misc.xml deleted file mode 100644 index ef89d98..0000000 --- a/gaeul/BOJ/BOJ/.idea/misc.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/gaeul/BOJ/BOJ/.idea/modules.xml b/gaeul/BOJ/BOJ/.idea/modules.xml deleted file mode 100644 index b6c1bac..0000000 --- a/gaeul/BOJ/BOJ/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/gaeul/BOJ/BOJ/.idea/vcs.xml b/gaeul/BOJ/BOJ/.idea/vcs.xml deleted file mode 100644 index c2365ab..0000000 --- a/gaeul/BOJ/BOJ/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/gaeul/BOJ/BOJ/src/java_10171/Main.java b/gaeul/BOJ/BOJ/src/java_10171/Main.java deleted file mode 100644 index f0b4b7d..0000000 --- a/gaeul/BOJ/BOJ/src/java_10171/Main.java +++ /dev/null @@ -1,12 +0,0 @@ -package java_10171; -public class Main { - public static void main(String[] args) { - System.out.println("\\ /\\"); - System.out.println(" ) ( ')"); - System.out.println("( / )"); - System.out.println(" \\(__)|"); - - } -} - -//역 슬래시 \ No newline at end of file diff --git a/gaeul/BOJ/BOJ/src/java_10172/Main.java b/gaeul/BOJ/BOJ/src/java_10172/Main.java deleted file mode 100644 index 167eb9c..0000000 --- a/gaeul/BOJ/BOJ/src/java_10172/Main.java +++ /dev/null @@ -1,10 +0,0 @@ -package java_10172; -public class Main{ - public static void main(String[] args){ - System.out.println("|\\_/|"); - System.out.println("|q p| /}"); - System.out.println("( 0 )\"\"\"\\"); - System.out.println("|\"^\"` |"); - System.out.println("||_/=\\\\__|"); - } -} \ No newline at end of file diff --git a/gaeul/BOJ/BOJ/src/java_10430/Main.java b/gaeul/BOJ/BOJ/src/java_10430/Main.java deleted file mode 100644 index d7fb148..0000000 --- a/gaeul/BOJ/BOJ/src/java_10430/Main.java +++ /dev/null @@ -1,17 +0,0 @@ -package java_10430; -import java.util.Scanner; - -public class Main { - public static void main(String[] args) { - Scanner scanner = new Scanner(System.in); - - int A = scanner.nextInt(); - int B = scanner.nextInt(); - int C = scanner.nextInt(); - - System.out.println((A + B) % C); - System.out.println(((A % C) + (B % C)) % C); - System.out.println((A * B) % C); - System.out.println(((A % C) * (B % C)) % C); - } -} \ No newline at end of file diff --git a/gaeul/BOJ/BOJ/src/java_10869/Main.java b/gaeul/BOJ/BOJ/src/java_10869/Main.java deleted file mode 100644 index a90cb74..0000000 --- a/gaeul/BOJ/BOJ/src/java_10869/Main.java +++ /dev/null @@ -1,19 +0,0 @@ -package java_10869; -import java.util.Scanner; - -public class Main { - public static void main(String[] args) { - - Scanner sc = new Scanner(System.in); - int A = sc.nextInt(); - int B = sc.nextInt(); - sc.close(); - - System.out.println(A + B); - System.out.println(A - B); - System.out.println(A * B); - System.out.println(A / B); - System.out.println(A % B); - - } -} \ No newline at end of file diff --git a/gaeul/BOJ/BOJ/src/java_10926/Main.java b/gaeul/BOJ/BOJ/src/java_10926/Main.java deleted file mode 100644 index 7e920df..0000000 --- a/gaeul/BOJ/BOJ/src/java_10926/Main.java +++ /dev/null @@ -1,13 +0,0 @@ -//참고: https://blog.naver.com/govkflek/222832840521 -//이거 어려웠음 -package java_10926; -import java.util.Scanner; -public class Main{ - public static void main(String[] args) { - String ID; - Scanner sc = new Scanner(System.in); - ID = sc.next(); - System.out.println(ID + "??!"); - sc.close(); - } -} \ No newline at end of file diff --git a/gaeul/BOJ/BOJ/src/java_10950/Main.java b/gaeul/BOJ/BOJ/src/java_10950/Main.java deleted file mode 100644 index 4a6401b..0000000 --- a/gaeul/BOJ/BOJ/src/java_10950/Main.java +++ /dev/null @@ -1,20 +0,0 @@ -package java_10950; -import java.util.Scanner; -public class Main { - - public static void main(String[] args) { - Scanner in = new Scanner( System.in); - - // 테스트 케이스 개수 - int t = in.nextInt(); - - for (int i =0; i < t ; i++){ - int a = in.nextInt(); - int b = in.nextInt(); - - System.out.println(a+b); - } - - in.close(); - } -} \ No newline at end of file diff --git a/gaeul/BOJ/BOJ/src/java_11382/Main.java b/gaeul/BOJ/BOJ/src/java_11382/Main.java deleted file mode 100644 index 9a7efc6..0000000 --- a/gaeul/BOJ/BOJ/src/java_11382/Main.java +++ /dev/null @@ -1,17 +0,0 @@ -package java_11382; -import java.util.Scanner; -import java.math.BigInteger; -public class Main { - public static void main(String[] args) { - Scanner sc = new Scanner(System.in); - BigInteger A = sc.nextBigInteger(); - BigInteger B = sc.nextBigInteger(); - BigInteger C = sc.nextBigInteger(); - sc.close(); - - System.out.println(A.add(B).add(C)); - } -} - -//int의 크기에 한계가 있음 - diff --git a/gaeul/BOJ/BOJ/src/java_1330/Main.java b/gaeul/BOJ/BOJ/src/java_1330/Main.java deleted file mode 100644 index 722755d..0000000 --- a/gaeul/BOJ/BOJ/src/java_1330/Main.java +++ /dev/null @@ -1,21 +0,0 @@ -package java_1330; -import java.util.Scanner; - -public class Main { - public static void main(String[] args) { - Scanner in = new Scanner(System.in); - - int A = in.nextInt(); - int B = in.nextInt(); - - if ( A > B){ - System.out.println(">"); - } else if ( A < B) { - System.out.println("<"); - } else if ( A == B){ - System.out.println("=="); - } - - in.close(); - } -} diff --git a/gaeul/BOJ/BOJ/src/java_14681/Main.java b/gaeul/BOJ/BOJ/src/java_14681/Main.java deleted file mode 100644 index 10a66da..0000000 --- a/gaeul/BOJ/BOJ/src/java_14681/Main.java +++ /dev/null @@ -1,22 +0,0 @@ -package java_14681; -import java.util.Scanner; -public class Main { - public static void main(String[] args) { - Scanner in = new Scanner(System.in); - - int x = in.nextInt(); - int y = in.nextInt(); - - if ( x > 0 && y > 0){ - System.out.println("1"); - } else if ( x < 0 && y > 0){ - System.out.println("2"); - } else if ( x < 0 && y < 0){ - System.out.println("3"); - } else if ( x > 0 && y < 0){ - System.out.println("4"); - } - - in.close(); - } -} \ No newline at end of file diff --git a/gaeul/BOJ/BOJ/src/java_18108/Main.java b/gaeul/BOJ/BOJ/src/java_18108/Main.java deleted file mode 100644 index 2f8aeef..0000000 --- a/gaeul/BOJ/BOJ/src/java_18108/Main.java +++ /dev/null @@ -1,16 +0,0 @@ -//참고: https://blog.naver.com/govkflek/222832860569 -package java_18108; -import java.util.Scanner; - -public class Main { - public static void main(String[] args) { - Scanner scanner = new Scanner(System.in); - int year = scanner.nextInt(); - - final int DIF = 2541 - 1998; - - System.out.println(year - DIF); - - scanner.close(); - } -} \ No newline at end of file diff --git a/gaeul/BOJ/BOJ/src/java_2480/Main.java b/gaeul/BOJ/BOJ/src/java_2480/Main.java deleted file mode 100644 index 07f2c0c..0000000 --- a/gaeul/BOJ/BOJ/src/java_2480/Main.java +++ /dev/null @@ -1,41 +0,0 @@ -package java_2480; -import java.util.Scanner; -public class Main { - public static void main(String[] args) { - - Scanner in = new Scanner(System.in); - - int a = in.nextInt(); - int b = in.nextInt(); - int c = in.nextInt(); - - in.close(); - - // 모두같은 경우 - if ( a == b && b == c && a == c){ - System.out.println(10000+(a*1000)); - } else if ( a == b && b != c ){ - System.out.println(1000+(a*100)); - } else if ( a == c && a != b ){ - System.out.println(1000+(a*100)); - } else if (b == c && a != b){ - System.out.println(1000+(b*100)); - } else if ( a != b && b !=c && a != c){ - if ( a > b && b > c){ - System.out.println(a*100); - } else if ( a > c && c > b){ - System.out.println(a*100); - } else if (b > a && a > c){ - System.out.println(b*100); - } else if (b > c && c > a){ - System.out.println(b*100); - } else if ( c > a && a > b){ - System.out.println(c*100); - } else if ( c > b && b > a ){ - System.out.println(c*100); - } - - } - - } -} \ No newline at end of file diff --git a/gaeul/BOJ/BOJ/src/java_2525/Main.java b/gaeul/BOJ/BOJ/src/java_2525/Main.java deleted file mode 100644 index c8d75ca..0000000 --- a/gaeul/BOJ/BOJ/src/java_2525/Main.java +++ /dev/null @@ -1,18 +0,0 @@ -package java_2525; -import java.util.Scanner; -public class Main { - - public static void main(String[] args) { - Scanner in = new Scanner(System.in); - - // 시간 - int h = in.nextInt(); - int m = in.nextInt(); - - //경과 시간 - int n = in.nextInt(); - - in.close(); - System.out.println( ((m+n)/60+h)%24 + " " + (m+n)%60); - } -} \ No newline at end of file diff --git a/gaeul/BOJ/BOJ/src/java_25304/Main.java b/gaeul/BOJ/BOJ/src/java_25304/Main.java deleted file mode 100644 index 071ac3e..0000000 --- a/gaeul/BOJ/BOJ/src/java_25304/Main.java +++ /dev/null @@ -1,27 +0,0 @@ -package java_25304; -import java.util.Scanner; -public class Main { - - public static void main(String[] args) { - - Scanner in = new Scanner(System.in); - int total = in.nextInt(); - int n = in.nextInt(); - int sum = 0; - - for ( int i=0; i < n; i ++){ - int money = in.nextInt(); - int any = in.nextInt(); - - sum += money * any; - } - - in.close(); - - if( total == sum){ - System.out.println("Yes"); - } else { - System.out.println("No"); - } - } -} \ No newline at end of file diff --git a/gaeul/BOJ/BOJ/src/java_25314/Main.java b/gaeul/BOJ/BOJ/src/java_25314/Main.java deleted file mode 100644 index aa9eb74..0000000 --- a/gaeul/BOJ/BOJ/src/java_25314/Main.java +++ /dev/null @@ -1,21 +0,0 @@ -package java_25314; -import java.util.Scanner; -public class Main { - - public static void main(String[] args) { - - Scanner in = new Scanner(System.in); - String str = ""; - int n = in.nextInt(); - - in.close(); - - int cnt = n/4; - for (int i =0; i < cnt; i++){ - str += "long "; - } - - System.out.println(str + "int"); - - } -} \ No newline at end of file diff --git a/gaeul/BOJ/BOJ/src/java_2588/Main.java b/gaeul/BOJ/BOJ/src/java_2588/Main.java deleted file mode 100644 index 153128b..0000000 --- a/gaeul/BOJ/BOJ/src/java_2588/Main.java +++ /dev/null @@ -1,16 +0,0 @@ -//참고: https://blog.naver.com/how14033/223038173810 -package java_2588; -import java.util.Scanner; - -public class Main { - public static void main(String[] args) { - Scanner scanner = new Scanner(System.in); - int A = scanner.nextInt(); - int B = scanner.nextInt(); - - System.out.println(A * (B % 10)); - System.out.println(A * ((B / 10) % 10)); - System.out.println(A * (B / 100)); - System.out.println(A * B); - } -} diff --git a/gaeul/BOJ/BOJ/src/java_2739/Main.java b/gaeul/BOJ/BOJ/src/java_2739/Main.java deleted file mode 100644 index caca74c..0000000 --- a/gaeul/BOJ/BOJ/src/java_2739/Main.java +++ /dev/null @@ -1,14 +0,0 @@ -package java_2739; -import java.util.Scanner; -public class Main { - public static void main(String[] args) { - Scanner in = new Scanner(System.in); - - int n = in.nextInt(); - in.close(); - - for ( int i=1; i< 10; i++){ - System.out.println( n +" * " + i + " = " + n*i); - } - } -} \ No newline at end of file diff --git a/gaeul/BOJ/BOJ/src/java_2753/Main.java b/gaeul/BOJ/BOJ/src/java_2753/Main.java deleted file mode 100644 index a9f3c58..0000000 --- a/gaeul/BOJ/BOJ/src/java_2753/Main.java +++ /dev/null @@ -1,17 +0,0 @@ -package java_2753; -import java.util.Scanner; -public class Main { - public static void main(String[] args) { - Scanner in = new Scanner(System.in); - int a = in.nextInt(); - - if ( a%4 == 0 && (a%400 == 0 || a%100 != 0) ){ - System.out.println("1"); - } else{ - System.out.println("0"); - } - - in.close(); - - } -} \ No newline at end of file diff --git a/gaeul/BOJ/BOJ/src/java_2884/Main.java b/gaeul/BOJ/BOJ/src/java_2884/Main.java deleted file mode 100644 index a50746e..0000000 --- a/gaeul/BOJ/BOJ/src/java_2884/Main.java +++ /dev/null @@ -1,25 +0,0 @@ -package java_2884; -import java.util.Scanner; - -public class Main { - public static void main(String[] args) { - Scanner in = new Scanner(System.in); - - int h = in.nextInt(); - int m = in.nextInt(); - - in.close(); - - if ( m < 45){ - - h--; - m = 60 - (45 - m); - if ( h < 0){ - h = 23; - } - System.out.println(h + " " + m); - }else { - System.out.println(h + " " + (m-45)); - } - } -} diff --git a/gaeul/BOJ/BOJ/src/java_8393/Main.java b/gaeul/BOJ/BOJ/src/java_8393/Main.java deleted file mode 100644 index 5ef4f64..0000000 --- a/gaeul/BOJ/BOJ/src/java_8393/Main.java +++ /dev/null @@ -1,18 +0,0 @@ -package java_8393; -import java.util.Scanner; -public class Main { - - public static void main(String[] args) { - - Scanner in = new Scanner(System.in); - - int n = in.nextInt(); - in.close(); - - int sum = 0; - for ( int i =1 ; i <= n; i ++){ - sum += i; - } - System.out.println( sum ); - } -} \ No newline at end of file diff --git a/gaeul/BOJ/BOJ/src/java_9498/Main.java b/gaeul/BOJ/BOJ/src/java_9498/Main.java deleted file mode 100644 index 4f100a0..0000000 --- a/gaeul/BOJ/BOJ/src/java_9498/Main.java +++ /dev/null @@ -1,21 +0,0 @@ -package java_9498; -import java.util.Scanner; -public class Main { - public static void main(String[] args) { - Scanner in = new Scanner(System.in); - - int A = in.nextInt(); - - if ( A >= 90 && A <= 100){ - System.out.println("A"); - } else if ( A >=80 && A < 90){ - System.out.println("B"); - } else if ( A >=70 && A < 80){ - System.out.println("C"); - } else if ( A >= 60 && A <70){ - System.out.println("D"); - } else { - System.out.println("F"); - } - } -} diff --git a/gaeul/happy_java/Happyjava/.gitignore b/gaeul/happy_java/Happyjava/.gitignore deleted file mode 100644 index f68d109..0000000 --- a/gaeul/happy_java/Happyjava/.gitignore +++ /dev/null @@ -1,29 +0,0 @@ -### IntelliJ IDEA ### -out/ -!**/src/main/**/out/ -!**/src/test/**/out/ - -### Eclipse ### -.apt_generated -.classpath -.factorypath -.project -.settings -.springBeans -.sts4-cache -bin/ -!**/src/main/**/bin/ -!**/src/test/**/bin/ - -### NetBeans ### -/nbproject/private/ -/nbbuild/ -/dist/ -/nbdist/ -/.nb-gradle/ - -### VS Code ### -.vscode/ - -### Mac OS ### -.DS_Store \ No newline at end of file diff --git a/gaeul/happy_java/Happyjava/.idea/.gitignore b/gaeul/happy_java/Happyjava/.idea/.gitignore deleted file mode 100644 index 13566b8..0000000 --- a/gaeul/happy_java/Happyjava/.idea/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml -# Editor-based HTTP Client requests -/httpRequests/ -# Datasource local storage ignored files -/dataSources/ -/dataSources.local.xml diff --git a/gaeul/happy_java/Happyjava/.idea/misc.xml b/gaeul/happy_java/Happyjava/.idea/misc.xml deleted file mode 100644 index ef89d98..0000000 --- a/gaeul/happy_java/Happyjava/.idea/misc.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/gaeul/happy_java/Happyjava/.idea/modules.xml b/gaeul/happy_java/Happyjava/.idea/modules.xml deleted file mode 100644 index 45e9ce3..0000000 --- a/gaeul/happy_java/Happyjava/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/gaeul/happy_java/Happyjava/.idea/vcs.xml b/gaeul/happy_java/Happyjava/.idea/vcs.xml deleted file mode 100644 index c2365ab..0000000 --- a/gaeul/happy_java/Happyjava/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/gaeul/happy_java/Happyjava/Happyjava.iml b/gaeul/happy_java/Happyjava/Happyjava.iml deleted file mode 100644 index c90834f..0000000 --- a/gaeul/happy_java/Happyjava/Happyjava.iml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/gaeul/happy_java/Happyjava/src/Main.java b/gaeul/happy_java/Happyjava/src/Main.java deleted file mode 100644 index aedd9cd..0000000 --- a/gaeul/happy_java/Happyjava/src/Main.java +++ /dev/null @@ -1,17 +0,0 @@ -// Press Shift twice to open the Search Everywhere dialog and type `show whitespaces`, -// then press Enter. You can now see whitespace characters in your code. -public class Main { - public static void main(String[] args) { - // Press Alt+Enter with your caret at the highlighted text to see how - // IntelliJ IDEA suggests fixing it. - System.out.printf("Hello and welcome!"); - - // Press Shift+F10 or click the green arrow button in the gutter to run the code. - for (int i = 1; i <= 5; i++) { - - // Press Shift+F9 to start debugging your code. We have set one breakpoint - // for you, but you can always add more by pressing Ctrl+F8. - System.out.println("i = " + i); - } - } -} \ No newline at end of file diff --git a/hayoon/.idea/.gitignore b/hayoon/.idea/.gitignore deleted file mode 100644 index 26d3352..0000000 --- a/hayoon/.idea/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml diff --git a/hayoon/.idea/misc.xml b/hayoon/.idea/misc.xml deleted file mode 100644 index ef89d98..0000000 --- a/hayoon/.idea/misc.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/hayoon/.idea/uiDesigner.xml b/hayoon/.idea/uiDesigner.xml deleted file mode 100644 index 2b63946..0000000 --- a/hayoon/.idea/uiDesigner.xml +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/hayoon/.idea/vcs.xml b/hayoon/.idea/vcs.xml deleted file mode 100644 index 6c0b863..0000000 --- a/hayoon/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/hayoon/BOJ/.gitignore b/hayoon/BOJ/.gitignore deleted file mode 100644 index f68d109..0000000 --- a/hayoon/BOJ/.gitignore +++ /dev/null @@ -1,29 +0,0 @@ -### IntelliJ IDEA ### -out/ -!**/src/main/**/out/ -!**/src/test/**/out/ - -### Eclipse ### -.apt_generated -.classpath -.factorypath -.project -.settings -.springBeans -.sts4-cache -bin/ -!**/src/main/**/bin/ -!**/src/test/**/bin/ - -### NetBeans ### -/nbproject/private/ -/nbbuild/ -/dist/ -/nbdist/ -/.nb-gradle/ - -### VS Code ### -.vscode/ - -### Mac OS ### -.DS_Store \ No newline at end of file diff --git a/hayoon/BOJ/.idea/.gitignore b/hayoon/BOJ/.idea/.gitignore deleted file mode 100644 index 26d3352..0000000 --- a/hayoon/BOJ/.idea/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml diff --git a/hayoon/BOJ/.idea/misc.xml b/hayoon/BOJ/.idea/misc.xml deleted file mode 100644 index 07115cd..0000000 --- a/hayoon/BOJ/.idea/misc.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/hayoon/BOJ/.idea/modules.xml b/hayoon/BOJ/.idea/modules.xml deleted file mode 100644 index b6c1bac..0000000 --- a/hayoon/BOJ/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/hayoon/BOJ/.idea/vcs.xml b/hayoon/BOJ/.idea/vcs.xml deleted file mode 100644 index b2bdec2..0000000 --- a/hayoon/BOJ/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/hayoon/BOJ/BOJ.iml b/hayoon/BOJ/BOJ.iml deleted file mode 100644 index c90834f..0000000 --- a/hayoon/BOJ/BOJ.iml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/hayoon/BOJ/src/Main.java b/hayoon/BOJ/src/Main.java deleted file mode 100644 index 3e59c38..0000000 --- a/hayoon/BOJ/src/Main.java +++ /dev/null @@ -1,5 +0,0 @@ -public class Main { - public static void main(String[] args) { - System.out.println("Hello world!"); - } -} \ No newline at end of file diff --git a/hayoon/BOJ/src/java_1000/Main.java b/hayoon/BOJ/src/java_1000/Main.java deleted file mode 100644 index 1c533d2..0000000 --- a/hayoon/BOJ/src/java_1000/Main.java +++ /dev/null @@ -1,12 +0,0 @@ -package java_1000; -import java.util.Scanner; - -public class Main { - public static void main(String[] args){ - Scanner sc = new Scanner(System.in); - int a, b; - a = sc.nextInt(); - b = sc.nextInt(); - System.out.println(a + b); - } -} diff --git a/hayoon/BOJ/src/java_1001/Main.java b/hayoon/BOJ/src/java_1001/Main.java deleted file mode 100644 index a642b34..0000000 --- a/hayoon/BOJ/src/java_1001/Main.java +++ /dev/null @@ -1,12 +0,0 @@ -package java_1001; -import java.util.Scanner; - -public class Main { - public static void main(String[] args){ - Scanner sc = new Scanner(System.in); - int a, b; - a = sc.nextInt(); - b = sc.nextInt(); - System.out.println(a - b); - } -} diff --git a/hayoon/BOJ/src/java_1008/Main.java b/hayoon/BOJ/src/java_1008/Main.java deleted file mode 100644 index 4c2e980..0000000 --- a/hayoon/BOJ/src/java_1008/Main.java +++ /dev/null @@ -1,12 +0,0 @@ -package java_1008; -import java.util.Scanner; - -public class Main { - public static void main(String[] args){ - Scanner sc = new Scanner(System.in); - double a, b; - a = sc.nextInt(); - b = sc.nextInt(); - System.out.println(a / b); - } -} \ No newline at end of file diff --git a/hayoon/BOJ/src/java_10171/Main.java b/hayoon/BOJ/src/java_10171/Main.java deleted file mode 100644 index c7ff8b5..0000000 --- a/hayoon/BOJ/src/java_10171/Main.java +++ /dev/null @@ -1,10 +0,0 @@ -package java_10171; - -public class Main { - public static void main(String[] args){ - System.out.println("\\ /\\"); - System.out.println(" ) ( ')"); - System.out.println("( / )"); - System.out.println(" \\(__)|"); - } -} diff --git a/hayoon/BOJ/src/java_10172/Main.java b/hayoon/BOJ/src/java_10172/Main.java deleted file mode 100644 index 1705c46..0000000 --- a/hayoon/BOJ/src/java_10172/Main.java +++ /dev/null @@ -1,11 +0,0 @@ -package java_10172; - -public class Main { - public static void main(String[] args){ - System.out.println("|\\_/|"); - System.out.println("|q p| /}"); - System.out.println("( 0 )\"\"\"\\"); - System.out.println("|\"^\"` |"); - System.out.println("||_/=\\\\__|"); - } -} diff --git a/hayoon/BOJ/src/java_10430/Main.java b/hayoon/BOJ/src/java_10430/Main.java deleted file mode 100644 index 3a65185..0000000 --- a/hayoon/BOJ/src/java_10430/Main.java +++ /dev/null @@ -1,17 +0,0 @@ -package java_10430; -import java.util.Scanner; - -public class Main { - public static void main(String[] args) { - Scanner sc = new Scanner(System.in); - int a, b, c; - a = sc.nextInt(); - b = sc.nextInt(); - c = sc.nextInt(); - - System.out.println((a+b)%c); - System.out.println(((a%c) + (b%c))%c); - System.out.println((a*b)%c); - System.out.println(((a%c) * (b%c))%c); - } -} \ No newline at end of file diff --git a/hayoon/BOJ/src/java_10807/Main.java b/hayoon/BOJ/src/java_10807/Main.java deleted file mode 100644 index 2a1b21f..0000000 --- a/hayoon/BOJ/src/java_10807/Main.java +++ /dev/null @@ -1,24 +0,0 @@ -package java_10807; -import java.util.Scanner; - -public class Main { - public static void main(String[] args) { - Scanner sc = new Scanner(System.in); - - int count = 0; - int N = sc.nextInt(); - int[] array = new int[N]; - - for(int i = 0; i < N; i++) { - array[i] = sc.nextInt(); - } - int b = sc.nextInt(); - - for(int j = 0; j < array.length; j++){ - if(b == array[j]){ - count++; - } - } - System.out.println(count); - } -} \ No newline at end of file diff --git a/hayoon/BOJ/src/java_10818/Main.java b/hayoon/BOJ/src/java_10818/Main.java deleted file mode 100644 index b084ce9..0000000 --- a/hayoon/BOJ/src/java_10818/Main.java +++ /dev/null @@ -1,19 +0,0 @@ -package java_10818; -import java.util.Arrays; -import java.util.Scanner; - -public class Main { - public static void main(String[] args) { - Scanner sc = new Scanner(System.in); - - int N = sc.nextInt(); - int[] array = new int[N]; - - for (int i = 0; i < N; i++) { - array[i] = sc.nextInt(); - } - sc.close(); - Arrays.sort(array); - System.out.print(array[0] + " " + array[N - 1]); - } -} \ No newline at end of file diff --git a/hayoon/BOJ/src/java_10869/Main.java b/hayoon/BOJ/src/java_10869/Main.java deleted file mode 100644 index 95ebbc5..0000000 --- a/hayoon/BOJ/src/java_10869/Main.java +++ /dev/null @@ -1,18 +0,0 @@ -package java_10869; -import java.util.Scanner; - -public class Main { - - public static void main(String[] args){ - Scanner sc = new Scanner(System.in); - int a, b; - a = sc.nextInt(); - b = sc.nextInt(); - - System.out.println(a + b); - System.out.println(a - b); - System.out.println(a * b); - System.out.println(a / b); - System.out.println(a % b); - } -} \ No newline at end of file diff --git a/hayoon/BOJ/src/java_10871/Main.java b/hayoon/BOJ/src/java_10871/Main.java deleted file mode 100644 index 0fed02d..0000000 --- a/hayoon/BOJ/src/java_10871/Main.java +++ /dev/null @@ -1,23 +0,0 @@ -package java_10871; -import java.util.Scanner; - -public class Main { - public static void main(String[] args) { - Scanner sc = new Scanner(System.in); - - int N = sc.nextInt(); - int X = sc.nextInt(); - int array[] = new int[N]; - - for (int i = 0; i < N; i++) { - array[i] = sc.nextInt(); - } - sc.close(); - - for (int i = 0; i < N; i++) { - if (array[i] < X) { - System.out.print(array[i] + " "); - } - } - } -} \ No newline at end of file diff --git a/hayoon/BOJ/src/java_10926/Main.java b/hayoon/BOJ/src/java_10926/Main.java deleted file mode 100644 index e6756b8..0000000 --- a/hayoon/BOJ/src/java_10926/Main.java +++ /dev/null @@ -1,12 +0,0 @@ -package java_10926; -import java.util.Scanner; - -public class Main { - public static void main(String[] args) { - Scanner sc = new Scanner(System.in); - String user; - user = sc.nextLine(); - - System.out.print(user + "??!"); - } -} \ No newline at end of file diff --git a/hayoon/BOJ/src/java_10950/Main.java b/hayoon/BOJ/src/java_10950/Main.java deleted file mode 100644 index b66b498..0000000 --- a/hayoon/BOJ/src/java_10950/Main.java +++ /dev/null @@ -1,21 +0,0 @@ -package java_10950; -import java.util.Scanner; - -public class Main { - public static void main(String args[]) { - Scanner sc = new Scanner(System.in); - int c = sc.nextInt(); - int array[] = new int[c]; - - for (int i = 0; i < c; i++) { - int a = sc.nextInt(); - int b = sc.nextInt(); - array[i] = a + b; - } - sc.close(); - - for (int k : array) { - System.out.println(k); - } - } -} \ No newline at end of file diff --git a/hayoon/BOJ/src/java_10998/Main.java b/hayoon/BOJ/src/java_10998/Main.java deleted file mode 100644 index 536e647..0000000 --- a/hayoon/BOJ/src/java_10998/Main.java +++ /dev/null @@ -1,12 +0,0 @@ -package java_10998; -import java.util.Scanner; - -public class Main { - public static void main(String[] args){ - Scanner sc = new Scanner(System.in); - int a, b; - a = sc.nextInt(); - b = sc.nextInt(); - System.out.println(a * b); - } -} \ No newline at end of file diff --git a/hayoon/BOJ/src/java_11382/Main.java b/hayoon/BOJ/src/java_11382/Main.java deleted file mode 100644 index 6fed173..0000000 --- a/hayoon/BOJ/src/java_11382/Main.java +++ /dev/null @@ -1,11 +0,0 @@ -package java_11382; -import java.util.Scanner; -public class Main { - public static void main(String[] args){ - Scanner sc = new Scanner(System.in); - long a = sc.nextLong(); - long b = sc.nextLong(); - long c = sc.nextLong(); - System.out.println(a + b + c); - } -} diff --git a/hayoon/BOJ/src/java_1330/Main.java b/hayoon/BOJ/src/java_1330/Main.java deleted file mode 100644 index f2c662e..0000000 --- a/hayoon/BOJ/src/java_1330/Main.java +++ /dev/null @@ -1,19 +0,0 @@ -package java_1330; -import java.util.Scanner; - -public class Main { - public static void main(String[] args) { - Scanner sc = new Scanner(System.in); - double a, b; - a = sc.nextDouble(); - b = sc.nextDouble(); - - if (a > b) { - System.out.println(">"); - } else if (a < b) { - System.out.println("<"); - } else { - System.out.println("=="); - } - } -} diff --git a/hayoon/BOJ/src/java_14681/Main.java b/hayoon/BOJ/src/java_14681/Main.java deleted file mode 100644 index 77f7ddd..0000000 --- a/hayoon/BOJ/src/java_14681/Main.java +++ /dev/null @@ -1,29 +0,0 @@ -package java_14681; -import java.util.Scanner; - -public class Main { - - public static void main(String[] args) { - Scanner sc = new Scanner(System.in); - - int X = sc.nextInt(); - int Y = sc.nextInt(); - - if(X > 0) { - if(Y > 0) { - System.out.print(1); - } - else { - System.out.print(4); - } - } - else { - if(Y > 0) { - System.out.print(2); - } - else { - System.out.print(3); - } - } - } -} \ No newline at end of file diff --git a/hayoon/BOJ/src/java_18108/Main.java b/hayoon/BOJ/src/java_18108/Main.java deleted file mode 100644 index ea60491..0000000 --- a/hayoon/BOJ/src/java_18108/Main.java +++ /dev/null @@ -1,11 +0,0 @@ -package java_18108; -import java.util.Scanner; - -public class Main { - public static void main(String[] args){ - Scanner sc = new Scanner(System.in); - int year = sc.nextInt(); - - System.out.println(year - 543); - } -} diff --git a/hayoon/BOJ/src/java_2557/Main.java b/hayoon/BOJ/src/java_2557/Main.java deleted file mode 100644 index 483c1af..0000000 --- a/hayoon/BOJ/src/java_2557/Main.java +++ /dev/null @@ -1,7 +0,0 @@ -package java_2557; - -public class Main { - public static void main(String[] args){ - System.out.println("Hello World!"); - } -} diff --git a/hayoon/BOJ/src/java_2562/Main.java b/hayoon/BOJ/src/java_2562/Main.java deleted file mode 100644 index d506e0e..0000000 --- a/hayoon/BOJ/src/java_2562/Main.java +++ /dev/null @@ -1,21 +0,0 @@ -package java_2562; -import java.util.Scanner; - -public class Main { - public static void main(String[] args) { - Scanner sc = new Scanner(System.in); - int array[] = new int[9]; - int max = array[0]; - int index = 0; - - for (int i = 0; i < array.length; i++) { - array[i] = sc.nextInt(); - if (max < array[i]) { - max = array[i]; - index = i+1; - } - } - System.out.println(max); - System.out.println(index); - } -} \ No newline at end of file diff --git a/hayoon/BOJ/src/java_2588/Main.java b/hayoon/BOJ/src/java_2588/Main.java deleted file mode 100644 index f64acb3..0000000 --- a/hayoon/BOJ/src/java_2588/Main.java +++ /dev/null @@ -1,15 +0,0 @@ -package java_2588; -import java.util.Scanner; - -public class Main { - public static void main(String[] args){ - Scanner sc = new Scanner(System.in); - int a = sc.nextInt(); - int b = sc.nextInt(); - - System.out.println(a * (b % 10)); - System.out.println(a * (b % 100 / 10)); - System.out.println(a * (b / 100)); - System.out.println(a * b); - } -} diff --git a/hayoon/BOJ/src/java_2739/Main.java b/hayoon/BOJ/src/java_2739/Main.java deleted file mode 100644 index 2cb28a7..0000000 --- a/hayoon/BOJ/src/java_2739/Main.java +++ /dev/null @@ -1,14 +0,0 @@ -package java_2739; -import java.util.Scanner; - -public class Main { - public static void main(String[] args) { - Scanner sc = new Scanner(System.in); - int a = sc.nextInt(); - sc.close(); - - for(int i = 1; i < 10 ;i++) { - System.out.println(a+" * "+i+" = "+(a*i)); - } - } -} \ No newline at end of file diff --git a/hayoon/BOJ/src/java_2753/Main.java b/hayoon/BOJ/src/java_2753/Main.java deleted file mode 100644 index b0021e9..0000000 --- a/hayoon/BOJ/src/java_2753/Main.java +++ /dev/null @@ -1,19 +0,0 @@ -package java_2753; -import java.util.Scanner; - -public class Main { - - public static void main(String[] args) { - Scanner sc = new Scanner(System.in); - - int y = sc.nextInt(); - sc.close(); - - if(y%4==0) { - if(y%400==0) System.out.println("1"); - else if(y%100==0) System.out.println("0"); - else System.out.println("1"); - } - else System.out.println("0"); - } -} \ No newline at end of file diff --git a/hayoon/BOJ/src/java_27866/Main.java b/hayoon/BOJ/src/java_27866/Main.java deleted file mode 100644 index 6b05e8c..0000000 --- a/hayoon/BOJ/src/java_27866/Main.java +++ /dev/null @@ -1,14 +0,0 @@ -package java_27866; -import java.util.Scanner; - -public class Main { - public static void main(String[] args){ - Scanner sc = new Scanner(System.in); - - String st = sc.next(); - int n = sc.nextInt()-1; - - System.out.println(st.charAt(n)); - sc.close(); - } -} \ No newline at end of file diff --git a/hayoon/BOJ/src/java_8393/Main.java b/hayoon/BOJ/src/java_8393/Main.java deleted file mode 100644 index dac8065..0000000 --- a/hayoon/BOJ/src/java_8393/Main.java +++ /dev/null @@ -1,17 +0,0 @@ -package java_8393; -import java.util.Scanner; - -public class Main { - public static void main(String[] args) { - Scanner sc = new Scanner(System.in); - - int a = sc.nextInt(); - sc.close(); - int sum = 0; - - for (int i = 1; i <= a; i++) { - sum += i; - } - System.out.println(sum); - } -} \ No newline at end of file diff --git a/hayoon/BOJ/src/java_9498/Main.java b/hayoon/BOJ/src/java_9498/Main.java deleted file mode 100644 index 8b66a46..0000000 --- a/hayoon/BOJ/src/java_9498/Main.java +++ /dev/null @@ -1,22 +0,0 @@ -package java_9498; -import java.util.Scanner; - -public class Main { - public static void main(String[] args){ - Scanner sc = new Scanner(System.in); - int score; - score = sc.nextInt(); - - if (score >= 90 && score <= 100) { - System.out.println("A"); - } else if (score >= 80 && score <= 89) { - System.out.println("B"); - } else if (score >= 70 && score <= 79) { - System.out.println("C"); - } else if (score >= 60 && score <= 69) { - System.out.println("D"); - } else { - System.out.println("F"); - } - } -} diff --git a/hayoon/happy_java/.gitignore b/hayoon/happy_java/.gitignore deleted file mode 100644 index f68d109..0000000 --- a/hayoon/happy_java/.gitignore +++ /dev/null @@ -1,29 +0,0 @@ -### IntelliJ IDEA ### -out/ -!**/src/main/**/out/ -!**/src/test/**/out/ - -### Eclipse ### -.apt_generated -.classpath -.factorypath -.project -.settings -.springBeans -.sts4-cache -bin/ -!**/src/main/**/bin/ -!**/src/test/**/bin/ - -### NetBeans ### -/nbproject/private/ -/nbbuild/ -/dist/ -/nbdist/ -/.nb-gradle/ - -### VS Code ### -.vscode/ - -### Mac OS ### -.DS_Store \ No newline at end of file diff --git a/hayoon/happy_java/.idea/.gitignore b/hayoon/happy_java/.idea/.gitignore deleted file mode 100644 index 26d3352..0000000 --- a/hayoon/happy_java/.idea/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml diff --git a/hayoon/happy_java/.idea/misc.xml b/hayoon/happy_java/.idea/misc.xml deleted file mode 100644 index 07115cd..0000000 --- a/hayoon/happy_java/.idea/misc.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/hayoon/happy_java/.idea/modules.xml b/hayoon/happy_java/.idea/modules.xml deleted file mode 100644 index b966e11..0000000 --- a/hayoon/happy_java/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/hayoon/happy_java/.idea/vcs.xml b/hayoon/happy_java/.idea/vcs.xml deleted file mode 100644 index b2bdec2..0000000 --- a/hayoon/happy_java/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/hayoon/happy_java/happy_java.iml b/hayoon/happy_java/happy_java.iml deleted file mode 100644 index c90834f..0000000 --- a/hayoon/happy_java/happy_java.iml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/hayoon/happy_java/src/Main.java b/hayoon/happy_java/src/Main.java deleted file mode 100644 index 3e59c38..0000000 --- a/hayoon/happy_java/src/Main.java +++ /dev/null @@ -1,5 +0,0 @@ -public class Main { - public static void main(String[] args) { - System.out.println("Hello world!"); - } -} \ No newline at end of file diff --git a/hayoon/happy_java/src/com/example/Ball.java b/hayoon/happy_java/src/com/example/Ball.java deleted file mode 100644 index 3592899..0000000 --- a/hayoon/happy_java/src/com/example/Ball.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.example; - -// 불변객체 -public class Ball { - private int number; - - public Ball(int number) { - this.number = number; - } - - public int getNumber() { - return number; - } -} \ No newline at end of file diff --git a/hayoon/happy_java/src/com/example/BeanFactory.java b/hayoon/happy_java/src/com/example/BeanFactory.java deleted file mode 100644 index 2ea5c7e..0000000 --- a/hayoon/happy_java/src/com/example/BeanFactory.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.example; - -public class BeanFactory { - // 2. 자기 자신 인스턴스를 참조하는 static한 필드를 선언한다. - private static BeanFactory interface = new BeanFactory(); - // 1. private 생성자를 만든다. 외부에서 인스턴스를 생성하지 못한다. - private BeanFactory(){ - } - // 3. 2번에서 생성한 인스턴스를 반환하는 static한 메소드를 만든다. - public static BeanFactory getInstance(){ - return instance; - } - - public Bus getBus(){ - return new Bus(); - } -} \ No newline at end of file diff --git a/hayoon/happy_java/src/com/example/BeanFactoryMain.java b/hayoon/happy_java/src/com/example/BeanFactoryMain.java deleted file mode 100644 index 488f82c..0000000 --- a/hayoon/happy_java/src/com/example/BeanFactoryMain.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.example; - -public class BeanFactoryMain { - public static void main(String[] args) { -// BeanFactory bf1 = new BeanFactory(); -// BeanFactory bf2 = new BeanFactory(); -// BeanFactory bf3 = new BeanFactory(); -// BeanFactory bf4 = new BeanFactory(); -// BeanFactory bf5 = new BeanFactory(); -// -// BeanFactory.instance = null; - - BeanFactory bf1 = BeanFactory.getInstance(); - BeanFactory bf2 = BeanFactory.getInstance(); - if(bf1 == bf2){ - System.out.println("bf1 == bf2"); - } - - Bus b1 = bf1.getBus(); - Bus b2 = bf1.getBus(); - - // Bus b3 = new Bus(); 대신 생성과정을 다른 객체(팩토리)한테 맡긴 후 리턴받아 사용 - } -} \ No newline at end of file diff --git a/hayoon/happy_java/src/com/example/Bus.java b/hayoon/happy_java/src/com/example/Bus.java deleted file mode 100644 index 40c1ae8..0000000 --- a/hayoon/happy_java/src/com/example/Bus.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.example; - -public class Bus extends Car{ - public void a(){ - System.out.println("a"); - } - public void b(){ - System.out.println("b"); - } - public void c(){ - System.out.println("c"); - } -} \ No newline at end of file diff --git a/hayoon/happy_java/src/com/example/Car.java b/hayoon/happy_java/src/com/example/Car.java deleted file mode 100644 index 779c1fa..0000000 --- a/hayoon/happy_java/src/com/example/Car.java +++ /dev/null @@ -1,5 +0,0 @@ -package com.example; - -public abstract class Car { - public abstract void a(); -} \ No newline at end of file diff --git a/hayoon/happy_java/src/com/example/CarExam.java b/hayoon/happy_java/src/com/example/CarExam.java deleted file mode 100644 index 1a5c65f..0000000 --- a/hayoon/happy_java/src/com/example/CarExam.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.example; - -public class CarExam { - public static void main(String[] args) { -// Car c1 = new Car(); // 추상클래스는 인스턴스가 될 수 없다. -> 에러 - Car c1 = new Car(){ - @Override - public void a(){ - System.out.println("이름없는 객체의 a()메소드 오버라이딩"); - } - }; - - - c1.a(); - } -} \ No newline at end of file diff --git a/hayoon/happy_java/src/com/example/ClassLoaderMain.java b/hayoon/happy_java/src/com/example/ClassLoaderMain.java deleted file mode 100644 index 1d47a78..0000000 --- a/hayoon/happy_java/src/com/example/ClassLoaderMain.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.example; - -import java.lang.reflect.Method; - -public class ClassLoaderMain { - public static void main(String[] args) throws Exception{ - // a() 메소드를 가지고 있는 클래스가 있다. - // 이 클래스 이름이 아직 무엇인지 모르겠다. - // 나중에 이 클래스 이름을 알려주겠다. - // a()메소드를 실행할 수 있도록 코드를 작성해라. - - // Bus b = new Bus(); - // b.a(); - - // className에 해당하는 클래스 정보를 CLASSPATH에서 읽어들이고, - // 그 정보를 clazz가 참조하도록 한다. - // Object 0 = new Bus(); - // Car c = new Bus(); - String className = "com.example.MyHome"; - Class clazz = Class.forName(className); - Object o = clazz.newInstance(); -// Car b = (Car)o; // 부모타입으로 참조 -// b.a(); - Method m = clazz.getDeclaredMethod("a", null); // a() 메소드 정보를 가지고 있는 method를 반환하라. - m.invoke(o, null); // Object o가 참조하는 m 메소드를 실행하라. - } -} \ No newline at end of file diff --git a/hayoon/happy_java/src/com/example/LottoMachine.java b/hayoon/happy_java/src/com/example/LottoMachine.java deleted file mode 100644 index aece321..0000000 --- a/hayoon/happy_java/src/com/example/LottoMachine.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.example; - -/* -1. 1~45까지 써있는 ball을 로또 기계에 넣는다. -2. 로또 기계에 있는 ball들을 섞는다. -3. 섞인 ball 중에서 6개를 꺼낸다. - */ -public interface LottoMachine { // interface는 추상 메소드 생략 가능, new 사용 불가 - int MAX_BALL_COUNT = 45; // interface의 field는 모두가 public static -> 생략 가능 - int RETURN_BALL_COUNT = 6; // = 메모리에 인스턴스를 만들지 않아도 올라간다. - public void setBalls(Ball[] balls); // Ball[] Ball이 45개를 받겠다. - public void mix(); // 자기가 가지고 있는 Ball들을 섞는다. - public Ball[] getBalls(); // 6개의 Ball을 반환한다. -} \ No newline at end of file diff --git a/hayoon/happy_java/src/com/example/LottoMachineImpl.java b/hayoon/happy_java/src/com/example/LottoMachineImpl.java deleted file mode 100644 index 25855fd..0000000 --- a/hayoon/happy_java/src/com/example/LottoMachineImpl.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.example; - -// 인터페이스를 구현하게 되면 반드시 인터페이스가 가지고 있는 메소드를 오버라이딩 해줘야 함. -public class LottoMachineImpl implements LottoMachine{ - private Ball[] balls; - - @Override - public void setBalls(Ball[] balls) { - this.balls = balls; - } - - // Math.random() ==> 0.0 <= x < 1.0 실수값 ex) 0.54322342 - // 0.0 <= x < 45.0 - // (int) 0 <= x < 45 ==> 0 ~ 44 사이의 정수 - @Override - public void mix() { - for (int i = 0; i < 10000; i++){ - int x1 = (int)(Math.random() * LottoMachine.MAX_BALL_COUNT); - int x2 = (int)(Math.random() * LottoMachine.MAX_BALL_COUNT); - if (x1 != x2){ - Ball tmp = balls[x1]; // 값을 치환할 때는 같은 타입의 임시변수가 필요하다. - balls[x1] = balls[x2]; - balls[x2] = tmp; - } // if - } // for - } - - @Override - public Ball[] getBalls() { - Ball[] result = new Ball[LottoMachine.RETURN_BALL_COUNT]; // Ball 6개를 참조할 수 있는 배열 - for(int i = 0; i < 6; i++){ - result[i] = balls[i]; - } - return result; - } -} \ No newline at end of file diff --git a/hayoon/happy_java/src/com/example/LottoMachineMain.java b/hayoon/happy_java/src/com/example/LottoMachineMain.java deleted file mode 100644 index 7355fe7..0000000 --- a/hayoon/happy_java/src/com/example/LottoMachineMain.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.example; - -public class LottoMachineMain { - public static void main(String[] args) { - -// Ball b1 = new Ball(1); -// Ball b2 = new Ball(2); -// ...... -// Ball b45 = new Ball(45); - // 변수가 45개 필요하다. Ball 인스턴스를 45개 참조할 수 있는 배열이 만들어진다. - // 배열은 45개의 참조할 수 있는 변수를 선언한 것이지 뒤에 new 인스턴스를 생성한 것이 아님. - Ball[] balls = new Ball[LottoMachine.MAX_BALL_COUNT]; // 배열 = 방 -// balls[0] = new Ball(1); -// balls[1] = new Ball(2); -// ... -// balls[44] = new Ball(45); - for(int i = 0; i < LottoMachine.MAX_BALL_COUNT; i++){ - balls[i] = new Ball(i + 1); - } - - // LottoMachine 인스턴스가 생성된다. - LottoMachine lottoMachine = new LottoMachineImpl(); - lottoMachine.setBalls(balls); - lottoMachine.mix(); - Ball[] result = lottoMachine.getBalls(); - - for(int i = 0; i < result.length; i++){ - System.out.println(result[i].getNumber()); - } - } -} \ No newline at end of file diff --git a/hayoon/happy_java/src/com/example/MyHome.java b/hayoon/happy_java/src/com/example/MyHome.java deleted file mode 100644 index 1c646ba..0000000 --- a/hayoon/happy_java/src/com/example/MyHome.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.example; - -public class MyHome { - public void a(){ - System.out.println("a 라는 메소드를 MyHome이 가지고 있어요."); - } -} \ No newline at end of file diff --git a/hayoon/happy_java/src/com/example/MyRunnable.java b/hayoon/happy_java/src/com/example/MyRunnable.java deleted file mode 100644 index bec9235..0000000 --- a/hayoon/happy_java/src/com/example/MyRunnable.java +++ /dev/null @@ -1,5 +0,0 @@ -package com.example; - -public interface MyRunnable { - public void run(); -} \ No newline at end of file diff --git a/hayoon/happy_java/src/com/example/MyRunnableMain.java b/hayoon/happy_java/src/com/example/MyRunnableMain.java deleted file mode 100644 index 083beae..0000000 --- a/hayoon/happy_java/src/com/example/MyRunnableMain.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.example; - -public class MyRunnableMain { - public static void main(String[] args) { - MyRunnable r = new MyRunnable() { - @Override - public void run() { - System.out.println("myrunnable run!!!"); - } - }; // 자동으로 이름없는 객체 만들어줌 - - r.run(); - } -} \ No newline at end of file diff --git a/hayoon/happy_java/src/com/example/MyRunnableMain2.java b/hayoon/happy_java/src/com/example/MyRunnableMain2.java deleted file mode 100644 index d6d60b8..0000000 --- a/hayoon/happy_java/src/com/example/MyRunnableMain2.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.example; - -public class MyRunnableMain2 { - public static void main(String[] args) { - - MyRunnable myRunnable = new MyRunnable() { - @Override - public void run(){ - System.out.println("hello!!!"); - } - } - - RunnableExecute runnableExecute = new RunnableExecute(); - System.out.println("------------"); - runnableExecute.execute(myRunnable); - System.out.println("------------"); - } -} \ No newline at end of file diff --git a/hayoon/happy_java/src/com/example/RunnableExecute.java b/hayoon/happy_java/src/com/example/RunnableExecute.java deleted file mode 100644 index c9c8881..0000000 --- a/hayoon/happy_java/src/com/example/RunnableExecute.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.example; - -public class RunnableExecute { - public void execute(MyRunnable myRunnable){ - myRunnable.run(); - } -} \ No newline at end of file diff --git a/hayoon/happy_java/src/com/example/StringExam.java b/hayoon/happy_java/src/com/example/StringExam.java deleted file mode 100644 index b028ceb..0000000 --- a/hayoon/happy_java/src/com/example/StringExam.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.example; - -public class StringExam { - public static void main(String[] args) { - String str1 = "hello"; // String 사용시 바람직한 방법 - String str2 = "hello"; - String str3 = new String("hello"); // new 사용시 매번 메모리를 차지 - String str4 = new String("hello"); - - if(str1 == str2) - System.out.println("str1 == str2"); - if(str1 == str3) - System.out.println("str1 == str3"); - if(str3 == str4) - System.out.println("str3 == str4"); - - System.out.println(str1); - System.out.println(str2); - System.out.println(str3); - System.out.println(str4); - } -} \ No newline at end of file diff --git a/hayoon/happy_java/src/com/example/StringExam2.java b/hayoon/happy_java/src/com/example/StringExam2.java deleted file mode 100644 index 28445e5..0000000 --- a/hayoon/happy_java/src/com/example/StringExam2.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.example; - -public class StringExam2 { - public static void main(String[] args) { - String str1 = "hello"; - String str2 = new String("hello"); - - if(str1.equals(str2)) { // equals 메소드는 값이 같은지 묻는 것 - System.out.println("str1과 str2의 값이 같다."); - } - - String s = str1.toUpperCase(); - System.out.println(s); - System.out.println(str1); - - String substring = str1.substring(3); - System.out.println(substring); - System.out.println(str1); - } -} \ No newline at end of file diff --git a/hayoon/happy_java/src/com/example/SuperCar.java b/hayoon/happy_java/src/com/example/SuperCar.java deleted file mode 100644 index 9e91bd3..0000000 --- a/hayoon/happy_java/src/com/example/SuperCar.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.example; - -public class SuperCar extends Car{ - public void a(){ - System.out.println("supercar a!!!"); - } -} \ No newline at end of file diff --git a/hayoon/happy_java/src/com/example/fw/Controller.java b/hayoon/happy_java/src/com/example/fw/Controller.java deleted file mode 100644 index 04b4886..0000000 --- a/hayoon/happy_java/src/com/example/fw/Controller.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.example.fw; -/* -Controller의 종류가 여러개더라. -초기화 - 항상 같은 코드 -실행 - 다른 코드 -마무리 - 항상 같은 코드 -*/ -public abstract class Controller { // abstract -> 반드시 상속 - // protected는 같은 package이거나 상속받았을 경우 접근 가능하다. - // final이 붙은 메소드는 오버라이딩이 금지가 됨. - protected final void init(){ - System.out.println("초기화 하는 코드"); - } - protected final void close(){ - System.out.println("마무리 하는 코드"); - } - protected abstract void run(); // 매번 달라지는 코드 <- 강제로 오버라이딩하게 함. - - // 내가 가지고 있는 메소드를 호출한다. - // 어떤 순서를 가지고 있다. 이런 메소드를 템플릿 메소드라고 한다. - public void execute(){ - this.init(); // this. = 생략가능 - this.run(); - this.close(); - } -} \ No newline at end of file diff --git a/hayoon/happy_java/src/com/example/main/CalculatorMain.java b/hayoon/happy_java/src/com/example/main/CalculatorMain.java deleted file mode 100644 index 68100c2..0000000 --- a/hayoon/happy_java/src/com/example/main/CalculatorMain.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.example.main; - -import com.example.util.Calculator; - -public class CalculatorMain { - public static void main(String[] args){ - Calculator cal = new Calculator(); - int value = cal.plus(50, 100); - System.out.println(value); - - com.example.util2.Calculator cal2 = new com.example.util2.Calculator(); - int value2 = cal2.divide(100, 50); - System.out.println(value2); - } -} diff --git a/hayoon/happy_java/src/com/example/main/ControllerMain.java b/hayoon/happy_java/src/com/example/main/ControllerMain.java deleted file mode 100644 index e6e6075..0000000 --- a/hayoon/happy_java/src/com/example/main/ControllerMain.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.example.main; - -import com.example.fw.Controller; -import com.example.myproject.FirstController; - -public class ControllerMain { - public static void main(String[] args) { - Controller c1 = new FirstController(); - c1.execute(); // protected인 init(), run(), close() 메소드는 보이지 않음. - } -} \ No newline at end of file diff --git a/hayoon/happy_java/src/com/example/myproject/FirstController.java b/hayoon/happy_java/src/com/example/myproject/FirstController.java deleted file mode 100644 index 5ee6a91..0000000 --- a/hayoon/happy_java/src/com/example/myproject/FirstController.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.example.myproject; - -import com.example.fw.Controller; - -public class FirstController extends Controller { // 추상클래스를 상속받으면 반드시 오버라이딩 해야 함. - @Override - protected void run() { // 상속을 받았기 때문에 다른 package여도 run()메소드 사용 가능. - System.out.println("별도로 동작하는 코드 111111"); - } -} \ No newline at end of file diff --git a/hayoon/happy_java/src/com/example/util/Calculator.java b/hayoon/happy_java/src/com/example/util/Calculator.java deleted file mode 100644 index 079ed54..0000000 --- a/hayoon/happy_java/src/com/example/util/Calculator.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.example.util; // 도메인명 거꾸로 + 프로젝트명 - -public class Calculator { - public int plus(int x, int y){ - return x + y; - } - - public int minus(int x, int y){ - return x - y; - } - - public static void main(String[] args){ - Calculator cal = new Calculator(); - int value = cal.plus(10, 100); - System.out.println(value); - } -} diff --git a/hayoon/happy_java/src/com/example/util2/Calculator.java b/hayoon/happy_java/src/com/example/util2/Calculator.java deleted file mode 100644 index 64f9699..0000000 --- a/hayoon/happy_java/src/com/example/util2/Calculator.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.example.util2; // 도메인명 거꾸로 + 프로젝트명 - -public class Calculator { - public int divide(int x, int y){ - return x / y; - } - -} diff --git a/hayoon/happy_java/src/happy_java_01/BitOperatorExam1.java b/hayoon/happy_java/src/happy_java_01/BitOperatorExam1.java deleted file mode 100644 index e7b15b4..0000000 --- a/hayoon/happy_java/src/happy_java_01/BitOperatorExam1.java +++ /dev/null @@ -1,13 +0,0 @@ -package happy_java_01; - -public class BitOperatorExam1 { - public static void main(String[] args) { - int a = 4; - int b = a >> 1; - System.out.println(b); - - int c = 4; - int d = c << 1; - System.out.println(d); - } -} diff --git a/hayoon/happy_java/src/happy_java_01/BooleanTest1.java b/hayoon/happy_java/src/happy_java_01/BooleanTest1.java deleted file mode 100644 index 932cac1..0000000 --- a/hayoon/happy_java/src/happy_java_01/BooleanTest1.java +++ /dev/null @@ -1,23 +0,0 @@ -package happy_java_01; - -public class BooleanTest1 { - public static void main(String[] args) { - boolean flag1 = false; - boolean flag2 = false; - boolean flag3 = false; - boolean flag4 = false; - boolean flag5 = false; - - flag1 = 10 > 5; - flag2 = 10 < 5; - flag3 = 10 >= 10; - flag4 = 10 <= 10; - flag5 = 10 == 10; - - System.out.println(flag1); - System.out.println(flag2); - System.out.println(flag3); - System.out.println(flag4); - System.out.println(flag5); - } -} diff --git a/hayoon/happy_java/src/happy_java_01/BooleanTest2.java b/hayoon/happy_java/src/happy_java_01/BooleanTest2.java deleted file mode 100644 index 05e6055..0000000 --- a/hayoon/happy_java/src/happy_java_01/BooleanTest2.java +++ /dev/null @@ -1,26 +0,0 @@ -package happy_java_01; - -public class BooleanTest2 { - public static void main(String[] args) { - boolean flag1 = false; - boolean flag2 = false; - boolean flag3 = false; - boolean flag4 = false; - boolean flag5 = false; - boolean flag6 = false; - - flag1 = 10 > 5 && 5 < 20; - flag2 = 10 < 5 & 5 < 20; - flag3 = 10 >= 10 || 5 > 6; - flag4 = 10 <= 10 | 5 > 6; - flag5 = 10 == 10 ^ 5 == 4; - flag6 = !flag5; - - System.out.println(flag1); - System.out.println(flag2); - System.out.println(flag3); - System.out.println(flag4); - System.out.println(flag5); - System.out.println(flag6); - } -} diff --git a/hayoon/happy_java/src/happy_java_01/CharExam2.java b/hayoon/happy_java/src/happy_java_01/CharExam2.java deleted file mode 100644 index c8a2ef9..0000000 --- a/hayoon/happy_java/src/happy_java_01/CharExam2.java +++ /dev/null @@ -1,19 +0,0 @@ -package happy_java_01; - -public class CharExam2 { - public static void main(String[] args) { - char c1 = 'a'; - - System.out.println((int) c1); - - char c2 = (char) 97; - System.out.println(c2); - - char c3 = 'a'; - - while(c3 <= 'z'){ - System.out.println(c3); - c3++; - } - } -} diff --git a/hayoon/happy_java/src/happy_java_01/ForExam2.java b/hayoon/happy_java/src/happy_java_01/ForExam2.java deleted file mode 100644 index ce5e51d..0000000 --- a/hayoon/happy_java/src/happy_java_01/ForExam2.java +++ /dev/null @@ -1,9 +0,0 @@ -package happy_java_01; - -public class ForExam2 { - public static void main(String[] args){ - for (int i = 1; i <= 10; i++){ - System.out.println(i); - } - } -} diff --git a/hayoon/happy_java/src/happy_java_01/Gugudan2.java b/hayoon/happy_java/src/happy_java_01/Gugudan2.java deleted file mode 100644 index f57f12d..0000000 --- a/hayoon/happy_java/src/happy_java_01/Gugudan2.java +++ /dev/null @@ -1,12 +0,0 @@ -package happy_java_01; - -public class Gugudan2 { - public static void main(String[] args){ - for (int k = 1; k <= 9; k++) { - for (int i = 1; i <= 9; i++) { - System.out.println(k + " * " + i + " = " + (k * i)); - } - System.out.println(); - } - } -} diff --git a/hayoon/happy_java/src/happy_java_01/LabelExam1.java b/hayoon/happy_java/src/happy_java_01/LabelExam1.java deleted file mode 100644 index e8a72e8..0000000 --- a/hayoon/happy_java/src/happy_java_01/LabelExam1.java +++ /dev/null @@ -1,14 +0,0 @@ -package happy_java_01; - -public class LabelExam1 { - public static void main(String[] args){ - outter: - for (int i = 0; i < 3; i++){ - for(int k = 0; k < 3; k++){ - if(i == 0 && k == 2) - break outter; - System.out.println(i + ", " + k); - } - } - } -} diff --git a/hayoon/happy_java/src/happy_java_01/NumberExam1.java b/hayoon/happy_java/src/happy_java_01/NumberExam1.java deleted file mode 100644 index 9a26955..0000000 --- a/hayoon/happy_java/src/happy_java_01/NumberExam1.java +++ /dev/null @@ -1,17 +0,0 @@ -package happy_java_01; - -public class NumberExam1 { - public static void main(String[] args) { - int maxInt = Integer.MAX_VALUE; - int minInt = Integer.MIN_VALUE; - - double maxDouble = Double.MAX_VALUE; - double minDouble = Double.MIN_VALUE; - - System.out.println(maxInt); - System.out.println(minInt); - - System.out.println(maxDouble); - System.out.println(minDouble); - } -} diff --git a/hayoon/happy_java/src/happy_java_01/NumberOverFlow.java b/hayoon/happy_java/src/happy_java_01/NumberOverFlow.java deleted file mode 100644 index 8b77792..0000000 --- a/hayoon/happy_java/src/happy_java_01/NumberOverFlow.java +++ /dev/null @@ -1,17 +0,0 @@ -package happy_java_01; - -public class NumberOverFlow { - public static void main(String[] args) { - int value = 10; - int maxInt = Integer.MAX_VALUE; - - System.out.println(value + 1); - System.out.println(maxInt + 1); - - double d1 = 50; - double d2 = 500L; - - System.out.println(d1); - System.out.println(d2); - } -} diff --git a/hayoon/happy_java/src/happy_java_01/Rectangle.java b/hayoon/happy_java/src/happy_java_01/Rectangle.java deleted file mode 100644 index 72731f8..0000000 --- a/hayoon/happy_java/src/happy_java_01/Rectangle.java +++ /dev/null @@ -1,16 +0,0 @@ -package happy_java_01; - -public class Rectangle { - public static void main(String[] args) { - System.out.println("**********"); - System.out.println("**********"); - System.out.println("**********"); - System.out.println("**********"); - System.out.println("**********"); - System.out.println("**********"); - System.out.println("**********"); - System.out.println("**********"); - System.out.println("**********"); - System.out.println("**********"); - } -} diff --git a/hayoon/happy_java/src/happy_java_01/Rectangle2.java b/hayoon/happy_java/src/happy_java_01/Rectangle2.java deleted file mode 100644 index 2cabfac..0000000 --- a/hayoon/happy_java/src/happy_java_01/Rectangle2.java +++ /dev/null @@ -1,11 +0,0 @@ -package happy_java_01; - -public class Rectangle2 { - public static void main(String[] args) { - int i = 1; - while(i <= 10) { - System.out.println("**********"); - i = i + 1; - } - } -} diff --git a/hayoon/happy_java/src/happy_java_01/Rectangle_1000.java b/hayoon/happy_java/src/happy_java_01/Rectangle_1000.java deleted file mode 100644 index b59a804..0000000 --- a/hayoon/happy_java/src/happy_java_01/Rectangle_1000.java +++ /dev/null @@ -1,11 +0,0 @@ -package happy_java_01; - -public class Rectangle_1000 { - public static void main(String[] args) { - int i = 1; - while(i <= 1000) { - System.out.println("**********"); - i = i + 1; - } - } -} diff --git a/hayoon/happy_java/src/happy_java_01/StringExam1.java b/hayoon/happy_java/src/happy_java_01/StringExam1.java deleted file mode 100644 index 305ba5c..0000000 --- a/hayoon/happy_java/src/happy_java_01/StringExam1.java +++ /dev/null @@ -1,13 +0,0 @@ -package happy_java_01; - -public class StringExam1 { - public static void main(String[] args){ - String str1 = "hello" +1; - String str2 = "hello" + true; - String str3 = "hello" + 50.4; - - System.out.println(str1); - System.out.println(str2); - System.out.println(str3); - } -} diff --git a/hayoon/happy_java/src/happy_java_01/SwitchExam1.java b/hayoon/happy_java/src/happy_java_01/SwitchExam1.java deleted file mode 100644 index d71e205..0000000 --- a/hayoon/happy_java/src/happy_java_01/SwitchExam1.java +++ /dev/null @@ -1,20 +0,0 @@ -package happy_java_01; - -public class SwitchExam1 { - public static void main(String[] args) { - int num = 4; - switch (num) { - case 1 : - System.out.println("1입니다."); - break; - case 2 : - System.out.println("2입니다."); - break; - case 3 : - System.out.println("3입니다."); - break; - default: - System.out.println("1,2,3이 아닙니다."); - } - } -} diff --git a/hayoon/happy_java/src/happy_java_01/WhileExam1.java b/hayoon/happy_java/src/happy_java_01/WhileExam1.java deleted file mode 100644 index 7ffd4af..0000000 --- a/hayoon/happy_java/src/happy_java_01/WhileExam1.java +++ /dev/null @@ -1,11 +0,0 @@ -package happy_java_01; - -public class WhileExam1 { - public static void main(String[] args) { - int i = 1; - while (i <= 5) { - System.out.println(i); - i++; - } - } -} diff --git a/hayoon/happy_java/src/happy_java_01/WhileExam3.java b/hayoon/happy_java/src/happy_java_01/WhileExam3.java deleted file mode 100644 index 80d5638..0000000 --- a/hayoon/happy_java/src/happy_java_01/WhileExam3.java +++ /dev/null @@ -1,10 +0,0 @@ -package happy_java_01; - -public class WhileExam3 { - public static void main(String[] args) { - int i = 0; - while (i++ < 10){ - System.out.println(i); - } - } -} diff --git a/hayoon/happy_java/src/happy_java_02/MathBean.java b/hayoon/happy_java/src/happy_java_02/MathBean.java deleted file mode 100644 index 949aee8..0000000 --- a/hayoon/happy_java/src/happy_java_02/MathBean.java +++ /dev/null @@ -1,16 +0,0 @@ -package happy_java_02; - -public class MathBean { - public void printClassName(){ - System.out.println("MathBean"); - } - public void printNumber(int number){ - System.out.println(number); - } - public int getOne(){ - return 1; - } - public int plus(int x, int y){ - return x + y; - } -} diff --git a/hayoon/happy_java/src/happy_java_02/MathBeanTest.java b/hayoon/happy_java/src/happy_java_02/MathBeanTest.java deleted file mode 100644 index 59ac198..0000000 --- a/hayoon/happy_java/src/happy_java_02/MathBeanTest.java +++ /dev/null @@ -1,14 +0,0 @@ -package happy_java_02; - -public class MathBeanTest { - public static void main(String[] args){ - MathBean math = new MathBean(); // heap 메모리에 올라간다. - - math.printClassName(); - math.printNumber(5000); - int x = math.getOne(); - System.out.println(x); - int value = math.plus(200, 300); - System.out.println(value); - } -} diff --git a/hayoon/happy_java/src/happy_java_02/VendingMachine.java b/hayoon/happy_java/src/happy_java_02/VendingMachine.java deleted file mode 100644 index 32ef761..0000000 --- a/hayoon/happy_java/src/happy_java_02/VendingMachine.java +++ /dev/null @@ -1,15 +0,0 @@ -package happy_java_02; - -public class VendingMachine { - // field (가지는 것들) - // 생성자 - // method - public String pushProductButton(int menuId) { - System.out.println(menuId + "를 전달받았습니다."); - return "콜라"; - } - - public static void printVersion(){ - System.out.println("v1.0"); - } -} diff --git a/hayoon/happy_java/src/happy_java_02/VendingMachineMain.java b/hayoon/happy_java/src/happy_java_02/VendingMachineMain.java deleted file mode 100644 index f17d9c5..0000000 --- a/hayoon/happy_java/src/happy_java_02/VendingMachineMain.java +++ /dev/null @@ -1,15 +0,0 @@ -package happy_java_02; - -public class VendingMachineMain { - public static void main(String[] args){ - VendingMachine.printVersion(); - VendingMachine vm1 = new VendingMachine(); - VendingMachine vm2 = new VendingMachine(); - - String product = vm1.pushProductButton(100); -// vm1.printVersion(); //static한 메소드는 레퍼런스변수형.static메소드() - 사용지양 - System.out.println(product); - String product2 = vm2.pushProductButton(200); - System.out.println(product2); - } -} diff --git a/hayoon/happy_java/src/happy_java_03/Book.java b/hayoon/happy_java/src/happy_java_03/Book.java deleted file mode 100644 index c51b257..0000000 --- a/hayoon/happy_java/src/happy_java_03/Book.java +++ /dev/null @@ -1,24 +0,0 @@ -package happy_java_03; - -public class Book { - private String title; - private int price; // field price - - // 필드의 값을 수정하고 얻기 위한 메소드를 만든다. = setter, getter - // setter, getter - 프로퍼티(property) - price 프로퍼티 - public int getPrice(){ - return this.price * 2; // this는 내 자신 인스턴스를 참조하는 예약어. - } - - public void setPrice(int price){ // 지역변수 price - this.price = price; - } - - public String getName() { - return title; - } - - public void setName(String title){ - this.title = title; - } -} diff --git a/hayoon/happy_java/src/happy_java_03/BookExam01.java b/hayoon/happy_java/src/happy_java_03/BookExam01.java deleted file mode 100644 index bbcec15..0000000 --- a/hayoon/happy_java/src/happy_java_03/BookExam01.java +++ /dev/null @@ -1,13 +0,0 @@ -package happy_java_03; - -public class BookExam01 { - public static void main(String[] args){ - Book b1 = new Book(); -// b1.price = 100; // private 필드는 직접 접근하지 못함. -// System.out.println(b1.price); - b1.setName("김성박의 즐거운 자바"); - b1.setPrice(500); - System.out.println(b1.getPrice()); - System.out.println(b1.getName()); - } -} diff --git a/hayoon/happy_java/src/happy_java_03/Bus.java b/hayoon/happy_java/src/happy_java_03/Bus.java deleted file mode 100644 index bf28e84..0000000 --- a/hayoon/happy_java/src/happy_java_03/Bus.java +++ /dev/null @@ -1,11 +0,0 @@ -package happy_java_03; -// Bus는 자동차의 한 종류다. -public class Bus extends Car{ - public void run(){ - System.out.println("후륜구동으로 달린다."); - } - - public void 안내방송(){ - System.out.println("안내방송하다."); - } -} diff --git a/hayoon/happy_java/src/happy_java_03/Car.java b/hayoon/happy_java/src/happy_java_03/Car.java deleted file mode 100644 index 021a91f..0000000 --- a/hayoon/happy_java/src/happy_java_03/Car.java +++ /dev/null @@ -1,32 +0,0 @@ -package happy_java_03; - -public class Car { - private String name; // 필드는 가지는 것. - - // 생성자는 메소드와 비슷하다. - // return type이 없다. 클래스 이름과 같아야 한다. - // 매개변수가 0개인 생성자를 기본생성자라고 한다. - // 생성자가 하나도 없으면 아무일도 안하는 기본생성자가 자동으로 만들어진다. - public Car(){ - System.out.println("자동차가 한대 생성됩니다."); - } - - // 이름을 가지고 인스턴스가 만들어지게 하고 싶다. - public Car(String name){ - this.name = name; - } - - public void printName(){ - System.out.println("자동차 이름 : " + name); - } - - public void run(){ - System.out.println("전륜구동으로 달리다."); - } - - @Override - public String toString() { - return "자동차!!"; - } - -} diff --git a/hayoon/happy_java/src/happy_java_03/CarExam01.java b/hayoon/happy_java/src/happy_java_03/CarExam01.java deleted file mode 100644 index 3898f6b..0000000 --- a/hayoon/happy_java/src/happy_java_03/CarExam01.java +++ /dev/null @@ -1,18 +0,0 @@ -package happy_java_03; - -public class CarExam01 { - public static void main(String[] args){ - Bus b1 = new Bus(); - b1.run(); -// b1.안내방송(); - - Car c1 = new Bus(); // 버스는 자동차다. - c1.run(); // 그(c1)자동차는 달린다. -// c1.안내방송(); // Car에 있는 메소드만 사용 가능 - Bus b2 = (Bus)c1; - b2.안내방송(); - - Car c2 = new SuperCar(); - c2.run(); - } -} diff --git a/hayoon/happy_java/src/happy_java_03/CarExam02.java b/hayoon/happy_java/src/happy_java_03/CarExam02.java deleted file mode 100644 index bc936b9..0000000 --- a/hayoon/happy_java/src/happy_java_03/CarExam02.java +++ /dev/null @@ -1,21 +0,0 @@ -package happy_java_03; - -public class CarExam02 { - public static void main(String[] args){ - Car c1 = new Car(); - System.out.println(c1); // println(Object x) - Object로 참조할 수 있는 것은 무엇이든 받을 수 있다. - c1.printName(); - System.out.println("-----------------"); - Car c2 = new Car("hayun"); - c2.printName(); - } -} - -// 부모타입의 변수로 자식인스턴스를 참조할 수 있다. -// 조상타입의 변수로 후손인스턴스를 참조할 수 있다. -// Car c1 = new Bus(); -// Car c2 = new 이층버스(); // 이층버스는 Car의 자손이다. -// Object c1 = new Car(); -// Object c2 = new Bus(); -// Object c3 = new 이층버스(); -// System.out.println(o1.toString()); == System.out.println(o1); \ No newline at end of file diff --git a/hayoon/happy_java/src/happy_java_03/Child.java b/hayoon/happy_java/src/happy_java_03/Child.java deleted file mode 100644 index 4186b46..0000000 --- a/hayoon/happy_java/src/happy_java_03/Child.java +++ /dev/null @@ -1,8 +0,0 @@ -package happy_java_03; - -public class Child extends Parent{ - public int i = 15; // 필드에 대한 오버라이딩 - public void printI(){ // 메소드에 대한 오버라이딩 - System.out.println("child - printI() : " + i); - } -} diff --git a/hayoon/happy_java/src/happy_java_03/Exam01.java b/hayoon/happy_java/src/happy_java_03/Exam01.java deleted file mode 100644 index 6223651..0000000 --- a/hayoon/happy_java/src/happy_java_03/Exam01.java +++ /dev/null @@ -1,18 +0,0 @@ -package happy_java_03; - -public class Exam01 { - public static void main(String[] args){ - Parent p1 = new Parent(); - System.out.println(p1.i); // 필드 직접 접근하는 코드는 객체지향에서 좋지 않다. - p1.printI(); - System.out.println("--------------------"); - Child c1 = new Child(); - System.out.println(c1.i); - c1.printI(); - System.out.println("--------------------"); - Parent p2 = new Child(); //Child는 Parent의 후손이다. 혹은 자식이다. - System.out.println(p2.i); // 필드는 부모타입을 따라가서 5가 출력. - p2.printII(); - p2.printI(); // 메소드는 오버라이딩되면 자식께 실행된다. - } -} diff --git a/hayoon/happy_java/src/happy_java_03/Hello2.java b/hayoon/happy_java/src/happy_java_03/Hello2.java deleted file mode 100644 index 7ec99eb..0000000 --- a/hayoon/happy_java/src/happy_java_03/Hello2.java +++ /dev/null @@ -1,15 +0,0 @@ -package happy_java_03; - -public class Hello2 { - static int i; - static { - i = 500; - System.out.println("static block"); // 원래는 static field를 초기화한다. - } - public static void main(String[] args){ - System.out.println("Hello"); - } -} - -// javac Hello2.java 로 컴파일 -// java Hello2 라고 실행 -> JVM은 CLASSPATH에서 Hello2클래스를 찾음. \ No newline at end of file diff --git a/hayoon/happy_java/src/happy_java_03/Parent.java b/hayoon/happy_java/src/happy_java_03/Parent.java deleted file mode 100644 index aad3139..0000000 --- a/hayoon/happy_java/src/happy_java_03/Parent.java +++ /dev/null @@ -1,11 +0,0 @@ -package happy_java_03; - -public class Parent { - public int i = 5; - public void printII(){ - System.out.println(i * 2); // I는 10이라 예상 - } - public void printI(){ - System.out.println("parent - printI() : " + i); - } -} diff --git a/hayoon/happy_java/src/happy_java_03/Person.java b/hayoon/happy_java/src/happy_java_03/Person.java deleted file mode 100644 index 90a1e5b..0000000 --- a/hayoon/happy_java/src/happy_java_03/Person.java +++ /dev/null @@ -1,20 +0,0 @@ -package happy_java_03; - -public class Person { - String name; // 인스턴스 필드 (static 붙어 있지 않음) - String address; - boolean isVip; - static int count = 0; // 클래스 필드 - static{ // 클래스 필드는 static 블록에서 초기화할 수 있다. - count = 100; - } - - public void printName(){ // 인스턴스 메소드 - Person이라는 메소드가 있어야만 사용 가능 - System.out.println("내 이름은 " + name); - } - - public static void printCount(){ // 클래스 메소드 -// System.out.println(name); // static 한 메소드에서는 인스턴스 필드나, 인스턴스 메소드를 사용할 수 없다. - System.out.println("count : " + count); - } -} diff --git a/hayoon/happy_java/src/happy_java_03/PersonTest.java b/hayoon/happy_java/src/happy_java_03/PersonTest.java deleted file mode 100644 index 9d99772..0000000 --- a/hayoon/happy_java/src/happy_java_03/PersonTest.java +++ /dev/null @@ -1,24 +0,0 @@ -package happy_java_03; - -public class PersonTest { - public static void main(String[] args){ - Person p1 = new Person(); //p1은 null이다. - Person p2 = new Person(); - p1.name = "홍길동"; //문자열은 new를 사용하지 않고 인스턴스를 사용할 수 있다. 되도록 new를 사용하지 말자(String사용할 땐) - p2.name = "조조"; - p1.isVip = true; - p1.address = "일산"; - p2.address = "서울"; - - System.out.println(p1.name); - System.out.println(p1.name.length()); - System.out.println(p1.address); - System.out.println(p1.address.length()); - System.out.println(p1.isVip); - System.out.println("------------------------------"); - System.out.println(p2.name); - System.out.println(p2.name.length()); - System.out.println(p2.address); - System.out.println(p2.isVip); - } -} diff --git a/hayoon/happy_java/src/happy_java_03/PersonTest2.java b/hayoon/happy_java/src/happy_java_03/PersonTest2.java deleted file mode 100644 index 1737676..0000000 --- a/hayoon/happy_java/src/happy_java_03/PersonTest2.java +++ /dev/null @@ -1,25 +0,0 @@ -package happy_java_03; - -public class PersonTest2 { - public static void main(String[] args){ - Person p1 = new Person(); - Person p2 = new Person(); - p1.name = "홍길동"; - p2.name = "조조"; - - System.out.println(Person.count); - - System.out.println(p1.name); - System.out.println(p2.name); - System.out.println(p1.count); - System.out.println(p2.count); - p1.count++; - System.out.println(p1.count); - System.out.println(p2.count); - p2.count++; - System.out.println(p1.count); - System.out.println(p2.count); - - System.out.println(Person.count); - } -} diff --git a/hayoon/happy_java/src/happy_java_03/PersonTest3.java b/hayoon/happy_java/src/happy_java_03/PersonTest3.java deleted file mode 100644 index 2815e27..0000000 --- a/hayoon/happy_java/src/happy_java_03/PersonTest3.java +++ /dev/null @@ -1,14 +0,0 @@ -package happy_java_03; - -public class PersonTest3 { - public static void main(String[] args){ - System.out.println(Person.count); - Person.printCount(); - - Person p1 = new Person(); - p1.name = "홍길동"; - - System.out.println(p1.name); - p1.printName(); - } -} diff --git a/hayoon/happy_java/src/happy_java_03/StandardOutput.java b/hayoon/happy_java/src/happy_java_03/StandardOutput.java deleted file mode 100644 index dcb0e31..0000000 --- a/hayoon/happy_java/src/happy_java_03/StandardOutput.java +++ /dev/null @@ -1,28 +0,0 @@ -package happy_java_03; - -public class StandardOutput { - public void println(boolean b){ - System.out.println(b); - } - - public void println(int i){ - System.out.println(i); - } - - public void println(double d){ - System.out.println(d); - } - - public void println(String s){ - System.out.println(s); - } - - // java StandardOutput - public static void main(String[] args){ - StandardOutput output = new StandardOutput(); - output.println(100); - output.println("hello"); - output.println(10.5); - output.println(false); - } -} diff --git a/hayoon/happy_java/src/happy_java_03/SuperCar.java b/hayoon/happy_java/src/happy_java_03/SuperCar.java deleted file mode 100644 index 34ee0c0..0000000 --- a/hayoon/happy_java/src/happy_java_03/SuperCar.java +++ /dev/null @@ -1,10 +0,0 @@ -package happy_java_03; - -public class SuperCar extends Car{ - @Override - public void run() { - System.out.println("사륜구동으로 달린다."); - } - - // ...추가적인 메소드 -} diff --git a/hayoon/happy_java/src/happy_java_04/Bus2.java b/hayoon/happy_java/src/happy_java_04/Bus2.java deleted file mode 100644 index 8ad6dc5..0000000 --- a/hayoon/happy_java/src/happy_java_04/Bus2.java +++ /dev/null @@ -1,14 +0,0 @@ -package happy_java_04; - -public class Bus2 extends Car2{ - public Bus2(){ - super("Bus!!"); // 부모의 기본 생성자를 호출하는 코드가 자동으로 삽입된다. - System.out.println("Bus2기본생성자."); - } - - // 부모가 가지고 있는 추상메소드는 자식에서 반드시 구현을 해줘야 한다. - @Override - public void run() { - System.out.println("후륜구동으로 동작한다."); - } -} \ No newline at end of file diff --git a/hayoon/happy_java/src/happy_java_04/Car2.java b/hayoon/happy_java/src/happy_java_04/Car2.java deleted file mode 100644 index 94292f8..0000000 --- a/hayoon/happy_java/src/happy_java_04/Car2.java +++ /dev/null @@ -1,12 +0,0 @@ -package happy_java_04; - -public abstract class Car2 { - public Car2(String name){ - super(); // 자동으로 들어간다. - System.out.println("Car2() 생성자 호출"); - } - - // 추상메소드. (선언만 되어있는 메소드) Car2를 만든 사람은 run()이라는 메소드가 필요하다고 생각을 하였다. - // run()은 자동차마다 다르게 구현할 것 같아. - public abstract void run(); // 구현 부분없이 선언만 해줌. -} \ No newline at end of file diff --git a/hayoon/happy_java/src/happy_java_04/Car2Exam.java b/hayoon/happy_java/src/happy_java_04/Car2Exam.java deleted file mode 100644 index 60b82f0..0000000 --- a/hayoon/happy_java/src/happy_java_04/Car2Exam.java +++ /dev/null @@ -1,9 +0,0 @@ -package happy_java_04; - -public class Car2Exam { - public static void main(String[] args){ - Car2 c1 = new Car2("urstory"); - - Bus2 b1 = new Bus2(); - } -} \ No newline at end of file diff --git a/hayoon/happy_java/src/happy_java_04/Car2Exam02.java b/hayoon/happy_java/src/happy_java_04/Car2Exam02.java deleted file mode 100644 index 7b89a07..0000000 --- a/hayoon/happy_java/src/happy_java_04/Car2Exam02.java +++ /dev/null @@ -1,24 +0,0 @@ -package happy_java_04; - -public class Car2Exam02 { - public static void main(String[] args) { -// Car2 c = new Car2("urstory"); - - Bus2 b = new Bus2(); - b.run(); - - SportsCar s1 = new SportsCar("sportsCar!!"); - s1.run(); - - Car2 c = new SportsCar("sportsCar!!"); - c.run(); // 어떤 결과가 나올까요? -> Car2 c = [ ] []부분에 어떤 결과가 써있는지에 따라 run 메소드가 달라지게 된다. - // 실행해야만 결과를 알 수 있음 = 동적 언어(ex. java) - - Car2[] array = new Car2[2]; // Car2를 2개 참조할 수 있는 배열을 선언. - array[0] = new Bus2(); // 배열 1 : Bus 참조 - array[1] = new SportsCar("sportsCar!!"); // 배열 2 : SportsCar 참조 - for(Car2 c2 : array){ - c2.run(); - } - } -} \ No newline at end of file diff --git a/hayoon/happy_java/src/happy_java_04/SportsCar.java b/hayoon/happy_java/src/happy_java_04/SportsCar.java deleted file mode 100644 index e8bd53b..0000000 --- a/hayoon/happy_java/src/happy_java_04/SportsCar.java +++ /dev/null @@ -1,13 +0,0 @@ -package happy_java_04; - -public class SportsCar extends Car2{ - // 부모가 기본생성자가 없기 때문에 반드시 super()를 호출한다. - public SportsCar(String name) { - super(name); - } - - @Override - public void run() { // Car2 기본생성자 없기 때문에 생성자 만들어주고 부모생성자에 값 전달해야 함. - System.out.println("사륜구동으로 동작한다."); - } -} \ No newline at end of file diff --git a/hayoon/happy_java/src/happy_java_04/User.java b/hayoon/happy_java/src/happy_java_04/User.java deleted file mode 100644 index 8aa025e..0000000 --- a/hayoon/happy_java/src/happy_java_04/User.java +++ /dev/null @@ -1,39 +0,0 @@ -package happy_java_04; - -public class User { - private String email; - private String password; - private String name; - - // 생성자를 하나라도 만들게 되면 기본생성자가 자동으로 만들어지지 않는다. - public User(String name, String email) { // return만 해주는 객체 = 불변객체 - this(name, email, null); // super생성자를 제외하고는 this 생성자가 첫번째 줄에 있어야 함. - } - - // 생성자 오버로딩 - public User(String email, String password, String name) { - this.email = email; - this.password = password; - this.name = name; - } - - public String getEmail() { - return email; - } - - public String getPassword() { - return password; - } - - public String getName() { - return name; - } - - @Override - public String toString() { - return "User{" + - "email='" + email + '\'' + - ", name='" + name + '\'' + - '}'; - } -} \ No newline at end of file diff --git a/hayoon/happy_java/src/happy_java_04/UserExam.java b/hayoon/happy_java/src/happy_java_04/UserExam.java deleted file mode 100644 index 5142ff8..0000000 --- a/hayoon/happy_java/src/happy_java_04/UserExam.java +++ /dev/null @@ -1,17 +0,0 @@ -package happy_java_04; - -public class UserExam { - public static void main(String[] args){ - User user = new User("김성박", "urstory@gmail.com"); - -// System.out.println(user.getName()); -// System.out.println(user.getEmail()); - System.out.println(user); - - User user2 = new User("홍길동", "hong@example.com", "1234") - System.out.println(user2.getName()); - System.out.println(user2.getEmail()); - System.out.println(user2.getPassword()); - System.out.println(user2); - } -} diff --git a/hayoon/happy_java/src/happy_java_05/Array01.java b/hayoon/happy_java/src/happy_java_05/Array01.java deleted file mode 100644 index aa64531..0000000 --- a/hayoon/happy_java/src/happy_java_05/Array01.java +++ /dev/null @@ -1,17 +0,0 @@ -package happy_java_05; - -public class Array01 { - public static void main(String[] args) { - int[] array1; - int array2[]; - int array3[]; - - array1 = new int[5]; - array2 = new int[5]; - array3 = new int[0]; - - System.out.println(array1.length); - System.out.println(array2.length); - System.out.println(array3.length); - } -} \ No newline at end of file diff --git a/hayoon/happy_java/src/happy_java_05/Array03.java b/hayoon/happy_java/src/happy_java_05/Array03.java deleted file mode 100644 index 3f8ceea..0000000 --- a/hayoon/happy_java/src/happy_java_05/Array03.java +++ /dev/null @@ -1,28 +0,0 @@ -package happy_java_05; - -public class Array03 { - public static void main(String[] args) { - int[] array1 = new int[5]; // 배열 크기 정하기 - array1[0] = 1; // 입력받은 값 or 파일로부터 읽은 값 으로 초기화해줄 때 사용 - array1[1] = 2; - array1[2] = 3; - array1[3] = 4; - array1[4] = 5; - int[] array2 = new int[]{1,2,3,4,5}; // 배열 선언과 동시에 초기화 - int[] array3 = {1,2,3,4,5}; // 배열 선언과 동시에 초기화 - - System.out.println("array1 의 값 출력"); - for (int i = 0; i < 5; i++) { - System.out.println(array1[i]); - } - - System.out.println("array2 의 값 출력"); - for (int i = 0; i < 5; i++) { - System.out.println(array2[i]); - } - - System.out.println("array3 의 값 출력"); - for (int i = 0; i < 5; i++) { - System.out.println(array3[i]); - } - } \ No newline at end of file diff --git a/hayoon/happy_java/src/happy_java_05/Array04.java b/hayoon/happy_java/src/happy_java_05/Array04.java deleted file mode 100644 index 934e2f3..0000000 --- a/hayoon/happy_java/src/happy_java_05/Array04.java +++ /dev/null @@ -1,21 +0,0 @@ -package happy_java_05; - -public class Array04 { - public static void main(String[] args){ - ItemForArray[] array1; - ItemForArray array2[]; - - array1 = new ItemForArray[5]; - array2 = new ItemForArray[5]; - - array1[0] = new ItemForArray(500, "item01"); - array2[1] = new ItemForArray(1000, "item02"); - - ItemForArray i1 = new ItemForArray(500, "itemAAA"); - - System.out.println(array1[0].getName()); - System.out.println(i1.getName()); - - System.out.println(array1[2].getName()); - } -} \ No newline at end of file diff --git a/hayoon/happy_java/src/happy_java_05/Array07.java b/hayoon/happy_java/src/happy_java_05/Array07.java deleted file mode 100644 index 2062eb0..0000000 --- a/hayoon/happy_java/src/happy_java_05/Array07.java +++ /dev/null @@ -1,9 +0,0 @@ -package happy_java_05; - -public class Array07 { - public static void main(String[] args) { - double[] array2 = new double[0]; - System.out.println(array2.length); -// System.out.println(array2[0]); //ArrayIndecOutofException 발생 - } -} \ No newline at end of file diff --git a/hayoon/happy_java/src/happy_java_05/Array08.java b/hayoon/happy_java/src/happy_java_05/Array08.java deleted file mode 100644 index 4ac8a3e..0000000 --- a/hayoon/happy_java/src/happy_java_05/Array08.java +++ /dev/null @@ -1,21 +0,0 @@ -package happy_java_05; - -public class Array08 { - public static void main(String[] args) { - int[][] array = new int[2][3]; - array[0][0] = 0; - array[0][1] = 1; - array[0][2] = 2; - - array[1][0] = 3; - array[1][1] = 4; - array[1][2] = 5; - - for (int i = 0; i < array.length; i++){ - for (int j = 0; j < array[i].length; j++){ - System.out.print(array[i][j] + "\t"); - } - System.out.println(); - } - } -} \ No newline at end of file diff --git a/hayoon/happy_java/src/happy_java_05/Array12.java b/hayoon/happy_java/src/happy_java_05/Array12.java deleted file mode 100644 index 4d7813a..0000000 --- a/hayoon/happy_java/src/happy_java_05/Array12.java +++ /dev/null @@ -1,15 +0,0 @@ -package happy_java_05; - -public class Array12 { - public static void main(String[] args) { - int[] array = {1,2,3,4,5}; - -// for (int i = 0; i < array.length; i++){ // i : 0,1,2,3,4 -// System.out.println(array[i]); -// } - - for (int i :array){ // 줄여서 쓸 수 있다. - System.out.println(i); - } - } -} \ No newline at end of file diff --git a/hayoon/happy_java/src/happy_java_05/Array15.java b/hayoon/happy_java/src/happy_java_05/Array15.java deleted file mode 100644 index 6de5b0d..0000000 --- a/hayoon/happy_java/src/happy_java_05/Array15.java +++ /dev/null @@ -1,15 +0,0 @@ -package happy_java_05; -import java.util.Arrays; -// java.lang 패키지의 클래스는 import를 하지 않아도 사용가능 - -public class Array15 { - public static void main(String[] args) { - char[] copyFrom = {'h', 'e', 'l', 'l', 'o', '!'}; - - char[] copyTo = Arrays.copyOfRange(copyFrom, 1, 3); - - for (char c : copyTo){ - System.out.println(c); - } - } -} \ No newline at end of file diff --git a/hayoon/happy_java/src/happy_java_05/Array172.java b/hayoon/happy_java/src/happy_java_05/Array172.java deleted file mode 100644 index b532c31..0000000 --- a/hayoon/happy_java/src/happy_java_05/Array172.java +++ /dev/null @@ -1,64 +0,0 @@ -package happy_java_05; -import java.util.Arrays; - -public class Array172 { - public static void main(String[] args) { - Item[] items = new Item[5]; - items[0] = new Item("java", 5000); - items[1] = new Item("파이썬", 4000); - items[2] = new Item("C#", 4500); - items[3] = new Item("자바스크립트", 6000); - items[4] = new Item("Dart", 2000); - - // sort(Object[]) - Object는 모든 객체의 조상으로, 어떤 객체의 배열이든 올 수 있다. - Arrays.sort(items); - - for (Item item : items){ // for each 문 - System.out.println(item); - } - } -} - -// Comparable 은 어떤 Item이 큰지, 작은지 기준을 정하는 interface다. -class Item implements Comparable{ - private String name; - private int price; - - public Item(String name, int price) { // 생성자 만들기 - this.name = name; - this.price = price; - } - - // 파라미터로 들어온 Object와 내 자신을 비교하는 메소드 - // compareTo에는 Object를 받아들이도록 했지만 실제로는 Item이 들어온다. (자신과 같은 타입의 객체가 들어옴) - // 홍길동, 고길동 -> 유니코드로 비교 -> 홍길동이 더 큰 값. - @Override - public int compareTo(Object 0) { - Item d = (Item) o; - return this.name.compareTo(d.name); // 양수, 0, 음수 (문자열 가나다순) - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public int getPrice() { - return price; - } - - public void setPrice(int price) { - this.price = price; - } - - @Override - public String toString() { - return "Item{" + - "name='" + name +'\'' + - ", price=" + price + - '}'; - } -} \ No newline at end of file diff --git a/hayoon/happy_java/src/happy_java_05/EmptyCommandLineArgumentExam.java b/hayoon/happy_java/src/happy_java_05/EmptyCommandLineArgumentExam.java deleted file mode 100644 index 9e3a7aa..0000000 --- a/hayoon/happy_java/src/happy_java_05/EmptyCommandLineArgumentExam.java +++ /dev/null @@ -1,15 +0,0 @@ -package happy_java_05; - -public class EmptyCommandLineArgumentExam { - public static void main(String[] args) { - System.out.println(args.length); - } -} - -// String[] args = new String[0]; -// main(args); -> 0개짜리 String 배열이 넘어와서 실행됨. - -// java EmptyCommandLineArgumentExam.java -// java EmptyCommandLineArgumentExam a b c d hello -// (공백 기준으로 5개의 문자열 배열이 args에 들어옴) -// java -javaagent:어떤설정 EmptyCommandLineArgumentExam a b c \ No newline at end of file diff --git a/hayoon/happy_java/src/happy_java_05/GenericBox.java b/hayoon/happy_java/src/happy_java_05/GenericBox.java deleted file mode 100644 index e465d3f..0000000 --- a/hayoon/happy_java/src/happy_java_05/GenericBox.java +++ /dev/null @@ -1,13 +0,0 @@ -package happy_java_05; - -public class GenericBox { // 보통 type의 T 사용 - private T t; - - public void add(T obj) { - this.t = obj; - } - - public T get() { - return this.t; - } -} \ No newline at end of file diff --git a/hayoon/happy_java/src/happy_java_05/GenericBoxMain.java b/hayoon/happy_java/src/happy_java_05/GenericBoxMain.java deleted file mode 100644 index 913b3e6..0000000 --- a/hayoon/happy_java/src/happy_java_05/GenericBoxMain.java +++ /dev/null @@ -1,20 +0,0 @@ -package happy_java_05; - -public class GenericBoxMain { - public static void main(String[] args) { - GenericBox genericBox = new GenericBox<>(); - genericBox.add("kim"); - String str = genericBox.get(); - System.out.println(str.toUpperCase()); - - GenericBox intBox = new GenericBox<>(); - intBox.add(new Integer(5)); // 컴파일 오류가 발생한다. - Integer intValue = intBox.get(); - System.out.println(intValue); - - GenericBox objBox = new GenericBox<>(); - objBox.add("hello"); - String str2 = (String)objBox.get(); - System.out.println(str2); - } -} \ No newline at end of file diff --git a/hayoon/happy_java/src/happy_java_05/ListExam01.java b/hayoon/happy_java/src/happy_java_05/ListExam01.java deleted file mode 100644 index b713568..0000000 --- a/hayoon/happy_java/src/happy_java_05/ListExam01.java +++ /dev/null @@ -1,26 +0,0 @@ -package happy_java_05; -import java.util.ArrayList; - -public class ListExam01 { - public static void main(String[] args) { - // 자료구조객체들은 제네릭을 사용하지 않으면 - // Object 타입을 저장합니다. - ArrayList list = new ArrayList(); // 제네릭 사용하지 않고 ArrayList 사용 -// ArrayList list = new ArrayList<>(); // 제네릭 사용하고 ArrayList 사용 - list.add("kim"); - list.add("lee"); - list.add("hong"); - - String str1 = (String)list.get(0); // (String)타입으로 형변환 - 제네릭 X - String str2 = (String)list.get(1); - String str3 = (String)list.get(2); - -// String str1 = list.get(0); // 형변환 없이 사용 - 제네릭 O -// String str2 = list.get(1); -// String str3 = list.get(2); - - System.out.println(str1); - System.out.println(str2); - System.out.println(str3); - } -} \ No newline at end of file diff --git a/hayoon/happy_java/src/happy_java_05/ObjectBox.java b/hayoon/happy_java/src/happy_java_05/ObjectBox.java deleted file mode 100644 index 1da7054..0000000 --- a/hayoon/happy_java/src/happy_java_05/ObjectBox.java +++ /dev/null @@ -1,13 +0,0 @@ -package happy_java_05; - -public class ObjectBox { - private Object object; - - public void set(Object obj){ - this.object = obj; - } - - public Object get(){ - return this.object; - } -} \ No newline at end of file diff --git a/hayoon/happy_java/src/happy_java_05/ObjectBoxMain.java b/hayoon/happy_java/src/happy_java_05/ObjectBoxMain.java deleted file mode 100644 index 621d34f..0000000 --- a/hayoon/happy_java/src/happy_java_05/ObjectBoxMain.java +++ /dev/null @@ -1,14 +0,0 @@ -package happy_java_05; - -public class ObjectBoxMain { - public static void main(String[] args) { - ObjectBox box = new ObjectBox(); - box.set("kim"); - String str = (String)box.get(); - System.out.println(str.toUpperCase()); - - box.set(new Integer(5)); - Integer i = (Integer)box.get(); - System.out.println(i.intValue()); - } -} \ No newline at end of file diff --git a/hayrin/BOJ/BOJ/.gitignore b/hayrin/BOJ/BOJ/.gitignore deleted file mode 100644 index f68d109..0000000 --- a/hayrin/BOJ/BOJ/.gitignore +++ /dev/null @@ -1,29 +0,0 @@ -### IntelliJ IDEA ### -out/ -!**/src/main/**/out/ -!**/src/test/**/out/ - -### Eclipse ### -.apt_generated -.classpath -.factorypath -.project -.settings -.springBeans -.sts4-cache -bin/ -!**/src/main/**/bin/ -!**/src/test/**/bin/ - -### NetBeans ### -/nbproject/private/ -/nbbuild/ -/dist/ -/nbdist/ -/.nb-gradle/ - -### VS Code ### -.vscode/ - -### Mac OS ### -.DS_Store \ No newline at end of file diff --git a/hayrin/BOJ/BOJ/.idea/.gitignore b/hayrin/BOJ/BOJ/.idea/.gitignore deleted file mode 100644 index c3f502a..0000000 --- a/hayrin/BOJ/BOJ/.idea/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -# 디폴트 무시된 파일 -/shelf/ -/workspace.xml -# 에디터 기반 HTTP 클라이언트 요청 -/httpRequests/ -# Datasource local storage ignored files -/dataSources/ -/dataSources.local.xml diff --git a/hayrin/BOJ/BOJ/.idea/misc.xml b/hayrin/BOJ/BOJ/.idea/misc.xml deleted file mode 100644 index ef89d98..0000000 --- a/hayrin/BOJ/BOJ/.idea/misc.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/hayrin/BOJ/BOJ/.idea/modules.xml b/hayrin/BOJ/BOJ/.idea/modules.xml deleted file mode 100644 index b6c1bac..0000000 --- a/hayrin/BOJ/BOJ/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/hayrin/BOJ/BOJ/.idea/vcs.xml b/hayrin/BOJ/BOJ/.idea/vcs.xml deleted file mode 100644 index c2365ab..0000000 --- a/hayrin/BOJ/BOJ/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/hayrin/BOJ/BOJ/BOJ.iml b/hayrin/BOJ/BOJ/BOJ.iml deleted file mode 100644 index c90834f..0000000 --- a/hayrin/BOJ/BOJ/BOJ.iml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/hayrin/BOJ/BOJ/src/JAVA_1001/Main.java b/hayrin/BOJ/BOJ/src/JAVA_1001/Main.java deleted file mode 100644 index 079f0da..0000000 --- a/hayrin/BOJ/BOJ/src/JAVA_1001/Main.java +++ /dev/null @@ -1,14 +0,0 @@ -package JAVA_1001; - -import java.util.Scanner; - -public class Main{ - public static void main(String[] args){ - Scanner sc=new Scanner(System.in); - - int A = sc.nextInt(); - int B = sc.nextInt(); - - System.out.println(A-B); - } -} \ No newline at end of file diff --git a/hayrin/BOJ/BOJ/src/JAVA_1008/Main.java b/hayrin/BOJ/BOJ/src/JAVA_1008/Main.java deleted file mode 100644 index 7b5b101..0000000 --- a/hayrin/BOJ/BOJ/src/JAVA_1008/Main.java +++ /dev/null @@ -1,15 +0,0 @@ -package JAVA_1008; - -import java.util.Scanner; - -public class Main{ - public static void main(String[] arsg) { - - Scanner sc = new Scanner(System.in); - - Double A = sc.nextDouble(); - Double B = sc.nextDouble(); - - System.out.println(A/B); - } -} diff --git a/hayrin/BOJ/BOJ/src/JAVA_10172/Main.java b/hayrin/BOJ/BOJ/src/JAVA_10172/Main.java deleted file mode 100644 index c49e37e..0000000 --- a/hayrin/BOJ/BOJ/src/JAVA_10172/Main.java +++ /dev/null @@ -1,11 +0,0 @@ -package JAVA_10172; - -public class Main{ - public static void main(String[] args) { - System.out.println("|\\_/|"); - System.out.println("|q p| /}"); - System.out.println("( 0 )\"\"\"\\"); - System.out.println("|\"^\"` |"); - System.out.println("||_/=\\\\__|"); - } -} diff --git a/hayrin/BOJ/BOJ/src/JAVA_10403/Main.java b/hayrin/BOJ/BOJ/src/JAVA_10403/Main.java deleted file mode 100644 index 0f54e70..0000000 --- a/hayrin/BOJ/BOJ/src/JAVA_10403/Main.java +++ /dev/null @@ -1,19 +0,0 @@ -package JAVA_10403; - -import java.util.Scanner; - -public class Main { - public static void main(String[] args) { - Scanner in = new Scanner(System.in); - - int A = in.nextInt(); - int B = in.nextInt(); - int C = in.nextInt(); - in.close(); - - System.out.println((A+B)%C); - System.out.println(((A%C)+(B%C))%C); - System.out.println((A*B)%C); - System.out.println( ((A%C)*(B%C))%C); - } -} \ No newline at end of file diff --git a/hayrin/BOJ/BOJ/src/JAVA_10809/Main.java b/hayrin/BOJ/BOJ/src/JAVA_10809/Main.java deleted file mode 100644 index b380ede..0000000 --- a/hayrin/BOJ/BOJ/src/JAVA_10809/Main.java +++ /dev/null @@ -1,30 +0,0 @@ -package JAVA_10809; - -import java.util.Scanner; -import java.util.Arrays; - -public class Main { - public static void main(String[] args) { - Scanner sc = new Scanner(System.in); - - String str = sc.next(); - sc.close(); - - int arr[] = new int[26]; - Arrays.fill(arr, -1); - - for(int i=0;i n2) { - System.out.println(">"); - } - else { - System.out.println("<"); - } - - } -} \ No newline at end of file diff --git a/hayrin/BOJ/BOJ/src/JAVA_2438/Main.java b/hayrin/BOJ/BOJ/src/JAVA_2438/Main.java deleted file mode 100644 index 79e6921..0000000 --- a/hayrin/BOJ/BOJ/src/JAVA_2438/Main.java +++ /dev/null @@ -1,19 +0,0 @@ -package JAVA_2438; - -import java.util.Scanner; - -public class Main { - public static void main(String[] args) { - Scanner in = new Scanner(System.in); - - int N = in.nextInt(); - in.close(); - - for(int i=1; i<=N; i++) { - for(int j=1; j<=i; j++) { - System.out.println("*"); - } - System.out.println(); - } - } -} \ No newline at end of file diff --git a/hayrin/BOJ/BOJ/src/JAVA_2439/Main.java b/hayrin/BOJ/BOJ/src/JAVA_2439/Main.java deleted file mode 100644 index 16f6f8c..0000000 --- a/hayrin/BOJ/BOJ/src/JAVA_2439/Main.java +++ /dev/null @@ -1,22 +0,0 @@ -package JAVA_2439; - -import java.util.Scanner; - -public class Main { - public static void main(String[] args) { - Scanner in = new Scanner(System.in); - - int n = in.nextInt(); - in.close(); - - for (int i=1; i<=n; i++) { - for (int j=1; j<=n-i; j++) { - System.out.print(" "); - } - for (int k=0; k=90)? "A": (A>=80)? "B": (A>=70)?"C": (A>=60)?"D": "F"); - } -} diff --git a/hayrin/happy_java/happy_java/.gitignore b/hayrin/happy_java/happy_java/.gitignore deleted file mode 100644 index f68d109..0000000 --- a/hayrin/happy_java/happy_java/.gitignore +++ /dev/null @@ -1,29 +0,0 @@ -### IntelliJ IDEA ### -out/ -!**/src/main/**/out/ -!**/src/test/**/out/ - -### Eclipse ### -.apt_generated -.classpath -.factorypath -.project -.settings -.springBeans -.sts4-cache -bin/ -!**/src/main/**/bin/ -!**/src/test/**/bin/ - -### NetBeans ### -/nbproject/private/ -/nbbuild/ -/dist/ -/nbdist/ -/.nb-gradle/ - -### VS Code ### -.vscode/ - -### Mac OS ### -.DS_Store \ No newline at end of file diff --git a/hayrin/happy_java/happy_java/.idea/.gitignore b/hayrin/happy_java/happy_java/.idea/.gitignore deleted file mode 100644 index c3f502a..0000000 --- a/hayrin/happy_java/happy_java/.idea/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -# 디폴트 무시된 파일 -/shelf/ -/workspace.xml -# 에디터 기반 HTTP 클라이언트 요청 -/httpRequests/ -# Datasource local storage ignored files -/dataSources/ -/dataSources.local.xml diff --git a/hayrin/happy_java/happy_java/.idea/misc.xml b/hayrin/happy_java/happy_java/.idea/misc.xml deleted file mode 100644 index ef89d98..0000000 --- a/hayrin/happy_java/happy_java/.idea/misc.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/hayrin/happy_java/happy_java/.idea/modules.xml b/hayrin/happy_java/happy_java/.idea/modules.xml deleted file mode 100644 index b966e11..0000000 --- a/hayrin/happy_java/happy_java/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/hayrin/happy_java/happy_java/.idea/vcs.xml b/hayrin/happy_java/happy_java/.idea/vcs.xml deleted file mode 100644 index c2365ab..0000000 --- a/hayrin/happy_java/happy_java/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/hayrin/happy_java/happy_java/happy_java.iml b/hayrin/happy_java/happy_java/happy_java.iml deleted file mode 100644 index c90834f..0000000 --- a/hayrin/happy_java/happy_java/happy_java.iml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/hayrin/happy_java/happy_java/src/Bus.java b/hayrin/happy_java/happy_java/src/Bus.java deleted file mode 100644 index 1dff83a..0000000 --- a/hayrin/happy_java/happy_java/src/Bus.java +++ /dev/null @@ -1,13 +0,0 @@ -//Bus는 자동차의 한 종류 -public class Bus extends Car { - public void run(){ - System.out.println("후륜구동으로 달리다."); - - } - - - - public void 안내방송() { - System.out.println("안내방송"); - } -} diff --git a/hayrin/happy_java/happy_java/src/Car.java b/hayrin/happy_java/happy_java/src/Car.java deleted file mode 100644 index 3b60ffd..0000000 --- a/hayrin/happy_java/happy_java/src/Car.java +++ /dev/null @@ -1,25 +0,0 @@ -public class Car { - public String name; //필드 = 갖는 것 - - //생성자는 메소드와 비슷하다. - //return type이 없다. 클래스 이름과 같아야 한다. - //매개변수 0개인 생성자를 기본생성자라고 한다. - //생성자가 하나동 없으면 아무일도 안하는 기본 생성자가 자동으로 만들어진다. - - public Car() { - System.out.println("자동차가 한대 생성됩니다."); - } - //이름을 가지고 인스턴스가 만들어지게 하고싶다. - public Car(String name) { - this.name = name; - } - public void Run() { - - System.out.println("전륜구동으로 달리다."); - } - - @Override - public String toString() { - return "자동차!"; - } -} diff --git a/hayrin/happy_java/happy_java/src/CarExam01.java b/hayrin/happy_java/happy_java/src/CarExam01.java deleted file mode 100644 index c08bc2a..0000000 --- a/hayrin/happy_java/happy_java/src/CarExam01.java +++ /dev/null @@ -1,12 +0,0 @@ -public class CarExam01 { - public static void main(String[] args) { - Bus b1 = new Bus(); - b1.Run(); -// b1.안내방송(); - - Car c1 = new Bus(); //버스는 자동차다. - c1.Run(); //그(c1) 자동차는 달린다. - // c1.안내방송(); - - } -} diff --git a/hayrin/happy_java/happy_java/src/CarExam02.java b/hayrin/happy_java/happy_java/src/CarExam02.java deleted file mode 100644 index e79011b..0000000 --- a/hayrin/happy_java/happy_java/src/CarExam02.java +++ /dev/null @@ -1,16 +0,0 @@ -public class CarExam02 { - public static void main(String[] args) { - Car c1 = new Car(); - System.out.println(c1); //println(Object x) - object로 참조할 수 있는 것은 무엇이든 받을 수 있다. - } -} - -//부모타입의 변수로 자식인스턴스를 참조할 수 있다. -//조상타입의 변수로 후손인스턴스를 참조할 수 있다. -//Car c1 = new Bus(); -//Car c2 = new 이층버스(); //이층버스는 Car의 자손이다. -//Object o1 = new car(); -//Object o2 = new Bus(); -//Object o3 = new 이층버스(); -//System.out.println(o1.toString()) == System.out.prinln(o1); - diff --git a/hayrin/happy_java/happy_java/src/Child.java b/hayrin/happy_java/happy_java/src/Child.java deleted file mode 100644 index 0a785fb..0000000 --- a/hayrin/happy_java/happy_java/src/Child.java +++ /dev/null @@ -1,6 +0,0 @@ -public class Child extends Parent{ - public int i = 15; //필드에 대한 오버라이딩 - public void printI() { //메소드에 대한 오버라이딩 - System.out.println("child - printI() : " + i); - } -} diff --git a/hayrin/happy_java/happy_java/src/Exam01.java b/hayrin/happy_java/happy_java/src/Exam01.java deleted file mode 100644 index e84480f..0000000 --- a/hayrin/happy_java/happy_java/src/Exam01.java +++ /dev/null @@ -1,16 +0,0 @@ -public class Exam01 { - public static void main(String[] args) { - Parent p1 = new Parent(); - System.out.println(p1.i); - p1.printI(); - System.out.println("-----------------"); - Child c1 = new Child(); - System.out.println(c1.i); - c1.printI(); - System.out.println("-----------------"); - Parent p2 = new Child(); //Child는 Parent의 후손 혹은 자식이다. - System.out.println(p2.i); - p2.printI(); - p2.printII(); - } -} diff --git a/hayrin/happy_java/happy_java/src/Hello2.java b/hayrin/happy_java/happy_java/src/Hello2.java deleted file mode 100644 index 7c4cc97..0000000 --- a/hayrin/happy_java/happy_java/src/Hello2.java +++ /dev/null @@ -1,14 +0,0 @@ -public class Hello2 { - static int i; - static { - i = 500; - System.out.println("static block"); //원래는 static field를 초기화한다. - } - - public static void main(String[] args) { - System.out.println("Hello"); - } -} - -//javac Hello2.java -//java Hello2 \ No newline at end of file diff --git a/hayrin/happy_java/happy_java/src/Main.java b/hayrin/happy_java/happy_java/src/Main.java deleted file mode 100644 index 77516b8..0000000 --- a/hayrin/happy_java/happy_java/src/Main.java +++ /dev/null @@ -1,17 +0,0 @@ -// Shift을(를) 두 번 눌러 전체 검색 대화상자를 열고 'show whitespaces'를 입력한 다음, -// Enter를 누르세요. 그러면 코드 내에서 공백 문자를 확인할 수 있습니다. -public class Main { - public static void main(String[] args) { - // 캐럿을 강조 표시된 텍스트에 놓고 Alt+Enter을(를) 누르면 - // IntelliJ IDEA의 수정 제안을 볼 수 있습니다. - System.out.printf("Hello and welcome!"); - - // Shift+F10을(를) 누르거나 여백의 녹색 화살표 버튼을 클릭하여 코드를 실행합니다. - for (int i = 1; i <= 5; i++) { - - // Shift+F9을(를) 눌러 코드 디버그를 시작합니다. 중단점을 하나 설정해 드렸습니다. - // 중단점을 더 추가하려면 언제든지 Ctrl+F8을(를) 누르세요. - System.out.println("i = " + i); - } - } -} \ No newline at end of file diff --git a/hayrin/happy_java/happy_java/src/Parent.java b/hayrin/happy_java/happy_java/src/Parent.java deleted file mode 100644 index e23f6ce..0000000 --- a/hayrin/happy_java/happy_java/src/Parent.java +++ /dev/null @@ -1,10 +0,0 @@ -public class Parent { - public int i = 5; - public void printII() { - System.out.println(i * 2); - //p2.printII()메소드 실행 시 필드도 오버라이딩 되면 무조건 자식 것이 사용돼 30이 나와야 함. 하지만 10 출력됨 - } - public void printI() { - System.out.println("parent - printI() : " + i); - } -} diff --git a/hayrin/happy_java/happy_java/src/Person.java b/hayrin/happy_java/happy_java/src/Person.java deleted file mode 100644 index 994b381..0000000 --- a/hayrin/happy_java/happy_java/src/Person.java +++ /dev/null @@ -1,5 +0,0 @@ -public class Person { - public String name; - public String address; - public boolean isVip; -} diff --git a/hayrin/happy_java/happy_java/src/PersonTest.java b/hayrin/happy_java/happy_java/src/PersonTest.java deleted file mode 100644 index 6ab91a3..0000000 --- a/hayrin/happy_java/happy_java/src/PersonTest.java +++ /dev/null @@ -1,23 +0,0 @@ -public class PersonTest { - public static void main(String[] args) { - Person p1 = new Person(); - Person p2 = new Person(); - p1.name = "홍길동"; //문자열은 new를 사용하지 않고 인스턴스를 사용할 수 있다. 되도록 new를 사용하지 말자(String 사용할 때) - p1.address = "일산"; - p1.isVip = true; - p2.name = "조조"; - p2.address = "서울"; - - System.out.println(p1.name); - System.out.println(p1.name.length()); - System.out.println(p1.address); - System.out.println(p1.address.length()); - System.out.println(p1.isVip); - System.out.println("----------------------------------------------"); - System.out.println(p2.name); - System.out.println(p2.name.length()); - System.out.println(p2.address); - System.out.println(p2.address.length()); - } -} - diff --git a/hayrin/happy_java/happy_java/src/StandardOutput.java b/hayrin/happy_java/happy_java/src/StandardOutput.java deleted file mode 100644 index 9f07955..0000000 --- a/hayrin/happy_java/happy_java/src/StandardOutput.java +++ /dev/null @@ -1,27 +0,0 @@ -public class StandardOutput { - public void println(boolean b) { - System.out.println(b); - } - - public void println(int i){ - System.out.println(i); - } - - public void println(double d) { - System.out.println(d); - } - - public void println(String s) { - System.out.println(s); - } - - //java StandardOutput - public static void main(String[] args){ - StandardOutput output = new StandardOutput(); - output.println(100); - output.println("hello"); - output.println(10.5); - output.println(false); - } -} - diff --git a/hayrin/happy_java/happy_java/src/VendingMachine.java b/hayrin/happy_java/happy_java/src/VendingMachine.java deleted file mode 100644 index 94c1b4d..0000000 --- a/hayrin/happy_java/happy_java/src/VendingMachine.java +++ /dev/null @@ -1,13 +0,0 @@ -public class VendingMachine { -// public static void main(String[] args) { -// VendingMachine.printVersion(); -// VendingMachine vm1 = new VendingMachine(); -// VendingMachine vm2 = new VendingMachine(); -// -// String product = vm1.pushProductButton(menuId: 100); -// // vm1.printVersion(); //static한 메소드는 레퍼런스변수명.static메소드() -// System.out.println(product); -// String product = vm2.pushProductButton(menuId: 100); -// System.out.println(product2); -// } -} diff --git a/junyeong/BOJ/.gitignore b/junyeong/BOJ/.gitignore deleted file mode 100644 index f68d109..0000000 --- a/junyeong/BOJ/.gitignore +++ /dev/null @@ -1,29 +0,0 @@ -### IntelliJ IDEA ### -out/ -!**/src/main/**/out/ -!**/src/test/**/out/ - -### Eclipse ### -.apt_generated -.classpath -.factorypath -.project -.settings -.springBeans -.sts4-cache -bin/ -!**/src/main/**/bin/ -!**/src/test/**/bin/ - -### NetBeans ### -/nbproject/private/ -/nbbuild/ -/dist/ -/nbdist/ -/.nb-gradle/ - -### VS Code ### -.vscode/ - -### Mac OS ### -.DS_Store \ No newline at end of file diff --git a/junyeong/BOJ/.idea/.gitignore b/junyeong/BOJ/.idea/.gitignore deleted file mode 100644 index 13566b8..0000000 --- a/junyeong/BOJ/.idea/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml -# Editor-based HTTP Client requests -/httpRequests/ -# Datasource local storage ignored files -/dataSources/ -/dataSources.local.xml diff --git a/junyeong/BOJ/.idea/misc.xml b/junyeong/BOJ/.idea/misc.xml deleted file mode 100644 index 07115cd..0000000 --- a/junyeong/BOJ/.idea/misc.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/junyeong/BOJ/.idea/vcs.xml b/junyeong/BOJ/.idea/vcs.xml deleted file mode 100644 index b2bdec2..0000000 --- a/junyeong/BOJ/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/junyeong/BOJ/src/java_10172/Main.java b/junyeong/BOJ/src/java_10172/Main.java deleted file mode 100644 index 4f6a983..0000000 --- a/junyeong/BOJ/src/java_10172/Main.java +++ /dev/null @@ -1,10 +0,0 @@ -package java_10172; -public class Main { - public static void main(String[] args) { - System.out.println("|\\_/|"); - System.out.println("|q p| /}"); - System.out.println("( 0 )\"\"\"\\"); - System.out.println("|\"^\"` |"); - System.out.println("||_/=\\\\__|"); - } -} \ No newline at end of file diff --git a/junyeong/BOJ/src/java_10807/Main.java b/junyeong/BOJ/src/java_10807/Main.java deleted file mode 100644 index 500d3a7..0000000 --- a/junyeong/BOJ/src/java_10807/Main.java +++ /dev/null @@ -1,25 +0,0 @@ -package java_10807; -import java.util.Scanner; - -public class Main { - public static void main(String[]args){ - - Scanner input = new Scanner(System.in); - int a = input.nextInt(); - int [] n = new int[a]; - for(int i=0;i() { - @Override - public int compare(String s1, String s2) { - if(s1.length() == s2.length()) { - return s1.compareTo(s2); - } else { - return s1.length() - s2.length(); - } - } - }); - - System.out.println(arr[0]); - for (int i = 1; i < N; i++) { - if (arr[i].equals(arr[i-1])) continue; - System.out.println(arr[i]); - } - } -} \ No newline at end of file diff --git a/junyeong/BOJ/src/java_2523/Main.java b/junyeong/BOJ/src/java_2523/Main.java deleted file mode 100644 index e98636c..0000000 --- a/junyeong/BOJ/src/java_2523/Main.java +++ /dev/null @@ -1,26 +0,0 @@ -package java_2523; - -import java.util.Scanner; - -public class Main { - - public static void main(String[] args) { - Scanner input = new Scanner(System.in); - - int n = input.nextInt(); - - for (int i = 1; i<=n;i++){ - for (int j = 0; j0;i--){ - for (int j = 0;j '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac -done - -# This is normally unused -# shellcheck disable=SC2034 -APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum - -warn () { - echo "$*" -} >&2 - -die () { - echo - echo "$*" - echo - exit 1 -} >&2 - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -nonstop=false -case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; -esac - -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar - - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD=java - if ! command -v java >/dev/null 2>&1 - then - die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -fi - -# Increase the maximum file descriptors if we can. -if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac -fi - -# Collect all arguments for the java command, stacking in reverse order: -# * args from the command line -# * the main class name -# * -classpath -# * -D...appname settings -# * --module-path (only if needed) -# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. - -# For Cygwin or MSYS, switch paths to Windows format before running java -if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - - JAVACMD=$( cygpath --unix "$JAVACMD" ) - - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done -fi - - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' - -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. - -set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" - -# Stop when "xargs" is not available. -if ! command -v xargs >/dev/null 2>&1 -then - die "xargs is not available" -fi - -# Use "xargs" to parse quoted args. -# -# With -n1 it outputs one arg per line, with the quotes and backslashes removed. -# -# In Bash we could simply go: -# -# readarray ARGS < <( xargs -n1 <<<"$var" ) && -# set -- "${ARGS[@]}" "$@" -# -# but POSIX shell has neither arrays nor command substitution, so instead we -# post-process each arg (as a line of input to sed) to backslash-escape any -# character that might be a shell metacharacter, then use eval to reverse -# that process (while maintaining the separation between arguments), and wrap -# the whole thing up as a single "set" statement. -# -# This will of course break if any of these variables contains a newline or -# an unmatched quote. -# - -eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' - -exec "$JAVACMD" "$@" diff --git a/junyeong/hello-spring/gradlew.bat b/junyeong/hello-spring/gradlew.bat deleted file mode 100644 index 93e3f59..0000000 --- a/junyeong/hello-spring/gradlew.bat +++ /dev/null @@ -1,92 +0,0 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem - -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* - -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/junyeong/hello-spring/settings.gradle b/junyeong/hello-spring/settings.gradle deleted file mode 100644 index 69a39da..0000000 --- a/junyeong/hello-spring/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -rootProject.name = 'hello-spring' diff --git a/junyeong/hello-spring/src/main/java/hello/hellospring/AOP/TimeTraceAop.java b/junyeong/hello-spring/src/main/java/hello/hellospring/AOP/TimeTraceAop.java deleted file mode 100644 index fa47634..0000000 --- a/junyeong/hello-spring/src/main/java/hello/hellospring/AOP/TimeTraceAop.java +++ /dev/null @@ -1,24 +0,0 @@ -package hello.hellospring.AOP; - -import org.aspectj.lang.ProceedingJoinPoint; -import org.aspectj.lang.annotation.Around; -import org.aspectj.lang.annotation.Aspect; -import org.springframework.stereotype.Component; - -@Aspect -@Component -public class TimeTraceAop { - - @Around("execution(* hello.hellospring..*(..))") - public Object execute(ProceedingJoinPoint joinPoint) throws Throwable{ - long start = System.currentTimeMillis(); - System.out.println("START: " + joinPoint.toString()); - try{ - return joinPoint.proceed(); - }finally { - long finish = System.currentTimeMillis(); - long timeMs = finish - start; - System.out.println("START: " + joinPoint.toString() + " " + timeMs + "ms"); - } - } -} diff --git a/junyeong/hello-spring/src/main/java/hello/hellospring/HelloSpringApplication.java b/junyeong/hello-spring/src/main/java/hello/hellospring/HelloSpringApplication.java deleted file mode 100644 index 8b59cc3..0000000 --- a/junyeong/hello-spring/src/main/java/hello/hellospring/HelloSpringApplication.java +++ /dev/null @@ -1,14 +0,0 @@ -package hello.hellospring; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; - -@SpringBootApplication -public class HelloSpringApplication { - - public static void main(String[] args) { - - SpringApplication.run(HelloSpringApplication.class, args); - } - -} diff --git a/junyeong/hello-spring/src/main/java/hello/hellospring/SpringConfig.java b/junyeong/hello-spring/src/main/java/hello/hellospring/SpringConfig.java deleted file mode 100644 index c49f058..0000000 --- a/junyeong/hello-spring/src/main/java/hello/hellospring/SpringConfig.java +++ /dev/null @@ -1,18 +0,0 @@ -package hello.hellospring; - -import hello.hellospring.repository.MemberRepository; -import hello.hellospring.repository.MemoryMemberRepository; -import hello.hellospring.service.MemberService; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -@Configuration -public class SpringConfig { - @Bean - public MemberService memberService() { - return new MemberService(memberRepository()); - } - @Bean - public MemberRepository memberRepository() { - return new MemoryMemberRepository(); - } -} diff --git a/junyeong/hello-spring/src/main/java/hello/hellospring/controller/HelloController.java b/junyeong/hello-spring/src/main/java/hello/hellospring/controller/HelloController.java deleted file mode 100644 index a6d0753..0000000 --- a/junyeong/hello-spring/src/main/java/hello/hellospring/controller/HelloController.java +++ /dev/null @@ -1,53 +0,0 @@ -package hello.hellospring.controller; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; - -@Controller -public class HelloController { - - @GetMapping("hello") - public String hello(Model model){ - model.addAttribute("data","hello!!"); - return "hello"; - - } - - @GetMapping("hello-mvc") - public String helloMvc(@RequestParam("name")String name,Model model){ - model.addAttribute("name",name); - return "hello-template"; - } - - @GetMapping("hello-string") - @ResponseBody - public String helloString(@RequestParam("name") String name){ - return "hello " + name; - } - - @GetMapping("hello-api") - @ResponseBody - public Hello helloApi(@RequestParam("name")String name){ - Hello hello = new Hello(); - hello.setName(name); - return hello; - - } - - static class Hello{ - private String name; - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - } - -} diff --git a/junyeong/hello-spring/src/main/java/hello/hellospring/controller/MemberController.java b/junyeong/hello-spring/src/main/java/hello/hellospring/controller/MemberController.java deleted file mode 100644 index 8a66337..0000000 --- a/junyeong/hello-spring/src/main/java/hello/hellospring/controller/MemberController.java +++ /dev/null @@ -1,16 +0,0 @@ -package hello.hellospring.controller; - -import hello.hellospring.domain.Member; -import hello.hellospring.service.MemberService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; - -@Controller -public class MemberController { - private final MemberService memberService; - - @Autowired - public MemberController(MemberService memberService) { - this.memberService = memberService; - } -} diff --git a/junyeong/hello-spring/src/main/java/hello/hellospring/domain/Member.java b/junyeong/hello-spring/src/main/java/hello/hellospring/domain/Member.java deleted file mode 100644 index 3a5822d..0000000 --- a/junyeong/hello-spring/src/main/java/hello/hellospring/domain/Member.java +++ /dev/null @@ -1,22 +0,0 @@ -package hello.hellospring.domain; - -public class Member { - private Long id; - private String name; - - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } -} diff --git a/junyeong/hello-spring/src/main/java/hello/hellospring/repository/JdbcMemberRepository.java b/junyeong/hello-spring/src/main/java/hello/hellospring/repository/JdbcMemberRepository.java deleted file mode 100644 index 5723959..0000000 --- a/junyeong/hello-spring/src/main/java/hello/hellospring/repository/JdbcMemberRepository.java +++ /dev/null @@ -1,142 +0,0 @@ -package hello.hellospring.repository; -import hello.hellospring.domain.Member; -import org.springframework.jdbc.datasource.DataSourceUtils; -import javax.sql.DataSource; -import java.sql.*; -import java.util.ArrayList; -import java.util.List; -import java.util.Optional; -public class JdbcMemberRepository implements MemberRepository { - private final DataSource dataSource; - public JdbcMemberRepository(DataSource dataSource) { - this.dataSource = dataSource; - } - @Override - public Member save(Member member) { - String sql = "insert into member(name) values(?)"; - Connection conn = null; - PreparedStatement pstmt = null; - ResultSet rs = null; - try { - conn = getConnection(); - pstmt = conn.prepareStatement(sql, - Statement.RETURN_GENERATED_KEYS); - pstmt.setString(1, member.getName()); - pstmt.executeUpdate(); - rs = pstmt.getGeneratedKeys(); - if (rs.next()) { - member.setId(rs.getLong(1)); - } else { - throw new SQLException("id 조회 실패"); - } - return member; - } catch (Exception e) { - throw new IllegalStateException(e); - } finally { - close(conn, pstmt, rs); - } - } - @Override - public Optional findById(Long id) { - String sql = "select * from member where id = ?"; - Connection conn = null; - PreparedStatement pstmt = null; - ResultSet rs = null; - try { - conn = getConnection(); - pstmt = conn.prepareStatement(sql); - pstmt.setLong(1, id); - rs = pstmt.executeQuery(); - if(rs.next()) { - Member member = new Member(); - member.setId(rs.getLong("id")); - member.setName(rs.getString("name")); - return Optional.of(member); - } else { - return Optional.empty(); - } - } catch (Exception e) { - throw new IllegalStateException(e); - } finally { - close(conn, pstmt, rs); - } - } - @Override - public List findAll() { - String sql = "select * from member"; - Connection conn = null; - PreparedStatement pstmt = null; - ResultSet rs = null; - try { - conn = getConnection(); - pstmt = conn.prepareStatement(sql); - rs = pstmt.executeQuery(); - List members = new ArrayList<>(); - while(rs.next()) { - Member member = new Member(); - member.setId(rs.getLong("id")); - member.setName(rs.getString("name")); - members.add(member); - } - return members; - } catch (Exception e) { - throw new IllegalStateException(e); - } finally { - close(conn, pstmt, rs); - } - } - @Override - public Optional findByName(String name) { - String sql = "select * from member where name = ?"; - Connection conn = null; - PreparedStatement pstmt = null; - ResultSet rs = null; - try { - conn = getConnection(); - pstmt = conn.prepareStatement(sql); - pstmt.setString(1, name); - rs = pstmt.executeQuery(); - if(rs.next()) { - Member member = new Member(); - member.setId(rs.getLong("id")); - member.setName(rs.getString("name")); - return Optional.of(member); - } - return Optional.empty(); - } catch (Exception e) { - throw new IllegalStateException(e); - } finally { - close(conn, pstmt, rs); - } - } - private Connection getConnection() { - return DataSourceUtils.getConnection(dataSource); - } - private void close(Connection conn, PreparedStatement pstmt, ResultSet rs) - { - try { - if (rs != null) { - rs.close(); - } - } catch (SQLException e) { - e.printStackTrace(); - } - try { - if (pstmt != null) { - pstmt.close(); - } - } catch (SQLException e) { - e.printStackTrace(); - } - try { - if (conn != null) { - close(conn); - } - } catch (SQLException e) { - e.printStackTrace(); - } - } - private void close(Connection conn) throws SQLException { - DataSourceUtils.releaseConnection(conn, dataSource); - } -} \ No newline at end of file diff --git a/junyeong/hello-spring/src/main/java/hello/hellospring/repository/JdbcTemplateMemberRepository.java b/junyeong/hello-spring/src/main/java/hello/hellospring/repository/JdbcTemplateMemberRepository.java deleted file mode 100644 index eaeb96c..0000000 --- a/junyeong/hello-spring/src/main/java/hello/hellospring/repository/JdbcTemplateMemberRepository.java +++ /dev/null @@ -1,52 +0,0 @@ -package hello.hellospring.repository; -import hello.hellospring.domain.Member; -import org.springframework.jdbc.core.JdbcTemplate; -import org.springframework.jdbc.core.RowMapper; -import org.springframework.jdbc.core.namedparam.MapSqlParameterSource; -import org.springframework.jdbc.core.simple.SimpleJdbcInsert; -import javax.sql.DataSource; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Optional; -public class JdbcTemplateMemberRepository implements MemberRepository { - private final JdbcTemplate jdbcTemplate; - public JdbcTemplateMemberRepository(DataSource dataSource) { - jdbcTemplate = new JdbcTemplate(dataSource); - } - @Override - public Member save(Member member) { - SimpleJdbcInsert jdbcInsert = new SimpleJdbcInsert(jdbcTemplate); - jdbcInsert.withTableName("member").usingGeneratedKeyColumns("id"); - Map parameters = new HashMap<>(); - parameters.put("name", member.getName()); - Number key = jdbcInsert.executeAndReturnKey(new - MapSqlParameterSource(parameters)); - member.setId(key.longValue()); - return member; - } - @Override - public Optional findById(Long id) { - List result = jdbcTemplate.query("select * from member where id = ?", memberRowMapper(), id); - return result.stream().findAny(); - } - @Override - public List findAll() { - return jdbcTemplate.query("select * from member", memberRowMapper()); - } - @Override - public Optional findByName(String name) { - List result = jdbcTemplate.query("select * from member where name = ?", memberRowMapper(), name); - return result.stream().findAny(); - } - private RowMapper memberRowMapper() { - return (rs, rowNum) -> { - Member member = new Member(); - member.setId(rs.getLong("id")); - member.setName(rs.getString("name")); - return member; - }; - } -} \ No newline at end of file diff --git a/junyeong/hello-spring/src/main/java/hello/hellospring/repository/JpaMemberRepository.java b/junyeong/hello-spring/src/main/java/hello/hellospring/repository/JpaMemberRepository.java deleted file mode 100644 index 3d97919..0000000 --- a/junyeong/hello-spring/src/main/java/hello/hellospring/repository/JpaMemberRepository.java +++ /dev/null @@ -1,29 +0,0 @@ -package hello.hellospring.repository; -import hello.hellospring.domain.Member; -import javax.persistence.EntityManager; -import java.util.List; -import java.util.Optional; -public class JpaMemberRepository implements MemberRepository { - private final EntityManager em; - public JpaMemberRepository(EntityManager em) { - this.em = em; - } - public Member save(Member member) { - em.persist(member); - return member; - } - public Optional findById(Long id) { - Member member = em.find(Member.class, id); - return Optional.ofNullable(member); - } - public List findAll() { - return em.createQuery("select m from Member m", Member.class) - .getResultList(); - } - public Optional findByName(String name) { - List result = em.createQuery("select m from Member m where m.name = :name", Member.class) - .setParameter("name", name) - .getResultList(); - return result.stream().findAny(); - } -} \ No newline at end of file diff --git a/junyeong/hello-spring/src/main/java/hello/hellospring/repository/MemberRepository.java b/junyeong/hello-spring/src/main/java/hello/hellospring/repository/MemberRepository.java deleted file mode 100644 index 0609161..0000000 --- a/junyeong/hello-spring/src/main/java/hello/hellospring/repository/MemberRepository.java +++ /dev/null @@ -1,13 +0,0 @@ -package hello.hellospring.repository; - -import hello.hellospring.domain.Member; - -import java.util.Optional; -import java.util.List; - -public interface MemberRepository { - Member save(Member member); - Optional findById(Long id); - Optional findByName(String name); - List findAll(); -} diff --git a/junyeong/hello-spring/src/main/java/hello/hellospring/repository/MemoryMemberRepository.java b/junyeong/hello-spring/src/main/java/hello/hellospring/repository/MemoryMemberRepository.java deleted file mode 100644 index 9fb2e21..0000000 --- a/junyeong/hello-spring/src/main/java/hello/hellospring/repository/MemoryMemberRepository.java +++ /dev/null @@ -1,37 +0,0 @@ -package hello.hellospring.repository; - -import hello.hellospring.domain.Member; - -import java.util.*; - -public class MemoryMemberRepository implements MemberRepository{ - - private static Map store = new HashMap<>(); - private static long sequence = 0L; - @Override - public Member save(Member member) { - member.setId(++sequence); - store.put(member.getId(),member); - return member; - } - - @Override - public Optional findById(Long id) { - return Optional.ofNullable(store.get(id)); - } - - @Override - public Optional findByName(String name) { - return store.values().stream() - .filter(member -> member.getName().equals(name)) - .findAny(); - } - - @Override - public List findAll() { - return new ArrayList<>(store.values()); - } - public void clearStore(){ - store.clear(); - } -} diff --git a/junyeong/hello-spring/src/main/java/hello/hellospring/repository/SpringDataJpaMemberRepository.java b/junyeong/hello-spring/src/main/java/hello/hellospring/repository/SpringDataJpaMemberRepository.java deleted file mode 100644 index 00d9682..0000000 --- a/junyeong/hello-spring/src/main/java/hello/hellospring/repository/SpringDataJpaMemberRepository.java +++ /dev/null @@ -1,13 +0,0 @@ -package hello.hellospring.repository; - -import hello.hellospring.domain.Member; -import org.springframework.data.jpa.repository.JpaRepository; - -import java.util.Optional; - -public interface SpringDataJpaMemberRepository extends JpaRepository, MemberRepository { - - //JPQL select m from Member m where m.name = ? - @Override - Optional findByName(String name); -} diff --git a/junyeong/hello-spring/src/main/java/hello/hellospring/service/MemberService.java b/junyeong/hello-spring/src/main/java/hello/hellospring/service/MemberService.java deleted file mode 100644 index 5ce0d08..0000000 --- a/junyeong/hello-spring/src/main/java/hello/hellospring/service/MemberService.java +++ /dev/null @@ -1,31 +0,0 @@ -package hello.hellospring.service; - -import hello.hellospring.domain.Member; -import hello.hellospring.repository.MemberRepository; -import hello.hellospring.repository.MemoryMemberRepository; - -import java.util.List; -import java.util.Optional; - -public class MemberService { - - private final MemberRepository memberRepository = new MemoryMemberRepository(); - - public Long join(Member member) { - validateDuplicateMember(member); //중복 회원 검증 - memberRepository.save(member); - return member.getId(); - } - private void validateDuplicateMember(Member member) { - memberRepository.findByName(member.getName()) - .ifPresent(m -> { - throw new IllegalStateException("이미 존재하는 회원입니다."); - }); - } - public List findMembers() { - return memberRepository.findAll(); - } - public Optional findOne(Long memberId) { - return memberRepository.findById(memberId); - } -} diff --git a/junyeong/hello-spring/src/main/resources/application.properties b/junyeong/hello-spring/src/main/resources/application.properties deleted file mode 100644 index 8b13789..0000000 --- a/junyeong/hello-spring/src/main/resources/application.properties +++ /dev/null @@ -1 +0,0 @@ - diff --git a/junyeong/hello-spring/src/main/resources/static/hello-static.html b/junyeong/hello-spring/src/main/resources/static/hello-static.html deleted file mode 100644 index 1e615f1..0000000 --- a/junyeong/hello-spring/src/main/resources/static/hello-static.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - static content - - -정적 콘텐츠 입니다. - - - \ No newline at end of file diff --git a/junyeong/hello-spring/src/main/resources/static/index.html b/junyeong/hello-spring/src/main/resources/static/index.html deleted file mode 100644 index 1a127d9..0000000 --- a/junyeong/hello-spring/src/main/resources/static/index.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - Hello - - - -Hello -hello - - \ No newline at end of file diff --git a/junyeong/hello-spring/src/main/resources/templates/hello-template.html b/junyeong/hello-spring/src/main/resources/templates/hello-template.html deleted file mode 100644 index c253599..0000000 --- a/junyeong/hello-spring/src/main/resources/templates/hello-template.html +++ /dev/null @@ -1,4 +0,0 @@ - - -

hello! empty

- \ No newline at end of file diff --git a/junyeong/hello-spring/src/main/resources/templates/hello.html b/junyeong/hello-spring/src/main/resources/templates/hello.html deleted file mode 100644 index 9687404..0000000 --- a/junyeong/hello-spring/src/main/resources/templates/hello.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - Hello - - - - -

안녕하세요. 손님

- - - \ No newline at end of file diff --git a/junyeong/hello-spring/src/test/java/hello/hellospring/HelloSpringApplicationTests.java b/junyeong/hello-spring/src/test/java/hello/hellospring/HelloSpringApplicationTests.java deleted file mode 100644 index 87d37cf..0000000 --- a/junyeong/hello-spring/src/test/java/hello/hellospring/HelloSpringApplicationTests.java +++ /dev/null @@ -1,13 +0,0 @@ -package hello.hellospring; - -import org.junit.jupiter.api.Test; -import org.springframework.boot.test.context.SpringBootTest; - -@SpringBootTest -class HelloSpringApplicationTests { - - @Test - void contextLoads() { - } - -} diff --git a/junyeong/hello-spring/src/test/java/hello/hellospring/repository/MemoryMemberRepositoryTest.java b/junyeong/hello-spring/src/test/java/hello/hellospring/repository/MemoryMemberRepositoryTest.java deleted file mode 100644 index 2ac7846..0000000 --- a/junyeong/hello-spring/src/test/java/hello/hellospring/repository/MemoryMemberRepositoryTest.java +++ /dev/null @@ -1,62 +0,0 @@ -package hello.hellospring.repository; - -import hello.hellospring.domain.Member; -import org.assertj.core.api.Assertions; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.Test; - -import java.util.List; -import java.util.Optional; - -import static org.assertj.core.api.Assertions.*; - -public class MemoryMemberRepositoryTest { - MemoryMemberRepository repository = new MemoryMemberRepository(); - - @AfterEach - public void afterEach(){ - repository.clearStore(); - - } - - @Test - public void save(){ - Member member = new Member(); - member.setName("spring"); - - repository.save(member); - - Member result = repository.findById(member.getId()).get(); - assertThat(member).isEqualTo(result); - - } - - @Test - public void findByName(){ - Member member1 = new Member(); - member1.setName("spring1"); - repository.save(member1); - - Member member2 = new Member(); - member2.setName("spring2"); - repository.save(member2); - - Member result = repository.findByName("spring1").get(); - - assertThat(result).isEqualTo(member1); - } - @Test - public void findAll(){ - Member member1 = new Member(); - member1.setName("spring1"); - repository.save(member1); - - Member member2 = new Member(); - member2.setName("spring2"); - repository.save(member2); - - List result = repository.findAll(); - - assertThat(result.size()).isEqualTo(2); - } -} diff --git a/junyeong/hello-spring/src/test/java/hello/hellospring/service/MemberServiceIntegrationTest.java b/junyeong/hello-spring/src/test/java/hello/hellospring/service/MemberServiceIntegrationTest.java deleted file mode 100644 index 397a462..0000000 --- a/junyeong/hello-spring/src/test/java/hello/hellospring/service/MemberServiceIntegrationTest.java +++ /dev/null @@ -1,41 +0,0 @@ -package hello.hellospring.service; -import hello.hellospring.domain.Member; -import hello.hellospring.repository.MemberRepository; -import org.junit.jupiter.api.Test; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.annotation.Commit; -import org.springframework.transaction.annotation.Transactional; -import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertThrows; -@SpringBootTest -@Transactional -class MemberServiceIntegrationTest { - @Autowired MemberService memberService; - @Autowired MemberRepository memberRepository; - @Test - public void 회원가입() throws Exception { - //Given - Member member = new Member(); - member.setName("hello"); - //When - Long saveId = memberService.join(member); - //Then - Member findMember = memberRepository.findById(saveId).get(); - assertEquals(member.getName(), findMember.getName()); - } - @Test - public void 중복_회원_예외() throws Exception { - //Given - Member member1 = new Member(); - member1.setName("spring"); - Member member2 = new Member(); - member2.setName("spring"); - //When - memberService.join(member1); - IllegalStateException e = assertThrows(IllegalStateException.class, - () -> memberService.join(member2));//예외가 발생해야 한다. - assertThat(e.getMessage()).isEqualTo("이미 존재하는 회원입니다."); - } -} diff --git a/junyeong/hello-spring/src/test/java/hello/hellospring/service/MemberServiceTest.java b/junyeong/hello-spring/src/test/java/hello/hellospring/service/MemberServiceTest.java deleted file mode 100644 index 0da40c5..0000000 --- a/junyeong/hello-spring/src/test/java/hello/hellospring/service/MemberServiceTest.java +++ /dev/null @@ -1,41 +0,0 @@ -package hello.hellospring.service; - -import hello.hellospring.domain.Member; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -import java.util.Optional; - -import static org.assertj.core.api.AssertionsForClassTypes.assertThat; -import static org.junit.jupiter.api.Assertions.*; -class MemberServiceTest { - - MemberService memberService = new MemberService(); - - @Test - void 회원가입() throws Exception { - Member member = new Member(); - member.setName("hello"); - - Long saveId = memberService.join(member); - - Member findMember = memberService.findOne(saveId).get(); - assertThat(member.getName()).isEqualTo(findMember.getName()); - } - - @Test - public void 중복_회원_예외() throws Exception { - //Given - Member member1 = new Member(); - member1.setName("spring"); - Member member2 = new Member(); - member2.setName("spring"); - memberService.join(member1); - IllegalStateException e = assertThrows(IllegalStateException.class, - () -> memberService.join(member2));//예외가 발생해야 한다. - assertThat(e.getMessage()).isEqualTo("이미 존재하는 회원입니다."); - } - - - -} \ No newline at end of file diff --git a/kimshinhee/HappyJava/.gitignore b/kimshinhee/HappyJava/.gitignore deleted file mode 100644 index f68d109..0000000 --- a/kimshinhee/HappyJava/.gitignore +++ /dev/null @@ -1,29 +0,0 @@ -### IntelliJ IDEA ### -out/ -!**/src/main/**/out/ -!**/src/test/**/out/ - -### Eclipse ### -.apt_generated -.classpath -.factorypath -.project -.settings -.springBeans -.sts4-cache -bin/ -!**/src/main/**/bin/ -!**/src/test/**/bin/ - -### NetBeans ### -/nbproject/private/ -/nbbuild/ -/dist/ -/nbdist/ -/.nb-gradle/ - -### VS Code ### -.vscode/ - -### Mac OS ### -.DS_Store \ No newline at end of file diff --git a/kimshinhee/HappyJava/.idea/.gitignore b/kimshinhee/HappyJava/.idea/.gitignore deleted file mode 100644 index 13566b8..0000000 --- a/kimshinhee/HappyJava/.idea/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml -# Editor-based HTTP Client requests -/httpRequests/ -# Datasource local storage ignored files -/dataSources/ -/dataSources.local.xml diff --git a/kimshinhee/HappyJava/.idea/misc.xml b/kimshinhee/HappyJava/.idea/misc.xml deleted file mode 100644 index 07115cd..0000000 --- a/kimshinhee/HappyJava/.idea/misc.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/kimshinhee/HappyJava/.idea/vcs.xml b/kimshinhee/HappyJava/.idea/vcs.xml deleted file mode 100644 index b2bdec2..0000000 --- a/kimshinhee/HappyJava/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/kimshinhee/HappyJava/src/Car.java b/kimshinhee/HappyJava/src/Car.java deleted file mode 100644 index fe5d041..0000000 --- a/kimshinhee/HappyJava/src/Car.java +++ /dev/null @@ -1,27 +0,0 @@ -public class Car { - private String name; //필드는 가지는 것. - - //생성자는 메소드와 비슷하다. - //return type이 없다. 클래스 이름과 같아야 한다. - //매개변수 0개인 생성자를 기본생성자라고 한다. - //생성자가 아무것도 없으면 아무일도 안하는 기본 생성자가 자동으로 만들어진다. - - public Car(){ - System.out.println("자동차가 한대 생성됩니다."); - } - - //이름을 가지고 인스턴스가 만들어지게 하고 싶다.->필드 만들어주기 - public Car(String name){ - this.name = name; - } - public void printName(){ - System.out.println("자동차 이름: "+ name); - } - public void run(){ - System.out.println("전륜구동으로 달리다."); - } - @Override - public String toString(){ - return "자동차!!"; - } -} diff --git a/kimshinhee/HappyJava/src/CarExam02.java b/kimshinhee/HappyJava/src/CarExam02.java deleted file mode 100644 index 3e08152..0000000 --- a/kimshinhee/HappyJava/src/CarExam02.java +++ /dev/null @@ -1,10 +0,0 @@ -public class CarExam02 { - public static void main(String[] args){ - Car c1 = new Car(); - System.out.println(c1); //println(Object x) - Object로 참조할 수 있는 것은 무엇이든 ㅇ - c1.printName(); - - Car c2 = new Car("urstroy"); - c2.printName(); - } -} diff --git a/kimshinhee/Java_practice/.gitignore b/kimshinhee/Java_practice/.gitignore deleted file mode 100644 index f68d109..0000000 --- a/kimshinhee/Java_practice/.gitignore +++ /dev/null @@ -1,29 +0,0 @@ -### IntelliJ IDEA ### -out/ -!**/src/main/**/out/ -!**/src/test/**/out/ - -### Eclipse ### -.apt_generated -.classpath -.factorypath -.project -.settings -.springBeans -.sts4-cache -bin/ -!**/src/main/**/bin/ -!**/src/test/**/bin/ - -### NetBeans ### -/nbproject/private/ -/nbbuild/ -/dist/ -/nbdist/ -/.nb-gradle/ - -### VS Code ### -.vscode/ - -### Mac OS ### -.DS_Store \ No newline at end of file diff --git a/kimshinhee/Java_practice/.idea/.gitignore b/kimshinhee/Java_practice/.idea/.gitignore deleted file mode 100644 index 13566b8..0000000 --- a/kimshinhee/Java_practice/.idea/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml -# Editor-based HTTP Client requests -/httpRequests/ -# Datasource local storage ignored files -/dataSources/ -/dataSources.local.xml diff --git a/kimshinhee/Java_practice/.idea/misc.xml b/kimshinhee/Java_practice/.idea/misc.xml deleted file mode 100644 index 07115cd..0000000 --- a/kimshinhee/Java_practice/.idea/misc.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/kimshinhee/Java_practice/.idea/vcs.xml b/kimshinhee/Java_practice/.idea/vcs.xml deleted file mode 100644 index b2bdec2..0000000 --- a/kimshinhee/Java_practice/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/kimshinhee/Java_practice/src/baekjoon_1000/Main.java b/kimshinhee/Java_practice/src/baekjoon_1000/Main.java deleted file mode 100644 index 324e30b..0000000 --- a/kimshinhee/Java_practice/src/baekjoon_1000/Main.java +++ /dev/null @@ -1,10 +0,0 @@ -import java.util.Scanner; -public class Main{ - public static void main(String[] args){ - //객체만들고 입력받는 거 연습 - Scanner sc = new Scanner(System.in); - int a = sc.nextInt(); - int b = sc.nextInt(); - System.out.println(a+b); - } -} \ No newline at end of file diff --git a/kimshinhee/Java_practice/src/baekjoon_1037/Main.java b/kimshinhee/Java_practice/src/baekjoon_1037/Main.java deleted file mode 100644 index 6d06bed..0000000 --- a/kimshinhee/Java_practice/src/baekjoon_1037/Main.java +++ /dev/null @@ -1,23 +0,0 @@ -import java.util.Scanner; - -public class Main { - - public static void main(String[] args) { - - Scanner in = new Scanner(System.in); - - int T = in.nextInt(); - - int max = Integer.MIN_VALUE; - int min = Integer.MAX_VALUE; - - while(T-- > 0) { - int N = in.nextInt(); - max = N > max ? N : max; - min = N < min ? N : min; - - } - System.out.println(max * min); - } - -} \ No newline at end of file diff --git a/kimshinhee/Java_practice/src/baekjoon_10807/Main.java b/kimshinhee/Java_practice/src/baekjoon_10807/Main.java deleted file mode 100644 index 4492139..0000000 --- a/kimshinhee/Java_practice/src/baekjoon_10807/Main.java +++ /dev/null @@ -1,29 +0,0 @@ -import java.io.BufferedReader; -import java.io.InputStreamReader; -import java.io.IOException; -import java.util.StringTokenizer; - -public class Main { - public static void main(String[] args) throws IOException { - BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); - int count = Integer.parseInt(br.readLine()); - int countint = 0; - int findnum = 0; - int[] num = new int[count]; - StringTokenizer st = new StringTokenizer(br.readLine(), " "); - for (int i = 0; i < count; i++) { - num[i] = Integer.parseInt(st.nextToken()); - } - - findnum = Integer.parseInt(br.readLine()); - - for (int i = 0; i < num.length; i++) { - if (num[i] == findnum) { - countint++; - } - } - - System.out.println(countint); - - } -} \ No newline at end of file diff --git a/kimshinhee/Java_practice/src/baekjoon_10809/Main.java b/kimshinhee/Java_practice/src/baekjoon_10809/Main.java deleted file mode 100644 index 21355d3..0000000 --- a/kimshinhee/Java_practice/src/baekjoon_10809/Main.java +++ /dev/null @@ -1,29 +0,0 @@ -import java.util.Scanner; - -public class Main { - - public static void main(String[] args) { - Scanner in = new Scanner(System.in); - - - int[] arr = new int[26]; - - for(int i = 0; i < arr.length; i++) { - arr[i] = -1; - } - - String S = in.nextLine(); - - for(int i = 0; i < S.length(); i++) { - char ch = S.charAt(i); - - if(arr[ch - 'a'] == -1) { - arr[ch - 'a'] = i; - } - } - - for(int val : arr) { // 배열 출력 - System.out.print(val + " "); - } - } -} \ No newline at end of file diff --git a/kimshinhee/Java_practice/src/baekjoon_10871/Main.java b/kimshinhee/Java_practice/src/baekjoon_10871/Main.java deleted file mode 100644 index 2ef3235..0000000 --- a/kimshinhee/Java_practice/src/baekjoon_10871/Main.java +++ /dev/null @@ -1,23 +0,0 @@ -import java.util.Scanner; - -public class Main{ - public static void main(String[] args){ - Scanner sc = new Scanner(System.in); - int N = sc.nextInt(); - int X = sc.nextInt(); - - //배열 이용하기 - int arr[] = new int[N]; - - //숫자 입력받기 - for (int i = 0; i < N; i++){ - arr[i] = sc.nextInt(); - } - //배열 arr 차례대로 X보다 작으면 출력하기 - for (int i = 0; i < N; i++){ - if (arr[i] < X){ - System.out.print(arr[i]+ " "); - } - } - } -} \ No newline at end of file diff --git a/kimshinhee/Java_practice/src/baekjoon_11022/Main.java b/kimshinhee/Java_practice/src/baekjoon_11022/Main.java deleted file mode 100644 index 2212fec..0000000 --- a/kimshinhee/Java_practice/src/baekjoon_11022/Main.java +++ /dev/null @@ -1,19 +0,0 @@ -import java.util.Scanner; - -public class Main { - public static void main(String args[]) { - - Scanner in = new Scanner(System.in); - - int T = in.nextInt(); - - for (int i = 1; i <= T; i++) { - int A = in.nextInt(); - int B = in.nextInt(); - - System.out.println("Case #" + i + ": " + A + " + " + B + " = " + (A+B)); - } - - in.close(); - } -} \ No newline at end of file diff --git a/kimshinhee/Java_practice/src/baekjoon_1330/Main.java b/kimshinhee/Java_practice/src/baekjoon_1330/Main.java deleted file mode 100644 index b70127c..0000000 --- a/kimshinhee/Java_practice/src/baekjoon_1330/Main.java +++ /dev/null @@ -1,13 +0,0 @@ -import java.util.*; -public class Main{ - public static void main(String[] args){ - Scanner sc = new Scanner(System.in); - - int a = sc.nextInt(); - int b = sc.nextInt(); - - //if문은 쉬우니까 삼항 연산자 사용해보기 - String result = (a > b) ? ">": ((a < b) ? "<" : "=="); - System.out.println(result); - } -} \ No newline at end of file diff --git a/kimshinhee/Java_practice/src/baekjoon_2439/Main.java b/kimshinhee/Java_practice/src/baekjoon_2439/Main.java deleted file mode 100644 index f93c05e..0000000 --- a/kimshinhee/Java_practice/src/baekjoon_2439/Main.java +++ /dev/null @@ -1,17 +0,0 @@ -import java.util.Scanner; - -public class Main { - public static void main(String[] args) { - Scanner sc = new Scanner(System.in); - int N = sc.nextInt(); - for (int i = 0; i < N; i++) { - for (int j = 0; j < N - (i + 1); j++) { - System.out.print(" "); - } - for (int j = 0; j < i + 1; j++) { - System.out.print("*"); - } - System.out.println(); - } - } -} \ No newline at end of file diff --git a/kimshinhee/Java_practice/src/baekjoon_2739/Main.java b/kimshinhee/Java_practice/src/baekjoon_2739/Main.java deleted file mode 100644 index e2f8086..0000000 --- a/kimshinhee/Java_practice/src/baekjoon_2739/Main.java +++ /dev/null @@ -1,11 +0,0 @@ -import java.util.Scanner; - -public class Main{ - public static void main(String[] args){ - Scanner sc = new Scanner(System.in); - int N = sc.nextInt(); - for (int i=1; i<=9; i++){ - System.out.println(N + " * " + i +" = " + (N*i)); - } - } -} \ No newline at end of file diff --git a/kimshinhee/Java_practice/src/baekjoon_9498/Main.java b/kimshinhee/Java_practice/src/baekjoon_9498/Main.java deleted file mode 100644 index fff0c7d..0000000 --- a/kimshinhee/Java_practice/src/baekjoon_9498/Main.java +++ /dev/null @@ -1,28 +0,0 @@ -import java.util.Scanner; - -public class Main{ - public static void main(String[] args){ - Scanner sc = new Scanner(System.in); - int score = sc.nextInt(); - score = score/10; - //switch문 연습 - switch (score) { - case 10: - case 9: - System.out.println("A"); - break; - case 8: - System.out.println("B"); - break; - case 7: - System.out.println("C"); - break; - case 6: - System.out.println("D"); - break; - default: - System.out.println("F"); - - } - } -} \ No newline at end of file diff --git a/kimshinhee/hello-spring/.gitignore b/kimshinhee/hello-spring/.gitignore deleted file mode 100644 index c2065bc..0000000 --- a/kimshinhee/hello-spring/.gitignore +++ /dev/null @@ -1,37 +0,0 @@ -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/kimshinhee/hello-spring/build.gradle b/kimshinhee/hello-spring/build.gradle deleted file mode 100644 index 972c825..0000000 --- a/kimshinhee/hello-spring/build.gradle +++ /dev/null @@ -1,26 +0,0 @@ -plugins { - id 'java' - id 'org.springframework.boot' version '3.1.3' - id 'io.spring.dependency-management' version '1.1.3' -} - -group = 'hello' -version = '0.0.1-SNAPSHOT' - -java { - sourceCompatibility = '17' -} - -repositories { - mavenCentral() -} - -dependencies { - implementation 'org.springframework.boot:spring-boot-starter-thymeleaf' - implementation 'org.springframework.boot:spring-boot-starter-web' - testImplementation 'org.springframework.boot:spring-boot-starter-test' -} - -tasks.named('test') { - useJUnitPlatform() -} diff --git a/kimshinhee/hello-spring/gradle/wrapper/gradle-wrapper.jar b/kimshinhee/hello-spring/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index 033e24c..0000000 Binary files a/kimshinhee/hello-spring/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/kimshinhee/hello-spring/gradle/wrapper/gradle-wrapper.properties b/kimshinhee/hello-spring/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 9f4197d..0000000 --- a/kimshinhee/hello-spring/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,7 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip -networkTimeout=10000 -validateDistributionUrl=true -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists diff --git a/kimshinhee/hello-spring/gradlew b/kimshinhee/hello-spring/gradlew deleted file mode 100644 index fcb6fca..0000000 --- a/kimshinhee/hello-spring/gradlew +++ /dev/null @@ -1,248 +0,0 @@ -#!/bin/sh - -# -# Copyright © 2015-2021 the original authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -############################################################################## -# -# Gradle start up script for POSIX generated by Gradle. -# -# Important for running: -# -# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is -# noncompliant, but you have some other compliant shell such as ksh or -# bash, then to run this script, type that shell name before the whole -# command line, like: -# -# ksh Gradle -# -# Busybox and similar reduced shells will NOT work, because this script -# requires all of these POSIX shell features: -# * functions; -# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», -# «${var#prefix}», «${var%suffix}», and «$( cmd )»; -# * compound commands having a testable exit status, especially «case»; -# * various built-in commands including «command», «set», and «ulimit». -# -# Important for patching: -# -# (2) This script targets any POSIX shell, so it avoids extensions provided -# by Bash, Ksh, etc; in particular arrays are avoided. -# -# The "traditional" practice of packing multiple parameters into a -# space-separated string is a well documented source of bugs and security -# problems, so this is (mostly) avoided, by progressively accumulating -# options in "$@", and eventually passing that to Java. -# -# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, -# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; -# see the in-line comments for details. -# -# There are tweaks for specific operating systems such as AIX, CygWin, -# Darwin, MinGW, and NonStop. -# -# (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt -# within the Gradle project. -# -# You can find Gradle at https://github.com/gradle/gradle/. -# -############################################################################## - -# Attempt to set APP_HOME - -# Resolve links: $0 may be a link -app_path=$0 - -# Need this for daisy-chained symlinks. -while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] -do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac -done - -# This is normally unused -# shellcheck disable=SC2034 -APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum - -warn () { - echo "$*" -} >&2 - -die () { - echo - echo "$*" - echo - exit 1 -} >&2 - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -nonstop=false -case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; -esac - -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar - - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD=java - if ! command -v java >/dev/null 2>&1 - then - die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -fi - -# Increase the maximum file descriptors if we can. -if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac -fi - -# Collect all arguments for the java command, stacking in reverse order: -# * args from the command line -# * the main class name -# * -classpath -# * -D...appname settings -# * --module-path (only if needed) -# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. - -# For Cygwin or MSYS, switch paths to Windows format before running java -if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - - JAVACMD=$( cygpath --unix "$JAVACMD" ) - - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done -fi - - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' - -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. - -set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" - -# Stop when "xargs" is not available. -if ! command -v xargs >/dev/null 2>&1 -then - die "xargs is not available" -fi - -# Use "xargs" to parse quoted args. -# -# With -n1 it outputs one arg per line, with the quotes and backslashes removed. -# -# In Bash we could simply go: -# -# readarray ARGS < <( xargs -n1 <<<"$var" ) && -# set -- "${ARGS[@]}" "$@" -# -# but POSIX shell has neither arrays nor command substitution, so instead we -# post-process each arg (as a line of input to sed) to backslash-escape any -# character that might be a shell metacharacter, then use eval to reverse -# that process (while maintaining the separation between arguments), and wrap -# the whole thing up as a single "set" statement. -# -# This will of course break if any of these variables contains a newline or -# an unmatched quote. -# - -eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' - -exec "$JAVACMD" "$@" diff --git a/kimshinhee/hello-spring/gradlew.bat b/kimshinhee/hello-spring/gradlew.bat deleted file mode 100644 index 93e3f59..0000000 --- a/kimshinhee/hello-spring/gradlew.bat +++ /dev/null @@ -1,92 +0,0 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem - -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* - -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/kimshinhee/hello-spring/settings.gradle b/kimshinhee/hello-spring/settings.gradle deleted file mode 100644 index 69a39da..0000000 --- a/kimshinhee/hello-spring/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -rootProject.name = 'hello-spring' diff --git a/kimshinhee/hello-spring/sql/ddl.sql b/kimshinhee/hello-spring/sql/ddl.sql deleted file mode 100644 index b20616c..0000000 --- a/kimshinhee/hello-spring/sql/ddl.sql +++ /dev/null @@ -1,7 +0,0 @@ -drop table if exists member CASCADE; -create table member -( - id bigint generated by default as identity, - name varchar(255), - primary key (id) -); \ No newline at end of file diff --git a/kimshinhee/hello-spring/src/main/java/hello/hellospring/SpringConfig.java b/kimshinhee/hello-spring/src/main/java/hello/hellospring/SpringConfig.java deleted file mode 100644 index 7cfbd4b..0000000 --- a/kimshinhee/hello-spring/src/main/java/hello/hellospring/SpringConfig.java +++ /dev/null @@ -1,17 +0,0 @@ -package hello.hellospring; -import hello.hellospring.repository.MemberRepository; -import hello.hellospring.repository.MemoryMemberRepository; -import hello.hellospring.service.MemberService; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -@Configuration -public class SpringConfig { - @Bean - public MemberService memberService() { - return new MemberService(memberRepository()); - } - @Bean - public MemberRepository memberRepository() { - return new MemoryMemberRepository(); - } -} \ No newline at end of file diff --git a/kimshinhee/hello-spring/src/main/java/hello/hellospring/controller/HelloController.java b/kimshinhee/hello-spring/src/main/java/hello/hellospring/controller/HelloController.java deleted file mode 100644 index ebbcba5..0000000 --- a/kimshinhee/hello-spring/src/main/java/hello/hellospring/controller/HelloController.java +++ /dev/null @@ -1,47 +0,0 @@ -package hello.hellospring.controller; - -//import ch.qos.logback.core.model.Model; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.GetMapping; - -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; - -@Controller -public class HelloController { - @GetMapping("hello") - public String hello(Model model) { - model.addAttribute("data", "hello!!"); - return "hello"; - } - - @GetMapping("hello-mvc") - public String helloMvc(@RequestParam("name") String name, Model model) { - model.addAttribute("name", name); - return "hello-template"; - } - @GetMapping("hello-string") - @ResponseBody - public String helloString(@RequestParam("name") String name) { - return "hello " + name; - } - @GetMapping("hello-api") - @ResponseBody - public Hello helloApi(@RequestParam("name") String name) { - Hello hello = new Hello(); - hello.setName(name); - return hello; - } - static class Hello { - private String name; - - public String getName() { - return name; - } - public void setName(String name) { - - this.name = name; - } - } -} \ No newline at end of file diff --git a/kimshinhee/hello-spring/src/main/java/hello/hellospring/controller/HomeController.java b/kimshinhee/hello-spring/src/main/java/hello/hellospring/controller/HomeController.java deleted file mode 100644 index 88a08a5..0000000 --- a/kimshinhee/hello-spring/src/main/java/hello/hellospring/controller/HomeController.java +++ /dev/null @@ -1,10 +0,0 @@ -package hello.hellospring.controller; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.GetMapping; -@Controller -public class HomeController { - @GetMapping("/") // 슬래쉬는 맨 처음에 localhost 들어올때 아래가 호출된다. - public String home() { - return "home"; - } -} \ No newline at end of file diff --git a/kimshinhee/hello-spring/src/main/java/hello/hellospring/controller/MemberController.java b/kimshinhee/hello-spring/src/main/java/hello/hellospring/controller/MemberController.java deleted file mode 100644 index 7243521..0000000 --- a/kimshinhee/hello-spring/src/main/java/hello/hellospring/controller/MemberController.java +++ /dev/null @@ -1,45 +0,0 @@ -package hello.hellospring.controller; -//import ch.qos.logback.core.model.Model; //이거때문에 model.addAttribute 오류생겼음. -import org.springframework.ui.Model; -import hello.hellospring.domain.Member; -import hello.hellospring.service.MemberService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; - - -import java.util.List; - -@Controller -public class MemberController { - private final MemberService memberService; - @Autowired - public MemberController(MemberService memberService) { - this.memberService = memberService; - } - - //members/new-->url은 똑같지만 get이냐 post냐에 따라 다르게 mapping할수있다. - //보통 데이터 등록할때 post, 조회할 때 get - @GetMapping(value = "/members/new") //alt + enter 임포트해주기 - public String createForm() { - return "members/createMemberForm"; //리턴하면 templates에서 찾음. - } - @PostMapping(value = "/members/new") //alt shift enter - public String create(MemberForm form) { - Member member = new Member(); - member.setName(form.getName()); - - - System.out.println("member = " + member.getName()); //확인용으로 입력해보기 - - memberService.join(member); //회원가입할때 join - return "redirect:/"; //회원가입 끝났으니 home화면으로 보내주기 - } - @GetMapping(value = "/members") - public String list(Model model) { - List members = memberService.findMembers(); - model.addAttribute("members", members); - return "members/memberList"; - } -} \ No newline at end of file diff --git a/kimshinhee/hello-spring/src/main/java/hello/hellospring/controller/MemberForm.java b/kimshinhee/hello-spring/src/main/java/hello/hellospring/controller/MemberForm.java deleted file mode 100644 index e314ce9..0000000 --- a/kimshinhee/hello-spring/src/main/java/hello/hellospring/controller/MemberForm.java +++ /dev/null @@ -1,10 +0,0 @@ -package hello.hellospring.controller; -public class MemberForm { - private String name; - public String getName() { - return name; - } - public void setName(String name) { - this.name = name; - } -} diff --git a/kimshinhee/hello-spring/src/main/java/hello/hellospring/domain/Member.java b/kimshinhee/hello-spring/src/main/java/hello/hellospring/domain/Member.java deleted file mode 100644 index a6b002a..0000000 --- a/kimshinhee/hello-spring/src/main/java/hello/hellospring/domain/Member.java +++ /dev/null @@ -1,19 +0,0 @@ -package hello.hellospring.domain; - -public class Member { - - private Long id; - private String name; - public Long getId() { - return id; - } - public void setId(Long id) { - this.id = id; - } - public String getName() { - return name; - } - public void setName(String name) { - this.name = name; - } -} diff --git a/kimshinhee/hello-spring/src/main/java/hello/hellospring/repository/MemberRepository.java b/kimshinhee/hello-spring/src/main/java/hello/hellospring/repository/MemberRepository.java deleted file mode 100644 index 8169ef8..0000000 --- a/kimshinhee/hello-spring/src/main/java/hello/hellospring/repository/MemberRepository.java +++ /dev/null @@ -1,10 +0,0 @@ -package hello.hellospring.repository; -import hello.hellospring.domain.Member; -import java.util.List; -import java.util.Optional; -public interface MemberRepository { - Member save(Member member);//회원을 저장하면 저장된 회원 반환 - Optional findById(Long id); //id를 통해 찾기 - Optional findByName(String name); //name을 통해 찾기 - List findAll(); //지금까지 저장된 회원들 반환 -} \ No newline at end of file diff --git a/kimshinhee/hello-spring/src/main/java/hello/hellospring/repository/MemoryMemberRepository.java b/kimshinhee/hello-spring/src/main/java/hello/hellospring/repository/MemoryMemberRepository.java deleted file mode 100644 index d24da85..0000000 --- a/kimshinhee/hello-spring/src/main/java/hello/hellospring/repository/MemoryMemberRepository.java +++ /dev/null @@ -1,38 +0,0 @@ -package hello.hellospring.repository; -import hello.hellospring.domain.Member; -import org.springframework.stereotype.Repository; - -import java.util.*; -/** - * 동시성 문제가 고려되어 있지 않음, 실무에서는 ConcurrentHashMap, AtomicLong 사용 고려 - */ -@Repository //정형화되어있는 패턴 -public class MemoryMemberRepository implements MemberRepository { - private static Map store = new HashMap<>(); - private static long sequence = 0L;//sequence는 0,1,2 이렇게 key값 생성해주는 아이 - @Override - public Member save(Member member) { - member.setId(++sequence);//sequence값 하나 올려주기 - store.put(member.getId(), member);//스토어에 put-->map에 저장됨 - return member; - } - @Override - public Optional findById(Long id) { - return Optional.ofNullable(store.get(id)); - //return store.get(id);라 하기도 하는데 null반환 가능성이 있으면 optional.of~~ 사용해줌 - //이러면 null도 감쌀수있음 - } - @Override - public List findAll() { - return new ArrayList<>(store.values());//store에 있는 멤버들이 반환됨 - } - @Override - public Optional findByName(String name) { - return store.values().stream() - .filter(member -> member.getName().equals(name))//파라미터로 넘어온 name이랑 같은지 확인 - .findAny();//찾으면 반환(루프돌면서 찾으면 바로 반환), 없으면 null포함해서 반환 - } - public void clearStore() { - store.clear(); - } -} \ No newline at end of file diff --git a/kimshinhee/hello-spring/src/main/java/hello/hellospring/service/HelloSpringApplication.java b/kimshinhee/hello-spring/src/main/java/hello/hellospring/service/HelloSpringApplication.java deleted file mode 100644 index e5fe7f5..0000000 --- a/kimshinhee/hello-spring/src/main/java/hello/hellospring/service/HelloSpringApplication.java +++ /dev/null @@ -1,14 +0,0 @@ -package hello.hellospring.service; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; - -@SpringBootApplication -public class HelloSpringApplication { - - public static void main(String[] args) { - - SpringApplication.run(HelloSpringApplication.class, args); - } - -} diff --git a/kimshinhee/hello-spring/src/main/java/hello/hellospring/service/MemberService.java b/kimshinhee/hello-spring/src/main/java/hello/hellospring/service/MemberService.java deleted file mode 100644 index 02a7d0f..0000000 --- a/kimshinhee/hello-spring/src/main/java/hello/hellospring/service/MemberService.java +++ /dev/null @@ -1,46 +0,0 @@ -package hello.hellospring.service; - -import hello.hellospring.domain.Member; -import hello.hellospring.repository.MemberRepository; -import hello.hellospring.repository.MemoryMemberRepository; -import org.springframework.stereotype.Service; - -import java.util.List; -import java.util.Optional; - -@Service -public class MemberService { - private final MemberRepository memberRepository; - public MemberService(MemberRepository memberRepository) { - this.memberRepository = memberRepository; - } - /** - * 회원가입 - */ - public Long join(Member member) { - validateDuplicateMember(member); //중복 회원 검증 - //memberRepository.findByName(member.getName()); - //단축키 command option v - //Optional result = memberRepository.findByName(member.getNamme()); - //retult.ifPresent(m -> {throw new IllegalStateException("이미 존재하는 회원입니다.");}}; - //이 부분 다시 공부하기 - - memberRepository.save(member); - return member.getId(); - } - private void validateDuplicateMember(Member member) { - memberRepository.findByName(member.getName()) - .ifPresent(m -> { - throw new IllegalStateException("이미 존재하는 회원입니다."); - }); - } - /** - * 전체 회원 조회 - */ - public List findMembers() { - return memberRepository.findAll(); - } - public Optional findOne(Long memberId) { - return memberRepository.findById(memberId); - } -} diff --git a/kimshinhee/hello-spring/src/main/resources/application.properties b/kimshinhee/hello-spring/src/main/resources/application.properties deleted file mode 100644 index 8b13789..0000000 --- a/kimshinhee/hello-spring/src/main/resources/application.properties +++ /dev/null @@ -1 +0,0 @@ - diff --git a/kimshinhee/hello-spring/src/main/resources/static/hello-static.html b/kimshinhee/hello-spring/src/main/resources/static/hello-static.html deleted file mode 100644 index 68254b2..0000000 --- a/kimshinhee/hello-spring/src/main/resources/static/hello-static.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - static content - - - -정적 컨텐츠 입니다. - - \ No newline at end of file diff --git a/kimshinhee/hello-spring/src/main/resources/static/index.html b/kimshinhee/hello-spring/src/main/resources/static/index.html deleted file mode 100644 index c141fa2..0000000 --- a/kimshinhee/hello-spring/src/main/resources/static/index.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Hello - - -Hello -hello - - \ No newline at end of file diff --git a/kimshinhee/hello-spring/src/main/resources/templates/hello-template.html b/kimshinhee/hello-spring/src/main/resources/templates/hello-template.html deleted file mode 100644 index 66c25d8..0000000 --- a/kimshinhee/hello-spring/src/main/resources/templates/hello-template.html +++ /dev/null @@ -1,5 +0,0 @@ - - -

hello! empty

- - \ No newline at end of file diff --git a/kimshinhee/hello-spring/src/main/resources/templates/hello.html b/kimshinhee/hello-spring/src/main/resources/templates/hello.html deleted file mode 100644 index 81f8f1c..0000000 --- a/kimshinhee/hello-spring/src/main/resources/templates/hello.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - Hello - - - -

안녕하세요. 손님

- - \ No newline at end of file diff --git a/kimshinhee/hello-spring/src/main/resources/templates/home.html b/kimshinhee/hello-spring/src/main/resources/templates/home.html deleted file mode 100644 index d5f7880..0000000 --- a/kimshinhee/hello-spring/src/main/resources/templates/home.html +++ /dev/null @@ -1,15 +0,0 @@ - - - -
-
-

Hello Spring

-

회원 기능

-

- 회원 가입 - 회원 목록 -

-
-
- - \ No newline at end of file diff --git a/kimshinhee/hello-spring/src/main/resources/templates/members/createMemberForm.html b/kimshinhee/hello-spring/src/main/resources/templates/members/createMemberForm.html deleted file mode 100644 index 080117a..0000000 --- a/kimshinhee/hello-spring/src/main/resources/templates/members/createMemberForm.html +++ /dev/null @@ -1,14 +0,0 @@ - - - -
-
//여기에서 MemberController로 넘어가서 PostMapping으로 이동 -
- - //name이 key가 된다. -
- -
-
- - \ No newline at end of file diff --git a/kimshinhee/hello-spring/src/main/resources/templates/members/memberList.html b/kimshinhee/hello-spring/src/main/resources/templates/members/memberList.html deleted file mode 100644 index 31aaf5e..0000000 --- a/kimshinhee/hello-spring/src/main/resources/templates/members/memberList.html +++ /dev/null @@ -1,23 +0,0 @@ - - - -
-
- - - - - - - - - - - - - -
#이름
-
-
- - \ No newline at end of file diff --git a/kimshinhee/hello-spring/src/test/java/hello/hellospring/HelloSpringApplicationTests.java b/kimshinhee/hello-spring/src/test/java/hello/hellospring/HelloSpringApplicationTests.java deleted file mode 100644 index 87d37cf..0000000 --- a/kimshinhee/hello-spring/src/test/java/hello/hellospring/HelloSpringApplicationTests.java +++ /dev/null @@ -1,13 +0,0 @@ -package hello.hellospring; - -import org.junit.jupiter.api.Test; -import org.springframework.boot.test.context.SpringBootTest; - -@SpringBootTest -class HelloSpringApplicationTests { - - @Test - void contextLoads() { - } - -} diff --git a/kimshinhee/hello-spring/src/test/java/hello/hellospring/repository/MemoryMemberRepositoryTest.java b/kimshinhee/hello-spring/src/test/java/hello/hellospring/repository/MemoryMemberRepositoryTest.java deleted file mode 100644 index 0e490a1..0000000 --- a/kimshinhee/hello-spring/src/test/java/hello/hellospring/repository/MemoryMemberRepositoryTest.java +++ /dev/null @@ -1,63 +0,0 @@ -package hello.hellospring.repository; -import hello.hellospring.domain.Member; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.Test; -import java.util.List; -import java.util.Optional; -import static org.assertj.core.api.Assertions.*; -class MemoryMemberRepositoryTest { - MemoryMemberRepository repository = new MemoryMemberRepository(); - @AfterEach - public void afterEach() { - repository.clearStore(); - } - @Test //@Test치면 org.junit.jupiter.api 뜨고 선택해서 임포트해줌 - public void save() { - //given - Member member = new Member(); //저장이 잘되는지 확인 - member.setName("spring");//나는 이름 스프링으로 해줌 - //when - repository.save(member);//레포지토리에 멤버 세이브하기 - //then - Member result = repository.findById(member.getId()).get();//제대로 잘 드갔나 확인 - //optional에서 값 꺼낼때 .get()으로 할 수 있음 - assertThat(result).isEqualTo(member); - //sysout("result = " + (result == member)); - //Assertions.assertEquals(member, result); - //Assertions.assertThat(member).isEqualTo(result); -->Assertions없애도 된다는 뜻 - } - @Test - public void findByName() {//이름으로 찾는거 - //given - Member member1 = new Member(); - member1.setName("spring1"); - repository.save(member1); - - Member member2 = new Member();//이거 어차피 숫자하나 바뀌니까 위에꺼 복붙하고 member1에 shift + F6누르면 됨(rename) - member2.setName("spring2"); - repository.save(member2); - - //when - Member result = repository.findByName("spring1").get(); - - //then - assertThat(result).isEqualTo(member1); - } - @Test - public void findAll() { - //given - Member member1 = new Member(); - member1.setName("spring1"); - repository.save(member1); - - Member member2 = new Member(); - member2.setName("spring2"); - repository.save(member2); - - //when - List result = repository.findAll(); - - //then - assertThat(result.size()).isEqualTo(2);//2개가 나와야 함. - } -} \ No newline at end of file diff --git a/kimshinhee/hello-spring/src/test/java/hello/hellospring/service/MemberServiceTest.java b/kimshinhee/hello-spring/src/test/java/hello/hellospring/service/MemberServiceTest.java deleted file mode 100644 index 10ab869..0000000 --- a/kimshinhee/hello-spring/src/test/java/hello/hellospring/service/MemberServiceTest.java +++ /dev/null @@ -1,45 +0,0 @@ -package hello.hellospring.service; -import hello.hellospring.domain.Member; -import hello.hellospring.repository.MemoryMemberRepository; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import static org.assertj.core.api.Assertions.*; -import static org.junit.jupiter.api.Assertions.*; -class MemberServiceTest { - MemberService memberService; - MemoryMemberRepository memberRepository; - @BeforeEach - public void beforeEach() { - memberRepository = new MemoryMemberRepository(); - memberService = new MemberService(memberRepository); - } - @AfterEach - public void afterEach() { - memberRepository.clearStore(); - } - @Test - public void 회원가입() throws Exception { - //Given - Member member = new Member(); - member.setName("hello"); - //When - Long saveId = memberService.join(member); - //Then - Member findMember = memberRepository.findById(saveId).get(); - assertEquals(member.getName(), findMember.getName()); - } - @Test - public void 중복_회원_예외() throws Exception { - //Given - Member member1 = new Member(); - member1.setName("spring"); - Member member2 = new Member(); - member2.setName("spring"); - //When - memberService.join(member1); - IllegalStateException e = assertThrows(IllegalStateException.class, - () -> memberService.join(member2));//예외가 발생해야 한다. - assertThat(e.getMessage()).isEqualTo("이미 존재하는 회원입니다."); - } -} \ No newline at end of file diff --git "a/kimshinhee/\352\260\225\354\235\230\354\210\230\352\260\225\355\231\225\354\235\270\354\202\254\354\247\204/\352\260\225\354\235\230\354\210\230\352\260\225\354\231\204\353\243\2141.png" "b/kimshinhee/\352\260\225\354\235\230\354\210\230\352\260\225\355\231\225\354\235\270\354\202\254\354\247\204/\352\260\225\354\235\230\354\210\230\352\260\225\354\231\204\353\243\2141.png" deleted file mode 100644 index 1cf1a13..0000000 Binary files "a/kimshinhee/\352\260\225\354\235\230\354\210\230\352\260\225\355\231\225\354\235\270\354\202\254\354\247\204/\352\260\225\354\235\230\354\210\230\352\260\225\354\231\204\353\243\2141.png" and /dev/null differ diff --git "a/kimshinhee/\352\260\225\354\235\230\354\210\230\352\260\225\355\231\225\354\235\270\354\202\254\354\247\204/\352\260\225\354\235\230\354\210\230\352\260\225\354\231\204\353\243\2142.png" "b/kimshinhee/\352\260\225\354\235\230\354\210\230\352\260\225\355\231\225\354\235\270\354\202\254\354\247\204/\352\260\225\354\235\230\354\210\230\352\260\225\354\231\204\353\243\2142.png" deleted file mode 100644 index c67b084..0000000 Binary files "a/kimshinhee/\352\260\225\354\235\230\354\210\230\352\260\225\355\231\225\354\235\270\354\202\254\354\247\204/\352\260\225\354\235\230\354\210\230\352\260\225\354\231\204\353\243\2142.png" and /dev/null differ diff --git "a/kimshinhee/\352\260\225\354\235\230\354\210\230\352\260\225\355\231\225\354\235\270\354\202\254\354\247\204/\352\260\225\354\235\230\354\210\230\352\260\225\354\231\204\353\243\2143.png" "b/kimshinhee/\352\260\225\354\235\230\354\210\230\352\260\225\355\231\225\354\235\270\354\202\254\354\247\204/\352\260\225\354\235\230\354\210\230\352\260\225\354\231\204\353\243\2143.png" deleted file mode 100644 index 723dec9..0000000 Binary files "a/kimshinhee/\352\260\225\354\235\230\354\210\230\352\260\225\355\231\225\354\235\270\354\202\254\354\247\204/\352\260\225\354\235\230\354\210\230\352\260\225\354\231\204\353\243\2143.png" and /dev/null differ diff --git "a/kimshinhee/\354\236\220\353\260\224\353\263\265\354\212\265/.idea/workspace.xml" "b/kimshinhee/\354\236\220\353\260\224\353\263\265\354\212\265/.idea/workspace.xml" deleted file mode 100644 index 9d6c1f9..0000000 --- "a/kimshinhee/\354\236\220\353\260\224\353\263\265\354\212\265/.idea/workspace.xml" +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - - - - - - - - 1695114797502 - - - - - - \ No newline at end of file diff --git "a/kimshinhee/\354\236\220\353\260\224\353\263\265\354\212\265/10\354\233\22424\354\235\274\353\260\261\354\244\200\354\236\220\353\260\224\353\254\270\354\240\234.png" "b/kimshinhee/\354\236\220\353\260\224\353\263\265\354\212\265/10\354\233\22424\354\235\274\353\260\261\354\244\200\354\236\220\353\260\224\353\254\270\354\240\234.png" deleted file mode 100644 index e1e3bcc..0000000 Binary files "a/kimshinhee/\354\236\220\353\260\224\353\263\265\354\212\265/10\354\233\22424\354\235\274\353\260\261\354\244\200\354\236\220\353\260\224\353\254\270\354\240\234.png" and /dev/null differ diff --git "a/kimshinhee/\354\236\220\353\260\224\353\263\265\354\212\265/\354\204\271\354\205\2303_1.png" "b/kimshinhee/\354\236\220\353\260\224\353\263\265\354\212\265/\354\204\271\354\205\2303_1.png" deleted file mode 100644 index 413e3d6..0000000 Binary files "a/kimshinhee/\354\236\220\353\260\224\353\263\265\354\212\265/\354\204\271\354\205\2303_1.png" and /dev/null differ diff --git "a/kimshinhee/\354\236\220\353\260\224\353\263\265\354\212\265/\354\204\271\354\205\2303_2.png" "b/kimshinhee/\354\236\220\353\260\224\353\263\265\354\212\265/\354\204\271\354\205\2303_2.png" deleted file mode 100644 index 4e171de..0000000 Binary files "a/kimshinhee/\354\236\220\353\260\224\353\263\265\354\212\265/\354\204\271\354\205\2303_2.png" and /dev/null differ diff --git "a/kimshinhee/\354\236\220\353\260\224\353\263\265\354\212\265/\354\266\224\354\203\201 \355\201\264\353\236\230\354\212\244\354\231\200 \354\235\270\355\204\260\355\216\230\354\235\264\354\212\244 \352\264\200\352\263\204 \354\260\270\352\263\240 \354\235\264\353\257\270\354\247\200.jpg" "b/kimshinhee/\354\236\220\353\260\224\353\263\265\354\212\265/\354\266\224\354\203\201 \355\201\264\353\236\230\354\212\244\354\231\200 \354\235\270\355\204\260\355\216\230\354\235\264\354\212\244 \352\264\200\352\263\204 \354\260\270\352\263\240 \354\235\264\353\257\270\354\247\200.jpg" deleted file mode 100644 index d3d390e..0000000 Binary files "a/kimshinhee/\354\236\220\353\260\224\353\263\265\354\212\265/\354\266\224\354\203\201 \355\201\264\353\236\230\354\212\244\354\231\200 \354\235\270\355\204\260\355\216\230\354\235\264\354\212\244 \352\264\200\352\263\204 \354\260\270\352\263\240 \354\235\264\353\257\270\354\247\200.jpg" and /dev/null differ