첫 커밋

This commit is contained in:
daniel LEE 2023-10-23 19:43:02 +09:00
parent 7ae392d0a6
commit 16d256ee34
132 changed files with 19497 additions and 0 deletions

310
mvnw vendored Normal file
View File

@ -0,0 +1,310 @@
#!/bin/sh
# ----------------------------------------------------------------------------
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you 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.
# ----------------------------------------------------------------------------
# ----------------------------------------------------------------------------
# Maven2 Start Up Batch script
#
# Required ENV vars:
# ------------------
# JAVA_HOME - location of a JDK home dir
#
# Optional ENV vars
# -----------------
# M2_HOME - location of maven2's installed home dir
# MAVEN_OPTS - parameters passed to the Java VM when running Maven
# e.g. to debug Maven itself, use
# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
# MAVEN_SKIP_RC - flag to disable loading of mavenrc files
# ----------------------------------------------------------------------------
if [ -z "$MAVEN_SKIP_RC" ] ; then
if [ -f /etc/mavenrc ] ; then
. /etc/mavenrc
fi
if [ -f "$HOME/.mavenrc" ] ; then
. "$HOME/.mavenrc"
fi
fi
# OS specific support. $var _must_ be set to either true or false.
cygwin=false;
darwin=false;
mingw=false
case "`uname`" in
CYGWIN*) cygwin=true ;;
MINGW*) mingw=true;;
Darwin*) darwin=true
# Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
# See https://developer.apple.com/library/mac/qa/qa1170/_index.html
if [ -z "$JAVA_HOME" ]; then
if [ -x "/usr/libexec/java_home" ]; then
export JAVA_HOME="`/usr/libexec/java_home`"
else
export JAVA_HOME="/Library/Java/Home"
fi
fi
;;
esac
if [ -z "$JAVA_HOME" ] ; then
if [ -r /etc/gentoo-release ] ; then
JAVA_HOME=`java-config --jre-home`
fi
fi
if [ -z "$M2_HOME" ] ; then
## resolve links - $0 may be a link to maven's home
PRG="$0"
# need this for relative symlinks
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG="`dirname "$PRG"`/$link"
fi
done
saveddir=`pwd`
M2_HOME=`dirname "$PRG"`/..
# make it fully qualified
M2_HOME=`cd "$M2_HOME" && pwd`
cd "$saveddir"
# echo Using m2 at $M2_HOME
fi
# For Cygwin, ensure paths are in UNIX format before anything is touched
if $cygwin ; then
[ -n "$M2_HOME" ] &&
M2_HOME=`cygpath --unix "$M2_HOME"`
[ -n "$JAVA_HOME" ] &&
JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
[ -n "$CLASSPATH" ] &&
CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
fi
# For Mingw, ensure paths are in UNIX format before anything is touched
if $mingw ; then
[ -n "$M2_HOME" ] &&
M2_HOME="`(cd "$M2_HOME"; pwd)`"
[ -n "$JAVA_HOME" ] &&
JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
fi
if [ -z "$JAVA_HOME" ]; then
javaExecutable="`which javac`"
if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
# readlink(1) is not available as standard on Solaris 10.
readLink=`which readlink`
if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
if $darwin ; then
javaHome="`dirname \"$javaExecutable\"`"
javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
else
javaExecutable="`readlink -f \"$javaExecutable\"`"
fi
javaHome="`dirname \"$javaExecutable\"`"
javaHome=`expr "$javaHome" : '\(.*\)/bin'`
JAVA_HOME="$javaHome"
export JAVA_HOME
fi
fi
fi
if [ -z "$JAVACMD" ] ; then
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
else
JAVACMD="`which java`"
fi
fi
if [ ! -x "$JAVACMD" ] ; then
echo "Error: JAVA_HOME is not defined correctly." >&2
echo " We cannot execute $JAVACMD" >&2
exit 1
fi
if [ -z "$JAVA_HOME" ] ; then
echo "Warning: JAVA_HOME environment variable is not set."
fi
CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
# traverses directory structure from process work directory to filesystem root
# first directory with .mvn subdirectory is considered project base directory
find_maven_basedir() {
if [ -z "$1" ]
then
echo "Path not specified to find_maven_basedir"
return 1
fi
basedir="$1"
wdir="$1"
while [ "$wdir" != '/' ] ; do
if [ -d "$wdir"/.mvn ] ; then
basedir=$wdir
break
fi
# workaround for JBEAP-8937 (on Solaris 10/Sparc)
if [ -d "${wdir}" ]; then
wdir=`cd "$wdir/.."; pwd`
fi
# end of workaround
done
echo "${basedir}"
}
# concatenates all lines of a file
concat_lines() {
if [ -f "$1" ]; then
echo "$(tr -s '\n' ' ' < "$1")"
fi
}
BASE_DIR=`find_maven_basedir "$(pwd)"`
if [ -z "$BASE_DIR" ]; then
exit 1;
fi
##########################################################################################
# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
# This allows using the maven wrapper in projects that prohibit checking in binary data.
##########################################################################################
if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then
if [ "$MVNW_VERBOSE" = true ]; then
echo "Found .mvn/wrapper/maven-wrapper.jar"
fi
else
if [ "$MVNW_VERBOSE" = true ]; then
echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
fi
if [ -n "$MVNW_REPOURL" ]; then
jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar"
else
jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar"
fi
while IFS="=" read key value; do
case "$key" in (wrapperUrl) jarUrl="$value"; break ;;
esac
done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties"
if [ "$MVNW_VERBOSE" = true ]; then
echo "Downloading from: $jarUrl"
fi
wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar"
if $cygwin; then
wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"`
fi
if command -v wget > /dev/null; then
if [ "$MVNW_VERBOSE" = true ]; then
echo "Found wget ... using wget"
fi
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
wget "$jarUrl" -O "$wrapperJarPath"
else
wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath"
fi
elif command -v curl > /dev/null; then
if [ "$MVNW_VERBOSE" = true ]; then
echo "Found curl ... using curl"
fi
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
curl -o "$wrapperJarPath" "$jarUrl" -f
else
curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f
fi
else
if [ "$MVNW_VERBOSE" = true ]; then
echo "Falling back to using Java to download"
fi
javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java"
# For Cygwin, switch paths to Windows format before running javac
if $cygwin; then
javaClass=`cygpath --path --windows "$javaClass"`
fi
if [ -e "$javaClass" ]; then
if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
if [ "$MVNW_VERBOSE" = true ]; then
echo " - Compiling MavenWrapperDownloader.java ..."
fi
# Compiling the Java class
("$JAVA_HOME/bin/javac" "$javaClass")
fi
if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
# Running the downloader
if [ "$MVNW_VERBOSE" = true ]; then
echo " - Running MavenWrapperDownloader.java ..."
fi
("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR")
fi
fi
fi
fi
##########################################################################################
# End of extension
##########################################################################################
export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
if [ "$MVNW_VERBOSE" = true ]; then
echo $MAVEN_PROJECTBASEDIR
fi
MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
# For Cygwin, switch paths to Windows format before running java
if $cygwin; then
[ -n "$M2_HOME" ] &&
M2_HOME=`cygpath --path --windows "$M2_HOME"`
[ -n "$JAVA_HOME" ] &&
JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
[ -n "$CLASSPATH" ] &&
CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
[ -n "$MAVEN_PROJECTBASEDIR" ] &&
MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
fi
# Provide a "standardized" way to retrieve the CLI args that will
# work with both Windows and non-Windows executions.
MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@"
export MAVEN_CMD_LINE_ARGS
WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
exec "$JAVACMD" \
$MAVEN_OPTS \
-classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
"-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"

182
mvnw.cmd vendored Normal file
View File

@ -0,0 +1,182 @@
@REM ----------------------------------------------------------------------------
@REM Licensed to the Apache Software Foundation (ASF) under one
@REM or more contributor license agreements. See the NOTICE file
@REM distributed with this work for additional information
@REM regarding copyright ownership. The ASF licenses this file
@REM to you under the Apache License, Version 2.0 (the
@REM "License"); you may not use this file except in compliance
@REM with the License. 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,
@REM software distributed under the License is distributed on an
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@REM KIND, either express or implied. See the License for the
@REM specific language governing permissions and limitations
@REM under the License.
@REM ----------------------------------------------------------------------------
@REM ----------------------------------------------------------------------------
@REM Maven2 Start Up Batch script
@REM
@REM Required ENV vars:
@REM JAVA_HOME - location of a JDK home dir
@REM
@REM Optional ENV vars
@REM M2_HOME - location of maven2's installed home dir
@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending
@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
@REM e.g. to debug Maven itself, use
@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
@REM ----------------------------------------------------------------------------
@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
@echo off
@REM set title of command window
title %0
@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on'
@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
@REM set %HOME% to equivalent of $HOME
if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
@REM Execute a user defined script before this one
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
@REM check for pre script, once with legacy .bat ending and once with .cmd ending
if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
:skipRcPre
@setlocal
set ERROR_CODE=0
@REM To isolate internal variables from possible post scripts, we use another setlocal
@setlocal
@REM ==== START VALIDATION ====
if not "%JAVA_HOME%" == "" goto OkJHome
echo.
echo Error: JAVA_HOME not found in your environment. >&2
echo Please set the JAVA_HOME variable in your environment to match the >&2
echo location of your Java installation. >&2
echo.
goto error
:OkJHome
if exist "%JAVA_HOME%\bin\java.exe" goto init
echo.
echo Error: JAVA_HOME is set to an invalid directory. >&2
echo JAVA_HOME = "%JAVA_HOME%" >&2
echo Please set the JAVA_HOME variable in your environment to match the >&2
echo location of your Java installation. >&2
echo.
goto error
@REM ==== END VALIDATION ====
:init
@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
@REM Fallback to current working directory if not found.
set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
set EXEC_DIR=%CD%
set WDIR=%EXEC_DIR%
:findBaseDir
IF EXIST "%WDIR%"\.mvn goto baseDirFound
cd ..
IF "%WDIR%"=="%CD%" goto baseDirNotFound
set WDIR=%CD%
goto findBaseDir
:baseDirFound
set MAVEN_PROJECTBASEDIR=%WDIR%
cd "%EXEC_DIR%"
goto endDetectBaseDir
:baseDirNotFound
set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
cd "%EXEC_DIR%"
:endDetectBaseDir
IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
@setlocal EnableExtensions EnableDelayedExpansion
for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
:endReadAdditionalConfig
SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar"
FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B
)
@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
@REM This allows using the maven wrapper in projects that prohibit checking in binary data.
if exist %WRAPPER_JAR% (
if "%MVNW_VERBOSE%" == "true" (
echo Found %WRAPPER_JAR%
)
) else (
if not "%MVNW_REPOURL%" == "" (
SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar"
)
if "%MVNW_VERBOSE%" == "true" (
echo Couldn't find %WRAPPER_JAR%, downloading it ...
echo Downloading from: %DOWNLOAD_URL%
)
powershell -Command "&{"^
"$webclient = new-object System.Net.WebClient;"^
"if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^
"$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^
"}"^
"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^
"}"
if "%MVNW_VERBOSE%" == "true" (
echo Finished downloading %WRAPPER_JAR%
)
)
@REM End of extension
@REM Provide a "standardized" way to retrieve the CLI args that will
@REM work with both Windows and non-Windows executions.
set MAVEN_CMD_LINE_ARGS=%*
%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
if ERRORLEVEL 1 goto error
goto end
:error
set ERROR_CODE=1
:end
@endlocal & set ERROR_CODE=%ERROR_CODE%
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
@REM check for post script, once with legacy .bat ending and once with .cmd ending
if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
:skipRcPost
@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
if "%MAVEN_BATCH_PAUSE%" == "on" pause
if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
exit /B %ERROR_CODE%

400
pom.xml Normal file
View File

@ -0,0 +1,400 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.3.12.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<artifactId>LogLogAPI</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>war</packaging>
<name>LogLogAPI</name>
<description> LogLogAPI for Spring Boot</description>
<properties>
<java.version>1.8</java.version>
<!-- Jenkins에서 사용하는 부분 -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>
<build>
<finalName>LogLogAPI</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
<!-- 빌드시 리소스 파일 포함설정 -->
<resources>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>*.properties</include>
<include>*.xml</include>
</includes>
<targetPath>.</targetPath>
<filtering>true</filtering>
</resource>
<resource>
<directory>src/main/java/com/loglog/api/commons/daos/mapper</directory>
<includes>
<include>*.xml</include>
</includes>
<targetPath>com/loglog/api/commons/daos/mapper</targetPath>
<filtering>true</filtering>
</resource>
</resources>
</build>
<repositories>
<!-- UrlBuilder -->
<repository>
<id>jcenter</id>
<url>https://jcenter.bintray.com/</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>inner project</id>
<name>external jars</name>
<url>file://${project.basedir}/lib</url>
</repository>
<repository>
<id>in-project-jenkins</id>
<name>custom jars-jenkins</name>
<url>file://${JENKINS_HOME}/jobs/${JOB_NAME}/workspace/lib</url>
</repository>
<repository>
<id>Java-fcm</id>
<name>Java-fcm for Maven</name>
<url>http://dl.bintray.com/tudor/Pixsee</url>
</repository>
</repositories>
<dependencyManagement>
<dependencies>
<!-- AWS BOM -->
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>bom</artifactId>
<version>2.11.12</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<!-- Google Cloud -->
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>libraries-bom</artifactId>
<version>12.1.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
<exclusion>
<artifactId>commons-logging</artifactId>
<groupId>commons-logging</groupId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
<exclusion>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</exclusion>
<exclusion>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</exclusion>
<exclusion>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
<exclusion>
<artifactId>commons-logging</artifactId>
<groupId>commons-logging</groupId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
<exclusion>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</exclusion>
<exclusion>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</exclusion>
<exclusion>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- Spring Actuator & Boot Admin Start -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
<exclusion>
<artifactId>commons-logging</artifactId>
<groupId>commons-logging</groupId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
<exclusion>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</exclusion>
<exclusion>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</exclusion>
<exclusion>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-starter-client</artifactId>
<version>2.2.0</version> <!-- 스프링부트 2.2.4 기준 -->
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>1.9.3</version>
</dependency>
<!-- postgresSQL -->
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.6</version>
</dependency>
<!-- MyBatis -->
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>1.3.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.mybatis/mybatis-spring -->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
<version>1.3.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.mybatis/mybatis -->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.4.6</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.mariadb.jdbc/mariadb-java-client -->
<dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
</dependency>
<!-- DBCP -->
<dependency>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
<version>1.2.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.json/json -->
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20160810</version>
</dependency>
<!-- Json Web Tokens -->
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt</artifactId>
<version>0.9.1</version>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
</dependency>
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.3.1</version>
</dependency>
<!-- image EXIF read -->
<dependency>
<groupId>com.drewnoakes</groupId>
<artifactId>metadata-extractor</artifactId>
<version>2.9.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.imgscalr/imgscalr-lib -->
<dependency>
<groupId>org.imgscalr</groupId>
<artifactId>imgscalr-lib</artifactId>
<version>4.2</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
</dependency>
<!-- jsoup HTML parser library @ https://jsoup.org/ -->
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.14.1</version>
</dependency>
<!-- log4j CSVV 취약점 대응버전으로 추가 Start -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.15.0</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.15.0</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
</dependency>
<!-- log4j CSVV 취약점 대응버전으로 추가 End -->
<!-- email setting -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-mail</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,45 @@
package com.loglog.api;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.Banner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.PropertySource;
import org.springframework.context.annotation.PropertySources;
import org.springframework.web.WebApplicationInitializer;
import com.loglog.api.commons.constants.Constants;
@SpringBootApplication
@ComponentScan(basePackages= {Constants.COMM_PACKAGE, Constants.BASE_PACKAGE})
@PropertySources({
@PropertySource(value = "classpath:application.properties", ignoreResourceNotFound = false)
})
@MapperScan(basePackages= {Constants.COMM_PACKAGE+".daos.mapper"})
public class LogLogAppApplication extends SpringBootServletInitializer implements WebApplicationInitializer {
public LogLogAppApplication() {
super();
//error org.springframework.boot.web.servlet.support.errorpagefilter 硫붿떆吏<EFBFBD> <EFBFBD><EFBFBD><EFBFBD>삤寃<EFBFBD> 泥섎
setRegisterErrorPageFilter(false);
}
public static void main(String[] args) {
SpringApplication app = new SpringApplication(LogLogAppApplication.class);
app.setBannerMode(Banner.Mode.OFF);
app.run(args);
}
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
return builder.sources(LogLogAppApplication.class);
}
}

View File

@ -0,0 +1,46 @@
package com.loglog.api.commons.beans;
/**
* 자동로그인 Bean
*
* @author PCH
*/
public class AutoLoginBean extends CommonBean {
/** 자동로그인 ID */
private String autoLoginId;
/** 회원구분코드 ( 1 : 사용자, 2 : 판매자, 3 : 관리자 ) */
private String memberTypeCd;
/** 회원ID */
private String memberId;
/** 세션ID*/
private String sessionId;
public String getAutoLoginId() {
return autoLoginId;
}
public void setAutoLoginId(String autoLoginId) {
this.autoLoginId = autoLoginId;
}
public String getMemberTypeCd() {
return memberTypeCd;
}
public void setMemberTypeCd(String memberTypeCd) {
this.memberTypeCd = memberTypeCd;
}
public String getMemberId() {
return memberId;
}
public void setMemberId(String memberId) {
this.memberId = memberId;
}
public String getSessionId() {
return sessionId;
}
public void setSessionId(String sessionId) {
this.sessionId = sessionId;
}
}

View File

@ -0,0 +1,176 @@
package com.loglog.api.commons.beans;
/**
* 게시판 신청 Bean
*
* @author SJW
* @since 2018.06.08
*/
public class BoardApplyBean extends CommonBean {
private static final long serialVersionUID = -3271644440516180579L;
private String bdTypeCd;
/** 신청번호 */
private int bdApplyNo;
/** Board 순번 */
private int bdNo;
/** UserId */
private String userId;
/** User레벨 */
private Integer userLevel;
/** 신청자 유져명 */
private String applyUserName;
/** 신청타입 */
private String applyType;
/** 신청명 */
private String applyName;
/** 신청자 핸드폰 */
private String applyHp;
/** 신청자 이메일 */
private String applyEmail;
/** 신청자 우편번호 */
private String applyZipcode;
/** 신청자 주소 */
private String applyAddr;
/** 신청자 상품타입 */
private String applyPrdType;
/** 추천인 정 */
private String applyRecommender;
/** 기타 신청내용 */
private String applyEtc;
/** 총게시물 수 */
private String contentCount;
/** 총 신청 수 */
private String applyCount;
/** 관리자 여부 */
private String adminYn;
public String getBdTypeCd() {
return bdTypeCd;
}
public void setBdTypeCd(String bdTypeCd) {
this.bdTypeCd = bdTypeCd;
}
public int getBdApplyNo() {
return bdApplyNo;
}
public void setBdApplyNo(int bdApplyNo) {
this.bdApplyNo = bdApplyNo;
}
public int getBdNo() {
return bdNo;
}
public void setBdNo(int bdNo) {
this.bdNo = bdNo;
}
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public Integer getUserLevel() {
return userLevel;
}
public void setUserLevel(Integer userLevel) {
this.userLevel = userLevel;
}
public String getApplyUserName() {
return applyUserName;
}
public void setApplyUserName(String applyUserName) {
this.applyUserName = applyUserName;
}
public String getApplyType() {
return applyType;
}
public void setApplyType(String applyType) {
this.applyType = applyType;
}
public String getApplyName() {
return applyName;
}
public void setApplyName(String applyName) {
this.applyName = applyName;
}
public String getApplyHp() {
return applyHp;
}
public void setApplyHp(String applyHp) {
this.applyHp = applyHp;
}
public String getApplyEmail() {
return applyEmail;
}
public void setApplyEmail(String applyEmail) {
this.applyEmail = applyEmail;
}
public String getApplyZipcode() {
return applyZipcode;
}
public void setApplyZipcode(String applyZipcode) {
this.applyZipcode = applyZipcode;
}
public String getApplyAddr() {
return applyAddr;
}
public void setApplyAddr(String applyAddr) {
this.applyAddr = applyAddr;
}
public String getApplyRecommender() {
return applyRecommender;
}
public void setApplyRecommender(String applyRecommender) {
this.applyRecommender = applyRecommender;
}
public String getApplyPrdType() {
return applyPrdType;
}
public void setApplyPrdType(String applyPrdType) {
this.applyPrdType = applyPrdType;
}
public String getApplyEtc() {
return applyEtc;
}
public void setApplyEtc(String applyEtc) {
this.applyEtc = applyEtc;
}
public String getContentCount() {
return contentCount;
}
public void setContentCount(String contentCount) {
this.contentCount = contentCount;
}
public String getApplyCount() {
return applyCount;
}
public void setApplyCount(String applyCount) {
this.applyCount = applyCount;
}
public String getAdminYn() {
return adminYn;
}
public void setAdminYn(String adminYn) {
this.adminYn = adminYn;
}
}

View File

@ -0,0 +1,288 @@
package com.loglog.api.commons.beans;
import java.util.List;
import org.springframework.web.multipart.MultipartFile;
public class BoardBean extends CommonBean {
private static final long serialVersionUID = 3326779846408868973L;
/** 순번*/
private int bdNo;
/** 게시판 유형 코드*/
private String bdTypeCd;
/** 공지사항여부*/
private String bdNoticeYn;
/** 비밀글여부*/
private String bdSecretYn;
/** 게시물 비밀번호 */
private String bdPass;
/** 카테고리 유형 코드*/
private String bdCategoryCd;
/** 제목*/
private String bdTitle;
/** 썸네일 이미지1 **/
private String bdThumbImg1;
/** 썸네일 이미지2 **/
private String bdThumbImg2;
/** 썸네일 업로드 파일 이미지1 **/
private MultipartFile bdThumbImgFile1;
/** 썸네일 업로드 이미지2 **/
private MultipartFile bdThumbImgFile2;
/** 이미지내용 */
private String bdImgCont;
/** 내용 */
private String bdCont;
/** 작성자ID */
private String bdWriterId;
/** 작성자 이름 */
private String bdWriterName;
/** 조회수*/
private int bdHit;
/** 답변여부*/
private String bdReplyYn;
/** 신청 가능여부*/
private String bdApplyYn;
/** 관리자 전용 게시판 여부(쓰기, 읽기) */
private String bdAdminYn;
/** 게시글 이미지 목록 조회 */
private List<BoardImgBean> boardImgList;
/** 게시글 파일 목록 조회 */
private List<BoardFileBean> boardFileList;
/** 답변 목록 */
private List<BoardReplyBean> replyList;
/** 게시글에 신청된 총 신청건수 */
private String totApplyCount;
/** 신청번호 */
private String bdApplyNo;
//2023-06-18
/* 게시글 이미지 */
private String[] imgPath;
/* 게시글 이미지 원본이름 */
private String[] imgOriginName;
/* 게시글 이미지 원본 사이즈 */
private String[] imgSize;
/* 게시글 파일 */
private String[] filePath;
/* 게시글 파일 원본이름 */
private String[] fileOriginName;
/* 게시글 파일 원본 사이즈 */
private String[] fileSize;
public MultipartFile getBdThumbImgFile1() {
return bdThumbImgFile1;
}
public void setBdThumbImgFile1(MultipartFile bdThumbImgFile1) {
this.bdThumbImgFile1 = bdThumbImgFile1;
}
public MultipartFile getBdThumbImgFile2() {
return bdThumbImgFile2;
}
public void setBdThumbImgFile2(MultipartFile bdThumbImgFile2) {
this.bdThumbImgFile2 = bdThumbImgFile2;
}
public String getBdThumbImg1() {
return bdThumbImg1;
}
public void setBdThumbImg1(String bdThumbImg1) {
this.bdThumbImg1 = bdThumbImg1;
}
public String getBdThumbImg2() {
return bdThumbImg2;
}
public void setBdThumbImg2(String bdThumbImg2) {
this.bdThumbImg2 = bdThumbImg2;
}
public int getBdNo() {
return bdNo;
}
public void setBdNo(int bdNo) {
this.bdNo = bdNo;
}
public String getBdTypeCd() {
return bdTypeCd;
}
public void setBdTypeCd(String bdTypeCd) {
this.bdTypeCd = bdTypeCd;
}
public String getBdNoticeYn() {
return bdNoticeYn;
}
public void setBdNoticeYn(String bdNoticeYn) {
this.bdNoticeYn = bdNoticeYn;
}
public String getBdSecretYn() {
return bdSecretYn;
}
public void setBdSecretYn(String bdSecretYn) {
this.bdSecretYn = bdSecretYn;
}
public String getBdPass() {
return bdPass;
}
public void setBdPass(String bdPass) {
this.bdPass = bdPass;
}
public String getBdCategoryCd() {
return bdCategoryCd;
}
public void setBdCategoryCd(String bdCategoryCd) {
this.bdCategoryCd = bdCategoryCd;
}
public String getBdTitle() {
return bdTitle;
}
public void setBdTitle(String bdTitle) {
this.bdTitle = bdTitle;
}
public String getBdCont() {
return bdCont;
}
public void setBdCont(String bdCont) {
this.bdCont = bdCont;
}
public String getBdWriterId() {
return bdWriterId;
}
public void setBdWriterId(String bdWriterId) {
this.bdWriterId = bdWriterId;
}
public String getBdWriterName() {
return bdWriterName;
}
public void setBdWriterName(String bdWriterName) {
this.bdWriterName = bdWriterName;
}
public int getBdHit() {
return bdHit;
}
public void setBdHit(int bdHit) {
this.bdHit = bdHit;
}
public String getBdReplyYn() {
return bdReplyYn;
}
public void setBdReplyYn(String bdReplyYn) {
this.bdReplyYn = bdReplyYn;
}
public String getBdApplyYn() {
return bdApplyYn;
}
public void setBdApplyYn(String bdApplyYn) {
this.bdApplyYn = bdApplyYn;
}
public List<BoardImgBean> getBoardImgList() {
return boardImgList;
}
public void setBoardImgList(List<BoardImgBean> boardImgList) {
this.boardImgList = boardImgList;
}
public List<BoardFileBean> getBoardFileList() {
return boardFileList;
}
public void setBoardFileList(List<BoardFileBean> boardFileList) {
this.boardFileList = boardFileList;
}
public List<BoardReplyBean> getReplyList() {
return replyList;
}
public void setReplyList(List<BoardReplyBean> replyList) {
this.replyList = replyList;
}
public String getBdImgCont() {
return bdImgCont;
}
public void setBdImgCont(String bdImgCont) {
this.bdImgCont = bdImgCont;
}
public String getTotApplyCount() {
return totApplyCount;
}
public void setTotApplyCount(String totApplyCount) {
this.totApplyCount = totApplyCount;
}
public String getBdApplyNo() {
return bdApplyNo;
}
public void setBdApplyNo(String bdApplyNo) {
this.bdApplyNo = bdApplyNo;
}
public String getBdAdminYn() {
return bdAdminYn;
}
public void setBdAdminYn(String bdAdminYn) {
this.bdAdminYn = bdAdminYn;
}
public String[] getImgPath() {
return imgPath;
}
public void setImgPath(String[] imgPath) {
this.imgPath = imgPath;
}
public String[] getImgOriginName() {
return imgOriginName;
}
public void setImgOriginName(String[] imgOriginName) {
this.imgOriginName = imgOriginName;
}
public String[] getImgSize() {
return imgSize;
}
public void setImgSize(String[] imgSize) {
this.imgSize = imgSize;
}
public String[] getFilePath() {
return filePath;
}
public void setFilePath(String[] filePath) {
this.filePath = filePath;
}
public String[] getFileOriginName() {
return fileOriginName;
}
public void setFileOriginName(String[] fileOriginName) {
this.fileOriginName = fileOriginName;
}
public String[] getFileSize() {
return fileSize;
}
public void setFileSize(String[] fileSize) {
this.fileSize = fileSize;
}
public static long getSerialversionuid() {
return serialVersionUID;
}
}

View File

@ -0,0 +1,65 @@
package com.loglog.api.commons.beans;
public class BoardFileBean extends CommonBean {
/** 게시판 파일 */
private String bdFileNo;
/** 게시판번호 */
private int bdNo;
/** 파일 경로 */
private String filePath;
/** 파일 원본이름 */
private String fileOriginName;
/** 파일 크기 */
private String fileSize;
/** 예약번호 */
private int reserveNo;
/** 교육신청번호 */
private int eduNo;
public int getReserveNo() {
return reserveNo;
}
public void setReserveNo(int reserveNo) {
this.reserveNo = reserveNo;
}
public int getEduNo() {
return eduNo;
}
public void setEduNo(int eduNo) {
this.eduNo = eduNo;
}
public String getFileSize() {
return fileSize;
}
public void setFileSize(String fileSize) {
this.fileSize = fileSize;
}
public String getBdFileNo() {
return bdFileNo;
}
public void setBdFileNo(String bdFileNo) {
this.bdFileNo = bdFileNo;
}
public int getBdNo() {
return bdNo;
}
public void setBdNo(int bdNo) {
this.bdNo = bdNo;
}
public String getFilePath() {
return filePath;
}
public void setFilePath(String filePath) {
this.filePath = filePath;
}
public String getFileOriginName() {
return fileOriginName;
}
public void setFileOriginName(String fileOriginName) {
this.fileOriginName = fileOriginName;
}
}

View File

@ -0,0 +1,102 @@
package com.loglog.api.commons.beans;
/**
* 게시판 이미지 Bean
* @author "PCH"
*
*/
public class BoardImgBean extends CommonBean {
/** 게시판이미지 */
private String bdImgNo;
/** 게시글번호 */
private int bdNo;
/** 이미지경로 */
private String imgPath;
/** 이미지 원본이름 */
private String imgOriginName;
/** 이미지크기 */
private String imgSize;
/** 예약번호 */
private int reserveNo;
/** 교육신청번호 */
private int eduNo;
/** 썸네일 1 */
private String thumbImg1;
/** 썸네일 2 */
private String thumbImg2;
/** 썸네일1 원본이름 */
private String imgOriginNameThumb;
/** 썸네일1 이미지크기*/
private String imgSizeThumb;
public String getImgOriginNameThumb() {
return imgOriginNameThumb;
}
public void setImgOriginNameThumb(String imgOriginNameThumb) {
this.imgOriginNameThumb = imgOriginNameThumb;
}
public String getImgSizeThumb() {
return imgSizeThumb;
}
public void setImgSizeThumb(String imgSizeThumb) {
this.imgSizeThumb = imgSizeThumb;
}
public String getThumbImg1() {
return thumbImg1;
}
public void setThumbImg1(String thumbImg1) {
this.thumbImg1 = thumbImg1;
}
public String getThumbImg2() {
return thumbImg2;
}
public void setThumbImg2(String thumbImg2) {
this.thumbImg2 = thumbImg2;
}
public int getReserveNo() {
return reserveNo;
}
public void setReserveNo(int reserveNo) {
this.reserveNo = reserveNo;
}
public int getEduNo() {
return eduNo;
}
public void setEduNo(int eduNo) {
this.eduNo = eduNo;
}
public String getBdImgNo() {
return bdImgNo;
}
public void setBdImgNo(String bdImgNo) {
this.bdImgNo = bdImgNo;
}
public int getBdNo() {
return bdNo;
}
public void setBdNo(int bdNo) {
this.bdNo = bdNo;
}
public String getImgPath() {
return imgPath;
}
public void setImgPath(String imgPath) {
this.imgPath = imgPath;
}
public String getImgOriginName() {
return imgOriginName;
}
public void setImgOriginName(String imgOriginName) {
this.imgOriginName = imgOriginName;
}
public String getImgSize() {
return imgSize;
}
public void setImgSize(String imgSize) {
this.imgSize = imgSize;
}
}

View File

@ -0,0 +1,82 @@
package com.loglog.api.commons.beans;
import java.util.List;
public class BoardReplyBean extends CommonBean {
/** 댓글번호 */
private String replyNo;
/** 부모글번호 */
private int bdNo;
/** 내용 */
private String replyCont;
/** 작성자ID */
private String replyWriterId;
/** 작성자이름 */
private String replyWriterName;
/** 작성자 Level */
private int replyWriterLevel;
/** 작성자이름 */
private String secretYn;
/** 댓글 비밀번호 */
private String replyPass;
/** 관리자여부 */
private String adminYn;
private List<BoardReplyBean> boardreplyList;
public String getReplyNo() {
return replyNo;
}
public void setReplyNo(String replyNo) {
this.replyNo = replyNo;
}
public int getBdNo() {
return bdNo;
}
public void setBdNo(int bdNo) {
this.bdNo = bdNo;
}
public String getReplyCont() {
return replyCont;
}
public void setReplyCont(String replyCont) {
this.replyCont = replyCont;
}
public String getReplyWriterId() {
return replyWriterId;
}
public void setReplyWriterId(String replyWriterId) {
this.replyWriterId = replyWriterId;
}
public String getReplyWriterName() {
return replyWriterName;
}
public void setReplyWriterName(String replyWriterName) {
this.replyWriterName = replyWriterName;
}
public String getSecretYn() {
return secretYn;
}
public void setSecretYn(String secretYn) {
this.secretYn = secretYn;
}
public int getReplyWriterLevel() {
return replyWriterLevel;
}
public void setReplyWriterLevel(int replyWriterLevel) {
this.replyWriterLevel = replyWriterLevel;
}
public String getReplyPass() {
return replyPass;
}
public void setReplyPass(String replyPass) {
this.replyPass = replyPass;
}
public String getAdminYn() {
return adminYn;
}
public void setAdminYn(String adminYn) {
this.adminYn = adminYn;
}
}

View File

@ -0,0 +1,287 @@
package com.loglog.api.commons.beans;
/**
* 사용자 Bean
* 내점기록에 사용될 Bean trn0012가 메인이다
* @author SJG
*/
public class CalenderBean extends CommonBean {
/** 입력코드*/
private String insuserCd;
/** 저장시간*/
private String insdatetime;
/** 업데이트 코드*/
private String upduserCd;
/** 업데이트 시간*/
private String updatetime;
/** 사용자코드*/
private String userCd;
/** 상점 코드*/
private String shopCd;
/** 상점이름*/
private String shopNm;
/** 내점시간 */
private String raitenTime;
/** 내점시간변경 */
private String raitenChange;
/**메모 변경*/
private String nikkiTitleChange;
/** 메모 제목*/
private String nikkiTitle;
/** 메모 내용*/
private String nikkiText;
/** 썸네일1*/
private String thumbnail1;
/** 썸네일2*/
private String thumbnail2;
/** 썸네일2*/
private String thumbnail3;
/** 협업 카테고리*/
private String connectKbn;
/** 협업 카테고리*/
private String url;
/** 협업 카테고리*/
private String location;
/** 협업 카테고리*/
private String endRaitenTime;
/** 협업 카테고리*/
private String color;
/** 협업 카테고리*/
private String allday;
/** 월별조회 */
private String inputMon;
/** 월별조회 */
private String startMon;
/** 월별조회 */
private String endMon;
/** 업데이트 안한 이미지 URL 리스트 */
private String noteUpdatedImgUrlList;
public String getInsuserCd() {
return insuserCd;
}
public void setInsuserCd(String insuserCd) {
this.insuserCd = insuserCd;
}
public String getInsdatetime() {
return insdatetime;
}
public void setInsdatetime(String insdatetime) {
this.insdatetime = insdatetime;
}
public String getUpduserCd() {
return upduserCd;
}
public void setUpduserCd(String upduserCd) {
this.upduserCd = upduserCd;
}
public String getUpdatetime() {
return updatetime;
}
public void setUpdatetime(String updatetime) {
this.updatetime = updatetime;
}
public String getUserCd() {
return userCd;
}
public void setUserCd(String userCd) {
this.userCd = userCd;
}
public String getShopCd() {
return shopCd;
}
public void setShopCd(String shopCd) {
this.shopCd = shopCd;
}
public String getShopNm() {
return shopNm;
}
public void setShopNm(String shopNm) {
this.shopNm = shopNm;
}
public String getRaitenTime() {
return raitenTime;
}
public void setRaitenTime(String raitenTime) {
this.raitenTime = raitenTime;
}
public String getRaitenChange() {
return raitenChange;
}
public void setRaitenChange(String raitenChange) {
this.raitenChange = raitenChange;
}
public String getNikkiTitle() {
return nikkiTitle;
}
public void setNikkiTitle(String nikkiTitle) {
this.nikkiTitle = nikkiTitle;
}
public String getNikkiText() {
return nikkiText;
}
public void setNikkiText(String nikkiText) {
this.nikkiText = nikkiText;
}
public String getThumbnail1() {
return thumbnail1;
}
public void setThumbnail1(String thumbnail1) {
this.thumbnail1 = thumbnail1;
}
public String getThumbnail2() {
return thumbnail2;
}
public void setThumbnail2(String thumbnail2) {
this.thumbnail2 = thumbnail2;
}
public String getThumbnail3() {
return thumbnail3;
}
public void setThumbnail3(String thumbnail3) {
this.thumbnail3 = thumbnail3;
}
public String getConnectKbn() {
return connectKbn;
}
public void setConnectKbn(String connectKbn) {
this.connectKbn = connectKbn;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getLocation() {
return location;
}
public void setLocation(String location) {
this.location = location;
}
public String getEndRaitenTime() {
return endRaitenTime;
}
public void setEndRaitenTime(String endRaitenTime) {
this.endRaitenTime = endRaitenTime;
}
public String getColor() {
return color;
}
public void setColor(String color) {
this.color = color;
}
public String getAllday() {
return allday;
}
public void setAllday(String allday) {
this.allday = allday;
}
public String getInputMon() {
return inputMon;
}
public void setInputMon(String inputMon) {
this.inputMon = inputMon;
}
public String getStartMon() {
return startMon;
}
public void setStartMon(String startMon) {
this.startMon = startMon;
}
public String getEndMon() {
return endMon;
}
public void setEndMon(String endMon) {
this.endMon = endMon;
}
private String getNikkiTitleChange() {
return nikkiTitleChange;
}
private void setNikkiTitleChange(String nikkiTitleChange) {
this.nikkiTitleChange = nikkiTitleChange;
}
public String getNoteUpdatedImgUrlList() {
return noteUpdatedImgUrlList;
}
public void setNoteUpdatedImgUrlList(String noteUpdatedImgUrlList) {
this.noteUpdatedImgUrlList = noteUpdatedImgUrlList;
}
}

View File

@ -0,0 +1,62 @@
package com.loglog.api.commons.beans;
/**
* 공지사항 Bean
* mst0017를 참조하는 Bean
* @author "JIK"
*
*/
public class CardImgBean {
/** 이미지경로 */
private String imgPath;
/** 이미지 원본이름 */
private String imgOriginName;
/** 이미지크기 */
private String imgSize;
/** 썸네일 1 */
private String thumbImg1;
/** 썸네일1 원본이름 */
private String imgOriginNameThumb;
/** 썸네일1 이미지크기*/
private String imgSizeThumb;
public String getImgPath() {
return imgPath;
}
public void setImgPath(String imgPath) {
this.imgPath = imgPath;
}
public String getImgOriginName() {
return imgOriginName;
}
public void setImgOriginName(String imgOriginName) {
this.imgOriginName = imgOriginName;
}
public String getImgSize() {
return imgSize;
}
public void setImgSize(String imgSize) {
this.imgSize = imgSize;
}
public String getThumbImg1() {
return thumbImg1;
}
public void setThumbImg1(String thumbImg1) {
this.thumbImg1 = thumbImg1;
}
public String getImgOriginNameThumb() {
return imgOriginNameThumb;
}
public void setImgOriginNameThumb(String imgOriginNameThumb) {
this.imgOriginNameThumb = imgOriginNameThumb;
}
public String getImgSizeThumb() {
return imgSizeThumb;
}
public void setImgSizeThumb(String imgSizeThumb) {
this.imgSizeThumb = imgSizeThumb;
}
}

View File

@ -0,0 +1,236 @@
package com.loglog.api.commons.beans;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;
/**
* 공지사항 Bean
* mst0017를 참조하는 Bean
* @author "JIK"
*
*/
public class CardMasterBean extends CommonBean {
/** 유저코드 */
private String userCd;
/** 코드업데이트 */
private String upduserCd;
/** 최종 갱신일 */
private String upDate;
/** 업데이트시간 */
private String updatetime;
/** 상점그룹코드 */
private String shopGroupCd;
/** 상점 코드 */
private String shopCd;
/** 현재포인트 */
private int nowPoint;
/** 메일주소2 */
private String mailAddr2;
/** 메일주소 */
private String mailAddr;
/** */
private String janNo;
/** 입력코드 */
private String insuserCd;
/** 최종내점일 */
private String eDate;
/** 좋아요 유무 */
private String custCd;
/** 카드이름 */
private String cardNm;
/** 카드이미지 */
private String cardImage;
/** 바코드번호 */
private String barcodeKbn;
/** 바꿀 카드이름 */
private String chanCardNm;
/** 바꿀 카드번호 */
private String chanJanNo;
/** 추가되는 포인트값 */
private int point;
/**상점 이름*/
private String shopNm;
public String getUserCd() {
return userCd;
}
public void setUserCd(String userCd) {
this.userCd = userCd;
}
public String getUpduserCd() {
return upduserCd;
}
public void setUpduserCd(String upduserCd) {
this.upduserCd = upduserCd;
}
public String getUpDate() {
return upDate;
}
public void setUpDate(String upDate) {
this.upDate = upDate;
}
public String getUpdatetime() {
return updatetime;
}
public void setUpdatetime(String updatetime) {
this.updatetime = updatetime;
}
public String getShopGroupCd() {
return shopGroupCd;
}
public void setShopGroupCd(String shopGroupCd) {
this.shopGroupCd = shopGroupCd;
}
public String getShopCd() {
return shopCd;
}
public void setShopCd(String shopCd) {
this.shopCd = shopCd;
}
public int getNowPoint() {
return nowPoint;
}
public void setNowPoint(int nowPoint) {
this.nowPoint = nowPoint;
}
public String getMailAddr2() {
return mailAddr2;
}
public void setMailAddr2(String mailAddr2) {
this.mailAddr2 = mailAddr2;
}
public String getMailAddr() {
return mailAddr;
}
public void setMailAddr(String mailAddr) {
this.mailAddr = mailAddr;
}
public String getJanNo() {
return janNo;
}
public void setJanNo(String janNo) {
this.janNo = janNo;
}
public String getInsuserCd() {
return insuserCd;
}
public void setInsuserCd(String insuserCd) {
this.insuserCd = insuserCd;
}
public String geteDate() {
return eDate;
}
public void seteDate(String eDate) {
this.eDate = eDate;
}
public String getCustCd() {
return custCd;
}
public void setCustCd(String custCd) {
this.custCd = custCd;
}
public String getCardNm() {
return cardNm;
}
public void setCardNm(String cardNm) {
this.cardNm = cardNm;
}
public String getCardImage() {
return cardImage;
}
public void setCardImage(String cardImage) {
this.cardImage = cardImage;
}
public String getBarcodeKbn() {
return barcodeKbn;
}
public void setBarcodeKbn(String barcodeKbn) {
this.barcodeKbn = barcodeKbn;
}
public String getChanCardNm() {
return chanCardNm;
}
public void setChanCardNm(String chanCardNm) {
this.chanCardNm = chanCardNm;
}
public String getChanJanNo() {
return chanJanNo;
}
public void setChanJanNo(String chanJanNo) {
this.chanJanNo = chanJanNo;
}
public int getPoint() {
return point;
}
public void setPoint(int point) {
this.point = point;
}
public String getShopNm() {
return shopNm;
}
public void setShopNm(String shopNm) {
this.shopNm = shopNm;
}
}

View File

@ -0,0 +1,45 @@
package com.loglog.api.commons.beans;
/**
* 사용자 Bean
* 내점기록에 사용될 Bean trn0012가 메인이다
* @author SJG
*/
public class CategoryBean extends CommonBean {
/**카테고리 코드*/
private String categoryCd;
/**카테고리 이름*/
private String categoryNm;
/**카테고리 이미지*/
private String categoryImg;
public String getCategoryCd() {
return categoryCd;
}
public void setCategoryCd(String categoryCd) {
this.categoryCd = categoryCd;
}
public String getCategoryNm() {
return categoryNm;
}
public void setCategoryNm(String categoryNm) {
this.categoryNm = categoryNm;
}
public String getCategoryImg() {
return categoryImg;
}
public void setCategoryImg(String categoryImg) {
this.categoryImg = categoryImg;
}
}

View File

@ -0,0 +1,64 @@
package com.loglog.api.commons.beans;
import java.io.Serializable;
/**
* 공통 Bean
*
* @author SJG
*/
public class CommonBean implements Serializable {
/** 토큰 **/
private String authToken;
/** 생성날짜 **/
private String regDt;
/** 수정날짜 **/
private String updDt;
/** 로그인 후 이동할 URL */
private String resultUrl;
/** BASE Img URL */
private String baseImgUrl;
/** BASE Img URL2 */
private String baseImgUrl2;
public String getAuthToken() {
return authToken;
}
public void setAuthToken(String authToken) {
this.authToken = authToken;
}
public String getRegDt() {
return regDt;
}
public void setRegDt(String regDt) {
this.regDt = regDt;
}
public String getUpdDt() {
return updDt;
}
public void setUpdDt(String updDt) {
this.updDt = updDt;
}
public String getResultUrl() {
return resultUrl;
}
public void setResultUrl(String resultUrl) {
this.resultUrl = resultUrl;
}
public String getBaseImgUrl() {
return baseImgUrl;
}
public void setBaseImgUrl(String baseImgUrl) {
this.baseImgUrl = baseImgUrl;
}
public String getBaseImgUrl2() {
return baseImgUrl2;
}
public void setBaseImgUrl2(String baseImgUrl2) {
this.baseImgUrl2 = baseImgUrl2;
}
}

View File

@ -0,0 +1,34 @@
package com.loglog.api.commons.beans;
/**
* 사용자 Bean
*
* @author SJG
*/
public class CouponLikedBean extends CommonBean {
private static final long serialVersionUID = -8015604660465562829L;
/** 고유 쿠폰번호 */
private int uniqueCouponCd;
/** 사용자번호 */
private String userCd;
public int getUniqueCouponCd() {
return uniqueCouponCd;
}
public void setUniqueCouponCd(int uniqueCouponCd) {
this.uniqueCouponCd = uniqueCouponCd;
}
public String getUserCd() {
return userCd;
}
public void setUserCd(String userCd) {
this.userCd = userCd;
}
}

View File

@ -0,0 +1,254 @@
package com.loglog.api.commons.beans;
/**
* 사용자 Bean
*
* @author SJG
*/
public class CouponMasterBean extends CommonBean {
private static final long serialVersionUID = -8015604660465562829L;
/** 등록 된 코드 */
private String insuserCd;
/** 코드 업데이트 */
private String upduserCd;
/** 저장 코드 */
private String shopCd;
/** 쿠폰 코드 */
private String couponCd;
/** 상품명 */
private String couponGoods;
/** 만료일 (시작) */
private String effectSrt;
/** 만료일 (종료) */
private String effectEnd;
/** 할인 가격 */
private String couponDiscount;
/** 썸네일 사진 1 */
private String thumbnail1;
/** 썸네일 사진 2 */
private String thumbnail2;
/** 썸네일 사진 3 */
private String thumbnail3;
/** 사용자 코드 */
private String userCd;
/** 협업 카테고리 */
private String connectKbn;
/** 사용 된 카테고리 */
private String used;
/** 배경 */
private String background;
/** 색상 */
private String color;
/** 지사 */
private String prefecture;
/** 나이 */
private String age;
/** 성별 */
private String gender;
/** 생일 */
private String birthday;
/** 랭킹 */
private String rank;
/** 내점조건 */
private String visitCondition;
public String getInsuserCd() {
return insuserCd;
}
public void setInsuserCd(String insuserCd) {
this.insuserCd = insuserCd;
}
public String getUpduserCd() {
return upduserCd;
}
public void setUpduserCd(String upduserCd) {
this.upduserCd = upduserCd;
}
public String getShopCd() {
return shopCd;
}
public void setShopCd(String shopCd) {
this.shopCd = shopCd;
}
public String getCouponCd() {
return couponCd;
}
public void setCouponCd(String couponCd) {
this.couponCd = couponCd;
}
public String getCouponGoods() {
return couponGoods;
}
public void setCouponGoods(String couponGoods) {
this.couponGoods = couponGoods;
}
public String getEffectSrt() {
return effectSrt;
}
public void setEffectSrt(String effectSrt) {
this.effectSrt = effectSrt;
}
public String getEffectEnd() {
return effectEnd;
}
public void setEffectEnd(String effectEnd) {
this.effectEnd = effectEnd;
}
public String getCouponDiscount() {
return couponDiscount;
}
public void setCouponDiscount(String couponDiscount) {
this.couponDiscount = couponDiscount;
}
public String getThumbnail1() {
return thumbnail1;
}
public void setThumbnail1(String thumbnail1) {
this.thumbnail1 = thumbnail1;
}
public String getThumbnail2() {
return thumbnail2;
}
public void setThumbnail2(String thumbnail2) {
this.thumbnail2 = thumbnail2;
}
public String getThumbnail3() {
return thumbnail3;
}
public void setThumbnail3(String thumbnail3) {
this.thumbnail3 = thumbnail3;
}
public String getUserCd() {
return userCd;
}
public void setUserCd(String userCd) {
this.userCd = userCd;
}
public String getConnectKbn() {
return connectKbn;
}
public void setConnectKbn(String connectKbn) {
this.connectKbn = connectKbn;
}
public String getUsed() {
return used;
}
public void setUsed(String used) {
this.used = used;
}
public String getBackground() {
return background;
}
public void setBackground(String background) {
this.background = background;
}
public String getColor() {
return color;
}
public void setColor(String color) {
this.color = color;
}
public String getPrefecture() {
return prefecture;
}
public void setPrefecture(String prefecture) {
this.prefecture = prefecture;
}
public String getAge() {
return age;
}
public void setAge(String age) {
this.age = age;
}
public String getGender() {
return gender;
}
public void setGender(String gender) {
this.gender = gender;
}
public String getBirthday() {
return birthday;
}
public void setBirthday(String birthday) {
this.birthday = birthday;
}
public String getRank() {
return rank;
}
public void setRank(String rank) {
this.rank = rank;
}
public String getVisitCondition() {
return visitCondition;
}
public void setVisitCondition(String visitCondition) {
this.visitCondition = visitCondition;
}
}

View File

@ -0,0 +1,452 @@
package com.loglog.api.commons.beans;
/**
* 사용자 Bean
*
* @author SJG
*/
public class CouponPublicBean extends CommonBean {
private static final long serialVersionUID = -8015604660465562829L;
/**유저 코드*/
private String userCd;
/**쿠폰 조회 타입*/
private String type;
/** 쿠폰 코드 */
private int uniqueCouponCd;
/**매장 코드*/
private String shopCd;
/**만료일 (시작)*/
private String effectSrt;
/**만료일 (종료)*/
private String effectEnd;
/**쿠폰이름*/
private String couponGoods;
/**쿠폰내용*/
private String couponDiscount;
/**상점이미지*/
private String shopimage;
/**썸네일 사진 1*/
private String thumbnail1;
/**썸네일 사진 2*/
private String thumbnail2;
/**썸네일 사진 3*/
private String thumbnail3;
/**???*/
private String connectKbn;
/**카테고리코드*/
private String categoryCd;
/**배경색*/
private String background;
/**색코드*/
private String color;
/**지사*/
private String prefecture;
/**나이*/
private String age;
/**성별*/
private String gender;
/**생일*/
private String birthday;
/**랭킹*/
private String rank;
/**내점 조건*/
private String visitCondition;
/**쿠폰 코드*/
private int couponCd;
/**지방 자치 단체*/
private String municipality;
/** 가게의 날*/
private String visitWithin;
/**내점 유무*/
private String visitOrNot;
/**배포된 쿠폰 코드*/
private String sentCouponCd;
/**배포된 쿠폰 상태*/
private String sentCouponStatus;
/**타점 이용 점포 코드 1*/
private String shopCd1;
/**타점 이용 점포 코드 2*/
private String shopCd2;
/**타점 이용 점포 코드 3*/
private String shopCd3;
/**타점 이용 점포 코드 4*/
private String shopCd4;
/**타점 이용 점포 코드 5*/
private String shopCd5;
/**타점 이용 점포 코드 6*/
private String shopCd6;
/**타점 이용 점포 코드 7*/
private String shopCd7;
/**타점 이용 점포 코드 8*/
private String shopCd8;
/**타점 이용 점포 코드 9*/
private String shopCd9;
/**타점 이용 점포 코드 10*/
private String shopCd10;
/**유료 맴버*/
private int paidMember;
/**좋아요 유무*/
private int liked;
public String getUserCd() {
return userCd;
}
public void setUserCd(String userCd) {
this.userCd = userCd;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public int getUniqueCouponCd() {
return uniqueCouponCd;
}
public void setUniqueCouponCd(int uniqueCouponCd) {
this.uniqueCouponCd = uniqueCouponCd;
}
public String getShopCd() {
return shopCd;
}
public void setShopCd(String shopCd) {
this.shopCd = shopCd;
}
public String getEffectSrt() {
return effectSrt;
}
public void setEffectSrt(String effectSrt) {
this.effectSrt = effectSrt;
}
public String getEffectEnd() {
return effectEnd;
}
public void setEffectEnd(String effectEnd) {
this.effectEnd = effectEnd;
}
public String getCouponGoods() {
return couponGoods;
}
public void setCouponGoods(String couponGoods) {
this.couponGoods = couponGoods;
}
public String getCouponDiscount() {
return couponDiscount;
}
public void setCouponDiscount(String couponDiscount) {
this.couponDiscount = couponDiscount;
}
public String getShopimage() {
return shopimage;
}
public void setShopimage(String shopimage) {
this.shopimage = shopimage;
}
public String getThumbnail1() {
return thumbnail1;
}
public void setThumbnail1(String thumbnail1) {
this.thumbnail1 = thumbnail1;
}
public String getThumbnail2() {
return thumbnail2;
}
public void setThumbnail2(String thumbnail2) {
this.thumbnail2 = thumbnail2;
}
public String getThumbnail3() {
return thumbnail3;
}
public void setThumbnail3(String thumbnail3) {
this.thumbnail3 = thumbnail3;
}
public String getConnectKbn() {
return connectKbn;
}
public void setConnectKbn(String connectKbn) {
this.connectKbn = connectKbn;
}
public String getCategoryCd() {
return categoryCd;
}
public void setCategoryCd(String categoryCd) {
this.categoryCd = categoryCd;
}
public String getBackground() {
return background;
}
public void setBackground(String background) {
this.background = background;
}
public String getColor() {
return color;
}
public void setColor(String color) {
this.color = color;
}
public String getPrefecture() {
return prefecture;
}
public void setPrefecture(String prefecture) {
this.prefecture = prefecture;
}
public String getAge() {
return age;
}
public void setAge(String age) {
this.age = age;
}
public String getGender() {
return gender;
}
public void setGender(String gender) {
this.gender = gender;
}
public String getBirthday() {
return birthday;
}
public void setBirthday(String birthday) {
this.birthday = birthday;
}
public String getRank() {
return rank;
}
public void setRank(String rank) {
this.rank = rank;
}
public String getVisitCondition() {
return visitCondition;
}
public void setVisitCondition(String visitCondition) {
this.visitCondition = visitCondition;
}
public int getCouponCd() {
return couponCd;
}
public void setCouponCd(int couponCd) {
this.couponCd = couponCd;
}
public String getMunicipality() {
return municipality;
}
public void setMunicipality(String municipality) {
this.municipality = municipality;
}
public String getVisitWithin() {
return visitWithin;
}
public void setVisitWithin(String visitWithin) {
this.visitWithin = visitWithin;
}
public String getVisitOrNot() {
return visitOrNot;
}
public void setVisitOrNot(String visitOrNot) {
this.visitOrNot = visitOrNot;
}
public String getSentCouponCd() {
return sentCouponCd;
}
public void setSentCouponCd(String sentCouponCd) {
this.sentCouponCd = sentCouponCd;
}
public String getSentCouponStatus() {
return sentCouponStatus;
}
public void setSentCouponStatus(String sentCouponStatus) {
this.sentCouponStatus = sentCouponStatus;
}
public String getShopCd1() {
return shopCd1;
}
public void setShopCd1(String shopCd1) {
this.shopCd1 = shopCd1;
}
public String getShopCd2() {
return shopCd2;
}
public void setShopCd2(String shopCd2) {
this.shopCd2 = shopCd2;
}
public String getShopCd3() {
return shopCd3;
}
public void setShopCd3(String shopCd3) {
this.shopCd3 = shopCd3;
}
public String getShopCd4() {
return shopCd4;
}
public void setShopCd4(String shopCd4) {
this.shopCd4 = shopCd4;
}
public String getShopCd5() {
return shopCd5;
}
public void setShopCd5(String shopCd5) {
this.shopCd5 = shopCd5;
}
public String getShopCd6() {
return shopCd6;
}
public void setShopCd6(String shopCd6) {
this.shopCd6 = shopCd6;
}
public String getShopCd7() {
return shopCd7;
}
public void setShopCd7(String shopCd7) {
this.shopCd7 = shopCd7;
}
public String getShopCd8() {
return shopCd8;
}
public void setShopCd8(String shopCd8) {
this.shopCd8 = shopCd8;
}
public String getShopCd9() {
return shopCd9;
}
public void setShopCd9(String shopCd9) {
this.shopCd9 = shopCd9;
}
public String getShopCd10() {
return shopCd10;
}
public void setShopCd10(String shopCd10) {
this.shopCd10 = shopCd10;
}
public int getPaidMember() {
return paidMember;
}
public void setPaidMember(int paidMember) {
this.paidMember = paidMember;
}
public int getLiked() {
return liked;
}
public void setLiked(int liked) {
this.liked = liked;
}
}

View File

@ -0,0 +1,23 @@
package com.loglog.api.commons.beans;
/**
* 사용자 Bean
*
* @author SJG
*/
public class CouponUsedBean extends CommonBean {
private static final long serialVersionUID = -8015604660465562829L;
/** 고유 쿠폰번호 */
private int unique_coupon_cd;
/** 사용자번호 */
private String user_cd;
/** 사용여부 */
private int used;
/** ?? */
private String seen;
}

View File

@ -0,0 +1,166 @@
package com.loglog.api.commons.beans;
/**
* 사용자 Bean
* getCouponAjax를 받기위한 Bean
* @author SJG
*/
public class CouponUserListBean extends CommonBean {
private String shopCd;
private String shopAdd1;
private String shopAdd2;
private String couponCd;
private String shopNm;
private String categoryCd;
private String couponGoods;
private String effectSrt;
private String effectEnd;
private String couponDiscount;
private String shopimage;
private String thumbnail1;
private String thumbnail2;
private String thumbnail3;
private String connectKbn;
private String used;
private String color;
private String visitCondition;
private String proximity;
private String liked;
private String shopThumbNail1;
private String couponThumbnail1;
public String getShopCd() {
return shopCd;
}
public void setShopCd(String shopCd) {
this.shopCd = shopCd;
}
public String getShopAdd1() {
return shopAdd1;
}
public void setShopAdd1(String shopAdd1) {
this.shopAdd1 = shopAdd1;
}
public String getShopAdd2() {
return shopAdd2;
}
public void setShopAdd2(String shopAdd2) {
this.shopAdd2 = shopAdd2;
}
public String getCouponCd() {
return couponCd;
}
public void setCouponCd(String couponCd) {
this.couponCd = couponCd;
}
public String getShopNm() {
return shopNm;
}
public void setShopNm(String shopNm) {
this.shopNm = shopNm;
}
public String getCategoryCd() {
return categoryCd;
}
public void setCategoryCd(String categoryCd) {
this.categoryCd = categoryCd;
}
public String getCouponGoods() {
return couponGoods;
}
public void setCouponGoods(String couponGoods) {
this.couponGoods = couponGoods;
}
public String getEffectSrt() {
return effectSrt;
}
public void setEffectSrt(String effectSrt) {
this.effectSrt = effectSrt;
}
public String getEffectEnd() {
return effectEnd;
}
public void setEffectEnd(String effectEnd) {
this.effectEnd = effectEnd;
}
public String getCouponDiscount() {
return couponDiscount;
}
public void setCouponDiscount(String couponDiscount) {
this.couponDiscount = couponDiscount;
}
public String getShopimage() {
return shopimage;
}
public void setShopimage(String shopimage) {
this.shopimage = shopimage;
}
public String getThumbnail1() {
return thumbnail1;
}
public void setThumbnail1(String thumbnail1) {
this.thumbnail1 = thumbnail1;
}
public String getThumbnail2() {
return thumbnail2;
}
public void setThumbnail2(String thumbnail2) {
this.thumbnail2 = thumbnail2;
}
public String getThumbnail3() {
return thumbnail3;
}
public void setThumbnail3(String thumbnail3) {
this.thumbnail3 = thumbnail3;
}
public String getConnectKbn() {
return connectKbn;
}
public void setConnectKbn(String connectKbn) {
this.connectKbn = connectKbn;
}
public String getUsed() {
return used;
}
public void setUsed(String used) {
this.used = used;
}
public String getColor() {
return color;
}
public void setColor(String color) {
this.color = color;
}
public String getVisitCondition() {
return visitCondition;
}
public void setVisitCondition(String visitCondition) {
this.visitCondition = visitCondition;
}
public String getProximity() {
return proximity;
}
public void setProximity(String proximity) {
this.proximity = proximity;
}
public String getLiked() {
return liked;
}
public void setLiked(String liked) {
this.liked = liked;
}
public String getShopThumbNail1() {
return shopThumbNail1;
}
public void setShopThumbNail1(String shopThumbNail1) {
this.shopThumbNail1 = shopThumbNail1;
}
public String getCouponThumbnail1() {
return couponThumbnail1;
}
public void setCouponThumbnail1(String couponThumbnail1) {
this.couponThumbnail1 = couponThumbnail1;
}
}

View File

@ -0,0 +1,58 @@
package com.loglog.api.commons.beans;
/**
* 사용자 Bean
*
* @author SJG
*/
public class GeolocationBean extends CommonBean {
private static final long serialVersionUID = -8015604660465562829L;
/**상점 코드*/
private String shopCd;
/**경도*/
private Double longtitude;
/**위도*/
private Double latitude;
/**주소*/
private String address;
public String getShopCd() {
return shopCd;
}
public void setShopCd(String shopCd) {
this.shopCd = shopCd;
}
public Double getLongtitude() {
return longtitude;
}
public void setLongtitude(Double longtitude) {
this.longtitude = longtitude;
}
public Double getLatitude() {
return latitude;
}
public void setLatitude(Double latitude) {
this.latitude = latitude;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
}

View File

@ -0,0 +1,68 @@
package com.loglog.api.commons.beans;
public class ImageDataBean {
private String attachurl;
private int dataSeq;
private String dispElId;
private String filename;
private int filesize;
private String imageurl;
private String originalurl;
private String thumburl;
private int tmpSeq;
public String getAttachurl() {
return attachurl;
}
public void setAttachurl(String attachurl) {
this.attachurl = attachurl;
}
public int getDataSeq() {
return dataSeq;
}
public void setDataSeq(int dataSeq) {
this.dataSeq = dataSeq;
}
public String getDispElId() {
return dispElId;
}
public void setDispElId(String dispElId) {
this.dispElId = dispElId;
}
public String getFilename() {
return filename;
}
public void setFilename(String filename) {
this.filename = filename;
}
public int getFilesize() {
return filesize;
}
public void setFilesize(int filesize) {
this.filesize = filesize;
}
public String getImageurl() {
return imageurl;
}
public void setImageurl(String imageurl) {
this.imageurl = imageurl;
}
public String getOriginalurl() {
return originalurl;
}
public void setOriginalurl(String originalurl) {
this.originalurl = originalurl;
}
public String getThumburl() {
return thumburl;
}
public void setThumburl(String thumburl) {
this.thumburl = thumburl;
}
public int getTmpSeq() {
return tmpSeq;
}
public void setTmpSeq(int tmpSeq) {
this.tmpSeq = tmpSeq;
}
}

View File

@ -0,0 +1,176 @@
package com.loglog.api.commons.beans;
/**
* 사용자 Bean
*
* @author SJG
*/
public class MsgMasterBean extends CommonBean {
/**메세지 구분값 */
private String msgType;
/**공지사항 메세지 내용*/
private String noitCont;
/**메세지방 고유번호*/
private int roomId;
/**유저코드*/
private String userCd;
/**상점 코드*/
private String shopCd;
/**상점이름*/
private String shopNm;
/**상점이름-카나*/
private String shopKn;
/**상점 이미지*/
private String thumbnail1;
/**보낸 메세지 시간*/
private String datesent;
/**메세지 내용*/
private String content;
/**메세지 확인 여부*/
private String seen;
/**보낸 장소*/
private String sender;
/**메시지 좋아요*/
private int liked;
/**통지 메세지 이미지 */
private String msgImg;
/**메세지 개수*/
private String msgCount;
/**메세지 코드*/
private String msgCd;
/** 메세지 입력시간*/
private String insdatetime;
/**읽지 않은 메세제 개수*/
private String notReadMsg;
public String getMsgType() {
return msgType;
}
public void setMsgType(String msgType) {
this.msgType = msgType;
}
public String getNoitCont() {
return noitCont;
}
public void setNoitCont(String noitCont) {
this.noitCont = noitCont;
}
public int getRoomId() {
return roomId;
}
public void setRoomId(int roomId) {
this.roomId = roomId;
}
public String getUserCd() {
return userCd;
}
public void setUserCd(String userCd) {
this.userCd = userCd;
}
public String getShopCd() {
return shopCd;
}
public void setShopCd(String shopCd) {
this.shopCd = shopCd;
}
public String getShopNm() {
return shopNm;
}
public void setShopNm(String shopNm) {
this.shopNm = shopNm;
}
public String getShopKn() {
return shopKn;
}
public void setShopKn(String shopKn) {
this.shopKn = shopKn;
}
public String getThumbnail1() {
return thumbnail1;
}
public void setThumbnail1(String thumbnail1) {
this.thumbnail1 = thumbnail1;
}
public String getDatesent() {
return datesent;
}
public void setDatesent(String datesent) {
this.datesent = datesent;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public String getSeen() {
return seen;
}
public void setSeen(String seen) {
this.seen = seen;
}
public String getSender() {
return sender;
}
public void setSender(String sender) {
this.sender = sender;
}
public int getLiked() {
return liked;
}
public void setLiked(int liked) {
this.liked = liked;
}
public String getMsgCount() {
return msgCount;
}
public void setMsgCount(String msgCount) {
this.msgCount = msgCount;
}
public String getMsgImg() {
return msgImg;
}
public void setMsgImg(String msgImg) {
this.msgImg = msgImg;
}
public String getMsgCd() {
return msgCd;
}
public void setMegCd(String megCd) {
this.msgCd = megCd;
}
public String getInsdatetime() {
return insdatetime;
}
public void setInsdatetime(String insdatetime) {
this.insdatetime = insdatetime;
}
public String getNotReadMsg() {
return notReadMsg;
}
public void setNotReadMsg(String notReadMsg) {
this.notReadMsg = notReadMsg;
}
}

View File

@ -0,0 +1,94 @@
package com.loglog.api.commons.beans;
/**
* 공지사항 첨부파일 Bean
*
* @author "JIK"
*
*/
public class NotiAttachBean {
/** 공지사항 첨부파일 고유번호 */
private String notiAttachId;
/** 공지사항 고유번호 */
private String notiId;
/** 공지사항 첨부파일 정렬번호 */
private String ord;
/** 공지사항 첨부파일 타입 */
private String fileType;
/** 공지사항 첨부파일 원본파일명 */
private String fileName;
/** 공지사항 첨부파일 저장된 경로 */
private String filePath;
/** 공지사항 첨부파일 크기 */
private String fileSize;
/** 공지사항 첨부파일 등록일시 */
private String regDt;
/** 공지사항 첨부파일 수정일시 */
private String updDt;
/** 공지사항 첨부파일 이미지 Url */
private String imageUrl;
public String getNotiAttachId() {
return notiAttachId;
}
public void setNotiAttachId(String notiAttachId) {
this.notiAttachId = notiAttachId;
}
public String getNotiId() {
return notiId;
}
public void setNotiId(String notiId) {
this.notiId = notiId;
}
public String getOrd() {
return ord;
}
public void setOrd(String ord) {
this.ord = ord;
}
public String getFileType() {
return fileType;
}
public void setFileType(String fileType) {
this.fileType = fileType;
}
public String getFileName() {
return fileName;
}
public void setFileName(String fileName) {
this.fileName = fileName;
}
public String getFilePath() {
return filePath;
}
public void setFilePath(String filePath) {
this.filePath = filePath;
}
public String getFileSize() {
return fileSize;
}
public void setFileSize(String fileSize) {
this.fileSize = fileSize;
}
public String getRegDt() {
return regDt;
}
public void setRegDt(String regDt) {
this.regDt = regDt;
}
public String getUpdDt() {
return updDt;
}
public void setUpdDt(String updDt) {
this.updDt = updDt;
}
public String getImageUrl() {
return imageUrl;
}
public void setImageUrl(String imageUrl) {
this.imageUrl = imageUrl;
}
}

View File

@ -0,0 +1,105 @@
package com.loglog.api.commons.beans;
/**
* 공지사항 Bean
*
* @author "JIK"
*
*/
public class NotiBean {
/** 공지사항 번호 */
private String notiId;
/** 공지사항 종류 코드*/
private String typeCd;
/** 공지사항 종류(사용자, 판매자) */
private String notiType;
/** 공지사항 내용 분류 코드*/
private String notiContTypeCd;
/** 공지사항 내용 분류 */
private String notiContType;
/** 공지사항 제목 */
private String notiTitle;
/** 공지사항 내용 */
private String notiCont;
/** 공지사항 조회수 */
private String hit;
/** 공지사항 등록일시 */
private String regDt;
/** 공지사항 등록일시 - 년월일 */
private String regDtYmd;
/** 공지사항 수정일시 */
private String updDt;
public String getNotiId() {
return notiId;
}
public void setNotiId(String notiId) {
this.notiId = notiId;
}
public String getTypeCd() {
return typeCd;
}
public void setTypeCd(String typeCd) {
this.typeCd = typeCd;
}
public String getNotiType() {
return notiType;
}
public void setNotiType(String notiType) {
this.notiType = notiType;
}
public String getNotiContTypeCd() {
return notiContTypeCd;
}
public void setNotiContTypeCd(String notiContTypeCd) {
this.notiContTypeCd = notiContTypeCd;
}
public String getNotiContType() {
return notiContType;
}
public void setNotiContType(String notiContType) {
this.notiContType = notiContType;
}
public String getNotiTitle() {
return notiTitle;
}
public void setNotiTitle(String notiTitle) {
this.notiTitle = notiTitle;
}
public String getNotiCont() {
return notiCont;
}
public void setNotiCont(String notiCont) {
this.notiCont = notiCont;
}
public String getHit() {
return hit;
}
public void setHit(String hit) {
this.hit = hit;
}
public String getRegDt() {
return regDt;
}
public void setRegDt(String regDt) {
this.regDt = regDt;
}
public String getUpdDt() {
return updDt;
}
public void setUpdDt(String updDt) {
this.updDt = updDt;
}
public String getRegDtYmd() {
return regDtYmd;
}
public void setRegDtYmd(String regDtYmd) {
this.regDtYmd = regDtYmd;
}
}

View File

@ -0,0 +1,419 @@
package com.loglog.api.commons.beans;
/**
* 리스트의 페이징을 처리하는 Bean
*
* @author SJW
*/
public class PagingBean {
/** 페이지당 보여줄 레코드수 (변경가능하게 set/get 추가함) */
private int countPerRecord = 10;
/** all: 모든 레코드를 표시한다. **/
private String countPerRecordTypeCd;
/** 한 화면에 보여줄 페이지 수 (변경가능하게 set/get 추가함) */
private int countPerPage = 10;
/** 인덱스에 보여줄 공지사항 수 (변경가능하게 set/get 추가함) */
private int countPerNoti = 15;
/** 전체 레코드수 */
private int totalRecordCount;
/** 전체 페이지 수 */
private int totalPageCount;
/** 요청 페이지 */
private int pageNo;
/** DB 시작 로우 번호 */
private int startRow;
/** DB 종료 로우 번호 */
private int endRow;
/** 전체 페이지의 그룹갯수 */
private int totalGroupCount;
/** 현재 페이지의 그룹번호 (그룹번호는 1부터 시작) */
private int groupNo;
/** 시작 페이지 번호 */
private int pageStartNo;
/** 끝 페이지 번호 */
private int pageEndNo;
/** 검색어 */
private String search;
/** 검색 종류 */
private String searchKind;
/** 탭 구분자 */
private String tapType;
/** 정렬 문자열 */
private String orderByStr;
/** 공지 타입 코드 */
private String typeCd;
/** 1대1 판매자 및 적립금 문의 기간 */
private String period;
/** 1대1 판매자 문의 답변유형 */
private String replyYn;
/** 1대1 문의 및 조회 할때 사용자 ID */
private String sellerUserId;
/** 사용자ID */
private String userId;
/** 판매자 ID */
private String sellerId;
/** 관리자ID*/
private String adminId;
/** 적립금 입출금유형 */
private String inYn;
/** 적립금 조회시 주문번호 */
private String orderId;
/** 적립금 조회시 주문딜번호 */
private String orderDealId;
/** 판매자 주문/배송관리 조회 시작 날 */
/** 검색문의 시작일 */
private String startDt;
/** 판매자 주문/배송관리 조회 끝 날 */
/** 검색문의 종료일 */
private String endDt;
/** 딜명 **/
private String dealName;
/** 딜아이디 */
private String dealId;
/** 공동구매 정산 아이디 */
private String calGroupId;
/** 주문 상태 코드 */
private String orderStatusCd;
/** 쿠폰 검색시 필요한 정보 */
private String couponStatus1;
private String couponStatus2;
private String couponStatus3;
/** 검색시 필요한 키워드 */
private String searchKeyword;
/** 게시판 유형 코드 */
private String bdTypeCd;
/** 게시물 고유번호 */
private int bdNo;
/** 교육신청 번호 */
private int eduNo;
/**
* 화면에 표시할 페이지를 계산한다.
* @param totalRecordCount : 전체 레코드 갯수
*/
public void calcPage(int totalRecordCount) {
//페이지 디폴트값은 무조건 1 이다.
this.pageNo = pageNo == 0 ? 1 : pageNo;
this.totalRecordCount = totalRecordCount;
//전체 페이지 갯수
totalPageCount = calculateTotalPageCount(totalRecordCount, countPerRecord);
//DB에서 가져올 시작행 번호
//startRow = ((pageNo - 1) * countPerRecord) + 1;
// mysql limit 사용하므로 +1은 사용안한다.
startRow = (pageNo - 1) * countPerRecord;
//DB에서 가져올 끝행 번호
endRow = pageNo * countPerRecord;
//전체 페이징 그룹 갯수
totalGroupCount = calculateTotalPageCount( totalPageCount, countPerPage );
//현재 페이지의 소속 그룹번호
groupNo = calculateTotalPageCount(pageNo, countPerPage);
//시작, 페이지번호 구하기
//게시물총수가 0일때는 스타트번호를 0으로
if(totalRecordCount == 0){
pageStartNo = 0;
} else {
pageStartNo = ((groupNo - 1) * countPerPage) + 1;
}
pageEndNo = groupNo * countPerPage;
//마지막 페이지 번호보다 같거나 크다면 더이상의 페이지가 없는것이기 때문에 전체 페이지 갯수를 대입해준다.
if(pageEndNo >= totalPageCount) {
pageEndNo = totalPageCount;
}
}
/**
* 전체 레코드 개수에 대한 화면에 표시할 페이징 계산
* @param totalCount
* @return
*/
private int calculateTotalPageCount(int totalRecordCount , int countPerPage){
int totalPageCount = 0;
if(totalRecordCount > 0){
totalPageCount = totalRecordCount / countPerPage;
if( (totalRecordCount % countPerPage) > 0 ){
totalPageCount ++;
}
}
return totalPageCount;
}
public int getCountPerRecord() {
return countPerRecord;
}
public void setCountPerRecord(int countPerRecord) {
this.countPerRecord = countPerRecord;
}
public String getCountPerRecordTypeCd() {
return countPerRecordTypeCd;
}
public void setCountPerRecordTypeCd(String countPerRecordTypeCd) {
this.countPerRecordTypeCd = countPerRecordTypeCd;
}
public int getCountPerPage() {
return countPerPage;
}
public void setCountPerPage(int countPerPage) {
this.countPerPage = countPerPage;
}
public int getCountPerNoti() {
return countPerNoti;
}
public void setCountPerNoti(int countPerNoti) {
this.countPerNoti = countPerNoti;
}
public int getTotalPageCount() {
return totalPageCount;
}
public int getStartRow() {
return startRow;
}
public int getEndRow() {
return endRow;
}
public int getTotalRecordCount() {
return totalRecordCount;
}
public void setTotalRecordCount(int totalRecordCount) {
this.totalRecordCount = totalRecordCount;
}
public int getPageNo() {
return pageNo;
}
public void setPageNo(int pageNo) {
this.pageNo = pageNo;
}
public void setTotalPageCount(int totalPageCount) {
this.totalPageCount = totalPageCount;
}
public void setStartRow(int startRow) {
this.startRow = startRow;
}
public void setEndRow(int endRow) {
this.endRow = endRow;
}
public int getTotalGroupCount() {
return totalGroupCount;
}
public void setTotalGroupCount(int totalGroupCount) {
this.totalGroupCount = totalGroupCount;
}
public int getGroupNo() {
return groupNo;
}
public void setGroupNo(int groupNo) {
this.groupNo = groupNo;
}
public int getPageStartNo() {
return pageStartNo;
}
public void setPageStartNo(int pageStartNo) {
this.pageStartNo = pageStartNo;
}
public int getPageEndNo() {
return pageEndNo;
}
public void setPageEndNo(int pageEndNo) {
this.pageEndNo = pageEndNo;
}
public String getSearch() {
return search;
}
public void setSearch(String search) {
this.search = search;
}
public String getSearchKind() {
return searchKind;
}
public void setSearchKind(String searchKind) {
this.searchKind = searchKind;
}
public String getTapType() {
return tapType;
}
public void setTapType(String tapType) {
this.tapType = tapType;
}
public String getTypeCd() {
return typeCd;
}
public void setTypeCd(String typeCd) {
this.typeCd = typeCd;
}
public String getPeriod() {
return period;
}
public void setPeriod(String period) {
this.period = period;
}
public String getReplyYn() {
return replyYn;
}
public void setReplyYn(String replyYn) {
this.replyYn = replyYn;
}
public String getSellerUserId() {
return sellerUserId;
}
public void setSellerUserId(String sellerUserId) {
this.sellerUserId = sellerUserId;
}
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public String getSellerId() {
return sellerId;
}
public void setSellerId(String sellerId) {
this.sellerId = sellerId;
}
public String getAdminId() {
return adminId;
}
public void setAdminId(String adminId) {
this.adminId = adminId;
}
public String getInYn() {
return inYn;
}
public void setInYn(String inYn) {
this.inYn = inYn;
}
public String getOrderId() {
return orderId;
}
public void setOrderId(String orderId) {
this.orderId = orderId;
}
public String getOrderDealId() {
return orderDealId;
}
public void setOrderDealId(String orderDealId) {
this.orderDealId = orderDealId;
}
public String getStartDt() {
return startDt;
}
public void setStartDt(String startDt) {
this.startDt = startDt;
}
public String getEndDt() {
return endDt;
}
public void setEndDt(String endDt) {
this.endDt = endDt;
}
public String getDealName() {
return dealName;
}
public void setDealName(String dealName) {
this.dealName = dealName;
}
public String getDealId() {
return dealId;
}
public void setDealId(String dealId) {
this.dealId = dealId;
}
public String getCalGroupId() {
return calGroupId;
}
public void setCalGroupId(String calGroupId) {
this.calGroupId = calGroupId;
}
public String getOrderByStr() {
return orderByStr;
}
public void setOrderByStr(String orderByStr) {
this.orderByStr = orderByStr;
}
public String getOrderStatusCd() {
return orderStatusCd;
}
public void setOrderStatusCd(String orderStatusCd) {
this.orderStatusCd = orderStatusCd;
}
public String getCouponStatus1() {
return couponStatus1;
}
public void setCouponStatus1(String couponStatus1) {
this.couponStatus1 = couponStatus1;
}
public String getCouponStatus2() {
return couponStatus2;
}
public void setCouponStatus2(String couponStatus2) {
this.couponStatus2 = couponStatus2;
}
public String getSearchKeyword() {
return searchKeyword;
}
public void setSearchKeyword(String searchKeyword) {
this.searchKeyword = searchKeyword;
}
public String getCouponStatus3() {
return couponStatus3;
}
public void setCouponStatus3(String couponStatus3) {
this.couponStatus3 = couponStatus3;
}
public String getBdTypeCd() {
return bdTypeCd;
}
public void setBdTypeCd(String bdTypeCd) {
this.bdTypeCd = bdTypeCd;
}
public int getEduNo() {
return eduNo;
}
public void setEduNo(int eduNo) {
this.eduNo = eduNo;
}
public int getBdNo() {
return bdNo;
}
public void setBdNo(int bdNo) {
this.bdNo = bdNo;
}
}

View File

@ -0,0 +1,43 @@
package com.loglog.api.commons.beans;
/**
* 결과 Bean
*
* @author SJG
*/
public class ResultBean {
/** 결과 */
private String result;
/** 결과 메시지 */
private String resultMsg;
/** 결과 코드 */
private String resultCode;
/** 취소 일시 */
private String cancelDt;
public String getResult() {
return result;
}
public void setResult(String result) {
this.result = result;
}
public String getResultMsg() {
return resultMsg;
}
public void setResultMsg(String resultMsg) {
this.resultMsg = resultMsg;
}
public String getCancelDt() {
return cancelDt;
}
public void setCancelDt(String cancelDt) {
this.cancelDt = cancelDt;
}
public String getResultCode() {
return resultCode;
}
public void setResultCode(String resultCode) {
this.resultCode = resultCode;
}
}

View File

@ -0,0 +1,327 @@
package com.loglog.api.commons.beans;
/**
* 사용자 Bean
*
* @author SJG
*/
public class ShopDetailBean extends CommonBean {
/** 유저코드*/
private String userCd;
/** 상점 고유번호 */
private String shopCd;
/** 상점 핸드폰번호 */
private String shopPhone;
/** 상점이름 */
private String shopNm;
/** sns주소1 */
private String urlSns1;
/** sns주소2 */
private String urlSns2;
/** sns주소3 */
private String urlSns3;
/** sns주소4 */
private String urlSns4;
/** HP */
private String urlHp;
/** 썸네일1 */
private String thumbnail1;
/** 썸네일2 */
private String thumbnail2;
/** 썸네일3 */
private String thumbnail3;
/** 휴일1 */
private String holiDay1;
/** 휴일2 */
private String holiDay2;
/** 휴일3 */
private String holiDay3;
/** 무료텍스트 */
private String freeText;
/** 로고 */
private String logo;
/** 오픈시간1 */
private String openTime1;
/** 닫는시간1 */
private String closeTime1;
/** 오픈시간2 */
private String openTime2;
/** 닫는시간2 */
private String closeTime2;
/** 상점주소3 */
private String shopAdd3;
/** 상점주소2 */
private String shopAdd2;
/** 상점주소1 */
private String shopAdd1;
/** 상점 우편주소 */
private String shopPostcd;
/** 사용가능한 쿠폰갯수*/
private String couponCnt;
/** 즐겨찾기 여부*/
private String liked;
/** 방문 휫수*/
private String visitCnt;
/** 최근 공지사항 */
private String message;
public String getUserCd() {
return userCd;
}
public void setUserCd(String userCd) {
this.userCd = userCd;
}
public String getShopCd() {
return shopCd;
}
public void setShopCd(String shopCd) {
this.shopCd = shopCd;
}
public String getShopPhone() {
return shopPhone;
}
public void setShopPhone(String shopPhone) {
this.shopPhone = shopPhone;
}
public String getShopNm() {
return shopNm;
}
public void setShopNm(String shopNm) {
this.shopNm = shopNm;
}
public String getUrlSns1() {
return urlSns1;
}
public void setUrlSns1(String urlSns1) {
this.urlSns1 = urlSns1;
}
public String getUrlSns2() {
return urlSns2;
}
public void setUrlSns2(String urlSns2) {
this.urlSns2 = urlSns2;
}
public String getUrlSns3() {
return urlSns3;
}
public void setUrlSns3(String urlSns3) {
this.urlSns3 = urlSns3;
}
public String getUrlSns4() {
return urlSns4;
}
public void setUrlSns4(String urlSns4) {
this.urlSns4 = urlSns4;
}
public String getUrlHp() {
return urlHp;
}
public void setUrlHp(String urlHp) {
this.urlHp = urlHp;
}
public String getThumbnail1() {
return thumbnail1;
}
public void setThumbnail1(String thumbnail1) {
this.thumbnail1 = thumbnail1;
}
public String getThumbnail2() {
return thumbnail2;
}
public void setThumbnail2(String thumbnail2) {
this.thumbnail2 = thumbnail2;
}
public String getThumbnail3() {
return thumbnail3;
}
public void setThumbnail3(String thumbnail3) {
this.thumbnail3 = thumbnail3;
}
public String getHoliDay1() {
return holiDay1;
}
public void setHoliDay1(String holiDay1) {
this.holiDay1 = holiDay1;
}
public String getHoliDay2() {
return holiDay2;
}
public void setHoliDay2(String holiDay2) {
this.holiDay2 = holiDay2;
}
public String getHoliDay3() {
return holiDay3;
}
public void setHoliDay3(String holiDay3) {
this.holiDay3 = holiDay3;
}
public String getFreeText() {
return freeText;
}
public void setFreeText(String freeText) {
this.freeText = freeText;
}
public String getLogo() {
return logo;
}
public void setLogo(String logo) {
this.logo = logo;
}
public String getOpenTime1() {
return openTime1;
}
public void setOpenTime1(String openTime1) {
this.openTime1 = openTime1;
}
public String getCloseTime1() {
return closeTime1;
}
public void setCloseTime1(String closeTime1) {
this.closeTime1 = closeTime1;
}
public String getOpenTime2() {
return openTime2;
}
public void setOpenTime2(String openTime2) {
this.openTime2 = openTime2;
}
public String getCloseTime2() {
return closeTime2;
}
public void setCloseTime2(String closeTime2) {
this.closeTime2 = closeTime2;
}
public String getShopAdd3() {
return shopAdd3;
}
public void setShopAdd3(String shopAdd3) {
this.shopAdd3 = shopAdd3;
}
public String getShopAdd2() {
return shopAdd2;
}
public void setShopAdd2(String shopAdd2) {
this.shopAdd2 = shopAdd2;
}
public String getShopAdd1() {
return shopAdd1;
}
public void setShopAdd1(String shopAdd1) {
this.shopAdd1 = shopAdd1;
}
public String getShopPostcd() {
return shopPostcd;
}
public void setShopPostcd(String shopPostcd) {
this.shopPostcd = shopPostcd;
}
public String getCouponCnt() {
return couponCnt;
}
public void setCouponCnt(String couponCnt) {
this.couponCnt = couponCnt;
}
public String getLiked() {
return liked;
}
public void setLiked(String liked) {
this.liked = liked;
}
public String getVisitCnt() {
return visitCnt;
}
public void setVisitCnt(String visitCnt) {
this.visitCnt = visitCnt;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
}

View File

@ -0,0 +1,176 @@
package com.loglog.api.commons.beans;
/**
* 사용자 Bean
*
* @author SJG
*/
public class ShopMasterBean extends CommonBean {
/**Tempo_liked 고유번호*/
private String id;
/**상점코드*/
private String shopCd;
/**유저 코드*/
private String userCd;
/**룸ID*/
private String roomId;
/**상점이름*/
private String shopNm;
/**상점이름 - 일본어*/
private String shopKn;
/**상점이미지*/
private String thumbnail1;
/**상점 전화번호*/
private String shopPhone;
/**상점주소*/
private String shopAdd1 ;
/**상점상세주소*/
private String shopAdd2 ;
/**카테고리 코드*/
private String categoryCd;
/**경도*/
private Double longtitude ;
/**경도*/
private Double latitude ;
/**접근성*/
private String proximity;
private String liked;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getShopCd() {
return shopCd;
}
public void setShopCd(String shopCd) {
this.shopCd = shopCd;
}
public String getRoomId() {
return roomId;
}
public void setRoomId(String roomId) {
this.roomId = roomId;
}
public String getUserCd() {
return userCd;
}
public void setUserCd(String userCd) {
this.userCd = userCd;
}
public String getShopNm() {
return shopNm;
}
public void setShopNm(String shopNm) {
this.shopNm = shopNm;
}
public String getShopKn() {
return shopKn;
}
public void setShopKn(String shopKn) {
this.shopKn = shopKn;
}
public String getThumbnail1() {
return thumbnail1;
}
public void setThumbnail1(String thumbnail1) {
this.thumbnail1 = thumbnail1;
}
public String getShopPhone() {
return shopPhone;
}
public void setShopPhone(String shopPhone) {
this.shopPhone = shopPhone;
}
public String getShopAdd1() {
return shopAdd1;
}
public void setShopAdd1(String shopAdd1) {
this.shopAdd1 = shopAdd1;
}
public String getShopAdd2() {
return shopAdd2;
}
public void setShopAdd2(String shopAdd2) {
this.shopAdd2 = shopAdd2;
}
public String getCategoryCd() {
return categoryCd;
}
public void setCategoryCd(String categoryCd) {
this.categoryCd = categoryCd;
}
public Double getLongtitude() {
return longtitude;
}
public void setLongtitude(Double longtitude) {
this.longtitude = longtitude;
}
public Double getLatitude() {
return latitude;
}
public void setLatitude(Double latitude) {
this.latitude = latitude;
}
public String getProximity() {
return proximity;
}
public void setProximity(String proximity) {
this.proximity = proximity;
}
public String getLiked() {
return liked;
}
public void setLiked(String liked) {
this.liked = liked;
}
}

View File

@ -0,0 +1,172 @@
package com.loglog.api.commons.beans;
/**
* 사용자 Bean
*
* @author SJG
*/
public class UserBean extends CommonBean {
private static final long serialVersionUID = -8015604660465562829L;
/**등록된 코드*/
private String insuserCd;
/**코드업데이트*/
private String upduserCd;
/**사용자코드*/
private String userCd;
/**사용자이름*/
private String userNm;
/**사용자이름 카나*/
private String userKn;
/**사용자 생일*/
private String birthday;
/**사용자 성별*/
private String gender;
/**사용자 이메일*/
private String userMail;
/**사용자 비밀번호*/
private String userPw;
/**사용자 핸드폰번호*/
private String userPhone;
/**협업 카테고리*/
private String connectKbn;
/**주소*/
private String add1;
/**상세주소*/
private String add2;
/**랭킹*/
private String rank;
/** ?? */
private String janNo;
/** ?? */
private String custCd;
private String custCd1;
private String custCd2;
private String custCd3;
/**비밀번호 확인*/
private String checkPw;
public String getInsuserCd() {
return insuserCd;
}
public void setInsuserCd(String insuserCd) {
this.insuserCd = insuserCd;
}
public String getUpduserCd() {
return upduserCd;
}
public void setUpduserCd(String upduserCd) {
this.upduserCd = upduserCd;
}
public String getUserCd() {
return userCd;
}
public void setUserCd(String userCd) {
this.userCd = userCd;
}
public String getUserNm() {
return userNm;
}
public void setUserNm(String userNm) {
this.userNm = userNm;
}
public String getUserKn() {
return userKn;
}
public void setUserKn(String userKn) {
this.userKn = userKn;
}
public String getBirthday() {
return birthday;
}
public void setBirthday(String birthday) {
this.birthday = birthday;
}
public String getGender() {
return gender;
}
public void setGender(String gender) {
this.gender = gender;
}
public String getUserMail() {
return userMail;
}
public void setUserMail(String userMail) {
this.userMail = userMail;
}
public String getUserPw() {
return userPw;
}
public void setUserPw(String userPw) {
this.userPw = userPw;
}
public String getUserPhone() {
return userPhone;
}
public void setUserPhone(String userPhone) {
this.userPhone = userPhone;
}
public String getConnectKbn() {
return connectKbn;
}
public void setConnectKbn(String connectKbn) {
this.connectKbn = connectKbn;
}
public String getAdd1() {
return add1;
}
public void setAdd1(String add1) {
this.add1 = add1;
}
public String getAdd2() {
return add2;
}
public void setAdd2(String add2) {
this.add2 = add2;
}
public String getRank() {
return rank;
}
public void setRank(String rank) {
this.rank = rank;
}
public String getJanNo() {
return janNo;
}
public void setJanNo(String janNo) {
this.janNo = janNo;
}
public String getCustCd() {
return custCd;
}
public void setCustCd(String custCd) {
this.custCd = custCd;
}
public String getCustCd1() {
return custCd1;
}
public void setCustCd1(String custCd1) {
this.custCd1 = custCd1;
}
public String getCustCd2() {
return custCd2;
}
public void setCustCd2(String custCd2) {
this.custCd2 = custCd2;
}
public String getCustCd3() {
return custCd3;
}
public void setCustCd3(String custCd3) {
this.custCd3 = custCd3;
}
public String getCheckPw() {
return checkPw;
}
public void setCheckPw(String checkPw) {
this.checkPw = checkPw;
}
}

View File

@ -0,0 +1,96 @@
package com.loglog.api.commons.constants;
/**
* 게시판 상수코드 정의
*
* @since 2017.12.12
*/
public class BoardConstant {
/**
* 게시판 유형 코드- 이벤트 - {@value}
* */
public static final String BOARD_TYPE_CD_01 = "1";
/**
* 게시판 유형 코드- 자격신청 - {@value}
* */
public static final String BOARD_TYPE_CD_02 = "2";
/**
* 게시판 유형 코드- KSA News - {@value}
* */
public static final String BOARD_TYPE_CD_03 = "3";
/**
* 게시판 유형 코드- photo - {@value}
* */
public static final String BOARD_TYPE_CD_04 = "4";
/**
* 게시판 유형 코드- video - {@value}
* */
public static final String BOARD_TYPE_CD_05 = "5";
/**
* 게시판 유형 코드- 공지사항 - {@value}
* */
public static final String BOARD_TYPE_CD_06 = "6";
/**
* 게시판 유형 코드- 자유게시판 - {@value}
* */
public static final String BOARD_TYPE_CD_07 = "7";
/**
* 게시판 유형 코드- 서핑포인트 - {@value}
* */
public static final String BOARD_TYPE_CD_08 = "8";
/**
* 게시판 유형 코드- 자료실 - {@value}
* */
public static final String BOARD_TYPE_CD_09 = "9";
/**
* 게시판 유형 코드- 1:1문의 - {@value}
* */
public static final String BOARD_TYPE_CD_10 = "10";
/**
* 게시판 유형 코드- 서울특별시 서핑협회 - {@value}
* */
public static final String BOARD_TYPE_CD_11 = "11";
/**
* 게시판 유형 코드- 대전광역시 서핑협회 - {@value}
* */
public static final String BOARD_TYPE_CD_12 = "12";
/**
* 게시판 유형 코드- 울산광역시 서핑협회 - {@value}
* */
public static final String BOARD_TYPE_CD_13 = "13";
/**
* 게시판 유형 코드- 강원도 서핑협회 - {@value}
* */
public static final String BOARD_TYPE_CD_14 = "14";
/**
* 게시판 유형 코드- 충청남도 서핑협회 - {@value}
* */
public static final String BOARD_TYPE_CD_15 = "15";
/**
* 게시판 유형 코드- 경상북도 서핑협회 - {@value}
* */
public static final String BOARD_TYPE_CD_16 = "16";
/**
* 게시판 유형 코드- 제주특별자치도 서핑협회 - {@value}
* */
public static final String BOARD_TYPE_CD_17 = "17";
}

View File

@ -0,0 +1,422 @@
package com.loglog.api.commons.constants;
/**
* TB_CODE 테이블 상수정의
*
* @author SJW
*/
public class CodeConstant {
/** 관리자 상태 코드- 가입심사중 - {@value} */
public static final String ADMIN_STATUS_CD_1001 = "1001";
/** 관리자 상태 코드- 정상이용 - {@value} */
public static final String ADMIN_STATUS_CD_1000 = "1000";
/** 판매자 상태 코드- 가입심사중 - {@value} */
public static final String SELLER_STATUS_CD_1001 = "1001";
/** 판매자 상태 코드- 정상이용 - {@value} */
public static final String SELLER_STATUS_CD_1000 = "1000";
/** 인증 상태 코드- 인증메일발송 - {@value} */
public static final String AUTH_STATUS_CD_01 = "01";
/** 인증 상태 코드- 인증확인 - {@value} */
public static final String AUTH_STATUS_CD_02 = "02";
/** 인증 상태 코드- 승인대기 - {@value} */
public static final String AUTH_STATUS_CD_03 = "03";
/** 인증 상태 코드- 정상이용 - {@value} */
public static final String AUTH_STATUS_CD_04 = "04";
/** 인증 상태 코드- 일시정지 - {@value} */
public static final String AUTH_STATUS_CD_05 = "05";
/** 주소 종류 코드- 일반주소 - {@value} */
public static final String ADDR_TYPE_CD_01 = "01";
/** 주소 종류 코드- 대표출고지 주소 - {@value} */
public static final String ADDR_TYPE_CD_02 = "02";
/** 주소 종류 코드- 대표 반품/교환지 주소 - {@value} */
public static final String ADDR_TYPE_CD_03 = "03";
/** 판매자 유형 코드- 사업자 판매 회원 - {@value} */
public static final String SELLER_TYPE_CD_01 = "01";
/** 판매자 유형 코드- 개인 판매 회원 - {@value} */
public static final String SELLER_TYPE_CD_02 = "02";
/** 사용자 상태 코드- 정상 이용 - {@value} */
public static final String USER_STATUS_CD_1000 = "1000";
/** 사용자 상태 코드- 가입 심사중 - {@value} */
public static final String USER_STATUS_CD_1001 = "1001";
/** 사용자 상태 코드- 메일 인증 대기 - {@value} */
public static final String USER_STATUS_CD_2001 = "2001";
/** 사용자 상태 코드- 활동 정지 - {@value} */
public static final String USER_STATUS_CD_5001 = "5001";
/** 사용자 상태 코드- 탈퇴 - {@value} */
public static final String USER_STATUS_CD_9999 = "9999";
/** 사용자 상태 코드- 탈퇴요청 - {@value} */
public static final String USER_STATUS_CD_9001 = "9001";
/** 사용자 상태 코드- 탈퇴반려 - {@value} */
public static final String USER_STATUS_CD_9002 = "9002";
/** 딜 상태 코드- 딜 등록대기 - {@value} */
public static final String DEAL_STATUS_CD_100 = "100";
/** 딜 상태 코드- 딜 심사요청 - {@value} */
public static final String DEAL_STATUS_CD_101 = "101";
/** 딜 상태 코드- 딜 심사중 - {@value} */
public static final String DEAL_STATUS_CD_111 = "111";
/** 딜 상태 코드- 딜 심사 반려 - {@value} */
public static final String DEAL_STATUS_CD_121 = "121";
/** 딜 상태 코드- 딜 진행중 - {@value} */
public static final String DEAL_STATUS_CD_131 = "131";
/** 딜 상태 코드- 딜 종료 - {@value} */
public static final String DEAL_STATUS_CD_141 = "141";
/** 딜 상태 코드- 딜 삭제 - {@value} */
public static final String DEAL_STATUS_CD_191 = "191";
/** 딜 상태 코드- 딜 수요조사 등록대기- {@value} */
public static final String DEAL_STATUS_CD_200 = "200";
/** 딜 상태 코드- 딜 수요조사 심사요청- {@value} */
public static final String DEAL_STATUS_CD_201 = "201";
/** 딜 상태 코드- 딜 수요조사 심사중 - {@value} */
public static final String DEAL_STATUS_CD_211 = "211";
/** 딜 상태 코드- 딜 수요조사 심사반려 - {@value} */
public static final String DEAL_STATUS_CD_221 = "221";
/** 딜 상태 코드- 딜 수요조사 진행중 - {@value} */
public static final String DEAL_STATUS_CD_231 = "231";
/** 딜 상태 코드- 딜 수요조사 종료 - {@value} */
public static final String DEAL_STATUS_CD_241 = "241";
/** 딜 상태 코드- 딜 수요조사 삭제 - {@value} */
public static final String DEAL_STATUS_CD_291 = "291";
/** 딜 상태 코드- 딜 공동구매 등록대기 - {@value} */
public static final String DEAL_STATUS_CD_300 = "300";
/** 딜 상태 코드- 딜 공동구매 심사요청 - {@value} */
public static final String DEAL_STATUS_CD_301 = "301";
/** 딜 상태 코드- 딜 공동구매 심사중 - {@value} */
public static final String DEAL_STATUS_CD_311 = "311";
/** 딜 상태 코드- 딜 공동구매 심사 반려 - {@value} */
public static final String DEAL_STATUS_CD_321 = "321";
/** 딜 상태 코드- 딜 공동구매 모집중 - {@value} */
public static final String DEAL_STATUS_CD_331 = "331";
/** 딜 상태 코드- 딜 공동구매 모집실패 처리중 - {@value} */
public static final String DEAL_STATUS_CD_335 = "335";
/** 딜 상태 코드- 딜 공동구매 모집종료 - {@value} */
public static final String DEAL_STATUS_CD_341 = "341";
/** 딜 상태 코드- 딜 공동구매 배송중 - {@value} */
public static final String DEAL_STATUS_CD_351 = "351";
/** 딜 상태 코드- 딜 공동구매 종료 - {@value} */
public static final String DEAL_STATUS_CD_361 = "361";
/** 딜 상태 코드- 딜 공동구매 모집실패 - {@value} */
public static final String DEAL_STATUS_CD_381 = "381";
/** 딜 상태 코드- 딜 공동구매 삭제 - {@value} */
public static final String DEAL_STATUS_CD_391 = "391";
/** 딜 타입 코드 - 판매딜 - {@value} */
public static final String DEAL_TYPE_CD_1 = "1";
/** 딜 타입 코드 - 수요조사딜 - {@value} */
public static final String DEAL_TYPE_CD_2 = "2";
/** 딜 타입 코드 - 공동구매딜 - {@value} */
public static final String DEAL_TYPE_CD_3 = "3";
/** 딜 타입별 상태 - 판매딜 - 판매자 - {@value} */
public static final String[] DEAL_TYPE_1_CDS_SELLER = {"100","101","111","121","131","141"};
/** 딜 타입별 상태 - 판매딜 - 관리자 - {@value} */
public static final String[] DEAL_TYPE_1_CDS_ADMIN = {"100","101","111","121","131","141", "191"};
/** 딜 타입별 상태 - 수요조사딜 - {@value} */
public static final String[] DEAL_TYPE_2_CDS = {"201","211","221","231","241"};
/** 딜 타입별 상태 - 공동구매딜 - 판매자 - {@value} */
public static final String[] DEAL_TYPE_3_CDS_SELLER = {"300","301","311","321","331","335","341","351","361","381"};
/** 딜 타입별 상태 - 공동구매 주문관리 딜 - 판매자 - {@value} */
public static final String[] DEAL_TYPE_3_CDS_SELLER_GROUP = {"331","335","341","351","361","381"};
/** 딜 타입별 상태 - 공동구매딜 - 관리자 - {@value} */
public static final String[] DEAL_TYPE_3_CDS_ADMIN = {"300","301","311","321","331","335","341","351","361","381","391"};
/** 옵션 타입 코드 - 기본 옵션 - {@value} */
public static final String OPTION_TYPE_CD_1 = "1";
/** 옵션 타입 코드 - 하위옵션 - {@value} */
public static final String OPTION_TYPE_CD_2 = "2";
/** 옵션 타입 코드 - 추가구성품 - {@value} */
public static final String OPTION_TYPE_CD_3 = "3";
/** 결제 수단 코드 - 신용카드 {@value} */
public static final String PAY_MEANS_CD_CREDIT_CARD = "CREDIT_CARD";
/** 결제 수단 코드 - 실시간계좌이체 {@value} */
public static final String PAY_MEANS_CD_BANK = "BANK";
/** 결제 수단 코드 - 무통장입금 {@value} */
public static final String PAY_MEANS_CD_VIRTUAL_ACCOUNT = "VIRTUAL_ACCOUNT";
/** 결제 수단 코드 - 휴대폰 {@value} */
public static final String PAY_MEANS_CD_MOBILE = "MOBILE";
/** 결제 수단 코드 - 카카오페이 {@value} */
public static final String PAY_MEANS_CD_KAKAO_PAY= "KAKAO_PAY";
/** 배송비 그룹 계산 방식 코드 - 묶음그룹에서 가장 작은 배송비로 부과 - {@value} */
public static final String DELI_FEE_GROUP_CAL_TYPE_CD_01 = "01";
/** 배송비 그룹 계산 방식 코드 - 묶음그룹에서 가장 큰 배송비로 부과 - {@value} */
public static final String DELI_FEE_GROUP_CAL_TYPE_CD_02 = "02";
/** 주문 상태 코드 - 주문접수 {@value} */
public static final String ORDER_STATUS_CD_101 = "101";
/** 주문 상태 코드 - 입금대기중 {@value} */
public static final String ORDER_STATUS_CD_201 = "201";
/** 주문 상태 코드 - 결제완료 {@value} */
public static final String ORDER_STATUS_CD_301 = "301";
/** 주문 상태 코드 - 배송준비중 {@value} */
public static final String ORDER_STATUS_CD_401 = "401";
/** 주문 상태 코드 - 배송중 {@value} */
public static final String ORDER_STATUS_CD_501 = "501";
/** 주문 상태 코드 - 배송완료 {@value} */
public static final String ORDER_STATUS_CD_601 = "601";
/** 주문 상태 코드 - 구매확정 {@value} */
public static final String ORDER_STATUS_CD_701 = "701";
/** 주문 상태 코드 - 주문취소접수 {@value} */
public static final String ORDER_STATUS_CD_801 = "801";
/** 주문 상태 코드 - 주문취소 {@value} */
public static final String ORDER_STATUS_CD_901 = "901";
/** 공동구매 주문 목록 상태 코드 - 판매자 {@value} */
public static final String[] ORDER_STATUS_CDS_SELLER= {"301","401","501","601","701","901"};
/** 회원 구분 코드 - 사용자 {@value} */
public static final String MEMBER_TYPE_CD_1 = "1";
/** 회원 구분 코드 - 판매자 {@value} */
public static final String MEMBER_TYPE_CD_2 = "2";
/** 회원 구분 코드 - 관리자 {@value} */
public static final String MEMBER_TYPE_CD_3 = "3";
/** 결제 상태 코드 - 결제대기 {@value} */
public static final String PAY_STATUS_CD_101 = "101";
/** 결제 상태 코드 - 입금대기 {@value} */
public static final String PAY_STATUS_CD_201 = "201";
/** 결제 상태 코드 - 결제완료 {@value} */
public static final String PAY_STATUS_CD_301 = "301";
/** 결제 상태 코드 - 결제완료(취소불가) {@value} */
public static final String PAY_STATUS_CD_302 = "302";
/** 결제 상태 코드 - 결제취소 {@value} */
public static final String PAY_STATUS_CD_701 = "701";
/** 결제 상태 코드 - 결제실패 {@value} */
public static final String PAY_STATUS_CD_901 = "901";
/** 게시 기간 코드 - 재고소진시까지 {@value} */
public static final String INFORM_DT_CD_1 = "1";
/** 게시 기간 코드 - 게시기간 {@value} */
public static final String INFORM_DT_CD_2 = "2";
/** 공지사항 타입 - 판매자 {@value} */
public static final String NOTI_TYPE_S = "S";
/** 공지사항 타입 - 사용자 {@value} */
public static final String NOTI_TYPE_U = "U";
/** 사용자 공지사항 탭 구분 - 공지 {@value} */
public static final String NOTI_EVENT_N = "N";
/** 사용자 공지사항 탭 구분 - 이벤트 {@value} */
public static final String NOTI_EVENT_E = "E";
/** 자주하는 질문 탭 구분 - 주문/배송 {@value} */
public static final String FAQ_ORDER = "1";
/** 자주하는 질문 탭 구분 - 취소/환불 {@value} */
public static final String FAQ_CANCEL = "2";
/** 자주하는 질문 탭 구분 - 서비스 {@value} */
public static final String FAQ_SERVICE = "3";
/** 발송 메일 주소 코드 - help {@value} */
public static final String SEND_MAIL_CD_01 = "01";
/** 다우 페이 카드 코드 - 신한카드 {@value} */
public static final String DAOU_PAY_CARD_CD_CCLG = "CCLG";
/** 다우 페이 카드 코드 - BC카드 {@value} */
public static final String DAOU_PAY_CARD_CD_CCBC = "CCBC";
/** 다우 페이 카드 코드 - 국민카드 {@value} */
public static final String DAOU_PAY_CARD_CD_CCKM = "CCKM";
/** 다우 페이 카드 코드 - 삼성카드 {@value} */
public static final String DAOU_PAY_CARD_CD_CCSS = "CCSS";
/** 다우 페이 카드 코드 - 현대카드 {@value} */
public static final String DAOU_PAY_CARD_CD_CCDI = "CCDI";
/** 다우 페이 카드 코드 - 롯데카드 {@value} */
public static final String DAOU_PAY_CARD_CD_CCLO = "CCLO";
/** 다우 페이 카드 코드 - 하나SK카드 {@value} */
public static final String DAOU_PAY_CARD_CD_CCHN = "CCHN";
/** 다우 페이 카드 코드 - 외환카드 {@value} */
public static final String DAOU_PAY_CARD_CD_CCKE = "CCKE";
/** 다우 페이 카드 코드 - NH농협카드 {@value} */
public static final String DAOU_PAY_CARD_CD_CCNH = "CCNH";
/** 다우 페이 카드 코드 - 시티카드 {@value} */
public static final String DAOU_PAY_CARD_CD_CCCT = "CCCT";
/** 다우 페이 카드 코드 - 우리카드 {@value} */
public static final String DAOU_PAY_CARD_CD_CCPH = "CCPH";
/** 다우 페이 상품 구분 코드 - 디지털 {@value} */
public static final String DAOU_PAY_PRODUCT_TYPE_CD_1 = "1";
/** 다우 페이 상품 구분 코드 - 실물 {@value} */
public static final String DAOU_PAY_PRODUCT_TYPE_CD_2 = "2";
/** 다우 페이 과금 유형 코드 - 일반 {@value} */
public static final String DAOU_PAY_BILL_TYPE_CD_1 = "1";
/** 다우 페이 입금만료일(가상계좌) {@value} */
public static final String DAOU_PAY_DEPOSIT_END_DATE= "3";
/** 다우 페이 현금영수증 발행여부 - 발행 {@value} */
public static final String DAOU_PAY_CASH_RECEIPT_FLAG_1 = "1";
/** 다우 페이 현금영수증 발행여부 - 미발행 {@value} */
public static final String DAOU_PAY_CASH_RECEIPT_FLAG_2 = "2";
/** 다우 페이 콜백 - 결제수단 - 신용카드 결과통보 {@value} */
public static final String DAOU_PAY_PAY_METHOD_CD_CARD = "CARD";
/** 다우 페이 콜백 - 결제수단 - 가상계좌 계좌발행 {@value} */
public static final String DAOU_PAY_PAY_METHOD_CD_VACCOUNTISSUE = "VACCOUNTISSUE";
/** 다우 페이 콜백 - 결제수단 - 가상계좌 결과통보 {@value} */
public static final String DAOU_PAY_PAY_METHOD_CD_VACCOUNT = "VACCOUNT";
/** 다우 페이 콜백 - 결제수단 - 계좌이체 결과통보 {@value} */
public static final String DAOU_PAY_PAY_METHOD_CD_BANK = "BANK";
/** 다우 페이 비과세 여부 코드 - 과세 {@value} */
public static final String DAOU_PAY_TAX_FREE_CD_00 = "00";
/** 다우 페이 비과세 여부 코드 - 비과세 {@value} */
public static final String DAOU_PAY_TAX_FREE_CD_01 = "01";
/** PG사 코드 - 다우페이 {@value} */
public static final String PG_CD_DAOU = "DAOU";
public static final String PG_CD_INICIS = "INICIS";
/** 구매평 샘플 코드 - 매우좋아요 {@value} */
public static final String BUY_EVAL_SAMPLE_CD_01 = "01";
/** 구매평 샘플 코드 - 좋아요 {@value} */
public static final String BUY_EVAL_SAMPLE_CD_02 = "02";
/** 구매평 샘플 코드 - 보통입니다 {@value} */
public static final String BUY_EVAL_SAMPLE_CD_03 = "03";
/** 구매평 샘플 코드 - 별로입니다 {@value} */
public static final String BUY_EVAL_SAMPLE_CD_04 = "04";
/** 구매평 샘플 코드 - 매우별로 {@value} */
public static final String BUY_EVAL_SAMPLE_CD_05 = "05";
/** 적립금 구분 코드 - 구매확정 {@value} */
public static final String SAVE_CASH_TYPE_CD_01 = "01";
/** 적립금 구분 코드 - SNS 공유 {@value} */
public static final String SAVE_CASH_TYPE_CD_02 = "02";
/** 적립금 구분 코드 - 가격구간 할인 {@value} */
public static final String SAVE_CASH_TYPE_CD_03 = "03";
/** 적립금 구분 코드 - 구매후기 {@value} */
public static final String SAVE_CASH_TYPE_CD_04 = "04";
/** 적립금 구분 코드 - 인출신청 {@value} */
public static final String SAVE_CASH_TYPE_CD_05 = "05";
/** 적립금 구분 코드 - 인출완료 {@value} */
public static final String SAVE_CASH_TYPE_CD_06 = "06";
/** 적립금 구분 코드 - 인출불가 {@value} */
public static final String SAVE_CASH_TYPE_CD_07 = "07";
/** 적립금 구분 코드 - 인출취소 {@value} */
public static final String SAVE_CASH_TYPE_CD_08 = "08";
/** 적립금 구분 코드 - 결제 {@value} */
public static final String SAVE_CASH_TYPE_CD_09 = "09";
/** 적립금 구분 코드 - 결제취소 {@value} */
public static final String SAVE_CASH_TYPE_CD_10 = "10";
/** 적립금 구분 코드 - 구매평 {@value} */
public static final String SAVE_CASH_TYPE_CD_11 = "11";
/** 적립금 구분 코드 - 이벤트 {@value} */
public static final String SAVE_CASH_TYPE_CD_30 = "30";
/** 적립금 구분 코드 - 회원가입 {@value} */
public static final String SAVE_CASH_TYPE_CD_40 = "40";
/** 적립금 구분 코드 - 회원가입 추천인 ID {@value} */
public static final String SAVE_CASH_TYPE_CD_41 = "41";
/**쿠폰 타입 구분 코드
/** 인출신청 상태 코드 - 신청 {@value} */
public static final String WITHDRAW_REQUEST_STATUS_CD_01 = "01";
/** 인출신청 상태 코드 - 처리완료 {@value} */
public static final String WITHDRAW_REQUEST_STATUS_CD_02 = "02";
/** 인출신청 상태 코드 - 불가 {@value} */
public static final String WITHDRAW_REQUEST_STATUS_CD_03 = "03";
/** 인출신청 상태 코드 - 취소 {@value} */
public static final String WITHDRAW_REQUEST_STATUS_CD_04 = "04";
/** 결제 타입 코드 - 주문 {@value} */
public static final String PAY_TYPE_CD_ORDER = "ORDER";
/** 결제 타입 코드 - 취소 {@value} */
public static final String PAY_TYPE_CD_CANCEL = "CANCEL";
/** 결제 타입 코드 - 재결제 {@value} */
public static final String PAY_TYPE_CD_REPAY = "REPAY";
/** SNS 유형 코드 - facebook {@value} */
public static final String SNS_TYPE_CD_FACEBOOK = "01";
/** SNS 유형 코드 - twitter {@value} */
public static final String SNS_TYPE_CD_TWITTER= "02";
/** SNS 유형 코드 - naver {@value} */
public static final String SNS_TYPE_CD_NAVER= "03";
/** SNS 유형 코드 - daumCafe {@value} */
public static final String SNS_TYPE_CD_DAUMCAFE= "04";
/** SNS 유형 코드 - tumblr {@value} */
public static final String SNS_TYPE_CD_TUMBLR= "05";
/** SNS 유형 코드 - pinterest {@value} */
public static final String SNS_TYPE_CD_PINTEREST= "06";
/** SNS 유형 코드 - google {@value} */
public static final String SNS_TYPE_CD_GOOGLE= "07";
/** SNS 유형 코드 - kakaoStory {@value} */
public static final String SNS_TYPE_CD_KAKAOSTORY= "08";
/** SNS 유형 코드 - band {@value} */
public static final String SNS_TYPE_CD_BAND= "09";
/** 추천인 유형 코드 - 없음 {@value} */
public static final String RECOMMENDER_TYPE_CD_NONE = "00";
/** 추천인 유형 코드 - 판매자 {@value} */
public static final String RECOMMENDER_TYPE_CD_SELLER = "01";
/** 추천인 유형 코드 - 일반사용자 {@value} */
public static final String RECOMMENDER_TYPE_CD_USER = "02";
/** 광고 딜 그룹 타입 코드 - 전체 {@value} */
public static final String AD_DEAL_GRP_TYPE_CD_A = "A";
/** 광고 딜 그룹 타입 코드 - PC {@value} */
public static final String AD_DEAL_GRP_TYPE_CD_P = "P";
/** 광고 딜 그룹 타입 코드 - 모바일 {@value} */
public static final String AD_DEAL_GRP_TYPE_CD_M = "M";
/** 정산 상태 코드 - 정산예정{@value} */
public static final String CAL_STATUS_CD_101 = "101";
/** 정산 상태 코드 - 정산완료{@value} */
public static final String CAL_STATUS_CD_201 = "201";
/** 송금 상태 코드 - 송금전{@value} */
public static final String REMIT_STATUS_CD_101 = "101";
/** 송금 상태 코드 - 송금완료{@value} */
public static final String REMIT_STATUS_CD_201 = "201";
/** 세금계산서 발행 코드 - 발행대기{@value} */
public static final String TAX_BILL_PUB_CD_101 = "101";
/** 세금계산서 발행 코드 - 발행완료{@value} */
public static final String TAX_BILL_PUB_CD_201 = "201";
/** 다우페이 결과 코드 - 성공 */
public static final String DAOU_PAY_RESULT_CD_0000 = "0000";
/** 다우페이 결과 코드 - 취소가능 금액 부족 */
public static final String DAOU_PAY_RESULT_CD_9029 = "9029";
/** 다우페이 결과 코드 - 이미 취소 되었습니다 */
public static final String DAOU_PAY_RESULT_CD_9112 = "9112";
/** 다우페이 결과 코드 - 예외상황-에러발생 */
public static final String DAOU_PAY_RESULT_CD_9999 = "9999";
}

View File

@ -0,0 +1,153 @@
package com.loglog.api.commons.constants;
/**
* TB_CODE_GRP 테이블 상수정의
*
* @author SJW
*/
public class CodeGrpConstant {
/** 이메일 - {@value} */
public static final String EMAIL = "1";
/** 사용자회원 상태코드 - {@value} */
public static final String USER_STATUS_CD = "2";
/** 지역번호코드 - {@value} */
public static final String AREA_CD = "3";
/** 통신사코드 - {@value} */
public static final String MOBILE_CD = "4";
/** 대금결제은행코드(G마켓ESM참조) - {@value} */
public static final String ACCOUNT_BANK_CD = "5";
/** 사업자종류코드 - {@value} */
public static final String BIZ_TYPE_CD = "6";
/** 판매자유형코드 - {@value} */
public static final String SELLER_TYPE_CD = "7";
/** 상품형태코드 - {@value} */
public static final String PRODUCT_TYPE_CD = "8";
/** 주소종류코드 - {@value} */
public static final String ADDR_TYPE_CD = "9";
/** 과세 구분 코드 - {@value} */
public static final String TAX_TYPE_CD = "10";
/** 배송 방법 코드 - {@value} */
public static final String DELI_TYPE_CD = "11";
/** 배송비 유형 코드 - {@value} */
public static final String DELI_FEE_TYPE_CD = "12";
/** 배송비 결제 방식 코드 - {@value} */
public static final String DELI_FEE_PAY_TYPE_CD = "13";
/** 판매자 상태 코드 - {@value} */
public static final String SELLER_STATUS_CD = "14";
/** 인증 상태 코드 - {@value} */
public static final String AUTH_STATUS_CD = "15";
/** 배송비 그룹 계산 방식 코드 - {@value} */
public static final String DELI_FEE_GROUP_CAL_TYPE_CD = "16";
/** 질문 코드 - {@value} */
public static final String QUESTION_CD = "17";
/** 딜 상태 코드 - {@value} */
public static final String DEAL_STATUS_CD = "18";
/** 옵션 타입 코드 - {@value} */
public static final String OPTION_TYPE_CD = "19";
/** 결제 수단 코드 - {@value} */
public static final String PAY_MEANS_CD = "20";
/** 주문 상태 코드 - {@value} */
public static final String ORDER_STATUS_CD = "28";
/** 회원 구분 코드 - {@value} */
public static final String MEMBER_TYPE_CD = "29";
/** 결제 상태 코드 - {@value} */
public static final String PAY_STATUS_CD = "30";
/** 게시 기간 코드 - {@value} */
public static final String INFORM_DT_CD = "31";
/** 발송 메일 주소 코드 - {@value} */
public static final String SEND_MAIL_CD = "32";
/** 다우 페이 카드 코드 - {@value} */
public static final String DAOU_PAY_CARD_CD = "33";
/** 다우 페이 상품 구분 코드 - {@value} */
public static final String DAOU_PAY_PRODUCT_TYPE_CD = "34";
/** 다우 페이 과금 유형 코드 - {@value} */
public static final String DAOU_PAY_BILL_TYPE_CD = "35";
/** 다우 페이 콜백 - 결제수단 - {@value} */
public static final String DAOU_PAY_PAY_METHOD_CD = "36";
/** 다우 페이 비과세 여부 코드 - {@value} */
public static final String DAOU_PAY_TAX_FREE_CD = "37";
/** 1대1 문의유형 코드 - {@value} */
public static final String INQUIRY_TYPE_CD = "38";
/** PG사 코드 - {@value} */
public static final String PG_CD = "39";
/** 공지사항 종류 코드 -{@value} */
public static final String USER_SELLER_TYPE_CD = "40";
/** 공지사항 내용 분류 코드 -{@value} */
public static final String NOTI_CONT_TYPE_CD = "41";
/** 자주하는질문 분류 코드 -{@value} */
public static final String FAQ_TYPE_CD = "42";
/** 구매평 샘플 코드 -{@value} */
public static final String BUY_EVAL_SAMPLE_CD = "43";
/** 적립금 구분 코드 -{@value} */
public static final String SAVE_CASH_TYPE_CD = "44";
/** 인출 요청 상태 코드 -{@value} */
public static final String WITHDRAW_REQUEST_STATUS_CD = "47";
/** 주문 취소 사유 코드 -{@value} */
public static final String ORDER_CANCEL_REASON_CD = "48";
/** 결제 타입 코드 -{@value} */
public static final String PAY_TYPE_CD = "49";
/** SNS 유형 코드 -{@value} */
public static final String SNS_TYPE_CD = "50";
/** 추천인 유형 코드 -{@value} */
public static final String RECOMMENDER_TYPE_CD = "51";
/** 광고 딜 그룹 타입 코드 -{@value} */
public static final String AD_DEAL_GRP_TYPE_CD = "52";
/** 딜 타입 코드 -{@value} */
public static final String DEAL_TYPE_CD = "53";
/** 정산 상태 코드 -{@value} */
public static final String CAL_STATUS_CD = "54";
/** 송금 상태 코드 -{@value} */
public static final String REMIT_STATUS_CD = "55";
/** 세금계산서 발행 코드 -{@value} */
public static final String TAX_BILL_PUB_CD = "56";
/** 다우페이 결과 코드 -{@value} */
public static final String DAOU_PAY_RESULT_CODE = "57";
}

View File

@ -0,0 +1,87 @@
package com.loglog.api.commons.constants;
public final class Constants {
public static final String OK = "ok";
public static final String FAIL = "fail";
public static final String WAIT = "wait";
public static final String OK_PAY = "okPay";
public static final String RESULT = "result";
public static final String RESULT_MSG = "resultMsg";
public static final String REDIRECT_MSG = "redirectMsg";
public static final String RESULT_URL = "resultUrl";
public static final String AUTH_TOKEN = "auth_token";
public static final String SESSION_USER_ID = "userId";
public static final String SESSION_ADMIN_BEAN = "adminBean";
public static final String SESSION_SELLER_BEAN = "sellerBean";
public static final String SESSION_USER_BEAN = "userBean";
public static final String BASE_PACKAGE = "com.loglog.api";
public static final String COMM_PACKAGE = "com.loglog.api.commons";
/** 세션에 저장된 판매자의 구분코드를 저장 **/
public static final String SESSION_SELLER_TYPE_CD = "sessionSellerTypeCd";
/** 네이버 회원가입 임시 유져정보 저장 **/
public static final String SESSION_NAVER_TEMP_USER_BEAN = "sessioNaverTempUserBean";
public static final String SESSION_RECOMMENDER_ID = "recommenderId";
public static final String SESSION_SNS_MAP = "snsMap";
public static final String SESSION_ORDER_BEAN = "orderBean";
/** 나이스 SMS 요청시 세션에 저장하는 요청번호(고유번호) **/
public static final String SESSION_SMS_NICE_REQ_NUMBER = "sessionSmsNiceReqNumber";
public static final String USER_FORM = "1";
public static final String SELLER_FORM = "2";
public static final String ADMIN_FORM = "3";
public static final String UPDATE_FLAG = "updateFlag";
public static final String CHECK_PW_LOCATION = "chkPwLocation";
public static final String CATE_LEVEL2_LIST = "cateLevel2List";
/** 서버 키 - 사용자 */
public static final String SERVER_USER = "U";
/** 서버 키 - 판매자 */
public static final String SERVER_SELLER = "S";
/** 서버 키 - 관리자 */
public static final String SERVER_ADMIN = "A";
/** 서버 키 - 모바일 */
public static final String SERVER_MOBILE = "M";
/** 관리자 메일 */
public static final String ADMIN_MAIL = "sales@showpun.com";
/** 메일전송 방식 - 네이버웍스 **/
public static final int MAIL_TYPE_NAVER_WORKS = 1;
/** 메일전송 방식 - 지메일 **/
public static final int MAIL_TYPE_GMAIL = 2;
/** 나이스 SMS 인증시 사용자 ID를 세션에 저장할때 사용하는 키 **/
public static final String NICE_SESSION_USER_ID = "niceSessionUserId";
/** 나이스 SMS 인증시 사용자 이름을 세션에 저장할때 사용하는 키 **/
public static final String NICE_SESSION_USER_NAME = "niceSessionUserName";
public static final String VER_BUILD_DATE = "VER_BUILD_DATE";
}

View File

@ -0,0 +1,30 @@
package com.loglog.api.commons.daos;
import java.util.List;
import com.loglog.api.commons.beans.BoardBean;
import com.loglog.api.commons.beans.PagingBean;
public interface BoardDao {
/** 글작성 */
public void insertBoard(BoardBean boardBean);
/** 게시글 수정 */
public int updateBoard(BoardBean boardBean);
/** 게시글 갯수 */
public int selectBoardCount(PagingBean pagingBean);
/** 글 목록 가져오기 */
public List<BoardBean> boardList(PagingBean pagingBean);
/** 조회수 업데이트 */
public void updateHit(BoardBean boardBean);
/** 글 상세보기 */
public BoardBean selectInBoard(BoardBean boardBean);
/** 글 삭제하기 */
public void deleteBoard(BoardBean boardBean);
}

View File

@ -0,0 +1,32 @@
package com.loglog.api.commons.daos;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.loglog.api.commons.beans.BoardBean;
import com.loglog.api.commons.beans.BoardFileBean;
public interface BoardFileDao {
/**게시물 이미지/파일 등록 */
public int insertBoardFile(BoardFileBean boardFileBean);
/** 게시글 수정시 삭제할 이미지/파일 목록 */
public List<BoardFileBean> deleteFileList(@Param("bdNo") int bdNo,@Param("boardFileArray") List<String> boardFileArray);
/** 게시글 수정시 삭제할 이미지/파일 목록 - 교육신청 */
public List<BoardFileBean> deleteFileListEdu(@Param("eduNo") int eduNo,@Param("boardFileArray") List<String> boardFileArray);
/** 게시글 수정시 이미지/파일 삭제 */
public void deleteFileForUpdate(@Param("boardFileList") List<BoardFileBean> boardFileList);
/** 한개의 글 이미지/파일 목록 */
public List<BoardFileBean> selectBoardFile(int bdNo);
/** 많은 게시물 이미지/파일들 가져오기 */
public List<BoardFileBean> boardFileList(@Param("boardList") List<BoardBean> boardList);
/** 게시글 이미지/파일 삭제 */
public void deleteFile(@Param("bdNo") int bdNo);
}

View File

@ -0,0 +1,44 @@
package com.loglog.api.commons.daos;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.loglog.api.commons.beans.BoardBean;
import com.loglog.api.commons.beans.BoardImgBean;
public interface BoardImgDao {
/** 게시글 이미지 등록 */
public int insertBoardImg(BoardImgBean boardImgBean);
/** 게시글 이미지 수정 */
public int updateBoardImg(BoardImgBean boardImgBean);
/** 게시글 이미지 수정 -교육신청- */
public int updateBoardImgEdu(BoardImgBean boardImgBean);
/** 게시글 수정시 이미지 삭제 */
public void deleteImgForUpdate(@Param("boardImgList") List<BoardImgBean> boardImgList);
/** 게시글 수정시 삭제할 이미지 목록 */
public List<BoardImgBean> deleteImgList(@Param("bdNo") int bdNo,@Param("boardImgArray") List<String> boardImgArray);
/** 게시글 수정시 삭제할 이미지 목록 - 교육신청*/
public List<BoardImgBean> deleteImgListEdu(@Param("eduNo") int eduNo,@Param("boardImgArray") List<String> boardImgArray);
/** 많은 게시물 이미지들 가져오기 -게시판- */
public List<BoardImgBean> boardImgList(@Param("boardList") List<BoardBean> list);
/** 한개의 글 이미지 목록 */
public List<BoardImgBean> selectBoardImg(int bdNo);
/** 한개의 글 이미지 목록 */
public List<BoardImgBean> selectBoardImgEdu(int eduNo);
/** 게시글 이미지 삭제 */
public void deleteImg(@Param("bdNo") int bdNo);
/** 게시글 이미지 삭제 */
public void deleteImgEdu(@Param("eduNo") int eduNo);
}

View File

@ -0,0 +1,43 @@
package com.loglog.api.commons.daos;
import java.util.List;
import com.loglog.api.commons.beans.BoardReplyBean;
import com.loglog.api.commons.beans.PagingBean;
public interface BoardReplyDao {
/** 댓글 입력 */
public int insertReply(BoardReplyBean replyBean);
/** 댓글목록 갯수 가져오기 */
public int replyListCount(PagingBean pagingBean);
/** 댓글목록 가져오기 */
public List<BoardReplyBean> replyList(PagingBean pagingBean);
/** 댓글 1건 삭제 */
public int deleteReply(BoardReplyBean replyBean);
/** 댓글 여러건 삭제 */
public int deleteReplyList(BoardReplyBean replyBean);
/** 댓글 수정 */
public int updateReply(BoardReplyBean replyBean);
/** 댓글 하나 가져오기 */
public BoardReplyBean selectTheReply(BoardReplyBean replyBean);
/** 댓글 비밀번호 + 입력 */
public int insertNeedPassReply(BoardReplyBean replyBean);
/** 댓글 비밀번호 비교 */
public int selectReplyPass(BoardReplyBean replyBean);
/** 댓글 비밀번호 수정 */
public int updateNeedPassReply(BoardReplyBean replyBean);
/** 댓글 + 비밀번호 1건 삭제 */
public int deleteNeedPassReply(BoardReplyBean replyBean);
}

View File

@ -0,0 +1,51 @@
package com.loglog.api.commons.daos;
import java.util.List;
import java.util.Map;
import com.loglog.api.commons.beans.PagingBean;
import com.loglog.api.commons.beans.CalenderBean;
/**
* 사용자 DAO
*
* @author SJG
*/
public interface CalenderDao {
/** 상점정보 있는지 체크 */
public int selectShopInfo(CalenderBean calenderBean);
/** 내점기록 저장 */
public int insertCalender(CalenderBean calenderBean);
/** 캘린더 조회 */
public List<CalenderBean> selectCalenderMon(CalenderBean calenderBean);
/** 스케줄 저장 */
public int insertSchedule(CalenderBean calenderBean);
/** 스케줄 디테일 조회*/
public List<CalenderBean> selectCalenderDay(CalenderBean calenderBean);
/** 스케줄 업데이트 */
public int updateCalender(CalenderBean calenderBean);
/** 저장후 고유ID를 이용해 데이터를 조회*/
public CalenderBean selectCalenderId(CalenderBean calenderBean);
/** 내점기록저장후 내용이나 사진 업데이트*/
public int updateCalenderthum(CalenderBean calenderBean);
/** 업데이트 이후 ID값을 이용해 조회후 출력*/
public CalenderBean selectUpdateId(CalenderBean calenderBean);
/** 내점이력 삭제*/
public int deleteVisitCalender(CalenderBean calenderBean);
/**내점이력 리스트 조회*/
public List<CalenderBean> selectVisitList(CalenderBean calenderBean);
/**섬네일 초기화*/
public int cleanCalenderThum(CalenderBean calenderBean);
}

View File

@ -0,0 +1,42 @@
package com.loglog.api.commons.daos;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.annotations.Param;
import com.loglog.api.commons.beans.PagingBean;
import com.loglog.api.commons.beans.UserBean;
import com.loglog.api.commons.beans.CardImgBean;
import com.loglog.api.commons.beans.CardMasterBean;
import com.loglog.api.commons.beans.CouponPublicBean;
import com.loglog.api.commons.beans.CouponUserListBean;
/**
* 사용자 DAO
*
* @author SJG
*/
public interface CardImgDao {
/**카드 이미지 등록*/
public int insertCardImg(CardImgBean cardImgBean);
/**카드 이미지 수정*/
public int updateCardImg(CardImgBean cardImgBean);
/** 카드 이미지 삭제*/
public void DeleteImg(int janNo )throws Exception;
/** 카드 이미지 리스트*/
public List<CardImgBean> cardImgList(List<CardImgBean> list);
/** 게시글 수정시 이미지 삭제 */
public void deleteImgForUpdate(@Param("boardImgList") List<CardImgBean> cardImgList);
/** 게시글 수정시 삭제할 이미지 목록 */
public List<CardImgBean> deleteImgList(@Param("janNo") String janNo, @Param("cardImgArray") List<String> cardImgArray);
/** 게시글 이미지 삭제 */
public void deleteImg(@Param("janNo") String janNo);
}

View File

@ -0,0 +1,68 @@
package com.loglog.api.commons.daos;
import java.util.List;
import java.util.Map;
import com.loglog.api.commons.beans.PagingBean;
import com.loglog.api.commons.beans.UserBean;
import com.loglog.api.commons.beans.CardMasterBean;
import com.loglog.api.commons.beans.CouponPublicBean;
import com.loglog.api.commons.beans.ShopMasterBean;
/**
* 사용자 DAO
*
* @author SJG
*/
public interface CardMasterDao {
/** 유저 카드 이미지 조회 */
public List<CardMasterBean> selectCardList(CardMasterBean cardMasterBean);
/**카드저장*/
public int insertCard(CardMasterBean cardMasterBean);
/**카드저장*/
public int insertCardNoimg(CardMasterBean cardMasterBean);
/**카드 저장전 중복체크*/
public int checkCardNm(CardMasterBean cardMasterBean);
/**카드 수정 전 카드이름 중복체크*/
public int checkCardNmUpdate(CardMasterBean cardMasterBean);
/**카드 정보 수정*/
public int updateCard(CardMasterBean cardMasterBean);
/**카드 정보 수정*/
public int updateCardNoimg(CardMasterBean cardMasterBean);
/**카드 정보 삭제*/
public int deleteCard(CardMasterBean cardMasterBean);
/**자세한 카드정보 조회*/
public CardMasterBean detailCard(CardMasterBean cardMasterBean);
/**포인트값 더하기 */
public int updatePoint(CardMasterBean cardMasterBean);
/**포인트값 치김 */
public int deletePoint(CardMasterBean cardMasterBean);
/**포인트값 null을 0으로 바꾸기 */
public int changZeroPoint(CardMasterBean cardMasterBean);
/**포인트값 조회 */
public int selectPoint(CardMasterBean cardMasterBean);
/** 즐겨찾기한 카드 조회 */
public List<CardMasterBean> selectLikeCardList(CardMasterBean cardMasterBean);
/**카드좋아요 */
public int likeCard(CardMasterBean cardMasterBean);
/**카드좋아요 취소ㅓ */
public int unlikeCard(CardMasterBean cardMasterBean);
/**마이카드 등록하기 전 등록하지 않은 상점리스트 출력*/
public List<ShopMasterBean> selectNotRegisShopList(CardMasterBean cardMasterBean);
}

View File

@ -0,0 +1,17 @@
package com.loglog.api.commons.daos;
import java.util.List;
import java.util.Map;
import com.loglog.api.commons.beans.PagingBean;
import com.loglog.api.commons.beans.UserBean;
/**
* 사용자 DAO
*
* @author SJG
*/
public interface CouponLikedDao {
}

View File

@ -0,0 +1,20 @@
package com.loglog.api.commons.daos;
import java.util.List;
import java.util.Map;
import com.loglog.api.commons.beans.PagingBean;
import com.loglog.api.commons.beans.UserBean;
import com.loglog.api.commons.beans.CouponMasterBean;
/**
* 사용자 DAO
*
* @author SJG
*/
public interface CouponMasterDao {
public int selectCouponPage(CouponMasterBean couponMasterBean);
public CouponMasterBean selectCouponDetail(CouponMasterBean CouponMasterBean);
}

View File

@ -0,0 +1,70 @@
package com.loglog.api.commons.daos;
import java.util.List;
import java.util.Map;
import com.loglog.api.commons.beans.GeolocationBean;
import com.loglog.api.commons.beans.PagingBean;
import com.loglog.api.commons.beans.CouponPublicBean;
import com.loglog.api.commons.beans.CouponUserListBean;
import com.loglog.api.commons.beans.CategoryBean;
/**
* 사용자 DAO
*
* @author SJG
*/
public interface CouponPublicDao {
/**사용자 쿠폰정보 가져오기 위경도값 없음 */
public List<CouponUserListBean> selectGetCoupons(Map<String,Object> parameter);
/**사용자 쿠폰정보 가져오기 위경도값 있음 */
public List<CouponUserListBean> selectGeoGetCoupons(Map<String,Object> parameter);
/**쿠폰 갯수 반환 */
public int selectCouponCount(Map<String,Object> parameter);
/**쿠폰생성(유효회원이 아닐때) */
public int insertCouponNotPaid(CouponPublicBean couponPublicBean);
/**쿠폰생성(유효회원) */
public int insertCouponPaid(CouponPublicBean couponPublicBean);
/**좋아요 쿠폰 개수 반환*/
public int selectLikeCouponCount(Map<String,Object> parameter);
/** 좋아요 쿠폰 조회 */
public List<CouponUserListBean> selectGetLikeCoupons(Map<String,Object> parameter);
/**쿠폰 좋아요*/
public int insertCouponLike(CouponPublicBean couponPublicBean);
/**쿠폰 좋아요*/
public int insertCouponUnLike(CouponPublicBean couponPublicBean);
/**쿠폰 사용*/
public int insertUseCoupon(CouponPublicBean couponPublicBean);
/**상세정보를 확인한 쿠폰 개수 반환*/
public int selectSeenCouponCount(Map<String,Object> parameter);
/**coupon_seen에 중복데이터 체크*/
public int selectSeenCheck(CouponPublicBean couponPublicBean);
/**상세정보를 확인한 쿠폰 리스트 */
public List<CouponUserListBean> selectSeenCoupons(Map<String,Object> parameter);
/**쿠폰 상세정보를 볼때 DB업데이트 - coupon_seen*/
public int insertSeenCoupon(CouponPublicBean couponPublicBean);
/**카테고리 리스트*/
public List<CategoryBean> selectCategoryList(CategoryBean categoryBean);
/**쿠폰의 존재 여부 체크*/
public int selectCouponCheck(CouponPublicBean couponPublicBean);
/**쿠폰의 사용여부 체크*/
public int selectUsedCouponCheck(CouponPublicBean couponPublicBean);
}

View File

@ -0,0 +1,17 @@
package com.loglog.api.commons.daos;
import java.util.List;
import java.util.Map;
import com.loglog.api.commons.beans.PagingBean;
import com.loglog.api.commons.beans.UserBean;
/**
* 사용자 DAO
*
* @author SJG
*/
public interface CouponUsedDao {
}

View File

@ -0,0 +1,49 @@
package com.loglog.api.commons.daos;
import java.util.List;
import java.util.Map;
import com.loglog.api.commons.beans.PagingBean;
import com.loglog.api.commons.beans.MsgMasterBean;
/**
* 사용자 DAO
*
* @author SJG
*/
public interface MsgMasterDao {
/** 뮤저 전체 메세지 출력 */
public List<MsgMasterBean> selectMsgText(MsgMasterBean msgMasterBean);
/**통지 메시지 출력*/
public List<MsgMasterBean> selectNoitMsg(MsgMasterBean msgMasterBean);
/**유저 전체 메세지 디테일*/
public MsgMasterBean selectMsgTextDetail(MsgMasterBean msgMasterBean);
/**유저 통지 메세지 디테일*/
public MsgMasterBean selectNoitMsgDetail(MsgMasterBean msgMasterBean);
/**즐겨찾기한 상점의 메세지리스트*/
public List<MsgMasterBean> selectShopMsgList(MsgMasterBean msgMasterBean);
/**즐겨찾기한 상점이 보내준 메세지 상세내용*/
public List<MsgMasterBean> selectShopMsgDetail(MsgMasterBean msgMasterBean);
/**오시라세 디테일 확인시 seen컬럼 1로 업데이트*/
public int updateMsgSeen(MsgMasterBean msgMasterBean);
/**msgType : 1인 메세지의 상세내용*/
public List<MsgMasterBean> selectMegDeltail(MsgMasterBean msgMasterBean);
/**유저 읽지 않은 통지 메세지 개수 반환*/
public MsgMasterBean selectNotReadNotice(MsgMasterBean msgMasterBean);
/**유저 읽지 않은 오시라세 메세지 개수 반환*/
public MsgMasterBean selectNotReadShopMsg(MsgMasterBean msgMasterBean);
/**통지 상세보기 읽음처리*/
public int updateNoticSeen(MsgMasterBean msgMasterBean);
}

View File

@ -0,0 +1,36 @@
package com.loglog.api.commons.daos;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.loglog.api.commons.beans.NotiAttachBean;
/**
* 공지사항 첨부파일 Dao
*
* @author "JIK"
*
*/
public interface NotiAttachDao {
/** 공지사항 첨부파일 정보 등록 */
public int insertNotiAttach(NotiAttachBean notiAttachBean);
/** 공지사항 첨부파일 정보 조회 */
public List<NotiAttachBean> selectNotiAttach(
@Param("notiId")String notiId,
@Param("serverUrlAdmin") String serverUrlAdmin
);
/** 공지사항 첨부파일 다운로드 정보 조회 */
public NotiAttachBean selectNotiAttachInfo(String notiAttachId);
/** 공지사항 첨부파일 정보 삭제 */
public int deleteNotiAttach(
@Param("notiAttachId")String notiAttachId
);
}

View File

@ -0,0 +1,42 @@
package com.loglog.api.commons.daos;
import java.util.List;
import com.loglog.api.commons.beans.NotiBean;
import com.loglog.api.commons.beans.PagingBean;
/**
* Noti Dao
* @author "JIK"
*
*/
public interface NotiDao {
/** 공지사항 SelectNotiList */
public List<NotiBean> selectNotiList(PagingBean pagingBean);
/** 공지사항 InsertNoti */
public int insertNoti(NotiBean notiBean);
/** 조회수 올리기 */
public void updateHit(NotiBean notiBean);
/** 공지사항 SelectNoti */
public NotiBean selectNoti(NotiBean notiBean);
/** 공지사항 UpdateNoti */
public int updateNoti(NotiBean notiBean);
/** 공지사항 DeleteNoti */
public int deleteNoti(NotiBean notiBean);
/** 공지사항 총 수 */
public int notiTotCnt(PagingBean pagingBean);
/** 공지사항 IndexList */
public List<NotiBean> selectNotiIndexList(PagingBean pagingBean);
}

View File

@ -0,0 +1,44 @@
package com.loglog.api.commons.daos;
import java.util.List;
import com.loglog.api.commons.beans.ShopMasterBean;
import com.loglog.api.commons.beans.PagingBean;
import com.loglog.api.commons.beans.ShopDetailBean;
/**
* Noti Dao
* @author "JIK"
*
*/
public interface ShopMasterDao {
/**상점 상세정보*/
public ShopDetailBean selectShopDetail(ShopDetailBean shopDetailBean);
/**유저 주위의 상점 리스트 출력*/
public List<ShopMasterBean> selectProxShopList(ShopMasterBean shopMasterBean);
/**room 생성하기 전 중복체크*/
public int selectCheckRoom(ShopMasterBean shopMasterBean);
/**상점 즐겨찾기 - room 추가*/
public int insertLikeShop(ShopMasterBean shopMasterBean);
/**상점 즐겨찾기 - tempo_liked 추가*/
public int insertLikeTempo(ShopMasterBean shopMasterBean);
/**상점 즐겨찾기 취소*/
public int calcelLikeShop(ShopMasterBean shopMasterBean);
/**상점 즐겨찾기 취소 - tempo_liked*/
public int deleteLikeTempo(ShopMasterBean shopMasterBean);
/**즐겨찾기한 상점 리스트 출력*/
public List<ShopDetailBean> selectShopList(ShopDetailBean shopDetailBean);
/**상점이름으로 검색 출력 리스트*/
public List<ShopDetailBean> selectSearchShopList(ShopDetailBean shopDetailBean);
}

View File

@ -0,0 +1,123 @@
package com.loglog.api.commons.daos;
import java.util.List;
import java.util.Map;
import com.loglog.api.commons.beans.PagingBean;
import com.loglog.api.commons.beans.UserBean;
/**
* 사용자 DAO
*
* @author SJG
*/
public interface UserDao {
/** 회원가입 */
public int insertUser(UserBean userBean);
/** UserCd값 가져오기 */
public String selectUserCdStr(UserBean userBean);
/** 아이디 중복 체크 */
public int chkUserId(UserBean userBean);
/**닉네임 중복 체크*/
public int chkNickName(UserBean userBean);
/**userCd 조회*/
public int selectUserCd(UserBean userBean);
/**로그인한 회원 정보 찾기 */
public UserBean selectUser(UserBean userBean);
/**로그인한 회원 상세정보 조회*/
public UserBean selectUserDetail(UserBean userBean);
/**세션아이디로 로그인한 회원 정보 찾기 */
public UserBean selectUserBySessionId(String sessionId);
/** 이전 세션쿠키로 로그인한 회원 확인 */
public UserBean selectUserByBeforeSessionId(String sessionId);
/** ID와 PW가 일치하는 회원 정보 찾기 */
public UserBean selectUserPW(UserBean userBean);
/**아이디 찾기 - JSON */
public String findUserId(UserBean userBean);
/**회원 비밀번호 찾을시 해당 정보 회원있는지 확인*/
public int findUser(UserBean userBean);
/**db에 새 비밀번호 세팅*/
public int updateUserPw(UserBean userBean);
/**update last login dt */
public int updLastLoginDt(UserBean userBean);
/**회원 정보 수정*/
public int updateUser(UserBean userBean);
/**회원 계좌 정보 수정*/
public int updateAccount(UserBean userBean);
/**db에 새 인출 비밀번호 세팅*/
public void updateAccountPw(UserBean userBean);
/**user table에 네이버 아이디 있는지 확인*/
public int searchNaverIdInUserTable(UserBean userBean);
/**사용자 총 수*/
public int userTotCnt(PagingBean pagingBean);
/**사용자 목록 조회*/
public List<UserBean> selectUserList(Map<String, Object> parameter);
/**사용자 목록 조회*/
public List<UserBean> selectUserListByPagingBean(PagingBean pagingBean);
/**사용자 상태 변경*/
public int updateUserStatusCd(UserBean userBean);
/**푸시알림, 자동로그인 설정값 변경*/
public int updateUserSetting(UserBean userBean);
/**사용자 답변 확인*/
public int userAnswerChk(UserBean userBean);
/**회원 탈퇴*/
public int deleteUser(UserBean userBean);
/**회원 비밀번호 찾을시 해당 정보 회원있는지 확인( 이름 -> 이메이로 대체)*/
public int findUserL(UserBean userBean);
/**db에 새 비밀번호 세팅 (이름 -> 이메일로 대체)*/
public int updateUserPwL(UserBean userBean);
/**이메일 체크 - JSON */
public String findUserEmail(UserBean userBean);
/** 사용자 목록 조회 정보 개수*/
public int countUserList(PagingBean pagingBean);
/** 회원 등급 수정 */
public void updateUserLevel(Map<String, Object> parameter);
/** 회원 탈퇴*/
public UserBean userDelete(UserBean userBean);
/** 회원이름 조회 */
public UserBean userName(UserBean userBean);
/**QR 로그인*/
public UserBean qRLogin(UserBean userBean);
/**비밀번호 수정 - 이메일을 모르고 UserCd를 아는 경우*/
public int selectKnowUserCd(UserBean userBean);
/** 사용자 이메일이 있는지 확인*/
public int selectCheckEmail(UserBean userBean);
/**이메일로 임시비밀번호를 보내면 비밀번호 업데이트*/
public int updatetempPw(UserBean userBean);
}

View File

@ -0,0 +1,152 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.loglog.api.commons.daos.BoardFileDao">
<sql id="boardFileColumn">
bd_file_no as bdFileNo,
bd_no as bdNo,
edu_no as eduNo,
reserve_no as reserveNo,
CONCAT("http://koreasurfing.org",file_path) as filePath,
file_origin_name as fileOriginName,
file_size as fileSize,
reg_dt as regDt,
upd_dt as updDt
</sql>
<!-- 게시글 이미지 등록 -->
<insert id="insertBoardFile" parameterType="com.loglog.api.commons.beans.BoardFileBean">
INSERT INTO tb_board_file(
bd_no,
edu_no,
reserve_no,
file_path,
file_origin_name,
file_size
) VALUES(
#{bdNo},
#{eduNo},
#{reserveNo},
#{filePath},
#{fileOriginName},
#{fileSize}
)
</insert>
<!-- 게시글 이미지/파일 수정 -->
<update id="updateBoardFile" parameterType="com.loglog.api.commons.beans.BoardFileBean">
UPDATE tb_board_file
SET
WHERE bd_no = #{bdNo}
AND file_path = #{filePath}
</update>
<!-- 게시글 이미지/파일 수정 -교육신청- -->
<update id="updateBoardFileEdu" parameterType="com.loglog.api.commons.beans.BoardFileBean">
UPDATE tb_board_file
SET
WHERE edu_no = #{eduNo}
AND file_path = #{filePath}
</update>
<!-- 한개의 게시글 이미지/파일 가져오기 -->
<select id="selectBoardFile" parameterType="int" resultType="com.loglog.api.commons.beans.BoardFileBean">
SELECT
<include refid="boardFileColumn" />
FROM tb_board_file
WHERE 1=1
AND bd_no = #{bdNo}
ORDER BY bd_file_no ASC
</select>
<!-- 한개의 게시글 이미지/파일 가져오기 -->
<select id="selectBoardFileEdu" parameterType="int" resultType="com.loglog.api.commons.beans.BoardFileBean">
SELECT
<include refid="boardFileColumn" />
FROM tb_board_file
WHERE 1=1
AND edu_no = #{eduNo}
ORDER BY bd_file_no ASC
</select>
<!-- 많은 게시물 이미지/파일들 가져오기 -->
<select id="boardFileList" resultType="com.loglog.api.commons.beans.BoardFileBean">
SELECT
<include refid="boardFileColumn"/>
FROM tb_board_file
WHERE 1=1
AND bd_no IN
<foreach collection="boardList" item="board" open="(" close=")" separator=",">
#{board.bdNo}
</foreach>
ORDER BY bd_no ASC
</select>
<!-- 많은 게시물 이미지/파일들 가져오기 - 교육신청 -->
<select id="boardFileListEdu" resultType="com.loglog.api.commons.beans.BoardFileBean">
SELECT
<include refid="boardFileColumn"/>
FROM tb_board_file
WHERE 1=1
AND bd_no IN
<foreach collection="educationList" item="edu" open="(" close=")" separator=",">
#{edu.eduNo}
</foreach>
ORDER BY bd_no ASC
</select>
<!-- 이미지/파일 삭제 -->
<delete id="deleteFile">
DELETE FROM tb_board_file
WHERE bd_no = #{bdNo}
</delete>
<!-- 이미지/파일 삭제 교육신청 -->
<delete id="deleteFileEdu">
DELETE FROM tb_board_file
WHERE edu_no = #{eduNo}
</delete>
<!-- 게시글 수정시 삭제할 이미지 목록 -->
<select id="deleteFileList" resultType="com.loglog.api.commons.beans.BoardFileBean">
SELECT
<include refid="boardFileColumn"/>
FROM tb_board_file
WHERE bd_no = #{bdNo}
<if test=' boardFileArray != null and boardFileArray.size() != 0 '>
AND file_path NOT IN
<foreach collection="boardFileArray" item="boardFile" open="(" close=")" separator=",">
#{boardFile}
</foreach>
</if>
</select>
<!-- 게시글 수정시 삭제할 이미지 목록 - 교육신청 -->
<select id="deleteFileListEdu" resultType="com.loglog.api.commons.beans.BoardFileBean">
SELECT
<include refid="boardFileColumn"/>
FROM tb_board_file
WHERE edu_no = #{eduNo}
<if test=' boardFileArray != null and boardFileArray.size() != 0 '>
AND file_path NOT IN
<foreach collection="boardFileArray" item="boardFile" open="(" close=")" separator=",">
#{boardFile}
</foreach>
</if>
</select>
<!-- 게시글 수정시 이미지/파일 삭제 -->
<delete id="deleteFileForUpdate">
DELETE FROM tb_board_file
WHERE 1=1
<if test=' boardFileList != null and boardFileList.size() != 0 '>
AND bd_file_no IN
<foreach collection="boardFileList" item="boardFile" open="(" close=")" separator=",">
#{boardFile.bdFileNo}
</foreach>
</if>
</delete>
</mapper>

View File

@ -0,0 +1,162 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.loglog.api.commons.daos.BoardImgDao">
<sql id="boardImgColumn">
bd_img_no as bdImgNo,
bd_no as bdNo,
edu_no as eduNo,
reserve_no as reserveNo,
CONCAT("http://koreasurfing.org", img_path) as imgPath,
img_origin_name as imgOriginName,
img_size as imgSize,
reg_dt as regDt,
upd_dt as updDt
</sql>
<!-- 게시글 이미지 등록 -->
<insert id="insertBoardImg" parameterType="com.loglog.api.commons.beans.BoardImgBean">
INSERT INTO
tb_board_img(
bd_no,
edu_no,
reserve_no,
img_path,
img_origin_name,
img_size
) VALUES (
#{bdNo},
#{eduNo},
#{reserveNo},
#{imgPath},
#{imgOriginName},
#{imgSize}
)
</insert>
<!-- 게시글 이미지 수정 -->
<update id="updateBoardImg" parameterType="com.loglog.api.commons.beans.BoardImgBean">
UPDATE tb_board_img
SET
WHERE bd_no = #{bdNo}
AND img_path = #{imgPath}
</update>
<!-- 게시글 이미지 수정 -교육신청 -->
<update id="updateBoardImgEdu" parameterType="com.loglog.api.commons.beans.BoardImgBean">
UPDATE tb_board_img
SET
WHERE edu_no = #{eduNo}
AND img_path = #{imgPath}
</update>
<!-- 한개의 개시글 이미지 가져오기 -->
<select id="selectBoardImg" parameterType="int" resultType="com.loglog.api.commons.beans.BoardImgBean">
SELECT
<include refid="boardImgColumn" />
FROM tb_board_img
WHERE 1=1
AND bd_no = #{bdNo}
ORDER BY bd_img_no ASC
</select>
<!-- 한개의 개시글 이미지 가져오기 교육신청-->
<select id="selectBoardImgEdu" parameterType="int" resultType="com.loglog.api.commons.beans.BoardImgBean">
SELECT
<include refid="boardImgColumn" />
FROM tb_board_img
WHERE 1=1
AND edu_no = #{eduNo}
ORDER BY bd_img_no ASC
</select>
<!-- 많은 게시물 이미지들 가져오기 -게시판- -->
<select id="boardImgList" resultType="com.loglog.api.commons.beans.BoardImgBean">
SELECT
<include refid="boardImgColumn"/>
FROM tb_board_img
WHERE 1=1
<if test=' boardList != null and boardList.size() > 0 '>
AND bd_no IN
<foreach collection="boardList" item="board" open="(" close=")" separator=",">
#{board.bdNo}
</foreach>
</if>
GROUP BY bd_no
ORDER BY bd_no DESC
</select>
<!-- 많은 게시물 이미지들 가져오기 -교육신청 관리자- -->
<select id="boardImgListEdu" resultType="com.loglog.api.commons.beans.BoardImgBean">
SELECT
<include refid="boardImgColumn"/>
FROM tb_board_img
WHERE 1=1
<if test=' educationList != null and educationList.size() > 0 '>
AND edu_no IN
<foreach collection="educationList" item="edu" open="(" close=")" separator=",">
#{edu.eduNo}
</foreach>
</if>
Group By edu_no
ORDER BY edu_no DESC
</select>
<!-- 이미지 삭제 -->
<delete id="deleteImg">
DELETE FROM tb_board_img
WHERE bd_no = #{bdNo}
</delete>
<!-- 이미지 삭제 - 교육신청 -->
<delete id="deleteImgEdu">
DELETE FROM tb_board_img
WHERE edu_no = #{eduNo}
</delete>
<!-- 게시글 수정시 삭제할 이미지 목록 -->
<select id="deleteImgList" resultType="com.loglog.api.commons.beans.BoardImgBean">
SELECT
<include refid="boardImgColumn"/>
FROM tb_board_img
WHERE bd_no = #{bdNo}
<if test=' boardImgArray != null and boardImgArray.size() > 0 '>
AND img_path NOT IN
<foreach collection="boardImgArray" item="boardImg" open="(" close=")" separator=",">
#{boardImg}
</foreach>
</if>
</select>
<!-- 게시글 수정시 삭제할 이미지 목록 - 교육신청- -->
<select id="deleteImgListEdu" resultType="com.loglog.api.commons.beans.BoardImgBean">
SELECT
<include refid="boardImgColumn"/>
FROM tb_board_img
WHERE edu_no = #{eduNo}
<if test=' boardImgArray != null and boardImgArray.size() > 0 '>
AND img_path NOT IN
<foreach collection="boardImgArray" item="boardImg" open="(" close=")" separator=",">
#{boardImg}
</foreach>
</if>
</select>
<!-- 게시글 수정시 이미지 삭제 -->
<delete id="deleteImgForUpdate">
DELETE FROM tb_board_img
WHERE 1=1
<if test=' boardImgList != null and boardImgList.size() > 0 '>
AND bd_img_no IN
<foreach collection="boardImgList" item="boardImg" open="(" close=")" separator=",">
#{boardImg.bdImgNo}
</foreach>
</if>
</delete>
</mapper>

View File

@ -0,0 +1,315 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.loglog.api.commons.daos.BoardDao">
<sql id="Y">
'Y'
</sql>
<sql id="N">
'N'
</sql>
<sql id="secretN">
'N'
</sql>
<sql id="categoryCodeId">
'1'
</sql>
<sql id="boardColumn">
bd_no as bdNo,
bd_type_cd as bdTypeCd,
bd_notice_yn as bdNoticeYn,
bd_secret_yn as bdSecretYn,
bd_pass as bdPass,
bd_category_cd as bdCategoryCd,
bd_title as bdTitle,
bd_cont as bdCont,
bd_img_cont as bdImgCont,
bd_thumb_img1 as bdThumbImg1,
bd_thumb_img2 as bdThumbImg2,
bd_writer_id as bdWriterId,
bd_writer_name as bdWriterName,
bd_hit as bdHit,
bd_reply_yn as bdReplyYn,
bd_apply_yn as bdApplyYn,
bd_admin_yn as bdAdminYn,
DATE_FORMAT(REG_DT,'%Y-%m-%d') as regDt,
DATE_FORMAT(UPD_DT,'$Y-%m-%d') as updDt
</sql>
<!-- 글 작성 -->
<insert id="insertBoard" parameterType="com.loglog.api.commons.beans.BoardBean">
INSERT INTO tb_board(
bd_type_cd,
bd_notice_yn,
bd_secret_yn,
bd_pass,
bd_reply_yn,
bd_apply_yn,
bd_admin_yn,
bd_category_cd,
bd_title,
bd_cont,
bd_img_cont,
bd_thumb_img1,
bd_thumb_img2,
bd_writer_id,
bd_writer_name
) VALUES(
#{bdTypeCd},
<choose>
<when test='bdNoticeYn != null and bdNoticeYn != "" '>
#{bdNoticeYn},
</when>
<otherwise>
<include refid="N"/>,
</otherwise>
</choose>
<choose>
<when test='bdSecretYn != null and bdSecretYn != "" '>
#{bdSecretYn},
</when>
<otherwise>
<include refid="secretN"/>,
</otherwise>
</choose>
#{bdPass},
<choose>
<when test='bdReplyYn != null and bdReplyYn != "" '>
#{bdReplyYn},
</when>
<otherwise>
<include refid="N"/>,
</otherwise>
</choose>
<choose>
<when test='bdApplyYn != null and bdApplyYn != "" '>
#{bdApplyYn},
</when>
<otherwise>
<include refid="N"/>,
</otherwise>
</choose>
<choose>
<when test='bdAdminYn != null and bdAdminYn != "" '>
#{bdAdminYn},
</when>
<otherwise>
<include refid="N"/>,
</otherwise>
</choose>
<choose>
<when test='bdCategoryCd != null and bdCategoryCd != "" '>
#{bdCategoryCd},
</when>
<otherwise>
null,
</otherwise>
</choose>
<choose>
<when test='bdTitle != null and bdTitle != "" '>
#{bdTitle},
</when>
<otherwise>
null,
</otherwise>
</choose>
<choose>
<when test='bdCont != null and bdCont != "" '>
#{bdCont},
</when>
<otherwise>
null,
</otherwise>
</choose>
<choose>
<when test='bdImgCont != null and bdImgCont != "" '>
#{bdImgCont},
</when>
<otherwise>
null,
</otherwise>
</choose>
#{bdThumbImg1},
#{bdThumbImg2},
#{bdWriterId},
#{bdWriterName}
)
<!-- 입력된 data의 bdNo를 반환한다 -->
<selectKey order="AFTER" keyProperty="bdNo" resultType="int">
SELECT LAST_INSERT_ID()
</selectKey>
</insert>
<!-- 게시글 수정 -->
<update id="updateBoard" parameterType="com.loglog.api.commons.beans.BoardBean">
UPDATE tb_board
SET
<choose>
<when test="bdCategoryCd != null and bdCategoryCd != '' ">
bd_category_cd = #{bdCategoryCd},
</when>
<otherwise>
bd_category_cd = null,
</otherwise>
</choose>
<choose>
<when test="bdNoticeYn != null and bdNoticeYn != '' ">
bd_notice_yn = #{bdNoticeYn},
</when>
<otherwise>
bd_notice_yn =
<include refid="N" />
,
</otherwise>
</choose>
<choose>
<when test="bdSecretYn != null and bdSecretYn != '' ">
bd_secret_yn = #{bdSecretYn},
</when>
<otherwise>
bd_secret_yn =
<include refid="secretN" />
,
</otherwise>
</choose>
<if test="bdWriterName != null and bdWriterName != '' ">
bd_writer_name = #{bdWriterName},
</if>
bd_title = #{bdTitle},
upd_dt = CURRENT_TIMESTAMP,
bd_cont = #{bdCont},
<if test="bdReplyYn != null and bdReplyYn != '' ">
bd_reply_yn = #{bdReplyYn},
</if>
<if test="bdApplyYn != null and bdApplyYn != '' ">
bd_apply_yn = #{bdApplyYn},
</if>
<if test="bdAdminYn != null and bdAdminYn != '' ">
bd_admin_yn = #{bdAdminYn},
</if>
<if test="bdThumbImg1 != null and bdThumbImg1 != '' ">
bd_thumb_img1 = #{bdThumbImg1},
</if>
<if test="bdThumbImg2 != null and bdThumbImg2 != '' ">
bd_thumb_img2 = #{bdThumbImg2},
</if>
<choose>
<when test="bdImgCont != null and bdImgCont != '' ">
bd_img_cont = #{bdImgCont}
</when>
<otherwise>
bd_img_cont = null
</otherwise>
</choose>
WHERE 1=1
AND bd_no = #{bdNo}
</update>
<!-- 조회수 update -->
<update id="updateHit" parameterType="com.loglog.api.commons.beans.BoardBean">
UPDATE tb_board
SET
bd_hit = bd_hit +1
WHERE 1=1
AND bd_no = #{bdNo}
</update>
<!-- 게시글 갯수 -->
<select id="selectBoardCount" parameterType="com.loglog.api.commons.beans.PagingBean" resultType="int">
SELECT COUNT(r.bd_no)
FROM (
select * from tb_board where 1=1
<if test='bdTypeCd != null and bdTypeCd != "" '>
AND bd_type_cd = #{bdTypeCd}
</if>
<choose>
<when test='searchKind == "title" and search != null and search != ""'>
AND bd_title like CONCAT('%', #{search}, '%')
</when>
<when test='searchKind == "author" and search != null and search != ""'>
AND bd_writer_id like CONCAT('%', #{search}, '%')
</when>
<when test='searchKind == "regdate" and search != null and search != ""'>
AND reg_dt like CONCAT('%',STR_TO_DATE(#{search}, '%Y%m%d'),'%')
</when>
<when test='searchKind == null and search != null and search != ""'>
AND (
bd_title like CONCAT('%', #{search}, '%')
OR bd_writer_id like CONCAT('%', #{search}, '%')
)
</when>
</choose>
) r
WHERE 1=1
</select>
<!-- 게시글 목록 가져오기 -->
<select id="boardList" parameterType="com.loglog.api.commons.beans.PagingBean" resultType="com.loglog.api.commons.beans.BoardBean">
SELECT
<include refid="boardColumn" />
, (SELECT COUNT(*) FROM tb_board_apply WHERE bd_no = b.bd_no) as totApplyCount
<if test=" userId != null and userId !='' ">
, (SELECT bd_apply_no FROM tb_board_apply WHERE bd_no = b.bd_no AND user_id = #{userId}) as bdApplyNo
</if>
FROM tb_board b
WHERE 1=1
<if test='bdTypeCd != null and bdTypeCd != "" '>
AND bd_type_cd = #{bdTypeCd}
</if>
<choose>
<when test='searchKind == "title" and search != null and search != ""'>
AND bd_title like CONCAT('%', #{search}, '%')
</when>
<when test='searchKind == "author" and search != null and search != ""'>
AND bd_writer_id like CONCAT('%', #{search}, '%')
</when>
<when test='searchKind == "regdate" and search != null and search != ""'>
AND reg_dt like CONCAT('%',STR_TO_DATE(#{search}, '%Y%m%d'),'%')
</when>
<when test='searchKind == null and search != null and search != ""'>
AND (
bd_title like CONCAT('%', #{search}, '%')
OR bd_writer_id like CONCAT('%', #{search}, '%')
)
</when>
</choose>
<choose>
<when test='orderByStr == "hit"'>
ORDER BY bdHit DESC
</when>
<otherwise>
ORDER BY bdNo DESC
</otherwise>
</choose>
LIMIT #{startRow}, #{countPerRecord}
</select>
<!-- 글 상세보기 -->
<select id="selectInBoard" parameterType="com.loglog.api.commons.beans.BoardBean" resultType="com.loglog.api.commons.beans.BoardBean">
SELECT
<include refid="boardColumn"/>
<!-- (SELECT code_name FROM tb_code WHERE code = b.bd_category_cd AND tb_code.code_grp_id = <include refid="categoryCodeId"/> ) AS bdCategory -->
, (SELECT COUNT(*) FROM tb_board_apply WHERE bd_no = b.bd_no) as totApplyCount
<if test=" bdWriterId != null and bdWriterId !='' ">
, (SELECT bd_apply_no FROM tb_board_apply WHERE bd_no = b.bd_no AND user_id = #{bdWriterId}) as bdApplyNo
</if>
FROM tb_board b
WHERE 1=1
AND bd_no = #{bdNo}
</select>
<!-- 게시글 삭제 -->
<delete id="deleteBoard" parameterType="com.loglog.api.commons.beans.BoardBean">
DELETE FROM tb_board
WHERE 1=1
AND bd_no = #{bdNo}
</delete>
</mapper>

View File

@ -0,0 +1,166 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.loglog.api.commons.daos.BoardReplyDao">
<sql id="replyColumn">
reply_no as replyNo,
bd_no as bdNo,
reply_cont as replyCont,
reply_writer_id as replyWriterId,
reply_writer_name as replyWriterName,
reply_writer_level as replyWriterLevel,
secret_yn as secretYn,
reply_pass as replyPass,
reg_dt as regDt,
upd_dt as updDt
</sql>
<!-- 댓글 입력 -->
<insert id="insertReply" parameterType="com.loglog.api.commons.beans.BoardReplyBean">
INSERT INTO tb_board_reply (
bd_no,
reply_cont,
reply_writer_id,
reply_writer_name,
reply_writer_level,
secret_yn
)VALUES(
#{bdNo},
#{replyCont},
#{replyWriterId},
#{replyWriterName},
#{replyWriterLevel},
<choose>
<when test="secretYn != null and secretYn != '' ">
#{secretYn}
</when>
<otherwise>
'N'
</otherwise>
</choose>
)
</insert>
<!-- 댓글 비밀번호 + 입력 -->
<insert id="insertNeedPassReply" parameterType="com.loglog.api.commons.beans.BoardReplyBean">
INSERT INTO tb_board_reply (
bd_no,
reply_cont,
reply_pass,
reply_writer_id,
reply_writer_name,
secret_yn
)VALUES(
#{bdNo},
#{replyCont},
#{replyPass},
#{replyWriterId},
#{replyWriterName},
<choose>
<when test="secretYn != null and secretYn != '' ">
#{secretYn}
</when>
<otherwise>
'N'
</otherwise>
</choose>
)
</insert>
<!-- 댓글 목록 갯수 -->
<select id="replyListCount" parameterType="com.loglog.api.commons.beans.PagingBean" resultType="int">
SELECT
COUNT(*)
FROM
tb_board_reply
WHERE
bd_no = #{bdNo}
</select>
<!-- 댓글 목록 -->
<select id="replyList" parameterType="com.loglog.api.commons.beans.PagingBean" resultType="com.loglog.api.commons.beans.BoardReplyBean">
SELECT
<include refid="replyColumn"/>
FROM
tb_board_reply
WHERE
<if test="bdNo != null and bdNo != '' ">
bd_no = #{bdNo}
</if>
ORDER BY reply_no DESC
LIMIT #{startRow}, #{countPerRecord}
</select>
<!-- 댓글 1건 삭제 -->
<delete id="deleteReply" parameterType="com.loglog.api.commons.beans.BoardReplyBean">
DELETE FROM tb_board_reply
WHERE
reply_no = #{replyNo}
<if test='adminYn != null and adminYn != "" and adminYn == "N"'>
AND reply_writer_id = #{replyWriterId}
</if>
</delete>
<!-- 댓글 + 비밀번호 1건 삭제 -->
<delete id="deleteNeedPassReply" parameterType="com.loglog.api.commons.beans.BoardReplyBean">
DELETE FROM tb_board_reply
WHERE
reply_no = #{replyNo}
<if test='adminYn != null and adminYn != "" and adminYn == "N"'>
AND reply_writer_id = #{replyWriterId}
</if>
</delete>
<!-- 댓글 여러건 삭제 -->
<delete id="deleteReplyList" parameterType="com.loglog.api.commons.beans.BoardReplyBean">
DELETE FROM tb_board_reply
WHERE
bd_no = #{bdNo}
</delete>
<!-- 댓글 수정 -->
<update id="updateReply" parameterType="com.loglog.api.commons.beans.BoardReplyBean">
UPDATE tb_board_reply
SET
reply_cont = #{replyCont}
WHERE
reply_no = #{replyNo}
<if test='adminYn != null and adminYn != "" and adminYn == "N"'>
AND reply_writer_id = #{replyWriterId}
</if>
</update>
<!-- 댓글 수정(비밀번호) -->
<update id="updateNeedPassReply" parameterType="com.loglog.api.commons.beans.BoardReplyBean">
UPDATE tb_board_reply
SET
reply_cont = #{replyCont}
WHERE
reply_no = #{replyNo}
<if test='adminYn != null and adminYn != "" and adminYn == "N"'>
AND reply_pass = #{replyPass}
</if>
</update>
<!-- 댓글 하나 가져오기 -->
<select id="selectTheReply" parameterType="com.loglog.api.commons.beans.BoardReplyBean" resultType="com.loglog.api.commons.beans.BoardReplyBean">
SELECT
<include refid="replyColumn"/>
FROM
tb_board_reply
WHERE
reply_no = #{replyNo}
</select>
<!-- 댓글 비밀번호 매칭 가져오기 -->
<select id="selectReplyPass" parameterType="com.loglog.api.commons.beans.BoardReplyBean" resultType="int">
SELECT
COUNT(*)
FROM
tb_board_reply
WHERE
reply_no = #{replyNo} and
reply_pass = #{replyPass}
</select>
</mapper>

View File

@ -0,0 +1,264 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.loglog.api.commons.daos.CalenderDao">
<sql id="CalenderColumn">
insuser_cd AS insuserCd,
insdatetime AS insdatetime,
upduser_cd AS upduserCd,
updatetime AS updatetime,
user_cd AS userCd,
shop_cd AS shopCd,
shop_nm AS shopNm,
nikki_title AS nikkiTitle,
nikki_text AS nikkiText,
thumbnail1 AS thumbnail1,
thumbnail2 AS thumbnail2,
thumbnail3 AS thumbnail3,
connect_kbn AS connectKbn,
url AS url,
location AS location,
end_raiten_time AS endRaitenTime,
color AS color,
allday AS allday,
raiten_time AS raitenTime
</sql>
<!-- 상점정보 유무체크 -->
<select id="selectShopInfo" parameterType="com.loglog.api.commons.beans.CalenderBean" resultType="int">
SELECT
count(shop_cd)
FROM mst0010
WHERE shop_cd=#{shopCd}
and shop_nm=#{shopNm}
</select>
<!-- QR로 내점기록 저장 -->
<insert id="insertCalender" parameterType="com.loglog.api.commons.beans.CalenderBean">
INSERT INTO trn0012 (
insuser_cd,
insdatetime,
upduser_cd,
updatetime,
user_cd,
shop_cd,
shop_nm,
raiten_time,
thumbnail1,
thumbnail2,
thumbnail3,
connect_kbn
) VALUES(
#{insuserCd},
now(),
#{userCd},
now(),
#{userCd},
#{shopCd},
#{shopNm},
now(),
'',
'',
'',
'1'
)
</insert>
<!-- 월별 캘린더 조회 -->
<select id="selectCalenderMon" parameterType="com.loglog.api.commons.beans.CalenderBean" resultType="com.loglog.api.commons.beans.CalenderBean">
select
<include refid="CalenderColumn"/>
from trn0012
where user_cd = #{userCd}
and raiten_time >= TO_TIMESTAMP(#{startMon},'YYYYMMDD')
and TO_TIMESTAMP(#{endMon},'YYYYMMDD') >= raiten_time
</select>
<!-- 캘린더 스케줄 저장 -->
<insert id="insertSchedule" parameterType="com.loglog.api.commons.beans.CalenderBean">
INSERT INTO trn0012 (
insuser_cd,
insdatetime,
upduser_cd,
updatetime,
user_cd,
nikki_title,
nikki_text,
location,
allday,
raiten_time,
end_raiten_time,
color,
url
) VALUES(
#{userCd},
now(),
#{userCd},
now(),
#{userCd},
#{nikkiTitle},
#{nikkiText},
#{location},
#{allday},
TO_TIMESTAMP(#{raitenTime},'YYYYMMDD HH24:MI'),
<choose>
<when test='allday == "0"'>
#{endRaitenTime},
</when>
<when test='allday == "1"'>
null,
</when>
</choose>
#{color},
#{url}
)
</insert>
<!-- 일별 캘린더 조회 -->
<select id="selectCalenderDay" parameterType="com.loglog.api.commons.beans.CalenderBean" resultType="com.loglog.api.commons.beans.CalenderBean">
select
<include refid="CalenderColumn"/>
from trn0012 t
where user_cd = #{userCd}
and to_char(raiten_time,'YYYYMMDD') = #{raitenTime}
</select>
<!-- 스케줄 업데이트 -->
<update id="updateCalender" parameterType="com.loglog.api.commons.beans.CalenderBean">
UPDATE trn0012
SET
updatetime = now()
<if test="nikkiTitle != null and nikkiTitle != ''">
,nikki_title = #{nikkiTitle}
</if>
<if test="nikkiText != null and nikkiText != ''">
,nikki_text = #{nikkiText}
</if>
,allday = #{allday}
<if test="location != null and location != ''">
,location = #{location}
</if>
<choose>
<when test='allday == "0"'>
,end_raiten_time = #{endRaitenTime}
,raiten_time = TO_TIMESTAMP(#{raitenTime},'YYYY-MM-DD HH24:MI')
</when>
<when test='allday == "1"'>
,end_raiten_time = null
</when>
</choose>
<if test="color != null and color != ''">
,color = #{color}
</if>
<if test="url != null and url != ''">
,url = #{url}
</if>
where 1 = 1
and user_cd = #{userCd}
and to_char(insdatetime ,'YYYYMMDD HH24:MI') = #{insdatetime}
</update>
<!-- 상점정보 유무체크 -->
<select id="selectCalenderId" parameterType="com.loglog.api.commons.beans.CalenderBean" resultType="com.loglog.api.commons.beans.CalenderBean">
select
<include refid="CalenderColumn" />
from trn0012 t
where user_cd = #{userCd}
and insuser_cd = #{insuserCd}
</select>
<!-- 스케줄 업데이트 -->
<update id="updateCalenderthum" parameterType="com.loglog.api.commons.beans.CalenderBean">
UPDATE trn0012
SET
updatetime = now()
<if test="nikkiTitle != null and nikkiTitle != ''">
,nikki_title = #{nikkiTitle}
</if>
<if test="nikkiText != null and nikkiText != ''">
,nikki_text = #{nikkiText}
</if>
,thumbnail1 = #{thumbnail1}
,thumbnail2 = #{thumbnail2}
,thumbnail3 = #{thumbnail3}
where 1 = 1
and user_cd = #{userCd}
and insuser_cd = #{insuserCd}
</update>
<!-- 스케줄 업데이트 -->
<update id="cleanCalenderThum" parameterType="com.loglog.api.commons.beans.CalenderBean">
UPDATE trn0012
SET
thumbnail1 = null
,thumbnail2 = null
,thumbnail3 = null
where 1 = 1
and user_cd = #{userCd}
and insuser_cd = #{insuserCd}
</update>
<!-- 업데이트 이후 ID값을 이용해 조회후 출력 -->
<select id="selectUpdateId" parameterType="com.loglog.api.commons.beans.CalenderBean" resultType="com.loglog.api.commons.beans.CalenderBean">
select
insuser_cd AS insuserCd,
insdatetime AS insdatetime,
upduser_cd AS upduserCd,
updatetime AS updatetime,
user_cd AS userCd,
shop_cd AS shopCd,
shop_nm AS shopNm,
nikki_title AS nikkiTitle,
nikki_text AS nikkiText,
CONCAT(#{baseImgUrl}, thumbnail1) as thumbnail1,
CONCAT(#{baseImgUrl}, thumbnail2) as thumbnail2,
CONCAT(#{baseImgUrl}, thumbnail3) as thumbnail3,
connect_kbn AS connectKbn,
url AS url,
location AS location,
end_raiten_time AS endRaitenTime,
color AS color,
allday AS allday,
raiten_time AS raitenTime
from trn0012 t
where user_cd = #{userCd}
and insuser_cd = #{insuserCd}
</select>
<!-- 내점이력 삭제 -->
<delete id="deleteVisitCalender" parameterType="com.loglog.api.commons.beans.CalenderBean">
delete
from trn0012
where user_cd = #{userCd}
and insuser_cd = #{insuserCd}
</delete>
<!-- 내점이력 리스트 조회 -->
<select id="selectVisitList" parameterType="com.loglog.api.commons.beans.CalenderBean" resultType="com.loglog.api.commons.beans.CalenderBean">
select
insuser_cd AS insuserCd,
insdatetime AS insdatetime,
upduser_cd AS upduserCd,
updatetime AS updatetime,
user_cd AS userCd,
shop_cd AS shopCd,
shop_nm AS shopNm,
nikki_title AS nikkiTitle,
nikki_text AS nikkiText,
CONCAT(#{baseImgUrl}, thumbnail1) as thumbnail1,
CONCAT(#{baseImgUrl}, thumbnail2) as thumbnail2,
CONCAT(#{baseImgUrl}, thumbnail3) as thumbnail3,
connect_kbn AS connectKbn,
url AS url,
location AS location,
end_raiten_time AS endRaitenTime,
color AS color,
allday AS allday,
raiten_time AS raitenTime
from trn0012 t
where user_cd = #{userCd}
and shop_cd = #{shopCd}
</select>
</mapper>

View File

@ -0,0 +1,283 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.loglog.api.commons.daos.CardMasterDao">
<sql id="CardMasterColumn">
A.updatetime as updatetime,
A.user_cd as userCd,
A.jan_no as janNo,
A.card_nm as cardNm,
A.shop_group_cd as shopGroupCd,
CONCAT(#{baseImgUrl}, A.card_image) as cardImage,
B.shop_cd as shopCd,
A.e_date as eDate,
A.up_date as upDate,
A.now_point as nowPoint,
B.barcode_kbn as barcodeKbn,
A.cust_cd as custCd
</sql>
<!-- 유저 카드 리스트 출력 -->
<select id="selectCardList" parameterType="com.loglog.api.commons.beans.CardMasterBean" resultType="com.loglog.api.commons.beans.CardMasterBean">
select
A.updatetime as updatetime,
A.user_cd as userCd,
A.jan_no as janNo,
A.card_nm as cardNm,
A.shop_group_cd as shopGroupCd,
CASE
WHEN A.card_image is not null THEN CONCAT(#{baseImgUrl}, A.card_image)
WHEN A.card_image is null and A.shop_cd is not null then CONCAT(#{baseImgUrl2}, '/', A.shop_cd, '/',B.thumbnail1)
else null
END AS cardImage,
A.shop_cd as shopCd,
B.shop_nm as shopNm,
A.e_date as eDate,
A.up_date as upDate,
A.now_point as nowPoint,
B.barcode_kbn as barcodeKbn,
A.cust_cd as custCd
from mst0017 A
left join mst0010 B on B.shop_cd = A.shop_cd
where user_cd = #{userCd}
order by updatetime desc
</select>
<!-- 카드 등록 -->
<insert id="insertCard" parameterType="com.loglog.api.commons.beans.CardMasterBean">
INSERT INTO mst0017 (
insuser_cd,
insdatetime,
upduser_cd,
updatetime,
user_cd,
jan_no,
card_nm,
card_image,
shop_cd
) VALUES(
#{userCd},
now(),
#{userCd},
now(),
#{userCd},
#{janNo},
#{cardNm},
#{cardImage},
#{shopCd}
)
</insert>
<!-- 카드 등록 -->
<insert id="insertCardNoimg" parameterType="com.loglog.api.commons.beans.CardMasterBean">
INSERT INTO mst0017 (
insuser_cd,
insdatetime,
upduser_cd,
updatetime,
user_cd,
jan_no,
card_nm
) VALUES(
#{userCd},
now(),
#{userCd},
now(),
#{userCd},
#{janNo},
#{cardNm}
)
</insert>
<!-- 유저 카드 이름 중복체크 -->
<select id="checkCardNm" parameterType="com.loglog.api.commons.beans.CardMasterBean" resultType="int">
select
count(card_nm)
from mst0017
where card_nm = #{cardNm}
and user_cd = #{userCd}
and jan_no = #{janNo}
</select>
<!-- 유저 카드 이름 중복체크 -->
<select id="checkCardNmUpdate" parameterType="com.loglog.api.commons.beans.CardMasterBean" resultType="int">
select
count(card_nm)
from mst0017
where card_nm = #{chanCardNm}
and user_cd = #{userCd}
and jan_no = #{chanJanNo}
</select>
<!-- 유저 카드정보 수정 -->
<update id="updateCard" parameterType="com.loglog.api.commons.beans.CardMasterBean">
UPDATE mst0017
SET
card_nm = #{chanCardNm}
,jan_no = #{chanJanNo}
,updatetime = now()
<choose>
<when test='cardImage != null and cardImage != "" '>
,card_image =#{cardImage}
</when>
<otherwise>
,card_image = null
</otherwise>
</choose>
WHERE 1=1
AND user_cd = #{userCd}
and card_nm = #{cardNm}
and jan_no = #{janNo}
</update>
<!-- 유저 카드정보 수정 -->
<update id="updateCardNoimg" parameterType="com.loglog.api.commons.beans.CardMasterBean">
UPDATE mst0017
SET
card_nm = #{chanCardNm}
,jan_no = #{chanJanNo}
,updatetime = now()
WHERE 1=1
AND user_cd = #{userCd}
and card_nm = #{cardNm}
and jan_no = #{janNo}
</update>
<!-- 카드삭제 -->
<delete id="deleteCard" parameterType="com.loglog.api.commons.beans.CardMasterBean">
delete
from mst0017
where user_cd = #{userCd}
and jan_no = #{janNo}
and card_nm = #{cardNm}
</delete>
<!-- 자세한 카드정보 -->
<select id="detailCard" parameterType="com.loglog.api.commons.beans.CardMasterBean" resultType="com.loglog.api.commons.beans.CardMasterBean">
select
A.updatetime as updatetime,
A.user_cd as userCd,
A.jan_no as janNo,
A.card_nm as cardNm,
A.shop_group_cd as shopGroupCd,
A.card_image as cardImage,
B.shop_cd as shopCd,
A.e_date as eDate,
A.up_date as upDate,
A.now_point as nowPoint,
B.barcode_kbn as barcodeKbn,
A.cust_cd as custCd
from mst0017 A
LEFT JOIN mst0010 B ON B.shop_nm = A.card_nm
where user_cd = #{userCd}
and card_nm = #{cardNm}
and jan_no = #{janNo}
</select>
<!-- 포인트값 더하기 -->
<update id="updatePoint" parameterType="com.loglog.api.commons.beans.CardMasterBean">
UPDATE mst0017 SET
now_point = now_point + #{point} ,
updatetime = now()
where user_cd = #{userCd}
and card_nm = #{cardNm}
and jan_no = #{janNo}
</update>
<!-- 포인트값 빼기 -->
<update id="deletePoint" parameterType="com.loglog.api.commons.beans.CardMasterBean">
UPDATE mst0017 SET
now_point = now_point - #{point} ,
updatetime = now()
where user_cd = #{userCd}
and card_nm = #{cardNm}
and jan_no = #{janNo}
</update>
<!-- 포인트값 null을 0값으로 넣기 -->
<update id="changZeroPoint" parameterType="com.loglog.api.commons.beans.CardMasterBean">
UPDATE mst0017 SET
now_point = 0
where user_cd = #{userCd}
and card_nm = #{cardNm}
and jan_no = #{janNo}
</update>
<!-- 포인트 조회 -->
<select id="selectPoint" parameterType="com.loglog.api.commons.beans.CardMasterBean" resultType="int">
select
COALESCE(now_point, 0) as nowPoint
from mst0017
where user_cd = #{userCd}
and card_nm = #{cardNm}
and jan_no = #{janNo}
</select>
<!-- 즐겨찾기 카드 조회 -->
<select id="selectLikeCardList" parameterType="com.loglog.api.commons.beans.CardMasterBean" resultType="com.loglog.api.commons.beans.CardMasterBean">
select
A.updatetime as updatetime,
A.user_cd as userCd,
A.jan_no as janNo,
A.card_nm as cardNm,
A.shop_group_cd as shopGroupCd,
CONCAT(#{baseImgUrl}, A.card_image) as cardImage,
B.shop_cd as shopCd,
A.e_date as eDate,
A.up_date as upDate,
A.now_point as nowPoint,
B.barcode_kbn as barcodeKbn,
A.cust_cd as custCd
from mst0017 A
LEFT JOIN mst0010 B ON B.shop_nm = A.card_nm
where user_cd = #{userCd}
and cust_cd = '1'
</select>
<!-- 카드 좋아요 -->
<update id="likeCard" parameterType="com.loglog.api.commons.beans.CardMasterBean">
UPDATE mst0017 SET
cust_cd = 1
where user_cd = #{userCd}
and card_nm = #{cardNm}
and jan_no = #{janNo}
</update>
<!-- 카드 좋아요 취소 -->
<update id="unlikeCard" parameterType="com.loglog.api.commons.beans.CardMasterBean">
UPDATE mst0017 SET
cust_cd = 0
where user_cd = #{userCd}
and card_nm = #{cardNm}
and jan_no = #{janNo}
</update>
<!-- 유저 카드 리스트 출력 -->
<select id="selectNotRegisShopList" parameterType="com.loglog.api.commons.beans.CardMasterBean" resultType="com.loglog.api.commons.beans.ShopMasterBean">
select
m.shop_cd as shopCd
,m.shop_nm as shopNm
,m.shop_kn as shopKn
,CONCAT(#{baseImgUrl}, '/', m.shop_cd , '/', m.thumbnail1) as thumbnail1
,m.shop_phone as shopPhone
,m.shop_add1 as shopAdd1
,m.shop_add2 as shopAdd2
,m.category_cd as categoryCd
,CASE
WHEN CL.shop_cd IS NOT NULL THEN 1
ELSE 0
END AS liked
,m.shop_cd
from mst0010 m
left join tempo_liked CL on CL.shop_cd = m.shop_cd and CL.user_cd= #{userCd}
where m.shop_cd not in (
select shop_cd from mst0017 where user_cd = #{userCd} and shop_cd is not null
)
order by liked desc;
</select>
</mapper>

View File

@ -0,0 +1,69 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.loglog.api.commons.daos.CouponMasterDao">
<sql id="CouponMasterColumn">
insuser_cd AS insuserCd,
insdatetime AS insdatetime,
upduser_cd AS upduserCd,
updatetime AS updatetime,
shop_cd AS shopCd,
unique_coupon_cd AS couponCd,
coupon_goods AS couponGoods,
effect_srt AS effectSrt,
effect_end AS effectEnd,
coupon_discount AS couponDiscount,
CONCAT(#{baseImgUrl}, '/', shop_cd , '/', thumbnail1) as thumbnail1,
thumbnail2 AS thumbnail2,
thumbnail3 AS thumbnail3,
user_cd AS userCd,
connect_kbn AS connectKbn,
used AS used,
background AS background,
color AS color,
prefecture AS prefecture,
age AS age,
gender AS gender,
birthday AS birthday,
rank AS rank,
visit_condition AS visit_condition
</sql>
<!-- 유저 쿠폰개수 반환 -->
<select id="selectCouponPage" parameterType="com.loglog.api.commons.beans.CouponMasterBean" resultType="int">
SELECT
count(user_cd)
FROM mst0012 A, mst0010 B
WHERE used = '0'
AND A.shop_cd = B.shop_cd
AND user_cd = #{userCd}
AND to_char(Now(),'YYYYMMDD') >= effect_srt
AND (effect_end >= to_char(Now(),'YYYYMMDD'))
</select>
<!-- 유저 쿠폰정보 디테일 -->
<select id="selectCouponDetail" parameterType="com.loglog.api.commons.beans.CouponMasterBean" resultType="com.loglog.api.commons.beans.CouponMasterBean">
select
unique_coupon_cd AS couponCd
,shop_cd AS shopCd
,effect_srt AS effectSrt
,effect_end AS effectEnd
,coupon_goods AS couponGoods
,coupon_discount AS couponDiscount
,CONCAT(#{baseImgUrl}, '/', shop_cd , '/', thumbnail1) as thumbnail1
,thumbnail2 AS thumbnail2
,thumbnail3 AS thumbnail3
,connect_kbn AS connectKbn
,background AS background
,color AS color
,prefecture AS prefecture
,age AS age
,gender AS gender
,birthday AS birthday
,rank AS rank
,visit_condition AS visitCondition
from coupons
where unique_coupon_cd = #{couponCd}::INTEGER
</select>
</mapper>

View File

@ -0,0 +1,435 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.loglog.api.commons.daos.CouponPublicDao">
<sql id="CouponPublicColumn">
COALESCE(cpnTrn.used, 0) as used,
CASE
WHEN CL.unique_coupon_cd IS NOT NULL THEN 1
ELSE 0
END AS liked,
coupons.unique_coupon_cd as couponCd,
coupons.shop_cd as shopCd ,
mst0010.shop_add1 as shopAdd1,
mst0010.shop_add2 as shopAdd2,
mst0010.shop_nm as shopNm,
mst0010.category_cd as categoryCd,
coupons.coupon_goods as couponGoods,
coupons.effect_srt as effectSrt,
coupons.effect_end as effectEnd,
coupons.coupon_discount as couponDiscount,
CONCAT(#{baseImgUrl2}, '/', coupons.shop_cd, '/',mst0010.thumbnail1) as shopimage,
CONCAT(#{baseImgUrl}, '/', coupons.shop_cd , '/', coupons.thumbnail1) as thumbnail1,
coupons.thumbnail2 as thumbnail2,
coupons.thumbnail3 as thumbnail3,
mst0010.thumbnail1 as shopThumbNail1,
coupons.thumbnail1 as couponThumbnail1,
coupons.connect_kbn as connectKbn,
coupons.color as color,
coupons.visit_condition as visitCondition,
'0' as proximity
</sql>
<!-- 게시글 갯수 -->
<select id="selectCouponCount" parameterType="Map" resultType="int">
SELECT
count(coupons.unique_coupon_cd)
from coupons
left join (select unique_coupon_cd, used from coupons_used where user_cd= #{userCd}) cpnTrn
on cpnTrn.unique_coupon_cd = coupons.unique_coupon_cd
left join mst0010 on coupons.shop_cd = mst0010.shop_cd
left join geolocations GEO on GEO.shop_cd = mst0010.shop_cd
left join (select unique_coupon_cd , user_cd from coupons_liked where user_cd= #{userCd}) CL on CL.unique_coupon_cd = coupons.unique_coupon_cd
WHERE
(effect_end >= to_char(Now(),'YYYYMMDD')
and to_char(Now(),'YYYYMMDD') >= effect_srt)
<choose>
<when test='categoryCd != null and categoryCd != ""'>
and category_cd = #{categoryCd}
</when>
</choose>
<choose>
<when test='searchKind == null and search != null and search != ""'>
AND (
mst0010.shop_nm Ilike CONCAT('%', #{search}, '%')
)
</when>
</choose>
</select>
<!-- 유저 쿠폰값 출력(위경도 없음) -->
<select id="selectGetCoupons" parameterType="Map" resultType="com.loglog.api.commons.beans.CouponUserListBean">
SELECT
<include refid="CouponPublicColumn" />
from coupons
left join (select unique_coupon_cd, used from coupons_used where user_cd= #{userCd}) cpnTrn
on cpnTrn.unique_coupon_cd = coupons.unique_coupon_cd
left join mst0010 on coupons.shop_cd = mst0010.shop_cd
left join geolocations GEO on GEO.shop_cd = mst0010.shop_cd
left join (select unique_coupon_cd , user_cd from coupons_liked where user_cd= #{userCd} ) CL on CL.unique_coupon_cd = coupons.unique_coupon_cd
WHERE
(effect_end >= to_char(Now(),'YYYYMMDD')
and to_char(Now(),'YYYYMMDD') >= effect_srt)
<choose>
<when test='categoryCd != null and categoryCd != ""'>
and category_cd = #{categoryCd}
</when>
</choose>
<choose>
<when test='searchKind == null and search != null and search != ""'>
AND (
mst0010.shop_nm Ilike CONCAT('%', #{search}, '%')
)
</when>
</choose>
order by cpnTrn.used desc, liked desc, proximity asc, effect_srt desc
LIMIT #{countPerRecord} OFFSET #{startRow}
</select>
<!-- 유저 쿠폰값 출력(위경도 있음) -->
<select id="selectGeoGetCoupons" parameterType="Map" resultType="com.loglog.api.commons.beans.CouponUserListBean">
SELECT
COALESCE(cpnTrn.used, 0) as used,
CASE
WHEN CL.unique_coupon_cd IS NOT NULL THEN 1
ELSE 0
END AS liked ,
coupons.unique_coupon_cd as couponCd,
coupons.shop_cd as shopCd ,
mst0010.shop_add1 as shopAdd1,
mst0010.shop_add2 as shopAdd2,
mst0010.shop_nm as shopNm,
mst0010.category_cd as categoryCd,
coupons.coupon_goods as couponGoods,
coupons.effect_srt as effectSrt,
coupons.effect_end as effectEnd,
coupons.coupon_discount as couponDiscount,
CONCAT(#{baseImgUrl2}, '/', coupons.shop_cd, '/',mst0010.thumbnail1) as shopimage,
CONCAT(#{baseImgUrl}, '/', coupons.shop_cd , '/', coupons.thumbnail1) as thumbnail1,
coupons.thumbnail2 as thumbnail2,
coupons.thumbnail3 as thumbnail3,
mst0010.thumbnail1 as shopThumbNail1,
coupons.thumbnail1 as couponThumbnail1,
coupons.connect_kbn as connectKbn,
coupons.color as color,
coupons.visit_condition as visitCondition,
(ABS(GEO.longtitude::FLOAT-ABS(#{longtitude}))+ABS(GEO.latitude::FLOAT-ABS(#{latitude}))) as proximity
from coupons
left join (select unique_coupon_cd, used from coupons_used where user_cd= #{userCd}) cpnTrn
on cpnTrn.unique_coupon_cd = coupons.unique_coupon_cd
left join mst0010 on coupons.shop_cd = mst0010.shop_cd
left join geolocations GEO on GEO.shop_cd = mst0010.shop_cd
left join (select unique_coupon_cd , user_cd from coupons_liked where user_cd= #{userCd} ) CL on CL.unique_coupon_cd = coupons.unique_coupon_cd
WHERE
(effect_end >= to_char(Now(),'YYYYMMDD')
and to_char(Now(),'YYYYMMDD') >= effect_srt)
<choose>
<when test='categoryCd != null and categoryCd != ""'>
and category_cd = #{categoryCd}
</when>
</choose>
<choose>
<when test='searchKind == null and search != null and search != ""'>
AND (
mst0010.shop_nm Ilike CONCAT('%', #{search}, '%')
)
</when>
</choose>
order by proximity asc, liked desc, cpnTrn.used desc, effect_srt desc
LIMIT #{countPerRecord} OFFSET #{startRow}
</select>
<!-- 쿠폰등록(유료회원이 아닐때) -->
<insert id="insertCouponNotPaid" parameterType="com.loglog.api.commons.beans.CouponPublicBean">
INSERT INTO coupons (
unique_coupon_cd,
updatetime,
shop_cd,
coupon_goods,
effect_srt,
effect_end,
coupon_discount,
thumbnail1,
thumbnail2,
thumbnail3,
connect_kbn,
visit_condition
) VALUES(
nextval('unique_coupon_cd_seq'),
now(),
#{shopCd},
#{couponGoods},
#{effectSrt},
#{effectEnd},
#{couponDiscount},
#{thumbnail1},
#{thumbnail2},
#{thumbnail3},
#{connectKbn},
#{visitCondition}
)
</insert>
<!-- 쿠폰등록(유료회원일때) -->
<insert id="insertCouponPaid" parameterType="com.loglog.api.commons.beans.CouponUserListBean">
INSERT INTO coupons (
unique_coupon_cd,
updatetime,
shop_cd,
coupon_goods,
effect_srt,
effect_end,
coupon_discount,
thumbnail1,
thumbnail2,
thumbnail3,
connect_kbn,
background,
color,
prefecture,
age,
gender,
birthday,
rank,
visit_condition
) VALUES(
nextval('unique_coupon_cd_seq'),
now(),
#{shopCd},
#{couponGoods},
#{effectSrt},
#{effectEnd},
#{couponDiscount},
#{thumbnail1},
#{thumbnail2},
#{thumbnail3},
#{connectKbn},
#{background},
#{color},
#{prefecture},
#{age},
#{gender},
#{birthday},
#{rank},
#{visitCondition}
)
</insert>
<!-- 게시글 갯수 -->
<select id="selectLikeCouponCount" parameterType="Map" resultType="int">
select
count(A.unique_coupon_cd)
from coupons A
LEFT JOIN coupons_liked B ON B.unique_coupon_cd = A.unique_coupon_cd
left join mst0010 on A.shop_cd = mst0010.shop_cd
where B.user_cd = #{userCd}
AND (effect_end >= to_char(Now(),'YYYYMMDD')
and to_char(Now(),'YYYYMMDD') >= effect_srt)
<choose>
<when test='searchKind == "title" and search != null and search != ""'>
AND mart_nm like CONCAT('%', #{search}, '%')
</when>
<when test='searchKind == "code" and search != null and search != ""'>
AND mart_cd like CONCAT('%',STR_TO_DATE(#{search}, '%Y%m%d'),'%')
</when>
<when test='searchKind == null and search != null and search != ""'>
AND (
mst0010.shop_nm Ilike CONCAT('%', #{search}, '%')
)
</when>
</choose>
</select>
<!-- 유저가 좋아요 누른 쿠폰 출력 -->
<select id="selectGetLikeCoupons" parameterType="Map" resultType="com.loglog.api.commons.beans.CouponUserListBean">
select
A.unique_coupon_cd as couponCd,
A.shop_cd as shopCd ,
mst0010.shop_add1 as shopAdd1,
mst0010.shop_add2 as shopAdd2,
mst0010.shop_nm as shopNm,
mst0010.category_cd as categoryCd,
A.effect_srt as effectSrt,
A.effect_end as effectEnd,
A.coupon_discount as couponDiscount,
CONCAT(#{baseImgUrl2}, '/', A.shop_cd, '/',mst0010.thumbnail1) as shopimage,
CONCAT(#{baseImgUrl}, '/', A.shop_cd , '/', A.thumbnail1) as thumbnail1,
mst0010.thumbnail1 as shopThumbNail1,
A.thumbnail1 as couponThumbnail1,
A.thumbnail2 as thumbnail2,
A.thumbnail3 as thumbnail3,
mst0010.thumbnail1 as shopThumbNail1,
A.thumbnail1 as couponThumbnail1,
A.connect_kbn as connectKbn,
A.color as color,
A.visit_condition as visitCondition,
A.coupon_goods as couponGoods,
A.coupon_discount as couponDiscount ,
'0' as proximity ,
'1' as liked
from coupons A
LEFT JOIN coupons_liked B ON B.unique_coupon_cd = A.unique_coupon_cd
left join mst0010 on A.shop_cd = mst0010.shop_cd
where B.user_cd = #{userCd}
AND (effect_end >= to_char(Now(),'YYYYMMDD')
and to_char(Now(),'YYYYMMDD') >= effect_srt)
<choose>
<when test='searchKind == null and search != null and search != ""'>
AND (
mst0010.shop_nm Ilike CONCAT('%', #{search}, '%')
)
</when>
</choose>
LIMIT #{countPerRecord} OFFSET #{startRow}
</select>
<!-- 쿠폰 좋아요 -->
<insert id="insertCouponLike" parameterType="com.loglog.api.commons.beans.CouponPublicBean">
INSERT INTO coupons_liked (
unique_coupon_cd
,user_cd
) VALUES(
#{uniqueCouponCd}
,#{userCd}
)
</insert>
<!-- 쿠폰 싫어요 -->
<delete id="insertCouponUnLike" parameterType="com.loglog.api.commons.beans.CouponPublicBean">
delete
from coupons_liked
where user_cd = #{userCd}
and unique_coupon_cd = #{uniqueCouponCd}
</delete>
<!-- 쿠폰 사용 -->
<insert id="insertUseCoupon" parameterType="com.loglog.api.commons.beans.CouponPublicBean">
INSERT INTO coupons_used (
unique_coupon_cd
,user_cd
,used
) VALUES(
#{uniqueCouponCd}
,#{userCd}
,'1'
);
</insert>
<!-- 사용한 쿠폰갯수 반환 -->
<select id="selectSeenCouponCount" parameterType="Map" resultType="int">
SELECT
count(coupons.unique_coupon_cd)
from coupons
left join (select unique_coupon_cd, used from coupons_used where user_cd= #{userCd}) cpnTrn
on cpnTrn.unique_coupon_cd = coupons.unique_coupon_cd
left join mst0010 on coupons.shop_cd = mst0010.shop_cd
left join geolocations GEO on GEO.shop_cd = mst0010.shop_cd
left join (select unique_coupon_cd , user_cd from coupons_liked where user_cd= #{userCd}) CL on CL.unique_coupon_cd = coupons.unique_coupon_cd
right join (select unique_coupon_cd , user_cd from coupons_seen where user_cd= #{userCd}) SEEN on SEEN.unique_coupon_cd = coupons.unique_coupon_cd
WHERE
(effect_end >= to_char(Now(),'YYYYMMDD')
and to_char(Now(),'YYYYMMDD') >= effect_srt)
<choose>
<when test='categoryCd != null and categoryCd != ""'>
and category_cd = #{categoryCd}
</when>
</choose>
<choose>
<when test='searchKind == null and search != null and search != ""'>
AND (
mst0010.shop_nm Ilike CONCAT('%', #{search}, '%')
)
</when>
</choose>
</select>
<!-- 유저의 사용한 쿠폰 출력-->
<select id="selectSeenCoupons" parameterType="com.loglog.api.commons.beans.CouponPublicBean" resultType="com.loglog.api.commons.beans.CouponUserListBean">
SELECT
<include refid="CouponPublicColumn" />
from coupons
left join (select unique_coupon_cd, used from coupons_used where user_cd= #{userCd}) cpnTrn
on cpnTrn.unique_coupon_cd = coupons.unique_coupon_cd
left join mst0010 on coupons.shop_cd = mst0010.shop_cd
left join geolocations GEO on GEO.shop_cd = mst0010.shop_cd
left join (select unique_coupon_cd , user_cd from coupons_liked where user_cd= #{userCd} ) CL on CL.unique_coupon_cd = coupons.unique_coupon_cd
right join (select unique_coupon_cd , user_cd from coupons_seen where user_cd= #{userCd}) SEEN on SEEN.unique_coupon_cd = coupons.unique_coupon_cd
WHERE
(effect_end >= to_char(Now(),'YYYYMMDD')
and to_char(Now(),'YYYYMMDD') >= effect_srt)
<choose>
<when test='categoryCd != null and categoryCd != ""'>
and category_cd = #{categoryCd}
</when>
</choose>
<choose>
<when test='searchKind == null and search != null and search != ""'>
AND (
mst0010.shop_nm Ilike CONCAT('%', #{search}, '%')
)
</when>
</choose>
order by cpnTrn.used desc, liked desc, proximity asc, effect_srt desc
LIMIT #{countPerRecord} OFFSET #{startRow}
</select>
<!-- 쿠폰 상세정보 확인 -->
<insert id="insertSeenCoupon" parameterType="com.loglog.api.commons.beans.CouponPublicBean">
INSERT INTO coupons_seen (
unique_coupon_cd
,updatetime
,user_cd
,seen
) VALUES(
#{uniqueCouponCd}
,now()
,#{userCd}
,'1'
);
</insert>
<!--카테고리 리스트 출력-->
<select id="selectCategoryList" parameterType="com.loglog.api.commons.beans.CategoryBean" resultType="com.loglog.api.commons.beans.CategoryBean">
SELECT
category_cd as categoryCd
,category_nm as categoryNm
,CONCAT(#{baseImgUrl}, category_img) as categoryImg
from mst0014
where 1=1
<choose>
<when test='categoryCd != null and categoryCd != ""'>
and category_cd = #{categoryCd}
</when>
</choose>
</select>
<!--coupon_seen에 데이터가 있는지 확인-->
<select id="selectSeenCheck" parameterType="com.loglog.api.commons.beans.CouponPublicBean" resultType="int">
select
count(*)
from coupons_seen
where user_cd = #{userCd}
and unique_coupon_cd = #{uniqueCouponCd}
</select>
<!--쿠폰이 존재 하는지 체크-->
<select id="selectCouponCheck" parameterType="com.loglog.api.commons.beans.CouponPublicBean" resultType="int">
select
count(unique_coupon_cd)
from coupons
where unique_coupon_cd = #{uniqueCouponCd}
</select>
<!--쿠폰이 존재 하는지 체크-->
<select id="selectUsedCouponCheck" parameterType="com.loglog.api.commons.beans.CouponPublicBean" resultType="int">
select
count(unique_coupon_cd)
from coupons_used cu
where user_cd = #{userCd}
and unique_coupon_cd = #{uniqueCouponCd}
</select>
</mapper>

View File

@ -0,0 +1,192 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.loglog.api.commons.daos.MsgMasterDao">
<sql id="MsgMasterColumn">
insuser_cd AS insuserCd ,
insdatetime AS insdatetime ,
upduser_cd AS upduserCd ,
updatetime AS updatetime ,
shop_cd AS shopCd ,
msg_cd AS msgCd ,
msg_text AS msgText ,
thumbnail1 AS thumbnail1 ,
thumbnail2 AS thumbnail1 ,
thumbnail3 AS thumbnail1 ,
user_cd AS userCd ,
connect_kbn AS connectKbn ,
background AS background ,
color AS color ,
prefecture AS prefecture ,
age AS age ,
gender AS gender ,
birthday AS birthday ,
rank AS rank
</sql>
<!-- 유저 전체메세지 출력 -->
<select id="selectMsgText" parameterType="com.loglog.api.commons.beans.MsgMasterBean" resultType="com.loglog.api.commons.beans.MsgMasterBean">
select
mst.updatetime as datesent,
msg_text as content ,
mst.shop_cd as shopCd,
msg_cd as megCd,
CONCAT(#{baseImgUrl}, '/', m.shop_cd , '/', m.thumbnail1) as thumbnail1,
mst.thumbnail1 as msgImg,
m.shop_nm as shopNm
from mst0013 mst, mst0010 m
where
(mst.updatetime, msg_cd, mst.shop_cd) IN (
select
max(updatetime),
max(msg_cd),
shop_cd
from mst0013
group by shop_cd
)
and mst.shop_cd = m.shop_cd
</select>
<!-- 유저 통지 메세지 디테일(단건) -->
<select id="selectMsgTextDetail" parameterType="com.loglog.api.commons.beans.MsgMasterBean" resultType="com.loglog.api.commons.beans.MsgMasterBean">
select
m.room_id as roomId
,user_cd as userCd
,m.shop_cd as shopCd
,m.datesent as datesent
,m.content as content
,mst.shop_nm as shopNm
,mst.shop_kn as shopKn
,CONCAT(#{baseImgUrl}, '/', m.shop_cd , '/', mst.thumbnail1) as thumbnail1
from messages m, mst0010 mst
where 1 = 1
and m.shop_cd = mst.shop_cd
and user_cd = #{userCd}
and m.shop_cd = '0001'
and m.content like CONCAT('%', #{noitCont}, '%')
order by datesent desc;
</select>
<!-- 통지 메세지 출력 -->
<select id="selectNoitMsg" parameterType="com.loglog.api.commons.beans.MsgMasterBean" resultType="com.loglog.api.commons.beans.MsgMasterBean">
select
m.room_id as roomId
,user_cd as userCd
,m.shop_cd as shopCd
,m.datesent as datesent
,m.content as content
,mst.shop_nm as shopNm
,mst.shop_kn as shopKn
,CONCAT(#{baseImgUrl}, '/', m.shop_cd , '/', mst.thumbnail1) as thumbnail1
,seen as seen
,msg_cd as msgCd
from messages m, mst0010 mst
where 1 = 1
and m.shop_cd = mst.shop_cd
and m.shop_cd = '0001'
and user_cd = #{userCd}
order by datesent desc
</select>
<!-- 즐겨찾기한 상점의 메세지 목록 -->
<select id="selectShopMsgList" parameterType="com.loglog.api.commons.beans.MsgMasterBean" resultType="com.loglog.api.commons.beans.MsgMasterBean">
with messageData as (
select * from messages
)
select
m.room_id as roomId
,m.user_cd as userCd
,m.shop_cd as shopCd
,m.datesent as datesent
,m.content as content
,mst.shop_nm as shopNm
,mst.shop_kn as shopKn
,CONCAT(#{baseImgUrl}, '/', m.shop_cd , '/', mst.thumbnail1) as thumbnail1
,(select count(msg_cd) from messageData where user_cd = m.user_cd and shop_cd = m.shop_cd) as msgCount
,(select sum(seen::integer) from messageData where user_cd = m.user_cd and shop_cd = m.shop_cd) as seen
from messages m, mst0010 mst
where (m.shop_cd, datesent) in (
select shop_cd, max(datesent) as datesent
from messages group by shop_cd
)
and m.shop_cd = mst.shop_cd
and m.shop_cd != '0001'
and user_cd = #{userCd}
order by datesent desc;
</select>
<!-- 즐겨찾기한 상점의 메세지 -->
<select id="selectShopMsgDetail" parameterType="com.loglog.api.commons.beans.MsgMasterBean" resultType="com.loglog.api.commons.beans.MsgMasterBean">
select
m.content as content
,m.shop_cd as shopCd
,m.datesent as datesent
,CONCAT(#{baseImgUrl}, '/', m.shop_cd , '/', (
select
thumbnail1
from mst0010 m2
where shop_cd = #{shopCd}
)) as thumbnail1
from messages m
where user_cd = #{userCd}
and m.shop_cd = #{shopCd}
order by m.datesent
</select>
<!-- 메세지 획안하면 봤다는 컬럼(seen) 1로 업데이트-->
<update id="updateMsgSeen" parameterType="com.loglog.api.commons.beans.MsgMasterBean">
UPDATE messages
SET
seen = '1'
where user_cd = #{userCd}
and shop_cd = #{shopCd}
</update>
<!-- msgType : 1인 메세지의 상세내용 -->
<select id="selectMegDeltail" parameterType="com.loglog.api.commons.beans.MsgMasterBean" resultType="com.loglog.api.commons.beans.MsgMasterBean">
select
distinct msg_cd as msgCd, mt.shop_cd as shopCd, msg_text as content , (select insdatetime from mst0013 where msg_cd = mt.msg_cd order by insdatetime desc limit 1) as insdatetime, mt.thumbnail1 as msgImg
,CONCAT(#{baseImgUrl}, '/', mt.shop_cd , '/', m.thumbnail1) as thumbnail1
,m.shop_nm as shopNm
from mst0013 mt, mst0010 m
where mt.shop_cd = m.shop_cd
and mt.shop_cd = #{shopCd}
order by msg_cd asc
</select>
<!-- 유저 읽지 않은 통지 메세지 개수 반환 -->
<select id="selectNotReadNotice" parameterType="com.loglog.api.commons.beans.MsgMasterBean" resultType="com.loglog.api.commons.beans.MsgMasterBean">
select
count(content) as msgCount,
sum(seen::integer) as seen ,
count(msg_cd) - sum(seen::integer) as notReadMsg
from messages m
where shop_cd = '0001'
and user_cd = #{userCd}
</select>
<!-- 유저 읽지 않은 오시라세 메세지 개수 반환 -->
<select id="selectNotReadShopMsg" parameterType="com.loglog.api.commons.beans.MsgMasterBean" resultType="com.loglog.api.commons.beans.MsgMasterBean">
select
count(content) as msgCount,
sum(seen::integer) as seen ,
count(msg_cd) - sum(seen::integer) as notReadMsg
from messages m
where shop_cd != '0001'
and user_cd = #{userCd}
</select>
<!-- 통지 상세보기 읽음처리 -->
<update id="updateNoticSeen" parameterType="com.loglog.api.commons.beans.MsgMasterBean">
UPDATE messages
SET
seen = '1'
where user_cd = #{userCd}
and shop_cd = '0001'
and msg_cd = #{msgCd}
</update>
</mapper>

View File

@ -0,0 +1,70 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.loglog.api.commons.daos.NotiAttachDao">
<sql id="notiAttach">
noti_attach_id as notiAttachId,
noti_id as notiId,
ord as ord,
file_type as fileType,
file_name as fileName,
file_path as filePath,
file_size as fileSize,
CASE file_type
WHEN 'I' THEN concat( #{serverUrlAdmin} , file_path )
ELSE ''
END as imageUrl
</sql>
<!-- 공지사항 첨부파일 정보 등록 -->
<insert id="insertNotiAttach" parameterType="com.loglog.api.commons.beans.NotiAttachBean">
INSERT INTO tb_noti_attach(
noti_id,
ord,
file_type,
file_name,
file_path,
file_size
) VALUES (
#{notiId},
#{ord},
#{fileType},
#{fileName},
#{filePath},
#{fileSize}
)
<!-- 마지막 insert ID 반환 -->
<selectKey order="AFTER" keyProperty="notiAttachId" resultType="String">
SELECT LAST_INSERT_ID()
</selectKey>
</insert>
<!-- 공지사항 첨부파일 정보 조회 -->
<select id="selectNotiAttach" parameterType="String" resultType="com.loglog.api.commons.beans.NotiAttachBean">
SELECT
<include refid="notiAttach"/>
FROM tb_noti_attach
WHERE 1=1
AND noti_id = #{notiId}
ORDER BY ord
</select>
<!-- 공지사항 첨부파일 다운로드 정보 조회 -->
<select id="selectNotiAttachInfo" parameterType="String" resultType="com.loglog.api.commons.beans.NotiAttachBean">
SELECT
<include refid="notiAttach"/>
FROM tb_noti_attach
WHERE 1=1
AND noti_attach_id = #{notiAttachId}
</select>
<delete id="deleteNotiAttach" parameterType="String">
DELETE
FROM tb_noti_attach
WHERE 1=1
AND noti_attach_id = #{notiAttachId}
</delete>
</mapper>

View File

@ -0,0 +1,155 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.loglog.api.commons.daos.NotiDao">
<sql id="noti">
noti_id as notiId,
( SELECT code_name FROM tb_code WHERE code_grp_id = '40' AND code = noti_type_cd ) as notiType,
noti_type_cd as typeCd,
( SELECT code_name FROM tb_code WHERE code_grp_id = '41' AND code = noti_cont_type_cd ) as notiContType,
noti_cont_type_cd as notiContTypeCd,
noti_title as notiTitle,
noti_cont as notiCont,
hit as hit,
reg_dt as regDt,
DATE_FORMAT(reg_dt, '%Y-%m-%d') AS regDtYmd,
upd_dt as updDt
</sql>
<!-- 공지사항 총 수 -->
<select id="notiTotCnt" parameterType="com.loglog.api.commons.beans.PagingBean" resultType="int">
SELECT
count(*)
FROM tb_noti
WHERE 1=1
<if test='typeCd != null and typeCd != "" '>
AND noti_type_cd = #{typeCd}
</if>
<choose>
<when test='tapType =="N"'>
AND noti_cont_type_cd != '2'
</when>
<when test='tapType == "E"'>
AND noti_cont_type_cd = '2'
</when>
</choose>
<choose>
<when test='searchKind == "전체" and search != null and search != ""'>
AND (noti_title like CONCAT('%', #{search}, '%')
OR noti_cont like CONCAT('%', #{search}, '%'))
</when>
<when test='searchKind == "제목" and search != null and search != ""'>
AND noti_title like CONCAT('%', #{search}, '%')
</when>
<when test='searchKind == "내용" and search != null and search != ""'>
AND noti_cont like CONCAT('%', #{search}, '%')
</when>
<when test='searchKind == null and search != null and search != ""'>
AND (noti_title like CONCAT('%', #{search}, '%')
OR noti_cont like CONCAT('%', #{search}, '%'))
</when>
</choose>
</select>
<!-- 공지사항 SelectNotiList -->
<select id="selectNotiList" parameterType="com.loglog.api.commons.beans.PagingBean" resultType="com.loglog.api.commons.beans.NotiBean">
SELECT
<include refid="noti" />
FROM tb_noti
WHERE 1=1
<if test='typeCd != null and typeCd != "" '>
AND noti_type_cd = #{typeCd}
</if>
<choose>
<when test='tapType =="N"'>
AND noti_cont_type_cd != '2'
</when>
<when test='tapType == "E"'>
AND noti_cont_type_cd = '2'
</when>
<otherwise>
</otherwise>
</choose>
<choose>
<when test='searchKind == "전체" and search != null and search != ""'>
AND (noti_title like CONCAT('%', #{search}, '%')
OR noti_cont like CONCAT('%', #{search}, '%'))
</when>
<when test='searchKind == "제목" and search != null and search != ""'>
AND noti_title like CONCAT('%', #{search}, '%')
</when>
<when test='searchKind == "내용" and search != null and search != ""'>
AND noti_cont like CONCAT('%', #{search}, '%')
</when>
</choose>
ORDER BY noti_id DESC
LIMIT #{startRow}, #{countPerRecord}
</select>
<!-- 공지사항 InsertNoti -->
<insert id="insertNoti" parameterType="com.loglog.api.commons.beans.NotiBean">
INSERT INTO tb_noti (
noti_type_cd,
noti_cont_type_cd,
noti_title,
noti_cont
) values(
#{typeCd},
#{notiContTypeCd},
#{notiTitle},
#{notiCont}
)
<!-- 마지막 insert ID 반환 -->
<selectKey order="AFTER" keyProperty="notiId" resultType="String">
SELECT LAST_INSERT_ID()
</selectKey>
</insert>
<!-- 조회수 올리기 -->
<update id="updateHit" parameterType="com.loglog.api.commons.beans.NotiBean">
UPDATE tb_noti
SET
hit = hit + 1
WHERE noti_id = #{notiId}
</update>
<!-- 공지사항 SelectNoti -->
<select id="selectNoti" parameterType="com.loglog.api.commons.beans.NotiBean" resultType="com.loglog.api.commons.beans.NotiBean">
SELECT
<include refid="noti" />
FROM tb_noti
WHERE noti_id = #{notiId}
</select>
<!-- 공지사항 UpdateNoti -->
<update id="updateNoti" parameterType="com.loglog.api.commons.beans.NotiBean">
UPDATE tb_noti
SET
noti_type_cd = #{typeCd},
noti_cont_type_cd = #{notiContTypeCd},
noti_title = #{notiTitle},
noti_cont = #{notiCont}
WHERE noti_id = #{notiId}
</update>
<!-- 공지사항 DeleteNoti -->
<delete id="deleteNoti" parameterType="com.loglog.api.commons.beans.NotiBean">
DELETE
FROM tb_noti
WHERE noti_id = #{notiId}
</delete>
<!-- 공지사항 IndexList -->
<select id="selectNotiIndexList" parameterType="com.loglog.api.commons.beans.PagingBean" resultType="com.loglog.api.commons.beans.NotiBean">
SELECT
<include refid="noti" />
FROM tb_noti
WHERE 1=1
AND noti_type_cd = #{typeCd}
ORDER BY noti_id DESC
LIMIT 0, #{countPerNoti}
</select>
</mapper>

View File

@ -0,0 +1,236 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.loglog.api.commons.daos.ShopMasterDao">
<sql id="ShopDetailColumn">
shop_cd as shopCd ,
shop_phone as shopPhone ,
shop_nm as shopNm ,
url_sns1 as urlSns1 ,
url_sns2 as urlSns2 ,
url_sns3 as urlSns3 ,
url_sns4 as urlSns4 ,
url_hp as urlHp ,
CONCAT(#{baseImgUrl}, '/', shop_cd , '/', thumbnail1) as thumbnail1,
thumbnail2 as thumbnail2,
thumbnail3 as thumbnail3,
holiday1 as holiDay1 ,
holiday2 as holiDay2 ,
holiday3 as holiDay3 ,
free_text as freeText ,
logo as logo ,
opentime1 as openTime1 ,
closetime1 as closeTime1,
opentime2 as openTime2 ,
closetime2 as closeTime2,
shop_add3 as shopAdd3 ,
shop_add2 as shopAdd2 ,
shop_add1 as shopAdd1 ,
shop_postcd as shopPostcd
</sql>
<!-- 싱잠 상세정보 -->
<select id="selectShopDetail" parameterType="com.loglog.api.commons.beans.ShopDetailBean" resultType="com.loglog.api.commons.beans.ShopDetailBean">
select
shop_cd as shopCd ,
shop_phone as shopPhone ,
shop_nm as shopNm ,
url_sns1 as urlSns1 ,
url_sns2 as urlSns2 ,
url_sns3 as urlSns3 ,
url_sns4 as urlSns4 ,
url_hp as urlHp ,
CONCAT(#{baseImgUrl}, '/', shop_cd , '/', thumbnail1) as thumbnail1,
thumbnail2 as thumbnail2,
thumbnail3 as thumbnail3,
holiday1 as holiDay1 ,
holiday2 as holiDay2 ,
holiday3 as holiDay3 ,
free_text as freeText ,
logo as logo ,
opentime1 as openTime1 ,
closetime1 as closeTime1,
opentime2 as openTime2 ,
closetime2 as closeTime2,
shop_add3 as shopAdd3 ,
shop_add2 as shopAdd2 ,
shop_add1 as shopAdd1 ,
shop_postcd as shopPostcd,
(SELECT
count(coupons.unique_coupon_cd)
from coupons
left join (select unique_coupon_cd, used from coupons_used where user_cd= #{userCd}) cpnTrn
on cpnTrn.unique_coupon_cd = coupons.unique_coupon_cd
left join mst0010 on coupons.shop_cd = mst0010.shop_cd
left join geolocations GEO on GEO.shop_cd = mst0010.shop_cd
left join (select unique_coupon_cd , user_cd from coupons_liked where user_cd= #{userCd} ) CL on CL.unique_coupon_cd = coupons.unique_coupon_cd
WHERE
(effect_end >= to_char(Now(),'YYYYMMDD')
and cpnTrn.used is null
and to_char(Now(),'YYYYMMDD') >= effect_srt)
and coupons.shop_cd = #{shopCd}) as couponCnt,
(select
count(*)
from trn0012 t
where user_cd = #{userCd}
and shop_cd = #{shopCd}) as visitCnt,
(select
count(*)
from tempo_liked tl
where user_cd = #{userCd}
and shop_cd = #{shopCd}) as liked,
( select
m.content as content
from messages m, mst0010 mst
where (m.shop_cd, datesent) in (
select shop_cd, max(datesent) as datesent
from messages group by shop_cd
)
and m.shop_cd = mst.shop_cd
and m.shop_cd = #{shopCd}
and user_cd = #{userCd}) as message
from mst0010
where shop_cd = #{shopCd}
</select>
<!-- 인근 상점 리스트 -->
<select id="selectProxShopList" parameterType="com.loglog.api.commons.beans.ShopMasterBean" resultType="com.loglog.api.commons.beans.ShopMasterBean">
select
m.shop_cd as shopCd
,m.shop_nm as shopNm
,m.shop_kn as shopKn
,CONCAT(#{baseImgUrl}, '/', m.shop_cd , '/', m.thumbnail1) as thumbnail1
,m.shop_phone as shopPhone
,m.shop_add1 as shopAdd1
,m.shop_add2 as shopAdd2
,m.category_cd as categoryCd
,geo.longtitude as longtitude
,geo.latitude as latitude
,(ABS(GEO.longtitude::FLOAT-ABS(#{longtitude}))+ABS(GEO.latitude::FLOAT-ABS(#{latitude}))) as proximity
from mst0010 m
left join geolocations GEO on GEO.shop_cd = m.shop_cd
order by proximity asc
</select>
<!-- 즐겨찾기한 상점 리스트 -->
<select id="selectCheckRoom" parameterType="com.loglog.api.commons.beans.ShopMasterBean" resultType="int">
select
count(*)
from rooms r
where user_cd = #{userCd}
and shop_cd = #{shopCd}
</select>
<!-- 상점 즐겨찾기 추가 -->
<insert id="insertLikeShop" parameterType="com.loglog.api.commons.beans.ShopMasterBean">
INSERT INTO rooms (
shop_cd
,user_cd
,liked
) VALUES(
#{shopCd}
,#{userCd}
,'0'
)
</insert>
<!-- 상점 즐겨찾기 추가 - tempo_liked -->
<insert id="insertLikeTempo" parameterType="com.loglog.api.commons.beans.ShopMasterBean">
INSERT INTO tempo_liked (
id
,shop_cd
,user_cd
,liked
) VALUES(
#{id}
,#{shopCd}
,#{userCd}
,'0'
)
</insert>
<!-- 상점 즐겨찾기 취소 -->
<delete id="calcelLikeShop" parameterType="com.loglog.api.commons.beans.ShopMasterBean">
delete
from rooms
where user_cd = #{userCd}
and shop_cd = #{shopCd}
and room_id = #{roomId}::INTEGER
</delete>
<!-- 상점 즐겨찾기 취소 - tempo_liked -->
<delete id="deleteLikeTempo" parameterType="com.loglog.api.commons.beans.ShopMasterBean">
delete
from tempo_liked
where shop_cd = #{shopCd}
and user_cd = #{userCd}
</delete>
<!-- 즐겨찾기한 상점 리스트 -->
<select id="selectShopList" parameterType="com.loglog.api.commons.beans.ShopDetailBean" resultType="com.loglog.api.commons.beans.ShopDetailBean">
select
m.shop_cd as shopCd ,
shop_phone as shopPhone ,
shop_nm as shopNm ,
url_sns1 as urlSns1 ,
url_sns2 as urlSns2 ,
url_sns3 as urlSns3 ,
url_sns4 as urlSns4 ,
url_hp as urlHp ,
CONCAT(#{baseImgUrl}, '/', m.shop_cd , '/', thumbnail1) as thumbnail1,
thumbnail2 as thumbnail2,
thumbnail3 as thumbnail3,
holiday1 as holiDay1 ,
holiday2 as holiDay2 ,
holiday3 as holiDay3 ,
free_text as freeText ,
logo as logo ,
opentime1 as openTime1 ,
closetime1 as closeTime1,
opentime2 as openTime2 ,
closetime2 as closeTime2,
shop_add3 as shopAdd3 ,
shop_add2 as shopAdd2 ,
shop_add1 as shopAdd1 ,
shop_postcd as shopPostcd,
'1' as liked
from mst0010 m
left join tempo_liked r on m.shop_cd = r.shop_cd
where r.user_cd = #{userCd}
</select>
<!-- 상점이름으로 검색 출력 리스트 -->
<select id="selectSearchShopList" parameterType="com.loglog.api.commons.beans.ShopDetailBean" resultType="com.loglog.api.commons.beans.ShopDetailBean">
select
m.shop_cd as shopCd ,
shop_phone as shopPhone ,
shop_nm as shopNm ,
url_sns1 as urlSns1 ,
url_sns2 as urlSns2 ,
url_sns3 as urlSns3 ,
url_sns4 as urlSns4 ,
url_hp as urlHp ,
CONCAT(#{baseImgUrl}, '/', m.shop_cd , '/', thumbnail1) as thumbnail1,
thumbnail2 as thumbnail2,
thumbnail3 as thumbnail3,
holiday1 as holiDay1 ,
holiday2 as holiDay2 ,
holiday3 as holiDay3 ,
free_text as freeText ,
logo as logo ,
opentime1 as openTime1 ,
closetime1 as closeTime1,
opentime2 as openTime2 ,
closetime2 as closeTime2,
shop_add3 as shopAdd3 ,
shop_add2 as shopAdd2 ,
shop_add1 as shopAdd1 ,
shop_postcd as shopPostcd
from mst0010 m
where (
m.shop_nm Ilike CONCAT('%', #{shopNm}, '%')
)
</select>
</mapper>

View File

@ -0,0 +1,450 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.loglog.api.commons.daos.UserDao">
<sql id="userColumn">
insuser_cd as insuserCd,
insdatetime as insdatetime,
upduser_cd as upduserCd,
updatetime as updatetime,
user_cd as userCd ,
user_nm as userNm,
user_kn as userKn,
birthday as birthday,
gender as gender,
user_mail as userMail,
user_pw as userPw,
user_phone as userPhone,
connect_kbn as connectKbn,
add1 as add1,
add2 as add2,
rank as rank,
jan_no as janNo,
cust_cd as custCd
</sql>
<!-- 회원 등록 -->
<insert id="insertUser" parameterType="com.loglog.api.commons.beans.UserBean">
INSERT INTO mst0011 (
insdatetime,
updatetime,
user_nm,
user_pw,
user_mail,
user_phone,
connect_kbn
) VALUES(
now(),
now(),
#{userNm},
#{userPw},
#{userMail},
#{userPhone},
0
)
</insert>
<!-- userCd체크(string) -->
<select id="selectUserCdStr" parameterType="com.loglog.api.commons.beans.UserBean" resultType="string">
SELECT
user_cd
FROM mst0011
WHERE user_mail=#{userMail}
</select>
<!-- 아이디 중복체크 -->
<select id="chkUserId" parameterType="com.loglog.api.commons.beans.UserBean" resultType="int">
SELECT
count(user_mail)
FROM mst0011
WHERE user_mail=#{userMail}
</select>
<!-- 닉네임 중복 체크 -->
<select id="chkNickName" parameterType="com.loglog.api.commons.beans.UserBean" resultType="int">
SELECT
count(member_name)
FROM vw_member
WHERE member_name = #{nickName}
</select>
<!-- userCd체크 -->
<select id="selectUserCd" parameterType="com.loglog.api.commons.beans.UserBean" resultType="int">
SELECT
count(user_cd)
FROM mst0011
WHERE user_cd = #{userCd}
</select>
<!-- 로그인한 회원 정보 찾기 -->
<select id="selectUser" parameterType="com.loglog.api.commons.beans.UserBean" resultType="com.loglog.api.commons.beans.UserBean">
SELECT
<include refid="userColumn"/>
FROM mst0011
WHERE user_mail = #{userMail}
AND user_pw = #{userPw}
</select>
<!-- usercd로 회원정보 가져오기 -->
<select id="selectUserDetail" parameterType="com.loglog.api.commons.beans.UserBean" resultType="com.loglog.api.commons.beans.UserBean">
SELECT
<include refid="userColumn"/>
FROM mst0011
WHERE user_cd = #{userCd}
</select>
<!-- usercd로 회원이름조회 -->
<select id="userName" parameterType="com.loglog.api.commons.beans.UserBean" resultType="com.loglog.api.commons.beans.UserBean">
SELECT
<include refid="userColumn"/>
FROM mst0011
WHERE user_cd = #{userCd}
</select>
<!-- usercd로 회원탈퇴 -->
<select id="userDelete" parameterType="com.loglog.api.commons.beans.UserBean" resultType="com.loglog.api.commons.beans.UserBean">
DELETE
FROM mst0011
WHERE user_cd = #{userCd}
</select>
<!-- ID와 PW가 일치하는 회원 정보 찾기 -->
<select id="selectUserPW" parameterType="com.loglog.api.commons.beans.UserBean" resultType="com.loglog.api.commons.beans.UserBean">
SELECT
<include refid="userColumn"/>
FROM tb_user
WHERE
user_id = #{userId}
AND password = #{password}
</select>
<!-- 아이디 찾기 - JSON -->
<select id="findUserId" parameterType="com.loglog.api.commons.beans.UserBean" resultType="string">
SELECT user_id
FROM tb_user
WHERE 1=1
<if test="userName != null and userName != ''">
AND user_Name = #{userName}
</if>
<if test="userHp != null and userHp != ''">
AND user_hp = #{userHp}
</if>
<if test="questionCd != null and questionCd != ''">
AND question_cd = #{questionCd}
</if>
<if test="answer != null and answer != ''">
AND answer = #{answer}
</if>
<if test="userEmail != null and userEmail != ''">
AND user_email = #{userEmail}
</if>
</select>
<!-- 회원 비밀번호 찾을시 해당 정보 회원있는지 확인-->
<select id="findUser" parameterType="com.loglog.api.commons.beans.UserBean" resultType="int">
SELECT count(user_id)
FROM tb_user
WHERE
user_id = #{userId}
AND user_name = #{userName}
AND user_email = #{userEmail}
</select>
<!-- db에 새 비밀번호 세팅 -->
<update id="updateUserPw" parameterType="com.loglog.api.commons.beans.UserBean">
UPDATE tb_user
SET
password = #{password},
upd_dt = now()
WHERE user_id = #{userId}
AND user_Name = #{userName}
</update>
<!-- 최종 로그인일시 update -->
<update id="updLastLoginDt" parameterType="string">
UPDATE tb_user
SET
last_login_dt = now()
WHERE 1=1
AND user_id = #{userId}
</update>
<!-- 회원 정보 수정 -->
<update id="updateUser" parameterType="com.loglog.api.commons.beans.UserBean">
UPDATE mst0011
SET
<choose>
<when test='birthday != null and birthday != "" '>
birthday = #{birthday}
</when>
<otherwise>
birthday = null
</otherwise>
</choose>
<if test="userNm != null and userNm != ''">
,user_nm = #{userNm}
</if>
<if test="userKn != null and userKn != ''">
,user_kn=#{userKn}
</if>
<if test="userPw != null and userPw != ''">
,user_pw=#{userPw}
</if>
<if test="userMail != null and userMail != ''">
,user_mail=#{userMail}
</if>
<if test="gender != null and gender != ''">
,gender=#{gender}
</if>
<if test="add1 != null and add1 != ''">
,add1 = #{add1}
</if>
<if test="add2 != null and add2 != ''">
,add2 = #{add2}
</if>
,updatetime = now()
WHERE 1=1
AND user_mail=#{userMail}
</update>
<!-- 회원 계좌 정보 수정 -->
<update id="updateAccount" parameterType="com.loglog.api.commons.beans.UserBean">
UPDATE tb_user
SET
account_bank_cd = #{accountBankCd},
account_name = #{accountName},
account = #{account},
upd_dt = now()
WHERE 1=1
AND user_id = #{userId}
</update>
<!-- 회원 계좌 비밀번호 수정 -->
<update id="updateAccountPw" parameterType="com.loglog.api.commons.beans.UserBean">
UPDATE tb_user
SET
account_pw = #{accountPw},
upd_dt = now()
WHERE user_id = #{userId}
AND user_Name = #{userName}
</update>
<!-- 네이버 사용자 회원수 조회 -->
<select id="searchNaverIdInUserTable" parameterType="com.loglog.api.commons.beans.UserBean" resultType="int">
SELECT
COUNT(*)
FROM tb_user
WHERE
user_id = #{userId} AND user_name = #{userName}
</select>
<!-- 사용자 회원 총 수 -->
<select id="userTotCnt" parameterType="com.loglog.api.commons.beans.PagingBean" resultType="int">
SELECT
COUNT(*)
FROM tb_user
WHERE 1=1
<if test='search != "" and search != null and search != "null"'>
<choose>
<when test='searchKind == "1"'>
AND user_id like CONCAT('%', #{search}, '%')
</when>
<when test='searchKind == "2"'>
AND user_name like CONCAT('%', #{search}, '%')
</when>
</choose>
</if>
</select>
<!-- 사용자 회원 목록 조회 -->
<select id="selectUserList" parameterType="com.loglog.api.commons.beans.PagingBean" resultType="com.loglog.api.commons.beans.UserBean">
SELECT
<include refid="userColumn"/>
FROM tb_user
WHERE 1=1
<if test='search != "" and search != null and search != "null"'>
<choose>
<when test='searchKind == "1"'>
AND user_id like CONCAT('%', #{search}, '%')
</when>
<when test='searchKind == "2"'>
AND user_name like CONCAT('%', #{search}, '%')
</when>
</choose>
</if>
ORDER BY reg_dt DESC
LIMIT #{startRow}, #{countPerRecord}
</select>
<!-- 사용자 회원 목록 조회 -->
<select id="selectUserListByPagingBean" parameterType="com.loglog.api.commons.beans.PagingBean" resultType="com.loglog.api.commons.beans.UserBean">
SELECT
<include refid="userColumn"/>
FROM tb_user
WHERE 1=1
<if test='search != "" and search != null and search != "null"'>
<choose>
<when test='searchKind == "1"'>
AND user_id like CONCAT('%', #{search}, '%')
</when>
<when test='searchKind == "2"'>
AND user_name like CONCAT('%', #{search}, '%')
</when>
</choose>
</if>
ORDER BY reg_dt DESC
LIMIT #{startRow}, #{countPerRecord}
</select>
<select id="countUserList" parameterType="Map" resultType="int" >
SELECT
COUNT(*)
FROM tb_user
WHERE 1=1
<if test='search != "" and search != null'>
AND 1=1
<choose>
<when test='searchKind == "1"'>
AND user_id like CONCAT('%', #{search}, '%')
</when>
<when test='searchKind == "2"'>
AND user_name like CONCAT('%', #{search}, '%')
</when>
</choose>
</if>
</select>
<!-- 사용자 상태 변경(정지 or 정상) -->
<update id="updateUserStatusCd" parameterType="com.loglog.api.commons.beans.UserBean">
UPDATE tb_user
SET
status_cd = #{statusCd}
WHERE user_id = #{userId}
</update>
<!-- 푸시알림, 자동로그인 설정값 변경 -->
<update id="updateUserSetting" parameterType="com.loglog.api.commons.beans.UserBean">
UPDATE tb_user
<trim prefix="SET" suffixOverrides=",">
<if test='pushRecvYn != "" and pushRecvYn != null and pushRecvYn != "null"'>
push_recv_yn = #{pushRecvYn},
</if>
<if test='autoLoginYn != "" and autoLoginYn != null and autoLoginYn != "null"'>
auto_login_yn = #{autoLoginYn},
</if>
<if test='pushKeyAnd != "" and pushKeyAnd != null and pushKeyAnd != "null"'>
push_key_and = #{pushKeyAnd},
</if>
<if test='pushKeyIos != "" and pushKeyIos != null and pushKeyIos != "null"'>
push_key_ios = #{pushKeyIos},
</if>
<if test='userHp != "" and userHp != null and userHp != "null"'>
user_hp = #{userHp},
</if>
</trim>
WHERE
user_id = #{userId}
</update>
<!-- 사용자 답변 확인 -->
<select id="userAnswerChk" parameterType="com.loglog.api.commons.beans.UserBean" resultType="int">
SELECT
COUNT(*)
FROM tb_user
WHERE 1=1
AND user_id = #{userId}
AND user_name = #{userName}
AND answer = #{answer}
</select>
<!-- 회원정보 탈퇴 -->
<delete id="deleteUser" parameterType="com.loglog.api.commons.beans.UserBean">
DELETE
FROM tb_user
WHERE
user_id = #{userId}
</delete>
<!-- 회원 비밀번호 찾을시 해당 정보 회원있는지 확인(이름 -> 이메일로 대체)-->
<select id="findUserL" parameterType="com.loglog.api.commons.beans.UserBean" resultType="int">
SELECT count(user_id)
FROM tb_user
WHERE user_id = #{userId}
AND user_email = #{userEmail}
</select>
<!-- db에 새 비밀번호 세팅 (이름 -> 이메일로 대체) -->
<update id="updateUserPwL" parameterType="com.loglog.api.commons.beans.UserBean">
UPDATE tb_user
SET
password = #{password},
upd_dt = now()
WHERE user_id = #{userId}
AND user_email = #{userEmail}
</update>
<!-- 회원 이메일 정보를 찾아 비교해보기 -->
<select id="findUserEmail" parameterType="com.loglog.api.commons.beans.UserBean" resultType="string">
SELECT USER_EMAIL
FROM tb_user
WHERE user_id = #{userId}
</select>
<update id="updateUserLevel" parameterType="Map">
UPDATE tb_user
SET
<if test="userLevel != null and userLevel != ''">
user_level = #{userLevel},
</if>
<if test="adminYn != null and adminYn != ''">
admin_yn = #{adminYn}
</if>
WHERE
user_id = #{userId}
</update>
<!-- userCd체크(string) -->
<select id="qRLogin" parameterType="com.loglog.api.commons.beans.UserBean" resultType= "com.loglog.api.commons.beans.UserBean">
select
<include refid="userColumn"/>
from mst0011
where cust_cd IN (#{custCd1},#{custCd2},#{custCd3})
</select>
<!-- 비밀번호 수정 - 이메일을 모르고 UserCd를 아는 경우 -->
<update id="selectKnowUserCd" parameterType="com.loglog.api.commons.beans.UserBean">
UPDATE mst0011
SET
user_pw = #{userPw}
WHERE user_cd = #{userCd}
</update>
<!-- 사용자 이메일이 있는지 확인 -->
<select id="selectCheckEmail" parameterType="com.loglog.api.commons.beans.UserBean" resultType= "int">
select
count(*)
from mst0011
where user_mail = #{userMail}
</select>
<update id="updatetempPw" parameterType="com.loglog.api.commons.beans.UserBean">
UPDATE mst0011 SET
user_pw = #{userPw}
WHERE
user_mail = #{userMail}
</update>
</mapper>

View File

@ -0,0 +1,44 @@
package com.loglog.api.commons.filter;
import java.io.IOException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.stereotype.Component;
@Component
public class CORSFilter implements Filter {
private FilterConfig filterConfig;
public void init(FilterConfig config) throws ServletException {
filterConfig = config;
}
public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException {
//CORS 처리 시작
HttpServletRequest request = (HttpServletRequest) req;
HttpServletResponse response = (HttpServletResponse) res;
response.setHeader("Access-Control-Allow-Origin", "*");
response.setHeader("Access-Control-Allow-Methods", "POST, GET, DELETE, PUT");
response.setHeader("Access-Control-Max-Age", "3600");
response.setHeader("Access-Control-Allow-Credentials", "true");
response.setHeader("Access-Control-Allow-Headers", "Origin, Accept, X-Requested-With, Content-Type, Access-Control-Request-Method, Access-Control-Request-Headers, Authorization");
response.setHeader("Access-Control-Allow-Headers", "*");
chain.doFilter(request, response);
}
public void destroy() {}
}

View File

@ -0,0 +1,118 @@
package com.loglog.api.commons.interceptor;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import org.apache.commons.beanutils.PropertyUtils;
import org.apache.ibatis.cache.CacheKey;
import org.apache.ibatis.executor.Executor;
import org.apache.ibatis.executor.statement.StatementHandler;
import org.apache.ibatis.mapping.BoundSql;
import org.apache.ibatis.mapping.MappedStatement;
import org.apache.ibatis.mapping.ParameterMapping;
import org.apache.ibatis.plugin.Interceptor;
import org.apache.ibatis.plugin.Intercepts;
import org.apache.ibatis.plugin.Invocation;
import org.apache.ibatis.plugin.Plugin;
import org.apache.ibatis.plugin.Signature;
import org.apache.ibatis.session.ResultHandler;
import org.apache.ibatis.session.RowBounds;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@Intercepts({
@Signature(type = Executor.class, method = "update", args ={MappedStatement.class, Object.class}),
@Signature(type = Executor.class, method = "query", args ={MappedStatement.class, Object.class, RowBounds.class, ResultHandler.class, CacheKey.class, BoundSql.class}),
@Signature(type = Executor.class, method = "query", args ={MappedStatement.class, Object.class, RowBounds.class, ResultHandler.class})
})
public class MybatisLogInterceptor implements Interceptor {
private static final Logger logger = LoggerFactory.getLogger("mybatis.log");
@Override
public Object intercept(Invocation invocation) throws Throwable {
Object[] args = invocation.getArgs();
MappedStatement ms = (MappedStatement)args[0];
logger.info("=====================================================================");
logger.info(ms.getId());
logger.info("=====================================================================");
return invocation.proceed(); // 쿼리 실행
}
@Override
public Object plugin(Object target) {
return Plugin.wrap(target, this);
}
@Override
public void setProperties(Properties properties) {
}
private List<Object> getColumnValues(StatementHandler handler, BoundSql boundSql) {
List<Object> columnValues = new ArrayList<Object>();
Object parameter = handler.getParameterHandler().getParameterObject();
List<ParameterMapping> parameterMappingList = boundSql.getParameterMappings();
for(int i = 0;i<parameterMappingList.size();i++) {
try {
if(PropertyUtils.isReadable(parameter, parameterMappingList.get(i).getProperty())) {
Object column = PropertyUtils.getProperty(parameter, parameterMappingList.get(i).getProperty());
columnValues.add(column);
} else {
if(parameter instanceof Map) {
columnValues.add( ((Map<?, ?>) parameter).get(parameterMappingList.get(i).getProperty()) );
} else {
columnValues.add(parameter);
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
return columnValues;
}
private Object[] getTypes(List<Object> columnValues) {
Object[] object = new Object[columnValues.size()];
for(int i = 0; i < columnValues.size(); i++) {
object[i] = columnValues.get(i);
}
return object;
}
private String getSql(String sqlStr, Object[] items) {
int seq = 0;
StringBuffer buf = new StringBuffer();
int i;
while ((i = sqlStr.indexOf("?")) >= 0) {
if(seq == items.length) break;
buf.append(sqlStr.substring(0, i));
if (items[seq] instanceof String) {
buf.append("'" + items[seq] + "'");
} else if (items[seq] instanceof Integer) {
buf.append(items[seq]);
} else if (items[seq] instanceof Long) {
buf.append(items[seq]);
} else if (items[seq] == null) {
buf.append("null");
} else {
buf.append(items[seq]);
}
sqlStr = sqlStr.substring(i + "?".length());
seq++;
}
buf.append(sqlStr);
return buf.toString();
}
}

View File

@ -0,0 +1,92 @@
package com.loglog.api.commons.interceptor;
import java.util.HashMap;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
import com.loglog.api.commons.utils.UAgentInfo;
/**
* PC Mobile 들어오는 Request를 보고 해당 OS의 URL로 맵핑하여 이동시킨다.
* @author SJW
*
*/
public class UrlTranferInterceptor extends HandlerInterceptorAdapter {
public static final Map<String, String> URI_MOBILE_2_PC = new HashMap<String, String>();
public static final Map<String, String> URI_PC_2_MOBILE = new HashMap<String, String>();
private static UAgentInfo mUAgentInfo = new UAgentInfo();
@Value("#{server['server.url.user']}")
public String SHOWPUN_PC_URL;
@Value("#{server['server.url.mobile']}")
public String SHOWPUN_MOBILE_URL;
static {
//PC 에서 들어온 URL을 Mobile로 매핑해서 이동시킬때 사용한다.
URI_PC_2_MOBILE.put("/myPage/orderHistList.ans", "/myPage/myPageMain.ans"); //마이페이지
URI_PC_2_MOBILE.put("/cs/selectNotiList.ans", "/mainMenu/noticeList.ans"); //고객센터 - 공지 리스트
URI_PC_2_MOBILE.put("/cs/selectFaqList.ans", "/mainMenu/faqList.ans"); //고객센터 - 자주하는 질문
//Mobile 에서 들어온 URL을 PC로 매핑해서 이동시킬때 사용한다.
URI_MOBILE_2_PC.put("/myPage/myPageMain.ans", "/myPage/orderHistList.ans"); //마이페이지
URI_MOBILE_2_PC.put("/mainMenu/noticeList.ans", "/cs/selectNotiList.ans"); //고객센터 - 공지 리스트
}
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
mUAgentInfo.setUAgentInfo(request.getHeader("user-agent"), request.getHeader("accept"));
String reqUri = request.getRequestURI();
String queryStr = request.getQueryString() == null ? "" : request.getQueryString();
if( StringUtils.indexOf(reqUri, "Ajax") >= 0 ) return true;
System.out.println("isMobilePhone: " + mUAgentInfo.isMobilePhone);
System.out.println("reqUri : " + reqUri);
System.out.println("queryStr : " + queryStr);
String moveUri = reqUri;
//PC --> Mobile 이동
if( mUAgentInfo.isMobilePhone ) {
//맵핑 URI 처리
if( StringUtils.isNotEmpty(URI_PC_2_MOBILE.get(reqUri)) ) {
moveUri = URI_PC_2_MOBILE.get(reqUri);
//Query처리
if ( StringUtils.isNotEmpty(queryStr ) ) {
moveUri += "?" + queryStr;
}
//이동
response.sendRedirect(SHOWPUN_MOBILE_URL + moveUri);
return false;
}
}
//Mobile --> PC 이동
else {
//맵핑 URI 처리
if( StringUtils.isNotEmpty(URI_MOBILE_2_PC.get(reqUri)) ) {
moveUri = URI_MOBILE_2_PC.get(reqUri);
//Query처리
if ( StringUtils.isNotEmpty(queryStr ) ) {
moveUri += "?" + queryStr;
}
//이동
response.sendRedirect(SHOWPUN_PC_URL + moveUri);
return false;
}
}
return true;
}
}

View File

@ -0,0 +1,13 @@
package com.loglog.api.commons.interfaces;
/**
* Service 공통 인터페이스
*
* @author itbong
* @since 2019.07.01
*/
public interface CommonInterface {
public void setServerUrlImg(String serverUrlImg);
}

View File

@ -0,0 +1,18 @@
package com.loglog.api.commons.modules.service.board;
import java.util.List;
import com.loglog.api.commons.beans.BoardBean;
import com.loglog.api.commons.beans.BoardFileBean;
public interface BoardFileService {
/** 질문 이미지 등록 */
public int insertBoardFile(BoardBean boardBean, List<BoardFileBean> boardFileList) throws Exception;
/** 게시글 이미지 수정 */
public int updateBoardFile(BoardBean boardBean,List<BoardFileBean> boardFileList) throws Exception;
/** 게시글 파일 삭제 */
public void deleteFile(int bdNo) throws Exception;
}

View File

@ -0,0 +1,169 @@
package com.loglog.api.commons.modules.service.board;
import java.io.File;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import org.apache.commons.io.FileUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import com.loglog.api.commons.beans.BoardBean;
import com.loglog.api.commons.beans.BoardFileBean;
import com.loglog.api.commons.daos.BoardFileDao;
@Service
public class BoardFileServiceImpl implements BoardFileService {
@Autowired
private BoardFileDao boardFileDao;
// 레파지토리 경로
@Value("${repository.path}")
private String RESPOSITORY_PATH;
// 보드 파일 폴더 경로
@Value("${upload.board.file.path}")
private String UPLOAD_BOARD_FILE_PATH;
// 다음 에디터 파일 임시 폴더 경로
@Value("${upload.daum.editor.file.temp.path}")
private String UPLOAD_DAUM_EDITOR_FILE_TEMP_PATH;
/** 게시글 파일 등록 */
@Override
public int insertBoardFile(BoardBean boardBean, List<BoardFileBean> boardFileList) throws Exception {
int result = 0;
List<File> deleteFileList = new ArrayList<File>();
/* 게시글 이미지 등록 */
for(int i=0; i<boardFileList.size(); i++){
BoardFileBean boardFileBean = boardFileList.get(i);
/* 게시글 KEY 셋팅 */
boardFileBean.setBdNo(boardBean.getBdNo());
File boardFileTempFile = new File(RESPOSITORY_PATH + boardFileBean.getFilePath());
deleteFileList.add(boardFileTempFile);
Date date = new Date();
SimpleDateFormat newDate = new SimpleDateFormat("yyyyMMdd");
String boardFilePath = UPLOAD_BOARD_FILE_PATH + "/" + boardBean.getBdNo() + "/" + newDate.format(date) + "/"+ boardFileTempFile.getName();
File boardFileFile = new File(RESPOSITORY_PATH + boardFilePath);
FileUtils.copyFile(boardFileTempFile, boardFileFile);
boardFileBean.setFilePath(boardFilePath);
result += boardFileDao.insertBoardFile(boardFileBean);
boardFileTempFile.delete();
}
return result;
}
/** 게시글 파일 수정 */
@Override
public int updateBoardFile(BoardBean boardBean, List<BoardFileBean> boardFileList) throws Exception {
int result =0;
List<File> deleteFileList = new ArrayList<File>();
//기존이미지 데이터 삭제
//UI에서 삭제된 이미지일 경우 이미지 경로가 안들어오므로 체크하여 삭제한다.
List<String> boardFileArray = new ArrayList<String>();
if(boardFileList != null && boardFileList.size() != 0){
for(int i=0; i<boardFileList.size(); i++){
BoardFileBean boardFileBean = boardFileList.get(i);
//게시글 KEY 셋팅
boardFileBean.setBdNo(boardBean.getBdNo());
//이미지 변경없음
System.out.println("first---"+boardFileBean.getFilePath().indexOf(UPLOAD_BOARD_FILE_PATH));
System.out.println("second---"+boardFileBean.getFilePath().indexOf(UPLOAD_DAUM_EDITOR_FILE_TEMP_PATH));
if(boardFileBean.getFilePath().indexOf(UPLOAD_DAUM_EDITOR_FILE_TEMP_PATH) == -1){
boardFileArray.add(boardFileBean.getFilePath());
}
}//end for();
}
//삭제될 파일 목록 조회
List<BoardFileBean> deleteBoardFileList = boardFileDao.deleteFileList(boardBean.getBdNo(),boardFileArray);
if(deleteBoardFileList != null && deleteBoardFileList.size() != 0){
boardFileDao.deleteFileForUpdate(deleteBoardFileList);
//서버에서 이미지 삭제 처리
for(BoardFileBean boardFileBean : deleteBoardFileList){
File deleteFileFile = new File(RESPOSITORY_PATH + boardFileBean.getFilePath());
try {
deleteFileFile.delete();
} catch (Exception e) {
e.getMessage();
}
}//end for();
}
if(boardFileList != null && boardFileList.size() != 0){
//게시글 이미지 수정
for(int i = 0; i<boardFileList.size(); i++){
BoardFileBean boardFileBean = boardFileList.get(i);
//게시글 KEY 셋팅
boardFileBean.setBdNo(boardBean.getBdNo());
System.out.println("last---"+boardFileBean.getFilePath().indexOf(UPLOAD_DAUM_EDITOR_FILE_TEMP_PATH));
//이미지 변경 없음 ??
if(!(boardFileBean.getFilePath().indexOf(UPLOAD_DAUM_EDITOR_FILE_TEMP_PATH) == -1)){
// 이미지 변경 또는 신규 등록됨
File boardFileTempFile = new File(RESPOSITORY_PATH + boardFileBean.getFilePath());
deleteFileList.add(boardFileTempFile);
Date date = new Date();
SimpleDateFormat newDate = new SimpleDateFormat("yyyyMMdd");
String boardFilePath = UPLOAD_BOARD_FILE_PATH + "/" + boardBean.getBdNo() + "/" + newDate.format(date) + "/"+ boardFileTempFile.getName();
File boardFileFile = new File(RESPOSITORY_PATH + boardFilePath);
// 정상적인 프로세스상 파일 이동이 이동되어야 하지만,
// 파일 복사로 변경
FileUtils.copyFile(boardFileTempFile, boardFileFile);
boardFileBean.setFilePath(boardFilePath);
result += boardFileDao.insertBoardFile(boardFileBean);
boardFileTempFile.delete();
}
}//end for();
}
return result;
}
/** 게시글 파일 삭제 */
@Override
public void deleteFile(int bdNo) throws Exception {
boardFileDao.deleteFile(bdNo);
File deleteFileFile = new File(RESPOSITORY_PATH + UPLOAD_BOARD_FILE_PATH + "/" + bdNo);
FileUtils.deleteDirectory(deleteFileFile);
}
}

View File

@ -0,0 +1,22 @@
package com.loglog.api.commons.modules.service.board;
import java.util.List;
import com.loglog.api.commons.beans.BoardBean;
import com.loglog.api.commons.beans.BoardImgBean;
public interface BoardImgService {
/** 질문 이미지 등록 */
public int insertBoardImg(BoardBean boardBean, List<BoardImgBean> boardImgList) throws Exception;
/** 게시글 이미지 수정 */
public int updateBoardImg(BoardBean boardBean, List<BoardImgBean> boardImgList) throws Exception;
/** 게시글 이미지 삭제*/
public void deleteImg(int bdNo) throws Exception;
/** 게시글 이미지 리스트*/
public List<BoardImgBean> boardImgList(List<BoardBean> list) throws Exception;
}

View File

@ -0,0 +1,204 @@
package com.loglog.api.commons.modules.service.board;
import java.io.File;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import org.apache.commons.io.FileUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import com.loglog.api.commons.beans.BoardBean;
import com.loglog.api.commons.beans.BoardImgBean;
import com.loglog.api.commons.daos.BoardDao;
import com.loglog.api.commons.daos.BoardImgDao;
@Service
public class BoardImgServiceImpl implements BoardImgService {
@Autowired
private BoardImgDao boardImgDao;
@Autowired
private BoardDao boardDao;
// 레파지토리 경로
@Value("${repository.path}")
private String RESPOSITORY_PATH;
// 보드 이미지 폴더 경로
@Value("${upload.board.path}")
private String UPLOAD_BOARD_PATH;
// 다음 에디터 이미지 임시 폴더 경로
@Value("${upload.daum.editor.image.temp.path}")
private String UPLOAD_DAUM_EDITOR_IMAGE_TEMP_PATH;
// 다음 에디터 파일 임시 폴더 경로
@Value("${upload.daum.editor.file.temp.path}")
private String UPLOAD_DAUM_EDITOR_FILE_TEMP_PATH;
/**
* 게시글 이미지 등록
*/
@Override
public int insertBoardImg(BoardBean boardBean,List<BoardImgBean> boardImgList) throws Exception {
int result =0;
List<File> deleteFileList = new ArrayList<File>();
/* 게시글 이미지 등록 */
for(int i=0; i<boardImgList.size(); i++){
BoardImgBean boardImgBean = boardImgList.get(i);
/* 게시글 KEY 셋팅 */
boardImgBean.setBdNo(boardBean.getBdNo());
File boardImgTempFile = new File(System.getProperty("user.dir") + RESPOSITORY_PATH + boardImgBean.getImgPath());
deleteFileList.add(boardImgTempFile);
Date date = new Date();
SimpleDateFormat newDate = new SimpleDateFormat("yyyyMMdd");
String boardImgPath = UPLOAD_BOARD_PATH + "/" + boardBean.getBdNo() + "/" + newDate.format(date) + "/"+ boardImgTempFile.getName();
File boardImgFile = new File(System.getProperty("user.dir") + RESPOSITORY_PATH + boardImgPath);
System.out.println("before save : " + boardImgPath + " : " + boardImgTempFile.getAbsolutePath());
FileUtils.copyFile(boardImgTempFile, boardImgFile);
boardImgBean.setImgPath(boardImgPath);
//이미지 정보를 DB에 저장
result += boardImgDao.insertBoardImg(boardImgBean);
//이미지의 저장경로를 변경
String changeImg = "<img src=\"";
String imgPath = changeImg + UPLOAD_BOARD_PATH;
changeImg += UPLOAD_DAUM_EDITOR_IMAGE_TEMP_PATH;
boardBean.setBdCont(boardBean.getBdCont().replaceAll(changeImg, imgPath + "/" + boardBean.getBdNo()));
System.out.println(boardBean.getBdCont());
result += boardDao.updateBoard(boardBean);
//Temp파일 삭제
boardImgTempFile.delete();
}
return result;
}
/** 게시글 이미지 수정 */
@Override
public int updateBoardImg(BoardBean boardBean,List<BoardImgBean> boardImgList) throws Exception {
int result = 0;
List<File> deleteFileList = new ArrayList<File>();
// 기존 이미지 데이터 삭제
// UI에서 삭제된 이미지일 경우 이미지 경로가 안들어오므로,
// 체크하여 삭제한다.
List<String> boardImgArray = new ArrayList<String>();
if (boardImgList != null && boardImgList.size() != 0) {
for (int i = 0; i < boardImgList.size(); i++) {
BoardImgBean boardImgBean = boardImgList.get(i);
// 게시글 key 셋팅
boardImgBean.setBdNo(boardBean.getBdNo());
// 이미지 변경 없음
System.out.println("first---"+boardImgBean.getImgPath().indexOf(UPLOAD_BOARD_PATH));
System.out.println("second---"+boardImgBean.getImgPath().indexOf(UPLOAD_DAUM_EDITOR_IMAGE_TEMP_PATH));
if (boardImgBean.getImgPath().indexOf(UPLOAD_DAUM_EDITOR_IMAGE_TEMP_PATH) == -1) {
boardImgArray.add(boardImgBean.getImgPath());
}
}
}
// 삭제될 이미지 목록 조회
List<BoardImgBean> deleteBoardImgList = boardImgDao.deleteImgList(boardBean.getBdNo(),boardImgArray);
if (deleteBoardImgList != null && deleteBoardImgList.size() != 0) {
// 삭제된 이미지 DB 삭제 처리
boardImgDao.deleteImgForUpdate(deleteBoardImgList);
// 서버에서 이미지 삭제 처리
for (BoardImgBean boardImgBean : deleteBoardImgList) {
File deleteImgFile = new File(RESPOSITORY_PATH + boardImgBean.getImgPath());
try {
deleteImgFile.delete();
} catch (Exception e) {
e.getMessage();
}
}
}
if (boardImgList != null && boardImgList.size() != 0) {
// 게시글 이미지 수정
for (int i = 0; i < boardImgList.size(); i++) {
BoardImgBean boardImgBean = boardImgList.get(i);
// 게시글 key 셋팅
boardImgBean.setBdNo(boardBean.getBdNo());
System.out.println("last---"+boardImgBean.getImgPath().indexOf(UPLOAD_DAUM_EDITOR_IMAGE_TEMP_PATH));
// 이미지 변경 없음
if (boardImgBean.getImgPath().indexOf(UPLOAD_DAUM_EDITOR_IMAGE_TEMP_PATH) == -1) {
//boardImgDao.updateBoardImg(boardImgBean);
// 이미지 변경 또는 신규 등록됨
} else {
File boardImgTempFile = new File(RESPOSITORY_PATH
+ boardImgBean.getImgPath());
deleteFileList.add(boardImgTempFile);
Date date = new Date();
SimpleDateFormat newDate = new SimpleDateFormat("yyyyMMdd");
String boardImgPath = UPLOAD_BOARD_PATH + "/" + boardBean.getBdNo() + "/" + newDate.format(date) + "/"+ boardImgTempFile.getName();
File boardImgFile = new File(RESPOSITORY_PATH + boardImgPath);
// 정상적인 프로세스상 파일 이동이 이동되어야 하지만,
// 파일 복사로 변경
FileUtils.copyFile(boardImgTempFile, boardImgFile);
boardImgBean.setImgPath(boardImgPath);
result += boardImgDao.insertBoardImg(boardImgBean);
String changeImg = "<img src=\"";
String imgPath = changeImg + UPLOAD_BOARD_PATH;
changeImg += UPLOAD_DAUM_EDITOR_IMAGE_TEMP_PATH;
boardBean.setBdCont(boardBean.getBdCont().replaceAll(changeImg, imgPath+"/"+boardBean.getBdNo()));
result += boardDao.updateBoard(boardBean);
result --;
boardImgTempFile.delete();
}
}
}
return result;
}
/** 게시글 이미지 삭제 */
@Override
public void deleteImg(int bdNo) throws Exception {
boardImgDao.deleteImg(bdNo);
File deleteImgFile = new File(RESPOSITORY_PATH + UPLOAD_BOARD_PATH + "/" + bdNo);
FileUtils.deleteDirectory(deleteImgFile);
}
/** 게시글 이미지 리스트*/
public List<BoardImgBean> boardImgList(List<BoardBean> list) throws Exception {
return boardImgDao.boardImgList(list);
}
}

View File

@ -0,0 +1,34 @@
package com.loglog.api.commons.modules.service.board;
import java.util.List;
import com.loglog.api.commons.beans.BoardBean;
import com.loglog.api.commons.beans.BoardFileBean;
import com.loglog.api.commons.beans.BoardImgBean;
import com.loglog.api.commons.beans.BoardReplyBean;
import com.loglog.api.commons.beans.PagingBean;
public interface BoardReplyService {
/** 댓글작성 */
public void insertReplyBoard(BoardReplyBean boardReplyBean,BoardBean boardBean) throws Exception;
/** 댓글 수정 */
public int updateReplyBoard(BoardReplyBean boardReplyBean) throws Exception;
/** 페이징 갯수 */
//public int selectReplyCount(PagingBean pagingBean) throws Exception;
/** 댓글 리스트 가져오기 */
public List<BoardReplyBean> replyList(PagingBean pagingBean) throws Exception;
/** 글 상세보기(글 이미지 포함 및 Hit 업데이트) */
// public BoardBean selectInBoard(BoardBean boardBean) throws Exception;
//
// /** 글 상세값만 가져오기 */
// public BoardBean selectTheBoard(BoardBean boardBean) throws Exception;
//
/** 댓글 삭제하기 */
public void deleteReplyBoard(BoardReplyBean boardReplyBean, BoardBean boardBean) throws Exception;
}

View File

@ -0,0 +1,85 @@
package com.loglog.api.commons.modules.service.board;
import java.io.File;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.UUID;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import com.loglog.api.commons.beans.BoardBean;
import com.loglog.api.commons.beans.BoardFileBean;
import com.loglog.api.commons.beans.BoardImgBean;
import com.loglog.api.commons.beans.BoardReplyBean;
import com.loglog.api.commons.beans.PagingBean;
import com.loglog.api.commons.daos.BoardDao;
import com.loglog.api.commons.daos.BoardFileDao;
import com.loglog.api.commons.daos.BoardImgDao;
import com.loglog.api.commons.daos.BoardReplyDao;
@Service
public class BoardReplyServiceImpl implements BoardReplyService {
// 레파지토리 경로
@Value("${repository.path}")
private String RESPOSITORY_PATH;
// 보드 이미지 폴더 경로
@Value("${upload.board.path}")
private String UPLOAD_BOARD_PATH;
@Autowired
private BoardDao boardDao;
@Autowired
private BoardImgDao boardImgDao;
@Autowired
private BoardReplyDao boardReplyDao;
@Autowired
private BoardFileDao boardFileDao;
@Autowired
private BoardFileService boardFileService;
@Autowired
private BoardImgService boardImgService;
// 댓글 저장
@Override
public void insertReplyBoard(BoardReplyBean boardReplyBean,BoardBean boardBean) throws Exception {
// TODO Auto-generated method stub
/*댓글 등록*/
BoardReplyBean replyBean = new BoardReplyBean();
replyBean.setBdNo(boardBean.getBdNo());
boardReplyDao.insertReply(boardReplyBean);
}
// 댓글 수정
@Override
public int updateReplyBoard(BoardReplyBean boardReplyBean) throws Exception {
return boardReplyDao.updateReply(boardReplyBean);
}
// 댓글 리스트
@Override
public List<BoardReplyBean> replyList(PagingBean pagingBean) throws Exception {
// TODO Auto-generated method stub
return boardReplyDao.replyList(pagingBean);
}
// 댓글 삭제
@Override
public void deleteReplyBoard(BoardReplyBean boardReplyBean,BoardBean boardBean) throws Exception {
// TODO Auto-generated method stub
// System.out.println("파리미터 서비스" + boardReplyBean.getReplyNo() + "--" + boardBean.getBdNo());
// BoardReplyBean replyBean = new BoardReplyBean();
// replyBean.setBdNo(boardBean.getBdNo());
boardReplyDao.deleteReply(boardReplyBean);
}
}

View File

@ -0,0 +1,33 @@
package com.loglog.api.commons.modules.service.board;
import java.util.List;
import com.loglog.api.commons.beans.BoardBean;
import com.loglog.api.commons.beans.BoardFileBean;
import com.loglog.api.commons.beans.BoardImgBean;
import com.loglog.api.commons.beans.PagingBean;
public interface BoardService {
/** 글작성 */
public void insertBoard(BoardBean boardBean, List<BoardImgBean> boardImgList, List<BoardFileBean> boardFileList) throws Exception;
/** 게시글 수정 */
public int updateBoard(BoardBean boardBean, List<BoardImgBean> boardImgList, List<BoardFileBean> boardFileList) throws Exception;
/** 게시글 갯수 */
public int selectBoardCount(PagingBean pagingBean) throws Exception;
/** 글 목록 가져오기 */
public List<BoardBean> boardList(PagingBean pagingBean) throws Exception;
/** 글 상세보기(글 이미지 포함 및 Hit 업데이트) */
public BoardBean selectInBoard(BoardBean boardBean) throws Exception;
//
// /** 글 상세값만 가져오기 */
// public BoardBean selectTheBoard(BoardBean boardBean) throws Exception;
//
/** 글 삭제하기 */
public void deleteBoard(BoardBean boardBean) throws Exception;
}

View File

@ -0,0 +1,303 @@
package com.loglog.api.commons.modules.service.board;
import java.io.File;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.UUID;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import com.loglog.api.commons.beans.BoardBean;
import com.loglog.api.commons.beans.BoardFileBean;
import com.loglog.api.commons.beans.BoardImgBean;
import com.loglog.api.commons.beans.BoardReplyBean;
import com.loglog.api.commons.beans.PagingBean;
import com.loglog.api.commons.daos.BoardDao;
import com.loglog.api.commons.daos.BoardFileDao;
import com.loglog.api.commons.daos.BoardImgDao;
import com.loglog.api.commons.daos.BoardReplyDao;
@Service
public class BoardServiceImpl implements BoardService {
// 레파지토리 경로
@Value("${repository.path}")
private String RESPOSITORY_PATH;
// 보드 이미지 폴더 경로
@Value("${upload.board.path}")
private String UPLOAD_BOARD_PATH;
@Autowired
private BoardDao boardDao;
@Autowired
private BoardImgDao boardImgDao;
@Autowired
private BoardReplyDao boardReplyDao;
@Autowired
private BoardFileDao boardFileDao;
@Autowired
private BoardFileService boardFileService;
@Autowired
private BoardImgService boardImgService;
/**
* 작성
* Insert
*/
@Override
public void insertBoard(BoardBean boardBean, List<BoardImgBean> boardImgList, List<BoardFileBean> boardFileList) throws Exception {
SimpleDateFormat newDate = new SimpleDateFormat("yyyyMMdd");
Date date = new Date();
//썸네일 이미지를 등록한다.
if(boardBean.getBdThumbImgFile1() != null) {
MultipartFile thumbFile = boardBean.getBdThumbImgFile1();
String fileName = thumbFile.getOriginalFilename();
String fileExt = fileName.substring( fileName.lastIndexOf(".") + 1 );
UUID uuid = UUID.randomUUID();
String thumbPath = System.getProperty("user.dir") + RESPOSITORY_PATH + UPLOAD_BOARD_PATH + "/thumb/" + newDate.format(date) + "/" + uuid + "." + fileExt;
String thumbFolder = System.getProperty("user.dir") + RESPOSITORY_PATH + UPLOAD_BOARD_PATH +"/thumb/" + newDate.format(date);
File tempFolder = new File( thumbFolder );
if ( !tempFolder.exists() ){
tempFolder.mkdirs();
}
thumbFile.transferTo(new File(thumbPath));
boardBean.setBdThumbImg1( UPLOAD_BOARD_PATH + "/thumb/" + newDate.format(date) + "/" + uuid + "." + fileExt );
}
if(boardBean.getBdThumbImgFile2() != null) {
MultipartFile thumbFile = boardBean.getBdThumbImgFile2();
String fileName = thumbFile.getOriginalFilename();
String fileExt = fileName.substring( fileName.lastIndexOf(".") + 1 );
UUID uuid = UUID.randomUUID();
String thumbPath = System.getProperty("user.dir") + RESPOSITORY_PATH + UPLOAD_BOARD_PATH + "/thumb/" + newDate.format(date) + "/" + uuid + "." + fileExt;
String thumbFolder = System.getProperty("user.dir") + RESPOSITORY_PATH + UPLOAD_BOARD_PATH +"/thumb/" + newDate.format(date);
File tempFolder = new File( thumbFolder );
if ( !tempFolder.exists() ){
tempFolder.mkdirs();
}
thumbFile.transferTo(new File(thumbPath));
boardBean.setBdThumbImg2( UPLOAD_BOARD_PATH + "/thumb/" + newDate.format(date) + "/" + uuid + "." + fileExt );
}
/* 글등록 */
boardDao.insertBoard(boardBean);
/* 이미지등록 */
if(boardImgList != null && boardImgList.size() != 0){
boardImgService.insertBoardImg(boardBean, boardImgList);
}
/* 파일등록 */
if(boardFileList != null && boardFileList.size() != 0){
boardFileService.insertBoardFile(boardBean, boardFileList);
}
}
/**
* 게시글 수정
* update
*/
@Override
public int updateBoard(BoardBean boardBean, List<BoardImgBean> boardImgList, List<BoardFileBean> boardFileList) throws Exception {
SimpleDateFormat newDate = new SimpleDateFormat("yyyyMMdd");
Date date = new Date();
String btThumbImg1Path = null;
String btThumbImg2Path = null;
//썸네일 이미지를 수정한다.
if(boardBean.getBdThumbImgFile1() != null) {
MultipartFile thumbFile = boardBean.getBdThumbImgFile1();
String fileName = thumbFile.getOriginalFilename();
String fileExt = fileName.substring( fileName.lastIndexOf(".") + 1 );
UUID uuid = UUID.randomUUID();
String thumbPath = System.getProperty("user.dir") + RESPOSITORY_PATH + UPLOAD_BOARD_PATH + "/thumb/" + newDate.format(date) + "/" + uuid + "." + fileExt;
String thumbFolder = System.getProperty("user.dir") + RESPOSITORY_PATH + UPLOAD_BOARD_PATH +"/thumb/" + newDate.format(date);
File tempFolder = new File( thumbFolder );
if ( !tempFolder.exists() ){
tempFolder.mkdirs();
}
thumbFile.transferTo(new File(thumbPath));
//수정전 백업
btThumbImg1Path = boardBean.getBdThumbImg1();
boardBean.setBdThumbImg1( UPLOAD_BOARD_PATH + "/thumb/" + newDate.format(date) + "/" + uuid + "." + fileExt );
}
if(boardBean.getBdThumbImgFile2() != null) {
MultipartFile thumbFile = boardBean.getBdThumbImgFile2();
String fileName = thumbFile.getOriginalFilename();
String fileExt = fileName.substring( fileName.lastIndexOf(".") + 1 );
UUID uuid = UUID.randomUUID();
String thumbPath = System.getProperty("user.dir") + RESPOSITORY_PATH + UPLOAD_BOARD_PATH + "/thumb/" + newDate.format(date) + "/" + uuid + "." + fileExt;
String thumbFolder = System.getProperty("user.dir") + RESPOSITORY_PATH + UPLOAD_BOARD_PATH +"/thumb/" + newDate.format(date);
File tempFolder = new File( thumbFolder );
if ( !tempFolder.exists() ){
tempFolder.mkdirs();
}
thumbFile.transferTo(new File(thumbPath));
//수정전 백업
btThumbImg2Path = boardBean.getBdThumbImg2();
boardBean.setBdThumbImg2( UPLOAD_BOARD_PATH + "/thumb/" + newDate.format(date) + "/" + uuid + "." + fileExt );
}
int result = boardDao.updateBoard(boardBean);
if(result > 0) {
//기존 썸네일 이미지 삭제
if(btThumbImg1Path != null) {
File thumb1Img = new File(System.getProperty("user.dir") + RESPOSITORY_PATH + btThumbImg1Path);
try {
thumb1Img.delete();
} catch (Exception e) {
e.getMessage();
}
}
if(btThumbImg2Path != null) {
File thumb2Img = new File(System.getProperty("user.dir") + RESPOSITORY_PATH + btThumbImg2Path);
try {
thumb2Img.delete();
} catch (Exception e) {
e.getMessage();
}
}
}
/* 게시글 이미지 수정 */
if(boardImgList != null && boardImgList.size() != 0){
boardImgService.updateBoardImg(boardBean, boardImgList);
}
if(boardFileList != null && boardFileList.size() != 0){
boardFileService.updateBoardFile(boardBean, boardFileList);
}
return result;
}
/**
* 게시글 갯수
*/
@Override
public int selectBoardCount(PagingBean pagingBean) throws Exception {
return boardDao.selectBoardCount(pagingBean);
}
/**
* 목록 가져오기
*/
@Override
public List<BoardBean> boardList(PagingBean pagingBean) throws Exception {
return boardDao.boardList(pagingBean);
}
/**
* 상세보기
*/
@Override
public BoardBean selectInBoard(BoardBean boardBean) throws Exception{
//한개의 이미지 목록
List<BoardImgBean> boardImgList = boardImgDao.selectBoardImg(boardBean.getBdNo());
//한개의 파일 목록
List<BoardFileBean> boardFileList = boardFileDao.selectBoardFile(boardBean.getBdNo());
//답변목록
PagingBean pagingBean = new PagingBean();
int totCount = boardReplyDao.replyListCount(pagingBean);
// 페이징 계산 , 가져올 데이터 시작위치 끝위치 계산
pagingBean.calcPage(totCount);
pagingBean.setBdNo(boardBean.getBdNo());
List<BoardReplyBean> replyList = boardReplyDao.replyList(pagingBean);
try {
//조회수 +1
boardDao.updateHit(boardBean);
} catch (Exception e) {
e.printStackTrace();
}
boardBean = boardDao.selectInBoard(boardBean);
boardBean.setBoardImgList(boardImgList.size() > 0 ? boardImgList : new ArrayList<>());
boardBean.setBoardFileList(boardFileList.size() > 0 ? boardFileList : new ArrayList<>());
boardBean.setReplyList(replyList.size() > 0 ? replyList : new ArrayList<>());
return boardBean;
}
//
//
// /** 글 상세값만 가져오기 */
// public BoardBean selectTheBoard(BoardBean boardBean) throws Exception {
// return boardDao.selectInBoard(boardBean);
// }
//
//
/**
* 게시글 삭제
*/
@Override
public void deleteBoard(BoardBean boardBean) throws Exception{
boardBean = boardDao.selectInBoard(boardBean);
//썸네일 삭제
if(boardBean.getBdThumbImg1() != null) {
File thumb1Img = new File(System.getProperty("user.dir") + RESPOSITORY_PATH + boardBean.getBdThumbImg1());
try {
thumb1Img.delete();
} catch (Exception e) {
e.getMessage();
}
}
if(boardBean.getBdThumbImg2() != null) {
File thumb2Img = new File(System.getProperty("user.dir") + RESPOSITORY_PATH + boardBean.getBdThumbImg2());
try {
thumb2Img.delete();
} catch (Exception e) {
e.getMessage();
}
}
//댓글 여러건 삭제
BoardReplyBean replyBean = new BoardReplyBean();
replyBean.setBdNo(boardBean.getBdNo());
boardReplyDao.deleteReplyList(replyBean);
//게시글 이미지 삭제
boardImgService.deleteImg(boardBean.getBdNo());
//게시글 파일 삭제
boardFileService.deleteFile(boardBean.getBdNo());
//게시글 삭제
boardDao.deleteBoard(boardBean);
}
}

View File

@ -0,0 +1,48 @@
package com.loglog.api.commons.modules.service.calender;
import java.util.List;
import java.util.Map;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import com.loglog.api.commons.beans.CalenderBean;
import com.loglog.api.commons.beans.PagingBean;
import com.loglog.api.commons.beans.UserBean;
public interface CalenderService {
/** 상점정보 있는지 체크 */
public int selectShopInfo(CalenderBean calenderBean);
/** 내점기록 저장 */
public int insertCalender(CalenderBean calenderBean);
/** 캘린더 조회 */
public List<CalenderBean> selectCalenderMon(CalenderBean calenderBean);
/** 스케줄 저장 */
public int insertSchedule (CalenderBean calenderBean);
/** 스케줄 디테일 조회*/
public List<CalenderBean> selectCalenderDay(CalenderBean calenderBean);
/** 스케줄 업데이트 */
public int updateCalender(CalenderBean calenderBean);
/** 저장후 고유ID를 이용해 데이터를 조회*/
public CalenderBean selectCalenderId(CalenderBean calenderBean)throws Exception;
/** 내점기록저장후 내용이나 사진 업데이트*/
public int updateCalenderthum(CalenderBean calenderBean,List<MultipartFile> thumFileList)throws Exception;
/** 내점기록저장후 내용이나 사진 업데이트한걸 다시 업데이트*/
public int updateCalenderUrl(CalenderBean calenderBean,List<MultipartFile> thumFileList)throws Exception;
/** 업데이트 이후 ID값을 이용해 조회후 출력*/
public CalenderBean selectUpdateId(CalenderBean calenderBean)throws Exception;
/** 내점이력 삭제*/
public int deleteVisitCalender(CalenderBean calenderBean)throws Exception;
/**내점이력 리스트 조회*/
public List<CalenderBean> selectVisitList(CalenderBean calenderBean)throws Exception;
}

View File

@ -0,0 +1,253 @@
package com.loglog.api.commons.modules.service.calender;
import java.io.File;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.UUID;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import com.loglog.api.commons.beans.CalenderBean;
import com.loglog.api.commons.daos.CalenderDao;
@Service
public class CalenderServiceImpl implements CalenderService {
// 레파지토리 경로
@Value("${repository.path}")
private String RESPOSITORY_PATH;
// 내점이력 이미지 폴더 경로
@Value("${upload.visit.path}")
private String UPLOAD_VISIT_PATH;
// BASE URL 내점기록 경로
@Value("${server.url.img.mycard}")
private String URL_IMG_thumFile;
@Autowired
private CalenderDao calenderDao;
@Override
public int selectShopInfo(CalenderBean calenderBean) {
return calenderDao.selectShopInfo(calenderBean);
}
@Override
public int insertCalender(CalenderBean calenderBean) {
return calenderDao.insertCalender(calenderBean);
}
/** 캘린더 조회 */
public List<CalenderBean> selectCalenderMon(CalenderBean calenderBean){
return calenderDao.selectCalenderMon(calenderBean);
}
/** 스케줄 저장 */
public int insertSchedule (CalenderBean calenderBean) {
return calenderDao.insertSchedule(calenderBean);
}
/** 스케줄 디테일 조회*/
public List<CalenderBean> selectCalenderDay(CalenderBean calenderBean){
return calenderDao.selectCalenderDay(calenderBean);
}
/** 스케줄 업데이트 */
public int updateCalender(CalenderBean calenderBean) {
return calenderDao.updateCalender(calenderBean);
}
/** 저장후 고유ID를 이용해 데이터를 조회*/
public CalenderBean selectCalenderId(CalenderBean calenderBean)throws Exception{
calenderBean.setBaseImgUrl(URL_IMG_thumFile);
return calenderDao.selectCalenderId(calenderBean);
}
/** 내점기록저장후 내용이나 사진 업데이트*/
public int updateCalenderthum(CalenderBean calenderBean, List<MultipartFile> thumFileList)throws Exception{
int result = 0;
CalenderBean calBean = calenderDao.selectCalenderId(calenderBean);
//1.유지처리
String updatedImgUrl = calenderBean.getNoteUpdatedImgUrlList(); // 유지시킬 URL
String splitList[] = null;
int loopCnt = 0;
if(updatedImgUrl == null) {
System.out.println("111");
}
if(updatedImgUrl != null) {
splitList = updatedImgUrl.split(",");
calenderDao.cleanCalenderThum(calenderBean); // 섬네일 초기화
for(int i=0; i<splitList.length; i++) {
String splitStr = splitList[i];
String removeUrl = splitStr.replaceAll("https://loglog.le-it.com","");
if(i == 0) {
calenderBean.setThumbnail1(removeUrl);
System.out.println(removeUrl);
loopCnt++;
}
if(i == 1) {
calenderBean.setThumbnail2(removeUrl);
System.out.println(removeUrl);
loopCnt++;
}
if(i == 2) {
calenderBean.setThumbnail3(removeUrl);
System.out.println(removeUrl);
loopCnt++;
}
}
System.out.println("loopCnt : " + loopCnt);
result = calenderDao.updateCalenderthum(calenderBean);
}
//3.기존 thumb1,thumb2,thumb3 삭제
//4.새로 thumb1,thumb2,thumb3 업데이트 한다.
ArrayList<String> Files = new ArrayList<String> ();
String baseFolder = UPLOAD_VISIT_PATH +"/visitRecord/"; // baseFolder = /up_imgs/visit_img/visitRecord/
// thumbFolder = C:/DEV/WORKS/loglog_project/SRC/LogLogAPI/src/main/webapp/up_imgs/visit_img/visitRecord/오늘날짜
String thumbFolder = RESPOSITORY_PATH + baseFolder + calenderBean.getUserCd() + "/" + calenderBean.getShopCd();
String btThumbImg1Path = null;
String btThumbImg2Path = null;
String btThumbImg3Path = null;
CalenderBean thumimg = calenderDao.selectCalenderId(calenderBean);
if( thumimg != null) {
btThumbImg1Path = thumimg.getThumbnail1(); // 기존에 있는 파일이 있을때 수정 파일을 백업
btThumbImg2Path = thumimg.getThumbnail2();
btThumbImg3Path = thumimg.getThumbnail3();
}
if(thumFileList != null && updatedImgUrl == null) {
for(MultipartFile file : thumFileList ) {
//System.out.println("이미지 파일 로그:: " + file.getOriginalFilename());
MultipartFile thumbFile = file;
String fileName = thumbFile.getOriginalFilename();
String fileExt = fileName.substring( fileName.lastIndexOf(".") + 1 );
UUID uuid = UUID.randomUUID();
String thumImgPath = baseFolder + calenderBean.getUserCd() + "/" + calenderBean.getShopCd() + "/" + uuid + "." + fileExt; // db애 저장된 경로
String thumbPath = thumbFolder + "/" + uuid + "." + fileExt; // 파일 완전경로
File tempFolder = new File( thumbFolder );
if ( !tempFolder.exists() ){
tempFolder.mkdirs();
}
//System.out.println("thumbPath: " + thumbPath);
thumbFile.transferTo(new File(thumbPath));
Files.add(thumImgPath);
}
if(thumFileList.size() == 1) {
String filePath1 = Files.get(0);
calenderBean.setThumbnail1(filePath1);
}else if(thumFileList.size() == 2) {
String filePath1 = Files.get(0);
String filePath2 = Files.get(1);
calenderBean.setThumbnail1(filePath1);
calenderBean.setThumbnail2(filePath2);
}else if(thumFileList.size() == 3) {
String filePath1 = Files.get(0);
String filePath2 = Files.get(1);
String filePath3 = Files.get(2);
calenderBean.setThumbnail1(filePath1);
calenderBean.setThumbnail2(filePath2);
calenderBean.setThumbnail3(filePath3);
}
}else if(thumFileList != null && updatedImgUrl != null) {
for(MultipartFile file : thumFileList ) {
//System.out.println("이미지 파일 로그:: " + file.getOriginalFilename());
MultipartFile thumbFile = file;
String fileName = thumbFile.getOriginalFilename();
String fileExt = fileName.substring( fileName.lastIndexOf(".") + 1 );
UUID uuid = UUID.randomUUID();
String thumImgPath = baseFolder + calenderBean.getUserCd() + "/" + calenderBean.getShopCd() + "/" + uuid + "." + fileExt; // db애 저장된 경로
String thumbPath = thumbFolder + "/" + uuid + "." + fileExt; // 파일 완전경로
File tempFolder = new File( thumbFolder );
if ( !tempFolder.exists() ){
tempFolder.mkdirs();
}
//System.out.println("thumbPath: " + thumbPath);
thumbFile.transferTo(new File(thumbPath));
Files.add(thumImgPath);
}
if(thumFileList.size() == 1) {
String filePath3 = Files.get(0);
System.out.println("유지하는 이미지 개수" + splitList.length);
if(splitList.length == 1) {
calenderBean.setThumbnail2(filePath3);
}else if(splitList.length == 2) {
calenderBean.setThumbnail3(filePath3);
}
}else if(thumFileList.size() == 2) {
String filePath2 = Files.get(0);
String filePath3 = Files.get(1);
calenderBean.setThumbnail2(filePath2);
calenderBean.setThumbnail3(filePath3);
}else if(thumFileList.size() == 3) {
String filePath1 = Files.get(0);
String filePath2 = Files.get(1);
String filePath3 = Files.get(2);
calenderBean.setThumbnail1(filePath1);
calenderBean.setThumbnail2(filePath2);
calenderBean.setThumbnail3(filePath3);
}
}
result = calenderDao.updateCalenderthum(calenderBean);
// if(result > 0) {
// if(btThumbImg1Path != null) {
// File thumb1Img = new File(RESPOSITORY_PATH + btThumbImg1Path);
// try {
// thumb1Img.delete();
// } catch (Exception e) {
// e.getMessage();
// }
// }
//
// if(btThumbImg2Path != null) {
// File thumb1Img = new File(RESPOSITORY_PATH + btThumbImg2Path);
// try {
// thumb1Img.delete();
// } catch (Exception e) {
// e.getMessage();
// }
// }
//
// if(btThumbImg3Path != null) {
// File thumb1Img = new File(RESPOSITORY_PATH + btThumbImg3Path);
// try {
// thumb1Img.delete();
// } catch (Exception e) {
// e.getMessage();
// }
// }
// }
return result;
}
/** 내점기록저장후 내용이나 사진 업데이트한걸 다시 업데이트*/
public int updateCalenderUrl(CalenderBean calenderBean,List<MultipartFile> thumFileList)throws Exception{
return calenderDao.updateCalenderthum(calenderBean);
}
/** 업데이트 이후 ID값을 이용해 조회후 출력*/
public CalenderBean selectUpdateId(CalenderBean calenderBean)throws Exception{
calenderBean.setBaseImgUrl(URL_IMG_thumFile);
return calenderDao.selectUpdateId(calenderBean);
}
/** 내점이력 삭제*/
public int deleteVisitCalender(CalenderBean calenderBean)throws Exception{
return calenderDao.deleteVisitCalender(calenderBean);
}
/**내점이력 리스트 조회*/
public List<CalenderBean> selectVisitList(CalenderBean calenderBean)throws Exception{
calenderBean.setBaseImgUrl(URL_IMG_thumFile);
return calenderDao.selectVisitList(calenderBean);
}
}

View File

@ -0,0 +1,26 @@
package com.loglog.api.commons.modules.service.card;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import com.loglog.api.commons.beans.CardMasterBean;
import com.loglog.api.commons.beans.CardImgBean;
public interface CardImgService {
/**카드 이미지 등록*/
public int insertCardImg(CardMasterBean cardMasterBean, List<CardImgBean> cardImgList) throws Exception;
/**카드 이미지 수정*/
public int updateCardImg(CardMasterBean cardMasterBean, List<CardImgBean> cardImgList) throws Exception;
/** 카드 이미지 삭제*/
public void DeleteImg(int janNo )throws Exception;
/** 카드 이미지 리스트*/
public List<CardImgBean> cardImgList(List<CardImgBean> list)throws Exception;
}

View File

@ -0,0 +1,192 @@
package com.loglog.api.commons.modules.service.card;
import java.io.File;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import org.apache.commons.io.FileUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import com.loglog.api.commons.beans.CardImgBean;
import com.loglog.api.commons.beans.CardMasterBean;
import com.loglog.api.commons.daos.CardMasterDao;
import com.loglog.api.commons.daos.CardImgDao;
@Service
public class CardImgServiceImpl implements CardImgService {
@Autowired
private CardMasterDao cardMasterDao;
@Autowired
private CardImgDao cardImgDao;
// 레파지토리 경로
@Value("${repository.path}")
private String RESPOSITORY_PATH;
// 보드 이미지 폴더 경로
@Value("${upload.board.path}")
private String UPLOAD_BOARD_PATH;
// 다음 에디터 이미지 임시 폴더 경로
@Value("${upload.daum.editor.image.temp.path}")
private String UPLOAD_DAUM_EDITOR_IMAGE_TEMP_PATH;
// 다음 에디터 파일 임시 폴더 경로
@Value("${upload.daum.editor.file.temp.path}")
private String UPLOAD_DAUM_EDITOR_FILE_TEMP_PATH;
/**카드 이미지 등록*/
public int insertCardImg(CardMasterBean cardMasterBean, List<CardImgBean> cardImgList) throws Exception{
int result =0;
List<File> deleteFileList = new ArrayList<File>();
/* 게시글 이미지 등록 */
for(int i=0; i<cardImgList.size(); i++){
CardImgBean cardImgBean = cardImgList.get(i);
File cardImgTempFile = new File(System.getProperty("user.dir") + RESPOSITORY_PATH + cardImgBean.getImgPath());
deleteFileList.add(cardImgTempFile);
Date date = new Date();
SimpleDateFormat newDate = new SimpleDateFormat("yyyyMMdd");
String cardImgPath = UPLOAD_BOARD_PATH + "/" + cardMasterBean.getJanNo() + "/" + newDate.format(date) + "/"+ cardImgTempFile.getName();
File boardImgFile = new File(System.getProperty("user.dir") + RESPOSITORY_PATH + cardImgPath);
System.out.println("before save : " + cardImgPath + " : " + cardImgTempFile.getAbsolutePath());
FileUtils.copyFile(cardImgTempFile, boardImgFile);
cardImgBean.setImgPath(cardImgPath);
//이미지 정보를 DB에 저장
result += cardImgDao.insertCardImg(cardImgBean);
//이미지의 저장경로를 변경
String changeImg = "<img src=\"";
String imgPath = changeImg + UPLOAD_BOARD_PATH;
changeImg += UPLOAD_DAUM_EDITOR_IMAGE_TEMP_PATH;
result += cardMasterDao.updateCard(cardMasterBean);
//Temp파일 삭제
cardImgTempFile.delete();
}
return result;
}
/**카드 이미지 수정*/
public int updateCardImg(CardMasterBean cardMasterBean, List<CardImgBean> cardImgList) throws Exception{
int result = 0;
List<File> deleteFileList = new ArrayList<File>();
// 기존 이미지 데이터 삭제
// UI에서 삭제된 이미지일 경우 이미지 경로가 안들어오므로,
// 체크하여 삭제한다.
List<String> cardImgArray = new ArrayList<String>();
if (cardImgList != null && cardImgList.size() != 0) {
for (int i = 0; i < cardImgList.size(); i++) {
CardImgBean cardImgBean = cardImgList.get(i);
// 이미지 변경 없음
System.out.println("first---"+cardImgBean.getImgPath().indexOf(UPLOAD_BOARD_PATH));
System.out.println("second---"+cardImgBean.getImgPath().indexOf(UPLOAD_DAUM_EDITOR_IMAGE_TEMP_PATH));
if (cardImgBean.getImgPath().indexOf(UPLOAD_DAUM_EDITOR_IMAGE_TEMP_PATH) == -1) {
cardImgArray.add(cardImgBean.getImgPath());
}
}
}
// 삭제될 이미지 목록 조회
List<CardImgBean> deleteCardImgList = cardImgDao.deleteImgList(cardMasterBean.getJanNo(),cardImgArray);
if (deleteCardImgList != null && deleteCardImgList.size() != 0) {
// 삭제된 이미지 DB 삭제 처리
cardImgDao.deleteImgForUpdate(deleteCardImgList);
// 서버에서 이미지 삭제 처리
for (CardImgBean cardImgBean : deleteCardImgList) {
File deleteImgFile = new File(RESPOSITORY_PATH + cardImgBean.getImgPath());
try {
deleteImgFile.delete();
} catch (Exception e) {
e.getMessage();
}
}
}
if (cardImgList != null && cardImgList.size() != 0) {
// 게시글 이미지 수정
for (int i = 0; i < cardImgList.size(); i++) {
CardImgBean cardImgBean = cardImgList.get(i);
System.out.println("last---"+cardImgBean.getImgPath().indexOf(UPLOAD_DAUM_EDITOR_IMAGE_TEMP_PATH));
// 이미지 변경 없음
if (cardImgBean.getImgPath().indexOf(UPLOAD_DAUM_EDITOR_IMAGE_TEMP_PATH) == -1) {
//boardImgDao.updateBoardImg(boardImgBean);
// 이미지 변경 또는 신규 등록됨
} else {
File cardImgTempFile = new File(RESPOSITORY_PATH
+ cardImgBean.getImgPath());
deleteFileList.add(cardImgTempFile);
Date date = new Date();
SimpleDateFormat newDate = new SimpleDateFormat("yyyyMMdd");
String boardImgPath = UPLOAD_BOARD_PATH + "/" + cardMasterBean.getJanNo() + "/" + newDate.format(date) + "/"+ cardImgTempFile.getName();
File boardImgFile = new File(RESPOSITORY_PATH + boardImgPath);
// 정상적인 프로세스상 파일 이동이 이동되어야 하지만,
// 파일 복사로 변경
FileUtils.copyFile(cardImgTempFile, boardImgFile);
cardImgBean.setImgPath(boardImgPath);
result += cardImgDao.insertCardImg(cardImgBean);
String changeImg = "<img src=\"";
String imgPath = changeImg + UPLOAD_BOARD_PATH;
changeImg += UPLOAD_DAUM_EDITOR_IMAGE_TEMP_PATH;
//boardBean.setBdCont(boardBean.getBdCont().replaceAll(changeImg, imgPath+"/"+boardBean.getBdNo()));
result += cardMasterDao.updateCard(cardMasterBean);
result --;
cardImgTempFile.delete();
}
}
}
return result;
}
/** 카드 이미지 삭제*/
public void DeleteImg(String janNo )throws Exception{
cardImgDao.deleteImg(janNo);
File deleteImgFile = new File(RESPOSITORY_PATH + UPLOAD_BOARD_PATH + "/" + janNo);
FileUtils.deleteDirectory(deleteImgFile);
}
/** 카드 이미지 리스트*/
public List<CardImgBean> cardImgList(List<CardImgBean> list)throws Exception{
return cardImgDao.cardImgList(list);
}
@Override
public void DeleteImg(int janNo) throws Exception {
// TODO Auto-generated method stub
}
}

View File

@ -0,0 +1,64 @@
package com.loglog.api.commons.modules.service.card;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.multipart.MultipartFile;
import com.loglog.api.commons.beans.PagingBean;
import com.loglog.api.commons.beans.ShopMasterBean;
import com.loglog.api.commons.beans.UserBean;
import com.loglog.api.commons.beans.CardMasterBean;
import com.loglog.api.commons.beans.CardImgBean;
public interface CardMasterService {
/**유저 카드 조회*/
public List<CardMasterBean> selectCardList(CardMasterBean cardMasterBean) throws Exception;
/**카드저장*/
public int insertCard(CardMasterBean cardMasterBean, MultipartFile cardImageFile) throws Exception;
/**카드 저장전 중복체크*/
public int checkCardNm(CardMasterBean cardMasterBean) throws Exception;
/**카드 수정 전 카드이름 중복체크*/
public int checkCardNmUpdate(CardMasterBean cardMasterBean)throws Exception;
/**카드 정보 수정*/
public int updateCard(CardMasterBean cardMasterBean, MultipartFile cardImageFile) throws Exception;
/**카드 정보 수정*/
public int updateCardNoimg(CardMasterBean cardMasterBean)throws Exception;
/**카드 정보 삭제*/
public int deleteCard(CardMasterBean cardMasterBean) throws Exception;
/**자세한 카드정보 조회*/
public CardMasterBean detailCard(CardMasterBean cardMasterBean) throws Exception;
/**포인트값 더하기 */
public int updatePoint(CardMasterBean cardMasterBean)throws Exception;
/**포인트값 치김 */
public int deletePoint(CardMasterBean cardMasterBean)throws Exception;
/**포인트값 null을 0으로 바꾸기 */
public int changZeroPoint(CardMasterBean cardMasterBean)throws Exception;
/**포인트값 조회 */
public int selectPoint(CardMasterBean cardMasterBean)throws Exception;
/** 즐겨찾기한 카드 조회 */
public List<CardMasterBean> selectLikeCardList(CardMasterBean cardMasterBean);
/**카드좋아요 */
public int likeCard(CardMasterBean cardMasterBean);
/**카드좋아요 취소ㅓ */
public int unlikeCard(CardMasterBean cardMasterBean);
/**마이카드 등록하기 전 등록하지 않은 상점리스트 출력*/
public List<ShopMasterBean> selectNotRegisShopList(CardMasterBean cardMasterBean)throws Exception;
}

View File

@ -0,0 +1,197 @@
package com.loglog.api.commons.modules.service.card;
import java.io.File;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.UUID;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import com.loglog.api.commons.beans.CardImgBean;
import com.loglog.api.commons.beans.CardMasterBean;
import com.loglog.api.commons.beans.CouponUserListBean;
import com.loglog.api.commons.beans.ShopMasterBean;
import com.loglog.api.commons.daos.CardMasterDao;
import com.loglog.api.commons.daos.CardImgDao;
@Service
public class CardMasterServiceImpl implements CardMasterService {
// 레파지토리 경로
@Value("${repository.path}")
private String RESPOSITORY_PATH;
// 보드 이미지 폴더 경로
@Value("${upload.board.path}")
private String UPLOAD_CARD_PATH;
// BASE URL MyCard 경로
@Value("${server.url.img.mycard}")
private String URL_IMG_MYCARD;
@Value("${server.url.img.shop}")
private String URL_IMG_SHOP;
@Autowired
private CardMasterDao cardMasterDao;
@Autowired
private CardImgDao cardImgDao;
@Autowired
private CardImgService cardImgService;
@Override
public List<CardMasterBean> selectCardList(CardMasterBean cardMasterBean) throws Exception {
// TODO Auto-generated method stub
cardMasterBean.setBaseImgUrl(URL_IMG_MYCARD);
cardMasterBean.setBaseImgUrl2(URL_IMG_SHOP);
List<CardMasterBean> list = cardMasterDao.selectCardList(cardMasterBean);
return list;
}
@Override
public int insertCard(CardMasterBean cardMasterBean, MultipartFile cardImageFile) throws Exception{
SimpleDateFormat newDate = new SimpleDateFormat("yyyyMMdd");
Date date = new Date();
if(cardImageFile != null) {
System.out.println("이미지 파일 로그:: " + cardImageFile.getOriginalFilename());
System.out.println("디버그1");
MultipartFile thumbFile = cardImageFile;
String fileName = thumbFile.getOriginalFilename();
String fileExt = fileName.substring( fileName.lastIndexOf(".") + 1 );
UUID uuid = UUID.randomUUID();
String baseFolder = UPLOAD_CARD_PATH +"/mycard/";
String thumbFolder = RESPOSITORY_PATH + baseFolder + newDate.format(date);
String cardImgPath = baseFolder + newDate.format(date) + "/" + uuid + "." + fileExt; // db애 저장된 경로
String thumbPath = thumbFolder + "/" + uuid + "." + fileExt; // 파일 완전경로
File tempFolder = new File( thumbFolder );
if ( !tempFolder.exists() ){
tempFolder.mkdirs();
System.out.println("디버그2");
}
System.out.println("thumbPath: " + thumbPath);
thumbFile.transferTo(new File(thumbPath));
cardMasterBean.setCardImage( cardImgPath );
System.out.println("디버그" + cardMasterBean.getCardImage());
}
return cardMasterDao.insertCard(cardMasterBean);
}
public int checkCardNm(CardMasterBean cardMasterBean) throws Exception{
return cardMasterDao.checkCardNm(cardMasterBean);
}
/**카드 수정 전 카드이름 중복체크*/
public int checkCardNmUpdate(CardMasterBean cardMasterBean)throws Exception{
return cardMasterDao.checkCardNmUpdate(cardMasterBean);
}
public int updateCard(CardMasterBean cardMasterBean,MultipartFile cardImageFile) throws Exception{
SimpleDateFormat newDate = new SimpleDateFormat("yyyyMMdd");
Date date = new Date();
String btThumbImg1Path = null;
if(cardImageFile != null) {
System.out.println("이미지 파일 로그(수정)" + cardImageFile.getOriginalFilename());
MultipartFile thumbFile = cardImageFile;
String fileName = thumbFile.getOriginalFilename();
String fileExt = fileName.substring( fileName.lastIndexOf(".") + 1 );
UUID uuid = UUID.randomUUID();
String baseFolder = UPLOAD_CARD_PATH +"/mycard/";
String thumbFolder = RESPOSITORY_PATH + baseFolder + newDate.format(date);
String cardImgPath = baseFolder + newDate.format(date) + "/" + uuid + "." + fileExt; // db애 저장된 경로
String thumbPath = thumbFolder + "/" + uuid + "." + fileExt; // 파일 완전경로
File tempFolder = new File( thumbFolder );
if ( !tempFolder.exists() ){
tempFolder.mkdirs();
System.out.println("디버그2");
}
System.out.println("thumbPath: " + thumbPath);
thumbFile.transferTo(new File(thumbPath));
// 수정전 백업
btThumbImg1Path = cardMasterBean.getCardImage();
cardMasterBean.setCardImage(cardImgPath);
}
int result = cardMasterDao.updateCard(cardMasterBean);
if(result > 0) {
if(btThumbImg1Path != null) {
File thumb1Img = new File(RESPOSITORY_PATH + btThumbImg1Path);
try {
thumb1Img.delete();
} catch (Exception e) {
e.getMessage();
}
}
}
return result;
}
/**카드 정보 수정*/
public int updateCardNoimg(CardMasterBean cardMasterBean)throws Exception{
return cardMasterDao.updateCardNoimg(cardMasterBean);
}
public int deleteCard(CardMasterBean cardMasterBean) throws Exception{
return cardMasterDao.deleteCard(cardMasterBean);
}
/**자세한 카드정보 조회*/
public CardMasterBean detailCard(CardMasterBean cardMasterBean) throws Exception{
return cardMasterDao.detailCard(cardMasterBean);
}
/**포인트값 더하기 */
public int updatePoint(CardMasterBean cardMasterBean)throws Exception{
return cardMasterDao.updatePoint(cardMasterBean);
}
/**포인트값 치김 */
public int deletePoint(CardMasterBean cardMasterBean)throws Exception{
return cardMasterDao.deletePoint(cardMasterBean);
}
/**포인트값 null을 0으로 바꾸기 */
public int changZeroPoint(CardMasterBean cardMasterBean)throws Exception{
return cardMasterDao.changZeroPoint(cardMasterBean);
}
/**포인트값 조회 */
public int selectPoint(CardMasterBean cardMasterBean)throws Exception{
return cardMasterDao.selectPoint(cardMasterBean);
}
/** 즐겨찾기한 카드 조회 */
public List<CardMasterBean> selectLikeCardList(CardMasterBean cardMasterBean){
System.out.println(URL_IMG_MYCARD);
cardMasterBean.setBaseImgUrl(URL_IMG_MYCARD);
return cardMasterDao.selectLikeCardList(cardMasterBean);
}
/**카드좋아요 */
public int likeCard(CardMasterBean cardMasterBean) {
return cardMasterDao.likeCard(cardMasterBean);
}
/**카드좋아요 취소ㅓ */
public int unlikeCard(CardMasterBean cardMasterBean) {
return cardMasterDao.unlikeCard(cardMasterBean);
}
/**마이카드 등록하기 전 등록하지 않은 상점리스트 출력*/
public List<ShopMasterBean> selectNotRegisShopList(CardMasterBean cardMasterBean)throws Exception{
cardMasterBean.setBaseImgUrl(URL_IMG_SHOP);
return cardMasterDao.selectNotRegisShopList(cardMasterBean);
}
}

View File

@ -0,0 +1,266 @@
package com.loglog.api.commons.modules.service.coupon;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import com.loglog.api.commons.utils.CommonUtils;
import com.loglog.api.commons.beans.CategoryBean;
import com.loglog.api.commons.beans.CouponPublicBean;
import com.loglog.api.commons.beans.CouponUserListBean;
import com.loglog.api.commons.beans.GeolocationBean;
import com.loglog.api.commons.beans.PagingBean;
import com.loglog.api.commons.daos.CouponPublicDao;
@Service
public class ConponPublicServiceImpl implements CouponPublicService {
@Value("${server.url.img.coupon}")
private String URL_IMG_COUPON;
@Value("${server.url.img.shop}")
private String URL_IMG_SHOP;
@Value("${server.url.img.mycard}") // https://loglog.le-it.com
private String URL_IMG_MYCARD;
@Autowired
private CouponPublicDao couponPublicDao;
/**type : 1*/
public List<CouponUserListBean> selectGetCoupons(CouponPublicBean couponPublicBean,PagingBean pagingBean) throws Exception {
Map<String,Object> parameter = new HashMap<String, Object>();
couponPublicBean.setBaseImgUrl(URL_IMG_COUPON);
couponPublicBean.setBaseImgUrl2(URL_IMG_SHOP); // 상점 이미지 BASE URL
parameter.put("userCd",couponPublicBean.getUserCd());
parameter.put("baseImgUrl", couponPublicBean.getBaseImgUrl());
parameter.put("baseImgUrl2", couponPublicBean.getBaseImgUrl2());
parameter.put("categoryCd", couponPublicBean.getCategoryCd());
parameter.put("type", couponPublicBean.getType());
parameter.put("searchKind",pagingBean.getSearchKind());
parameter.put("search", pagingBean.getSearch());
parameter.put("pageNo", pagingBean.getPageNo());
parameter.put("startRow", pagingBean.getStartRow());
parameter.put("countPerRecord", pagingBean.getCountPerRecord());
List<CouponUserListBean> list = couponPublicDao.selectGetCoupons(parameter);
//기존 파일명을 URL 인코딩 하여 전달한다. 파일명이 일본어일 경우 표시가 안됨으로
for(CouponUserListBean item : list) {
String encodShopImg = URLEncoder.encode(item.getShopThumbNail1(), StandardCharsets.UTF_8.toString()).replace("+", "%20");
String shopCd = item.getShopCd();
String couponCd = item.getCouponCd();
String shopUrlPath = URL_IMG_SHOP + "/" + shopCd + "/" + encodShopImg;
item.setShopimage( shopUrlPath );
//System.out.println("shopUrlPath:" + shopUrlPath);
String encodCouponImg = URLEncoder.encode(item.getCouponThumbnail1(), StandardCharsets.UTF_8.toString()).replace("+", "%20");
String couponUrlPath = URL_IMG_COUPON + "/" + shopCd + "/" + couponCd + "/"+ encodCouponImg;
if( "000011".equals(shopCd) ) {
System.out.println("getCouponThumbnail1:" + item.getCouponThumbnail1());
System.out.println("encodCouponImg:" + encodCouponImg);
System.out.println("couponUrlPath:" + couponUrlPath);
}
boolean isVerify = CommonUtils.getImageUrlVerify( couponUrlPath );
item.setThumbnail1( couponUrlPath );
// if(isVerify) {
// item.setThumbnail1( couponUrlPath );
// }else {
// item.setThumbnail1( shopUrlPath );
// }
}
return list;
}
/**type : 2*/
public List<CouponUserListBean> selectGeoGetCoupons(CouponPublicBean couponPublicBean, GeolocationBean geolocationBean,PagingBean pagingBean) throws Exception {
Map<String,Object> parameter = new HashMap<String, Object>();
couponPublicBean.setBaseImgUrl(URL_IMG_COUPON);
couponPublicBean.setBaseImgUrl2(URL_IMG_SHOP);
parameter.put("longtitude",geolocationBean.getLongtitude());
parameter.put("latitude",geolocationBean.getLatitude());
parameter.put("userCd",couponPublicBean.getUserCd());
parameter.put("baseImgUrl", couponPublicBean.getBaseImgUrl());
parameter.put("baseImgUrl2", couponPublicBean.getBaseImgUrl2());
parameter.put("categoryCd", couponPublicBean.getCategoryCd());
parameter.put("searchKind",pagingBean.getSearchKind());
parameter.put("search", pagingBean.getSearch());
parameter.put("pageNo", pagingBean.getPageNo());
parameter.put("startRow", pagingBean.getStartRow());
parameter.put("countPerRecord", pagingBean.getCountPerRecord());
List<CouponUserListBean> list = couponPublicDao.selectGeoGetCoupons(parameter);
//기존 파일명을 URL 인코딩 하여 전달한다. 파일명이 일본어일 경우 표시가 안됨으로
for(CouponUserListBean item : list) {
String encodShopImg = URLEncoder.encode(item.getShopThumbNail1(), StandardCharsets.UTF_8.toString()).replace("+", "%20");
String shopCd = item.getShopCd();
String couponCd = item.getCouponCd();
String shopUrlPath = URL_IMG_SHOP + "/" + shopCd + "/" + encodShopImg;
item.setShopimage( shopUrlPath );
//System.out.println("shopUrlPath:" + shopUrlPath);
String encodCouponImg = URLEncoder.encode(item.getCouponThumbnail1(), StandardCharsets.UTF_8.toString()).replace("+", "%20");
String couponUrlPath = URL_IMG_COUPON + "/" + shopCd + "/" + couponCd + "/"+ encodCouponImg;
item.setThumbnail1( couponUrlPath );
}
return list;
}
/**쿠폰 갯수 반환 */
public int selectCouponCount(CouponPublicBean couponPublicBean,PagingBean pagingBean) {
Map<String,Object> parameter = new HashMap<String, Object>();
parameter.put("userCd",couponPublicBean.getUserCd());
parameter.put("categoryCd", couponPublicBean.getCategoryCd());
parameter.put("searchKind",pagingBean.getSearchKind());
parameter.put("search", pagingBean.getSearch());
parameter.put("pageNo", pagingBean.getPageNo());
return couponPublicDao.selectCouponCount(parameter);
}
/**쿠폰생성(유효회원이 아닐때) */
public int insertCouponNotPaid(CouponPublicBean couponPublicBean)throws Exception{
return couponPublicDao.insertCouponNotPaid(couponPublicBean);
}
/**쿠폰생성(유효회원) */
public int insertCouponPaid(CouponPublicBean couponPublicBean)throws Exception{
return couponPublicDao.insertCouponPaid(couponPublicBean);
}
/**좋아요 쿠폰 개수 반환*/
public int selectLikeCouponCount(CouponPublicBean couponPublicBean,PagingBean pagingBean)throws Exception{
Map<String,Object> parameter = new HashMap<String, Object>();
parameter.put("userCd",couponPublicBean.getUserCd());
parameter.put("categoryCd", couponPublicBean.getCategoryCd());
parameter.put("searchKind",pagingBean.getSearchKind());
parameter.put("search", pagingBean.getSearch());
parameter.put("pageNo", pagingBean.getPageNo());
return couponPublicDao.selectLikeCouponCount(parameter);
}
/** 좋아요 쿠폰 조회 */
public List<CouponUserListBean> selectGetLikeCoupons(CouponPublicBean couponPublicBean, PagingBean pagingBean)throws Exception{
Map<String,Object> parameter = new HashMap<String, Object>();
couponPublicBean.setBaseImgUrl(URL_IMG_COUPON);
couponPublicBean.setBaseImgUrl2(URL_IMG_SHOP);
parameter.put("userCd",couponPublicBean.getUserCd());
parameter.put("baseImgUrl", couponPublicBean.getBaseImgUrl());
parameter.put("baseImgUrl2", couponPublicBean.getBaseImgUrl2());
parameter.put("categoryCd", couponPublicBean.getCategoryCd());
parameter.put("searchKind",pagingBean.getSearchKind());
parameter.put("search", pagingBean.getSearch());
parameter.put("pageNo", pagingBean.getPageNo());
parameter.put("startRow", pagingBean.getStartRow());
parameter.put("countPerRecord", pagingBean.getCountPerRecord());
List<CouponUserListBean> list = couponPublicDao.selectGetLikeCoupons(parameter);
//기존 파일명을 URL 인코딩 하여 전달한다. 파일명이 일본어일 경우 표시가 안됨으로
for(CouponUserListBean item : list) {
String encodShopImg = URLEncoder.encode(item.getShopThumbNail1(), StandardCharsets.UTF_8.toString()).replace("+", "%20");
String shopCd = item.getShopCd();
String shopUrlPath = URL_IMG_SHOP + "/" + shopCd + "/" + encodShopImg;
item.setShopimage( shopUrlPath );
//System.out.println("shopUrlPath:" + shopUrlPath);
String couponCd = item.getCouponCd();
String encodCouponImg = URLEncoder.encode(item.getCouponThumbnail1(), StandardCharsets.UTF_8.toString()).replace("+", "%20");
String couponUrlPath = URL_IMG_COUPON + "/" + shopCd + "/" + couponCd + "/"+ encodCouponImg;
item.setThumbnail1( couponUrlPath );
}
return list;
}
/** 쿠폰 좋아요 */
public int insertCouponLike(CouponPublicBean couponPublicBean)throws Exception{
return couponPublicDao.insertCouponLike(couponPublicBean);
}
/** 쿠폰 좋아요 취소 */
public int insertCouponUnLike(CouponPublicBean couponPublicBean)throws Exception{
return couponPublicDao.insertCouponUnLike(couponPublicBean);
}
/** 쿠폰 사용 */
public int insertUseCoupon(CouponPublicBean couponPublicBean)throws Exception{
return couponPublicDao.insertUseCoupon(couponPublicBean);
}
/**상세정보를 확인한 쿠폰 개수 반환*/
public int selectSeenCouponCount(CouponPublicBean couponPublicBean,PagingBean pagingBean)throws Exception{
Map<String,Object> parameter = new HashMap<String, Object>();
parameter.put("userCd",couponPublicBean.getUserCd());
parameter.put("categoryCd", couponPublicBean.getCategoryCd());
parameter.put("searchKind",pagingBean.getSearchKind());
parameter.put("search", pagingBean.getSearch());
parameter.put("pageNo", pagingBean.getPageNo());
return couponPublicDao.selectSeenCouponCount(parameter);
}
/**상세정보를 확인한 쿠폰 리스트 */
public List<CouponUserListBean> selectSeenCoupons(CouponPublicBean couponPublicBean,PagingBean pagingBean)throws Exception{
Map<String,Object> parameter = new HashMap<String, Object>();
couponPublicBean.setBaseImgUrl(URL_IMG_COUPON);
couponPublicBean.setBaseImgUrl2(URL_IMG_SHOP);
parameter.put("userCd",couponPublicBean.getUserCd());
parameter.put("baseImgUrl", couponPublicBean.getBaseImgUrl());
parameter.put("baseImgUrl2", couponPublicBean.getBaseImgUrl2());
parameter.put("categoryCd", couponPublicBean.getCategoryCd());
parameter.put("searchKind",pagingBean.getSearchKind());
parameter.put("search", pagingBean.getSearch());
parameter.put("pageNo", pagingBean.getPageNo());
parameter.put("startRow", pagingBean.getStartRow());
parameter.put("countPerRecord", pagingBean.getCountPerRecord());
List<CouponUserListBean> list = couponPublicDao.selectSeenCoupons(parameter);
for(CouponUserListBean item : list) {
String encodShopImg = URLEncoder.encode(item.getShopThumbNail1(), StandardCharsets.UTF_8.toString()).replace("+", "%20");
String shopCd = item.getShopCd();
String couponCd = item.getCouponCd();
String shopUrlPath = URL_IMG_SHOP + "/" + shopCd + "/" + encodShopImg;
item.setShopimage( shopUrlPath );
//System.out.println("shopUrlPath:" + shopUrlPath);
String encodCouponImg = URLEncoder.encode(item.getCouponThumbnail1(), StandardCharsets.UTF_8.toString()).replace("+", "%20");
String couponUrlPath = URL_IMG_COUPON + "/" + shopCd + "/" + couponCd + "/"+ encodCouponImg;
item.setThumbnail1( couponUrlPath );
}
return list;
}
/**쿠폰 상세정보를 볼때 DB업데이트 - coupon_seen*/
public int insertSeenCoupon(CouponPublicBean couponPublicBean)throws Exception{
return couponPublicDao.insertSeenCoupon(couponPublicBean);
}
/**coupon_seen에 중복데이터 체크*/
public int selectSeenCheck(CouponPublicBean couponPublicBean)throws Exception{
return couponPublicDao.selectSeenCheck(couponPublicBean);
}
/** 카테고리 리스트 */
public List<CategoryBean> selectCategoryList(CategoryBean categoryBean)throws Exception{
categoryBean.setBaseImgUrl(URL_IMG_MYCARD);
return couponPublicDao.selectCategoryList(categoryBean);
}
/** 쿠폰의 존재 여부 체크 */
public int selectCouponCheck(CouponPublicBean couponPublicBean)throws Exception{
return couponPublicDao.selectCouponCheck(couponPublicBean);
}
/** 쿠폰의 사용여부 체크 */
public int selectUsedCouponCheck(CouponPublicBean couponPublicBean)throws Exception{
return couponPublicDao.selectUsedCouponCheck(couponPublicBean);
}
}

View File

@ -0,0 +1,19 @@
package com.loglog.api.commons.modules.service.coupon;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import com.loglog.api.commons.beans.CouponMasterBean;
import com.loglog.api.commons.beans.CouponPublicBean;
import com.loglog.api.commons.beans.PagingBean;
import com.loglog.api.commons.beans.UserBean;
import com.loglog.api.commons.beans.GeolocationBean;
public interface CouponMasterService {
public int selectCouponPage(CouponMasterBean couponMasterBean) throws Exception;
public CouponMasterBean selectCouponDetail(CouponMasterBean CouponMasterBean) throws Exception;
}

View File

@ -0,0 +1,28 @@
package com.loglog.api.commons.modules.service.coupon;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import com.loglog.api.commons.beans.CouponMasterBean;
import com.loglog.api.commons.daos.CouponMasterDao;
@Service
public class CouponMasterServiceImpl implements CouponMasterService {
@Value("${server.url.img.coupon}")
private String URL_IMG_COUPON;
@Autowired
private CouponMasterDao couponMasterDao;
@Override
public int selectCouponPage(CouponMasterBean couponMasterBean) throws Exception {
return couponMasterDao.selectCouponPage(couponMasterBean);
}
public CouponMasterBean selectCouponDetail(CouponMasterBean CouponMasterBean) throws Exception{
CouponMasterBean.setBaseImgUrl(URL_IMG_COUPON);
return couponMasterDao.selectCouponDetail(CouponMasterBean);
}
}

View File

@ -0,0 +1,67 @@
package com.loglog.api.commons.modules.service.coupon;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import com.loglog.api.commons.beans.CategoryBean;
import com.loglog.api.commons.beans.CouponPublicBean;
import com.loglog.api.commons.beans.CouponUserListBean;
import com.loglog.api.commons.beans.PagingBean;
import com.loglog.api.commons.beans.UserBean;
import com.loglog.api.commons.beans.GeolocationBean;
public interface CouponPublicService {
/**사용자 쿠폰정보 가져오기 위경도값 없음 */
public List<CouponUserListBean> selectGetCoupons(CouponPublicBean couponPublicBean,PagingBean pagingBean) throws Exception;
/**사용자 쿠폰정보 가져오기 위경도값 있음 */
public List<CouponUserListBean> selectGeoGetCoupons(CouponPublicBean couponPublicBean, GeolocationBean geolocationBean ,PagingBean pagingBean ) throws Exception;
/**쿠폰 갯수 반환 */
public int selectCouponCount(CouponPublicBean couponPublicBean,PagingBean pagingBean);
/**쿠폰생성(유효회원이 아닐때) */
public int insertCouponNotPaid(CouponPublicBean couponPublicBean)throws Exception;
/**쿠폰생성(유효회원) */
public int insertCouponPaid(CouponPublicBean couponPublicBean)throws Exception;
/**좋아요 쿠폰 개수 반환*/
public int selectLikeCouponCount(CouponPublicBean couponPublicBean,PagingBean pagingBean)throws Exception;
/** 좋아요 쿠폰 조회 */
public List<CouponUserListBean> selectGetLikeCoupons(CouponPublicBean couponPublicBean,PagingBean pagingBean)throws Exception;
/**쿠폰 좋아요*/
public int insertCouponLike(CouponPublicBean couponPublicBean)throws Exception;
/**쿠폰 좋아요*/
public int insertCouponUnLike(CouponPublicBean couponPublicBean)throws Exception;
/**쿠폰 사용*/
public int insertUseCoupon(CouponPublicBean couponPublicBean)throws Exception;
/**상세정보를 확인한 쿠폰 개수 반환*/
public int selectSeenCouponCount(CouponPublicBean couponPublicBean,PagingBean pagingBean)throws Exception;
/**상세정보를 확인한 쿠폰 리스트 */
public List<CouponUserListBean> selectSeenCoupons(CouponPublicBean couponPublicBean,PagingBean pagingBean)throws Exception;
/**쿠폰 상세정보를 볼때 DB업데이트 - coupon_seen*/
public int insertSeenCoupon(CouponPublicBean couponPublicBean)throws Exception;
/**coupon_seen에 중복데이터 체크*/
public int selectSeenCheck(CouponPublicBean couponPublicBean)throws Exception;
/**카테고리 리스트*/
public List<CategoryBean> selectCategoryList(CategoryBean categoryBean)throws Exception;
/**쿠폰의 존재 여부 체크*/
public int selectCouponCheck(CouponPublicBean couponPublicBean)throws Exception;
/**쿠폰의 사용여부 체크*/
public int selectUsedCouponCheck(CouponPublicBean couponPublicBean)throws Exception;
}

View File

@ -0,0 +1,49 @@
package com.loglog.api.commons.modules.service.message;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import com.loglog.api.commons.beans.PagingBean;
import com.loglog.api.commons.beans.ShopDetailBean;
import com.loglog.api.commons.beans.UserBean;
import com.loglog.api.commons.beans.CardMasterBean;
import com.loglog.api.commons.beans.CouponPublicBean;
import com.loglog.api.commons.beans.CouponUserListBean;
import com.loglog.api.commons.beans.MsgMasterBean;
public interface MsgMasterService {
public List<MsgMasterBean> selectMsgText(MsgMasterBean msgMasterBean);
/**통지 메시지 출력*/
public List<MsgMasterBean> selectNoitMsg(MsgMasterBean msgMasterBean);
/**유저 전체 메세지 디테일*/
public MsgMasterBean selectMsgTextDetail(MsgMasterBean msgMasterBean);
/**유저 통지 메세지 디테일*/
public MsgMasterBean selectNoitMsgDetail(MsgMasterBean msgMasterBean);
/**즐겨찾기한 상점의 메세지리스트*/
public List<MsgMasterBean> selectShopMsgList(MsgMasterBean msgMasterBean)throws Exception;
/**즐겨찾기한 상점이 보내준 메세지 상세내용*/
public List<MsgMasterBean> selectShopMsgDetail(MsgMasterBean msgMasterBean)throws Exception;
/**오시라세 디테일 확인시 seen컬럼 1로 업데이트*/
public int updateMsgSeen(MsgMasterBean msgMasterBean)throws Exception;
/**msgType : 1인 메세지의 상세내용*/
public List<MsgMasterBean> selectMegDeltail(MsgMasterBean msgMasterBean)throws Exception;
/**유저 읽지 않은 통지 메세지 개수 반환*/
public MsgMasterBean selectNotReadNotice(MsgMasterBean msgMasterBean)throws Exception;
/**유저 읽지 않은 오시라세 메세지 개수 반환*/
public MsgMasterBean selectNotReadShopMsg(MsgMasterBean msgMasterBean)throws Exception;
/**통지 상세보기 읽음처리*/
public int updateNoticSeen(MsgMasterBean msgMasterBean)throws Exception;
}

View File

@ -0,0 +1,79 @@
package com.loglog.api.commons.modules.service.message;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import com.loglog.api.commons.beans.MsgMasterBean;
import com.loglog.api.commons.daos.MsgMasterDao;
@Service
public class MsgMasterServiceImpl implements MsgMasterService {
@Value("${server.url.img.shop}")
private String URL_IMG_SHOP;
@Autowired
private MsgMasterDao msgMasterDao;
@Override
public List<MsgMasterBean> selectMsgText(MsgMasterBean msgMasterBean) {
msgMasterBean.setBaseImgUrl(URL_IMG_SHOP);
return msgMasterDao.selectMsgText(msgMasterBean);
}
/**통지 메시지 출력*/
public List<MsgMasterBean> selectNoitMsg(MsgMasterBean msgMasterBean){
msgMasterBean.setBaseImgUrl(URL_IMG_SHOP);
return msgMasterDao.selectNoitMsg(msgMasterBean);
}
/**유저 전체 메세지 디테일*/
public MsgMasterBean selectMsgTextDetail(MsgMasterBean msgMasterBean) {
msgMasterBean.setBaseImgUrl(URL_IMG_SHOP);
return msgMasterDao.selectMsgTextDetail(msgMasterBean);
}
/**유저 통지 메세지 디테일*/
public MsgMasterBean selectNoitMsgDetail(MsgMasterBean msgMasterBean) {
return msgMasterDao.selectNoitMsgDetail(msgMasterBean);
}
/**즐겨찾기한 상점의 메세지리스트*/
public List<MsgMasterBean> selectShopMsgList(MsgMasterBean msgMasterBean)throws Exception{
msgMasterBean.setBaseImgUrl(URL_IMG_SHOP);
return msgMasterDao.selectShopMsgList(msgMasterBean);
}
/**즐겨찾기한 상점이 보내준 메세지 상세내용*/
public List<MsgMasterBean> selectShopMsgDetail(MsgMasterBean msgMasterBean)throws Exception{
msgMasterBean.setBaseImgUrl(URL_IMG_SHOP);
return msgMasterDao.selectShopMsgDetail(msgMasterBean);
}
/**오시라세 디테일 확인시 seen컬럼 1로 업데이트*/
public int updateMsgSeen(MsgMasterBean msgMasterBean)throws Exception{
return msgMasterDao.updateMsgSeen(msgMasterBean);
}
/**msgType : 1인 메세지의 상세내용*/
public List<MsgMasterBean> selectMegDeltail(MsgMasterBean msgMasterBean)throws Exception{
msgMasterBean.setBaseImgUrl(URL_IMG_SHOP);
return msgMasterDao.selectMegDeltail(msgMasterBean);
}
/**유저 읽지 않은 통지 메세지 개수 반환*/
public MsgMasterBean selectNotReadNotice(MsgMasterBean msgMasterBean)throws Exception{
return msgMasterDao.selectNotReadNotice(msgMasterBean);
}
/**유저 읽지 않은 오시라세 메세지 개수 반환*/
public MsgMasterBean selectNotReadShopMsg(MsgMasterBean msgMasterBean)throws Exception{
return msgMasterDao.selectNotReadShopMsg(msgMasterBean);
}
/**통지 상세보기 읽음처리*/
public int updateNoticSeen(MsgMasterBean msgMasterBean)throws Exception{
return msgMasterDao.updateNoticSeen(msgMasterBean);
}
}

View File

@ -0,0 +1,45 @@
package com.loglog.api.commons.modules.service.noti;
import java.util.List;
import com.loglog.api.commons.beans.NotiAttachBean;
import com.loglog.api.commons.beans.NotiBean;
import com.loglog.api.commons.beans.PagingBean;
import com.loglog.api.commons.interfaces.CommonInterface;
/**
* noti Service
* @author "JIK"
*
*/
public interface NotiService extends CommonInterface {
/** 공지사항 SelectNotiList */
List<NotiBean> selectNotiList(PagingBean pagingBean) throws Exception;
/** 공지사항 InsertNoti */
int insertNoti(NotiBean notiBean, String[] attach_type, String[] attach_file, String[] attach_file_name) throws Exception;
/** 공지사항 SelectNoti */
NotiBean selectNoti(NotiBean notiBean) throws Exception;
/** 공지사항 UpdateNoti */
int updateNoti(NotiBean notiBean, String[] attach_type, String[] attach_file, String[] attach_file_name) throws Exception;
/** 공지사항 DeleteNoti */
int deleteNoti(NotiBean notiBean) throws Exception;
/** 공지사항 총 수 */
int notiTotCnt(PagingBean pagingBean) throws Exception;
/** 공지사항 IndexList */
List<NotiBean> selectNotiIndexList(PagingBean pagingBean) throws Exception;
/** 공지사항 첨부파일 정보 조회 */
public List<NotiAttachBean> selectNotiAttach(String notiId) throws Exception;
/** 공지사항 첨부파일 다운로드 정보 조회 */
public NotiAttachBean selectNotiAttachInfo(String notiAttachId) throws Exception;
}

View File

@ -0,0 +1,433 @@
package com.loglog.api.commons.modules.service.noti;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.io.FileUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import com.loglog.api.commons.beans.NotiAttachBean;
import com.loglog.api.commons.beans.NotiBean;
import com.loglog.api.commons.beans.PagingBean;
import com.loglog.api.commons.daos.NotiAttachDao;
import com.loglog.api.commons.daos.NotiDao;
/**
* Noti ServiceImpl
* @author "JIK"
*
*/
@Service
public class NotiServiceImpl implements NotiService {
// 서버
@Value("${server}")
private String SERVER;
// 이미지 서버 URL
private String SERVER_URL_IMG;
// 사용자 레파지토리 경로
@Value("${repository.path}")
private String REPOSITORY_PATH;
// 다음 에디터 이미지 임시 폴더 경로
@Value("${upload.daum.editor.image.temp.path}")
private String UPLOAD_DAUM_EDITOR_IMAGE_TEMP_PATH;
// 노티 이미지 실경로
@Value("${upload.noti.image.path}")
private String UPLOAD_NOTI_IMAGE_PATH;
// 다음 에디터 파일 임시 폴더
@Value("${upload.daum.editor.file.temp.path}")
private String UPLOAD_DAUM_EDITOR_FILE_TEMP_PATH;
// 노티 파일 실경로
@Value("${upload.noti.file.path}")
private String UPLOAD_NOTI_FILE_PATH;
// 판매자 공지사항 다운로드 url 경로
@Value("${download.url.noti}")
private String DOWNLOAD_URL_NOTI;
@Autowired
private NotiDao notiDao;
@Autowired
private NotiAttachDao notiAttachDao;
@Value("${server.url.img.mycard}")
public void setServerUrlImg(String serverUrlImg) {
SERVER_URL_IMG = serverUrlImg;
}
/** 공지사항 SelectNotiList */
public List<NotiBean> selectNotiList(PagingBean pagingBean) throws Exception {
return notiDao.selectNotiList(pagingBean);
}
/** 공지사항 InsertNoti */
public int insertNoti(
NotiBean notiBean,
String[] attach_type,
String[] attach_file,
String[] attach_file_name
) throws Exception {
// 공지사항 내용 공백제거
notiBean.setNotiCont(notiBean.getNotiCont().trim());
// 공지사항 등록
notiDao.insertNoti(notiBean);
// 공지사항 첨부파일 정보 담을 생성
NotiAttachBean notiAttachBean = new NotiAttachBean();
// 삭제 템프파일 리스트
List<File> deleteFileList = new ArrayList<File>();
// 첨부파일 정보 등록
if(attach_file != null){
for(int i = 0; i < attach_file.length; i++){
// 파일 일때
if(attach_type[i].equals("F")){
// 템프 파일
File notiFileTempFile = new File(REPOSITORY_PATH + attach_file[i].replace(SERVER_URL_IMG, ""));
// 실경로
String notiFilePath = UPLOAD_NOTI_FILE_PATH + "/" + notiBean.getNotiId() + "/" + notiFileTempFile.getName();
// 실경로 파일
File notiFileFile = new File(REPOSITORY_PATH + notiFilePath);
// 템프에서 실경로로 파일 복사
FileUtils.copyFile(notiFileTempFile, notiFileFile);
// 템프에서 실경로로 옮겼을시 공지사항 첨부파일 정보 등록
notiAttachBean.setNotiId(notiBean.getNotiId());
notiAttachBean.setOrd(String.valueOf(i+1));
notiAttachBean.setFileType(attach_type[i]);
notiAttachBean.setFileName(attach_file_name[i]);
notiAttachBean.setFilePath(notiFilePath);
notiAttachBean.setFileSize(Long.toString(notiFileTempFile.length()));
notiAttachDao.insertNotiAttach(notiAttachBean);
notiBean.setNotiCont(notiBean.getNotiCont().replace(attach_file[i], DOWNLOAD_URL_NOTI+notiAttachBean.getNotiAttachId()));
// http://localhost/up_imgs/daum_editor_temp/20160215/561b3b59-4269-49b2-98fe-025134c2a67a.gif
// http://localhost/up_imgs/noti/68/561b3b59-4269-49b2-98fe-025134c2a67a.gif
// 복사한 템프파일 삭제 목록에 추가
deleteFileList.add(notiFileTempFile);
// 이미지 업로드 일때
}else{
// 템프 파일
File notiImgTempFile = new File(REPOSITORY_PATH + attach_file[i].replace(SERVER_URL_IMG, ""));
// 실경로
String notiImgPath = UPLOAD_NOTI_IMAGE_PATH + "/" + notiBean.getNotiId() + "/" + notiImgTempFile.getName();
// 실경로 파일
File notiImgFile = new File(REPOSITORY_PATH + notiImgPath);
// 템프에서 실경로로 파일 복사
FileUtils.copyFile(notiImgTempFile, notiImgFile);
// 템프에서 실경로로 옮겼을시 공지사항 첨부이미지 정보 등록
notiAttachBean.setNotiId(notiBean.getNotiId());
notiAttachBean.setOrd(String.valueOf(i+1));
notiAttachBean.setFileType(attach_type[i]);
notiAttachBean.setFileName(attach_file_name[i]);
notiAttachBean.setFilePath(notiImgPath);
notiAttachBean.setFileSize(Long.toString(notiImgTempFile.length()));
notiAttachDao.insertNotiAttach(notiAttachBean);
notiBean.setNotiCont(notiBean.getNotiCont().replace(attach_file[i], notiImgPath));
// http://localhost/up_imgs/daum_editor_temp/20160215/561b3b59-4269-49b2-98fe-025134c2a67a.gif
// http://localhost/up_imgs/noti/68/561b3b59-4269-49b2-98fe-025134c2a67a.gif
// 복사한 템프파일 삭제 목록에 추가
deleteFileList.add(notiImgTempFile);
}
}// end for
}// end if
if(attach_file != null){
// 실경로로 내용 업데이트
notiDao.updateNoti(notiBean);
// 템프 파일 삭제
for ( File deleteFile : deleteFileList ){
try {
deleteFile.delete();
} catch ( Exception e ){
e.getMessage();
}
}
}// end if
return Integer.parseInt( notiBean.getNotiId() );
}
/** 공지사항 SelectNoti */
public NotiBean selectNoti(NotiBean notiBean) throws Exception {
notiBean = notiDao.selectNoti(notiBean);
// 조회수 올리기
notiDao.updateHit(notiBean);
return notiBean;
}
/** 공지사항 UpdateNoti */
public int updateNoti(
NotiBean notiBean,
String[] attach_type,
String[] attach_file,
String[] attach_file_name
) throws Exception {
// 수정 첨부파일 정보 리스트
List<NotiAttachBean> beforeNotiAttachList = new ArrayList<NotiAttachBean>();
// 추가 첨부파일 정보 리스트
List<NotiAttachBean> addNotiAttachList = new ArrayList<NotiAttachBean>();
// 지워야 첨부파일 정보 리스트
List<NotiAttachBean> deleteNotiAttachList = new ArrayList<NotiAttachBean>();
// 첨부된 파일 있을 경우 빈생성
NotiAttachBean notiAttachBean = new NotiAttachBean();
// 추가인지 지워야할 것인지 비교값
Boolean compare = true;
// 추가된게 있을시 ord 마지막값 이어가기 위한
int lastOrd = 0;
// 공지사항 내용 공백제거
notiBean.setNotiCont(notiBean.getNotiCont().trim());
// 전에 있던 첨부파일 목록 조회
beforeNotiAttachList = notiAttachDao.selectNotiAttach(notiBean.getNotiId(), SERVER_URL_IMG);
// 전에 첨부파일 있을 경우만 ord 제일 높은수 넣어줌
if(!beforeNotiAttachList.isEmpty()){
lastOrd = Integer.parseInt(beforeNotiAttachList.get(beforeNotiAttachList.size()-1).getOrd());
}
// 삭제 템프파일 리스트
List<File> deleteFileList = new ArrayList<File>();
// 바뀐 이미지나 파일 있을
if(attach_file != null && !beforeNotiAttachList.isEmpty()){
// 추가 첨부파일 찾기
for (int i = 0; i < attach_type.length; i++) {
for (int j = 0; j < beforeNotiAttachList.size(); j++) {
// 끝자리 첨부파일 고유번호로 비교 같지 않은 것만 추가리스트에 추가 (새로 추가된건 url이 아예 달라서 바로 무시하고 추가됨)
if(attach_type[i].equals("F")){
if(attach_file[i].substring(attach_file[i].lastIndexOf("=")+1).equals(beforeNotiAttachList.get(j).getNotiAttachId())){
// 같은값이 있으면 compare값 false 줘서 추가안하기
compare = false;
}
// 이미지 업로드는 파일이름으로 비교
}else{
if(attach_file[i].substring(attach_file[i].lastIndexOf("/")+1).equals(
beforeNotiAttachList.get(j).getFilePath().substring(beforeNotiAttachList.get(j).getFilePath().lastIndexOf("/")+1))){
// 같은값이 있으면 compare값 false 줘서 추가안하기
compare = false;
}
}// end if
}// end for
// 추가된 첨부파일 addAttachList에 담기
if(compare){
// 추가 첨부파일 정보
NotiAttachBean addNotiAttachBean = new NotiAttachBean();
addNotiAttachBean.setFileName(attach_file_name[i]);
addNotiAttachBean.setFilePath(attach_file[i]);
addNotiAttachBean.setFileType(attach_type[i]);
addNotiAttachList.add(addNotiAttachBean);
}
// 값이 있어서 false로 바뀌었을시 다시 true로 초기화
compare = true;
}// end for
// 삭제 첨부파일 찾기
for (int i = 0; i < beforeNotiAttachList.size(); i++) {
for (int j = 0; j < attach_type.length; j++) {
// 끝자리 첨부파일 고유번호로 비교 같지 않은 것만 삭제 리스트에 추가
if(beforeNotiAttachList.get(i).getFileType().equals("F")){
if(attach_file[j].substring(attach_file[j].lastIndexOf("=")+1).equals(beforeNotiAttachList.get(i).getNotiAttachId())){
// 같은값이 있으면 compare값 false 줘서 추가안하기
compare = false;
}
// 이미지 업로드는 파일이름으로 비교
}else{
if(attach_file[j].substring(attach_file[j].lastIndexOf("/")+1).equals(
beforeNotiAttachList.get(i).getFilePath().replace(UPLOAD_NOTI_IMAGE_PATH+"/"+notiBean.getNotiId()+"/", ""))){
// 같은값이 있으면 compare값 false 줘서 추가안하기
compare = false;
}
}// end if
}// end for
// 삭제된 첨부파일 deleteAttachList에 담기
if(compare){
// 추가 첨부파일 정보
NotiAttachBean addNotiAttachBean = new NotiAttachBean();
addNotiAttachBean.setNotiAttachId(beforeNotiAttachList.get(i).getNotiAttachId());
addNotiAttachBean.setFileName(beforeNotiAttachList.get(i).getFileName());
addNotiAttachBean.setFilePath(beforeNotiAttachList.get(i).getFilePath());
addNotiAttachBean.setFileType(beforeNotiAttachList.get(i).getFileType());
deleteNotiAttachList.add(addNotiAttachBean);
}
// 값이 있어서 false로 바뀌었을시 다시 true로 초기화
compare = true;
}// end for
// 첨부파일 모두 삭제했을 경우
} else if(attach_file == null && !beforeNotiAttachList.isEmpty()){
deleteNotiAttachList = beforeNotiAttachList;
// 있던 것은 없었는데 추가했을 경우
} else if(attach_file != null && beforeNotiAttachList.isEmpty()){
for (int i = 0; i < attach_file.length; i++) {
// 추가 첨부파일 정보
NotiAttachBean addNotiAttachBean = new NotiAttachBean();
addNotiAttachBean.setFileName(attach_file_name[i]);
addNotiAttachBean.setFilePath(attach_file[i]);
addNotiAttachBean.setFileType(attach_type[i]);
addNotiAttachList.add(addNotiAttachBean);
}
}// end if(첨부파일 비교)
// 추가 이미지, 파일 추가하기
if(!addNotiAttachList.isEmpty()){
for(int i = 0; i < addNotiAttachList.size(); i++){
// 첨부된 파일
if(addNotiAttachList.get(i).getFileType().equals("F")){
// 템프 파일
File notiFileTempFile = new File(REPOSITORY_PATH + addNotiAttachList.get(i).getFilePath().replace(SERVER_URL_IMG, ""));
// 실경로
String notiFilePath = UPLOAD_NOTI_FILE_PATH + "/" + notiBean.getNotiId() + "/" + notiFileTempFile.getName();
// 실경로 파일
File notiFileFile = new File(REPOSITORY_PATH + notiFilePath);
// 템프에서 실경로로 파일 복사
FileUtils.copyFile(notiFileTempFile, notiFileFile);
// 템프에서 실경로로 옮겼을시 공지사항 첨부파일 정보 등록
notiAttachBean.setNotiId(notiBean.getNotiId());
notiAttachBean.setOrd(String.valueOf(i+1+lastOrd));
notiAttachBean.setFileType(addNotiAttachList.get(i).getFileType());
notiAttachBean.setFileName(addNotiAttachList.get(i).getFileName());
notiAttachBean.setFilePath(notiFilePath);
notiAttachBean.setFileSize(Long.toString(notiFileTempFile.length()));
notiAttachDao.insertNotiAttach(notiAttachBean);
notiBean.setNotiCont(notiBean.getNotiCont().replace(addNotiAttachList.get(i).getFilePath(), DOWNLOAD_URL_NOTI+notiAttachBean.getNotiAttachId()));
// http://localhost/up_imgs/daum_editor_temp/20160215/561b3b59-4269-49b2-98fe-025134c2a67a.gif
// http://localhost/up_imgs/noti/68/561b3b59-4269-49b2-98fe-025134c2a67a.gif
// 복사한 템프파일 삭제 목록에 추가
deleteFileList.add(notiFileTempFile);
} else {// 첨부된 이미지 업로드
// 템프 파일
File notiImgTempFile = new File(REPOSITORY_PATH + addNotiAttachList.get(i).getFilePath().replace(SERVER_URL_IMG, ""));
// 실경로
String notiImgPath = UPLOAD_NOTI_IMAGE_PATH + "/" + notiBean.getNotiId() + "/" + notiImgTempFile.getName();
// 실경로 파일
File notiImgFile = new File(REPOSITORY_PATH + notiImgPath);
// 템프에서 실경로로 파일 복사
FileUtils.copyFile(notiImgTempFile, notiImgFile);
// 템프에서 실경로로 옮겼을시 공지사항 첨부이미지 정보 등록
notiAttachBean.setNotiId(notiBean.getNotiId());
notiAttachBean.setOrd(String.valueOf(i+1+lastOrd));
notiAttachBean.setFileType(addNotiAttachList.get(i).getFileType());
notiAttachBean.setFileName(addNotiAttachList.get(i).getFileName());
notiAttachBean.setFilePath(notiImgPath);
notiAttachBean.setFileSize(Long.toString(notiImgTempFile.length()));
notiAttachDao.insertNotiAttach(notiAttachBean);
notiBean.setNotiCont(notiBean.getNotiCont().replace(addNotiAttachList.get(i).getFilePath(), notiImgPath));
// http://localhost/up_imgs/daum_editor_temp/20160215/561b3b59-4269-49b2-98fe-025134c2a67a.gif
// http://localhost/up_imgs/noti/68/561b3b59-4269-49b2-98fe-025134c2a67a.gif
// 복사한 템프파일 삭제 목록에 추가
deleteFileList.add(notiImgTempFile);
}// end if(이미지인지 파일인지 구분)
}// end for
}// end if
// 삭제할 파일이 있다면 삭제 목록에 추가하고 DB에서 삭제하기
if(!deleteNotiAttachList.isEmpty()){
for (int i = 0; i < deleteNotiAttachList.size(); i++) {
// 실경로 파일
File notiFileFile = new File(REPOSITORY_PATH + deleteNotiAttachList.get(i).getFilePath());
// 삭제 목록에 추가
deleteFileList.add(notiFileFile);
notiAttachDao.deleteNotiAttach(deleteNotiAttachList.get(i).getNotiAttachId());
}
}
// 템프, 수정된 파일 삭제
if(!deleteFileList.isEmpty()){
for ( File deleteFile : deleteFileList ){
try {
deleteFile.delete();
} catch ( Exception e ){
e.getMessage();
}
}
}
return notiDao.updateNoti(notiBean);
}
/** 공지사항 DeleteNoti */
public int deleteNoti(NotiBean notiBean) throws Exception {
// 삭제 첨부파일 정보 리스트
List<NotiAttachBean> deleteNotiAttachList = new ArrayList<NotiAttachBean>();
// 삭제 첨부파일 정보 조회
deleteNotiAttachList = notiAttachDao.selectNotiAttach(notiBean.getNotiId(), SERVER_URL_IMG);
// 삭제할 파일이 있다면 삭제하고 DB에서 삭제하기
if(!deleteNotiAttachList.isEmpty()){
for (int i = 0; i < deleteNotiAttachList.size(); i++) {
// 파일
File notiFileFile = new File(REPOSITORY_PATH + deleteNotiAttachList.get(i).getFilePath());
// 파일 삭제
notiFileFile.delete();
notiAttachDao.deleteNotiAttach(deleteNotiAttachList.get(i).getNotiAttachId());
}
}
return notiDao.deleteNoti(notiBean);
}
/** 공지사항 총 수 */
public int notiTotCnt(PagingBean pagingBean) throws Exception {
return notiDao.notiTotCnt(pagingBean);
}
/** 공지사항 IndexList */
public List<NotiBean> selectNotiIndexList(PagingBean pagingBean) throws Exception {
return notiDao.selectNotiIndexList(pagingBean);
}
/** 공지사항 첨부파일 정보 조회 */
public List<NotiAttachBean> selectNotiAttach(String notiId) throws Exception {
return notiAttachDao.selectNotiAttach(notiId, SERVER_URL_IMG);
}
/** 공지사항 첨부파일 다운로드 정보 조회 */
public NotiAttachBean selectNotiAttachInfo(String notiAttachId) {
return notiAttachDao.selectNotiAttachInfo(notiAttachId);
}
}

View File

@ -0,0 +1,44 @@
package com.loglog.api.commons.modules.service.shop;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import com.loglog.api.commons.beans.PagingBean;
import com.loglog.api.commons.beans.ShopDetailBean;
import com.loglog.api.commons.beans.ShopMasterBean;
import com.loglog.api.commons.beans.UserBean;
import com.loglog.api.commons.beans.CardMasterBean;
import com.loglog.api.commons.beans.CouponPublicBean;
import com.loglog.api.commons.beans.CouponUserListBean;
public interface ShopMasterService {
/**상점 상세정보*/
public ShopDetailBean selectShopDetail(ShopDetailBean shopDetailBean) throws Exception;
/**유저 주위의 상점 리스트 출력*/
public List<ShopMasterBean> selectProxShopList(ShopMasterBean shopMasterBean)throws Exception;
/**room 생성하기 전 중복체크*/
public int selectCheckRoom(ShopMasterBean shopMasterBean)throws Exception;
/**상점 즐겨찾기*/
public int insertLikeShop(ShopMasterBean shopMasterBean)throws Exception;
/**상점 즐겨찾기 - tempo_liked 추가*/
public int insertLikeTempo(ShopMasterBean shopMasterBean)throws Exception;
/**상점 즐겨찾기 취소*/
public int calcelLikeShop(ShopMasterBean shopMasterBean)throws Exception;
/**상점 즐겨찾기 취소 - tempo_liked*/
public int deleteLikeTempo(ShopMasterBean shopMasterBean)throws Exception;
/**즐겨찾기한 상점 리스트 출력*/
public List<ShopDetailBean> selectShopList(ShopDetailBean shopDetailBean)throws Exception;
/**상점이름으로 검색 출력 리스트*/
public List<ShopDetailBean> selectSearchShopList(ShopDetailBean shopDetailBean)throws Exception;
}

View File

@ -0,0 +1,73 @@
package com.loglog.api.commons.modules.service.shop;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import com.loglog.api.commons.beans.ShopDetailBean;
import com.loglog.api.commons.beans.ShopMasterBean;
import com.loglog.api.commons.daos.CardMasterDao;
import com.loglog.api.commons.daos.ShopMasterDao;
@Service
public class ShopMasterServiceImpl implements ShopMasterService {
@Value("${server.url.img.shop}")
private String URL_IMG_SHOP;
@Autowired
private ShopMasterDao shopMasterDao;
@Override
public ShopDetailBean selectShopDetail(ShopDetailBean shopDetailBean) throws Exception {
// TODO Auto-generated method stub
shopDetailBean.setBaseImgUrl(URL_IMG_SHOP);
return shopMasterDao.selectShopDetail(shopDetailBean) ;
}
/**유저 주위의 상점 리스트 출력*/
public List<ShopMasterBean> selectProxShopList(ShopMasterBean shopMasterBean)throws Exception{
shopMasterBean.setBaseImgUrl(URL_IMG_SHOP);
return shopMasterDao.selectProxShopList(shopMasterBean) ;
}
/**room 생성하기 전 중복체크*/
public int selectCheckRoom(ShopMasterBean shopMasterBean)throws Exception{
return shopMasterDao.selectCheckRoom(shopMasterBean);
}
/**상점 즐겨찾기*/
public int insertLikeShop(ShopMasterBean shopMasterBean)throws Exception{
return shopMasterDao.insertLikeShop(shopMasterBean);
}
/**상점 즐겨찾기 - tempo_liked 추가*/
public int insertLikeTempo(ShopMasterBean shopMasterBean)throws Exception{
return shopMasterDao.insertLikeTempo(shopMasterBean);
}
/**상점 즐겨찾기 취소*/
public int calcelLikeShop(ShopMasterBean shopMasterBean)throws Exception{
return shopMasterDao.calcelLikeShop(shopMasterBean);
}
/**상점 즐겨찾기 취소 - tempo_liked*/
public int deleteLikeTempo(ShopMasterBean shopMasterBean)throws Exception{
return shopMasterDao.deleteLikeTempo(shopMasterBean);
}
/**즐겨찾기한 상점 리스트 출력*/
public List<ShopDetailBean> selectShopList(ShopDetailBean shopDetailBean)throws Exception{
shopDetailBean.setBaseImgUrl(URL_IMG_SHOP);
return shopMasterDao.selectShopList(shopDetailBean) ;
}
/**상점이름으로 검색 출력 리스트*/
public List<ShopDetailBean> selectSearchShopList(ShopDetailBean shopDetailBean)throws Exception{
shopDetailBean.setBaseImgUrl(URL_IMG_SHOP);
return shopMasterDao.selectSearchShopList(shopDetailBean);
}
}

View File

@ -0,0 +1,125 @@
package com.loglog.api.commons.modules.service.user;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import com.loglog.api.commons.beans.PagingBean;
import com.loglog.api.commons.beans.UserBean;
public interface UserService {
/**회원가입*/
public int insertUser(UserBean userBean) throws Exception;
/** UserCd값 가져오기 */
public String selectUserCdStr(UserBean userBean) throws Exception;
/**아이디 중복체크 */
public int chkUserId(UserBean userBean) throws Exception;
/**닉네임 중복체크 */
public int chkNickName(UserBean userBean) throws Exception;
/**userCd 조회 */
public int selectUserCd(UserBean userBean) throws Exception;
/**로그인한 회원 정보 찾기 */
public UserBean selectUser(UserBean userBean) throws Exception;
/**로그인한 회원 정보 찾기 */
public UserBean selectUserDetail(UserBean userBean) throws Exception;
/** 세션쿠키로 로그인한 회원 정보 찾기 */
public UserBean selectUserBySessionId(HttpServletRequest request) throws Exception;
/**세션아이디로 로그인한 회원 정보 찾기 */
public UserBean selectUserBySessionId(String sessionId) throws Exception;
/** 이전 세션쿠키로 로그인한 회원 확인 */
public UserBean selectUserByBeforeSessionId(HttpServletRequest request) throws Exception;
/** ID와 PW가 일치하는 회원 정보 찾기 */
public UserBean selectUserPW(UserBean userBean) throws Exception;
/**아이디 찾기 - JSON */
public String findUserId(UserBean userBean) throws Exception;
/**이메일 체크 - JSON */
public String findUserEmail(UserBean userBean) throws Exception;
/**회원 비밀번호 찾을시 해당 정보 회원있는지 확인*/
public int findUser(UserBean userBean) throws Exception;
/**db에 새 비밀번호 세팅*/
public String updateUserPw(UserBean userBean, HttpServletRequest request) throws Exception;
/**최종 로그인 일자 update*/
public int updLastLoginDt(UserBean userBean) throws Exception;
/**회원 정보 수정*/
public int updateUser(UserBean userBean) throws Exception;
/**사용자가 입력한 비밀번호로 업데이트*/
public void updEnterdPw(HttpServletRequest request, String newEncodePw) throws Exception;
/**회원 계좌 정보 수정*/
public int updateAccount(UserBean userBean) throws Exception;
/**사용자가 입력한 인출 비밀번호로 업데이트*/
public void updEnteredAccountPw(HttpServletRequest request, String newEncodePw) throws Exception;
/**user table에 네이버 아이디 있는지 확인*/
public int searchNaverIdInUserTable(UserBean userBean) throws Exception;
/**사용자 총 수 */
public int userTotCnt(PagingBean pagingBean) throws Exception;
/**사용자 목록 조회*/
public List<UserBean> selectUserList(Map<String, Object> parameter) throws Exception;
/**사용자 목록 조회*/
public List<UserBean> selectUserList(PagingBean pagingBean) throws Exception;
/** 사용자 상태 변경(정지 or 정상) */
public int updateUserStatusCd(UserBean userBean) throws Exception;
/**푸시알림, 자동로그인 설정값 변경*/
public int updateUserSetting(UserBean userBean) throws Exception;
/**사용자 답변 확인*/
public int userAnswerChk(UserBean userBean) throws Exception;
/**회원 탈퇴*/
public int deleteUser(UserBean userBean) throws Exception;
/**회원 비밀번호 찾을시 해당 정보 회원있는지 확인 (이름 -> 이메일로 대체)*/
public int findUserL(UserBean userBean) throws Exception;
/**db에 새 비밀번호 세팅 ( 이름 -> 이메일로 대체)*/
public String updateUserPwL(UserBean userBean, HttpServletRequest request) throws Exception;
/** 사용자 목록 조회 정보 개수*/
public int countUserList(PagingBean pagingBean) throws Exception;
/** 회원 등급 수정 */
public void updateUserLevel(Map<String, Object> parameter) throws Exception;
/** 회원 탈퇴 */
public UserBean userDelete(UserBean userBean) throws Exception;
/** 회원 이름 조회 */
public UserBean userName(UserBean userBean) throws Exception;
/**QR 로그인*/
public UserBean qRLogin(UserBean userBean)throws Exception;
/**비밀번호 수정 - 이메일을 모르고 UserCd를 아는 경우*/
public int selectKnowUserCd(UserBean userBean)throws Exception;
/** 사용자 이메일이 있는지 확인*/
public int selectCheckEmail(UserBean userBean)throws Exception;
/**이메일로 임시비밀번호를 보내면 비밀번호 업데이트*/
public int updatetempPw(UserBean userBean)throws Exception;
}

View File

@ -0,0 +1,249 @@
package com.loglog.api.commons.modules.service.user;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.loglog.api.commons.beans.PagingBean;
import com.loglog.api.commons.beans.UserBean;
import com.loglog.api.commons.daos.UserDao;
import com.loglog.api.commons.utils.CommonUtils;
import com.loglog.api.commons.utils.SessionUtil;
@Service
public class UserServiceImpl implements UserService {
@Autowired
private UserDao userDao;
/** 회원가입 */
public int insertUser(UserBean userBean) throws Exception {
return userDao.insertUser(userBean);
}
/**아이디 찾기 - JSON */
public String selectUserCdStr(UserBean userBean) throws Exception {
return userDao.selectUserCdStr(userBean);
}
/**아이디 중복 체크*/
public int chkUserId(UserBean userBean) throws Exception {
return userDao.chkUserId(userBean);
}
/**닉네임 중복체크*/
public int selectUserCd(UserBean userBean) throws Exception {
return userDao.selectUserCd(userBean);
}
/**닉네임 중복체크*/
public int chkNickName(UserBean userBean) throws Exception {
return userDao.chkNickName(userBean);
}
/**로그인한 회원 정보 찾기 */
public UserBean selectUser(UserBean userBean) throws Exception {
return userDao.selectUser(userBean);
}
/**로그인한 회원 정보 찾기 */
public UserBean selectUserDetail(UserBean userBean) throws Exception {
return userDao.selectUserDetail(userBean);
}
/**로그인한 회원 정보 찾기 */
public UserBean selectUserBySessionId(HttpServletRequest request) throws Exception {
String sessionId = request.getHeader("Authorization");
System.out.println("check Authorization :: " + sessionId);
return userDao.selectUserBySessionId(sessionId);
}
/** 세션쿠키로 로그인한 회원 정보 찾기 */
public UserBean selectUserBySessionId(String sessionId) throws Exception {
return userDao.selectUserBySessionId(sessionId);
}
/**로그인한 회원 정보 찾기 */
public UserBean selectUserByBeforeSessionId(HttpServletRequest request) throws Exception {
String sessionId = request.getHeader("Authorization");
System.out.println("check Authorization :: " + sessionId);
return userDao.selectUserByBeforeSessionId(sessionId);
}
/** ID와 PW가 일치하는 회원 정보 찾기 */
public UserBean selectUserPW(UserBean userBean) throws Exception {
return userDao.selectUserPW(userBean);
}
/**아이디 찾기 - JSON */
public String findUserId(UserBean userBean) throws Exception {
return userDao.findUserId(userBean);
}
/**회원 비밀번호 찾을시 해당 정보 회원있는지 확인*/
public int findUser(UserBean userBean) throws Exception {
return userDao.findUser(userBean);
}
/**db에 새 비밀번호 세팅*/
public String updateUserPw(UserBean userBean, HttpServletRequest request) throws Exception {
//있다면 db에 넣을 새로운 비밀번호 10자 만들기
String newPw = CommonUtils.random(10);
//만든 비밀번호를 암호화
String encodingPw = CommonUtils.encode(newPw);
//db에 비밀번호 세팅
userBean.setUserPw(encodingPw);
userDao.updateUserPw(userBean);
return newPw;
}
/**최종 로그인 일자 update*/
public int updLastLoginDt(UserBean userBean) throws Exception {
return userDao.updLastLoginDt(userBean);
}
/**회원 정보 수정*/
public int updateUser(UserBean userBean) throws Exception {
return userDao.updateUser(userBean);
}
/**사용자가 입력한 비밀번호로 업데이트*/
public void updEnterdPw(HttpServletRequest request, String newEncodePw) throws Exception {
UserBean userBean = new UserBean();
userBean = SessionUtil.getUserBean(request);
userBean.setUserPw(newEncodePw);
userDao.updateUserPw(userBean);
}
/**회원 계좌 정보 수정*/
public int updateAccount(UserBean userBean) throws Exception {
return userDao.updateAccount(userBean);
}
/**user table에 네이버 아이디 있는지 확인*/
public int searchNaverIdInUserTable(UserBean userBean) throws Exception {
return userDao.searchNaverIdInUserTable(userBean);
}
/**사용자 총 수*/
public int userTotCnt(PagingBean pagingBean) throws Exception {
return userDao.userTotCnt(pagingBean);
}
/**사용자 목록 조회*/
public List<UserBean> selectUserList(Map<String, Object> parameter) throws Exception {
return userDao.selectUserList(parameter);
}
/**사용자 목록 조회*/
public List<UserBean> selectUserList(PagingBean pagingBean) throws Exception {
return userDao.selectUserListByPagingBean(pagingBean);
}
/**사용자 상태 변경*/
public int updateUserStatusCd(UserBean userBean) throws Exception {
return userDao.updateUserStatusCd(userBean);
}
/**푸시알림, 자동로그인 설정값 변경*/
public int updateUserSetting(UserBean userBean) throws Exception {
return userDao.updateUserSetting(userBean);
}
/**사용자 답변 확인*/
public int userAnswerChk(UserBean userBean) throws Exception {
return userDao.userAnswerChk(userBean);
}
/** 회원탈퇴 */
public int deleteUser(UserBean userBean) throws Exception {
return userDao.deleteUser(userBean);
}
/**회원 비밀번호 찾을시 해당 정보 회원있는지 확인 -> (이름 -> 이메일로 대체)*/
public int findUserL(UserBean userBean) throws Exception {
return userDao.findUserL(userBean);
}
/**db에 새 비밀번호 세팅 ( 이름 -> 이메일로 대체)*/
public String updateUserPwL(UserBean userBean, HttpServletRequest request) throws Exception {
//있다면 db에 넣을 새로운 비밀번호 10자 만들기
String newPw = CommonUtils.random(10);
//만든 비밀번호를 암호화
String encodingPw = CommonUtils.encode(newPw);
//db에 비밀번호 세팅
userBean.setUserPw(encodingPw);
userDao.updateUserPwL(userBean);
return newPw;
}
/**이메일 체크 - JSON */
public String findUserEmail(UserBean userBean) throws Exception {
return userDao.findUserEmail(userBean);
}
/** 사용자 목록 조회 정보 개수*/
public int countUserList(PagingBean pagingBean) throws Exception {
return userDao.countUserList(pagingBean);
}
/** 회원 등급 수정 */
public void updateUserLevel(Map<String, Object> parameter) throws Exception {
userDao.updateUserLevel(parameter);
}
@Override
public void updEnteredAccountPw(HttpServletRequest request, String newEncodePw) throws Exception {
// TODO Auto-generated method stub
}
@Override
public UserBean userDelete(UserBean userBean) throws Exception {
return userDao.userDelete(userBean);
}
@Override
public UserBean userName(UserBean userBean) throws Exception {
return userDao.userName(userBean);
}
/**QR 로그인*/
public UserBean qRLogin(UserBean userBean)throws Exception{
return userDao.qRLogin(userBean);
}
/**비밀번호 수정 - 이메일을 모르고 UserCd를 아는 경우*/
public int selectKnowUserCd(UserBean userBean)throws Exception{
return userDao.selectKnowUserCd(userBean);
}
/** 사용자 이메일이 있는지 확인*/
public int selectCheckEmail(UserBean userBean)throws Exception{
return userDao.selectCheckEmail(userBean);
}
/**이메일로 임시비밀번호를 보내면 비밀번호 업데이트*/
public int updatetempPw(UserBean userBean)throws Exception{
return userDao.updatetempPw(userBean);
}
}

View File

@ -0,0 +1,752 @@
package com.loglog.api.commons.utils;
// Copyright (c) 2006 Damien Miller <djm@mindrot.org>
//
// Permission to use, copy, modify, and distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
import java.io.UnsupportedEncodingException;
import java.security.SecureRandom;
/**
* BCrypt implements OpenBSD-style Blowfish password hashing using
* the scheme described in "A Future-Adaptable Password Scheme" by
* Niels Provos and David Mazieres.
* <p>
* This password hashing system tries to thwart off-line password
* cracking using a computationally-intensive hashing algorithm,
* based on Bruce Schneier's Blowfish cipher. The work factor of
* the algorithm is parameterised, so it can be increased as
* computers get faster.
* <p>
* Usage is really simple. To hash a password for the first time,
* call the hashpw method with a random salt, like this:
* <p>
* <code>
* String pw_hash = BCrypt.hashpw(plain_password, BCrypt.gensalt()); <br />
* </code>
* <p>
* To check whether a plaintext password matches one that has been
* hashed previously, use the checkpw method:
* <p>
* <code>
* if (BCrypt.checkpw(candidate_password, stored_hash))<br />
* &nbsp;&nbsp;&nbsp;&nbsp;System.out.println("It matches");<br />
* else<br />
* &nbsp;&nbsp;&nbsp;&nbsp;System.out.println("It does not match");<br />
* </code>
* <p>
* The gensalt() method takes an optional parameter (log_rounds)
* that determines the computational complexity of the hashing:
* <p>
* <code>
* String strong_salt = BCrypt.gensalt(10)<br />
* String stronger_salt = BCrypt.gensalt(12)<br />
* </code>
* <p>
* The amount of work increases exponentially (2**log_rounds), so
* each increment is twice as much work. The default log_rounds is
* 10, and the valid range is 4 to 31.
*
* @author Damien Miller
* @version 0.2
*/
public class BCrypt {
// BCrypt parameters
private static final int GENSALT_DEFAULT_LOG2_ROUNDS = 10;
private static final int BCRYPT_SALT_LEN = 16;
// Blowfish parameters
private static final int BLOWFISH_NUM_ROUNDS = 16;
// Initial contents of key schedule
private static final int P_orig[] = {
0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344,
0xa4093822, 0x299f31d0, 0x082efa98, 0xec4e6c89,
0x452821e6, 0x38d01377, 0xbe5466cf, 0x34e90c6c,
0xc0ac29b7, 0xc97c50dd, 0x3f84d5b5, 0xb5470917,
0x9216d5d9, 0x8979fb1b
};
private static final int S_orig[] = {
0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7,
0xb8e1afed, 0x6a267e96, 0xba7c9045, 0xf12c7f99,
0x24a19947, 0xb3916cf7, 0x0801f2e2, 0x858efc16,
0x636920d8, 0x71574e69, 0xa458fea3, 0xf4933d7e,
0x0d95748f, 0x728eb658, 0x718bcd58, 0x82154aee,
0x7b54a41d, 0xc25a59b5, 0x9c30d539, 0x2af26013,
0xc5d1b023, 0x286085f0, 0xca417918, 0xb8db38ef,
0x8e79dcb0, 0x603a180e, 0x6c9e0e8b, 0xb01e8a3e,
0xd71577c1, 0xbd314b27, 0x78af2fda, 0x55605c60,
0xe65525f3, 0xaa55ab94, 0x57489862, 0x63e81440,
0x55ca396a, 0x2aab10b6, 0xb4cc5c34, 0x1141e8ce,
0xa15486af, 0x7c72e993, 0xb3ee1411, 0x636fbc2a,
0x2ba9c55d, 0x741831f6, 0xce5c3e16, 0x9b87931e,
0xafd6ba33, 0x6c24cf5c, 0x7a325381, 0x28958677,
0x3b8f4898, 0x6b4bb9af, 0xc4bfe81b, 0x66282193,
0x61d809cc, 0xfb21a991, 0x487cac60, 0x5dec8032,
0xef845d5d, 0xe98575b1, 0xdc262302, 0xeb651b88,
0x23893e81, 0xd396acc5, 0x0f6d6ff3, 0x83f44239,
0x2e0b4482, 0xa4842004, 0x69c8f04a, 0x9e1f9b5e,
0x21c66842, 0xf6e96c9a, 0x670c9c61, 0xabd388f0,
0x6a51a0d2, 0xd8542f68, 0x960fa728, 0xab5133a3,
0x6eef0b6c, 0x137a3be4, 0xba3bf050, 0x7efb2a98,
0xa1f1651d, 0x39af0176, 0x66ca593e, 0x82430e88,
0x8cee8619, 0x456f9fb4, 0x7d84a5c3, 0x3b8b5ebe,
0xe06f75d8, 0x85c12073, 0x401a449f, 0x56c16aa6,
0x4ed3aa62, 0x363f7706, 0x1bfedf72, 0x429b023d,
0x37d0d724, 0xd00a1248, 0xdb0fead3, 0x49f1c09b,
0x075372c9, 0x80991b7b, 0x25d479d8, 0xf6e8def7,
0xe3fe501a, 0xb6794c3b, 0x976ce0bd, 0x04c006ba,
0xc1a94fb6, 0x409f60c4, 0x5e5c9ec2, 0x196a2463,
0x68fb6faf, 0x3e6c53b5, 0x1339b2eb, 0x3b52ec6f,
0x6dfc511f, 0x9b30952c, 0xcc814544, 0xaf5ebd09,
0xbee3d004, 0xde334afd, 0x660f2807, 0x192e4bb3,
0xc0cba857, 0x45c8740f, 0xd20b5f39, 0xb9d3fbdb,
0x5579c0bd, 0x1a60320a, 0xd6a100c6, 0x402c7279,
0x679f25fe, 0xfb1fa3cc, 0x8ea5e9f8, 0xdb3222f8,
0x3c7516df, 0xfd616b15, 0x2f501ec8, 0xad0552ab,
0x323db5fa, 0xfd238760, 0x53317b48, 0x3e00df82,
0x9e5c57bb, 0xca6f8ca0, 0x1a87562e, 0xdf1769db,
0xd542a8f6, 0x287effc3, 0xac6732c6, 0x8c4f5573,
0x695b27b0, 0xbbca58c8, 0xe1ffa35d, 0xb8f011a0,
0x10fa3d98, 0xfd2183b8, 0x4afcb56c, 0x2dd1d35b,
0x9a53e479, 0xb6f84565, 0xd28e49bc, 0x4bfb9790,
0xe1ddf2da, 0xa4cb7e33, 0x62fb1341, 0xcee4c6e8,
0xef20cada, 0x36774c01, 0xd07e9efe, 0x2bf11fb4,
0x95dbda4d, 0xae909198, 0xeaad8e71, 0x6b93d5a0,
0xd08ed1d0, 0xafc725e0, 0x8e3c5b2f, 0x8e7594b7,
0x8ff6e2fb, 0xf2122b64, 0x8888b812, 0x900df01c,
0x4fad5ea0, 0x688fc31c, 0xd1cff191, 0xb3a8c1ad,
0x2f2f2218, 0xbe0e1777, 0xea752dfe, 0x8b021fa1,
0xe5a0cc0f, 0xb56f74e8, 0x18acf3d6, 0xce89e299,
0xb4a84fe0, 0xfd13e0b7, 0x7cc43b81, 0xd2ada8d9,
0x165fa266, 0x80957705, 0x93cc7314, 0x211a1477,
0xe6ad2065, 0x77b5fa86, 0xc75442f5, 0xfb9d35cf,
0xebcdaf0c, 0x7b3e89a0, 0xd6411bd3, 0xae1e7e49,
0x00250e2d, 0x2071b35e, 0x226800bb, 0x57b8e0af,
0x2464369b, 0xf009b91e, 0x5563911d, 0x59dfa6aa,
0x78c14389, 0xd95a537f, 0x207d5ba2, 0x02e5b9c5,
0x83260376, 0x6295cfa9, 0x11c81968, 0x4e734a41,
0xb3472dca, 0x7b14a94a, 0x1b510052, 0x9a532915,
0xd60f573f, 0xbc9bc6e4, 0x2b60a476, 0x81e67400,
0x08ba6fb5, 0x571be91f, 0xf296ec6b, 0x2a0dd915,
0xb6636521, 0xe7b9f9b6, 0xff34052e, 0xc5855664,
0x53b02d5d, 0xa99f8fa1, 0x08ba4799, 0x6e85076a,
0x4b7a70e9, 0xb5b32944, 0xdb75092e, 0xc4192623,
0xad6ea6b0, 0x49a7df7d, 0x9cee60b8, 0x8fedb266,
0xecaa8c71, 0x699a17ff, 0x5664526c, 0xc2b19ee1,
0x193602a5, 0x75094c29, 0xa0591340, 0xe4183a3e,
0x3f54989a, 0x5b429d65, 0x6b8fe4d6, 0x99f73fd6,
0xa1d29c07, 0xefe830f5, 0x4d2d38e6, 0xf0255dc1,
0x4cdd2086, 0x8470eb26, 0x6382e9c6, 0x021ecc5e,
0x09686b3f, 0x3ebaefc9, 0x3c971814, 0x6b6a70a1,
0x687f3584, 0x52a0e286, 0xb79c5305, 0xaa500737,
0x3e07841c, 0x7fdeae5c, 0x8e7d44ec, 0x5716f2b8,
0xb03ada37, 0xf0500c0d, 0xf01c1f04, 0x0200b3ff,
0xae0cf51a, 0x3cb574b2, 0x25837a58, 0xdc0921bd,
0xd19113f9, 0x7ca92ff6, 0x94324773, 0x22f54701,
0x3ae5e581, 0x37c2dadc, 0xc8b57634, 0x9af3dda7,
0xa9446146, 0x0fd0030e, 0xecc8c73e, 0xa4751e41,
0xe238cd99, 0x3bea0e2f, 0x3280bba1, 0x183eb331,
0x4e548b38, 0x4f6db908, 0x6f420d03, 0xf60a04bf,
0x2cb81290, 0x24977c79, 0x5679b072, 0xbcaf89af,
0xde9a771f, 0xd9930810, 0xb38bae12, 0xdccf3f2e,
0x5512721f, 0x2e6b7124, 0x501adde6, 0x9f84cd87,
0x7a584718, 0x7408da17, 0xbc9f9abc, 0xe94b7d8c,
0xec7aec3a, 0xdb851dfa, 0x63094366, 0xc464c3d2,
0xef1c1847, 0x3215d908, 0xdd433b37, 0x24c2ba16,
0x12a14d43, 0x2a65c451, 0x50940002, 0x133ae4dd,
0x71dff89e, 0x10314e55, 0x81ac77d6, 0x5f11199b,
0x043556f1, 0xd7a3c76b, 0x3c11183b, 0x5924a509,
0xf28fe6ed, 0x97f1fbfa, 0x9ebabf2c, 0x1e153c6e,
0x86e34570, 0xeae96fb1, 0x860e5e0a, 0x5a3e2ab3,
0x771fe71c, 0x4e3d06fa, 0x2965dcb9, 0x99e71d0f,
0x803e89d6, 0x5266c825, 0x2e4cc978, 0x9c10b36a,
0xc6150eba, 0x94e2ea78, 0xa5fc3c53, 0x1e0a2df4,
0xf2f74ea7, 0x361d2b3d, 0x1939260f, 0x19c27960,
0x5223a708, 0xf71312b6, 0xebadfe6e, 0xeac31f66,
0xe3bc4595, 0xa67bc883, 0xb17f37d1, 0x018cff28,
0xc332ddef, 0xbe6c5aa5, 0x65582185, 0x68ab9802,
0xeecea50f, 0xdb2f953b, 0x2aef7dad, 0x5b6e2f84,
0x1521b628, 0x29076170, 0xecdd4775, 0x619f1510,
0x13cca830, 0xeb61bd96, 0x0334fe1e, 0xaa0363cf,
0xb5735c90, 0x4c70a239, 0xd59e9e0b, 0xcbaade14,
0xeecc86bc, 0x60622ca7, 0x9cab5cab, 0xb2f3846e,
0x648b1eaf, 0x19bdf0ca, 0xa02369b9, 0x655abb50,
0x40685a32, 0x3c2ab4b3, 0x319ee9d5, 0xc021b8f7,
0x9b540b19, 0x875fa099, 0x95f7997e, 0x623d7da8,
0xf837889a, 0x97e32d77, 0x11ed935f, 0x16681281,
0x0e358829, 0xc7e61fd6, 0x96dedfa1, 0x7858ba99,
0x57f584a5, 0x1b227263, 0x9b83c3ff, 0x1ac24696,
0xcdb30aeb, 0x532e3054, 0x8fd948e4, 0x6dbc3128,
0x58ebf2ef, 0x34c6ffea, 0xfe28ed61, 0xee7c3c73,
0x5d4a14d9, 0xe864b7e3, 0x42105d14, 0x203e13e0,
0x45eee2b6, 0xa3aaabea, 0xdb6c4f15, 0xfacb4fd0,
0xc742f442, 0xef6abbb5, 0x654f3b1d, 0x41cd2105,
0xd81e799e, 0x86854dc7, 0xe44b476a, 0x3d816250,
0xcf62a1f2, 0x5b8d2646, 0xfc8883a0, 0xc1c7b6a3,
0x7f1524c3, 0x69cb7492, 0x47848a0b, 0x5692b285,
0x095bbf00, 0xad19489d, 0x1462b174, 0x23820e00,
0x58428d2a, 0x0c55f5ea, 0x1dadf43e, 0x233f7061,
0x3372f092, 0x8d937e41, 0xd65fecf1, 0x6c223bdb,
0x7cde3759, 0xcbee7460, 0x4085f2a7, 0xce77326e,
0xa6078084, 0x19f8509e, 0xe8efd855, 0x61d99735,
0xa969a7aa, 0xc50c06c2, 0x5a04abfc, 0x800bcadc,
0x9e447a2e, 0xc3453484, 0xfdd56705, 0x0e1e9ec9,
0xdb73dbd3, 0x105588cd, 0x675fda79, 0xe3674340,
0xc5c43465, 0x713e38d8, 0x3d28f89e, 0xf16dff20,
0x153e21e7, 0x8fb03d4a, 0xe6e39f2b, 0xdb83adf7,
0xe93d5a68, 0x948140f7, 0xf64c261c, 0x94692934,
0x411520f7, 0x7602d4f7, 0xbcf46b2e, 0xd4a20068,
0xd4082471, 0x3320f46a, 0x43b7d4b7, 0x500061af,
0x1e39f62e, 0x97244546, 0x14214f74, 0xbf8b8840,
0x4d95fc1d, 0x96b591af, 0x70f4ddd3, 0x66a02f45,
0xbfbc09ec, 0x03bd9785, 0x7fac6dd0, 0x31cb8504,
0x96eb27b3, 0x55fd3941, 0xda2547e6, 0xabca0a9a,
0x28507825, 0x530429f4, 0x0a2c86da, 0xe9b66dfb,
0x68dc1462, 0xd7486900, 0x680ec0a4, 0x27a18dee,
0x4f3ffea2, 0xe887ad8c, 0xb58ce006, 0x7af4d6b6,
0xaace1e7c, 0xd3375fec, 0xce78a399, 0x406b2a42,
0x20fe9e35, 0xd9f385b9, 0xee39d7ab, 0x3b124e8b,
0x1dc9faf7, 0x4b6d1856, 0x26a36631, 0xeae397b2,
0x3a6efa74, 0xdd5b4332, 0x6841e7f7, 0xca7820fb,
0xfb0af54e, 0xd8feb397, 0x454056ac, 0xba489527,
0x55533a3a, 0x20838d87, 0xfe6ba9b7, 0xd096954b,
0x55a867bc, 0xa1159a58, 0xcca92963, 0x99e1db33,
0xa62a4a56, 0x3f3125f9, 0x5ef47e1c, 0x9029317c,
0xfdf8e802, 0x04272f70, 0x80bb155c, 0x05282ce3,
0x95c11548, 0xe4c66d22, 0x48c1133f, 0xc70f86dc,
0x07f9c9ee, 0x41041f0f, 0x404779a4, 0x5d886e17,
0x325f51eb, 0xd59bc0d1, 0xf2bcc18f, 0x41113564,
0x257b7834, 0x602a9c60, 0xdff8e8a3, 0x1f636c1b,
0x0e12b4c2, 0x02e1329e, 0xaf664fd1, 0xcad18115,
0x6b2395e0, 0x333e92e1, 0x3b240b62, 0xeebeb922,
0x85b2a20e, 0xe6ba0d99, 0xde720c8c, 0x2da2f728,
0xd0127845, 0x95b794fd, 0x647d0862, 0xe7ccf5f0,
0x5449a36f, 0x877d48fa, 0xc39dfd27, 0xf33e8d1e,
0x0a476341, 0x992eff74, 0x3a6f6eab, 0xf4f8fd37,
0xa812dc60, 0xa1ebddf8, 0x991be14c, 0xdb6e6b0d,
0xc67b5510, 0x6d672c37, 0x2765d43b, 0xdcd0e804,
0xf1290dc7, 0xcc00ffa3, 0xb5390f92, 0x690fed0b,
0x667b9ffb, 0xcedb7d9c, 0xa091cf0b, 0xd9155ea3,
0xbb132f88, 0x515bad24, 0x7b9479bf, 0x763bd6eb,
0x37392eb3, 0xcc115979, 0x8026e297, 0xf42e312d,
0x6842ada7, 0xc66a2b3b, 0x12754ccc, 0x782ef11c,
0x6a124237, 0xb79251e7, 0x06a1bbe6, 0x4bfb6350,
0x1a6b1018, 0x11caedfa, 0x3d25bdd8, 0xe2e1c3c9,
0x44421659, 0x0a121386, 0xd90cec6e, 0xd5abea2a,
0x64af674e, 0xda86a85f, 0xbebfe988, 0x64e4c3fe,
0x9dbc8057, 0xf0f7c086, 0x60787bf8, 0x6003604d,
0xd1fd8346, 0xf6381fb0, 0x7745ae04, 0xd736fccc,
0x83426b33, 0xf01eab71, 0xb0804187, 0x3c005e5f,
0x77a057be, 0xbde8ae24, 0x55464299, 0xbf582e61,
0x4e58f48f, 0xf2ddfda2, 0xf474ef38, 0x8789bdc2,
0x5366f9c3, 0xc8b38e74, 0xb475f255, 0x46fcd9b9,
0x7aeb2661, 0x8b1ddf84, 0x846a0e79, 0x915f95e2,
0x466e598e, 0x20b45770, 0x8cd55591, 0xc902de4c,
0xb90bace1, 0xbb8205d0, 0x11a86248, 0x7574a99e,
0xb77f19b6, 0xe0a9dc09, 0x662d09a1, 0xc4324633,
0xe85a1f02, 0x09f0be8c, 0x4a99a025, 0x1d6efe10,
0x1ab93d1d, 0x0ba5a4df, 0xa186f20f, 0x2868f169,
0xdcb7da83, 0x573906fe, 0xa1e2ce9b, 0x4fcd7f52,
0x50115e01, 0xa70683fa, 0xa002b5c4, 0x0de6d027,
0x9af88c27, 0x773f8641, 0xc3604c06, 0x61a806b5,
0xf0177a28, 0xc0f586e0, 0x006058aa, 0x30dc7d62,
0x11e69ed7, 0x2338ea63, 0x53c2dd94, 0xc2c21634,
0xbbcbee56, 0x90bcb6de, 0xebfc7da1, 0xce591d76,
0x6f05e409, 0x4b7c0188, 0x39720a3d, 0x7c927c24,
0x86e3725f, 0x724d9db9, 0x1ac15bb4, 0xd39eb8fc,
0xed545578, 0x08fca5b5, 0xd83d7cd3, 0x4dad0fc4,
0x1e50ef5e, 0xb161e6f8, 0xa28514d9, 0x6c51133c,
0x6fd5c7e7, 0x56e14ec4, 0x362abfce, 0xddc6c837,
0xd79a3234, 0x92638212, 0x670efa8e, 0x406000e0,
0x3a39ce37, 0xd3faf5cf, 0xabc27737, 0x5ac52d1b,
0x5cb0679e, 0x4fa33742, 0xd3822740, 0x99bc9bbe,
0xd5118e9d, 0xbf0f7315, 0xd62d1c7e, 0xc700c47b,
0xb78c1b6b, 0x21a19045, 0xb26eb1be, 0x6a366eb4,
0x5748ab2f, 0xbc946e79, 0xc6a376d2, 0x6549c2c8,
0x530ff8ee, 0x468dde7d, 0xd5730a1d, 0x4cd04dc6,
0x2939bbdb, 0xa9ba4650, 0xac9526e8, 0xbe5ee304,
0xa1fad5f0, 0x6a2d519a, 0x63ef8ce2, 0x9a86ee22,
0xc089c2b8, 0x43242ef6, 0xa51e03aa, 0x9cf2d0a4,
0x83c061ba, 0x9be96a4d, 0x8fe51550, 0xba645bd6,
0x2826a2f9, 0xa73a3ae1, 0x4ba99586, 0xef5562e9,
0xc72fefd3, 0xf752f7da, 0x3f046f69, 0x77fa0a59,
0x80e4a915, 0x87b08601, 0x9b09e6ad, 0x3b3ee593,
0xe990fd5a, 0x9e34d797, 0x2cf0b7d9, 0x022b8b51,
0x96d5ac3a, 0x017da67d, 0xd1cf3ed6, 0x7c7d2d28,
0x1f9f25cf, 0xadf2b89b, 0x5ad6b472, 0x5a88f54c,
0xe029ac71, 0xe019a5e6, 0x47b0acfd, 0xed93fa9b,
0xe8d3c48d, 0x283b57cc, 0xf8d56629, 0x79132e28,
0x785f0191, 0xed756055, 0xf7960e44, 0xe3d35e8c,
0x15056dd4, 0x88f46dba, 0x03a16125, 0x0564f0bd,
0xc3eb9e15, 0x3c9057a2, 0x97271aec, 0xa93a072a,
0x1b3f6d9b, 0x1e6321f5, 0xf59c66fb, 0x26dcf319,
0x7533d928, 0xb155fdf5, 0x03563482, 0x8aba3cbb,
0x28517711, 0xc20ad9f8, 0xabcc5167, 0xccad925f,
0x4de81751, 0x3830dc8e, 0x379d5862, 0x9320f991,
0xea7a90c2, 0xfb3e7bce, 0x5121ce64, 0x774fbe32,
0xa8b6e37e, 0xc3293d46, 0x48de5369, 0x6413e680,
0xa2ae0810, 0xdd6db224, 0x69852dfd, 0x09072166,
0xb39a460a, 0x6445c0dd, 0x586cdecf, 0x1c20c8ae,
0x5bbef7dd, 0x1b588d40, 0xccd2017f, 0x6bb4e3bb,
0xdda26a7e, 0x3a59ff45, 0x3e350a44, 0xbcb4cdd5,
0x72eacea8, 0xfa6484bb, 0x8d6612ae, 0xbf3c6f47,
0xd29be463, 0x542f5d9e, 0xaec2771b, 0xf64e6370,
0x740e0d8d, 0xe75b1357, 0xf8721671, 0xaf537d5d,
0x4040cb08, 0x4eb4e2cc, 0x34d2466a, 0x0115af84,
0xe1b00428, 0x95983a1d, 0x06b89fb4, 0xce6ea048,
0x6f3f3b82, 0x3520ab82, 0x011a1d4b, 0x277227f8,
0x611560b1, 0xe7933fdc, 0xbb3a792b, 0x344525bd,
0xa08839e1, 0x51ce794b, 0x2f32c9b7, 0xa01fbac9,
0xe01cc87e, 0xbcc7d1f6, 0xcf0111c3, 0xa1e8aac7,
0x1a908749, 0xd44fbd9a, 0xd0dadecb, 0xd50ada38,
0x0339c32a, 0xc6913667, 0x8df9317c, 0xe0b12b4f,
0xf79e59b7, 0x43f5bb3a, 0xf2d519ff, 0x27d9459c,
0xbf97222c, 0x15e6fc2a, 0x0f91fc71, 0x9b941525,
0xfae59361, 0xceb69ceb, 0xc2a86459, 0x12baa8d1,
0xb6c1075e, 0xe3056a0c, 0x10d25065, 0xcb03a442,
0xe0ec6e0e, 0x1698db3b, 0x4c98a0be, 0x3278e964,
0x9f1f9532, 0xe0d392df, 0xd3a0342b, 0x8971f21e,
0x1b0a7441, 0x4ba3348c, 0xc5be7120, 0xc37632d8,
0xdf359f8d, 0x9b992f2e, 0xe60b6f47, 0x0fe3f11d,
0xe54cda54, 0x1edad891, 0xce6279cf, 0xcd3e7e6f,
0x1618b166, 0xfd2c1d05, 0x848fd2c5, 0xf6fb2299,
0xf523f357, 0xa6327623, 0x93a83531, 0x56cccd02,
0xacf08162, 0x5a75ebb5, 0x6e163697, 0x88d273cc,
0xde966292, 0x81b949d0, 0x4c50901b, 0x71c65614,
0xe6c6c7bd, 0x327a140a, 0x45e1d006, 0xc3f27b9a,
0xc9aa53fd, 0x62a80f00, 0xbb25bfe2, 0x35bdd2f6,
0x71126905, 0xb2040222, 0xb6cbcf7c, 0xcd769c2b,
0x53113ec0, 0x1640e3d3, 0x38abbd60, 0x2547adf0,
0xba38209c, 0xf746ce76, 0x77afa1c5, 0x20756060,
0x85cbfe4e, 0x8ae88dd8, 0x7aaaf9b0, 0x4cf9aa7e,
0x1948c25c, 0x02fb8a8c, 0x01c36ae4, 0xd6ebe1f9,
0x90d4f869, 0xa65cdea0, 0x3f09252d, 0xc208e69f,
0xb74e6132, 0xce77e25b, 0x578fdfe3, 0x3ac372e6
};
// bcrypt IV: "OrpheanBeholderScryDoubt"
static private final int bf_crypt_ciphertext[] = {
0x4f727068, 0x65616e42, 0x65686f6c,
0x64657253, 0x63727944, 0x6f756274
};
// Table for Base64 encoding
static private final char base64_code[] = {
'.', '/', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J',
'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V',
'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h',
'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't',
'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5',
'6', '7', '8', '9'
};
// Table for Base64 decoding
static private final byte index_64[] = {
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, 0, 1, 54, 55,
56, 57, 58, 59, 60, 61, 62, 63, -1, -1,
-1, -1, -1, -1, -1, 2, 3, 4, 5, 6,
7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
-1, -1, -1, -1, -1, -1, 28, 29, 30,
31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
41, 42, 43, 44, 45, 46, 47, 48, 49, 50,
51, 52, 53, -1, -1, -1, -1, -1
};
// Expanded Blowfish key
private int P[];
private int S[];
/**
* Encode a byte array using bcrypt's slightly-modified base64
* encoding scheme. Note that this is *not* compatible with
* the standard MIME-base64 encoding.
*
* @param d the byte array to encode
* @param len the number of bytes to encode
* @return base64-encoded string
* @exception IllegalArgumentException if the length is invalid
*/
private static String encode_base64(byte d[], int len)
throws IllegalArgumentException {
int off = 0;
StringBuffer rs = new StringBuffer();
int c1, c2;
if (len <= 0 || len > d.length)
throw new IllegalArgumentException ("Invalid len");
while (off < len) {
c1 = d[off++] & 0xff;
rs.append(base64_code[(c1 >> 2) & 0x3f]);
c1 = (c1 & 0x03) << 4;
if (off >= len) {
rs.append(base64_code[c1 & 0x3f]);
break;
}
c2 = d[off++] & 0xff;
c1 |= (c2 >> 4) & 0x0f;
rs.append(base64_code[c1 & 0x3f]);
c1 = (c2 & 0x0f) << 2;
if (off >= len) {
rs.append(base64_code[c1 & 0x3f]);
break;
}
c2 = d[off++] & 0xff;
c1 |= (c2 >> 6) & 0x03;
rs.append(base64_code[c1 & 0x3f]);
rs.append(base64_code[c2 & 0x3f]);
}
return rs.toString();
}
/**
* Look up the 3 bits base64-encoded by the specified character,
* range-checking againt conversion table
* @param x the base64-encoded value
* @return the decoded value of x
*/
private static byte char64(char x) {
if ((int)x < 0 || (int)x > index_64.length)
return -1;
return index_64[(int)x];
}
/**
* Decode a string encoded using bcrypt's base64 scheme to a
* byte array. Note that this is *not* compatible with
* the standard MIME-base64 encoding.
* @param s the string to decode
* @param maxolen the maximum number of bytes to decode
* @return an array containing the decoded bytes
* @throws IllegalArgumentException if maxolen is invalid
*/
private static byte[] decode_base64(String s, int maxolen)
throws IllegalArgumentException {
StringBuffer rs = new StringBuffer();
int off = 0, slen = s.length(), olen = 0;
byte ret[];
byte c1, c2, c3, c4, o;
if (maxolen <= 0)
throw new IllegalArgumentException ("Invalid maxolen");
while (off < slen - 1 && olen < maxolen) {
c1 = char64(s.charAt(off++));
c2 = char64(s.charAt(off++));
if (c1 == -1 || c2 == -1)
break;
o = (byte)(c1 << 2);
o |= (c2 & 0x30) >> 4;
rs.append((char)o);
if (++olen >= maxolen || off >= slen)
break;
c3 = char64(s.charAt(off++));
if (c3 == -1)
break;
o = (byte)((c2 & 0x0f) << 4);
o |= (c3 & 0x3c) >> 2;
rs.append((char)o);
if (++olen >= maxolen || off >= slen)
break;
c4 = char64(s.charAt(off++));
o = (byte)((c3 & 0x03) << 6);
o |= c4;
rs.append((char)o);
++olen;
}
ret = new byte[olen];
for (off = 0; off < olen; off++)
ret[off] = (byte)rs.charAt(off);
return ret;
}
/**
* Blowfish encipher a single 64-bit block encoded as
* two 32-bit halves
* @param lr an array containing the two 32-bit half blocks
* @param off the position in the array of the blocks
*/
private final void encipher(int lr[], int off) {
int i, n, l = lr[off], r = lr[off + 1];
l ^= P[0];
for (i = 0; i <= BLOWFISH_NUM_ROUNDS - 2;) {
// Feistel substitution on left word
n = S[(l >> 24) & 0xff];
n += S[0x100 | ((l >> 16) & 0xff)];
n ^= S[0x200 | ((l >> 8) & 0xff)];
n += S[0x300 | (l & 0xff)];
r ^= n ^ P[++i];
// Feistel substitution on right word
n = S[(r >> 24) & 0xff];
n += S[0x100 | ((r >> 16) & 0xff)];
n ^= S[0x200 | ((r >> 8) & 0xff)];
n += S[0x300 | (r & 0xff)];
l ^= n ^ P[++i];
}
lr[off] = r ^ P[BLOWFISH_NUM_ROUNDS + 1];
lr[off + 1] = l;
}
/**
* Cycically extract a word of key material
* @param data the string to extract the data from
* @param offp a "pointer" (as a one-entry array) to the
* current offset into data
* @return the next word of material from data
*/
private static int streamtoword(byte data[], int offp[]) {
int i;
int word = 0;
int off = offp[0];
for (i = 0; i < 4; i++) {
word = (word << 8) | (data[off] & 0xff);
off = (off + 1) % data.length;
}
offp[0] = off;
return word;
}
/**
* Initialise the Blowfish key schedule
*/
private void init_key() {
P = (int[])P_orig.clone();
S = (int[])S_orig.clone();
}
/**
* Key the Blowfish cipher
* @param key an array containing the key
*/
private void key(byte key[]) {
int i;
int koffp[] = { 0 };
int lr[] = { 0, 0 };
int plen = P.length, slen = S.length;
for (i = 0; i < plen; i++)
P[i] = P[i] ^ streamtoword(key, koffp);
for (i = 0; i < plen; i += 2) {
encipher(lr, 0);
P[i] = lr[0];
P[i + 1] = lr[1];
}
for (i = 0; i < slen; i += 2) {
encipher(lr, 0);
S[i] = lr[0];
S[i + 1] = lr[1];
}
}
/**
* Perform the "enhanced key schedule" step described by
* Provos and Mazieres in "A Future-Adaptable Password Scheme"
* http://www.openbsd.org/papers/bcrypt-paper.ps
* @param data salt information
* @param key password information
*/
private void ekskey(byte data[], byte key[]) {
int i;
int koffp[] = { 0 }, doffp[] = { 0 };
int lr[] = { 0, 0 };
int plen = P.length, slen = S.length;
for (i = 0; i < plen; i++)
P[i] = P[i] ^ streamtoword(key, koffp);
for (i = 0; i < plen; i += 2) {
lr[0] ^= streamtoword(data, doffp);
lr[1] ^= streamtoword(data, doffp);
encipher(lr, 0);
P[i] = lr[0];
P[i + 1] = lr[1];
}
for (i = 0; i < slen; i += 2) {
lr[0] ^= streamtoword(data, doffp);
lr[1] ^= streamtoword(data, doffp);
encipher(lr, 0);
S[i] = lr[0];
S[i + 1] = lr[1];
}
}
/**
* Perform the central password hashing step in the
* bcrypt scheme
* @param password the password to hash
* @param salt the binary salt to hash with the password
* @param log_rounds the binary logarithm of the number
* of rounds of hashing to apply
* @return an array containing the binary hashed password
*/
private byte[] crypt_raw(byte password[], byte salt[], int log_rounds) {
int rounds, i, j;
int cdata[] = (int[])bf_crypt_ciphertext.clone();
int clen = cdata.length;
byte ret[];
if (log_rounds < 4 || log_rounds > 31)
throw new IllegalArgumentException ("Bad number of rounds");
rounds = 1 << log_rounds;
if (salt.length != BCRYPT_SALT_LEN)
throw new IllegalArgumentException ("Bad salt length");
init_key();
ekskey(salt, password);
for (i = 0; i < rounds; i++) {
key(password);
key(salt);
}
for (i = 0; i < 64; i++) {
for (j = 0; j < (clen >> 1); j++)
encipher(cdata, j << 1);
}
ret = new byte[clen * 4];
for (i = 0, j = 0; i < clen; i++) {
ret[j++] = (byte)((cdata[i] >> 24) & 0xff);
ret[j++] = (byte)((cdata[i] >> 16) & 0xff);
ret[j++] = (byte)((cdata[i] >> 8) & 0xff);
ret[j++] = (byte)(cdata[i] & 0xff);
}
return ret;
}
/**
* Hash a password using the OpenBSD bcrypt scheme
* @param password the password to hash
* @param salt the salt to hash with (perhaps generated
* using BCrypt.gensalt)
* @return the hashed password
*/
public static String hashpw(String password, String salt) {
BCrypt B;
String real_salt;
byte passwordb[], saltb[], hashed[];
char minor = (char)0;
int rounds, off = 0;
StringBuffer rs = new StringBuffer();
if (salt.charAt(0) != '$' || salt.charAt(1) != '2')
throw new IllegalArgumentException ("Invalid salt version");
if (salt.charAt(2) == '$')
off = 3;
else {
minor = salt.charAt(2);
if (minor != 'a' || salt.charAt(3) != '$')
throw new IllegalArgumentException ("Invalid salt revision");
off = 4;
}
// Extract number of rounds
if (salt.charAt(off + 2) > '$')
throw new IllegalArgumentException ("Missing salt rounds");
rounds = Integer.parseInt(salt.substring(off, off + 2));
real_salt = salt.substring(off + 3, off + 25);
try {
passwordb = (password + (minor >= 'a' ? "\000" : "")).getBytes("UTF-8");
} catch (UnsupportedEncodingException uee) {
throw new AssertionError("UTF-8 is not supported");
}
saltb = decode_base64(real_salt, BCRYPT_SALT_LEN);
B = new BCrypt();
hashed = B.crypt_raw(passwordb, saltb, rounds);
rs.append("$2");
if (minor >= 'a')
rs.append(minor);
rs.append("$");
if (rounds < 10)
rs.append("0");
rs.append(Integer.toString(rounds));
rs.append("$");
rs.append(encode_base64(saltb, saltb.length));
rs.append(encode_base64(hashed,
bf_crypt_ciphertext.length * 4 - 1));
return rs.toString();
}
/**
* Generate a salt for use with the BCrypt.hashpw() method
* @param log_rounds the log2 of the number of rounds of
* hashing to apply - the work factor therefore increases as
* 2**log_rounds.
* @param random an instance of SecureRandom to use
* @return an encoded salt value
*/
public static String gensalt(int log_rounds, SecureRandom random) {
StringBuffer rs = new StringBuffer();
byte rnd[] = new byte[BCRYPT_SALT_LEN];
random.nextBytes(rnd);
rs.append("$2a$");
if (log_rounds < 10)
rs.append("0");
rs.append(Integer.toString(log_rounds));
rs.append("$");
rs.append(encode_base64(rnd, rnd.length));
return rs.toString();
}
/**
* Generate a salt for use with the BCrypt.hashpw() method
* @param log_rounds the log2 of the number of rounds of
* hashing to apply - the work factor therefore increases as
* 2**log_rounds.
* @return an encoded salt value
*/
public static String gensalt(int log_rounds) {
return gensalt(log_rounds, new SecureRandom());
}
/**
* Generate a salt for use with the BCrypt.hashpw() method,
* selecting a reasonable default for the number of hashing
* rounds to apply
* @return an encoded salt value
*/
public static String gensalt() {
return gensalt(GENSALT_DEFAULT_LOG2_ROUNDS);
}
/**
* Check that a plaintext password matches a previously hashed
* one
* @param plaintext the plaintext password to verify
* @param hashed the previously-hashed password
* @return true if the passwords match, false otherwise
*/
public static boolean checkpw(String plaintext, String hashed) {
return (hashed.compareTo(hashpw(plaintext, hashed)) == 0);
}
}

View File

@ -0,0 +1,25 @@
package com.loglog.api.commons.utils;
import org.apache.commons.lang3.StringUtils;
import com.loglog.api.commons.beans.BoardBean;
public class BoardUtils {
/**
* 비밀글 이면서 본인의 비밀글이 맞는지를 확인한다.
* @param boardBean
* @return 위의 조건2개를 만족하면 true, 아니면 false
*/
public static boolean getIsSecretBdMine(String writerId, BoardBean boardBean) {
if(boardBean != null && StringUtils.equals(boardBean.getBdSecretYn(), "Y")) {
if( StringUtils.equals(writerId, boardBean.getBdWriterId()) ) {
return true;
}
}
return false;
}
}

View File

@ -0,0 +1,271 @@
package com.loglog.api.commons.utils;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLConnection;
import java.util.Random;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.servlet.http.HttpServletRequest;
import org.apache.commons.lang3.StringUtils;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
/**
* 공통사용 Util
*
* @author PCH
*/
public class CommonUtils {
/**
* 자릿수만큼 랜덤숫자 생성 반환한다.
*
* @author PCH
* @param loopCount 자릿수
* @return 자릿수만큼 랜덤숫자 생성 반환
*/
public static String getRandomNum(int loopCount){
String str = "";
int d = 0;
for (int i = 1; i <= loopCount; i++){
Random r = new Random();
d = r.nextInt(9);
str = str + Integer.toString(d);
}
return str;
}
private static final char[] chars;
static {
StringBuilder buffer = new StringBuilder();
for (char ch = '0'; ch <= '9'; ++ch)
buffer.append(ch);
for (char ch = 'a'; ch <= 'z'; ++ch)
buffer.append(ch);
for (char ch = 'A'; ch <= 'Z'; ++ch)
buffer.append(ch);
chars = buffer.toString().toCharArray();
}
/**
* 자릿수만큼 랜덤 문자열(숫자포함) 생성 반환한다
* @param length 자릿수
* @return 자릿수만큼 랜덤 문자열 반환
*/
public static String random(int length) {
if (length < 1)
throw new IllegalArgumentException("length < 1: " + length);
StringBuilder randomString = new StringBuilder();
Random random = new Random();
for (int i = 0; i < length; i++) {
randomString.append(chars[random.nextInt(chars.length)]);
}
return randomString.toString();
}
/**userId/sellerId 특수문자로 변경*/
public static String convertEmail(String email) throws Exception{
String str = "";
int flag = email.indexOf('@');
for (int i = 0; i < email.length(); i++) {
if (i<3) {
str += email.charAt(i);
}else{
if (i<flag) {
str += '*';
} else if (i==flag) {
str += '@';
}else{
str += email.charAt(i);
}
}
}
return str;
}
/**
* 비밀번호 암호화하는 메서드
* @author PCH
* @param pw 인코딩 전의 비밀번호
* @return encodingPassword 인코딩 비밀번호
*/
public static String encode(String pw) {
String encodingPassword = BCrypt.hashpw(pw, BCrypt.gensalt());
return encodingPassword;
}
/**
* 사용자가 입력한 값과 암호화된 비밀번호가 맞는지 확인하는 메서드
* @author PCH
* @param password 사용자가 입력한 비밀번호
* @param hashedPassword 암호화 되어있는 비밀번호
* @return true 일치, false 불일치
*/
public static Boolean chkPassword(String password, String hashedPassword){
return BCrypt.checkpw(password, hashedPassword);
}
/**
* 카테고리 아이디 자릿수로 카테고리 레벨을 반환한다.
* 1레벨 - 1~2자리
* 2레벨 - 4~5자리
* 3레벨 - 6~7자리
* 4레벨 - 8~9자리
*/
public static String getCategoryLevel(String categoryId){
String categoryLevel = "";
int categoryIdLength = categoryId.length();
if ( categoryIdLength == 1 || categoryIdLength == 2 ){
categoryLevel = "1";
} else if ( categoryIdLength == 4 || categoryIdLength == 5 ){
categoryLevel = "2";
} else if ( categoryIdLength == 6 || categoryIdLength == 7 ){
categoryLevel = "3";
} else if ( categoryIdLength == 8 || categoryIdLength == 9 ){
categoryLevel = "4";
}
return categoryLevel;
}
/**
* client ip 가져오기
* @param request
* @return String ip
*/
public static String getClientIp(HttpServletRequest request) {
request = ((ServletRequestAttributes)RequestContextHolder.currentRequestAttributes()).getRequest();
String ip = request.getHeader("X-FORWARDED-FOR");
if (ip == null){
ip = request.getRemoteAddr();
}
return ip;
}
/**
* 천단위 콤마 표시 반환
* @param request
* @return String ip
*/
public static String getThousandComma(String strVal) {
if(strVal == null || strVal.length() == 0) return "0";
String strResult = strVal; //출력할 결과를 저장할 변수
Pattern p = Pattern.compile("(^[+-]?\\d+)(\\d{3})"); //정규표현식
Matcher regexMatcher = p.matcher(strVal);
try {
//int cnt = 0;
while(regexMatcher.find()) {
strResult = regexMatcher.replaceAll("$1,$2"); //치환 : 그룹1 + "," + 그룹2
//System.out.println("과정("+ (++cnt) +"):"+strResult);
//치환된 문자열로 다시 matcher객체 얻기
//regexMatcher = p.matcher(strResult);
regexMatcher.reset(strResult);
}
} catch (Exception e) {
e.printStackTrace();
}
return strResult;
}
/**
* 이름 가운데 부분만 마스킹 처리 (앞1글자, 제일마지막 1글자는 제외)
* @param name
* @return string
*/
public static String maskingName(String name) {
if( StringUtils.isNotEmpty(name) ) {
StringBuffer sb = new StringBuffer();
for(int i = 0; i < name.length(); i++) {
String str = name.substring(i, i+1);
if(i == 0) {
sb.append(str);
} else if( i+1 == name.length() && name.length() != 2) {
sb.append(str);
} else {
sb.append("*");
}
}
return sb.toString();
} else {
return name;
}
}
/**
* Object Integer 캐스팅 한다.
* @param obj
* @return Integer
*/
public static Integer getCastObject2Int(Object obj) {
Integer rtnInt = 0;
if(obj == null) return rtnInt;
try {
if(obj instanceof String) {
rtnInt = Integer.parseInt( (String)obj );
}
else if(obj instanceof Integer) {
rtnInt = (Integer)obj;
}
else if(obj instanceof Long) {
rtnInt = (int)((long)obj);
}
else if(obj instanceof Float) {
rtnInt = (int)((float)obj);
}
} catch (Exception e) {
e.printStackTrace();
}
return rtnInt;
}
/**
*
* @return
*/
public synchronized static boolean getImageUrlVerify(String imgUrl) {
boolean isBoolRtn = false;
HttpURLConnection urlConn = null;
try {
URL url = new URL(imgUrl);
URLConnection con = url.openConnection();
urlConn = (HttpURLConnection)con;
con.setConnectTimeout(200);
urlConn.setReadTimeout(200);
int responseCode = urlConn.getResponseCode();
if(urlConn.getResponseCode() == 200) {
System.out.println("responseCode: " + responseCode);
System.out.println("imageUrlVerifyUrl: " + imgUrl);
isBoolRtn = true;
}
} catch(Exception e) {
System.out.println(e.getMessage());
}
return isBoolRtn;
}
}

View File

@ -0,0 +1,65 @@
package com.loglog.api.commons.utils;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.net.URLEncoder;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang3.StringUtils;
import org.springframework.util.FileCopyUtils;
import org.springframework.web.servlet.view.AbstractView;
public class DownloadView extends AbstractView {
public DownloadView() {
setContentType("application/download; charset=utf-8");
}
@Override
protected void renderMergedOutputModel(Map<String, Object> model,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
File file = (File) model.get("downloadFile");
String fileName = (String)model.get("fileName");
if ( StringUtils.isEmpty( fileName ) ){
fileName = file.getName();
}
response.setContentType(getContentType());
response.setContentLength((int) file.length());
// String userAgent = request.getHeader("User-Agent");
// boolean ie = userAgent.indexOf("MSIE") > -1;
String browser = request.getHeader("User-Agent");
//파일 인코딩
if(browser.contains("MSIE") || browser.contains("Trident") || browser.contains("Chrome")){
fileName = URLEncoder.encode(fileName,"UTF-8").replaceAll("\\+", "%20");
} else {
fileName = new String(fileName.getBytes("UTF-8"), "ISO-8859-1");
}
response.setHeader("Content-Disposition", "attachment; filename=\"" + fileName + "\";");
response.setHeader("Content-Transfer-Encoding", "binary");
OutputStream out = response.getOutputStream();
FileInputStream fis = null;
try {
fis = new FileInputStream(file);
FileCopyUtils.copy(fis, out);
} finally {
if (fis != null)
try {
fis.close();
} catch (IOException ex) {
}
}
out.flush();
}
}

View File

@ -0,0 +1,54 @@
package com.loglog.api.commons.utils;
import java.security.MessageDigest;
/** 암호화 유틸 */
public class EncryptUtil {
/**
* 문자열을 SHA-256 방식으로 암호화
* @param txt 암호화 하려하는 문자열
* @return String
* @throws Exception
*/
public String getEncSHA256(String txt) throws Exception{
StringBuffer sbuf = new StringBuffer();
MessageDigest mDigest = MessageDigest.getInstance("SHA-256");
mDigest.update(txt.getBytes());
byte[] msgStr = mDigest.digest() ;
for(int i=0; i < msgStr.length; i++){
byte tmpStrByte = msgStr[i];
String tmpEncTxt = Integer.toString((tmpStrByte & 0xff) + 0x100, 16).substring(1);
sbuf.append(tmpEncTxt) ;
}
return sbuf.toString();
}
/**
* 문자열을 MD-5 방식으로 암호화
* @param txt 암호화 하려하는 문자열
* @return String
* @throws Exception
*/
public String getEncMD5(String txt) throws Exception {
StringBuffer sbuf = new StringBuffer();
MessageDigest mDigest = MessageDigest.getInstance("MD5");
mDigest.update(txt.getBytes());
byte[] msgStr = mDigest.digest();
for(int i=0; i < msgStr.length; i++){
String tmpEncTxt = Integer.toHexString((int)msgStr[i] & 0x00ff);
sbuf.append(tmpEncTxt);
}
return sbuf.toString() ;
}
}

View File

@ -0,0 +1,235 @@
package com.loglog.api.commons.utils;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.web.multipart.MultipartFile;
/**
* 상품 마스터 이미지 파일 유틸 함수
* @author martin
*
*/
public class FileProductImgUtil {
/**
* 파일목록들을 폴더로 이동 처리
* upload경로path 리턴
*/
// repositoryPath : /Users/martin/Documents/workspaceMeatoB/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/MeatToBAdmin
// tempFolder : /product_img_temp
// targetFilePaths : /product_img_temp/20160728/9e2783fe-0593-4bd9-9111-48bf0ce19f78.jpg
public static List<String> moveTempFileToUploadFolder(String repositoryPath , String uploadFolderPath
, String subUploadFolderName , List<String> targetFilePathList) throws IOException{
List<String> uploadFiles = new ArrayList<String>();
String moveFilePath = "";
for(int i = 0 ; i < targetFilePathList.size() ; ++i){
moveFilePath = moveFileFolder(repositoryPath, uploadFolderPath, subUploadFolderName, targetFilePathList.get(i));
if(moveFilePath != null){
uploadFiles.add(moveFilePath);
}
}//for i
return uploadFiles;
}
/**
* 파일을 업로드 폴더로 이동 처리 원본 삭제
* upload경로path 리턴
*/
public static String moveFileFolder(String repositoryPath , String uploadFolderPath
, String subUploadFolderName , String targetFilePath) throws IOException{
File fileTemp = null;
String fullTempFilePath = "";
File fileMove = null;
String moveFilePath = "";
String fullMoveFilePath = "";
fullTempFilePath = repositoryPath + targetFilePath;
fileTemp = new File(fullTempFilePath);
moveFilePath = uploadFolderPath + "/"+ subUploadFolderName + "/"+fileTemp.getName();
fullMoveFilePath = repositoryPath + moveFilePath;
fileMove = new File( fullMoveFilePath);
if(fileTemp.exists() == false) return null;
FileUtils.copyFile(fileTemp, fileMove);
fileTemp.delete();
return moveFilePath;
}
/**
* 상품마스터 이미지 파일을 상품 이미지 폴더로 복사 처리
* 복사된 경로 리턴
*/
public static String copyMasterImgFileToProductFolder(String masterImgFullPath ,
String productRepositoryPath ,
String productFolderPath ,
String productId) throws IOException{
String fullTargetPath = "";
String targetPath = "";
File fileMaster = new File(masterImgFullPath);
File fileProduct = null;
if(fileMaster.exists() == false) return null;
targetPath = productFolderPath +"/"+ productId+ "/" + fileMaster.getName();
fullTargetPath = productRepositoryPath + targetPath;
fileProduct = new File(fullTargetPath);
FileUtils.copyFile(fileMaster, fileProduct);
return targetPath;
}
/**
* 파일 갱신
*/
public static void updateUploadFile(String repositoryPath ,String uploadFolderPath,String subUploadFolderName,List<String> targetFilePaths){
String fullUploadPath = repositoryPath + uploadFolderPath + "/" +subUploadFolderName;
if(StringUtils.isEmpty(subUploadFolderName)) return;
File folder = new File(fullUploadPath);
if(! folder.exists()){
return;
}
String[] fnameList = folder.list();
int fCnt = fnameList.length;
String childPath = "";
boolean isExist = false;
for(int i = 0; i < fCnt; i++) {
childPath = fullUploadPath+"/"+fnameList[i];
File f = new File(childPath);
if(f.isDirectory()) continue; //folder 라면 skip
isExist = false;
for(int j = 0 ; j < targetFilePaths.size() ; ++j){
//targetFilePaths 목록에 파일명이 존재 여부 체크
if( targetFilePaths.get(j).indexOf(f.getName()) >= 0){
isExist = true;
break;
}
}//for j
//targetFilePaths 목록에 없는 파일 이면 삭제
if(isExist == false){
f.delete();
}
}//for i
}
/**
* 파일 삭제
* @param imgFiles
*/
// targetFilePaths : /1/20160728/9e2783fe-0593-4bd9-9111-48bf0ce19f78.jpg
public static void deleteUploadFile(String repositoryPath ,List<String> targetFilePaths){
String tempImgPath = "";
String fullPath = "";
File fileDelete = null;
for(int i = 0 ; i < targetFilePaths.size() ; ++i){
tempImgPath = targetFilePaths.get(i);
fullPath = repositoryPath + tempImgPath;
fileDelete = new File(fullPath);
if(fileDelete.exists() == false) continue;
fileDelete.delete();
}//for i
}
/**
* 업로드 폴더 삭제
* @param repositoryPath
* @param uploadFolderPath
* @param subUploadFolderName
*/
public static void deleteUploadFolder(String repositoryPath,String uploadFolderPath,String subUploadFolderName) throws Exception {
if(StringUtils.isEmpty(subUploadFolderName)) return;
String fullUploadPath = repositoryPath + uploadFolderPath + "/" +subUploadFolderName;
File folder = new File(fullUploadPath);
if (folder.exists()){
deleteFolder(fullUploadPath);
}
}
/** 자식 요소 삭제후 폴더 삭제 */
public static void deleteFolder(String parentPath) throws Exception {
File file = new File(parentPath);
String[] fnameList = file.list();
int fCnt = fnameList.length;
String childPath = "";
for(int i = 0; i < fCnt; i++) {
childPath = parentPath+"/"+fnameList[i];
File f = new File(childPath);
if( ! f.isDirectory()) {
f.delete(); //파일이면 바로 삭제
} else {
deleteFolder(childPath);
}
}
File f = new File(parentPath);
f.delete(); //폴더는 나중에 삭제
}
/** 파일 등록*/
public static void multipartFileUpload(MultipartFile mf, String fileDir, String fileName) {
File dir = new File(fileDir);
if (!dir.isDirectory()) {
dir.mkdirs();
}
if (mf != null && !mf.getOriginalFilename().equals("")) {
//본래 파일명
String originalfileName = mf.getOriginalFilename();
System.out.println("원래 이름" + originalfileName);
//저장되는 파일 이름
if (!originalfileName.equals("")) {
File uploadFile = new File(fileDir+"/"+fileName);
try {
//파일 저장
mf.transferTo(uploadFile);
} catch (IllegalStateException | IOException e) {
e.printStackTrace();
}
}
}//end if
}
}

View File

@ -0,0 +1,180 @@
package com.loglog.api.commons.utils;
import java.io.BufferedInputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.util.Iterator;
import javax.servlet.http.HttpServletRequest;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONObject;
import com.google.gson.Gson;
public class HttpUtil {
/**
* 객체를 JSON 문자열로 POST 방식으로 전송한다.
* @param url
* @param object
*/
public static void sendObject2Json(String url, Object object) {
try {
URL u = new URL(url);
HttpURLConnection httpCon = (HttpURLConnection) u.openConnection();
httpCon.setRequestProperty("Content-Type", "application/json; charset=EUC-KR");
httpCon.setDoOutput(true);
httpCon.setDoInput(true);
httpCon.setRequestMethod("POST");
OutputStream raw = httpCon.getOutputStream();
//OutputStream buffered = new BufferedOutputStream(raw);
//OutputStreamWriter out = new OutputStreamWriter(buffered,"UTF-8");
//OutputStreamWriter out = new OutputStreamWriter(buffered);
//Object -> JSON
String jsonStr = new Gson().toJson(object);
System.out.println("ready to send : " + url);
System.out.println("converted json data: \n" + jsonStr);
//전송
raw.write(jsonStr.getBytes("EUC-KR"));
raw.flush();
raw.close();
// read the response
System.out.println(httpCon.getResponseCode());
System.out.println(httpCon.getResponseMessage());
InputStream in = new BufferedInputStream(httpCon.getInputStream());
String result = org.apache.commons.io.IOUtils.toString(in, "UTF-8");
System.out.println(result);
in.close();
httpCon.disconnect();
} catch(Exception e) {
e.printStackTrace();
}
}
/**
* 객체를 GET 파라미터 형식의 POST 방식으로 전송한다.
* @param url
* @param object
*/
public static void sendObject2Post(String url, Object object) {
try {
URL u = new URL(url);
HttpURLConnection httpCon = (HttpURLConnection) u.openConnection();
httpCon.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
httpCon.setDoOutput(true);
httpCon.setDoInput(true);
httpCon.setRequestMethod("POST");
OutputStream raw = httpCon.getOutputStream();
//OutputStream buffered = new BufferedOutputStream(raw);
//OutputStreamWriter out = new OutputStreamWriter(buffered,"UTF-8");
//OutputStreamWriter out = new OutputStreamWriter(buffered);
//Object -> JSON
String jsonStr = new Gson().toJson(object);
System.out.println("ready to send : " + url);
System.out.println("converted json data: \n" + jsonStr);
StringBuilder sb = new StringBuilder();
JSONObject json = new JSONObject(jsonStr);
Iterator<String> keys = json.keys();
//sb.append("?"); //start of query args
while (keys.hasNext()) {
String key = keys.next();
sb.append(key);
sb.append("=");
sb.append( URLEncoder.encode((String)json.get(key), "EUC-KR") );
sb.append("&"); //To allow for another argument.
}
String queryStr = sb.toString();
System.out.println( "json to query :" + queryStr );
//전송
raw.write(queryStr.getBytes("EUC-KR"));
raw.flush();
raw.close();
// read the response
System.out.println(httpCon.getResponseCode());
System.out.println(httpCon.getResponseMessage());
InputStream in = new BufferedInputStream(httpCon.getInputStream());
String result = org.apache.commons.io.IOUtils.toString(in, "UTF-8");
System.out.println(result);
in.close();
httpCon.disconnect();
} catch(Exception e) {
e.printStackTrace();
}
}
/**
* 객체를 GET 파라미터 형식의 POST 방식으로 전송한다.
* @param url
* @param object
*/
public static void send2PostOrderId(String url, String moduleId, String orderId, String userId) {
try {
URL u = new URL(url);
HttpURLConnection httpCon = (HttpURLConnection) u.openConnection();
httpCon.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
httpCon.setDoOutput(true);
httpCon.setDoInput(true);
httpCon.setRequestMethod("POST");
OutputStream raw = httpCon.getOutputStream();
System.out.println("ready to send : " + url);
String queryStr = "moduleId=" + moduleId + "&" + "orderId=" + orderId + "&" + "userId=" + userId;
System.out.println( "json to query :" + queryStr );
//전송
raw.write(queryStr.getBytes("EUC-KR"));
raw.flush();
raw.close();
// read the response
System.out.println(httpCon.getResponseCode());
System.out.println(httpCon.getResponseMessage());
InputStream in = new BufferedInputStream(httpCon.getInputStream());
String result = org.apache.commons.io.IOUtils.toString(in, "UTF-8");
System.out.println(result);
in.close();
httpCon.disconnect();
} catch(Exception e) {
e.printStackTrace();
}
}
/** 클라이언트 ip 추출
PROXY SERVER 또는 LOAD BALANCER를 거치는 경우 ip가 접속하기 직전의 ip로 들어오게 된다.
PROXY SERVER 또는 LOAD BALANCER를 거칠 경우 reuqest header의 HTTP_X_FORWARDED_FOR 키워드에 정보를 남김으로
먼저 확인 없을 경우 request.getRemoteAddr() ip를 추출한다. */
public static String getClientIp(HttpServletRequest request) throws Exception {
String ip = request.getHeader("HTTP_X_FORWARDED_FOR");
if ( StringUtils.isEmpty( ip ) ) {
ip = request.getRemoteAddr();
}
return ip;
}
}//end class

Some files were not shown because too many files have changed in this diff Show More