first
commit
11de123948
|
|
@ -0,0 +1,33 @@
|
||||||
|
HELP.md
|
||||||
|
target/
|
||||||
|
!.mvn/wrapper/maven-wrapper.jar
|
||||||
|
!**/src/main/**/target/
|
||||||
|
!**/src/test/**/target/
|
||||||
|
|
||||||
|
### STS ###
|
||||||
|
.apt_generated
|
||||||
|
.classpath
|
||||||
|
.factorypath
|
||||||
|
.project
|
||||||
|
.settings
|
||||||
|
.springBeans
|
||||||
|
.sts4-cache
|
||||||
|
|
||||||
|
### IntelliJ IDEA ###
|
||||||
|
.idea
|
||||||
|
*.iws
|
||||||
|
*.iml
|
||||||
|
*.ipr
|
||||||
|
|
||||||
|
### NetBeans ###
|
||||||
|
/nbproject/private/
|
||||||
|
/nbbuild/
|
||||||
|
/dist/
|
||||||
|
/nbdist/
|
||||||
|
/.nb-gradle/
|
||||||
|
build/
|
||||||
|
!**/src/main/**/build/
|
||||||
|
!**/src/test/**/build/
|
||||||
|
|
||||||
|
### VS Code ###
|
||||||
|
.vscode/
|
||||||
Binary file not shown.
|
|
@ -0,0 +1,2 @@
|
||||||
|
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.3/apache-maven-3.9.3-bin.zip
|
||||||
|
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar
|
||||||
Binary file not shown.
|
|
@ -0,0 +1,308 @@
|
||||||
|
#!/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.
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
# Apache Maven Wrapper startup batch script, version 3.2.0
|
||||||
|
#
|
||||||
|
# Required ENV vars:
|
||||||
|
# ------------------
|
||||||
|
# JAVA_HOME - location of a JDK home dir
|
||||||
|
#
|
||||||
|
# Optional ENV vars
|
||||||
|
# -----------------
|
||||||
|
# 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 /usr/local/etc/mavenrc ] ; then
|
||||||
|
. /usr/local/etc/mavenrc
|
||||||
|
fi
|
||||||
|
|
||||||
|
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
|
||||||
|
JAVA_HOME="$(/usr/libexec/java_home)"; export JAVA_HOME
|
||||||
|
else
|
||||||
|
JAVA_HOME="/Library/Java/Home"; export JAVA_HOME
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ -z "$JAVA_HOME" ] ; then
|
||||||
|
if [ -r /etc/gentoo-release ] ; then
|
||||||
|
JAVA_HOME=$(java-config --jre-home)
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# For Cygwin, ensure paths are in UNIX format before anything is touched
|
||||||
|
if $cygwin ; then
|
||||||
|
[ -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 "$JAVA_HOME" ] && [ -d "$JAVA_HOME" ] &&
|
||||||
|
JAVA_HOME="$(cd "$JAVA_HOME" || (echo "cannot cd into $JAVA_HOME."; exit 1); 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="$(\unset -f command 2>/dev/null; \command -v 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
|
||||||
|
|
||||||
|
# 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/.." || exit 1; pwd)
|
||||||
|
fi
|
||||||
|
# end of workaround
|
||||||
|
done
|
||||||
|
printf '%s' "$(cd "$basedir" || exit 1; pwd)"
|
||||||
|
}
|
||||||
|
|
||||||
|
# concatenates all lines of a file
|
||||||
|
concat_lines() {
|
||||||
|
if [ -f "$1" ]; then
|
||||||
|
# Remove \r in case we run on Windows within Git Bash
|
||||||
|
# and check out the repository with auto CRLF management
|
||||||
|
# enabled. Otherwise, we may read lines that are delimited with
|
||||||
|
# \r\n and produce $'-Xarg\r' rather than -Xarg due to word
|
||||||
|
# splitting rules.
|
||||||
|
tr -s '\r\n' ' ' < "$1"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
log() {
|
||||||
|
if [ "$MVNW_VERBOSE" = true ]; then
|
||||||
|
printf '%s\n' "$1"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
BASE_DIR=$(find_maven_basedir "$(dirname "$0")")
|
||||||
|
if [ -z "$BASE_DIR" ]; then
|
||||||
|
exit 1;
|
||||||
|
fi
|
||||||
|
|
||||||
|
MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}; export MAVEN_PROJECTBASEDIR
|
||||||
|
log "$MAVEN_PROJECTBASEDIR"
|
||||||
|
|
||||||
|
##########################################################################################
|
||||||
|
# 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.
|
||||||
|
##########################################################################################
|
||||||
|
wrapperJarPath="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar"
|
||||||
|
if [ -r "$wrapperJarPath" ]; then
|
||||||
|
log "Found $wrapperJarPath"
|
||||||
|
else
|
||||||
|
log "Couldn't find $wrapperJarPath, downloading it ..."
|
||||||
|
|
||||||
|
if [ -n "$MVNW_REPOURL" ]; then
|
||||||
|
wrapperUrl="$MVNW_REPOURL/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar"
|
||||||
|
else
|
||||||
|
wrapperUrl="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar"
|
||||||
|
fi
|
||||||
|
while IFS="=" read -r key value; do
|
||||||
|
# Remove '\r' from value to allow usage on windows as IFS does not consider '\r' as a separator ( considers space, tab, new line ('\n'), and custom '=' )
|
||||||
|
safeValue=$(echo "$value" | tr -d '\r')
|
||||||
|
case "$key" in (wrapperUrl) wrapperUrl="$safeValue"; break ;;
|
||||||
|
esac
|
||||||
|
done < "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.properties"
|
||||||
|
log "Downloading from: $wrapperUrl"
|
||||||
|
|
||||||
|
if $cygwin; then
|
||||||
|
wrapperJarPath=$(cygpath --path --windows "$wrapperJarPath")
|
||||||
|
fi
|
||||||
|
|
||||||
|
if command -v wget > /dev/null; then
|
||||||
|
log "Found wget ... using wget"
|
||||||
|
[ "$MVNW_VERBOSE" = true ] && QUIET="" || QUIET="--quiet"
|
||||||
|
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
|
||||||
|
wget $QUIET "$wrapperUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath"
|
||||||
|
else
|
||||||
|
wget $QUIET --http-user="$MVNW_USERNAME" --http-password="$MVNW_PASSWORD" "$wrapperUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath"
|
||||||
|
fi
|
||||||
|
elif command -v curl > /dev/null; then
|
||||||
|
log "Found curl ... using curl"
|
||||||
|
[ "$MVNW_VERBOSE" = true ] && QUIET="" || QUIET="--silent"
|
||||||
|
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
|
||||||
|
curl $QUIET -o "$wrapperJarPath" "$wrapperUrl" -f -L || rm -f "$wrapperJarPath"
|
||||||
|
else
|
||||||
|
curl $QUIET --user "$MVNW_USERNAME:$MVNW_PASSWORD" -o "$wrapperJarPath" "$wrapperUrl" -f -L || rm -f "$wrapperJarPath"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
log "Falling back to using Java to download"
|
||||||
|
javaSource="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/MavenWrapperDownloader.java"
|
||||||
|
javaClass="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/MavenWrapperDownloader.class"
|
||||||
|
# For Cygwin, switch paths to Windows format before running javac
|
||||||
|
if $cygwin; then
|
||||||
|
javaSource=$(cygpath --path --windows "$javaSource")
|
||||||
|
javaClass=$(cygpath --path --windows "$javaClass")
|
||||||
|
fi
|
||||||
|
if [ -e "$javaSource" ]; then
|
||||||
|
if [ ! -e "$javaClass" ]; then
|
||||||
|
log " - Compiling MavenWrapperDownloader.java ..."
|
||||||
|
("$JAVA_HOME/bin/javac" "$javaSource")
|
||||||
|
fi
|
||||||
|
if [ -e "$javaClass" ]; then
|
||||||
|
log " - Running MavenWrapperDownloader.java ..."
|
||||||
|
("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$wrapperUrl" "$wrapperJarPath") || rm -f "$wrapperJarPath"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
##########################################################################################
|
||||||
|
# End of extension
|
||||||
|
##########################################################################################
|
||||||
|
|
||||||
|
# If specified, validate the SHA-256 sum of the Maven wrapper jar file
|
||||||
|
wrapperSha256Sum=""
|
||||||
|
while IFS="=" read -r key value; do
|
||||||
|
case "$key" in (wrapperSha256Sum) wrapperSha256Sum=$value; break ;;
|
||||||
|
esac
|
||||||
|
done < "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.properties"
|
||||||
|
if [ -n "$wrapperSha256Sum" ]; then
|
||||||
|
wrapperSha256Result=false
|
||||||
|
if command -v sha256sum > /dev/null; then
|
||||||
|
if echo "$wrapperSha256Sum $wrapperJarPath" | sha256sum -c > /dev/null 2>&1; then
|
||||||
|
wrapperSha256Result=true
|
||||||
|
fi
|
||||||
|
elif command -v shasum > /dev/null; then
|
||||||
|
if echo "$wrapperSha256Sum $wrapperJarPath" | shasum -a 256 -c > /dev/null 2>&1; then
|
||||||
|
wrapperSha256Result=true
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "Checksum validation was requested but neither 'sha256sum' or 'shasum' are available."
|
||||||
|
echo "Please install either command, or disable validation by removing 'wrapperSha256Sum' from your maven-wrapper.properties."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if [ $wrapperSha256Result = false ]; then
|
||||||
|
echo "Error: Failed to validate Maven wrapper SHA-256, your Maven wrapper might be compromised." >&2
|
||||||
|
echo "Investigate or delete $wrapperJarPath to attempt a clean download." >&2
|
||||||
|
echo "If you updated your Maven version, you need to update the specified wrapperSha256Sum property." >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
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 "$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
|
||||||
|
|
||||||
|
# shellcheck disable=SC2086 # safe args
|
||||||
|
exec "$JAVACMD" \
|
||||||
|
$MAVEN_OPTS \
|
||||||
|
$MAVEN_DEBUG_OPTS \
|
||||||
|
-classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
|
||||||
|
"-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
|
||||||
|
${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"
|
||||||
|
|
@ -0,0 +1,205 @@
|
||||||
|
@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 Apache Maven Wrapper startup batch script, version 3.2.0
|
||||||
|
@REM
|
||||||
|
@REM Required ENV vars:
|
||||||
|
@REM JAVA_HOME - location of a JDK home dir
|
||||||
|
@REM
|
||||||
|
@REM Optional ENV vars
|
||||||
|
@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 keystroke 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 "%USERPROFILE%\mavenrc_pre.bat" call "%USERPROFILE%\mavenrc_pre.bat" %*
|
||||||
|
if exist "%USERPROFILE%\mavenrc_pre.cmd" call "%USERPROFILE%\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 WRAPPER_URL="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar"
|
||||||
|
|
||||||
|
FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
|
||||||
|
IF "%%A"=="wrapperUrl" SET WRAPPER_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 WRAPPER_URL="%MVNW_REPOURL%/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar"
|
||||||
|
)
|
||||||
|
if "%MVNW_VERBOSE%" == "true" (
|
||||||
|
echo Couldn't find %WRAPPER_JAR%, downloading it ...
|
||||||
|
echo Downloading from: %WRAPPER_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('%WRAPPER_URL%', '%WRAPPER_JAR%')"^
|
||||||
|
"}"
|
||||||
|
if "%MVNW_VERBOSE%" == "true" (
|
||||||
|
echo Finished downloading %WRAPPER_JAR%
|
||||||
|
)
|
||||||
|
)
|
||||||
|
@REM End of extension
|
||||||
|
|
||||||
|
@REM If specified, validate the SHA-256 sum of the Maven wrapper jar file
|
||||||
|
SET WRAPPER_SHA_256_SUM=""
|
||||||
|
FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
|
||||||
|
IF "%%A"=="wrapperSha256Sum" SET WRAPPER_SHA_256_SUM=%%B
|
||||||
|
)
|
||||||
|
IF NOT %WRAPPER_SHA_256_SUM%=="" (
|
||||||
|
powershell -Command "&{"^
|
||||||
|
"$hash = (Get-FileHash \"%WRAPPER_JAR%\" -Algorithm SHA256).Hash.ToLower();"^
|
||||||
|
"If('%WRAPPER_SHA_256_SUM%' -ne $hash){"^
|
||||||
|
" Write-Output 'Error: Failed to validate Maven wrapper SHA-256, your Maven wrapper might be compromised.';"^
|
||||||
|
" Write-Output 'Investigate or delete %WRAPPER_JAR% to attempt a clean download.';"^
|
||||||
|
" Write-Output 'If you updated your Maven version, you need to update the specified wrapperSha256Sum property.';"^
|
||||||
|
" exit 1;"^
|
||||||
|
"}"^
|
||||||
|
"}"
|
||||||
|
if ERRORLEVEL 1 goto error
|
||||||
|
)
|
||||||
|
|
||||||
|
@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 "%USERPROFILE%\mavenrc_post.bat" call "%USERPROFILE%\mavenrc_post.bat"
|
||||||
|
if exist "%USERPROFILE%\mavenrc_post.cmd" call "%USERPROFILE%\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%
|
||||||
|
|
||||||
|
cmd /C exit /B %ERROR_CODE%
|
||||||
|
|
@ -0,0 +1,198 @@
|
||||||
|
<?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>3.1.2</version>
|
||||||
|
<relativePath/> <!-- lookup parent from repository -->
|
||||||
|
</parent>
|
||||||
|
<groupId>kr.co.i4way</groupId>
|
||||||
|
<artifactId>i4way-genesys-service</artifactId>
|
||||||
|
<version>1.0</version>
|
||||||
|
<name>I4WAY-Genesys-service</name>
|
||||||
|
<description>i4way genesys service</description>
|
||||||
|
<properties>
|
||||||
|
<java.version>17</java.version>
|
||||||
|
</properties>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-batch</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-quartz</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-security</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-thymeleaf</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-web</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-web-services</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.mybatis.spring.boot</groupId>
|
||||||
|
<artifactId>mybatis-spring-boot-starter</artifactId>
|
||||||
|
<version>3.0.2</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.session</groupId>
|
||||||
|
<artifactId>spring-session-core</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.thymeleaf.extras</groupId>
|
||||||
|
<artifactId>thymeleaf-extras-springsecurity6</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Spring Boot Yml, Properties 암호화관련-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.ulisesbocchio</groupId>
|
||||||
|
<artifactId>jasypt-spring-boot-starter</artifactId>
|
||||||
|
<version>3.0.4</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- https://mvnrepository.com/artifact/com.google.code.gson/gson -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.google.code.gson</groupId>
|
||||||
|
<artifactId>gson</artifactId>
|
||||||
|
<version>2.10.1</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- https://mvnrepository.com/artifact/org.codehaus.jettison/jettison -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.codehaus.jettison</groupId>
|
||||||
|
<artifactId>jettison</artifactId>
|
||||||
|
<version>1.5.1</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- https://mvnrepository.com/artifact/org.springframework/spring-tx -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework</groupId>
|
||||||
|
<artifactId>spring-tx</artifactId>
|
||||||
|
<version>6.0.11</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- https://mvnrepository.com/artifact/commons-codec/commons-codec -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>commons-codec</groupId>
|
||||||
|
<artifactId>commons-codec</artifactId>
|
||||||
|
<version>1.16.0</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- https://mvnrepository.com/artifact/com.jcraft/jsch -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.jcraft</groupId>
|
||||||
|
<artifactId>jsch</artifactId>
|
||||||
|
<version>0.1.55</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- https://mvnrepository.com/artifact/commons-net/commons-net -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>commons-net</groupId>
|
||||||
|
<artifactId>commons-net</artifactId>
|
||||||
|
<version>3.9.0</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- https://mvnrepository.com/artifact/org.json/json -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.json</groupId>
|
||||||
|
<artifactId>json</artifactId>
|
||||||
|
<version>20230618</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- https://mvnrepository.com/artifact/net.minidev/json-smart -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>net.minidev</groupId>
|
||||||
|
<artifactId>json-smart</artifactId>
|
||||||
|
<version>2.4.7</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.microsoft.sqlserver</groupId>
|
||||||
|
<artifactId>mssql-jdbc</artifactId>
|
||||||
|
<scope>runtime</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.mysql</groupId>
|
||||||
|
<artifactId>mysql-connector-j</artifactId>
|
||||||
|
<scope>runtime</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.oracle.database.jdbc</groupId>
|
||||||
|
<artifactId>ojdbc8</artifactId>
|
||||||
|
<scope>runtime</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.mariadb.jdbc</groupId>
|
||||||
|
<artifactId>mariadb-java-client</artifactId>
|
||||||
|
<scope>runtime</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.postgresql</groupId>
|
||||||
|
<artifactId>postgresql</artifactId>
|
||||||
|
<scope>runtime</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.tmax.tibero</groupId>
|
||||||
|
<artifactId>tibero-jdbc</artifactId>
|
||||||
|
<version>6.0</version>
|
||||||
|
<scope>system</scope>
|
||||||
|
<systemPath>${basedir}/lib/tibero6-jdbc.jar</systemPath>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.projectlombok</groupId>
|
||||||
|
<artifactId>lombok</artifactId>
|
||||||
|
<optional>true</optional>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-test</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.mybatis.spring.boot</groupId>
|
||||||
|
<artifactId>mybatis-spring-boot-starter-test</artifactId>
|
||||||
|
<version>3.0.2</version>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.batch</groupId>
|
||||||
|
<artifactId>spring-batch-test</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.security</groupId>
|
||||||
|
<artifactId>spring-security-test</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<excludes>
|
||||||
|
<exclude>
|
||||||
|
<groupId>org.projectlombok</groupId>
|
||||||
|
<artifactId>lombok</artifactId>
|
||||||
|
</exclude>
|
||||||
|
</excludes>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
|
||||||
|
</project>
|
||||||
|
|
@ -0,0 +1,43 @@
|
||||||
|
/*
|
||||||
|
package kr.co.i4way;
|
||||||
|
|
||||||
|
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;
|
||||||
|
|
||||||
|
//외장Tomcat 사용시
|
||||||
|
@SpringBootApplication
|
||||||
|
//@EnableScheduling
|
||||||
|
public class I4way_Service extends SpringBootServletInitializer{
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
SpringApplication.run(I4way_Service.class, args);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
|
||||||
|
return builder.sources(I4way_Service.class);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* 내장Tomcat 사용시*/
|
||||||
|
package kr.co.i4way;
|
||||||
|
|
||||||
|
import org.springframework.boot.SpringApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||||
|
|
||||||
|
import com.ulisesbocchio.jasyptspringboot.annotation.EnableEncryptableProperties;
|
||||||
|
|
||||||
|
@SpringBootApplication
|
||||||
|
@EnableScheduling
|
||||||
|
@EnableEncryptableProperties
|
||||||
|
public class I4WayGenesysServiceApplication {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
SpringApplication.run(I4WayGenesysServiceApplication.class, args);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,54 @@
|
||||||
|
package kr.co.i4way.common;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Map.Entry;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
public class CommandMap {
|
||||||
|
Map<String,Object> map = new HashMap<String,Object>();
|
||||||
|
|
||||||
|
public Object get(String key){
|
||||||
|
return map.get(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void put(String key, Object value){
|
||||||
|
map.put(key, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Object remove(String key){
|
||||||
|
return map.remove(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean containsKey(String key){
|
||||||
|
return map.containsKey(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean containsValue(Object value){
|
||||||
|
return map.containsValue(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void clear(){
|
||||||
|
map.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
public Set<Entry<String, Object>> entrySet(){
|
||||||
|
return map.entrySet();
|
||||||
|
}
|
||||||
|
|
||||||
|
public Set<String> keySet(){
|
||||||
|
return map.keySet();
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isEmpty(){
|
||||||
|
return map.isEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void putAll(Map<? extends String, ?extends Object> m){
|
||||||
|
map.putAll(m);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Map<String,Object> getMap(){
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,74 @@
|
||||||
|
package kr.co.i4way.common.util;
|
||||||
|
|
||||||
|
import java.lang.reflect.Field;
|
||||||
|
import javax.crypto.Cipher;
|
||||||
|
import javax.crypto.SecretKey;
|
||||||
|
import javax.crypto.spec.IvParameterSpec;
|
||||||
|
import javax.crypto.spec.SecretKeySpec;
|
||||||
|
import org.apache.commons.codec.binary.Base64;
|
||||||
|
|
||||||
|
public class CipherAES {
|
||||||
|
static String AES_CBC_PKCS5Padding = "AES/CBC/PKCS5Padding";
|
||||||
|
|
||||||
|
static String MONITOR_KEY_VALUE = "BLUEQsiteUSE#MNS";
|
||||||
|
static String MONITOR_IV_VALUE = "SmartLOGIN201407";
|
||||||
|
|
||||||
|
private static String getKeyIvValue(String staticValue) throws Exception {
|
||||||
|
Class cipherAes = CipherAES.class;
|
||||||
|
Field cipherAesFields[] = cipherAes.getDeclaredFields();
|
||||||
|
|
||||||
|
String keyIvValue = "";
|
||||||
|
for (int i = 0; i < cipherAesFields.length; i++) {
|
||||||
|
if (staticValue.equals(cipherAesFields[i].getName())) {
|
||||||
|
keyIvValue = (String) cipherAesFields[i].get(cipherAes);
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return keyIvValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Key 생성
|
||||||
|
public static SecretKey generateKey(String keyValue) throws Exception {
|
||||||
|
return new SecretKeySpec(keyValue.getBytes("UTF-8"), "AES");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 복호화(String Decode)
|
||||||
|
public static String decrypt(String keyScn, String param) throws Exception {
|
||||||
|
System.out.println("keyScn==>"+keyScn);
|
||||||
|
System.out.println("param==>"+param);
|
||||||
|
return decrypt(AES_CBC_PKCS5Padding, param, getKeyIvValue(keyScn + "_KEY_VALUE"),
|
||||||
|
getKeyIvValue(keyScn + "_IV_VALUE"), "string");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 복호화
|
||||||
|
public static String decrypt(String transType, String srcData, String keyValue, String ivValue, String encodeType)
|
||||||
|
throws Exception {
|
||||||
|
String result = "";
|
||||||
|
byte[] decData = null;
|
||||||
|
|
||||||
|
try {
|
||||||
|
SecretKey key = generateKey(keyValue);
|
||||||
|
|
||||||
|
Cipher cipher = Cipher.getInstance(transType);
|
||||||
|
|
||||||
|
if (transType.equals(AES_CBC_PKCS5Padding)) {
|
||||||
|
if (null != ivValue && ivValue.length() > 0) {
|
||||||
|
cipher.init(Cipher.DECRYPT_MODE, key, new IvParameterSpec(ivValue.getBytes()));
|
||||||
|
} else {
|
||||||
|
cipher.init(Cipher.DECRYPT_MODE, key, new IvParameterSpec(new byte[16]));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
cipher.init(Cipher.DECRYPT_MODE, key);
|
||||||
|
}
|
||||||
|
|
||||||
|
decData = cipher.doFinal(Base64.decodeBase64(srcData));
|
||||||
|
|
||||||
|
result = new String(decData);
|
||||||
|
} catch (Exception e) {
|
||||||
|
result = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,212 @@
|
||||||
|
package kr.co.i4way.common.util;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.core.JsonParseException;
|
||||||
|
import com.fasterxml.jackson.databind.JsonMappingException;
|
||||||
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
|
||||||
|
import kr.co.i4way.util.AES256;
|
||||||
|
import net.minidev.json.JSONArray;
|
||||||
|
import net.minidev.json.JSONObject;
|
||||||
|
import net.minidev.json.parser.JSONParser;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 일반문자열 유틸.
|
||||||
|
*
|
||||||
|
* @author someone
|
||||||
|
* @version 1.0.0
|
||||||
|
*/
|
||||||
|
public class JsonUtil {
|
||||||
|
|
||||||
|
@Value("${ccc-service.enc-iv}")
|
||||||
|
private String enc_iv;
|
||||||
|
|
||||||
|
@Value("${ccc-service.enc-key}")
|
||||||
|
private String enc_key;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Map을 json으로 변환한다.
|
||||||
|
*
|
||||||
|
* @param map Map<String, Object>.
|
||||||
|
* @return JSONObject.
|
||||||
|
*/
|
||||||
|
public static JSONObject getJsonStringFromMap( Map<String, Object> map )
|
||||||
|
{
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
for( Map.Entry<String, Object> entry : map.entrySet() ) {
|
||||||
|
String key = entry.getKey();
|
||||||
|
Object value = entry.getValue();
|
||||||
|
jsonObject.put(key, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
return jsonObject;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* List<Map>을 jsonArray로 변환한다.
|
||||||
|
*
|
||||||
|
* @param list List<Map<String, Object>>.
|
||||||
|
* @return JSONArray.
|
||||||
|
*/
|
||||||
|
public static JSONArray getJsonArrayFromList( List<Map<String, Object>> list )
|
||||||
|
{
|
||||||
|
JSONArray jsonArray = new JSONArray();
|
||||||
|
for( Map<String, Object> map : list ) {
|
||||||
|
jsonArray.add( getJsonStringFromMap( map ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
return jsonArray;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* List<Map>을 jsonString으로 변환한다.
|
||||||
|
*
|
||||||
|
* @param list List<Map<String, Object>>.
|
||||||
|
* @return String.
|
||||||
|
*/
|
||||||
|
public static String getJsonStringFromList( List<Map<String, Object>> list )
|
||||||
|
{
|
||||||
|
JSONArray jsonArray = getJsonArrayFromList( list );
|
||||||
|
return jsonArray.toJSONString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* JsonObject를 Map<String, String>으로 변환한다.
|
||||||
|
*
|
||||||
|
* @param jsonObj JSONObject.
|
||||||
|
* @return Map<String, Object>.
|
||||||
|
*/
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
public static Map<String, Object> getMapFromJsonObject( JSONObject jsonObj )
|
||||||
|
{
|
||||||
|
Map<String, Object> map = null;
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
|
map = new ObjectMapper().readValue(jsonObj.toJSONString(), Map.class) ;
|
||||||
|
|
||||||
|
} catch (JsonParseException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
} catch (JsonMappingException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* JsonArray를 List<Map<String, String>>으로 변환한다.
|
||||||
|
*
|
||||||
|
* @param jsonArray JSONArray.
|
||||||
|
* @return List<Map<String, Object>>.
|
||||||
|
*/
|
||||||
|
public static List<Map<String, Object>> getListMapFromJsonArray( JSONArray jsonArray )
|
||||||
|
{
|
||||||
|
List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
|
||||||
|
|
||||||
|
if( jsonArray != null )
|
||||||
|
{
|
||||||
|
int jsonSize = jsonArray.size();
|
||||||
|
for( int i = 0; i < jsonSize; i++ )
|
||||||
|
{
|
||||||
|
Map<String, Object> map = JsonUtil.getMapFromJsonObject( ( JSONObject ) jsonArray.get(i) );
|
||||||
|
list.add( map );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static Map<String, Object> decrypt_param(Map<String, Object> param, String enc_key, String enc_iv, String enc_yn){
|
||||||
|
Map<String, Object> rtn_param = null;
|
||||||
|
String decData;
|
||||||
|
try {
|
||||||
|
if(enc_yn.equals("Yes")) {
|
||||||
|
String encData = getParam(param, "encData", "S");
|
||||||
|
decData = AES256.decrypt(encData, enc_key, enc_iv);
|
||||||
|
JSONParser parser = new JSONParser(JSONParser.DEFAULT_PERMISSIVE_MODE);
|
||||||
|
JSONObject json = (JSONObject) parser.parse(decData);
|
||||||
|
rtn_param = JsonUtil.getMapFromJsonObject(json);
|
||||||
|
}else {
|
||||||
|
rtn_param = param;
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return rtn_param;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String decrypt_param3(String param, String enc_key, String enc_iv, String enc_yn){
|
||||||
|
String rtnjson = null;
|
||||||
|
String decData;
|
||||||
|
try {
|
||||||
|
if(enc_yn.equals("Yes")) {
|
||||||
|
String encData = param;
|
||||||
|
decData = AES256.decrypt(encData, enc_key, enc_iv);
|
||||||
|
JSONParser parser = new JSONParser(JSONParser.DEFAULT_PERMISSIVE_MODE);
|
||||||
|
rtnjson = (String) parser.parse(decData);
|
||||||
|
System.out.println(rtnjson);
|
||||||
|
}else {
|
||||||
|
rtnjson = param;
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return rtnjson;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static JSONObject decrypt_param2(Map<String, Object> param, String enc_key, String enc_iv, String enc_yn){
|
||||||
|
JSONObject rtnjson = null;
|
||||||
|
String decData;
|
||||||
|
try {
|
||||||
|
if(enc_yn.equals("Yes")) {
|
||||||
|
String encData = getParam(param, "encData", "S");
|
||||||
|
decData = AES256.decrypt(encData, enc_key, enc_iv);
|
||||||
|
JSONParser parser = new JSONParser(JSONParser.DEFAULT_PERMISSIVE_MODE);
|
||||||
|
rtnjson = (JSONObject) parser.parse(decData);
|
||||||
|
}else {
|
||||||
|
rtnjson = getJsonStringFromMap(param);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return rtnjson;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static JSONObject encrypt_param(JSONObject obj, String enc_key, String enc_iv, String enc_yn){
|
||||||
|
JSONObject encobj = new JSONObject();
|
||||||
|
try {
|
||||||
|
if(enc_yn.equals("Yes")) {
|
||||||
|
encobj.put("encData", AES256.encrypt(obj.toString(), enc_key, enc_iv));
|
||||||
|
}else {
|
||||||
|
encobj = obj;
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return encobj;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static String getParam(Map<String, Object> param, String qryStr, String type){
|
||||||
|
String rtnstr = "";
|
||||||
|
if(type.equals("I")){
|
||||||
|
rtnstr = "0";
|
||||||
|
}
|
||||||
|
try{
|
||||||
|
rtnstr = param.get(qryStr).toString();
|
||||||
|
}catch(Exception e){
|
||||||
|
//rtnstr = "";
|
||||||
|
}
|
||||||
|
return rtnstr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,50 @@
|
||||||
|
package kr.co.i4way.config;
|
||||||
|
|
||||||
|
import com.ulisesbocchio.jasyptspringboot.annotation.EnableEncryptableProperties;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.jasypt.encryption.StringEncryptor;
|
||||||
|
import org.jasypt.encryption.pbe.PooledPBEStringEncryptor;
|
||||||
|
import org.jasypt.encryption.pbe.StandardPBEStringEncryptor;
|
||||||
|
import org.jasypt.encryption.pbe.config.SimpleStringPBEConfig;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@EnableEncryptableProperties
|
||||||
|
@Configuration
|
||||||
|
public class JasyptConfig {
|
||||||
|
|
||||||
|
public static final String JASYPT_STRING_ENCRYPTOR = "jasyptStringEncryptor";
|
||||||
|
|
||||||
|
/*
|
||||||
|
복호화 키값(jasypt.encryptor.password)는
|
||||||
|
Application 실행 시 외부 Environment 를 통해 주입 받는다.
|
||||||
|
|
||||||
|
# JAR 예
|
||||||
|
-Djasypt.encryptor.password=enc_password
|
||||||
|
*/
|
||||||
|
@Value("${jasypt.encryptor.password}")
|
||||||
|
private String encryptKey;
|
||||||
|
|
||||||
|
@Bean(name = "jasyptStringEncryptor")
|
||||||
|
public StringEncryptor stringEncryptor() {
|
||||||
|
//StandardPBEStringEncryptor encryptor = new StandardPBEStringEncryptor();
|
||||||
|
PooledPBEStringEncryptor encryptor = new PooledPBEStringEncryptor();
|
||||||
|
SimpleStringPBEConfig config = new SimpleStringPBEConfig();
|
||||||
|
log.info("encryptKey==>" + encryptKey);
|
||||||
|
config.setPassword(encryptKey);
|
||||||
|
config.setAlgorithm("PBEWithMD5AndDES");
|
||||||
|
config.setKeyObtentionIterations("1000");
|
||||||
|
config.setPoolSize("1");
|
||||||
|
config.setProviderName("SunJCE");
|
||||||
|
config.setSaltGeneratorClassName("org.jasypt.salt.RandomSaltGenerator");
|
||||||
|
config.setStringOutputType("base64");
|
||||||
|
encryptor.setConfig(config);
|
||||||
|
|
||||||
|
log.info("Jasypt Config Completed.");
|
||||||
|
|
||||||
|
return encryptor;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,45 @@
|
||||||
|
package kr.co.i4way.config;
|
||||||
|
|
||||||
|
import javax.sql.DataSource;
|
||||||
|
|
||||||
|
import org.apache.ibatis.session.SqlSession;
|
||||||
|
import org.apache.ibatis.session.SqlSessionFactory;
|
||||||
|
import org.mybatis.spring.SqlSessionFactoryBean;
|
||||||
|
import org.mybatis.spring.SqlSessionTemplate;
|
||||||
|
import org.mybatis.spring.annotation.MapperScan;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
|
import org.springframework.boot.jdbc.DataSourceBuilder;
|
||||||
|
import org.springframework.context.ApplicationContext;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.context.annotation.Primary;
|
||||||
|
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
|
||||||
|
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||||
|
//@Configuration
|
||||||
|
//@MapperScan(value = "kr.co.i4way.mapper.mssql_brd", sqlSessionFactoryRef = "mssqlBrdSqlSessionFactory")
|
||||||
|
//@EnableTransactionManagement
|
||||||
|
public class MssqlBrdDataBaseConfig {
|
||||||
|
|
||||||
|
// @Bean(name = "mssqlBrdDataSource")
|
||||||
|
// @ConfigurationProperties(prefix = "spring.datasource.mssql-brd")
|
||||||
|
// public DataSource mssqlDataSource() {
|
||||||
|
// return DataSourceBuilder.create().build();
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Bean(name = "mssqlBrdSqlSessionFactory")
|
||||||
|
// public SqlSessionFactory mssqlSqlSessionFactory(@Autowired @Qualifier("mssqlBrdDataSource") DataSource mssqlDataSource) throws Exception {
|
||||||
|
// SqlSessionFactoryBean sqlSessionFactory = new SqlSessionFactoryBean();
|
||||||
|
// sqlSessionFactory.setDataSource(mssqlDataSource);
|
||||||
|
// sqlSessionFactory.setConfigLocation(new PathMatchingResourcePatternResolver().getResource("classpath:mybatis-config.xml"));
|
||||||
|
// sqlSessionFactory.setMapperLocations(new PathMatchingResourcePatternResolver().getResources("classpath:kr/co/i4way/mybatis/mssql_brd/*.xml"));
|
||||||
|
// return sqlSessionFactory.getObject();
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Bean(name = "mssqlBrdSqlSession")
|
||||||
|
// public SqlSession sqlSession(SqlSessionFactory sqlSessionFactory) {
|
||||||
|
// return new SqlSessionTemplate(sqlSessionFactory);
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,48 @@
|
||||||
|
package kr.co.i4way.config;
|
||||||
|
|
||||||
|
import javax.sql.DataSource;
|
||||||
|
|
||||||
|
import org.apache.ibatis.session.SqlSession;
|
||||||
|
import org.apache.ibatis.session.SqlSessionFactory;
|
||||||
|
import org.mybatis.spring.SqlSessionFactoryBean;
|
||||||
|
import org.mybatis.spring.SqlSessionTemplate;
|
||||||
|
import org.mybatis.spring.annotation.MapperScan;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
|
import org.springframework.boot.jdbc.DataSourceBuilder;
|
||||||
|
import org.springframework.context.ApplicationContext;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.context.annotation.Primary;
|
||||||
|
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
|
||||||
|
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||||
|
@Configuration
|
||||||
|
@MapperScan(value = "kr.co.i4way.mapper.mssql", sqlSessionFactoryRef = "mssqlSqlSessionFactory")
|
||||||
|
@EnableTransactionManagement
|
||||||
|
public class MssqlDataBaseConfig {
|
||||||
|
|
||||||
|
@Primary
|
||||||
|
@Bean(name = "mssqlDataSource")
|
||||||
|
@ConfigurationProperties(prefix = "spring.datasource.mssql")
|
||||||
|
public DataSource mssqlDataSource() {
|
||||||
|
return DataSourceBuilder.create().build();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Primary
|
||||||
|
@Bean(name = "mssqlSqlSessionFactory")
|
||||||
|
public SqlSessionFactory mssqlSqlSessionFactory(@Autowired @Qualifier("mssqlDataSource") DataSource mssqlDataSource) throws Exception {
|
||||||
|
SqlSessionFactoryBean sqlSessionFactory = new SqlSessionFactoryBean();
|
||||||
|
sqlSessionFactory.setDataSource(mssqlDataSource);
|
||||||
|
sqlSessionFactory.setConfigLocation(new PathMatchingResourcePatternResolver().getResource("classpath:mybatis-config.xml"));
|
||||||
|
sqlSessionFactory.setMapperLocations(new PathMatchingResourcePatternResolver().getResources("classpath:kr/co/i4way/mybatis/mssql/*.xml"));
|
||||||
|
return sqlSessionFactory.getObject();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Primary
|
||||||
|
@Bean(name = "mssqlSqlSession")
|
||||||
|
public SqlSession sqlSession(SqlSessionFactory sqlSessionFactory) {
|
||||||
|
return new SqlSessionTemplate(sqlSessionFactory);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,47 @@
|
||||||
|
package kr.co.i4way.config;
|
||||||
|
|
||||||
|
import javax.sql.DataSource;
|
||||||
|
|
||||||
|
import org.apache.ibatis.session.SqlSession;
|
||||||
|
import org.apache.ibatis.session.SqlSessionFactory;
|
||||||
|
import org.mybatis.spring.SqlSessionFactoryBean;
|
||||||
|
import org.mybatis.spring.SqlSessionTemplate;
|
||||||
|
import org.mybatis.spring.annotation.MapperScan;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
|
import org.springframework.boot.jdbc.DataSourceBuilder;
|
||||||
|
import org.springframework.context.ApplicationContext;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.context.annotation.Primary;
|
||||||
|
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
|
||||||
|
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||||
|
//@Configuration
|
||||||
|
//@MapperScan(value = "kr.co.i4way.mapper.tibero", sqlSessionFactoryRef = "tiberoSqlSessionFactory")
|
||||||
|
//@EnableTransactionManagement
|
||||||
|
public class TiberoDataBaseConfig {
|
||||||
|
|
||||||
|
// @Primary
|
||||||
|
// @Bean(name = "tiberoDataSource")
|
||||||
|
// @ConfigurationProperties(prefix = "spring.datasource.tibero")
|
||||||
|
// public DataSource tiberoDataSource() {
|
||||||
|
// return DataSourceBuilder.create().build();
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Primary
|
||||||
|
// @Bean(name = "tiberoSqlSessionFactory")
|
||||||
|
// public SqlSessionFactory tiberoSqlSessionFactory(DataSource tiberoDataSource) throws Exception {
|
||||||
|
// SqlSessionFactoryBean sqlSessionFactory = new SqlSessionFactoryBean();
|
||||||
|
// sqlSessionFactory.setDataSource(tiberoDataSource);
|
||||||
|
// sqlSessionFactory.setConfigLocation(new PathMatchingResourcePatternResolver().getResource("classpath:mybatis-config.xml"));
|
||||||
|
// sqlSessionFactory.setMapperLocations(new PathMatchingResourcePatternResolver().getResources("classpath:kr/co/i4way/mybatis/tibero/*.xml"));
|
||||||
|
// return sqlSessionFactory.getObject();
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Primary
|
||||||
|
// @Bean(name = "tiberoSqlSession")
|
||||||
|
// public SqlSession sqlSession(@Qualifier("tiberoSqlSessionFactory") SqlSessionFactory sqlSessionFactory) {
|
||||||
|
// return new SqlSessionTemplate(sqlSessionFactory);
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,330 @@
|
||||||
|
package kr.co.i4way.cst.controller;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.scheduling.annotation.Scheduled;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.web.client.RestTemplate;
|
||||||
|
import org.codehaus.jettison.json.JSONException;
|
||||||
|
import org.codehaus.jettison.json.JSONObject;
|
||||||
|
import org.springframework.http.HttpEntity;
|
||||||
|
import org.springframework.http.HttpMethod;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.web.client.HttpStatusCodeException;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.core.JsonParseException;
|
||||||
|
import com.fasterxml.jackson.databind.JsonMappingException;
|
||||||
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
import com.google.gson.JsonArray;
|
||||||
|
import com.google.gson.JsonElement;
|
||||||
|
import com.google.gson.JsonObject;
|
||||||
|
import com.google.gson.JsonParser;
|
||||||
|
|
||||||
|
import kr.co.i4way.util.JsonUtil;
|
||||||
|
import kr.co.i4way.cst.model.RecLicenseVo;
|
||||||
|
import kr.co.i4way.cst.service.CstScheduleService;
|
||||||
|
import kr.co.i4way.util.HttpUtil;
|
||||||
|
import net.minidev.json.JSONArray;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Skill용 Controller
|
||||||
|
* @author jkhong
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
public class CstScheduleController {
|
||||||
|
|
||||||
|
@Value("${ccc-service.enc-iv}")
|
||||||
|
private String enc_iv;
|
||||||
|
|
||||||
|
@Value("${ccc-service.enc-key}")
|
||||||
|
private String enc_key;
|
||||||
|
|
||||||
|
@Value("${ccc-service.user-service-url}")
|
||||||
|
private String user_service_url;
|
||||||
|
|
||||||
|
@Value("${ccc-service.org-service-url}")
|
||||||
|
private String org_service_url;
|
||||||
|
|
||||||
|
@Value("${rec-service.license-url}")
|
||||||
|
private String rec_license_url;
|
||||||
|
|
||||||
|
@Value("${boardinfo.server_type}")
|
||||||
|
private String server_type;
|
||||||
|
|
||||||
|
private final Logger logger = LoggerFactory.getLogger(this.getClass().getSimpleName());
|
||||||
|
@Autowired(required=true)
|
||||||
|
private CstScheduleService service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 상담사 정보 적재
|
||||||
|
* 공통의 상담사 정보를 Select해서 MSSQL에 Insert
|
||||||
|
*/
|
||||||
|
@Scheduled(cron="${ccc-service.cron.user-service}")
|
||||||
|
public void AgentInfo(){
|
||||||
|
// rest template 선언
|
||||||
|
RestTemplate restTemplate = new RestTemplate();
|
||||||
|
int insert_count = 0;
|
||||||
|
|
||||||
|
// 전송 parameter 정의
|
||||||
|
Map<String, Object> mapParam = new HashMap<String, Object>();
|
||||||
|
|
||||||
|
// 수정일시 전달
|
||||||
|
mapParam.put("changeDatetime", getToday());
|
||||||
|
|
||||||
|
HttpEntity<Map<String, Object>> requestEntity = new HttpEntity<>(mapParam);
|
||||||
|
try {
|
||||||
|
// 서버에서 데이터를 수신한다.
|
||||||
|
ResponseEntity<Map> response = restTemplate.exchange (user_service_url + getToday(), HttpMethod.GET, requestEntity, Map.class);
|
||||||
|
|
||||||
|
Map output = response.getBody();
|
||||||
|
List<Map<String, Object>> data = (List) output.get("result");
|
||||||
|
|
||||||
|
// 정상의 경우 처리 ...
|
||||||
|
logger.info("read Agent Count => " + data.size());
|
||||||
|
|
||||||
|
List<Map<String, Object>> tmpData = new ArrayList<Map<String, Object>>();
|
||||||
|
|
||||||
|
for(int i=0; i < data.size(); i++ ) {
|
||||||
|
tmpData.add(insert_count, data.get(i));
|
||||||
|
if(insert_count > 80 || data.size() == i+1) {
|
||||||
|
service.insertCCCUser(tmpData);
|
||||||
|
insert_count = 0;
|
||||||
|
tmpData.clear();
|
||||||
|
}else {
|
||||||
|
insert_count++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}catch(HttpStatusCodeException e) {
|
||||||
|
|
||||||
|
// validation exception이 발생한 경우 처리
|
||||||
|
if( e.getStatusCode() == HttpStatus.UNPROCESSABLE_ENTITY) {
|
||||||
|
// 오류발생 시 처리
|
||||||
|
try {
|
||||||
|
|
||||||
|
// output으로 전달된 결과는 json으로 치환가능
|
||||||
|
JSONObject jsonMessage = new JSONObject(e.getResponseBodyAsString());
|
||||||
|
|
||||||
|
logger.info( jsonMessage.toString() ); // VALIDATION
|
||||||
|
logger.info( jsonMessage.getString("type") ); // VALIDATION
|
||||||
|
logger.info( jsonMessage.getString("code") ); // -1
|
||||||
|
logger.info( jsonMessage.getString("message") ); // exception message
|
||||||
|
logger.info( jsonMessage.getString("trace") ); // null {optional}
|
||||||
|
logger.info( jsonMessage.getString("error") ); // false {optional}
|
||||||
|
|
||||||
|
} catch (JSONException e1) {
|
||||||
|
throw new RuntimeException (e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 일반 오류가 발생한 경우 처리
|
||||||
|
else {
|
||||||
|
e.printStackTrace();
|
||||||
|
throw new RuntimeException (e);
|
||||||
|
}
|
||||||
|
|
||||||
|
}catch(Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
throw new RuntimeException (e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 조직 정보 적재
|
||||||
|
* 공통의 조직 정보를 Select해서 MSSQL에 Insert
|
||||||
|
*/
|
||||||
|
@Scheduled(cron="${ccc-service.cron.org-service}")
|
||||||
|
public void OrgInfo(){
|
||||||
|
// rest template 선언
|
||||||
|
RestTemplate restTemplate = new RestTemplate();
|
||||||
|
int insert_count = 0;
|
||||||
|
|
||||||
|
// 전송 parameter 정의
|
||||||
|
Map<String, Object> mapParam = new HashMap<String, Object>();
|
||||||
|
|
||||||
|
// 수정일시 전달
|
||||||
|
mapParam.put("changeDatetime", getToday());
|
||||||
|
|
||||||
|
HttpEntity<Map<String, Object>> requestEntity = new HttpEntity<>(mapParam);
|
||||||
|
try {
|
||||||
|
// 서버에서 데이터를 수신한다.
|
||||||
|
//ResponseEntity<Map> response = restTemplate.exchange (org_service_url + getToday(), HttpMethod.GET, requestEntity, Map.class);
|
||||||
|
ResponseEntity<Map> response = restTemplate.exchange (org_service_url, HttpMethod.GET, requestEntity, Map.class);
|
||||||
|
|
||||||
|
Map output = response.getBody();
|
||||||
|
List<Map<String, Object>> data = (List) output.get("result");
|
||||||
|
|
||||||
|
// 정상의 경우 처리 ...
|
||||||
|
logger.info("read Org Count => " + data.size());
|
||||||
|
|
||||||
|
List<Map<String, Object>> tmpData = new ArrayList<Map<String, Object>>();
|
||||||
|
|
||||||
|
for(int i=0; i < data.size(); i++ ) {
|
||||||
|
tmpData.add(insert_count, data.get(i));
|
||||||
|
if(insert_count > 80 || data.size() == i+1) {
|
||||||
|
service.insertCCCGroup(data);
|
||||||
|
insert_count = 0;
|
||||||
|
tmpData.clear();
|
||||||
|
}else {
|
||||||
|
insert_count++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}catch(HttpStatusCodeException e) {
|
||||||
|
|
||||||
|
// validation exception이 발생한 경우 처리
|
||||||
|
if( e.getStatusCode() == HttpStatus.UNPROCESSABLE_ENTITY) {
|
||||||
|
// 오류발생 시 처리
|
||||||
|
try {
|
||||||
|
|
||||||
|
// output으로 전달된 결과는 json으로 치환가능
|
||||||
|
JSONObject jsonMessage = new JSONObject(e.getResponseBodyAsString());
|
||||||
|
|
||||||
|
logger.info( jsonMessage.toString() ); // VALIDATION
|
||||||
|
logger.info( jsonMessage.getString("type") ); // VALIDATION
|
||||||
|
logger.info( jsonMessage.getString("code") ); // -1
|
||||||
|
logger.info( jsonMessage.getString("message") ); // exception message
|
||||||
|
logger.info( jsonMessage.getString("trace") ); // null {optional}
|
||||||
|
logger.info( jsonMessage.getString("error") ); // false {optional}
|
||||||
|
|
||||||
|
} catch (JSONException e1) {
|
||||||
|
throw new RuntimeException (e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 일반 오류가 발생한 경우 처리
|
||||||
|
else {
|
||||||
|
e.printStackTrace();
|
||||||
|
throw new RuntimeException (e);
|
||||||
|
}
|
||||||
|
|
||||||
|
}catch(Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
throw new RuntimeException (e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// @Scheduled(cron="${genesysinfo.cron.license-service}")
|
||||||
|
// //@Scheduled(cron="0 * * * * *")
|
||||||
|
// public void genesysLicenseCount(){
|
||||||
|
// RecLicenseVo vo = new RecLicenseVo();
|
||||||
|
//
|
||||||
|
// try {
|
||||||
|
// ArrayList dncnt = null;
|
||||||
|
// if(server_type.equals("prod")) {
|
||||||
|
// dncnt = service.getDnCnt();
|
||||||
|
// }else {
|
||||||
|
// dncnt = service.getDnCnt_Dev();
|
||||||
|
// }
|
||||||
|
// if(dncnt != null) {
|
||||||
|
// HashMap<String,Integer> map1 = (HashMap<String,Integer>) dncnt.get(0);
|
||||||
|
// vo.setUsed_cnt(map1.get("CNT_DN"));
|
||||||
|
// }
|
||||||
|
// if(vo.getUsed_cnt() > 0) {
|
||||||
|
// vo.setLicense_cnt(vo.getUsed_cnt() + (int)(vo.getUsed_cnt() * 0.1));
|
||||||
|
// }
|
||||||
|
// vo.setSolution_type("CTI");
|
||||||
|
// vo.setServer_id("1");
|
||||||
|
//
|
||||||
|
// service.setGenesysLicenseInfo(vo);
|
||||||
|
// logger.info("genesysLicenseCount Success");
|
||||||
|
// } catch (Exception e) {
|
||||||
|
// logger.error("error : ", e);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
public static JsonObject convertMapToJson(Map<String, Object> map) {
|
||||||
|
|
||||||
|
JsonObject json = new JsonObject();
|
||||||
|
String key = "";
|
||||||
|
Object value = null;
|
||||||
|
for(Map.Entry<String, Object> entry : map.entrySet()) {
|
||||||
|
key = entry.getKey();
|
||||||
|
value = entry.getValue();
|
||||||
|
json.add(key, (JsonElement) value);
|
||||||
|
}
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Map<String, Object> getMapFromJsonObject(JsonObject jsonObj){
|
||||||
|
Map<String, Object> map = null;
|
||||||
|
|
||||||
|
try {
|
||||||
|
map = new ObjectMapper().readValue(jsonObj.toString(), Map.class);
|
||||||
|
} catch (JsonParseException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
} catch (JsonMappingException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String getParam(Map<String, Object> param, String qryStr, String type){
|
||||||
|
String rtnstr = "";
|
||||||
|
if(type.equals("I")){
|
||||||
|
rtnstr = "0";
|
||||||
|
}
|
||||||
|
try{
|
||||||
|
rtnstr = param.get(qryStr).toString();
|
||||||
|
}catch(Exception e){
|
||||||
|
logger.error("error : ", e);
|
||||||
|
}
|
||||||
|
return rtnstr;
|
||||||
|
}
|
||||||
|
|
||||||
|
// @Scheduled(cron="${rec-service.cron.license-service}")
|
||||||
|
// //@Scheduled(cron="30 0,10,20,30,40,50 * * * *")
|
||||||
|
// public void recLicenseCount(){
|
||||||
|
// RecLicenseVo vo = new RecLicenseVo();
|
||||||
|
// JsonParser jparser = new JsonParser();
|
||||||
|
// List<RecLicenseVo> licenseList = new ArrayList<RecLicenseVo>();
|
||||||
|
// JsonObject rtnobj = null;
|
||||||
|
// logger.info("recLicenseCount Start");
|
||||||
|
// try {
|
||||||
|
// rtnobj = HttpUtil.callApi_type_normal(rec_license_url,"GET"); //녹취 라이선스 사용 현황 조회
|
||||||
|
// net.minidev.json.JSONObject param = JsonUtil.decrypt_param2(getMapFromJsonObject(rtnobj), enc_key, enc_iv, "Yes");
|
||||||
|
// logger.info("param=" + param.toJSONString());
|
||||||
|
// //JsonElement server_list = jparser.parse(getParam(param, "license_list", "S"));
|
||||||
|
// JSONArray arr = (JSONArray) param.get("license_list");
|
||||||
|
//
|
||||||
|
// for (Object server : arr) {
|
||||||
|
// net.minidev.json.JSONObject JsonObject = (net.minidev.json.JSONObject)server;
|
||||||
|
// vo.setSolution_type("REC");
|
||||||
|
// vo.setServer_id("1");
|
||||||
|
// vo.setServer_type("REC");
|
||||||
|
// vo.setServer_type_name("레코더");
|
||||||
|
// vo.setLicense_cnt((int)JsonObject.getAsNumber("license_cnt"));
|
||||||
|
// vo.setUsed_cnt((int)JsonObject.getAsNumber("used_cnt"));
|
||||||
|
// licenseList.add(vo);
|
||||||
|
// }
|
||||||
|
// if(licenseList.size() > 0) {
|
||||||
|
// service.setRecLicenseInfo(licenseList);
|
||||||
|
// }
|
||||||
|
// logger.info("recLicenseCount Success");
|
||||||
|
// } catch (Exception e) {
|
||||||
|
// logger.error("error : ", e);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
private String getToday() {
|
||||||
|
|
||||||
|
Date nowDate = new Date();
|
||||||
|
|
||||||
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMdd");
|
||||||
|
String strNowDate = simpleDateFormat.format(nowDate);
|
||||||
|
return strNowDate;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,56 @@
|
||||||
|
package kr.co.i4way.cst.model;
|
||||||
|
|
||||||
|
public class AgentInfoVo {
|
||||||
|
private String user_id;
|
||||||
|
private String etcp_ymd;
|
||||||
|
private String cti_use_yn;
|
||||||
|
private String cti_id;
|
||||||
|
private String rgst_dt;
|
||||||
|
private String mdfy_dt;
|
||||||
|
private String modify_diff;
|
||||||
|
|
||||||
|
public String getUser_id() {
|
||||||
|
return user_id;
|
||||||
|
}
|
||||||
|
public void setUser_id(String user_id) {
|
||||||
|
this.user_id = user_id;
|
||||||
|
}
|
||||||
|
public String getEtcp_ymd() {
|
||||||
|
return etcp_ymd;
|
||||||
|
}
|
||||||
|
public void setEtcp_ymd(String etcp_ymd) {
|
||||||
|
this.etcp_ymd = etcp_ymd;
|
||||||
|
}
|
||||||
|
public String getCti_use_yn() {
|
||||||
|
return cti_use_yn;
|
||||||
|
}
|
||||||
|
public void setCti_use_yn(String cti_use_yn) {
|
||||||
|
this.cti_use_yn = cti_use_yn;
|
||||||
|
}
|
||||||
|
public String getCti_id() {
|
||||||
|
return cti_id;
|
||||||
|
}
|
||||||
|
public void setCti_id(String cti_id) {
|
||||||
|
this.cti_id = cti_id;
|
||||||
|
}
|
||||||
|
public String getRgst_dt() {
|
||||||
|
return rgst_dt;
|
||||||
|
}
|
||||||
|
public void setRgst_dt(String rgst_dt) {
|
||||||
|
this.rgst_dt = rgst_dt;
|
||||||
|
}
|
||||||
|
public String getMdfy_dt() {
|
||||||
|
return mdfy_dt;
|
||||||
|
}
|
||||||
|
public void setMdfy_dt(String mdfy_dt) {
|
||||||
|
this.mdfy_dt = mdfy_dt;
|
||||||
|
}
|
||||||
|
public String getModify_diff() {
|
||||||
|
return modify_diff;
|
||||||
|
}
|
||||||
|
public void setModify_diff(String modify_diff) {
|
||||||
|
this.modify_diff = modify_diff;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,53 @@
|
||||||
|
package kr.co.i4way.cst.model;
|
||||||
|
|
||||||
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
|
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
@EnableConfigurationProperties
|
||||||
|
@ConfigurationProperties(prefix = "boardinfo")
|
||||||
|
public class BoardInfoVo {
|
||||||
|
|
||||||
|
private int genesys_license;
|
||||||
|
private int uw_kt;
|
||||||
|
private int uw_toll;
|
||||||
|
private int uw_lg;
|
||||||
|
private int yd_kt;
|
||||||
|
|
||||||
|
|
||||||
|
public int getUw_kt() {
|
||||||
|
return uw_kt;
|
||||||
|
}
|
||||||
|
public void setUw_kt(int uw_kt) {
|
||||||
|
this.uw_kt = uw_kt;
|
||||||
|
}
|
||||||
|
public int getUw_toll() {
|
||||||
|
return uw_toll;
|
||||||
|
}
|
||||||
|
public void setUw_toll(int uw_toll) {
|
||||||
|
this.uw_toll = uw_toll;
|
||||||
|
}
|
||||||
|
public int getUw_lg() {
|
||||||
|
return uw_lg;
|
||||||
|
}
|
||||||
|
public void setUw_lg(int uw_lg) {
|
||||||
|
this.uw_lg = uw_lg;
|
||||||
|
}
|
||||||
|
public int getYd_kt() {
|
||||||
|
return yd_kt;
|
||||||
|
}
|
||||||
|
public void setYd_kt(int yd_kt) {
|
||||||
|
this.yd_kt = yd_kt;
|
||||||
|
}
|
||||||
|
public int getGenesys_license() {
|
||||||
|
return genesys_license;
|
||||||
|
}
|
||||||
|
public void setGenesys_license(int genesys_license) {
|
||||||
|
this.genesys_license = genesys_license;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,54 @@
|
||||||
|
package kr.co.i4way.cst.model;
|
||||||
|
|
||||||
|
public class RecLicenseVo {
|
||||||
|
|
||||||
|
private String server_type, server_type_name, server_name, server_id, solution_type;
|
||||||
|
private int used_cnt = 0, license_cnt = 0;
|
||||||
|
|
||||||
|
|
||||||
|
public String getServer_type() {
|
||||||
|
return server_type;
|
||||||
|
}
|
||||||
|
public void setServer_type(String server_type) {
|
||||||
|
this.server_type = server_type;
|
||||||
|
}
|
||||||
|
public String getServer_type_name() {
|
||||||
|
return server_type_name;
|
||||||
|
}
|
||||||
|
public void setServer_type_name(String server_type_name) {
|
||||||
|
this.server_type_name = server_type_name;
|
||||||
|
}
|
||||||
|
public String getServer_name() {
|
||||||
|
return server_name;
|
||||||
|
}
|
||||||
|
public void setServer_name(String server_name) {
|
||||||
|
this.server_name = server_name;
|
||||||
|
}
|
||||||
|
public String getServer_id() {
|
||||||
|
return server_id;
|
||||||
|
}
|
||||||
|
public void setServer_id(String server_id) {
|
||||||
|
this.server_id = server_id;
|
||||||
|
}
|
||||||
|
public int getUsed_cnt() {
|
||||||
|
return used_cnt;
|
||||||
|
}
|
||||||
|
public void setUsed_cnt(int used_cnt) {
|
||||||
|
this.used_cnt = used_cnt;
|
||||||
|
}
|
||||||
|
public int getLicense_cnt() {
|
||||||
|
return license_cnt;
|
||||||
|
}
|
||||||
|
public void setLicense_cnt(int license_cnt) {
|
||||||
|
this.license_cnt = license_cnt;
|
||||||
|
}
|
||||||
|
public String getSolution_type() {
|
||||||
|
return solution_type;
|
||||||
|
}
|
||||||
|
public void setSolution_type(String solution_type) {
|
||||||
|
this.solution_type = solution_type;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,38 @@
|
||||||
|
package kr.co.i4way.cst.model;
|
||||||
|
|
||||||
|
public class TrunkInfoVo {
|
||||||
|
|
||||||
|
private int uw_kt;
|
||||||
|
private int uw_toll;
|
||||||
|
private int uw_lg;
|
||||||
|
private int yd_kt;
|
||||||
|
|
||||||
|
public int getUw_kt() {
|
||||||
|
return uw_kt;
|
||||||
|
}
|
||||||
|
public void setUw_kt(int uw_kt) {
|
||||||
|
this.uw_kt = uw_kt;
|
||||||
|
}
|
||||||
|
public int getUw_toll() {
|
||||||
|
return uw_toll;
|
||||||
|
}
|
||||||
|
public void setUw_toll(int uw_toll) {
|
||||||
|
this.uw_toll = uw_toll;
|
||||||
|
}
|
||||||
|
public int getUw_lg() {
|
||||||
|
return uw_lg;
|
||||||
|
}
|
||||||
|
public void setUw_lg(int uw_lg) {
|
||||||
|
this.uw_lg = uw_lg;
|
||||||
|
}
|
||||||
|
public int getYd_kt() {
|
||||||
|
return yd_kt;
|
||||||
|
}
|
||||||
|
public void setYd_kt(int yd_kt) {
|
||||||
|
this.yd_kt = yd_kt;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,67 @@
|
||||||
|
package kr.co.i4way.cst.service;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import kr.co.i4way.cst.model.TrunkInfoVo;
|
||||||
|
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import kr.co.i4way.cst.model.RecLicenseVo;
|
||||||
|
import kr.co.i4way.mapper.mssql.MssqlMapper;
|
||||||
|
import kr.co.i4way.mapper.mssql_brd.MssqlBrdMapper;
|
||||||
|
import kr.co.i4way.mapper.tibero.TiberoMapper;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class CstScheduleService {
|
||||||
|
Logger logger = LoggerFactory.getLogger(this.getClass());
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
MssqlMapper mssqlMapper;
|
||||||
|
|
||||||
|
// @Autowired
|
||||||
|
// MssqlBrdMapper mssqlBrdMapper;
|
||||||
|
//
|
||||||
|
// @Autowired
|
||||||
|
// TiberoMapper tiberoMapper;
|
||||||
|
|
||||||
|
public ArrayList getDnCnt() throws Exception{
|
||||||
|
return mssqlMapper.getDnCnt();
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArrayList getDnCnt_Dev() throws Exception{
|
||||||
|
return mssqlMapper.getDnCnt_Dev();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void insertCCCUser(List<Map<String, Object>> list) throws Exception{
|
||||||
|
mssqlMapper.insertCCCUser(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void insertCCCGroup(List<Map<String, Object>> list) throws Exception{
|
||||||
|
mssqlMapper.insertCCCGroup(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
// public void setRecLicenseInfo(List<RecLicenseVo> arr) throws Exception{
|
||||||
|
// mssqlBrdMapper.setRecLicenseInfo(arr);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// public void setGenesysLicenseInfo(RecLicenseVo vo) throws Exception{
|
||||||
|
// mssqlBrdMapper.setGenesysLicenseInfo(vo);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// public void setRecLicenseInfo_Dev(List<RecLicenseVo> arr) throws Exception{
|
||||||
|
// mssqlBrdMapper.setRecLicenseInfo_Dev(arr);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// public void setGenesysLicenseInfo_Dev(RecLicenseVo vo) throws Exception{
|
||||||
|
// mssqlBrdMapper.setGenesysLicenseInfo_Dev(vo);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// public void setTrunkInfo(TrunkInfoVo vo) throws Exception{
|
||||||
|
// mssqlBrdMapper.setTrunkInfo(vo);
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
package kr.co.i4way.mapper.mssql;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.apache.ibatis.session.SqlSession;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import kr.co.i4way.cst.model.RecLicenseVo;
|
||||||
|
|
||||||
|
public interface MssqlMapper {
|
||||||
|
public void insertCCCUser(List<Map<String, Object>> list) throws Exception;
|
||||||
|
public void insertCCCGroup(List<Map<String, Object>> list) throws Exception;
|
||||||
|
public void setRecLicenseInfo(List<RecLicenseVo> list) throws Exception;
|
||||||
|
public void setRecLicenseInfo_Dev(List<RecLicenseVo> list) throws Exception;
|
||||||
|
public void setGenesysLicenseInfo(RecLicenseVo reclicensevo) throws Exception;
|
||||||
|
public void setGenesysLicenseInfo_Dev(RecLicenseVo reclicensevo) throws Exception;
|
||||||
|
public ArrayList getDnCnt() throws Exception;
|
||||||
|
public ArrayList getDnCnt_Dev() throws Exception;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
package kr.co.i4way.mapper.mssql_brd;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import kr.co.i4way.cst.model.RecLicenseVo;
|
||||||
|
import kr.co.i4way.cst.model.TrunkInfoVo;
|
||||||
|
|
||||||
|
public interface MssqlBrdMapper {
|
||||||
|
public void setRecLicenseInfo(List<RecLicenseVo> list) throws Exception;
|
||||||
|
public void setGenesysLicenseInfo(RecLicenseVo reclicensevo) throws Exception;
|
||||||
|
public void setRecLicenseInfo_Dev(List<RecLicenseVo> list) throws Exception;
|
||||||
|
public void setGenesysLicenseInfo_Dev(RecLicenseVo reclicensevo) throws Exception;
|
||||||
|
public void insertWeatherHistory() throws Exception;
|
||||||
|
public void deleteWeatherInfo() throws Exception;
|
||||||
|
public void setTrunkInfo(TrunkInfoVo vo) throws Exception;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
package kr.co.i4way.mapper.tibero;
|
||||||
|
|
||||||
|
import java.sql.SQLException;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
import org.apache.ibatis.session.SqlSession;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
|
|
||||||
|
public interface TiberoMapper {
|
||||||
|
public ArrayList getCCCUser() throws Exception;
|
||||||
|
public ArrayList getCCCGroup() throws Exception;
|
||||||
|
public ArrayList getCCCToken() throws Exception;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,278 @@
|
||||||
|
<?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="kr.co.i4way.mapper.mssql.MssqlMapper">
|
||||||
|
|
||||||
|
<update id="insertCCCUser" parameterType="java.util.List">
|
||||||
|
MERGE INTO TBL_CCC_USER A USING (
|
||||||
|
<foreach item="item" collection="list" open="" close="" index="index" separator="UNION" >
|
||||||
|
SELECT #{item.USER_ID} as user_id
|
||||||
|
,#{item.USER_NM} as user_nm
|
||||||
|
,#{item.CUSC_ORG_NO} as cusc_org_no
|
||||||
|
,#{item.AUTH_GRP_NO} as auth_grp_no
|
||||||
|
,#{item.HP_TN} as hp_tn
|
||||||
|
,#{item.EML_ADR} as eml_adr
|
||||||
|
,#{item.CNSR_TCD} as cnsr_tcd
|
||||||
|
,#{item.EE_YN} as ee_yn
|
||||||
|
,#{item.USE_YN} as use_yn
|
||||||
|
,#{item.FIN_UPDR_ID} as fin_updr_id
|
||||||
|
,dbo.FN_HD_CONV_DATETIME(#{item.FIN_MDFY_TISMP}) as fin_mdfy_tismp
|
||||||
|
,#{item.ETCP_YMD} as etcp_ymd
|
||||||
|
,#{item.LVCO_YMD} as lvco_ymd
|
||||||
|
,#{item.LVCO_YN} as lvco_yn
|
||||||
|
,#{item.CTI_USE_YN} as cti_use_yn
|
||||||
|
,#{item.CTI_CNNC_USER_ID} as cti_cnnc_user_id
|
||||||
|
,#{item.AT_RCPM_YN} as at_rcpm_yn
|
||||||
|
,#{item.WKHM_YN} as wkhm_yn
|
||||||
|
,#{item.ODU_THMS_TCD} as odu_thms_tcd
|
||||||
|
,#{item.USE_XPR_PARR_YMD} as use_xpr_parr_ymd
|
||||||
|
,#{item.INLN_TN} as inln_tn
|
||||||
|
,#{item.REM_SBC} as rem_sbc
|
||||||
|
,#{item.CTI_USER_MGMT_NO} as cti_user_mgmt_no
|
||||||
|
</foreach>
|
||||||
|
) B ON (A.user_id = B.user_id)
|
||||||
|
WHEN MATCHED THEN
|
||||||
|
UPDATE
|
||||||
|
SET
|
||||||
|
A.USER_NM = B.user_nm
|
||||||
|
, A.CUSC_ORG_NO = B.cusc_org_no
|
||||||
|
, A.AUTH_GRP_NO = B.auth_grp_no
|
||||||
|
, A.HP_TN = B.hp_tn
|
||||||
|
, A.EML_ADR = B.eml_adr
|
||||||
|
, A.CNSR_TCD = B.cnsr_tcd
|
||||||
|
, A.EE_YN = B.ee_yn
|
||||||
|
, A.USE_YN = B.use_yn
|
||||||
|
, A.FIN_UPDR_ID = B.fin_updr_id
|
||||||
|
, A.FIN_MDFY_TISMP = B.fin_mdfy_tismp
|
||||||
|
, A.ETCP_YMD = B.etcp_ymd
|
||||||
|
, A.LVCO_YMD = B.lvco_ymd
|
||||||
|
, A.LVCO_YN = B.lvco_yn
|
||||||
|
, A.CTI_USE_YN = B.cti_use_yn
|
||||||
|
, A.CTI_CNNC_USER_ID = B.cti_cnnc_user_id
|
||||||
|
, A.AT_RCPM_YN = B.at_rcpm_yn
|
||||||
|
, A.WKHM_YN = B.wkhm_yn
|
||||||
|
, A.ODU_THMS_TCD = B.odu_thms_tcd
|
||||||
|
, A.USE_XPR_PARR_YMD = B.use_xpr_parr_ymd
|
||||||
|
, A.INLN_TN = B.inln_tn
|
||||||
|
, A.REM_SBC = B.rem_sbc
|
||||||
|
, A.CTI_USER_MGMT_NO = B.cti_user_mgmt_no
|
||||||
|
WHEN NOT MATCHED THEN
|
||||||
|
INSERT
|
||||||
|
(USER_ID
|
||||||
|
,USER_NM
|
||||||
|
,CUSC_ORG_NO
|
||||||
|
,AUTH_GRP_NO
|
||||||
|
,HP_TN
|
||||||
|
,EML_ADR
|
||||||
|
,CNSR_TCD
|
||||||
|
,EE_YN
|
||||||
|
,USE_YN
|
||||||
|
,FIN_UPDR_ID
|
||||||
|
,FIN_MDFY_TISMP
|
||||||
|
,ETCP_YMD
|
||||||
|
,LVCO_YMD
|
||||||
|
,LVCO_YN
|
||||||
|
,CTI_USE_YN
|
||||||
|
,CTI_CNNC_USER_ID
|
||||||
|
,AT_RCPM_YN
|
||||||
|
,WKHM_YN
|
||||||
|
,ODU_THMS_TCD
|
||||||
|
,USE_XPR_PARR_YMD
|
||||||
|
,INLN_TN
|
||||||
|
,REM_SBC
|
||||||
|
,CTI_USER_MGMT_NO)
|
||||||
|
VALUES
|
||||||
|
(B.user_id
|
||||||
|
,B.user_nm
|
||||||
|
,B.cusc_org_no
|
||||||
|
,B.auth_grp_no
|
||||||
|
,B.hp_tn
|
||||||
|
,B.eml_adr
|
||||||
|
,B.cnsr_tcd
|
||||||
|
,B.ee_yn
|
||||||
|
,B.use_yn
|
||||||
|
,B.fin_updr_id
|
||||||
|
,B.fin_mdfy_tismp
|
||||||
|
,B.etcp_ymd
|
||||||
|
,B.lvco_ymd
|
||||||
|
,B.lvco_yn
|
||||||
|
,B.cti_use_yn
|
||||||
|
,B.cti_cnnc_user_id
|
||||||
|
,B.at_rcpm_yn
|
||||||
|
,B.wkhm_yn
|
||||||
|
,B.odu_thms_tcd
|
||||||
|
,B.use_xpr_parr_ymd
|
||||||
|
,B.inln_tn
|
||||||
|
,B.rem_sbc
|
||||||
|
,B.cti_user_mgmt_no
|
||||||
|
);
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<update id="insertCCCGroup" parameterType="java.util.List">
|
||||||
|
MERGE INTO TBL_CCC_GRP A USING (
|
||||||
|
<foreach item="item" collection="list" open="" close="" index="index" separator="UNION" >
|
||||||
|
SELECT #{item.CUSC_ORG_NO} as cusc_org_no
|
||||||
|
,#{item.CUSC_ORG_NM} as cusc_org_nm
|
||||||
|
,#{item.CUSC_ORG_EXPL_SBC} as cusc_org_expl_sbc
|
||||||
|
,#{item.SUPI_CUSC_ORG_NO} as supi_cusc_org_no
|
||||||
|
,#{item.SORT_SQN} as sort_sqn
|
||||||
|
,#{item.CUSC_SYS_TYPE_CD} as cusc_sys_type_cd
|
||||||
|
,#{item.USE_YN} as use_yn
|
||||||
|
,#{item.VBG_RGN_ID} as vbg_rgn_id
|
||||||
|
,dbo.FN_HD_CONV_DATETIME(#{item.VBG_RGST_TISMP}) as vbg_rgst_tismp
|
||||||
|
,#{item.FIN_UPDR_ID} as fin_updr_id
|
||||||
|
,dbo.FN_HD_CONV_DATETIME(#{item.FIN_MDFY_TISMP}) as fin_mdfy_tismp
|
||||||
|
,#{item.BLNS_CO_CD} as blns_co_cd
|
||||||
|
</foreach>
|
||||||
|
) B ON (A.cusc_org_no = B.cusc_org_no)
|
||||||
|
WHEN MATCHED THEN
|
||||||
|
UPDATE
|
||||||
|
SET
|
||||||
|
A.CUSC_ORG_NM = B.cusc_org_nm
|
||||||
|
,A.CUSC_ORG_EXPL_SBC = B.cusc_org_expl_sbc
|
||||||
|
,A.SUPI_CUSC_ORG_NO = B.supi_cusc_org_no
|
||||||
|
,A.SORT_SQN = B.sort_sqn
|
||||||
|
,A.CUSC_SYS_TYPE_CD = B.cusc_sys_type_cd
|
||||||
|
,A.USE_YN = B.use_yn
|
||||||
|
,A.VBG_RGN_ID = B.vbg_rgn_id
|
||||||
|
,A.VBG_RGST_TISMP = B.vbg_rgst_tismp
|
||||||
|
,A.FIN_UPDR_ID = B.fin_updr_id
|
||||||
|
,A.FIN_MDFY_TISMP = B.fin_mdfy_tismp
|
||||||
|
,A.BLNS_CO_CD = B.blns_co_cd
|
||||||
|
WHEN NOT MATCHED THEN
|
||||||
|
INSERT
|
||||||
|
(CUSC_ORG_NO
|
||||||
|
,CUSC_ORG_NM
|
||||||
|
,CUSC_ORG_EXPL_SBC
|
||||||
|
,SUPI_CUSC_ORG_NO
|
||||||
|
,SORT_SQN
|
||||||
|
,CUSC_SYS_TYPE_CD
|
||||||
|
,USE_YN
|
||||||
|
,VBG_RGN_ID
|
||||||
|
,VBG_RGST_TISMP
|
||||||
|
,FIN_UPDR_ID
|
||||||
|
,FIN_MDFY_TISMP
|
||||||
|
,BLNS_CO_CD)
|
||||||
|
VALUES
|
||||||
|
(B.cusc_org_no
|
||||||
|
,B.cusc_org_nm
|
||||||
|
,B.cusc_org_expl_sbc
|
||||||
|
,B.supi_cusc_org_no
|
||||||
|
,B.sort_sqn
|
||||||
|
,B.cusc_sys_type_cd
|
||||||
|
,B.use_yn
|
||||||
|
,B.vbg_rgn_id
|
||||||
|
,B.vbg_rgst_tismp
|
||||||
|
,B.fin_updr_id
|
||||||
|
,B.fin_mdfy_tismp
|
||||||
|
,B.blns_co_cd
|
||||||
|
);
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<update id="setRecLicenseInfo">
|
||||||
|
MERGE INTO HBRDPRD.dbo.TBL_LICENSE A USING (
|
||||||
|
<foreach item="item" collection="list" open="" close="" index="index" separator="UNION" >
|
||||||
|
SELECT #{item.solution_type} as solution_type
|
||||||
|
,#{item.server_id} as server_id
|
||||||
|
,#{item.server_name} as server_name
|
||||||
|
,#{item.server_type} as server_type
|
||||||
|
,#{item.server_type_name} as server_type_name
|
||||||
|
,#{item.license_cnt} as license_cnt
|
||||||
|
,#{item.used_cnt} as used_cnt
|
||||||
|
</foreach>
|
||||||
|
) B ON (A.solution_type = B.solution_type AND A.server_id = B.server_id)
|
||||||
|
WHEN MATCHED THEN
|
||||||
|
UPDATE
|
||||||
|
SET
|
||||||
|
server_name = B.server_name
|
||||||
|
, A.server_type = B.server_type
|
||||||
|
, A.server_type_name = B.server_type_name
|
||||||
|
, A.license_cnt = B.license_cnt
|
||||||
|
, A.used_cnt = B.used_cnt
|
||||||
|
WHEN NOT MATCHED THEN
|
||||||
|
INSERT
|
||||||
|
(solution_type,
|
||||||
|
,server_id
|
||||||
|
,server_name
|
||||||
|
,server_type
|
||||||
|
,server_type_name
|
||||||
|
,license_cnt
|
||||||
|
,used_cnt)
|
||||||
|
VALUES
|
||||||
|
(B.solution_type
|
||||||
|
, B.server_id
|
||||||
|
, B.server_name
|
||||||
|
, B.server_type
|
||||||
|
, B.server_type_name
|
||||||
|
, B.license_cnt
|
||||||
|
, B.used_cnt
|
||||||
|
);
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<update id="setGenesysLicenseInfo" parameterType="kr.co.i4way.cst.model.RecLicenseVo">
|
||||||
|
UPDATE TBL_LICENSE SET
|
||||||
|
license_cnt = #{license_cnt}
|
||||||
|
,used_cnt = #{used_cnt}
|
||||||
|
WHERE solution_type = #{solution_type}
|
||||||
|
AND server_id = #{server_id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<select id="getDnCnt" resultType="hashmap">
|
||||||
|
SELECT COUNT(*) CNT_DN FROM HCTIPRD.dbo.CFG_DN
|
||||||
|
WHERE TYPE = '1'
|
||||||
|
and switch_dbid = '101'
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<update id="setRecLicenseInfo_dev">
|
||||||
|
MERGE INTO HBRDDEV.dbo.TBL_LICENSE A USING (
|
||||||
|
<foreach item="item" collection="list" open="" close="" index="index" separator="UNION" >
|
||||||
|
SELECT #{item.solution_type} as solution_type
|
||||||
|
,#{item.server_id} as server_id
|
||||||
|
,#{item.server_name} as server_name
|
||||||
|
,#{item.server_type} as server_type
|
||||||
|
,#{item.server_type_name} as server_type_name
|
||||||
|
,#{item.license_cnt} as license_cnt
|
||||||
|
,#{item.used_cnt} as used_cnt
|
||||||
|
</foreach>
|
||||||
|
) B ON (A.solution_type = B.solution_type AND A.server_id = B.server_id)
|
||||||
|
WHEN MATCHED THEN
|
||||||
|
UPDATE
|
||||||
|
SET
|
||||||
|
server_name = B.server_name
|
||||||
|
, A.server_type = B.server_type
|
||||||
|
, A.server_type_name = B.server_type_name
|
||||||
|
, A.license_cnt = B.license_cnt
|
||||||
|
, A.used_cnt = B.used_cnt
|
||||||
|
WHEN NOT MATCHED THEN
|
||||||
|
INSERT
|
||||||
|
(solution_type,
|
||||||
|
,server_id
|
||||||
|
,server_name
|
||||||
|
,server_type
|
||||||
|
,server_type_name
|
||||||
|
,license_cnt
|
||||||
|
,used_cnt)
|
||||||
|
VALUES
|
||||||
|
(B.solution_type
|
||||||
|
, B.server_id
|
||||||
|
, B.server_name
|
||||||
|
, B.server_type
|
||||||
|
, B.server_type_name
|
||||||
|
, B.license_cnt
|
||||||
|
, B.used_cnt
|
||||||
|
);
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<update id="setGenesysLicenseInfo_dev" parameterType="kr.co.i4way.cst.model.RecLicenseVo">
|
||||||
|
UPDATE HBRDDEV.dbo.TBL_LICENSE SET
|
||||||
|
license_cnt = #{license_cnt}
|
||||||
|
, used_cnt = #{used_cnt}
|
||||||
|
WHERE solution_type = #{solution_type}
|
||||||
|
AND server_id = #{server_id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<select id="getDnCnt_Dev" resultType="hashmap">
|
||||||
|
SELECT COUNT(*) CNT_DN FROM HCTIDEV.dbo.CFG_DN
|
||||||
|
WHERE TYPE = '1'
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
|
|
@ -0,0 +1,96 @@
|
||||||
|
<?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="kr.co.i4way.mapper.mssql_brd.MssqlBrdMapper">
|
||||||
|
|
||||||
|
<update id="setRecLicenseInfo">
|
||||||
|
MERGE INTO TBL_LICENSE A USING (
|
||||||
|
<foreach item="item" collection="list" open="" close="" index="index" separator="UNION" >
|
||||||
|
SELECT #{item.solution_type} as solution_type
|
||||||
|
,#{item.server_id} as server_id
|
||||||
|
,#{item.server_name} as server_name
|
||||||
|
,#{item.server_type} as server_type
|
||||||
|
,#{item.server_type_name} as server_type_name
|
||||||
|
,#{item.license_cnt} as license_cnt
|
||||||
|
,#{item.used_cnt} as used_cnt
|
||||||
|
</foreach>
|
||||||
|
) B ON (A.solution_type = B.solution_type AND A.server_id = B.server_id)
|
||||||
|
WHEN MATCHED THEN
|
||||||
|
UPDATE
|
||||||
|
SET
|
||||||
|
server_name = B.server_name
|
||||||
|
, A.server_type = B.server_type
|
||||||
|
, A.server_type_name = B.server_type_name
|
||||||
|
, A.license_cnt = B.license_cnt
|
||||||
|
, A.used_cnt = B.used_cnt
|
||||||
|
WHEN NOT MATCHED THEN
|
||||||
|
INSERT
|
||||||
|
(solution_type
|
||||||
|
,server_id
|
||||||
|
,server_name
|
||||||
|
,server_type
|
||||||
|
,server_type_name
|
||||||
|
,license_cnt
|
||||||
|
,used_cnt)
|
||||||
|
VALUES
|
||||||
|
(B.solution_type
|
||||||
|
, B.server_id
|
||||||
|
, B.server_name
|
||||||
|
, B.server_type
|
||||||
|
, B.server_type_name
|
||||||
|
, B.license_cnt
|
||||||
|
, B.used_cnt
|
||||||
|
);
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<update id="setGenesysLicenseInfo" parameterType="kr.co.i4way.cst.model.RecLicenseVo">
|
||||||
|
UPDATE TBL_LICENSE SET
|
||||||
|
license_cnt = #{license_cnt}
|
||||||
|
,used_cnt = #{used_cnt}
|
||||||
|
WHERE solution_type = #{solution_type}
|
||||||
|
AND server_id = #{server_id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<insert id="insertWeatherInfo">
|
||||||
|
INSERT INTO TBL_WEATHER (region_cd,do_nm,gu_nm,dong_nm,latitude,longitude,check_time,weather_icon,weather_nm
|
||||||
|
,current_temp,humidity,dewdrop,wind_direct,wind_speed,rain,snow,lnd_air_pres,spg_air_pres
|
||||||
|
,sunrise,sunset,visible) VALUES
|
||||||
|
<foreach item="item" collection="list" index="index" separator="," >
|
||||||
|
(
|
||||||
|
#{item.region_cd,jdbcType=VARCHAR}
|
||||||
|
,#{item.do_nm,jdbcType=VARCHAR}
|
||||||
|
,#{item.gu_nm,jdbcType=VARCHAR}
|
||||||
|
,#{item.dong_nm,jdbcType=VARCHAR}
|
||||||
|
,#{item.latitude,jdbcType=VARCHAR}
|
||||||
|
,#{item.longitude,jdbcType=VARCHAR}
|
||||||
|
,#{item.check_time,jdbcType=VARCHAR}
|
||||||
|
,#{item.weather_icon,jdbcType=VARCHAR}
|
||||||
|
,#{item.weather_nm,jdbcType=VARCHAR}
|
||||||
|
,#{item.current_temp,jdbcType=VARCHAR}
|
||||||
|
,#{item.humidity,jdbcType=VARCHAR}
|
||||||
|
,#{item.dewdrop,jdbcType=VARCHAR}
|
||||||
|
,#{item.wind_direct,jdbcType=VARCHAR}
|
||||||
|
,#{item.wind_speed,jdbcType=VARCHAR}
|
||||||
|
,#{item.rain,jdbcType=VARCHAR}
|
||||||
|
,#{item.snow,jdbcType=VARCHAR}
|
||||||
|
,#{item.lnd_air_pres,jdbcType=VARCHAR}
|
||||||
|
,#{item.spg_air_pres,jdbcType=VARCHAR}
|
||||||
|
,#{item.sunrise,jdbcType=VARCHAR}
|
||||||
|
,#{item.sunset,jdbcType=VARCHAR}
|
||||||
|
,#{item.visible,jdbcType=VARCHAR}
|
||||||
|
)
|
||||||
|
</foreach>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<insert id="insertWeatherHistory">
|
||||||
|
<![CDATA[
|
||||||
|
INSERT INTO TBL_WEATHER_HISTORY
|
||||||
|
SELECT * FROM TBL_WEATHER
|
||||||
|
WHERE region_cd = '42'
|
||||||
|
]]>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="deleteWeatherInfo">
|
||||||
|
DELETE FROM TBL_WEATHER
|
||||||
|
</update>
|
||||||
|
</mapper>
|
||||||
|
|
@ -0,0 +1,42 @@
|
||||||
|
<?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="kr.co.i4way.mapper.tibero.TiberoMapper">
|
||||||
|
|
||||||
|
<select id="getCCCUser" parameterType="hashmap" resultType="hashmap">
|
||||||
|
<![CDATA[
|
||||||
|
SELECT
|
||||||
|
*
|
||||||
|
FROM (SELECT A.USER_ID
|
||||||
|
, B.USER_NM
|
||||||
|
, A.ETCP_YMD
|
||||||
|
, A.LVCO_YMD
|
||||||
|
, A.LVCO_YN
|
||||||
|
, B.CUSC_ORG_NO
|
||||||
|
, B.AUTH_GRP_NO
|
||||||
|
, B.HP_TN
|
||||||
|
, B.EML_ADR
|
||||||
|
, B.EE_YN
|
||||||
|
, A.CTI_USE_YN
|
||||||
|
, B.INLN_TN
|
||||||
|
, B.USE_YN
|
||||||
|
, B.CNSR_TCD
|
||||||
|
, A.CTI_CNNC_USER_ID AS CTI_ID
|
||||||
|
, A.WKHM_YN
|
||||||
|
, B.AUTH_GRP_NO
|
||||||
|
, B.CUSC_ORG_NO
|
||||||
|
, (to_date(TO_CHAR(A.FIN_MDFY_TISMP, 'YYYYMMDD'), 'YYYYMMDD') - to_date( TO_CHAR(A.VBG_RGST_TISMP, 'YYYYMMDD'), 'YYYYMMDD')) AS MODIFY_DIFF
|
||||||
|
, TO_CHAR(A.VBG_RGST_TISMP, 'yyyymmddHH24miss') AS RGST_DT
|
||||||
|
, TO_CHAR(A.FIN_MDFY_TISMP, 'yyyymmddHH24miss') AS MDFY_DT
|
||||||
|
, A.FIN_UPDR_ID
|
||||||
|
FROM C0207_USER_ALTR_H A, C0207_USER_B B
|
||||||
|
WHERE A.USER_ID = B.USER_ID
|
||||||
|
AND A.FIN_MDFY_TISMP = (SELECT MAX(FIN_MDFY_TISMP) AS FIN_MDFY_TISMP
|
||||||
|
FROM C0207_USER_ALTR_H
|
||||||
|
WHERE TO_CHAR(FIN_MDFY_TISMP, 'YYYYMMDD') = TO_CHAR(sysdate, 'YYYYMMDD')
|
||||||
|
)
|
||||||
|
AND TO_CHAR(A.FIN_MDFY_TISMP, 'YYYYMMDD') = TO_CHAR(sysdate, 'YYYYMMDD')
|
||||||
|
)
|
||||||
|
]]>
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
package kr.co.i4way.sample;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
||||||
|
@Controller
|
||||||
|
public class sampleController {
|
||||||
|
@RequestMapping("/test")
|
||||||
|
public String test() {
|
||||||
|
return "/test.html";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,54 @@
|
||||||
|
package kr.co.i4way.util;
|
||||||
|
|
||||||
|
import java.util.Base64;
|
||||||
|
import javax.crypto.Cipher;
|
||||||
|
import javax.crypto.spec.IvParameterSpec;
|
||||||
|
import javax.crypto.spec.SecretKeySpec;
|
||||||
|
|
||||||
|
public class AES256 {
|
||||||
|
|
||||||
|
public static String alg = "AES/CBC/PKCS5Padding";
|
||||||
|
|
||||||
|
public static void main (String[] args) throws Exception {
|
||||||
|
int a = 956;
|
||||||
|
int b = 0;
|
||||||
|
if(a > 0) {
|
||||||
|
b = a + (int)(a * 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
System.out.println("A = " + a);
|
||||||
|
System.out.println("B = " + b);
|
||||||
|
//String encStr = "SHrqns7It6AOBKM+Ie91/KW3bJ/F6x8pQtTA0GR5pKcfhS+FRVXeBwHoYI/9k96actcmEQyo/3fhzXDd9sw2joz4+9kDfwactfbY6MFqkWhgtgkxVknZfQ8x+MABF5srudGg3UxcCcaCGkf5exbYXdN5FfeoQcrIxujYyHOpLGZaWk7Qtytta0AzkicokqXQ/cHSrzv8GDBBHxByE+n5taVd8m8IGzB6D+fa5oZ/LEMJhlEFEQdSjvn3Z8/stwgP+98xYH07Au9BfETaWvemYW3733uf3jYVICk6s6mNLSf88k0171wo9Mi/WBDzZNReKYrbNLVVzqKQAIHVMM9n/LPEwD7mXw+sHbuB0DWF7oLRzSnhS6Wl1LT9habCA4u5djP61h51cZ1VIxiIrFXZYpPazzUjehK8d7os2+6fwPZYG2wlLJUZ3JpYZyEOQlgWtyJsbQ9qNhBweQQPHOI2wmRYOlMaSsBmWFu857TmbKTKQxqfBqWcfYtdkBubikc4iQtlJqaLCprtFR/m07rfe47CqKjd6O1MowEcDyWw/d5myEpNKmTSUzo/oervaEF8zCzaN4eIuQcPEJcfjdb/AJSmrPWngJfr6tGa2Ni7Eg0GZTbPS+F8WsWiW4iahM89AxgQOknGy3EsLBXwVDcfxNym9JtweXdmZCp6ouKYxBMBtTbi1gmMn3lB0Rb6Fauqz4fNUQ22N5ZoBJqinB+Aq2365twE9OWqFpCO7v0p1uis+JAm3eRnxBhAFR85sdlCkVZg4ojS7NZqCBOZo+jBdD1RhINLIKib/yr62yDK5p+/lSVhY07YVQsmtvlQiS0BgSCOleT651BrWs4TcLm8MinwqbB6V+Xf/XwSPMBpKVyn7mGSANGdLAErZcxXbZ09t3hqB0+3Ye1pWc3qrd/kRv/waQQ29pBQVHTUJ47NVkpNTz3hcTtTox35Rt60gIcpTTwfs1eNdH8F387++lHeOA==";
|
||||||
|
//String encStr = "SHrqns7It6AOBKM+Ie91/KW3bJ/F6x8pQtTA0GR5pKcfhS+FRVXeBwHoYI/9k96actcmEQyo/3fhzXDd9sw2joz4+9kDfwactfbY6MFqkWhgtgkxVknZfQ8x+MABF5srudGg3UxcCcaCGkf5exbYXdN5FfeoQcrIxujYyHOpLGZaWk7Qtytta0AzkicokqXQ/cHSrzv8GDBBHxByE+n5taVd8m8IGzB6D+fa5oZ/LEMJhlEFEQdSjvn3Z8/stwgP+98xYH07Au9BfETaWvemYW3733uf3jYVICk6s6mNLSf88k0171wo9Mi/WBDzZNReKYrbNLVVzqKQAIHVMM9n/LPEwD7mXw+sHbuB0DWF7oLRzSnhS6Wl1LT9habCA4u5djP61h51cZ1VIxiIrFXZYpPazzUjehK8d7os2+6fwPZYG2wlLJUZ3JpYZyEOQlgWtyJsbQ9qNhBweQQPHOI2wmRYOlMaSsBmWFu857TmbKTKQxqfBqWcfYtdkBubikc4iQtlJqaLCprtFR/m07rfe47CqKjd6O1MowEcDyWw/d5myEpNKmTSUzo/oervaEF8zCzaN4eIuQcPEJcfjdb/AJSmrPWngJfr6tGa2Ni7Eg0GZTbPS+F8WsWiW4iahM89AxgQOknGy3EsLBXwVDcfxNym9JtweXdmZCp6ouKYxBMBtTbi1gmMn3lB0Rb6Fauqz4fNUQ22N5ZoBJqinB+Aq2365twE9OWqFpCO7v0p1uis+JAm3eRnxBhAFR85sdlCkVZg4ojS7NZqCBOZo+jBdD1RhINLIKib/yr62yDK5p+/lSVhY07YVQsmtvlQiS0BgSCOleT651BrWs4TcLm8MinwqbB6V+Xf/XwSPMBpKVyn7mGSANGdLAErZcxXbZ09t3hqB0+3Ye1pWc3qrd/kRv/waQQ29pBQVHTUJ47NVkpNTz3hcTtTox35Rt60gIcpTTwfs1eNdH8F387++lHeOA==";
|
||||||
|
//String encStr = "tVIs1T89WnKMXFMUdO/BUA==";
|
||||||
|
//System.out.println(decrypt(encStr, "12345678901234567890123456789012", "1234567890123456"));
|
||||||
|
|
||||||
|
|
||||||
|
//String jsonstr = "{\"TENANT_DBID\": \"1\",\"EMPLOYEE_ID\": \"19395237\"}";
|
||||||
|
//String aaa = encrypt(jsonstr, "12345678901234567890123456789012", "1234567890123456");
|
||||||
|
//System.out.println(aaa);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String encrypt(String text, String key, String iv) throws Exception {
|
||||||
|
Cipher cipher = Cipher.getInstance(alg);
|
||||||
|
SecretKeySpec keySpec = new SecretKeySpec(key.getBytes(), "AES");
|
||||||
|
IvParameterSpec ivParamSpec = new IvParameterSpec(iv.getBytes());
|
||||||
|
cipher.init(Cipher.ENCRYPT_MODE, keySpec, ivParamSpec);
|
||||||
|
|
||||||
|
byte[] encrypted = cipher.doFinal(text.getBytes("UTF-8"));
|
||||||
|
return Base64.getEncoder().encodeToString(encrypted);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String decrypt(String cipherText, String key, String iv) throws Exception {
|
||||||
|
Cipher cipher = Cipher.getInstance(alg);
|
||||||
|
SecretKeySpec keySpec = new SecretKeySpec(key.getBytes(), "AES");
|
||||||
|
IvParameterSpec ivParamSpec = new IvParameterSpec(iv.getBytes());
|
||||||
|
cipher.init(Cipher.DECRYPT_MODE, keySpec, ivParamSpec);
|
||||||
|
|
||||||
|
byte[] decodedBytes = Base64.getDecoder().decode(cipherText);
|
||||||
|
byte[] decrypted = cipher.doFinal(decodedBytes);
|
||||||
|
return new String(decrypted, "UTF-8");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,74 @@
|
||||||
|
package kr.co.i4way.util;
|
||||||
|
|
||||||
|
import java.lang.reflect.Field;
|
||||||
|
import javax.crypto.Cipher;
|
||||||
|
import javax.crypto.SecretKey;
|
||||||
|
import javax.crypto.spec.IvParameterSpec;
|
||||||
|
import javax.crypto.spec.SecretKeySpec;
|
||||||
|
import org.apache.commons.codec.binary.Base64;
|
||||||
|
|
||||||
|
public class CipherAES {
|
||||||
|
static String AES_CBC_PKCS5Padding = "AES/CBC/PKCS5Padding";
|
||||||
|
|
||||||
|
static String MONITOR_KEY_VALUE = "BLUEQsiteUSE#MNS";
|
||||||
|
static String MONITOR_IV_VALUE = "SmartLOGIN201407";
|
||||||
|
|
||||||
|
private static String getKeyIvValue(String staticValue) throws Exception {
|
||||||
|
Class cipherAes = CipherAES.class;
|
||||||
|
Field cipherAesFields[] = cipherAes.getDeclaredFields();
|
||||||
|
|
||||||
|
String keyIvValue = "";
|
||||||
|
for (int i = 0; i < cipherAesFields.length; i++) {
|
||||||
|
if (staticValue.equals(cipherAesFields[i].getName())) {
|
||||||
|
keyIvValue = (String) cipherAesFields[i].get(cipherAes);
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return keyIvValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Key 생성
|
||||||
|
public static SecretKey generateKey(String keyValue) throws Exception {
|
||||||
|
return new SecretKeySpec(keyValue.getBytes("UTF-8"), "AES");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 복호화(String Decode)
|
||||||
|
public static String decrypt(String keyScn, String param) throws Exception {
|
||||||
|
System.out.println("keyScn==>"+keyScn);
|
||||||
|
System.out.println("param==>"+param);
|
||||||
|
return decrypt(AES_CBC_PKCS5Padding, param, getKeyIvValue(keyScn + "_KEY_VALUE"),
|
||||||
|
getKeyIvValue(keyScn + "_IV_VALUE"), "string");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 복호화
|
||||||
|
public static String decrypt(String transType, String srcData, String keyValue, String ivValue, String encodeType)
|
||||||
|
throws Exception {
|
||||||
|
String result = "";
|
||||||
|
byte[] decData = null;
|
||||||
|
|
||||||
|
try {
|
||||||
|
SecretKey key = generateKey(keyValue);
|
||||||
|
|
||||||
|
Cipher cipher = Cipher.getInstance(transType);
|
||||||
|
|
||||||
|
if (transType.equals(AES_CBC_PKCS5Padding)) {
|
||||||
|
if (null != ivValue && ivValue.length() > 0) {
|
||||||
|
cipher.init(Cipher.DECRYPT_MODE, key, new IvParameterSpec(ivValue.getBytes()));
|
||||||
|
} else {
|
||||||
|
cipher.init(Cipher.DECRYPT_MODE, key, new IvParameterSpec(new byte[16]));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
cipher.init(Cipher.DECRYPT_MODE, key);
|
||||||
|
}
|
||||||
|
|
||||||
|
decData = cipher.doFinal(Base64.decodeBase64(srcData));
|
||||||
|
|
||||||
|
result = new String(decData);
|
||||||
|
} catch (Exception e) {
|
||||||
|
result = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,195 @@
|
||||||
|
package kr.co.i4way.util;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Vector;
|
||||||
|
import java.io.*;
|
||||||
|
import java.net.SocketException;
|
||||||
|
|
||||||
|
import org.apache.commons.net.ftp.FTP;
|
||||||
|
import org.apache.commons.net.ftp.FTPClient;
|
||||||
|
import org.apache.commons.net.ftp.FTPFile;
|
||||||
|
import org.apache.commons.net.ftp.FTPReply;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
public class FtpUtil {
|
||||||
|
private final Logger logger = LoggerFactory.getLogger(this.getClass().getSimpleName());
|
||||||
|
public boolean FtpPut(String ip, int port, String id, String password,
|
||||||
|
String upload_dir, String makedir, List files){
|
||||||
|
boolean result = false;
|
||||||
|
FTPClient ftp = null;
|
||||||
|
int reply = 0;
|
||||||
|
int a=0;
|
||||||
|
try{
|
||||||
|
ftp = new FTPClient();
|
||||||
|
ftp.connect(ip, port);
|
||||||
|
|
||||||
|
reply = ftp.getReplyCode();
|
||||||
|
if(!FTPReply.isPositiveCompletion(reply)){
|
||||||
|
ftp.disconnect();
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!ftp.login(id, password)){
|
||||||
|
ftp.logout();
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
ftp.setFileType(FTP.BINARY_FILE_TYPE);
|
||||||
|
ftp.enterLocalPassiveMode();
|
||||||
|
ftp.changeWorkingDirectory(upload_dir);
|
||||||
|
ftp.makeDirectory(makedir);
|
||||||
|
ftp.changeWorkingDirectory(makedir);
|
||||||
|
|
||||||
|
for(int i=0; i<files.size(); i++){
|
||||||
|
String sourceFile = (String)files.get(i);
|
||||||
|
File uploadFile = new File(sourceFile);
|
||||||
|
FileInputStream fis = null;
|
||||||
|
try{
|
||||||
|
fis = new FileInputStream(uploadFile);
|
||||||
|
boolean isSuccess = ftp.storeFile(uploadFile.getName(), fis);
|
||||||
|
if(isSuccess){
|
||||||
|
logger.info("FTP Upload Success ["+sourceFile+"]");
|
||||||
|
}
|
||||||
|
}catch(IOException e){
|
||||||
|
e.printStackTrace();
|
||||||
|
}finally{
|
||||||
|
if(fis != null){
|
||||||
|
try{
|
||||||
|
fis.close();
|
||||||
|
}catch(IOException e){
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ftp.logout();
|
||||||
|
result = true;
|
||||||
|
}catch(SocketException e){
|
||||||
|
e.printStackTrace();
|
||||||
|
}catch(IOException e){
|
||||||
|
e.printStackTrace();
|
||||||
|
}catch(Exception e){
|
||||||
|
e.printStackTrace();
|
||||||
|
}finally{
|
||||||
|
if(ftp != null && ftp.isConnected()){
|
||||||
|
try{ftp.disconnect(); } catch (IOException e){}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean FtpGet(String ip, int port, String id, String password,
|
||||||
|
String local_dir, String server_dir, String remote_fileName, String local_fileName){
|
||||||
|
boolean result = false;
|
||||||
|
FTPClient ftp = null;
|
||||||
|
int reply = 0;
|
||||||
|
try{
|
||||||
|
ftp = new FTPClient();
|
||||||
|
ftp.connect(ip, port);
|
||||||
|
logger.info("FTP Connect Success");
|
||||||
|
reply = ftp.getReplyCode();
|
||||||
|
if(!FTPReply.isPositiveCompletion(reply)){
|
||||||
|
logger.info("FTP Login Fail1");
|
||||||
|
ftp.disconnect();
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!ftp.login(id, password)){
|
||||||
|
logger.info("FTP Login Fail2");
|
||||||
|
ftp.logout();
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
logger.info("FTP Login Success");
|
||||||
|
ftp.setFileType(FTP.BINARY_FILE_TYPE);
|
||||||
|
ftp.enterLocalPassiveMode();
|
||||||
|
ftp.changeWorkingDirectory(server_dir);
|
||||||
|
File f = new File(local_dir, local_fileName);
|
||||||
|
FileOutputStream fos = null;
|
||||||
|
try{
|
||||||
|
fos = new FileOutputStream(f);
|
||||||
|
boolean isSuccess = ftp.retrieveFile(remote_fileName, fos);
|
||||||
|
result = isSuccess;
|
||||||
|
if(isSuccess){
|
||||||
|
logger.info("FTP Download Success ["+remote_fileName+"]");
|
||||||
|
}else{
|
||||||
|
logger.info("FTP Download Fail ["+remote_fileName+"]");
|
||||||
|
}
|
||||||
|
}catch(IOException e){
|
||||||
|
logger.info(getPrintStackTrace(e));
|
||||||
|
}finally{
|
||||||
|
if(fos != null) try{fos.close();} catch(IOException e){logger.error(getPrintStackTrace(e));}
|
||||||
|
}
|
||||||
|
ftp.logout();
|
||||||
|
}catch(SocketException e){
|
||||||
|
logger.error(getPrintStackTrace(e));
|
||||||
|
}catch(IOException e){
|
||||||
|
logger.error(getPrintStackTrace(e));
|
||||||
|
}catch(Exception e){
|
||||||
|
logger.error(getPrintStackTrace(e));
|
||||||
|
}finally{
|
||||||
|
if(ftp != null && ftp.isConnected()){
|
||||||
|
try{ftp.disconnect();} catch(IOException e){logger.error(getPrintStackTrace(e));}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Vector getFileInfo(String ip, int port, String id, String password,
|
||||||
|
String server_dir){
|
||||||
|
Vector vc = new Vector();
|
||||||
|
boolean result = false;
|
||||||
|
FTPClient ftp = null;
|
||||||
|
FTPFile[] files;
|
||||||
|
int reply = 0;
|
||||||
|
try{
|
||||||
|
ftp = new FTPClient();
|
||||||
|
ftp.connect(ip, port);
|
||||||
|
System.out.println("FTP Connection Success. IP="+ip);
|
||||||
|
reply = ftp.getReplyCode();
|
||||||
|
if(!FTPReply.isPositiveCompletion(reply)){
|
||||||
|
ftp.disconnect();
|
||||||
|
}
|
||||||
|
if(!ftp.login(id, password)){
|
||||||
|
ftp.logout();
|
||||||
|
}else{
|
||||||
|
System.out.println("FTP Login Success.");
|
||||||
|
}
|
||||||
|
ftp.setFileType(FTP.ASCII_FILE_TYPE);
|
||||||
|
ftp.enterLocalPassiveMode();
|
||||||
|
ftp.changeWorkingDirectory(server_dir);
|
||||||
|
try{
|
||||||
|
if(ftp.isConnected()){
|
||||||
|
files = ftp.listFiles(server_dir);
|
||||||
|
System.out.println(files.length + "Files In Target Folder.");
|
||||||
|
for (int i=0; i<files.length; i++){
|
||||||
|
vc.addElement(files[i].getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}catch(IOException e){
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}catch(SocketException e){
|
||||||
|
e.printStackTrace();
|
||||||
|
}catch(IOException e){
|
||||||
|
e.printStackTrace();
|
||||||
|
}catch(Exception e){
|
||||||
|
e.printStackTrace();
|
||||||
|
}finally{
|
||||||
|
if(ftp != null && ftp.isConnected()){
|
||||||
|
try{
|
||||||
|
ftp.disconnect();} catch(IOException e){e.printStackTrace();}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return vc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getPrintStackTrace(Exception e) {
|
||||||
|
|
||||||
|
StringWriter errors = new StringWriter();
|
||||||
|
e.printStackTrace(new PrintWriter(errors));
|
||||||
|
|
||||||
|
return errors.toString();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,190 @@
|
||||||
|
package kr.co.i4way.util;
|
||||||
|
|
||||||
|
import java.io.BufferedReader;
|
||||||
|
import java.io.BufferedWriter;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStreamReader;
|
||||||
|
import java.io.OutputStreamWriter;
|
||||||
|
import java.net.HttpURLConnection;
|
||||||
|
import java.net.MalformedURLException;
|
||||||
|
import java.net.URL;
|
||||||
|
|
||||||
|
import org.json.JSONException;
|
||||||
|
import org.json.JSONObject;
|
||||||
|
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import com.google.gson.GsonBuilder;
|
||||||
|
import com.google.gson.JsonArray;
|
||||||
|
import com.google.gson.JsonElement;
|
||||||
|
import com.google.gson.JsonObject;
|
||||||
|
import com.google.gson.JsonParser;
|
||||||
|
|
||||||
|
public class HttpUtil {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param params
|
||||||
|
* @param type
|
||||||
|
*/
|
||||||
|
public static JsonObject callApi_type_SIP_GW(String rest_url, String type){
|
||||||
|
|
||||||
|
HttpURLConnection conn = null;
|
||||||
|
JsonObject responseJson = null;
|
||||||
|
|
||||||
|
try {
|
||||||
|
//URL 설정
|
||||||
|
URL url = new URL(rest_url);
|
||||||
|
|
||||||
|
conn = (HttpURLConnection) url.openConnection();
|
||||||
|
|
||||||
|
// type의 경우 POST, GET, PUT, DELETE 가능
|
||||||
|
conn.setRequestMethod(type);
|
||||||
|
conn.setRequestProperty("Content-Type", "application/json");
|
||||||
|
conn.setRequestProperty("Transfer-Encoding", "chunked");
|
||||||
|
conn.setRequestProperty("Connection", "keep-alive");
|
||||||
|
conn.setRequestProperty("Authorization", "Basic QWRtaW46QWRtaW4=");
|
||||||
|
conn.setDoOutput(true);
|
||||||
|
|
||||||
|
// 보내고 결과값 받기
|
||||||
|
int responseCode = conn.getResponseCode();
|
||||||
|
if (responseCode == 200) {
|
||||||
|
BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream()));
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
String line = "";
|
||||||
|
while ((line = br.readLine()) != null) {
|
||||||
|
sb.append(line);
|
||||||
|
}
|
||||||
|
|
||||||
|
JsonParser jsonParser = new JsonParser();
|
||||||
|
JsonElement jsonElement = jsonParser.parse(sb.toString());
|
||||||
|
responseJson = jsonElement.getAsJsonObject();
|
||||||
|
|
||||||
|
// 응답 데이터
|
||||||
|
System.out.println("responseJson :: " + responseJson);
|
||||||
|
}
|
||||||
|
} catch (MalformedURLException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
} catch (JSONException e) {
|
||||||
|
System.out.println("not JSON Format response");
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return responseJson;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param params
|
||||||
|
* @param type
|
||||||
|
*/
|
||||||
|
public static JsonObject callApi_type_normal(String rest_url, String type){
|
||||||
|
|
||||||
|
HttpURLConnection conn = null;
|
||||||
|
JsonObject responseJson = null;
|
||||||
|
|
||||||
|
try {
|
||||||
|
//URL 설정
|
||||||
|
URL url = new URL(rest_url);
|
||||||
|
|
||||||
|
conn = (HttpURLConnection) url.openConnection();
|
||||||
|
|
||||||
|
// type의 경우 POST, GET, PUT, DELETE 가능
|
||||||
|
conn.setRequestMethod(type);
|
||||||
|
conn.setRequestProperty("Content-Type", "application/json");
|
||||||
|
conn.setRequestProperty("Transfer-Encoding", "chunked");
|
||||||
|
conn.setRequestProperty("Connection", "keep-alive");
|
||||||
|
conn.setDoOutput(true);
|
||||||
|
|
||||||
|
// 보내고 결과값 받기
|
||||||
|
int responseCode = conn.getResponseCode();
|
||||||
|
if (responseCode == 200) {
|
||||||
|
BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream()));
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
String line = "";
|
||||||
|
while ((line = br.readLine()) != null) {
|
||||||
|
sb.append(line);
|
||||||
|
}
|
||||||
|
JsonParser jsonParser = new JsonParser();
|
||||||
|
JsonElement jsonElement = jsonParser.parse(sb.toString());
|
||||||
|
responseJson = jsonElement.getAsJsonObject();
|
||||||
|
|
||||||
|
// 응답 데이터
|
||||||
|
System.out.println("responseJson :: " + responseJson);
|
||||||
|
}
|
||||||
|
} catch (MalformedURLException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
} catch (JSONException e) {
|
||||||
|
System.out.println("not JSON Format response");
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return responseJson;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param params
|
||||||
|
* @param type
|
||||||
|
*/
|
||||||
|
public static void callApi_type2(String rest_url, JsonObject params, String type){
|
||||||
|
|
||||||
|
HttpURLConnection conn = null;
|
||||||
|
JSONObject responseJson = null;
|
||||||
|
|
||||||
|
try {
|
||||||
|
//URL 설정
|
||||||
|
URL url = new URL(rest_url);
|
||||||
|
|
||||||
|
conn = (HttpURLConnection) url.openConnection();
|
||||||
|
|
||||||
|
// type의 경우 POST, GET, PUT, DELETE 가능
|
||||||
|
conn.setRequestMethod(type);
|
||||||
|
conn.setRequestProperty("Content-Type", "application/json");
|
||||||
|
conn.setRequestProperty("Transfer-Encoding", "chunked");
|
||||||
|
conn.setRequestProperty("Connection", "keep-alive");
|
||||||
|
conn.setDoOutput(true);
|
||||||
|
|
||||||
|
|
||||||
|
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(conn.getOutputStream()));
|
||||||
|
// JSON 형식의 데이터 셋팅
|
||||||
|
JsonObject commands = new JsonObject();
|
||||||
|
JsonArray jsonArray = new JsonArray();
|
||||||
|
|
||||||
|
params.addProperty("key", 1);
|
||||||
|
params.addProperty("age", 20);
|
||||||
|
params.addProperty("userNm", "홍길동");
|
||||||
|
|
||||||
|
commands.add("userInfo", params);
|
||||||
|
// JSON 형식의 데이터 셋팅 끝
|
||||||
|
|
||||||
|
// 데이터를 STRING으로 변경
|
||||||
|
Gson gson = new GsonBuilder().setPrettyPrinting().create();
|
||||||
|
String jsonOutput = gson.toJson(commands);
|
||||||
|
|
||||||
|
bw.write(commands.toString());
|
||||||
|
bw.flush();
|
||||||
|
bw.close();
|
||||||
|
|
||||||
|
// 보내고 결과값 받기
|
||||||
|
int responseCode = conn.getResponseCode();
|
||||||
|
if (responseCode == 200) {
|
||||||
|
BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream()));
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
String line = "";
|
||||||
|
while ((line = br.readLine()) != null) {
|
||||||
|
sb.append(line);
|
||||||
|
}
|
||||||
|
responseJson = new JSONObject(sb.toString());
|
||||||
|
|
||||||
|
// 응답 데이터
|
||||||
|
System.out.println("responseJson :: " + responseJson);
|
||||||
|
}
|
||||||
|
} catch (MalformedURLException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
} catch (JSONException e) {
|
||||||
|
System.out.println("not JSON Format response");
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,212 @@
|
||||||
|
package kr.co.i4way.util;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.core.JsonParseException;
|
||||||
|
import com.fasterxml.jackson.databind.JsonMappingException;
|
||||||
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
|
||||||
|
import kr.co.i4way.util.AES256;
|
||||||
|
import net.minidev.json.JSONArray;
|
||||||
|
import net.minidev.json.JSONObject;
|
||||||
|
import net.minidev.json.parser.JSONParser;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 일반문자열 유틸.
|
||||||
|
*
|
||||||
|
* @author someone
|
||||||
|
* @version 1.0.0
|
||||||
|
*/
|
||||||
|
public class JsonUtil {
|
||||||
|
|
||||||
|
@Value("${ccc-service.enc-iv}")
|
||||||
|
private String enc_iv;
|
||||||
|
|
||||||
|
@Value("${ccc-service.enc-key}")
|
||||||
|
private String enc_key;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Map을 json으로 변환한다.
|
||||||
|
*
|
||||||
|
* @param map Map<String, Object>.
|
||||||
|
* @return JSONObject.
|
||||||
|
*/
|
||||||
|
public static JSONObject getJsonStringFromMap( Map<String, Object> map )
|
||||||
|
{
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
for( Map.Entry<String, Object> entry : map.entrySet() ) {
|
||||||
|
String key = entry.getKey();
|
||||||
|
Object value = entry.getValue();
|
||||||
|
jsonObject.put(key, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
return jsonObject;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* List<Map>을 jsonArray로 변환한다.
|
||||||
|
*
|
||||||
|
* @param list List<Map<String, Object>>.
|
||||||
|
* @return JSONArray.
|
||||||
|
*/
|
||||||
|
public static JSONArray getJsonArrayFromList( List<Map<String, Object>> list )
|
||||||
|
{
|
||||||
|
JSONArray jsonArray = new JSONArray();
|
||||||
|
for( Map<String, Object> map : list ) {
|
||||||
|
jsonArray.add( getJsonStringFromMap( map ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
return jsonArray;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* List<Map>을 jsonString으로 변환한다.
|
||||||
|
*
|
||||||
|
* @param list List<Map<String, Object>>.
|
||||||
|
* @return String.
|
||||||
|
*/
|
||||||
|
public static String getJsonStringFromList( List<Map<String, Object>> list )
|
||||||
|
{
|
||||||
|
JSONArray jsonArray = getJsonArrayFromList( list );
|
||||||
|
return jsonArray.toJSONString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* JsonObject를 Map<String, String>으로 변환한다.
|
||||||
|
*
|
||||||
|
* @param jsonObj JSONObject.
|
||||||
|
* @return Map<String, Object>.
|
||||||
|
*/
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
public static Map<String, Object> getMapFromJsonObject( JSONObject jsonObj )
|
||||||
|
{
|
||||||
|
Map<String, Object> map = null;
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
|
map = new ObjectMapper().readValue(jsonObj.toJSONString(), Map.class) ;
|
||||||
|
|
||||||
|
} catch (JsonParseException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
} catch (JsonMappingException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* JsonArray를 List<Map<String, String>>으로 변환한다.
|
||||||
|
*
|
||||||
|
* @param jsonArray JSONArray.
|
||||||
|
* @return List<Map<String, Object>>.
|
||||||
|
*/
|
||||||
|
public static List<Map<String, Object>> getListMapFromJsonArray( JSONArray jsonArray )
|
||||||
|
{
|
||||||
|
List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
|
||||||
|
|
||||||
|
if( jsonArray != null )
|
||||||
|
{
|
||||||
|
int jsonSize = jsonArray.size();
|
||||||
|
for( int i = 0; i < jsonSize; i++ )
|
||||||
|
{
|
||||||
|
Map<String, Object> map = JsonUtil.getMapFromJsonObject( ( JSONObject ) jsonArray.get(i) );
|
||||||
|
list.add( map );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static Map<String, Object> decrypt_param(Map<String, Object> param, String enc_key, String enc_iv, String enc_yn){
|
||||||
|
Map<String, Object> rtn_param = null;
|
||||||
|
String decData;
|
||||||
|
try {
|
||||||
|
if(enc_yn.equals("Yes")) {
|
||||||
|
String encData = getParam(param, "encData", "S");
|
||||||
|
decData = AES256.decrypt(encData, enc_key, enc_iv);
|
||||||
|
JSONParser parser = new JSONParser(JSONParser.DEFAULT_PERMISSIVE_MODE);
|
||||||
|
JSONObject json = (JSONObject) parser.parse(decData);
|
||||||
|
rtn_param = JsonUtil.getMapFromJsonObject(json);
|
||||||
|
}else {
|
||||||
|
rtn_param = param;
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return rtn_param;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String decrypt_param3(String param, String enc_key, String enc_iv, String enc_yn){
|
||||||
|
String rtnjson = null;
|
||||||
|
String decData;
|
||||||
|
try {
|
||||||
|
if(enc_yn.equals("Yes")) {
|
||||||
|
String encData = param;
|
||||||
|
decData = AES256.decrypt(encData, enc_key, enc_iv);
|
||||||
|
JSONParser parser = new JSONParser(JSONParser.DEFAULT_PERMISSIVE_MODE);
|
||||||
|
rtnjson = (String) parser.parse(decData);
|
||||||
|
System.out.println(rtnjson);
|
||||||
|
}else {
|
||||||
|
rtnjson = param;
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return rtnjson;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static JSONObject decrypt_param2(Map<String, Object> param, String enc_key, String enc_iv, String enc_yn){
|
||||||
|
JSONObject rtnjson = null;
|
||||||
|
String decData;
|
||||||
|
try {
|
||||||
|
if(enc_yn.equals("Yes")) {
|
||||||
|
String encData = getParam(param, "encData", "S");
|
||||||
|
decData = AES256.decrypt(encData, enc_key, enc_iv);
|
||||||
|
JSONParser parser = new JSONParser(JSONParser.DEFAULT_PERMISSIVE_MODE);
|
||||||
|
rtnjson = (JSONObject) parser.parse(decData);
|
||||||
|
}else {
|
||||||
|
rtnjson = getJsonStringFromMap(param);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return rtnjson;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static JSONObject encrypt_param(JSONObject obj, String enc_key, String enc_iv, String enc_yn){
|
||||||
|
JSONObject encobj = new JSONObject();
|
||||||
|
try {
|
||||||
|
if(enc_yn.equals("Yes")) {
|
||||||
|
encobj.put("encData", AES256.encrypt(obj.toString(), enc_key, enc_iv));
|
||||||
|
}else {
|
||||||
|
encobj = obj;
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return encobj;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static String getParam(Map<String, Object> param, String qryStr, String type){
|
||||||
|
String rtnstr = "";
|
||||||
|
if(type.equals("I")){
|
||||||
|
rtnstr = "0";
|
||||||
|
}
|
||||||
|
try{
|
||||||
|
rtnstr = param.get(qryStr).toString();
|
||||||
|
}catch(Exception e){
|
||||||
|
//rtnstr = "";
|
||||||
|
}
|
||||||
|
return rtnstr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,183 @@
|
||||||
|
package kr.co.i4way.util;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileInputStream;
|
||||||
|
import java.io.FileNotFoundException;
|
||||||
|
import java.io.FileOutputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.util.Vector;
|
||||||
|
|
||||||
|
import com.jcraft.jsch.Channel;
|
||||||
|
import com.jcraft.jsch.ChannelSftp;
|
||||||
|
import com.jcraft.jsch.JSch;
|
||||||
|
import com.jcraft.jsch.JSchException;
|
||||||
|
import com.jcraft.jsch.Session;
|
||||||
|
import com.jcraft.jsch.SftpATTRS;
|
||||||
|
import com.jcraft.jsch.SftpException;
|
||||||
|
|
||||||
|
public class SFtpUtil {
|
||||||
|
|
||||||
|
public Session session = null;
|
||||||
|
private Channel channel = null;
|
||||||
|
public ChannelSftp channelSftp = null;
|
||||||
|
|
||||||
|
InputStream in = null;
|
||||||
|
FileOutputStream out = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 서버와 연결에 필요한 값들을 가져와 초기화 시킴
|
||||||
|
*
|
||||||
|
* @param host 서버 주소
|
||||||
|
* @param userName 아이디
|
||||||
|
* @param password 패스워드
|
||||||
|
* @param port 포트번호
|
||||||
|
* @param privateKey 개인키
|
||||||
|
*/
|
||||||
|
public void init(String host, String userName, String password, int port, String privateKey) {
|
||||||
|
|
||||||
|
JSch jSch = new JSch();
|
||||||
|
channel = null;
|
||||||
|
try {
|
||||||
|
if(!privateKey.equals("")) {//개인키가 존재한다면
|
||||||
|
jSch.addIdentity(privateKey);
|
||||||
|
}
|
||||||
|
session = jSch.getSession(userName, host, port);
|
||||||
|
|
||||||
|
if(privateKey.equals("") && password != null) {//개인키가 없다면 패스워드로 접속
|
||||||
|
session.setPassword(password);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 프로퍼티 설정
|
||||||
|
java.util.Properties config = new java.util.Properties();
|
||||||
|
config.put("StrictHostKeyChecking", "no"); // 접속 시 hostkeychecking 여부
|
||||||
|
session.setConfig(config);
|
||||||
|
session.connect();
|
||||||
|
//sftp로 접속
|
||||||
|
channel = session.openChannel("sftp");
|
||||||
|
channel.connect();
|
||||||
|
} catch (JSchException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
channelSftp = (ChannelSftp) channel;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 디렉토리 생성
|
||||||
|
*
|
||||||
|
* @param dir 이동할 주소
|
||||||
|
* @param mkdirName 생성할 디렉토리명
|
||||||
|
*/
|
||||||
|
public void mkdir(String dir, String mkdirName) {
|
||||||
|
if (!this.exists(dir + "/" + mkdirName)) {
|
||||||
|
try {
|
||||||
|
channelSftp.cd(dir);
|
||||||
|
channelSftp.mkdir(mkdirName);
|
||||||
|
} catch (SftpException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 디렉토리( or 파일) 존재 여부
|
||||||
|
* @param path 디렉토리 (or 파일)
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public boolean exists(String path) {
|
||||||
|
Vector res = null;
|
||||||
|
try {
|
||||||
|
res = channelSftp.ls(path);
|
||||||
|
} catch (SftpException e) {
|
||||||
|
if (e.id == ChannelSftp.SSH_FX_NO_SUCH_FILE) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return res != null && !res.isEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 파일 업로드
|
||||||
|
*
|
||||||
|
* @param dir 저장할 디렉토리
|
||||||
|
* @param file 저장할 파일
|
||||||
|
* @return 업로드 여부
|
||||||
|
*/
|
||||||
|
public boolean upload(String dir, File file) {
|
||||||
|
boolean isUpload = false;
|
||||||
|
SftpATTRS attrs;
|
||||||
|
in = null;
|
||||||
|
try {
|
||||||
|
in = new FileInputStream(file);
|
||||||
|
channelSftp.cd(dir);
|
||||||
|
channelSftp.put(in, file.getName());
|
||||||
|
|
||||||
|
// 업로드했는지 확인
|
||||||
|
if (this.exists(dir +"/"+file.getName())) {
|
||||||
|
isUpload = true;
|
||||||
|
}
|
||||||
|
} catch (SftpException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
} catch (FileNotFoundException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
} finally {
|
||||||
|
try {
|
||||||
|
in.close();
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return isUpload;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 파일 다운로드
|
||||||
|
*
|
||||||
|
* @param dir 다운로드 할 디렉토리
|
||||||
|
* @param downloadFileName 다운로드 할 파일
|
||||||
|
* @param path 다운로드 후 로컬에 저장될 경로(파일명)
|
||||||
|
*/
|
||||||
|
public void download(String dir, String downloadFileName, String path) {
|
||||||
|
out = null;
|
||||||
|
in = null;
|
||||||
|
try {
|
||||||
|
channelSftp.cd(dir);
|
||||||
|
in = channelSftp.get(downloadFileName);
|
||||||
|
} catch (SftpException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
out = new FileOutputStream(new File(path));
|
||||||
|
int i;
|
||||||
|
|
||||||
|
while ((i = in.read()) != -1) {
|
||||||
|
out.write(i);
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
} finally {
|
||||||
|
try {
|
||||||
|
out.close();
|
||||||
|
out = null;
|
||||||
|
in.close();
|
||||||
|
in = null;
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 연결 종료
|
||||||
|
*/
|
||||||
|
public void disconnection() {
|
||||||
|
channelSftp.quit();
|
||||||
|
channelSftp.disconnect();
|
||||||
|
channel.disconnect();
|
||||||
|
session.disconnect();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,44 @@
|
||||||
|
package kr.co.i4way.util;
|
||||||
|
|
||||||
|
import org.jasypt.encryption.StringEncryptor;
|
||||||
|
import org.jasypt.encryption.pbe.StandardPBEStringEncryptor;
|
||||||
|
import org.jasypt.encryption.pbe.config.SimpleStringPBEConfig;
|
||||||
|
|
||||||
|
import kr.co.i4way.util.JsonUtil;
|
||||||
|
|
||||||
|
public class Test {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
JsonUtil.decrypt_param3("tVIs1T89WnKMXFMUdO/BUA==", "12345678901234567890123456789012", "1234567890123456", "Yes");
|
||||||
|
// StringEncryptor newStringEncryptor = null;
|
||||||
|
// try {
|
||||||
|
// newStringEncryptor = createEncryptor("hyundai-motor");
|
||||||
|
// String resultText = newStringEncryptor.encrypt("HCCCWAS1!");
|
||||||
|
// System.out.println(resultText);
|
||||||
|
//
|
||||||
|
// } catch (Exception e) {
|
||||||
|
// // TODO Auto-generated catch block
|
||||||
|
// e.printStackTrace();
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
|
private static StringEncryptor createEncryptor(String password){
|
||||||
|
|
||||||
|
StandardPBEStringEncryptor encryptor = new StandardPBEStringEncryptor();
|
||||||
|
SimpleStringPBEConfig config = new SimpleStringPBEConfig();
|
||||||
|
config.setPassword(password);
|
||||||
|
config.setAlgorithm("PBEWithMD5AndTripleDES"); // 권장되는 기본 알고리즘
|
||||||
|
config.setKeyObtentionIterations("1000");
|
||||||
|
config.setPoolSize("1");
|
||||||
|
config.setSaltGeneratorClassName("org.jasypt.salt.RandomSaltGenerator");
|
||||||
|
config.setStringOutputType("base64");
|
||||||
|
encryptor.setConfig(config);
|
||||||
|
|
||||||
|
return encryptor;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,90 @@
|
||||||
|
server:
|
||||||
|
port: 8081
|
||||||
|
servlet:
|
||||||
|
session:
|
||||||
|
timeout: 30
|
||||||
|
ssl:
|
||||||
|
enabled: false
|
||||||
|
key-store: "/app/Gen_Web_API/cert/star_hmc_co_kr.jks"
|
||||||
|
key-store-password: "w853kx7q"
|
||||||
|
key-store-type: "JKS"
|
||||||
|
|
||||||
|
spring:
|
||||||
|
datasource:
|
||||||
|
mssql:
|
||||||
|
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
|
||||||
|
#jdbc-url: jdbc:sqlserver://10.5.150.92;databasename=HCTIETLDEV;encrypt=true;trustServerCertificate=true
|
||||||
|
jdbc-url: jdbc:sqlserver://172.168.30.61;databasename=RND_TEST;encrypt=true;trustServerCertificate=true
|
||||||
|
username: RND_USER
|
||||||
|
#password: icadmin321!
|
||||||
|
password: ENC(CrDt7e3wrVvyuU9mSCejDnTieWCdmCPS)
|
||||||
|
connection-test-query: SELECT 1
|
||||||
|
mssql-brd:
|
||||||
|
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
|
||||||
|
#jdbc-url: jdbc:sqlserver://10.5.150.92;databasename=HBRDDEV;encrypt=true;trustServerCertificate=true
|
||||||
|
jdbc-url: jdbc:sqlserver://172.168.30.61;databasename=RND_TEST;encrypt=true;trustServerCertificate=true
|
||||||
|
username: RND_USER
|
||||||
|
#password: icadmin321!
|
||||||
|
password: ENC(CrDt7e3wrVvyuU9mSCejDnTieWCdmCPS)
|
||||||
|
connection-test-query: SELECT 1
|
||||||
|
tibero:
|
||||||
|
driver-class-name: com.tmax.tibero.jdbc.TbDriver
|
||||||
|
jdbc-url: jdbc:tibero:thin:@10.5.150.55:1521:HCCCDev
|
||||||
|
username: HCCCWAS
|
||||||
|
#password: HCCCWAS1!
|
||||||
|
password: ENC(7k9EQwiyGj6Vt5sRGbOt/0mVHBr6dh/0)
|
||||||
|
connection-test-query: SELECT 1 from dual
|
||||||
|
jpa:
|
||||||
|
database-platform: org.hibernate.dialect.Oracle10gDialect
|
||||||
|
|
||||||
|
genesysinfo:
|
||||||
|
t_ip_p: 10.10.61.56
|
||||||
|
t_ip_b: 10.10.61.56
|
||||||
|
t_port_p: 3000
|
||||||
|
t_port_b: 3000
|
||||||
|
t_endpoint_p: T_EP_P
|
||||||
|
t_endpoint_b: T_EP_B
|
||||||
|
t_client_name: i4way_GPS_1
|
||||||
|
t_tenant_dbid: 1
|
||||||
|
t_charset: MS949
|
||||||
|
|
||||||
|
ccc-service:
|
||||||
|
user-service-url: http://10.5.150.93/api/IFCCC901?systemCode=CTI&changeDatetime=
|
||||||
|
org-service-url: http://10.5.150.93/api/IFCCC902?systemCode=CTI&changeDatetime=
|
||||||
|
enc-iv: 1234567890123456
|
||||||
|
enc-key: 12345678901234567890123456789012
|
||||||
|
#Yes : Encrypt On, No : Encrypt Off
|
||||||
|
enc-yn: No
|
||||||
|
cron:
|
||||||
|
user-service: 0 10 01 * * *
|
||||||
|
org-service: 0 20 01 * * *
|
||||||
|
|
||||||
|
rec-service:
|
||||||
|
license-url: https://h-dev-rec.hmc.co.kr/selectAllLicenseInfo.do
|
||||||
|
|
||||||
|
ftpinfo:
|
||||||
|
ftp_ip: 220.95.232.235
|
||||||
|
ftp_port: 21
|
||||||
|
id: i4way
|
||||||
|
#passwd: i4way!@#
|
||||||
|
passwd: ENC(Gvc51oxXTJjLbKaZQIOP4YEMGla5yPD7)
|
||||||
|
server_path: /home/i4way/korea_odam/
|
||||||
|
private_key:
|
||||||
|
local_path: ./weather/
|
||||||
|
|
||||||
|
boardinfo:
|
||||||
|
genesys_license: 555
|
||||||
|
uw_kt: 210
|
||||||
|
uw_toll: 60
|
||||||
|
uw_lg: 60
|
||||||
|
yd_kt: 90
|
||||||
|
server_type: dev
|
||||||
|
|
||||||
|
jasypt:
|
||||||
|
encryptor:
|
||||||
|
bean: jasyptStringEncryptor
|
||||||
|
property:
|
||||||
|
prefix: ENC(
|
||||||
|
suffix: )
|
||||||
|
|
||||||
|
#Password Encript Test Site : https://www.devglan.com/online-tools/jasypt-online-encryption-decryption
|
||||||
|
|
@ -0,0 +1,89 @@
|
||||||
|
server:
|
||||||
|
port: 8082
|
||||||
|
servlet:
|
||||||
|
session:
|
||||||
|
timeout: 30
|
||||||
|
ssl:
|
||||||
|
enabled: false
|
||||||
|
key-store: "/app/Gen_Web_API/cert/star_hmc_co_kr.jks"
|
||||||
|
key-store-password: "w853kx7q"
|
||||||
|
key-store-type: "JKS"
|
||||||
|
|
||||||
|
spring:
|
||||||
|
datasource:
|
||||||
|
mssql:
|
||||||
|
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
|
||||||
|
jdbc-url: jdbc:sqlserver://10.5.188.139;databasename=HCTIETLPRD;encrypt=true;trustServerCertificate=true
|
||||||
|
username: HCTIETLADM
|
||||||
|
password: ENC(0NvQrV/XiOyxCB+n6xL97JmMw1/kQlUc)
|
||||||
|
connection-test-query: SELECT 1
|
||||||
|
# mssql-brd:
|
||||||
|
# driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
|
||||||
|
# jdbc-url: jdbc:sqlserver://10.5.188.139;databasename=HBRDPRD;encrypt=true;trustServerCertificate=true
|
||||||
|
# username: HBRDADM
|
||||||
|
# password: ENC(0NvQrV/XiOyxCB+n6xL97JmMw1/kQlUc)
|
||||||
|
# connection-test-query: SELECT 1
|
||||||
|
# tibero:
|
||||||
|
# driver-class-name: com.tmax.tibero.jdbc.TbDriver
|
||||||
|
# jdbc-url: jdbc:tibero:thin:@10.5.188.229:1521:HCCCPrd
|
||||||
|
# username: HCCCWAS
|
||||||
|
# password: ENC(7k9EQwiyGj6Vt5sRGbOt/0mVHBr6dh/0)
|
||||||
|
# connection-test-query: SELECT 1 from dual
|
||||||
|
# jpa:
|
||||||
|
# database-platform: org.hibernate.dialect.Oracle10gDialect
|
||||||
|
|
||||||
|
genesysinfo:
|
||||||
|
t_ip_p: 10.10.61.54
|
||||||
|
t_ip_b: 10.10.61.55
|
||||||
|
t_port_p: 3000
|
||||||
|
t_port_b: 3000
|
||||||
|
t_endpoint_p: T_EP_P
|
||||||
|
t_endpoint_b: T_EP_B
|
||||||
|
t_client_name: i4way_service_sip
|
||||||
|
t_tenant_dbid: 1
|
||||||
|
t_charset: MS949
|
||||||
|
cron:
|
||||||
|
license-service: 0 0,30 * * * *
|
||||||
|
|
||||||
|
ccc-service:
|
||||||
|
user-service-url: https://h-ccc01.hmc.co.kr/api/IFCCC901?systemCode=CTI&changeDatetime=
|
||||||
|
org-service-url: https://h-ccc01.hmc.co.kr/api/IFCCC902?systemCode=CTI&changeDatetime=
|
||||||
|
enc-iv: 1234567890123456
|
||||||
|
enc-key: 12345678901234567890123456789012
|
||||||
|
#Yes : Encrypt On, No : Encrypt Off
|
||||||
|
enc-yn: No
|
||||||
|
cron:
|
||||||
|
user-service: 0 44 13 * * *
|
||||||
|
org-service: 0 20 01 * * *
|
||||||
|
|
||||||
|
rec-service:
|
||||||
|
license-url: https://h-rec.hmc.co.kr/selectAllLicenseInfo.do
|
||||||
|
cron:
|
||||||
|
license-service: 30 0,30 * * * *
|
||||||
|
|
||||||
|
ftpinfo:
|
||||||
|
ftp_ip: 220.95.232.235
|
||||||
|
ftp_port: 21
|
||||||
|
#passwd: i4way!@#
|
||||||
|
passwd: ENC(Gvc51oxXTJjLbKaZQIOP4YEMGla5yPD7)
|
||||||
|
server_path: /home/i4way/korea_odam/
|
||||||
|
private_key:
|
||||||
|
local_path: ./weather/
|
||||||
|
cron:
|
||||||
|
weather-service: 0 2,32 * * * *
|
||||||
|
|
||||||
|
boardinfo:
|
||||||
|
genesys_license: 555
|
||||||
|
uw_kt: 210
|
||||||
|
uw_toll: 60
|
||||||
|
uw_lg: 60
|
||||||
|
yd_kt: 90
|
||||||
|
server_type: prod
|
||||||
|
|
||||||
|
jasypt:
|
||||||
|
encryptor:
|
||||||
|
bean: jasyptStringEncryptor
|
||||||
|
property:
|
||||||
|
prefix: ENC(
|
||||||
|
suffix: )
|
||||||
|
#Password Encript Test Site : https://www.devglan.com/online-tools/jasypt-online-encryption-decryption
|
||||||
|
|
@ -0,0 +1,89 @@
|
||||||
|
server:
|
||||||
|
port: 8081
|
||||||
|
servlet:
|
||||||
|
session:
|
||||||
|
timeout: 30
|
||||||
|
ssl:
|
||||||
|
enabled: false
|
||||||
|
key-store: "/app/Gen_Web_API/cert/star_hmc_co_kr.jks"
|
||||||
|
key-store-password: "w853kx7q"
|
||||||
|
key-store-type: "JKS"
|
||||||
|
|
||||||
|
spring:
|
||||||
|
datasource:
|
||||||
|
mssql:
|
||||||
|
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
|
||||||
|
jdbc-url: jdbc:sqlserver://10.5.200.22;databasename=HCTIETLTST;encrypt=true;trustServerCertificate=true
|
||||||
|
username: HCTIETLADM
|
||||||
|
password: ENC(0NvQrV/XiOyxCB+n6xL97JmMw1/kQlUc)
|
||||||
|
connection-test-query: SELECT 1
|
||||||
|
mssql-brd:
|
||||||
|
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
|
||||||
|
jdbc-url: jdbc:sqlserver://10.5.200.22;databasename=HBRDTST;encrypt=true;trustServerCertificate=true
|
||||||
|
username: HBRDADM
|
||||||
|
password: ENC(0NvQrV/XiOyxCB+n6xL97JmMw1/kQlUc)
|
||||||
|
connection-test-query: SELECT 1
|
||||||
|
tibero:
|
||||||
|
driver-class-name: com.tmax.tibero.jdbc.TbDriver
|
||||||
|
jdbc-url: jdbc:tibero:thin:@10.5.200.106:1521:HCCCTst
|
||||||
|
username: HCCCWAS
|
||||||
|
password: ENC(7k9EQwiyGj6Vt5sRGbOt/0mVHBr6dh/0)
|
||||||
|
connection-test-query: SELECT 1 from dual
|
||||||
|
jpa:
|
||||||
|
database-platform: org.hibernate.dialect.Oracle10gDialect
|
||||||
|
|
||||||
|
genesysinfo:
|
||||||
|
t_ip_p: 10.10.61.54
|
||||||
|
t_ip_b: 10.10.61.55
|
||||||
|
t_port_p: 3000
|
||||||
|
t_port_b: 3000
|
||||||
|
t_endpoint_p: T_EP_P
|
||||||
|
t_endpoint_b: T_EP_B
|
||||||
|
t_client_name: i4way_service_sip
|
||||||
|
t_tenant_dbid: 1
|
||||||
|
t_charset: MS949
|
||||||
|
cron:
|
||||||
|
license-service: 0 0,30 * * * *
|
||||||
|
|
||||||
|
ccc-service:
|
||||||
|
user-service-url: https://h-stg-ccc01.hmc.co.kr/api/IFCCC901?systemCode=CTI&changeDatetime=
|
||||||
|
org-service-url: https://h-stg-ccc01.hmc.co.kr/api/IFCCC902?systemCode=CTI&changeDatetime=
|
||||||
|
enc-iv: 1234567890123456
|
||||||
|
enc-key: 12345678901234567890123456789012
|
||||||
|
#Yes : Encrypt On, No : Encrypt Off
|
||||||
|
enc-yn: No
|
||||||
|
cron:
|
||||||
|
user-service: 0 44 10 * * *
|
||||||
|
org-service: 0 20 01 * * *
|
||||||
|
|
||||||
|
rec-service:
|
||||||
|
license-url: https://h-rec.hmc.co.kr/selectAllLicenseInfo.do
|
||||||
|
cron:
|
||||||
|
license-service: 30 0,30 * * * *
|
||||||
|
|
||||||
|
ftpinfo:
|
||||||
|
ftp_ip: 220.95.232.235
|
||||||
|
ftp_port: 21
|
||||||
|
#passwd: i4way!@#
|
||||||
|
passwd: ENC(Gvc51oxXTJjLbKaZQIOP4YEMGla5yPD7)
|
||||||
|
server_path: /home/i4way/korea_odam/
|
||||||
|
private_key:
|
||||||
|
local_path: ./weather/
|
||||||
|
cron:
|
||||||
|
weather-service: 0 2,32 * * * *
|
||||||
|
|
||||||
|
boardinfo:
|
||||||
|
genesys_license: 555
|
||||||
|
uw_kt: 210
|
||||||
|
uw_toll: 60
|
||||||
|
uw_lg: 60
|
||||||
|
yd_kt: 90
|
||||||
|
server_type: prod
|
||||||
|
|
||||||
|
jasypt:
|
||||||
|
encryptor:
|
||||||
|
bean: jasyptStringEncryptor
|
||||||
|
property:
|
||||||
|
prefix: ENC(
|
||||||
|
suffix: )
|
||||||
|
#Password Encript Test Site : https://www.devglan.com/online-tools/jasypt-online-encryption-decryption
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
|
||||||
|
|
@ -0,0 +1,39 @@
|
||||||
|
server:
|
||||||
|
port: 8080
|
||||||
|
servlet:
|
||||||
|
session:
|
||||||
|
timeout: 30
|
||||||
|
ssl:
|
||||||
|
enabled: false
|
||||||
|
key-store: "/app/Gen_Web_API/cert/star_hmc_co_kr.jks"
|
||||||
|
key-store-password: "w853kx7q"
|
||||||
|
key-store-type: "JKS"
|
||||||
|
|
||||||
|
ftpinfo:
|
||||||
|
ftp_ip: 220.95.232.235
|
||||||
|
ftp_port: 21
|
||||||
|
id: i4way
|
||||||
|
passwd: i4way!@#
|
||||||
|
server_path: /home/i4way/korea_odam/
|
||||||
|
private_key:
|
||||||
|
local_path: ./weather/
|
||||||
|
|
||||||
|
boardinfo:
|
||||||
|
genesys_license: 555
|
||||||
|
uw_kt: 210
|
||||||
|
uw_toll: 60
|
||||||
|
uw_lg: 60
|
||||||
|
yd_kt: 90
|
||||||
|
|
||||||
|
---
|
||||||
|
spring:
|
||||||
|
profiles:
|
||||||
|
active: prod
|
||||||
|
---
|
||||||
|
spring:
|
||||||
|
profiles:
|
||||||
|
active: dev
|
||||||
|
---
|
||||||
|
spring:
|
||||||
|
profiles:
|
||||||
|
active: stg
|
||||||
|
|
@ -0,0 +1,42 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<configuration>
|
||||||
|
|
||||||
|
<!-- 로그파일 저장 경로 -->
|
||||||
|
<property name="LOG_DIR" value="/logfs/I4WAY_Genesys_Service/log" />
|
||||||
|
|
||||||
|
<!-- CONSOLE -->
|
||||||
|
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
|
||||||
|
<layout class="ch.qos.logback.classic.PatternLayout">
|
||||||
|
<Pattern>
|
||||||
|
[%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS} : %30logger{5} - %msg%n
|
||||||
|
</Pattern>
|
||||||
|
</layout>
|
||||||
|
</appender>
|
||||||
|
<!-- // CONSOLE -->
|
||||||
|
<!-- SYSLOG -->
|
||||||
|
<appender name="SYSLOG" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<file>${LOG_DIR}/I4WAY_Genesys_Service_log.log</file>
|
||||||
|
<layout class="ch.qos.logback.classic.PatternLayout">
|
||||||
|
<Pattern>
|
||||||
|
[%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS} : %30logger{5} - %msg%n
|
||||||
|
</Pattern>
|
||||||
|
</layout>
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
|
<fileNamePattern>${LOG_DIR}/I4WAY_Genesys_Service_log.%d{yyyy-MM-dd}.%i.log</fileNamePattern>
|
||||||
|
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
|
||||||
|
<maxFileSize>30MB</maxFileSize>
|
||||||
|
</timeBasedFileNamingAndTriggeringPolicy>
|
||||||
|
<maxHistory>30</maxHistory>
|
||||||
|
</rollingPolicy>
|
||||||
|
</appender>
|
||||||
|
<!-- // SYSLOG -->
|
||||||
|
|
||||||
|
<root level="info">
|
||||||
|
<appender-ref ref="CONSOLE" />
|
||||||
|
<appender-ref ref="SYSLOG" />
|
||||||
|
</root>
|
||||||
|
<logger name="com.example.logbackStudy" level="debug" additivity="false">
|
||||||
|
<appender-ref ref="CONSOLE" />
|
||||||
|
</logger>
|
||||||
|
|
||||||
|
</configuration>
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd">
|
||||||
|
|
||||||
|
<configuration>
|
||||||
|
<settings>
|
||||||
|
<setting name="mapUnderscoreToCamelCase" value="true"/>
|
||||||
|
<setting name="callSettersOnNulls" value="true"/>
|
||||||
|
<setting name="jdbcTypeForNull" value="NULL"/>
|
||||||
|
</settings>
|
||||||
|
</configuration>
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>Insert title here</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
Hello World!!
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
package kr.co.i4way;
|
||||||
|
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
|
|
||||||
|
@SpringBootTest
|
||||||
|
class I4WayGenesysServiceApplicationTests {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void contextLoads() {
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,105 @@
|
||||||
|
server:
|
||||||
|
port: 8080
|
||||||
|
servlet:
|
||||||
|
session:
|
||||||
|
timeout: 30
|
||||||
|
ssl:
|
||||||
|
enabled: false
|
||||||
|
key-store: "/app/Gen_Web_API/cert/star_hmc_co_kr.jks"
|
||||||
|
key-store-password: "w853kx7q"
|
||||||
|
key-store-type: "JKS"
|
||||||
|
|
||||||
|
spring:
|
||||||
|
datasource:
|
||||||
|
mssql:
|
||||||
|
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
|
||||||
|
jdbc-url: jdbc:sqlserver://10.5.188.139;databasename=HCTIETLPRD;encrypt=true;trustServerCertificate=true
|
||||||
|
username: HCTIETLADM
|
||||||
|
password: ENC(0NvQrV/XiOyxCB+n6xL97JmMw1/kQlUc)
|
||||||
|
connection-test-query: SELECT 1
|
||||||
|
mssql-brd:
|
||||||
|
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
|
||||||
|
jdbc-url: jdbc:sqlserver://10.5.188.139;databasename=HBRDPRD;encrypt=true;trustServerCertificate=true
|
||||||
|
username: HBRDADM
|
||||||
|
password: ENC(0NvQrV/XiOyxCB+n6xL97JmMw1/kQlUc)
|
||||||
|
connection-test-query: SELECT 1
|
||||||
|
tibero:
|
||||||
|
driver-class-name: com.tmax.tibero.jdbc.TbDriver
|
||||||
|
jdbc-url: jdbc:tibero:thin:@10.5.188.229:1521:HCCCPrd
|
||||||
|
username: HCCCWAS
|
||||||
|
password: ENC(7k9EQwiyGj6Vt5sRGbOt/0mVHBr6dh/0)
|
||||||
|
connection-test-query: SELECT 1 from dual
|
||||||
|
jpa:
|
||||||
|
database-platform: org.hibernate.dialect.Oracle10gDialect
|
||||||
|
|
||||||
|
genesysinfo:
|
||||||
|
cfg_ip_p: 10.10.61.29
|
||||||
|
cfg_ip_b: 10.10.61.29
|
||||||
|
cfg_port_p: 2020
|
||||||
|
cfg_port_b: 2020
|
||||||
|
cfg_endpoint_p: Cfg_EP_P
|
||||||
|
cfg_endpoint_b: Cfg_EP_B
|
||||||
|
cfg_client_name: default
|
||||||
|
cfg_tenant_dbid: 1
|
||||||
|
cfg_switch_dbid: 101
|
||||||
|
cfg_switch_dbid2: 0
|
||||||
|
cfg_id: apiadm
|
||||||
|
#cfg_passwd: ENC(aQJKA/qeRV9noXEeDGRLJ6jP7iIvn43K)
|
||||||
|
cfg_passwd: apiadm
|
||||||
|
cfg_charset: MS949
|
||||||
|
oc_ip_p: 10.10.61.29
|
||||||
|
oc_port_p: 2030
|
||||||
|
oc_id: apiadm
|
||||||
|
#oc_passwd: ENC(aQJKA/qeRV9noXEeDGRLJ6jP7iIvn43K)
|
||||||
|
oc_passwd: apiadm
|
||||||
|
oc_client_id:
|
||||||
|
oc_client_passwd:
|
||||||
|
oc_charset: MS949
|
||||||
|
stat_ip_p: 10.10.61.29
|
||||||
|
stat_port_p: 2032
|
||||||
|
stat_ip_b: 10.10.61.29
|
||||||
|
stat_port_b: 2032
|
||||||
|
stat_charset: MS949
|
||||||
|
stat_endpoint1: statserver_rtm
|
||||||
|
stat_endpoint2: statserver_rtm
|
||||||
|
stat_clientname: gps_stat
|
||||||
|
stat_tenant: Environment
|
||||||
|
stat_tenantdbid: 1
|
||||||
|
stat_switch: Switch
|
||||||
|
stat_frequency: 1
|
||||||
|
stat_lastrefid: 679
|
||||||
|
sc_ip_p: 10.10.61.29
|
||||||
|
sc_ip_b: 10.10.61.29
|
||||||
|
sc_port_p: 2024
|
||||||
|
sc_port_b: 2024
|
||||||
|
sc_endpoint_p: Sc_EP_P
|
||||||
|
sc_endpoint_b: Sc_EP_B
|
||||||
|
sc_client_name: i4way_GPS_1
|
||||||
|
sc_id: apiadm
|
||||||
|
sc_tenant_dbid: 1
|
||||||
|
sc_client_dbid: 106
|
||||||
|
sc_charset: MS949
|
||||||
|
sc_monitoring_dbids: 107,112,113,117,118,119
|
||||||
|
t_ip_p: 10.10.61.56
|
||||||
|
t_ip_b: 10.10.61.56
|
||||||
|
t_port_p: 3000
|
||||||
|
t_port_b: 3000
|
||||||
|
t_endpoint_p: T_EP_P
|
||||||
|
t_endpoint_b: T_EP_B
|
||||||
|
t_client_name: i4way_GPS_1
|
||||||
|
t_tenant_dbid: 1
|
||||||
|
t_charset: MS949
|
||||||
|
|
||||||
|
ccc-service:
|
||||||
|
enc-iv: 1234567890123456
|
||||||
|
enc-key: 12345678901234567890123456789012
|
||||||
|
#Yes : Encrypt On, No : Encrypt Off
|
||||||
|
#enc-yn: 'Yes'
|
||||||
|
enc-yn: 'No'
|
||||||
|
|
||||||
|
jasypt:
|
||||||
|
encryptor:
|
||||||
|
bean: jasyptStringEncryptor
|
||||||
|
property:
|
||||||
|
prefix: ENC(
|
||||||
|
suffix: )
|
||||||
|
|
@ -0,0 +1,106 @@
|
||||||
|
server:
|
||||||
|
port: 8080
|
||||||
|
servlet:
|
||||||
|
session:
|
||||||
|
timeout: 30
|
||||||
|
ssl:
|
||||||
|
enabled: false
|
||||||
|
key-store: "/app/Gen_Web_API/cert/star_hmc_co_kr.jks"
|
||||||
|
key-store-password: "w853kx7q"
|
||||||
|
key-store-type: "JKS"
|
||||||
|
|
||||||
|
spring:
|
||||||
|
datasource:
|
||||||
|
mssql:
|
||||||
|
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
|
||||||
|
jdbc-url: jdbc:sqlserver://10.5.188.139;databasename=HCTIETLPRD;encrypt=true;trustServerCertificate=true
|
||||||
|
username: HCTIETLADM
|
||||||
|
password: ENC(0NvQrV/XiOyxCB+n6xL97JmMw1/kQlUc)
|
||||||
|
connection-test-query: SELECT 1
|
||||||
|
mssql-brd:
|
||||||
|
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
|
||||||
|
jdbc-url: jdbc:sqlserver://10.5.188.139;databasename=HBRDPRD;encrypt=true;trustServerCertificate=true
|
||||||
|
username: HBRDADM
|
||||||
|
password: ENC(0NvQrV/XiOyxCB+n6xL97JmMw1/kQlUc)
|
||||||
|
connection-test-query: SELECT 1
|
||||||
|
tibero:
|
||||||
|
driver-class-name: com.tmax.tibero.jdbc.TbDriver
|
||||||
|
jdbc-url: jdbc:tibero:thin:@10.5.188.229:1521:HCCCPrd
|
||||||
|
username: HCCCWAS
|
||||||
|
password: ENC(7k9EQwiyGj6Vt5sRGbOt/0mVHBr6dh/0)
|
||||||
|
connection-test-query: SELECT 1 from dual
|
||||||
|
jpa:
|
||||||
|
database-platform: org.hibernate.dialect.Oracle10gDialect
|
||||||
|
|
||||||
|
ccc-service:
|
||||||
|
enc-iv: 1234567890123456
|
||||||
|
enc-key: 12345678901234567890123456789012
|
||||||
|
#Yes : Encrypt On, No : Encrypt Off
|
||||||
|
enc-yn: Yes
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
genesysinfo:
|
||||||
|
cfg_ip_p: hctipapp01.hmc.co.kr
|
||||||
|
cfg_ip_b: hctipapp02.hmc.co.kr
|
||||||
|
cfg_port_p: 2020
|
||||||
|
cfg_port_b: 2020
|
||||||
|
cfg_endpoint_p: Cfg_EP_P
|
||||||
|
cfg_endpoint_b: Cfg_EP_B
|
||||||
|
cfg_client_name: default
|
||||||
|
cfg_tenant_dbid: 1
|
||||||
|
cfg_switch_dbid: 101
|
||||||
|
cfg_switch_dbid2: 102
|
||||||
|
cfg_id: ctiadm
|
||||||
|
cfg_passwd: ENC(0NvQrV/XiOyxCB+n6xL97JmMw1/kQlUc)
|
||||||
|
cfg_charset: MS949
|
||||||
|
oc_ip_p: hctipapp01.hmc.co.kr
|
||||||
|
oc_port_p: 7001
|
||||||
|
oc_id: ctiadm
|
||||||
|
oc_passwd: ENC(0NvQrV/XiOyxCB+n6xL97JmMw1/kQlUc)
|
||||||
|
oc_client_id:
|
||||||
|
oc_client_passwd:
|
||||||
|
oc_charset: MS949
|
||||||
|
stat_ip_p: hctipapp01.hmc.co.kr
|
||||||
|
stat_port_p: 2034
|
||||||
|
stat_ip_b: hctipapp02.hmc.co.kr
|
||||||
|
stat_port_b: 2034
|
||||||
|
stat_charset: MS949
|
||||||
|
stat_endpoint1: statserver_brd
|
||||||
|
stat_endpoint2: statserver_brd_b
|
||||||
|
stat_clientname: i4way_service_stat
|
||||||
|
stat_tenant: Environment
|
||||||
|
stat_tenantdbid: 1
|
||||||
|
stat_switch: Switch_SIP
|
||||||
|
stat_frequency: 1
|
||||||
|
stat_lastrefid: 679
|
||||||
|
sc_ip_p: hctipapp01.hmc.co.kr
|
||||||
|
sc_ip_b: hctipapp02.hmc.co.kr
|
||||||
|
sc_port_p: 2024
|
||||||
|
sc_port_b: 2024
|
||||||
|
sc_endpoint_p: Sc_EP_P
|
||||||
|
sc_endpoint_b: Sc_EP_B
|
||||||
|
sc_client_name: i4way_service_sc
|
||||||
|
sc_id: ctiadm
|
||||||
|
sc_tenant_dbid: 1
|
||||||
|
sc_client_dbid: 108
|
||||||
|
sc_charset: MS949
|
||||||
|
sc_monitoring_dbids: 99,109,110,111,167,168,172,174,161,162,121,122,123,124
|
||||||
|
t_ip_p: 10.10.61.54
|
||||||
|
t_ip_b: 10.10.61.55
|
||||||
|
t_port_p: 3000
|
||||||
|
t_port_b: 3000
|
||||||
|
t_endpoint_p: T_EP_P
|
||||||
|
t_endpoint_b: T_EP_B
|
||||||
|
t_client_name: i4way_service_sip
|
||||||
|
t_tenant_dbid: 1
|
||||||
|
t_charset: MS949
|
||||||
|
|
||||||
|
|
||||||
|
jasypt:
|
||||||
|
encryptor:
|
||||||
|
bean: jasyptStringEncryptor
|
||||||
|
property:
|
||||||
|
prefix: ENC(
|
||||||
|
suffix: )
|
||||||
|
#Password Encript Test Site : https://www.devglan.com/online-tools/jasypt-online-encryption-decryption
|
||||||
|
|
@ -0,0 +1,106 @@
|
||||||
|
server:
|
||||||
|
port: 8080
|
||||||
|
servlet:
|
||||||
|
session:
|
||||||
|
timeout: 30
|
||||||
|
ssl:
|
||||||
|
enabled: false
|
||||||
|
key-store: "/app/Gen_Web_API/cert/star_hmc_co_kr.jks"
|
||||||
|
key-store-password: "w853kx7q"
|
||||||
|
key-store-type: "JKS"
|
||||||
|
|
||||||
|
spring:
|
||||||
|
datasource:
|
||||||
|
mssql:
|
||||||
|
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
|
||||||
|
jdbc-url: jdbc:sqlserver://10.5.188.139;databasename=HCTIETLPRD;encrypt=true;trustServerCertificate=true
|
||||||
|
username: HCTIETLADM
|
||||||
|
password: ENC(0NvQrV/XiOyxCB+n6xL97JmMw1/kQlUc)
|
||||||
|
connection-test-query: SELECT 1
|
||||||
|
mssql-brd:
|
||||||
|
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
|
||||||
|
jdbc-url: jdbc:sqlserver://10.5.188.139;databasename=HBRDPRD;encrypt=true;trustServerCertificate=true
|
||||||
|
username: HBRDADM
|
||||||
|
password: ENC(0NvQrV/XiOyxCB+n6xL97JmMw1/kQlUc)
|
||||||
|
connection-test-query: SELECT 1
|
||||||
|
tibero:
|
||||||
|
driver-class-name: com.tmax.tibero.jdbc.TbDriver
|
||||||
|
jdbc-url: jdbc:tibero:thin:@10.5.188.229:1521:HCCCPrd
|
||||||
|
username: HCCCWAS
|
||||||
|
password: ENC(7k9EQwiyGj6Vt5sRGbOt/0mVHBr6dh/0)
|
||||||
|
connection-test-query: SELECT 1 from dual
|
||||||
|
jpa:
|
||||||
|
database-platform: org.hibernate.dialect.Oracle10gDialect
|
||||||
|
|
||||||
|
ccc-service:
|
||||||
|
enc-iv: 1234567890123456
|
||||||
|
enc-key: 12345678901234567890123456789012
|
||||||
|
#Yes : Encrypt On, No : Encrypt Off
|
||||||
|
enc-yn: Yes
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
genesysinfo:
|
||||||
|
cfg_ip_p: 10.10.61.70
|
||||||
|
cfg_ip_b: 10.10.61.71
|
||||||
|
cfg_port_p: 2020
|
||||||
|
cfg_port_b: 2020
|
||||||
|
cfg_endpoint_p: Cfg_EP_P
|
||||||
|
cfg_endpoint_b: Cfg_EP_B
|
||||||
|
cfg_client_name: default
|
||||||
|
cfg_tenant_dbid: 1
|
||||||
|
cfg_switch_dbid: 101
|
||||||
|
cfg_switch_dbid2: 0
|
||||||
|
cfg_id: ctiadm
|
||||||
|
cfg_passwd: ENC(0NvQrV/XiOyxCB+n6xL97JmMw1/kQlUc)
|
||||||
|
cfg_charset: MS949
|
||||||
|
oc_ip_p: 10.10.61.70
|
||||||
|
oc_port_p: 7001
|
||||||
|
oc_id: ctiadm
|
||||||
|
oc_passwd: ENC(0NvQrV/XiOyxCB+n6xL97JmMw1/kQlUc)
|
||||||
|
oc_client_id:
|
||||||
|
oc_client_passwd:
|
||||||
|
oc_charset: MS949
|
||||||
|
stat_ip_p: 10.10.61.70
|
||||||
|
stat_port_p: 2034
|
||||||
|
stat_ip_b: 10.10.61.71
|
||||||
|
stat_port_b: 2034
|
||||||
|
stat_charset: MS949
|
||||||
|
stat_endpoint1: statserver_brd
|
||||||
|
stat_endpoint2: statserver_brd_b
|
||||||
|
stat_clientname: i4way_service_stat
|
||||||
|
stat_tenant: Environment
|
||||||
|
stat_tenantdbid: 1
|
||||||
|
stat_switch: Switch_SIP
|
||||||
|
stat_frequency: 1
|
||||||
|
stat_lastrefid: 679
|
||||||
|
sc_ip_p: 10.10.61.70
|
||||||
|
sc_ip_b: 10.10.61.71
|
||||||
|
sc_port_p: 2024
|
||||||
|
sc_port_b: 2024
|
||||||
|
sc_endpoint_p: Sc_EP_P
|
||||||
|
sc_endpoint_b: Sc_EP_B
|
||||||
|
sc_client_name: i4way_service_sc
|
||||||
|
sc_id: ctiadm
|
||||||
|
sc_tenant_dbid: 1
|
||||||
|
sc_client_dbid: 108
|
||||||
|
sc_charset: MS949
|
||||||
|
sc_monitoring_dbids: 99,109,110,111,167,168,172,174,161,162,121,122,123,124
|
||||||
|
t_ip_p: 10.10.61.77
|
||||||
|
t_ip_b: 10.10.61.78
|
||||||
|
t_port_p: 3000
|
||||||
|
t_port_b: 3000
|
||||||
|
t_endpoint_p: T_EP_P
|
||||||
|
t_endpoint_b: T_EP_B
|
||||||
|
t_client_name: i4way_service_sip
|
||||||
|
t_tenant_dbid: 1
|
||||||
|
t_charset: MS949
|
||||||
|
|
||||||
|
|
||||||
|
jasypt:
|
||||||
|
encryptor:
|
||||||
|
bean: jasyptStringEncryptor
|
||||||
|
property:
|
||||||
|
prefix: ENC(
|
||||||
|
suffix: )
|
||||||
|
#Password Encript Test Site : https://www.devglan.com/online-tools/jasypt-online-encryption-decryption
|
||||||
|
|
@ -0,0 +1,37 @@
|
||||||
|
server:
|
||||||
|
port: 8080
|
||||||
|
servlet:
|
||||||
|
session:
|
||||||
|
timeout: 30
|
||||||
|
ssl:
|
||||||
|
enabled: false
|
||||||
|
key-store: "/app/Gen_Web_API/cert/star_hmc_co_kr.jks"
|
||||||
|
key-store-password: "w853kx7q"
|
||||||
|
key-store-type: "JKS"
|
||||||
|
|
||||||
|
spring:
|
||||||
|
profiles:
|
||||||
|
default: dev
|
||||||
|
group:
|
||||||
|
dev:
|
||||||
|
- dev
|
||||||
|
prod:
|
||||||
|
- prod
|
||||||
|
stg:
|
||||||
|
- stg
|
||||||
|
|
||||||
|
---
|
||||||
|
spring:
|
||||||
|
config:
|
||||||
|
activate:
|
||||||
|
on-profile: prod
|
||||||
|
---
|
||||||
|
spring:
|
||||||
|
config:
|
||||||
|
activate:
|
||||||
|
on-profile: dev
|
||||||
|
---
|
||||||
|
spring:
|
||||||
|
config:
|
||||||
|
activate:
|
||||||
|
on-profile: stg
|
||||||
|
|
@ -0,0 +1,42 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<configuration>
|
||||||
|
|
||||||
|
<!-- 로그파일 저장 경로 -->
|
||||||
|
<property name="LOG_DIR" value="/logfs/genesys/I4WAY-Genesys-Service/log" />
|
||||||
|
|
||||||
|
<!-- CONSOLE -->
|
||||||
|
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
|
||||||
|
<layout class="ch.qos.logback.classic.PatternLayout">
|
||||||
|
<Pattern>
|
||||||
|
[%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS} : %30logger{5} - %msg%n
|
||||||
|
</Pattern>
|
||||||
|
</layout>
|
||||||
|
</appender>
|
||||||
|
<!-- // CONSOLE -->
|
||||||
|
<!-- SYSLOG -->
|
||||||
|
<appender name="SYSLOG" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<file>${LOG_DIR}/log.log</file>
|
||||||
|
<layout class="ch.qos.logback.classic.PatternLayout">
|
||||||
|
<Pattern>
|
||||||
|
[%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS} : %30logger{5} - %msg%n
|
||||||
|
</Pattern>
|
||||||
|
</layout>
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
|
<fileNamePattern>${LOG_DIR}/log.%d{yyyy-MM-dd}.%i.log</fileNamePattern>
|
||||||
|
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
|
||||||
|
<maxFileSize>30MB</maxFileSize>
|
||||||
|
</timeBasedFileNamingAndTriggeringPolicy>
|
||||||
|
<maxHistory>30</maxHistory>
|
||||||
|
</rollingPolicy>
|
||||||
|
</appender>
|
||||||
|
<!-- // SYSLOG -->
|
||||||
|
|
||||||
|
<root level="info">
|
||||||
|
<appender-ref ref="CONSOLE" />
|
||||||
|
<appender-ref ref="SYSLOG" />
|
||||||
|
</root>
|
||||||
|
<logger name="com.example.logbackStudy" level="debug" additivity="false">
|
||||||
|
<appender-ref ref="CONSOLE" />
|
||||||
|
</logger>
|
||||||
|
|
||||||
|
</configuration>
|
||||||
Loading…
Reference in New Issue