@ -0,0 +1,3 @@
|
||||
<component name="ProjectDictionaryState">
|
||||
<dictionary name="lanxuewei" />
|
||||
</component>
|
||||
@ -0,0 +1,13 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: org.attoparser:attoparser:2.0.4.RELEASE">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/maven/repository/org/attoparser/attoparser/2.0.4.RELEASE/attoparser-2.0.4.RELEASE.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$USER_HOME$/maven/repository/org/attoparser/attoparser/2.0.4.RELEASE/attoparser-2.0.4.RELEASE-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$USER_HOME$/maven/repository/org/attoparser/attoparser/2.0.4.RELEASE/attoparser-2.0.4.RELEASE-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
@ -0,0 +1,13 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: org.springframework.boot:spring-boot-devtools:2.0.0.RELEASE">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/maven/repository/org/springframework/boot/spring-boot-devtools/2.0.0.RELEASE/spring-boot-devtools-2.0.0.RELEASE.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$USER_HOME$/maven/repository/org/springframework/boot/spring-boot-devtools/2.0.0.RELEASE/spring-boot-devtools-2.0.0.RELEASE-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$USER_HOME$/maven/repository/org/springframework/boot/spring-boot-devtools/2.0.0.RELEASE/spring-boot-devtools-2.0.0.RELEASE-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
@ -0,0 +1,13 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: org.springframework.boot:spring-boot-starter-thymeleaf:2.0.0.RELEASE">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/maven/repository/org/springframework/boot/spring-boot-starter-thymeleaf/2.0.0.RELEASE/spring-boot-starter-thymeleaf-2.0.0.RELEASE.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$USER_HOME$/maven/repository/org/springframework/boot/spring-boot-starter-thymeleaf/2.0.0.RELEASE/spring-boot-starter-thymeleaf-2.0.0.RELEASE-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$USER_HOME$/maven/repository/org/springframework/boot/spring-boot-starter-thymeleaf/2.0.0.RELEASE/spring-boot-starter-thymeleaf-2.0.0.RELEASE-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
@ -0,0 +1,13 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: org.thymeleaf.extras:thymeleaf-extras-java8time:3.0.1.RELEASE">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/maven/repository/org/thymeleaf/extras/thymeleaf-extras-java8time/3.0.1.RELEASE/thymeleaf-extras-java8time-3.0.1.RELEASE.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$USER_HOME$/maven/repository/org/thymeleaf/extras/thymeleaf-extras-java8time/3.0.1.RELEASE/thymeleaf-extras-java8time-3.0.1.RELEASE-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$USER_HOME$/maven/repository/org/thymeleaf/extras/thymeleaf-extras-java8time/3.0.1.RELEASE/thymeleaf-extras-java8time-3.0.1.RELEASE-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
@ -0,0 +1,13 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: org.thymeleaf:thymeleaf:3.0.9.RELEASE">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/maven/repository/org/thymeleaf/thymeleaf/3.0.9.RELEASE/thymeleaf-3.0.9.RELEASE.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$USER_HOME$/maven/repository/org/thymeleaf/thymeleaf/3.0.9.RELEASE/thymeleaf-3.0.9.RELEASE-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$USER_HOME$/maven/repository/org/thymeleaf/thymeleaf/3.0.9.RELEASE/thymeleaf-3.0.9.RELEASE-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
@ -0,0 +1,13 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: org.thymeleaf:thymeleaf-spring5:3.0.9.RELEASE">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/maven/repository/org/thymeleaf/thymeleaf-spring5/3.0.9.RELEASE/thymeleaf-spring5-3.0.9.RELEASE.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$USER_HOME$/maven/repository/org/thymeleaf/thymeleaf-spring5/3.0.9.RELEASE/thymeleaf-spring5-3.0.9.RELEASE-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$USER_HOME$/maven/repository/org/thymeleaf/thymeleaf-spring5/3.0.9.RELEASE/thymeleaf-spring5-3.0.9.RELEASE-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
@ -0,0 +1,13 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: org.unbescape:unbescape:1.1.5.RELEASE">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/maven/repository/org/unbescape/unbescape/1.1.5.RELEASE/unbescape-1.1.5.RELEASE.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$USER_HOME$/maven/repository/org/unbescape/unbescape/1.1.5.RELEASE/unbescape-1.1.5.RELEASE-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$USER_HOME$/maven/repository/org/unbescape/unbescape/1.1.5.RELEASE/unbescape-1.1.5.RELEASE-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
@ -0,0 +1,225 @@
|
||||
#!/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
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
# Maven2 Start Up Batch script
|
||||
#
|
||||
# Required ENV vars:
|
||||
# ------------------
|
||||
# JAVA_HOME - location of a JDK home dir
|
||||
#
|
||||
# Optional ENV vars
|
||||
# -----------------
|
||||
# M2_HOME - location of maven2's installed home dir
|
||||
# MAVEN_OPTS - parameters passed to the Java VM when running Maven
|
||||
# e.g. to debug Maven itself, use
|
||||
# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
|
||||
# MAVEN_SKIP_RC - flag to disable loading of mavenrc files
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
if [ -z "$MAVEN_SKIP_RC" ] ; then
|
||||
|
||||
if [ -f /etc/mavenrc ] ; then
|
||||
. /etc/mavenrc
|
||||
fi
|
||||
|
||||
if [ -f "$HOME/.mavenrc" ] ; then
|
||||
. "$HOME/.mavenrc"
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
# OS specific support. $var _must_ be set to either true or false.
|
||||
cygwin=false;
|
||||
darwin=false;
|
||||
mingw=false
|
||||
case "`uname`" in
|
||||
CYGWIN*) cygwin=true ;;
|
||||
MINGW*) mingw=true;;
|
||||
Darwin*) darwin=true
|
||||
# Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
|
||||
# See https://developer.apple.com/library/mac/qa/qa1170/_index.html
|
||||
if [ -z "$JAVA_HOME" ]; then
|
||||
if [ -x "/usr/libexec/java_home" ]; then
|
||||
export JAVA_HOME="`/usr/libexec/java_home`"
|
||||
else
|
||||
export JAVA_HOME="/Library/Java/Home"
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -z "$JAVA_HOME" ] ; then
|
||||
if [ -r /etc/gentoo-release ] ; then
|
||||
JAVA_HOME=`java-config --jre-home`
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -z "$M2_HOME" ] ; then
|
||||
## resolve links - $0 may be a link to maven's home
|
||||
PRG="$0"
|
||||
|
||||
# need this for relative symlinks
|
||||
while [ -h "$PRG" ] ; do
|
||||
ls=`ls -ld "$PRG"`
|
||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
PRG="$link"
|
||||
else
|
||||
PRG="`dirname "$PRG"`/$link"
|
||||
fi
|
||||
done
|
||||
|
||||
saveddir=`pwd`
|
||||
|
||||
M2_HOME=`dirname "$PRG"`/..
|
||||
|
||||
# make it fully qualified
|
||||
M2_HOME=`cd "$M2_HOME" && pwd`
|
||||
|
||||
cd "$saveddir"
|
||||
# echo Using m2 at $M2_HOME
|
||||
fi
|
||||
|
||||
# For Cygwin, ensure paths are in UNIX format before anything is touched
|
||||
if $cygwin ; then
|
||||
[ -n "$M2_HOME" ] &&
|
||||
M2_HOME=`cygpath --unix "$M2_HOME"`
|
||||
[ -n "$JAVA_HOME" ] &&
|
||||
JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
|
||||
[ -n "$CLASSPATH" ] &&
|
||||
CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
|
||||
fi
|
||||
|
||||
# For Migwn, ensure paths are in UNIX format before anything is touched
|
||||
if $mingw ; then
|
||||
[ -n "$M2_HOME" ] &&
|
||||
M2_HOME="`(cd "$M2_HOME"; pwd)`"
|
||||
[ -n "$JAVA_HOME" ] &&
|
||||
JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
|
||||
# TODO classpath?
|
||||
fi
|
||||
|
||||
if [ -z "$JAVA_HOME" ]; then
|
||||
javaExecutable="`which javac`"
|
||||
if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
|
||||
# readlink(1) is not available as standard on Solaris 10.
|
||||
readLink=`which readlink`
|
||||
if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
|
||||
if $darwin ; then
|
||||
javaHome="`dirname \"$javaExecutable\"`"
|
||||
javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
|
||||
else
|
||||
javaExecutable="`readlink -f \"$javaExecutable\"`"
|
||||
fi
|
||||
javaHome="`dirname \"$javaExecutable\"`"
|
||||
javaHome=`expr "$javaHome" : '\(.*\)/bin'`
|
||||
JAVA_HOME="$javaHome"
|
||||
export JAVA_HOME
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -z "$JAVACMD" ] ; then
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD="$JAVA_HOME/jre/sh/java"
|
||||
else
|
||||
JAVACMD="$JAVA_HOME/bin/java"
|
||||
fi
|
||||
else
|
||||
JAVACMD="`which java`"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
echo "Error: JAVA_HOME is not defined correctly." >&2
|
||||
echo " We cannot execute $JAVACMD" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "$JAVA_HOME" ] ; then
|
||||
echo "Warning: JAVA_HOME environment variable is not set."
|
||||
fi
|
||||
|
||||
CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
|
||||
|
||||
# traverses directory structure from process work directory to filesystem root
|
||||
# first directory with .mvn subdirectory is considered project base directory
|
||||
find_maven_basedir() {
|
||||
|
||||
if [ -z "$1" ]
|
||||
then
|
||||
echo "Path not specified to find_maven_basedir"
|
||||
return 1
|
||||
fi
|
||||
|
||||
basedir="$1"
|
||||
wdir="$1"
|
||||
while [ "$wdir" != '/' ] ; do
|
||||
if [ -d "$wdir"/.mvn ] ; then
|
||||
basedir=$wdir
|
||||
break
|
||||
fi
|
||||
# workaround for JBEAP-8937 (on Solaris 10/Sparc)
|
||||
if [ -d "${wdir}" ]; then
|
||||
wdir=`cd "$wdir/.."; pwd`
|
||||
fi
|
||||
# end of workaround
|
||||
done
|
||||
echo "${basedir}"
|
||||
}
|
||||
|
||||
# concatenates all lines of a file
|
||||
concat_lines() {
|
||||
if [ -f "$1" ]; then
|
||||
echo "$(tr -s '\n' ' ' < "$1")"
|
||||
fi
|
||||
}
|
||||
|
||||
BASE_DIR=`find_maven_basedir "$(pwd)"`
|
||||
if [ -z "$BASE_DIR" ]; then
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
|
||||
echo $MAVEN_PROJECTBASEDIR
|
||||
MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
|
||||
|
||||
# For Cygwin, switch paths to Windows format before running java
|
||||
if $cygwin; then
|
||||
[ -n "$M2_HOME" ] &&
|
||||
M2_HOME=`cygpath --path --windows "$M2_HOME"`
|
||||
[ -n "$JAVA_HOME" ] &&
|
||||
JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
|
||||
[ -n "$CLASSPATH" ] &&
|
||||
CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
|
||||
[ -n "$MAVEN_PROJECTBASEDIR" ] &&
|
||||
MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
|
||||
fi
|
||||
|
||||
WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
|
||||
|
||||
exec "$JAVACMD" \
|
||||
$MAVEN_OPTS \
|
||||
-classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
|
||||
"-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
|
||||
${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"
|
||||
@ -0,0 +1,143 @@
|
||||
@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 http://www.apache.org/licenses/LICENSE-2.0
|
||||
@REM
|
||||
@REM Unless required by applicable law or agreed to in writing,
|
||||
@REM software distributed under the License is distributed on an
|
||||
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
@REM KIND, either express or implied. See the License for the
|
||||
@REM specific language governing permissions and limitations
|
||||
@REM under the License.
|
||||
@REM ----------------------------------------------------------------------------
|
||||
|
||||
@REM ----------------------------------------------------------------------------
|
||||
@REM Maven2 Start Up Batch script
|
||||
@REM
|
||||
@REM Required ENV vars:
|
||||
@REM JAVA_HOME - location of a JDK home dir
|
||||
@REM
|
||||
@REM Optional ENV vars
|
||||
@REM M2_HOME - location of maven2's installed home dir
|
||||
@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
|
||||
@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending
|
||||
@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
|
||||
@REM e.g. to debug Maven itself, use
|
||||
@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
|
||||
@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
|
||||
@REM ----------------------------------------------------------------------------
|
||||
|
||||
@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
|
||||
@echo off
|
||||
@REM enable echoing my setting MAVEN_BATCH_ECHO to 'on'
|
||||
@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
|
||||
|
||||
@REM set %HOME% to equivalent of $HOME
|
||||
if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
|
||||
|
||||
@REM Execute a user defined script before this one
|
||||
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
|
||||
@REM check for pre script, once with legacy .bat ending and once with .cmd ending
|
||||
if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
|
||||
if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
|
||||
:skipRcPre
|
||||
|
||||
@setlocal
|
||||
|
||||
set ERROR_CODE=0
|
||||
|
||||
@REM To isolate internal variables from possible post scripts, we use another setlocal
|
||||
@setlocal
|
||||
|
||||
@REM ==== START VALIDATION ====
|
||||
if not "%JAVA_HOME%" == "" goto OkJHome
|
||||
|
||||
echo.
|
||||
echo Error: JAVA_HOME not found in your environment. >&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the >&2
|
||||
echo location of your Java installation. >&2
|
||||
echo.
|
||||
goto error
|
||||
|
||||
:OkJHome
|
||||
if exist "%JAVA_HOME%\bin\java.exe" goto init
|
||||
|
||||
echo.
|
||||
echo Error: JAVA_HOME is set to an invalid directory. >&2
|
||||
echo JAVA_HOME = "%JAVA_HOME%" >&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the >&2
|
||||
echo location of your Java installation. >&2
|
||||
echo.
|
||||
goto error
|
||||
|
||||
@REM ==== END VALIDATION ====
|
||||
|
||||
:init
|
||||
|
||||
@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
|
||||
@REM Fallback to current working directory if not found.
|
||||
|
||||
set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
|
||||
IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
|
||||
|
||||
set EXEC_DIR=%CD%
|
||||
set WDIR=%EXEC_DIR%
|
||||
:findBaseDir
|
||||
IF EXIST "%WDIR%"\.mvn goto baseDirFound
|
||||
cd ..
|
||||
IF "%WDIR%"=="%CD%" goto baseDirNotFound
|
||||
set WDIR=%CD%
|
||||
goto findBaseDir
|
||||
|
||||
:baseDirFound
|
||||
set MAVEN_PROJECTBASEDIR=%WDIR%
|
||||
cd "%EXEC_DIR%"
|
||||
goto endDetectBaseDir
|
||||
|
||||
:baseDirNotFound
|
||||
set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
|
||||
cd "%EXEC_DIR%"
|
||||
|
||||
:endDetectBaseDir
|
||||
|
||||
IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
|
||||
|
||||
@setlocal EnableExtensions EnableDelayedExpansion
|
||||
for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
|
||||
@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
|
||||
|
||||
:endReadAdditionalConfig
|
||||
|
||||
SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
|
||||
|
||||
set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
|
||||
set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
|
||||
|
||||
%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
|
||||
if ERRORLEVEL 1 goto error
|
||||
goto end
|
||||
|
||||
:error
|
||||
set ERROR_CODE=1
|
||||
|
||||
:end
|
||||
@endlocal & set ERROR_CODE=%ERROR_CODE%
|
||||
|
||||
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
|
||||
@REM check for post script, once with legacy .bat ending and once with .cmd ending
|
||||
if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
|
||||
if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
|
||||
:skipRcPost
|
||||
|
||||
@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
|
||||
if "%MAVEN_BATCH_PAUSE%" == "on" pause
|
||||
|
||||
if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
|
||||
|
||||
exit /B %ERROR_CODE%
|
||||
@ -0,0 +1,20 @@
|
||||
package com.lanxuewei.code_on_line;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@SpringBootApplication
|
||||
public class CodeOnLineApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(CodeOnLineApplication.class, args);
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/", produces = "text/plain;charset=UTF-8")
|
||||
String index(){
|
||||
return "Hello Spring Boot!";
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,37 @@
|
||||
package com.lanxuewei.code_on_line.authorization.manager;
|
||||
|
||||
import com.lanxuewei.code_on_line.authorization.model.TokenModel;
|
||||
|
||||
/**
|
||||
* create by lanxuewei in 2018/4/14 15:07
|
||||
* description: 对 token 进行操作的接口
|
||||
*/
|
||||
public interface TokenManager {
|
||||
|
||||
/**
|
||||
* 创建一个 token 关联上指定用户
|
||||
* @param userId 指定用户的 userId
|
||||
* @return 生成的 token
|
||||
*/
|
||||
TokenModel createToken(Long userId);
|
||||
|
||||
/**
|
||||
* 检查 token 是否有效
|
||||
* @param model token
|
||||
* @return 是否有效
|
||||
*/
|
||||
boolean checkToken(TokenModel model);
|
||||
|
||||
/**
|
||||
* 从字符串解析 token
|
||||
* @param authentication 加密后的字符串
|
||||
* @return token
|
||||
*/
|
||||
TokenModel getToken(String authentication);
|
||||
|
||||
/**
|
||||
* 清除token
|
||||
* @param userId 登陆用户的userId
|
||||
*/
|
||||
void deleteToken(Long userId);
|
||||
}
|
||||
@ -0,0 +1,54 @@
|
||||
package com.lanxuewei.code_on_line.constant;
|
||||
|
||||
/**
|
||||
* create by lanxuewei in 2018/4/16 14:40
|
||||
* description: 返回值以及消息常量
|
||||
*/
|
||||
public enum ReturnCodeAndMsgEnum {
|
||||
|
||||
Success(0, "ok"), //请求成功
|
||||
|
||||
/**
|
||||
* User 相关业务
|
||||
*/
|
||||
Username_Or_Password_Error(-1000, "username or password error"), //账号或密码错误
|
||||
User_Not_Exist(-1001, "user not exist"), //用户不存在
|
||||
User_Not_Login(-1002, "user not login"), //账号未登录
|
||||
|
||||
/**
|
||||
* Problem 相关业务
|
||||
*/
|
||||
Problem_Not_Exist(-2001, "problem not exist");
|
||||
|
||||
/**
|
||||
* code 状态码
|
||||
*/
|
||||
private int code;
|
||||
|
||||
/**
|
||||
* info 状态信息
|
||||
*/
|
||||
private String info;
|
||||
|
||||
ReturnCodeAndMsgEnum(int code, String info) {
|
||||
this.code = code;
|
||||
this.info = info;
|
||||
}
|
||||
|
||||
public static ReturnCodeAndMsgEnum getByCode(int code) {
|
||||
for (ReturnCodeAndMsgEnum item : ReturnCodeAndMsgEnum.values()) {
|
||||
if (item.code == code) {
|
||||
return item;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getInfo() {
|
||||
return info;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,20 @@
|
||||
/**
|
||||
* Copyright (c) 2017-2018 DeepWise All Rights Reserved.
|
||||
* http://www.deepwise.com
|
||||
*/
|
||||
package com.lanxuewei.code_on_line.constant;
|
||||
|
||||
/**
|
||||
* @author lanxuewei Create in 2018/5/2 19:56
|
||||
* Description: 业务相关常量
|
||||
*/
|
||||
public class ServiceConstant {
|
||||
|
||||
/**
|
||||
* case 相关业务常量
|
||||
*/
|
||||
public interface Case {
|
||||
String Default_PageNum = "1"; //默认为第1页
|
||||
String Default_PageSize = "5"; //默认每页大小为5
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,38 @@
|
||||
package com.lanxuewei.code_on_line.controller;
|
||||
|
||||
import com.lanxuewei.code_on_line.constant.ReturnCodeAndMsgEnum;
|
||||
import com.lanxuewei.code_on_line.constant.ServiceConstant;
|
||||
import com.lanxuewei.code_on_line.model.Page;
|
||||
import com.lanxuewei.code_on_line.model.ReturnValue;
|
||||
import com.lanxuewei.code_on_line.service.CaseService;
|
||||
import com.wordnik.swagger.annotations.ApiOperation;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* create by lanxuewei in 2018/4/22 08:40
|
||||
* description: case controller
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping(value = "/case")
|
||||
public class CaseController {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(CaseController.class);
|
||||
|
||||
@Autowired
|
||||
private CaseService caseService;
|
||||
|
||||
@RequestMapping(method = RequestMethod.GET)
|
||||
@ApiOperation("select case by page")
|
||||
public ReturnValue<Page> pageHelpTest(@RequestParam(defaultValue = ServiceConstant.Case.Default_PageNum) Integer pageNum,
|
||||
@RequestParam(defaultValue = ServiceConstant.Case.Default_PageSize) Integer pageSize) {
|
||||
return new ReturnValue<>(ReturnCodeAndMsgEnum.Success, caseService.selectByPage(pageNum, pageSize));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,48 @@
|
||||
package com.lanxuewei.code_on_line.controller;
|
||||
|
||||
import com.lanxuewei.code_on_line.constant.ReturnCodeAndMsgEnum;
|
||||
import com.lanxuewei.code_on_line.dao.entity.Problem;
|
||||
import com.lanxuewei.code_on_line.model.ReturnValue;
|
||||
import com.lanxuewei.code_on_line.service.ProblemService;
|
||||
import com.wordnik.swagger.annotations.ApiOperation;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* create by lanxuewei in 2018/4/21 17:27
|
||||
* description: problem controller
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/problem")
|
||||
public class ProblemController {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(ProblemController.class);
|
||||
|
||||
@Autowired
|
||||
private ProblemService problemService;
|
||||
|
||||
/**
|
||||
* find problem by id
|
||||
* @param id
|
||||
* @return problem
|
||||
*/
|
||||
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
|
||||
@ApiOperation("find problem by id")
|
||||
public ReturnValue<Problem> findProblemById(@PathVariable Long id) {
|
||||
logger.info("---> findProblemById");
|
||||
Assert.notNull(id, "id can not be empty");
|
||||
Problem data = problemService.findProblemById(id);
|
||||
if (data != null) { //查询不为空
|
||||
return new ReturnValue<>(ReturnCodeAndMsgEnum.Success, data);
|
||||
} //查询结果为空 TODO data is always null
|
||||
return new ReturnValue<>(ReturnCodeAndMsgEnum.Problem_Not_Exist, data);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,61 @@
|
||||
package com.lanxuewei.code_on_line.controller;
|
||||
|
||||
import com.lanxuewei.code_on_line.model.ReturnValue;
|
||||
import com.lanxuewei.code_on_line.service.TagService;
|
||||
import com.wordnik.swagger.annotations.Api;
|
||||
import com.wordnik.swagger.annotations.ApiOperation;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* create by lanxuewei in 2018/4/22 08:43
|
||||
* description: tag controller
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping(value = "/tag")
|
||||
public class TagController {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(TagController.class);
|
||||
|
||||
@Autowired
|
||||
private TagService tagService;
|
||||
|
||||
/**
|
||||
* 新增标签 TODO
|
||||
* @param tagName 标签名
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(method = RequestMethod.POST)
|
||||
@ApiOperation("add a tag")
|
||||
public ReturnValue addTag(@RequestParam String tagName) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除标签 TODO
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
|
||||
@ApiOperation("delete a tag")
|
||||
public ReturnValue deleteTagById(@PathVariable Long id) {
|
||||
Assert.notNull(id, "tagId can not be empty");
|
||||
tagService.deleteTagById(id);
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取所有标签
|
||||
* @return tags
|
||||
*/
|
||||
@RequestMapping(method = RequestMethod.GET)
|
||||
@ApiOperation("get tag list")
|
||||
public ReturnValue getTagList() {
|
||||
// TODO
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,26 @@
|
||||
package com.lanxuewei.code_on_line.dao.common;
|
||||
|
||||
/**
|
||||
* create by lanxuewei in 2018/4/21 14:48
|
||||
* description: dao层相关常量
|
||||
*/
|
||||
public interface DaoConstants {
|
||||
|
||||
interface User{
|
||||
/** user 表中 sex 字段 */
|
||||
Byte Female = 0; //女
|
||||
Byte Male = 1; //男
|
||||
|
||||
/** user 表中 status 字段 */
|
||||
Byte TeacherOrManager = 0; //老师或管理员
|
||||
Byte Student = 1; //学生
|
||||
}
|
||||
|
||||
interface Problem{
|
||||
/** problem 表中 difficult 字段*/
|
||||
Byte easy = 0; //简单
|
||||
Byte medium = 1; //中等
|
||||
Byte difficult = 2; //难
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,74 @@
|
||||
package com.lanxuewei.code_on_line.dao.entity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 用例(对应表 case)
|
||||
*/
|
||||
public class Case {
|
||||
//id
|
||||
private Long id;
|
||||
|
||||
//输入
|
||||
private String input;
|
||||
|
||||
//输出
|
||||
private String output;
|
||||
|
||||
//创建时间
|
||||
private Date createTime;
|
||||
|
||||
//更新时间
|
||||
private Date updateTime;
|
||||
|
||||
//状态码
|
||||
private Byte status;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getInput() {
|
||||
return input;
|
||||
}
|
||||
|
||||
public void setInput(String input) {
|
||||
this.input = input == null ? null : input.trim();
|
||||
}
|
||||
|
||||
public String getOutput() {
|
||||
return output;
|
||||
}
|
||||
|
||||
public void setOutput(String output) {
|
||||
this.output = output == null ? null : output.trim();
|
||||
}
|
||||
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public Date getUpdateTime() {
|
||||
return updateTime;
|
||||
}
|
||||
|
||||
public void setUpdateTime(Date updateTime) {
|
||||
this.updateTime = updateTime;
|
||||
}
|
||||
|
||||
public Byte getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(Byte status) {
|
||||
this.status = status;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,129 @@
|
||||
package com.lanxuewei.code_on_line.dao.entity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 问题(对应表 problem)
|
||||
*/
|
||||
public class Problem {
|
||||
//id
|
||||
private Long id;
|
||||
|
||||
//问题名
|
||||
private String name;
|
||||
|
||||
//问题难度 0:简单 1:中等 2:难 默认为0
|
||||
private Byte difficulty;
|
||||
|
||||
//提交次数 默认为0
|
||||
private Integer submit;
|
||||
|
||||
//失败次数 默认为 0
|
||||
private Integer fail;
|
||||
|
||||
//成功次数 默认为 0
|
||||
private Integer success;
|
||||
|
||||
//作者
|
||||
private String author;
|
||||
|
||||
//创建时间
|
||||
private Date createTime;
|
||||
|
||||
//更新时间
|
||||
private Date updateTime;
|
||||
|
||||
//状态码
|
||||
private Byte status;
|
||||
|
||||
//描述
|
||||
private String des;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name == null ? null : name.trim();
|
||||
}
|
||||
|
||||
public Byte getDifficulty() {
|
||||
return difficulty;
|
||||
}
|
||||
|
||||
public void setDifficulty(Byte difficulty) {
|
||||
this.difficulty = difficulty;
|
||||
}
|
||||
|
||||
public Integer getSubmit() {
|
||||
return submit;
|
||||
}
|
||||
|
||||
public void setSubmit(Integer submit) {
|
||||
this.submit = submit;
|
||||
}
|
||||
|
||||
public Integer getFail() {
|
||||
return fail;
|
||||
}
|
||||
|
||||
public void setFail(Integer fail) {
|
||||
this.fail = fail;
|
||||
}
|
||||
|
||||
public Integer getSuccess() {
|
||||
return success;
|
||||
}
|
||||
|
||||
public void setSuccess(Integer success) {
|
||||
this.success = success;
|
||||
}
|
||||
|
||||
public String getAuthor() {
|
||||
return author;
|
||||
}
|
||||
|
||||
public void setAuthor(String author) {
|
||||
this.author = author;
|
||||
}
|
||||
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public Date getUpdateTime() {
|
||||
return updateTime;
|
||||
}
|
||||
|
||||
public void setUpdateTime(Date updateTime) {
|
||||
this.updateTime = updateTime;
|
||||
}
|
||||
|
||||
public Byte getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(Byte status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getDes() {
|
||||
return des;
|
||||
}
|
||||
|
||||
public void setDes(String des) {
|
||||
this.des = des == null ? null : des.trim();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,63 @@
|
||||
package com.lanxuewei.code_on_line.dao.entity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 标签(对应表 tag)
|
||||
*/
|
||||
public class Tag {
|
||||
//id
|
||||
private Long id;
|
||||
|
||||
//标签名
|
||||
private String name;
|
||||
|
||||
//创建时间
|
||||
private Date createTime;
|
||||
|
||||
//更新时间
|
||||
private Date updateTime;
|
||||
|
||||
//状态码 默认0
|
||||
private Byte status;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name == null ? null : name.trim();
|
||||
}
|
||||
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public Date getUpdateTime() {
|
||||
return updateTime;
|
||||
}
|
||||
|
||||
public void setUpdateTime(Date updateTime) {
|
||||
this.updateTime = updateTime;
|
||||
}
|
||||
|
||||
public Byte getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(Byte status) {
|
||||
this.status = status;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,94 @@
|
||||
package com.lanxuewei.code_on_line.dao.entity;
|
||||
|
||||
/**
|
||||
* 用户(对应表 user) TODO 考虑是否需要 createTime 和 updateTime
|
||||
*/
|
||||
public class User {
|
||||
//用户id
|
||||
private Long id;
|
||||
|
||||
//用户名
|
||||
private String userName;
|
||||
|
||||
//密码
|
||||
private String password;
|
||||
|
||||
//状态码 权限默认学生 0表示老师以及管理员 1表示学生
|
||||
private Byte status;
|
||||
|
||||
//真实姓名
|
||||
private String realName;
|
||||
|
||||
//性别
|
||||
private Byte sex;
|
||||
|
||||
//头像
|
||||
private String img;
|
||||
|
||||
//个人描述
|
||||
private String des;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getUserName() {
|
||||
return userName;
|
||||
}
|
||||
|
||||
public void setUserName(String userName) {
|
||||
this.userName = userName == null ? null : userName.trim();
|
||||
}
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password == null ? null : password.trim();
|
||||
}
|
||||
|
||||
public Byte getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(Byte status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getRealName() {
|
||||
return realName;
|
||||
}
|
||||
|
||||
public void setRealName(String realName) {
|
||||
this.realName = realName == null ? null : realName.trim();
|
||||
}
|
||||
|
||||
public Byte getSex() {
|
||||
return sex;
|
||||
}
|
||||
|
||||
public void setSex(Byte sex) {
|
||||
this.sex = sex;
|
||||
}
|
||||
|
||||
public String getImg() {
|
||||
return img;
|
||||
}
|
||||
|
||||
public void setImg(String img) {
|
||||
this.img = img == null ? null : img.trim();
|
||||
}
|
||||
|
||||
public String getDes() {
|
||||
return des;
|
||||
}
|
||||
|
||||
public void setDes(String des) {
|
||||
this.des = des == null ? null : des.trim();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,37 @@
|
||||
package com.lanxuewei.code_on_line.dao.mapper;
|
||||
|
||||
import com.lanxuewei.code_on_line.dao.entity.Case;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 对应 Problem 的CURD操作
|
||||
*/
|
||||
@Mapper
|
||||
public interface CaseMapper {
|
||||
|
||||
//新增
|
||||
int insert(Case record);
|
||||
int insertSelective(Case record);
|
||||
|
||||
//删除
|
||||
int deleteByPrimaryKey(Long id);
|
||||
|
||||
//查找
|
||||
Case selectByPrimaryKey(Long id);
|
||||
/**
|
||||
* 查找所有用例
|
||||
* @return all case
|
||||
*/
|
||||
List<Case> selectAll();
|
||||
/**
|
||||
* 查找总记录数
|
||||
* @return count all case
|
||||
*/
|
||||
int selectCount();
|
||||
|
||||
//更新
|
||||
int updateByPrimaryKeySelective(Case record);
|
||||
int updateByPrimaryKey(Case record);
|
||||
}
|
||||
@ -0,0 +1,87 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.lanxuewei.code_on_line.dao.mapper.CaseMapper" >
|
||||
<resultMap id="BaseResultMap" type="com.lanxuewei.code_on_line.dao.entity.Case" >
|
||||
<id column="id" property="id" jdbcType="BIGINT" />
|
||||
<result column="input" property="input" jdbcType="VARCHAR" />
|
||||
<result column="output" property="output" jdbcType="VARCHAR" />
|
||||
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
|
||||
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
|
||||
<result column="status" property="status" jdbcType="TINYINT" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List" >
|
||||
id, input, output, create_time, update_time, `status`
|
||||
</sql>
|
||||
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from `case`
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
|
||||
delete from `case`
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.lanxuewei.code_on_line.dao.entity.Case" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into `case` (`input`, `output`, `status`)
|
||||
values (#{input,jdbcType=VARCHAR}, #{output,jdbcType=VARCHAR}, #{status,jdbcType=TINYINT})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.lanxuewei.code_on_line.dao.entity.Case" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into `case`
|
||||
<trim prefix="(" suffix=")" suffixOverrides="," >
|
||||
<if test="input != null" >
|
||||
input,
|
||||
</if>
|
||||
<if test="output != null" >
|
||||
output,
|
||||
</if>
|
||||
<if test="status != null" >
|
||||
status,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides="," >
|
||||
<if test="input != null" >
|
||||
#{input,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="output != null" >
|
||||
#{output,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="status != null" >
|
||||
#{status,jdbcType=TINYINT},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.lanxuewei.code_on_line.dao.entity.Case" >
|
||||
update `case`
|
||||
<set >
|
||||
<if test="input != null" >
|
||||
input = #{input,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="output != null" >
|
||||
output = #{output,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="status != null" >
|
||||
`status` = #{status,jdbcType=TINYINT},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.lanxuewei.code_on_line.dao.entity.Case" >
|
||||
update `case`
|
||||
set input = #{input,jdbcType=VARCHAR},
|
||||
output = #{output,jdbcType=VARCHAR},
|
||||
`status` = #{status,jdbcType=TINYINT}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
<!-- select all -->
|
||||
<select id="selectAll" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from `case`
|
||||
</select>
|
||||
<!-- count all case -->
|
||||
<select id="selectCount" resultType="java.lang.Integer">
|
||||
select count(*)
|
||||
from `case`
|
||||
</select>
|
||||
</mapper>
|
||||
@ -0,0 +1,26 @@
|
||||
package com.lanxuewei.code_on_line.dao.mapper;
|
||||
|
||||
import com.lanxuewei.code_on_line.dao.entity.Problem;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 对应 Problem 的CURD操作
|
||||
*/
|
||||
@Mapper
|
||||
public interface ProblemMapper {
|
||||
|
||||
//新增
|
||||
int insert(Problem record);
|
||||
int insertSelective(Problem record);
|
||||
|
||||
//删除
|
||||
int deleteByPrimaryKey(Long id);
|
||||
|
||||
//查找
|
||||
Problem selectByPrimaryKey(Long id);
|
||||
|
||||
//更新
|
||||
int updateByPrimaryKeySelective(Problem record);
|
||||
int updateByPrimaryKeyWithBLOBs(Problem record);
|
||||
int updateByPrimaryKey(Problem record);
|
||||
}
|
||||
@ -0,0 +1,159 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.lanxuewei.code_on_line.dao.mapper.ProblemMapper">
|
||||
<resultMap id="BaseResultMap" type="com.lanxuewei.code_on_line.dao.entity.Problem">
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="name" jdbcType="VARCHAR" property="name" />
|
||||
<result column="difficulty" jdbcType="TINYINT" property="difficulty" />
|
||||
<result column="submit" jdbcType="INTEGER" property="submit" />
|
||||
<result column="fail" jdbcType="INTEGER" property="fail" />
|
||||
<result column="success" jdbcType="INTEGER" property="success" />
|
||||
<result column="author" jdbcType="VARCHAR" property="author" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
<result column="status" jdbcType="TINYINT" property="status" />
|
||||
</resultMap>
|
||||
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.lanxuewei.code_on_line.dao.entity.Problem">
|
||||
<result column="des" jdbcType="LONGVARCHAR" property="des" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
id, `name`, difficulty, submit, fail, success, author, create_time, update_time, `status`
|
||||
</sql>
|
||||
<sql id="Blob_Column_List">
|
||||
des
|
||||
</sql>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="ResultMapWithBLOBs">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
,
|
||||
<include refid="Blob_Column_List" />
|
||||
from problem
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||
delete from problem
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.lanxuewei.code_on_line.dao.entity.Problem" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into problem (id, `name`, difficulty,
|
||||
submit, fail, success,
|
||||
author, status, des)
|
||||
values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{difficulty,jdbcType=TINYINT},
|
||||
#{submit,jdbcType=INTEGER}, #{fail,jdbcType=INTEGER}, #{success,jdbcType=INTEGER},
|
||||
#{author,jdbcType=VARCHAR}, #{status,jdbcType=TINYINT}, #{des,jdbcType=LONGVARCHAR})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.lanxuewei.code_on_line.dao.entity.Problem" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into problem
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="name != null">
|
||||
name,
|
||||
</if>
|
||||
<if test="difficulty != null">
|
||||
difficulty,
|
||||
</if>
|
||||
<if test="submit != null">
|
||||
submit,
|
||||
</if>
|
||||
<if test="fail != null">
|
||||
fail,
|
||||
</if>
|
||||
<if test="success != null">
|
||||
success,
|
||||
</if>
|
||||
<if test="author != null">
|
||||
author,
|
||||
</if>
|
||||
<if test="status != null">
|
||||
status,
|
||||
</if>
|
||||
<if test="des != null">
|
||||
des,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="name != null">
|
||||
#{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="difficulty != null">
|
||||
#{difficulty,jdbcType=TINYINT},
|
||||
</if>
|
||||
<if test="submit != null">
|
||||
#{submit,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="fail != null">
|
||||
#{fail,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="success != null">
|
||||
#{success,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="author != null">
|
||||
#{author,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="status != null">
|
||||
#{status,jdbcType=TINYINT},
|
||||
</if>
|
||||
<if test="des != null">
|
||||
#{des,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.lanxuewei.code_on_line.dao.entity.Problem">
|
||||
update problem
|
||||
<set>
|
||||
<if test="name != null">
|
||||
name = #{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="difficulty != null">
|
||||
difficulty = #{difficulty,jdbcType=TINYINT},
|
||||
</if>
|
||||
<if test="submit != null">
|
||||
submit = #{submit,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="fail != null">
|
||||
fail = #{fail,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="success != null">
|
||||
success = #{success,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="author != null">
|
||||
author = #{author,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="status != null">
|
||||
`status` = #{status,jdbcType=TINYINT},
|
||||
</if>
|
||||
<if test="des != null">
|
||||
des = #{des,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
<update id="updateByPrimaryKeyWithBLOBs" parameterType="com.lanxuewei.code_on_line.dao.entity.Problem">
|
||||
update problem
|
||||
set name = #{name,jdbcType=VARCHAR},
|
||||
difficulty = #{difficulty,jdbcType=TINYINT},
|
||||
submit = #{submit,jdbcType=INTEGER},
|
||||
fail = #{fail,jdbcType=INTEGER},
|
||||
success = #{success,jdbcType=INTEGER},
|
||||
author = #{author,jdbcType=VARCHAR},
|
||||
`status` = #{status,jdbcType=TINYINT},
|
||||
des = #{des,jdbcType=LONGVARCHAR}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.lanxuewei.code_on_line.dao.entity.Problem">
|
||||
update problem
|
||||
set name = #{name,jdbcType=VARCHAR},
|
||||
difficulty = #{difficulty,jdbcType=TINYINT},
|
||||
submit = #{submit,jdbcType=INTEGER},
|
||||
fail = #{fail,jdbcType=INTEGER},
|
||||
success = #{success,jdbcType=INTEGER},
|
||||
author = #{author,jdbcType=VARCHAR},
|
||||
`status` = #{status,jdbcType=TINYINT}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
</mapper>
|
||||
@ -0,0 +1,25 @@
|
||||
package com.lanxuewei.code_on_line.dao.mapper;
|
||||
|
||||
import com.lanxuewei.code_on_line.dao.entity.Tag;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 对应 Tag 的CURD操作
|
||||
*/
|
||||
@Mapper
|
||||
public interface TagMapper {
|
||||
|
||||
//添加
|
||||
int insert(Tag record);
|
||||
int insertSelective(Tag record);
|
||||
|
||||
//删除
|
||||
int deleteByPrimaryKey(Long id);
|
||||
|
||||
//查找
|
||||
Tag selectByPrimaryKey(Long id);
|
||||
|
||||
//修改
|
||||
int updateByPrimaryKeySelective(Tag record);
|
||||
int updateByPrimaryKey(Tag record);
|
||||
}
|
||||
@ -0,0 +1,75 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.lanxuewei.code_on_line.dao.mapper.TagMapper" >
|
||||
<resultMap id="BaseResultMap" type="com.lanxuewei.code_on_line.dao.entity.Tag" >
|
||||
<id column="id" property="id" jdbcType="BIGINT" />
|
||||
<result column="name" property="name" jdbcType="VARCHAR" />
|
||||
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
|
||||
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
|
||||
<result column="status" property="status" jdbcType="TINYINT" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List" >
|
||||
id, `name`, create_time, update_time, `status`
|
||||
</sql>
|
||||
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from tag
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
|
||||
delete from tag
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.lanxuewei.code_on_line.dao.entity.Tag" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into tag (id, `name`, `status`)
|
||||
values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{status,jdbcType=TINYINT})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.lanxuewei.code_on_line.dao.entity.Tag" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into tag
|
||||
<trim prefix="(" suffix=")" suffixOverrides="," >
|
||||
<if test="id != null" >
|
||||
id,
|
||||
</if>
|
||||
<if test="name != null" >
|
||||
name,
|
||||
</if>
|
||||
<if test="status != null" >
|
||||
status,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides="," >
|
||||
<if test="id != null" >
|
||||
#{id,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="name != null" >
|
||||
#{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="status != null" >
|
||||
#{status,jdbcType=TINYINT},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.lanxuewei.code_on_line.dao.entity.Tag" >
|
||||
update tag
|
||||
<set >
|
||||
<if test="name != null" >
|
||||
name = #{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="status != null" >
|
||||
`status` = #{status,jdbcType=TINYINT},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.lanxuewei.code_on_line.dao.entity.Tag" >
|
||||
update tag
|
||||
set `name` = #{name,jdbcType=VARCHAR},
|
||||
`status` = #{status,jdbcType=TINYINT}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
<!-- get all tags -->
|
||||
<select id="selectTagList" >
|
||||
|
||||
</select>
|
||||
</mapper>
|
||||
@ -0,0 +1,39 @@
|
||||
package com.lanxuewei.code_on_line.dao.mapper;
|
||||
|
||||
import com.lanxuewei.code_on_line.dao.entity.User;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 对应 User 的CURD操作
|
||||
*/
|
||||
@Mapper
|
||||
public interface UserMapper {
|
||||
|
||||
//增加
|
||||
int insert(User record);
|
||||
int insertSelective(User record);
|
||||
|
||||
//删除
|
||||
int deleteByPrimaryKey(Long id);
|
||||
|
||||
//查找
|
||||
/**
|
||||
* 通过id查找User
|
||||
* @param id id
|
||||
* @return User
|
||||
*/
|
||||
User selectByPrimaryKey(Long id);
|
||||
/**
|
||||
* 通过用户名以及身份码查找对应User
|
||||
* @param userName 用户名
|
||||
* @param status 身份码
|
||||
* @return User
|
||||
*/
|
||||
User selectByUserName(@Param("userName") String userName, @Param("status") Byte status);
|
||||
|
||||
//修改
|
||||
int updateByPrimaryKey(User record);
|
||||
int updateByPrimaryKeySelective(User record);
|
||||
int updateByPrimaryKeyWithBLOBs(User record);
|
||||
}
|
||||
@ -0,0 +1,155 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.lanxuewei.code_on_line.dao.mapper.UserMapper" >
|
||||
<resultMap id="BaseResultMap" type="com.lanxuewei.code_on_line.dao.entity.User" >
|
||||
<id column="id" property="id" jdbcType="BIGINT" />
|
||||
<result column="user_name" property="userName" jdbcType="VARCHAR" />
|
||||
<result column="password" property="password" jdbcType="VARCHAR" />
|
||||
<result column="status" property="status" jdbcType="TINYINT" />
|
||||
<result column="real_name" property="realName" jdbcType="VARCHAR" />
|
||||
<result column="sex" property="sex" jdbcType="TINYINT" />
|
||||
<result column="img" property="img" jdbcType="VARCHAR" />
|
||||
</resultMap>
|
||||
<resultMap id="ResultMapWithBLOBs" type="com.lanxuewei.code_on_line.dao.entity.User" extends="BaseResultMap" >
|
||||
<result column="des" property="des" jdbcType="LONGVARCHAR" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List" >
|
||||
id, user_name, `password`, `status`, real_name, sex, img
|
||||
</sql>
|
||||
<sql id="Blob_Column_List" >
|
||||
des
|
||||
</sql>
|
||||
<select id="selectByPrimaryKey" resultMap="ResultMapWithBLOBs" parameterType="java.lang.Long" >
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
,
|
||||
<include refid="Blob_Column_List" />
|
||||
from `user`
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
|
||||
delete from `user`
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.lanxuewei.code_on_line.dao.entity.User" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into `user` (id, user_name, password,
|
||||
status, real_name, sex,
|
||||
img, des)
|
||||
values (#{id,jdbcType=BIGINT}, #{userName,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR},
|
||||
#{status,jdbcType=TINYINT}, #{realName,jdbcType=VARCHAR}, #{sex,jdbcType=TINYINT},
|
||||
#{img,jdbcType=VARCHAR}, #{des,jdbcType=LONGVARCHAR})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.lanxuewei.code_on_line.dao.entity.User" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into `user`
|
||||
<trim prefix="(" suffix=")" suffixOverrides="," >
|
||||
<if test="id != null" >
|
||||
id,
|
||||
</if>
|
||||
<if test="userName != null" >
|
||||
user_name,
|
||||
</if>
|
||||
<if test="password != null" >
|
||||
password,
|
||||
</if>
|
||||
<if test="status != null" >
|
||||
status,
|
||||
</if>
|
||||
<if test="realName != null" >
|
||||
real_name,
|
||||
</if>
|
||||
<if test="sex != null" >
|
||||
sex,
|
||||
</if>
|
||||
<if test="img != null" >
|
||||
img,
|
||||
</if>
|
||||
<if test="des != null" >
|
||||
des,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides="," >
|
||||
<if test="id != null" >
|
||||
#{id,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="userName != null" >
|
||||
#{userName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="password != null" >
|
||||
#{password,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="status != null" >
|
||||
#{status,jdbcType=TINYINT},
|
||||
</if>
|
||||
<if test="realName != null" >
|
||||
#{realName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="sex != null" >
|
||||
#{sex,jdbcType=TINYINT},
|
||||
</if>
|
||||
<if test="img != null" >
|
||||
#{img,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="des != null" >
|
||||
#{des,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.lanxuewei.code_on_line.dao.entity.User" >
|
||||
update `user`
|
||||
<set >
|
||||
<if test="userName != null" >
|
||||
user_name = #{userName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="password != null" >
|
||||
`password` = #{password,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="status != null" >
|
||||
`status` = #{status,jdbcType=TINYINT},
|
||||
</if>
|
||||
<if test="realName != null" >
|
||||
real_name = #{realName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="sex != null" >
|
||||
sex = #{sex,jdbcType=TINYINT},
|
||||
</if>
|
||||
<if test="img != null" >
|
||||
img = #{img,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="des != null" >
|
||||
des = #{des,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
<update id="updateByPrimaryKeyWithBLOBs" parameterType="com.lanxuewei.code_on_line.dao.entity.User" >
|
||||
update `user`
|
||||
set user_name = #{userName,jdbcType=VARCHAR},
|
||||
`password` = #{password,jdbcType=VARCHAR},
|
||||
`status` = #{status,jdbcType=TINYINT},
|
||||
real_name = #{realName,jdbcType=VARCHAR},
|
||||
sex = #{sex,jdbcType=TINYINT},
|
||||
img = #{img,jdbcType=VARCHAR},
|
||||
des = #{des,jdbcType=LONGVARCHAR}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.lanxuewei.code_on_line.dao.entity.User" >
|
||||
update `user`
|
||||
set user_name = #{userName,jdbcType=VARCHAR},
|
||||
`password` = #{password,jdbcType=VARCHAR},
|
||||
`status` = #{status,jdbcType=TINYINT},
|
||||
real_name = #{realName,jdbcType=VARCHAR},
|
||||
sex = #{sex,jdbcType=TINYINT},
|
||||
img = #{img,jdbcType=VARCHAR}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
<!-- 通过userName和status查找User -->
|
||||
<select id="selectByUserName" resultMap="ResultMapWithBLOBs">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
,
|
||||
<include refid="Blob_Column_List" />
|
||||
from `user`
|
||||
where user_name = #{userName,jdbcType=VARCHAR} and
|
||||
`status` = #{status,jdbcType=TINYINT}
|
||||
</select>
|
||||
</mapper>
|
||||
@ -0,0 +1,227 @@
|
||||
package com.lanxuewei.code_on_line.judger;
|
||||
|
||||
import sun.misc.Signal;
|
||||
import sun.misc.SignalHandler;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.Map;
|
||||
import java.util.TreeMap;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicLong;
|
||||
|
||||
public class CppSolution {
|
||||
|
||||
public static final long OUTPUT_MAX_SIZE = 1024 * 1024;
|
||||
|
||||
private String mSourceCode;
|
||||
|
||||
private int mTimeLimit;
|
||||
|
||||
private long mMemoryLimit;
|
||||
|
||||
private Map<String, String> mTestCases;
|
||||
|
||||
public CppSolution(String sourceCode, int timeLimit, long memoryLimit, Map<String, String> testCases) {
|
||||
mSourceCode = sourceCode;
|
||||
mTimeLimit = timeLimit;
|
||||
mMemoryLimit = memoryLimit;
|
||||
mTestCases = testCases;
|
||||
}
|
||||
|
||||
private static Map<String, String> makeMap(String k, String v) {
|
||||
Map<String, String> map = new TreeMap<String, String>();
|
||||
map.put(k, v);
|
||||
return map;
|
||||
}
|
||||
|
||||
public CppSolution(String sourceCode, int timeLimit, long memoryLimit, String input, String output) {
|
||||
this(sourceCode, timeLimit, memoryLimit, makeMap(input, output));
|
||||
}
|
||||
|
||||
private static File sWorkDir = new File(getTempDir());
|
||||
|
||||
private static String getTempDir() {
|
||||
String tmp = System.getProperty("java.io.tmpdir");
|
||||
if (tmp == null || tmp.length() == 0) {
|
||||
System.getenv("TMP");
|
||||
}
|
||||
if (tmp == null || tmp.length() == 0) {
|
||||
tmp = System.getenv("TEMP");
|
||||
}
|
||||
System.out.println("TMP: " + tmp);
|
||||
return tmp;
|
||||
}
|
||||
|
||||
public static void setWorkDir(String workDir) {
|
||||
sWorkDir = new File(workDir);
|
||||
if (!sWorkDir.exists()) {
|
||||
sWorkDir.mkdirs();
|
||||
}
|
||||
}
|
||||
|
||||
private static AtomicLong mCodeCounter = new AtomicLong(0);
|
||||
|
||||
private File mCodeFile;
|
||||
|
||||
private File mBinaryFile;
|
||||
|
||||
private File mCompileLog;
|
||||
|
||||
private Map<File, File> mCaseFiles = new TreeMap<File, File>();
|
||||
|
||||
// create source code file and testcase input output files in work dir
|
||||
private void prepareFiles() {
|
||||
long codeNo = mCodeCounter.incrementAndGet();
|
||||
mCodeFile = new File(sWorkDir, codeNo + ".cpp");
|
||||
Utils.createTextFile(mCodeFile, mSourceCode);
|
||||
|
||||
int caseNo = 1;
|
||||
for (Map.Entry<String, String> entry : mTestCases.entrySet()) {
|
||||
File in = new File(mCodeFile.getParent(), codeNo + "-" + caseNo + ".in");
|
||||
File out = new File(mCodeFile.getParent(),codeNo + "-" + caseNo + ".out");
|
||||
Utils.createTextFile(in, entry.getKey());
|
||||
Utils.createTextFile(out, entry.getValue());
|
||||
mCaseFiles.put(in, out);
|
||||
caseNo++;
|
||||
}
|
||||
}
|
||||
|
||||
private boolean mCompiled = false;
|
||||
|
||||
// compile source code file
|
||||
private boolean compile() {
|
||||
if (!mCodeFile.exists() || !new File(mCodeFile.getParent()).exists()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Process process = null;
|
||||
try {
|
||||
mBinaryFile = new File(mCodeFile.getAbsolutePath() + ".bin");
|
||||
mCompileLog = new File(mCodeFile.getAbsolutePath() + ".log");
|
||||
process = new ProcessBuilder().directory(sWorkDir)
|
||||
.command("g++", mCodeFile.getAbsolutePath(), "-o", mBinaryFile.getPath())
|
||||
.redirectOutput(mCompileLog)
|
||||
.redirectErrorStream(true)
|
||||
.start();
|
||||
process.waitFor();
|
||||
return process.exitValue() == 0;
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
if (process != null && process.isAlive()) {
|
||||
process.destroy();
|
||||
}
|
||||
mCompiled = true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public String getCompileLog() {
|
||||
return mCompiled ? Utils.readTextFile(mCompileLog) : null;
|
||||
}
|
||||
|
||||
private JudgeStatus run() {
|
||||
for (Map.Entry<File, File> entry: mCaseFiles.entrySet()) {
|
||||
File tin = entry.getKey();
|
||||
File tout = new File(tin.getAbsolutePath() + ".out");
|
||||
Process process = null;
|
||||
try {
|
||||
Signal.handle(new Signal("CHLD"), new SignalHandler() {
|
||||
@Override
|
||||
public void handle(Signal sig) {
|
||||
System.out.println("sig: " + sig);
|
||||
}
|
||||
});
|
||||
process = new ProcessBuilder().directory(sWorkDir)
|
||||
.command(mBinaryFile.getAbsolutePath())
|
||||
.redirectInput(tin)
|
||||
.redirectOutput(tout)
|
||||
.redirectErrorStream(true)
|
||||
.start();
|
||||
process.waitFor(mTimeLimit, TimeUnit.SECONDS);
|
||||
if (tout.length() > OUTPUT_MAX_SIZE) {
|
||||
return JudgeStatus.OUTPUT_LIMIT_EXCEEDED;
|
||||
}
|
||||
if (process.exitValue() != 0) {
|
||||
return JudgeStatus.NON_ZERO_EXIT_CODE;
|
||||
}
|
||||
|
||||
File eout = entry.getValue(); // expected output;
|
||||
if (Utils.compareTextFile(tout, eout) != 0) {
|
||||
return JudgeStatus.WRONG_ANSWER;
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
Signal.handle(new Signal("CHLD"), SignalHandler.SIG_DFL);
|
||||
if (tout.exists()) {
|
||||
tout.delete();
|
||||
}
|
||||
if (process != null && process.isAlive()) {
|
||||
process.destroy();
|
||||
return JudgeStatus.TIME_LIMIT_EXCEEDED;
|
||||
}
|
||||
}
|
||||
}
|
||||
return JudgeStatus.ACCEPTED;
|
||||
}
|
||||
|
||||
/**
|
||||
* clear temp file
|
||||
*/
|
||||
public void removeFiles() {
|
||||
if (mCodeFile.exists() && mCodeFile.isFile()) {
|
||||
if (mCodeFile.delete()) {
|
||||
System.out.println("delete cpp file successfully!");
|
||||
}
|
||||
} else {
|
||||
System.out.println("delete cpp file failed!");
|
||||
}
|
||||
if (mBinaryFile.exists() && mBinaryFile.isFile()) {
|
||||
if (mBinaryFile.delete()) {
|
||||
System.out.println("delete binaryFile successfully!");
|
||||
}
|
||||
} else {
|
||||
System.out.println("delete binaryFile failed!");
|
||||
}
|
||||
if (mCompileLog.exists() && mCompileLog.isFile()) {
|
||||
if (mCompileLog.delete()) {
|
||||
System.out.println("delete compileLog successfully!");
|
||||
}
|
||||
} else {
|
||||
System.out.println("delete compileLog failed!");
|
||||
}
|
||||
for (Map.Entry<File, File> entry: mCaseFiles.entrySet()) {
|
||||
File tmpCaseIn = entry.getKey();
|
||||
File tmpCaseOut = entry.getValue();
|
||||
if (tmpCaseIn.exists() && tmpCaseIn.isFile()) {
|
||||
if (tmpCaseIn.delete()){
|
||||
System.out.println("delete tmpCaseIn file successfully!");
|
||||
}
|
||||
} else {
|
||||
System.out.println("delete tmpCaseIn file failed!");
|
||||
}
|
||||
if (tmpCaseOut.exists() && tmpCaseOut.isFile()){
|
||||
if (tmpCaseOut.delete()){
|
||||
System.out.println("delete tmpCaseOut file successfully!");
|
||||
}
|
||||
} else {
|
||||
System.out.println("delete tmpCaseOut file failed!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public JudgeStatus judge() {
|
||||
prepareFiles();
|
||||
if (!compile()) {
|
||||
return JudgeStatus.COMPILE_ERROR;
|
||||
}
|
||||
return run();
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,17 @@
|
||||
package com.lanxuewei.code_on_line.judger;
|
||||
|
||||
// referenced ZOJ FAQ: http://acm.zju.edu.cn/onlinejudge/faq.do
|
||||
public enum JudgeStatus {
|
||||
QUEUING,
|
||||
ACCEPTED,
|
||||
PRESENTATION_ERROR,
|
||||
WRONG_ANSWER,
|
||||
TIME_LIMIT_EXCEEDED,
|
||||
MEMORY_LIMIT_EXECEEDED,
|
||||
OUTPUT_LIMIT_EXCEEDED,
|
||||
NON_ZERO_EXIT_CODE,
|
||||
COMPILE_ERROR,
|
||||
SEGMENTATION_FAULT,
|
||||
FLOATING_POINT_ERROR,
|
||||
RUNTIME_ERROR,
|
||||
}
|
||||
@ -0,0 +1,69 @@
|
||||
package com.lanxuewei.code_on_line.judger;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
public class Utils {
|
||||
public static boolean createTextFile(File file, String content) {
|
||||
if (file == null || content == null) {
|
||||
System.out.println("file or content null");
|
||||
return false;
|
||||
}
|
||||
if (content.length() == 0) {
|
||||
System.out.println("empty content!");
|
||||
}
|
||||
FileOutputStream out = null;
|
||||
try {
|
||||
if (file.exists()) {
|
||||
file.delete();
|
||||
}
|
||||
if (!file.createNewFile()) {
|
||||
System.out.println("create file " + file + " failed!");
|
||||
return false;
|
||||
}
|
||||
out = new FileOutputStream(file);
|
||||
out.write(content.getBytes());
|
||||
out.flush();
|
||||
return true;
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
if (out != null) {
|
||||
try {
|
||||
out.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
System.out.println("create text file: `" + file + "`, content: `" + content + "` failed!");
|
||||
return false;
|
||||
}
|
||||
|
||||
public static String readTextFile(File file) {
|
||||
if (file == null) return null;
|
||||
try {
|
||||
byte[] bytes = Files.readAllBytes(Paths.get(file.toURI()));
|
||||
return new String(bytes);
|
||||
} catch (FileNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public static int compareTextFile(File a, File b) {
|
||||
String atxt = readTextFile(a);
|
||||
if (atxt == null) atxt = "";
|
||||
return atxt.compareTo(readTextFile(b));
|
||||
}
|
||||
|
||||
public static int secondToMilliSecond(int second) {
|
||||
return second * 1000;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,73 @@
|
||||
package com.lanxuewei.code_on_line.judger.test;
|
||||
|
||||
import com.lanxuewei.code_on_line.judger.CppSolution;
|
||||
import com.lanxuewei.code_on_line.judger.JudgeStatus;
|
||||
import junit.framework.TestCase;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
public class CppSolutionTest extends TestCase {
|
||||
|
||||
@Test
|
||||
public void testAccepted() {
|
||||
String source = "#include <stdio.h>\n"
|
||||
+ "int main() {\n"
|
||||
+ " int a, b;\n"
|
||||
+ " scanf(\"%d%d\", &a, &b);\n"
|
||||
+ " printf(\"%d\", a + b);\n"
|
||||
+ " return 0;\n"
|
||||
+ "}\n";
|
||||
CppSolution solution = new CppSolution(source, 1000, 1024, "1 2", "3");
|
||||
Assert.assertEquals(solution.judge(), JudgeStatus.ACCEPTED);
|
||||
solution.removeFiles();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testWrongAnswer() {
|
||||
String source = "#include <stdio.h>\n"
|
||||
+ "int main() {\n"
|
||||
+ " int a, b;\n"
|
||||
+ " scanf(\"%d%d\", &a, &b);\n"
|
||||
+ " printf(\"%d\", a + b);\n"
|
||||
+ " return 0;\n"
|
||||
+ "}\n";
|
||||
CppSolution solution = new CppSolution(source, 1000, 1024, "1 2", "4");
|
||||
Assert.assertEquals(solution.judge(), JudgeStatus.WRONG_ANSWER);
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testCompileFailed() {
|
||||
String source = "#include <stdio.h>\n"
|
||||
+ "int m() {\n"
|
||||
+ "}\n";
|
||||
CppSolution solution = new CppSolution(source, 1000, 1024, "1 2", "3");
|
||||
Assert.assertEquals(solution.judge(), JudgeStatus.COMPILE_ERROR);
|
||||
System.out.println("compile failed: `" + solution.getCompileLog() + "`");
|
||||
Assert.assertTrue(solution.getCompileLog().length() > 0);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testTimeLimitExceed() {
|
||||
String source = "#include <stdio.h>\n"
|
||||
+ "int main() {\n"
|
||||
+ " while(1);"
|
||||
+ "}\n";
|
||||
CppSolution solution = new CppSolution(source, 5, 1024, "1 2", "3");
|
||||
Assert.assertEquals(solution.judge(), JudgeStatus.TIME_LIMIT_EXCEEDED);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testOutputLimitExceeded() {
|
||||
String source = "#include <stdio.h>\n"
|
||||
+ "int main() {\n"
|
||||
+ " for (int i = 0; i < 1024*1024+1; i++) {"
|
||||
+ " printf(\".\");\n"
|
||||
+ " }\n"
|
||||
+ " return 0;\n"
|
||||
+ "}\n";
|
||||
CppSolution solution = new CppSolution(source, 3, 1024, "1 2", "3");
|
||||
Assert.assertEquals(solution.judge(), JudgeStatus.OUTPUT_LIMIT_EXCEEDED);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,115 @@
|
||||
package com.lanxuewei.code_on_line.model;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* create by lanxuewei in 2018/4/15 22:29
|
||||
* description: 分页查询结果集封装对象
|
||||
*/
|
||||
public class Page<T> implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public final static int PAGE_INDEX = 1;
|
||||
|
||||
public final static int PAGE_SIZE = 10;
|
||||
|
||||
/**
|
||||
* 当前页码默认1
|
||||
*/
|
||||
private int pageIndex = PAGE_INDEX;
|
||||
/**
|
||||
* 每页记录条数
|
||||
*/
|
||||
private int pageSize = PAGE_SIZE;
|
||||
/**
|
||||
* 分页数据
|
||||
*/
|
||||
private List<T> rows;
|
||||
/**
|
||||
* 总记录数
|
||||
*/
|
||||
private long total;
|
||||
/**
|
||||
* 总页数
|
||||
*/
|
||||
private long pageCount;
|
||||
/**
|
||||
* 是否有下一页
|
||||
*/
|
||||
private boolean hasNext;
|
||||
/**
|
||||
* 是否有上一页
|
||||
*/
|
||||
private boolean hasPrevious;
|
||||
|
||||
/**
|
||||
* 构造方法
|
||||
*/
|
||||
public Page() {
|
||||
this(PAGE_INDEX, PAGE_SIZE, 0, new ArrayList<T>());
|
||||
}
|
||||
|
||||
/**
|
||||
* 构造方法
|
||||
* @param pageIndex 当前页码
|
||||
* @param pageSize 每页记录条数
|
||||
* @param total 总记录数
|
||||
* @param rows 分页数据
|
||||
*/
|
||||
public Page(int pageIndex, int pageSize, long total, List<T> rows) {
|
||||
this.pageIndex = pageIndex;
|
||||
this.pageSize = pageSize;
|
||||
this.total = total;
|
||||
this.pageCount = total / pageSize + ((total % pageSize) > 0 ? 1 : 0);
|
||||
this.hasNext = pageIndex < pageCount;
|
||||
this.hasPrevious = pageIndex > 1;
|
||||
this.rows = rows;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 构造方法
|
||||
* 只试用PageHelper插件查出来的List数据分页
|
||||
* @param rows 分页数据
|
||||
*/
|
||||
public Page(List<T> rows) {
|
||||
PageInfo<T> pageInfo = new PageInfo<>(rows);
|
||||
this.pageIndex = pageInfo.getPageNum();
|
||||
this.pageSize = pageInfo.getPageSize();
|
||||
this.total = pageInfo.getTotal();
|
||||
this.pageCount = total / pageSize + ((total % pageSize) > 0 ? 1 : 0);
|
||||
this.hasNext = pageIndex < pageCount;
|
||||
this.hasPrevious = pageIndex > 1;
|
||||
this.rows = rows;
|
||||
}
|
||||
|
||||
|
||||
public int getPageSize() {
|
||||
return pageSize;
|
||||
}
|
||||
public int getPageIndex() {
|
||||
return pageIndex;
|
||||
}
|
||||
public List<T> getRows() {
|
||||
return rows;
|
||||
}
|
||||
public long getTotal() {
|
||||
return total;
|
||||
}
|
||||
public long getPageCount() {
|
||||
return pageCount;
|
||||
}
|
||||
|
||||
public boolean isHasNext() {
|
||||
return hasNext;
|
||||
}
|
||||
|
||||
public boolean isHasPrevious() {
|
||||
return hasPrevious;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,68 @@
|
||||
package com.lanxuewei.code_on_line.model;
|
||||
|
||||
import com.lanxuewei.code_on_line.constant.ReturnCodeAndMsgEnum;
|
||||
|
||||
/**
|
||||
* create by lanxuewei in 2018/4/15 22:29
|
||||
* description: controller 统一返回结果model
|
||||
*/
|
||||
public class ReturnValue<T> {
|
||||
|
||||
/**
|
||||
* 状态码
|
||||
*/
|
||||
private Integer code = null;
|
||||
/**
|
||||
* 状态信息
|
||||
*/
|
||||
private String info = null;
|
||||
/**
|
||||
* 返回数据
|
||||
*/
|
||||
private T data = null;
|
||||
|
||||
/**
|
||||
* 表示无返回数据
|
||||
*
|
||||
* @param code
|
||||
* @param info
|
||||
*/
|
||||
public ReturnValue(Integer code, String info) {
|
||||
this.code = code;
|
||||
this.info = info;
|
||||
}
|
||||
|
||||
/**
|
||||
* 完整返回结果(包含数据)
|
||||
*
|
||||
* @param code
|
||||
* @param info
|
||||
* @param data
|
||||
*/
|
||||
public ReturnValue(Integer code, String info, T data) {
|
||||
this.code = code;
|
||||
this.info = info;
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public ReturnValue(ReturnCodeAndMsgEnum codeAndMsg) {
|
||||
this(codeAndMsg.getCode(), codeAndMsg.getInfo());
|
||||
}
|
||||
|
||||
public ReturnValue(ReturnCodeAndMsgEnum codeAndMsgEnum, T data) {
|
||||
this(codeAndMsgEnum.getCode(), codeAndMsgEnum.getInfo(), data);
|
||||
}
|
||||
|
||||
public Integer getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getInfo() {
|
||||
return info;
|
||||
}
|
||||
|
||||
public Object getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,62 @@
|
||||
package com.lanxuewei.code_on_line.service;
|
||||
|
||||
import com.lanxuewei.code_on_line.dao.entity.Case;
|
||||
import com.lanxuewei.code_on_line.model.Page;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* create by lanxuewei in 2018/4/21 19:04
|
||||
* description: Case 类的CURD操作
|
||||
*/
|
||||
public interface CaseService {
|
||||
|
||||
//新增
|
||||
/**
|
||||
* add case
|
||||
* @param problemCase
|
||||
* @return true or false
|
||||
*/
|
||||
boolean addCase(Case problemCase);
|
||||
|
||||
//删除
|
||||
/**
|
||||
* delete case by id
|
||||
* @param id
|
||||
* @return true or false
|
||||
*/
|
||||
boolean deleteCaseById(Long id);
|
||||
|
||||
//查询
|
||||
/**
|
||||
* find case by id
|
||||
* @param id
|
||||
* @return true or false
|
||||
*/
|
||||
Case findCaseById(Long id);
|
||||
/**
|
||||
* 查找所有用例
|
||||
* @return all case
|
||||
*/
|
||||
List<Case> selectAll();
|
||||
/**
|
||||
* 查找总记录数
|
||||
* @return count all case
|
||||
*/
|
||||
int selectCount();
|
||||
/**
|
||||
* 分页查找case
|
||||
* @param pageNum 页码
|
||||
* @param pageSize 每页大小
|
||||
* @return 分页后数据集以及分页信息
|
||||
*/
|
||||
Page<Case> selectByPage(Integer pageNum, Integer pageSize);
|
||||
|
||||
//修改
|
||||
/**
|
||||
* modify case by id
|
||||
* @param problemCase
|
||||
* @return true or false
|
||||
*/
|
||||
boolean modifyCaseById(Case problemCase);
|
||||
}
|
||||
@ -0,0 +1,44 @@
|
||||
package com.lanxuewei.code_on_line.service;
|
||||
|
||||
import com.lanxuewei.code_on_line.dao.entity.Problem;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* create by lanxuewei in 2018/4/21 17:30
|
||||
* description: Problem 类的CURD操作
|
||||
*/
|
||||
@Service
|
||||
public interface ProblemService {
|
||||
|
||||
//add
|
||||
/**
|
||||
* add problem
|
||||
* @param problem
|
||||
* @return true or false
|
||||
*/
|
||||
boolean addProblem(Problem problem);
|
||||
|
||||
//delete
|
||||
/**
|
||||
* delete problem by id
|
||||
* @param id
|
||||
* @return true or false
|
||||
*/
|
||||
boolean deleteProblemById(Long id);
|
||||
|
||||
//find
|
||||
/**
|
||||
* find problem
|
||||
* @param id
|
||||
* @return true or false
|
||||
*/
|
||||
Problem findProblemById(Long id);
|
||||
|
||||
//modify
|
||||
/**
|
||||
* modify problem
|
||||
* @param problem
|
||||
* @return true or false
|
||||
*/
|
||||
boolean modifyProblemById(Problem problem);
|
||||
}
|
||||
@ -0,0 +1,42 @@
|
||||
package com.lanxuewei.code_on_line.service;
|
||||
|
||||
import com.lanxuewei.code_on_line.dao.entity.Tag;
|
||||
|
||||
/**
|
||||
* create by lanxuewei in 2018/4/21 19:15
|
||||
* description: Tag 类的CURD操作
|
||||
*/
|
||||
public interface TagService {
|
||||
|
||||
//新增
|
||||
/**
|
||||
* add tag
|
||||
* @param tag
|
||||
* @return true or false
|
||||
*/
|
||||
boolean addTag(Tag tag);
|
||||
|
||||
//删除
|
||||
/**
|
||||
* delete tag by id
|
||||
* @param id
|
||||
* @return true or false
|
||||
*/
|
||||
boolean deleteTagById(Long id);
|
||||
|
||||
//查询
|
||||
/**
|
||||
* find tag by id
|
||||
* @param id
|
||||
* @return tag
|
||||
*/
|
||||
Tag findTagById(Long id);
|
||||
|
||||
//修改
|
||||
/**
|
||||
* modify tag by id
|
||||
* @param tag
|
||||
* @return true or false
|
||||
*/
|
||||
boolean modifyTagById(Tag tag);
|
||||
}
|
||||
@ -0,0 +1,49 @@
|
||||
package com.lanxuewei.code_on_line.service;
|
||||
|
||||
import com.lanxuewei.code_on_line.dao.entity.User;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* create by lanxuewei in 2018/4/15 21:06
|
||||
* description: User 类的CURD操作
|
||||
*/
|
||||
@Service
|
||||
public interface UserService {
|
||||
|
||||
//add
|
||||
/**
|
||||
* 添加用户
|
||||
* @param user
|
||||
* @return 操作是否成功
|
||||
*/
|
||||
boolean addUser(User user);
|
||||
|
||||
|
||||
//delete
|
||||
/**
|
||||
* 删除用户(TODO 暂时不考虑实现)
|
||||
* @param userId
|
||||
* @return 操作是否成功
|
||||
*/
|
||||
boolean deleteUserByUserId(Long userId);
|
||||
|
||||
|
||||
//find
|
||||
/**
|
||||
* 通过用户名以及status查找用户信息
|
||||
* @param userName 用户名
|
||||
* @param status 身份码
|
||||
* @return 查找到的用户信息
|
||||
*/
|
||||
User findByUserName(String userName, Byte status);
|
||||
User findByUserId(Long userId);
|
||||
|
||||
|
||||
//modify
|
||||
/**
|
||||
* 通过用户名修改用户信息
|
||||
* @param userName 用户名
|
||||
* @return 操作是否成功
|
||||
*/
|
||||
boolean modifyUserByUserName(String userName);
|
||||
}
|
||||
@ -0,0 +1,64 @@
|
||||
package com.lanxuewei.code_on_line.service.imp;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.lanxuewei.code_on_line.constant.ServiceConstant;
|
||||
import com.lanxuewei.code_on_line.dao.entity.Case;
|
||||
import com.lanxuewei.code_on_line.dao.mapper.CaseMapper;
|
||||
import com.lanxuewei.code_on_line.model.Page;
|
||||
import com.lanxuewei.code_on_line.service.CaseService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* create by lanxuewei in 2018/4/21 19:10
|
||||
* description: Case 相关业务实现
|
||||
*/
|
||||
@Service
|
||||
public class CaseServiceImp implements CaseService{
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(CaseServiceImp.class);
|
||||
|
||||
@Autowired
|
||||
private CaseMapper caseMapper;
|
||||
|
||||
@Override
|
||||
public boolean addCase(Case problemCase) {
|
||||
return caseMapper.insert(problemCase) != 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean deleteCaseById(Long id) {
|
||||
return caseMapper.deleteByPrimaryKey(id) != 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Case findCaseById(Long id) {
|
||||
return caseMapper.selectByPrimaryKey(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Case> selectAll() {
|
||||
return caseMapper.selectAll();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<Case> selectByPage(Integer pageNum, Integer pageSize) {
|
||||
PageHelper.startPage(pageNum, pageSize); //分页查询
|
||||
List<Case> cases = caseMapper.selectAll();
|
||||
return new Page<>(cases);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int selectCount() {
|
||||
return caseMapper.selectCount();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean modifyCaseById(Case problemCase) {
|
||||
return caseMapper.updateByPrimaryKey(problemCase) != 0;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,42 @@
|
||||
package com.lanxuewei.code_on_line.service.imp;
|
||||
|
||||
import com.lanxuewei.code_on_line.dao.entity.Problem;
|
||||
import com.lanxuewei.code_on_line.dao.mapper.ProblemMapper;
|
||||
import com.lanxuewei.code_on_line.service.ProblemService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* create by lanxuewei in 2018/4/21 18:39
|
||||
* description: Problem 相关业务实现
|
||||
*/
|
||||
@Service
|
||||
public class ProblemServiceImp implements ProblemService{
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(ProblemServiceImp.class);
|
||||
|
||||
@Autowired
|
||||
private ProblemMapper problemMapper;
|
||||
|
||||
@Override
|
||||
public boolean addProblem(Problem problem) {
|
||||
return problemMapper.insert(problem) != 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean deleteProblemById(Long id) {
|
||||
return problemMapper.deleteByPrimaryKey(id) != 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Problem findProblemById(Long id) {
|
||||
return problemMapper.selectByPrimaryKey(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean modifyProblemById(Problem problem) {
|
||||
return problemMapper.updateByPrimaryKey(problem) != 0;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,42 @@
|
||||
package com.lanxuewei.code_on_line.service.imp;
|
||||
|
||||
import com.lanxuewei.code_on_line.dao.entity.Tag;
|
||||
import com.lanxuewei.code_on_line.dao.mapper.TagMapper;
|
||||
import com.lanxuewei.code_on_line.service.TagService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* create by lanxuewei in 2018/4/21 19:19
|
||||
* description: Tag 相关业务实现
|
||||
*/
|
||||
@Service
|
||||
public class TagServiceImp implements TagService{
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(TagServiceImp.class);
|
||||
|
||||
@Autowired
|
||||
private TagMapper tagMapper;
|
||||
|
||||
@Override
|
||||
public boolean addTag(Tag tag) {
|
||||
return tagMapper.insert(tag) != 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean deleteTagById(Long id) {
|
||||
return tagMapper.deleteByPrimaryKey(id) != 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Tag findTagById(Long id) {
|
||||
return tagMapper.selectByPrimaryKey(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean modifyTagById(Tag tag) {
|
||||
return tagMapper.updateByPrimaryKey(tag) != 0;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,68 @@
|
||||
package com.lanxuewei.code_on_line.service.imp;
|
||||
|
||||
import com.lanxuewei.code_on_line.dao.entity.User;
|
||||
import com.lanxuewei.code_on_line.dao.mapper.UserMapper;
|
||||
import com.lanxuewei.code_on_line.service.UserService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* create by lanxuewei in 2018/4/15 21:32
|
||||
* description: User 相关业务实现
|
||||
*/
|
||||
@Service
|
||||
public class UserServiceImp implements UserService{
|
||||
|
||||
private static Logger logger = LoggerFactory.getLogger(UserServiceImp.class);
|
||||
|
||||
@Autowired
|
||||
private UserMapper userMapper;
|
||||
|
||||
/**
|
||||
* 新增
|
||||
* @param user
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public boolean addUser(User user) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public boolean deleteUserByUserId(Long userId) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查找
|
||||
* @param userName
|
||||
* @param status
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public User findByUserName(String userName, Byte status) {
|
||||
return userMapper.selectByUserName(userName, status);
|
||||
}
|
||||
|
||||
@Override
|
||||
public User findByUserId(Long userId) {
|
||||
return userMapper.selectByPrimaryKey(userId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
* @param userName
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public boolean modifyUserByUserName(String userName) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,23 @@
|
||||
package com.lanxuewei.code_on_line.utils;
|
||||
|
||||
import org.springframework.util.DigestUtils;
|
||||
|
||||
/**
|
||||
* 用于加密
|
||||
*/
|
||||
public class Md5Util {
|
||||
|
||||
private static final String salt = "%*HE$24hdi55)&H"; //盐值
|
||||
|
||||
/**
|
||||
* 使用 md5 加密
|
||||
* @param sourceStr
|
||||
* @return
|
||||
*/
|
||||
public static String getMd5(String sourceStr){
|
||||
String base = sourceStr + "/" + salt;
|
||||
String md5 = DigestUtils.md5DigestAsHex(base.getBytes());
|
||||
return md5;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,6 @@
|
||||
.__ .__
|
||||
| | _____ ____ ___ _____ __ ______ _ __ ____ |__|
|
||||
| | \__ \ / \\ \/ / | \_/ __ \ \/ \/ // __ \| |
|
||||
| |__/ __ \| | \> <| | /\ ___/\ /\ ___/| |
|
||||
|____(____ /___| /__/\_ \____/ \___ >\/\_/ \___ >__|
|
||||
\/ \/ \/ \/ \/
|
||||
@ -0,0 +1,66 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration scan="true" scanPeriod="60 seconds">
|
||||
<property name="LOG_HOME" value="log" />
|
||||
<appender name="FILE"
|
||||
class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<encoder>
|
||||
<pattern>
|
||||
[ %-5level] [%date{yyyy-MM-dd HH:mm:ss.SSS}] %logger{96} [%line] [%thread]- %msg%n
|
||||
</pattern>
|
||||
<charset>UTF-8</charset> <!-- 此处设置字符集 -->
|
||||
</encoder>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- rollover daily 配置日志所生成的目录以及生成文件名的规则 -->
|
||||
<fileNamePattern>${LOG_HOME}/log_%d{yyyyMMdd}.%i.log</fileNamePattern>
|
||||
<timeBasedFileNamingAndTriggeringPolicy
|
||||
class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
|
||||
<maxFileSize>64 MB</maxFileSize>
|
||||
</timeBasedFileNamingAndTriggeringPolicy>
|
||||
<maxHistory>30</maxHistory>
|
||||
</rollingPolicy>
|
||||
|
||||
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
|
||||
<level>INFO</level>
|
||||
</filter>
|
||||
<!-- Safely log to the same file from multiple JVMs. Degrades performance! -->
|
||||
<prudent>false</prudent>
|
||||
</appender>
|
||||
|
||||
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>
|
||||
[ %-5level] [%date{yyyy-MM-dd HH:mm:ss.SSS}] %logger{96} [%line] [%thread]- %msg%n
|
||||
</pattern>
|
||||
<charset>UTF-8</charset> <!-- 此处设置字符集 -->
|
||||
</encoder>
|
||||
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
|
||||
<level>DEBUG</level>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<!-- 邮件监控异常 -->
|
||||
<!-- <appender name="EMAIL" class="ch.qos.logback.classic.net.SMTPAppender">
|
||||
<smtpHost>smtp.163.com</smtpHost>
|
||||
<username>cairs-2w010@163.com</username>
|
||||
<password>zxc1s2dsa46</password>
|
||||
<from>cairs-2010@163.com</from>
|
||||
<to>403411d876@qq.com</to>
|
||||
<subject>【web-ext-Error】: %logger</subject>
|
||||
<layout class="ch.qos.logback.classic.html.HTMLLayout"/>
|
||||
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
|
||||
<level>ERROR</level>
|
||||
</filter>
|
||||
</appender>-->
|
||||
|
||||
<!-- Enable FILE and STDOUT appenders for all log messages. By default,
|
||||
only log at level INFO and above. -->
|
||||
<root level="DEBUG">
|
||||
<appender-ref ref="STDOUT" />
|
||||
<!--<appender-ref ref="FILE" />-->
|
||||
<!--<appender-ref ref="EMAIL" />-->
|
||||
</root>
|
||||
|
||||
<!-- For loggers in the these namespaces, log at all levels. -->
|
||||
<!-- <logger name="pedestal" level="ALL" /> <logger name="hammock-cafe"
|
||||
level="ALL" /> <logger name="user" level="ALL" /> -->
|
||||
</configuration>
|
||||
@ -0,0 +1,16 @@
|
||||
@font-face {
|
||||
font-family: 'iconfont';
|
||||
src: url('../fonts/iconfont.eot');
|
||||
src: url('../fonts/iconfont.eot?#iefix') format('embedded-opentype'),
|
||||
url('../fonts/iconfont.woff') format('woff'),
|
||||
url('../fonts/iconfont.ttf') format('truetype'),
|
||||
url('../fonts/iconfont.svg#iconfont') format('svg');
|
||||
}
|
||||
.iconfont{
|
||||
font-family:"iconfont" !important;
|
||||
font-size:16px;font-style:normal;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-webkit-text-stroke-width: 0.2px;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
@ -0,0 +1,63 @@
|
||||
@charset "utf-8";
|
||||
@import url(../lib/layui/css/layui.css);
|
||||
*{
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||
font-size: 12px;
|
||||
}
|
||||
a{
|
||||
text-decoration: none;
|
||||
}
|
||||
html{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow-x:hidden;
|
||||
overflow-y:auto;
|
||||
}
|
||||
body{
|
||||
width: 100%;
|
||||
min-height: 100%;
|
||||
}
|
||||
.login .layui-form-label{
|
||||
width: 30%;
|
||||
}
|
||||
.login .layui-input-inline{
|
||||
width: 70%;
|
||||
margin-right: 0px;
|
||||
}
|
||||
.login .layui-input{
|
||||
border-radius: 0px !important;
|
||||
height: 38px !important;
|
||||
}
|
||||
|
||||
/*#username-label{
|
||||
width: 30%;
|
||||
}
|
||||
#username-input-inline{
|
||||
width: 70%;
|
||||
margin-right: 0px;
|
||||
}
|
||||
#username{
|
||||
border-radius: 0px;
|
||||
height: 38px;
|
||||
}*/
|
||||
/*#password-label{
|
||||
width: 30%;
|
||||
}
|
||||
#password-input-inline{
|
||||
width: 70%;
|
||||
margin-right: 0px;
|
||||
}
|
||||
#password{
|
||||
border-radius: 0px;
|
||||
height: 38px;
|
||||
}*/
|
||||
/*
|
||||
#identity-label{
|
||||
width: 30%;
|
||||
}
|
||||
#identity{
|
||||
width: 70%;
|
||||
text-align: center;
|
||||
}*/
|
||||
@ -0,0 +1,101 @@
|
||||
@charset "utf-8";
|
||||
@import url(../lib/layui/css/layui.css);
|
||||
*{
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||
font-size: 12px;
|
||||
}
|
||||
a{
|
||||
text-decoration: none;
|
||||
}
|
||||
html{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow-x:hidden;
|
||||
overflow-y:auto;
|
||||
}
|
||||
body{
|
||||
width: 100%;
|
||||
min-height: 100%;
|
||||
}
|
||||
.register .layui-form-label{
|
||||
width: 30%;
|
||||
}
|
||||
.register .layui-input-inline{
|
||||
width: 70%;
|
||||
margin-right: 0px;
|
||||
}
|
||||
.register .layui-input{
|
||||
/*border-radius: 0px !important;
|
||||
height: 38px !important;*/
|
||||
}
|
||||
/*账号提示标签*/
|
||||
/*#username-label{
|
||||
width: 30%;
|
||||
}
|
||||
!*账号输入div*!
|
||||
#username-input-inline{
|
||||
width: 70%;
|
||||
margin-right: 0px;
|
||||
}
|
||||
!*账号输入框*!
|
||||
#username{
|
||||
padding-left: 15px;
|
||||
}
|
||||
!*密码提示标签*!
|
||||
#password-label{
|
||||
width: 30%;
|
||||
}
|
||||
!*密码输入div*!
|
||||
#password-input-inline{
|
||||
width: 70%;
|
||||
margin-right: 0px;
|
||||
}
|
||||
!*密码输入框*!
|
||||
#password{
|
||||
padding-left: 15px;
|
||||
}
|
||||
!*姓名提示标签*!
|
||||
#realname-label{
|
||||
width: 30%;
|
||||
}
|
||||
!*姓名输入div*!
|
||||
#realname-input-inline{
|
||||
width: 70%;
|
||||
margin-right: 0px;
|
||||
}
|
||||
#realname{
|
||||
padding-left: 15px;
|
||||
}
|
||||
|
||||
!*性别标签*!
|
||||
#sex-label{
|
||||
width: 30%;
|
||||
}
|
||||
!*性别选择*!*/
|
||||
#sex{
|
||||
/*width: 70%;*/
|
||||
text-align: center;
|
||||
}
|
||||
/*总面板*/
|
||||
.register{
|
||||
margin: 75px auto 0 auto;
|
||||
margin-right: auto;
|
||||
margin-left: auto;
|
||||
min-height: 420px;
|
||||
max-width: 500px;
|
||||
padding: 40px;
|
||||
background-color: #ffffff;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
border-radius: 4px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
/*设置背景图*/
|
||||
.register-bg{
|
||||
/*background: #eeeeee url() 0 0 no-repeat;*/
|
||||
background:url(../images/bg.png) no-repeat center;
|
||||
background-size: cover;
|
||||
overflow: hidden;
|
||||
}
|
||||
@ -0,0 +1,469 @@
|
||||
@charset "utf-8";
|
||||
@import url(../lib/layui/css/layui.css);
|
||||
*{
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||
font-size: 12px;
|
||||
}
|
||||
a{
|
||||
text-decoration: none;
|
||||
}
|
||||
html{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow-x:hidden;
|
||||
overflow-y:auto;
|
||||
}
|
||||
body{
|
||||
width: 100%;
|
||||
min-height: 100%;
|
||||
}
|
||||
.login-bg{
|
||||
/*background: #eeeeee url() 0 0 no-repeat;*/
|
||||
background:url(../images/bg.png) no-repeat center;
|
||||
background-size: cover;
|
||||
overflow: hidden;
|
||||
}
|
||||
.login{
|
||||
margin: 140px auto 0 auto;
|
||||
min-height: 420px;
|
||||
max-width: 420px;
|
||||
padding: 40px;
|
||||
background-color: #ffffff;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
border-radius: 4px;
|
||||
/* overflow-x: hidden; */
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.login a.logo{
|
||||
display: block;
|
||||
height: 58px;
|
||||
width: 167px;
|
||||
margin: 0 auto 30px auto;
|
||||
background-size: 167px 42px;
|
||||
}
|
||||
.login .message {
|
||||
margin: 10px 0 0 -58px;
|
||||
padding: 18px 10px 18px 60px;
|
||||
background: #189F92;
|
||||
position: relative;
|
||||
color: #fff;
|
||||
font-size: 16px;
|
||||
}
|
||||
.login #darkbannerwrap {
|
||||
background: url(../images/aiwrap.png);
|
||||
width: 18px;
|
||||
height: 10px;
|
||||
margin: 0 0 20px -58px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.login input[type=text],
|
||||
.login input[type=file],
|
||||
.login input[type=password],
|
||||
.login input[type=email], select {
|
||||
border: 1px solid #DCDEE0;
|
||||
vertical-align: middle;
|
||||
border-radius: 3px;
|
||||
height: 50px;
|
||||
padding: 0px 16px;
|
||||
font-size: 14px;
|
||||
color: #555555;
|
||||
outline:none;
|
||||
width:100%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.login input[type=text]:focus,
|
||||
.login input[type=file]:focus,
|
||||
.login input[type=password]:focus,
|
||||
.login input[type=email]:focus, select:focus {
|
||||
border: 1px solid #27A9E3;
|
||||
}
|
||||
.login input[type=submit],
|
||||
.login input[type=button]{
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
padding: 12px 24px;
|
||||
margin: 0px;
|
||||
font-size: 18px;
|
||||
line-height: 24px;
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
vertical-align: middle;
|
||||
cursor: pointer;
|
||||
color: #ffffff;
|
||||
background-color: #189F92;
|
||||
border-radius: 3px;
|
||||
border: none;
|
||||
-webkit-appearance: none;
|
||||
outline:none;
|
||||
width:100%;
|
||||
}
|
||||
.login hr {
|
||||
background: #fff url() 0 0 no-repeat;
|
||||
}
|
||||
.login hr.hr15 {
|
||||
height: 15px;
|
||||
border: none;
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
width: 100%;
|
||||
}
|
||||
.login hr.hr20 {
|
||||
height: 20px;
|
||||
border: none;
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
width: 100%;
|
||||
}
|
||||
.x-body{
|
||||
padding: 20px;
|
||||
}
|
||||
.x-nav{
|
||||
padding: 0 20px;
|
||||
position: relative;
|
||||
z-index: 99;
|
||||
border-bottom: 1px solid #e5e5e5;
|
||||
line-height: 39px;
|
||||
height: 39px;
|
||||
overflow: hidden;
|
||||
}
|
||||
xblock{
|
||||
display: block;
|
||||
margin-bottom: 10px;
|
||||
padding: 5px;
|
||||
line-height: 22px;
|
||||
/* border-left: 5px solid #009688; */
|
||||
border-radius: 0 2px 2px 0;
|
||||
background-color: #f2f2f2;
|
||||
}
|
||||
.x-right{
|
||||
float: right;
|
||||
}
|
||||
.x-so{
|
||||
text-align: center;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.x-so input.layui-input{
|
||||
width: 190px;
|
||||
}
|
||||
.x-so .layui-form-label{
|
||||
display: inline-block;
|
||||
}
|
||||
.x-so input.layui-input,.x-so input.layui-btn{
|
||||
display: inline-block;
|
||||
}
|
||||
.x-red{
|
||||
color: red;
|
||||
}
|
||||
.page{
|
||||
margin-top: 20px;
|
||||
text-align: center;
|
||||
|
||||
}
|
||||
.page a{
|
||||
display: inline-block;
|
||||
background: #fff url() 0 0 no-repeat;
|
||||
color: #888;
|
||||
padding: 10px;
|
||||
min-width: 15px;
|
||||
border: 1px solid #E2E2E2;
|
||||
|
||||
}
|
||||
.page span{
|
||||
display: inline-block;
|
||||
padding: 10px;
|
||||
min-width: 15px;
|
||||
border: 1px solid #E2E2E2;
|
||||
}
|
||||
.page span.current{
|
||||
display: inline-block;
|
||||
background: #009688 url() 0 0 no-repeat;
|
||||
color: #fff;
|
||||
padding: 10px;
|
||||
min-width: 15px;
|
||||
border: 1px solid #009688;
|
||||
}
|
||||
.page .pagination li{
|
||||
display: inline-block;
|
||||
margin-right: 5px;
|
||||
text-align: center;
|
||||
}
|
||||
.page .pagination li.active span{
|
||||
background: #009688 url() 0 0 no-repeat;
|
||||
color: #fff;
|
||||
border: 1px solid #009688;
|
||||
|
||||
}
|
||||
|
||||
/*登录样式*/
|
||||
/*头部*/
|
||||
.container{
|
||||
width: 100%;
|
||||
height: 45px;
|
||||
background-color: #222;
|
||||
border-bottom: 1px solid rgba(255, 255, 255, 0.2);
|
||||
}
|
||||
.container .logo a{
|
||||
float: left;
|
||||
color: #fff;
|
||||
font-size: 18px;
|
||||
padding-left: 20px;
|
||||
line-height: 45px;
|
||||
width: 200px;
|
||||
}
|
||||
.container .right{
|
||||
background-color:rgba(0,0,0,0);
|
||||
float: right;
|
||||
|
||||
}
|
||||
.container .left_open{
|
||||
height: 45px;
|
||||
float: left;
|
||||
}
|
||||
.container .left_open i{
|
||||
display: block;
|
||||
background: rgba(255,255,255,0.1) url() 0 0 no-repeat;
|
||||
color: #fff;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
line-height: 32px;
|
||||
border-radius: 3px;
|
||||
text-align: center;
|
||||
margin-top: 7px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.container .left_open i:hover{
|
||||
background: rgba(255,255,255,0.3) url() 0 0 no-repeat;
|
||||
}
|
||||
|
||||
.container .left{
|
||||
background-color:rgba(0,0,0,0);
|
||||
float: left;
|
||||
|
||||
}
|
||||
.container .layui-nav-item{
|
||||
line-height: 45px;
|
||||
}
|
||||
.container .layui-nav-more{
|
||||
top: 20px;
|
||||
}
|
||||
.container .layui-nav-child{
|
||||
top: 50px;
|
||||
}
|
||||
.container .layui-nav-child i{
|
||||
margin-right: 10px;
|
||||
}
|
||||
.layui-nav .layui-nav-item a{
|
||||
color: #fff;
|
||||
}
|
||||
.layui-nav .layui-nav-child a{
|
||||
color: #333;
|
||||
}
|
||||
.left-nav{
|
||||
position: absolute;
|
||||
top: 46px;
|
||||
bottom: 42px;
|
||||
left: 0;
|
||||
z-index: 2;
|
||||
padding-top: 10px;
|
||||
background-color: #EEEEEE;
|
||||
width: 220px;
|
||||
max-width: 220px;
|
||||
overflow: auto;
|
||||
overflow-x:hidden;
|
||||
border-right: 1px solid #e5e5e5;
|
||||
|
||||
/*width: 0px;*/
|
||||
}
|
||||
.left-nav #nav li{
|
||||
border-bottom: 1px solid #e5e5e5;
|
||||
}
|
||||
.left-nav #nav li:hover > a{
|
||||
/*color: blue;*/
|
||||
}
|
||||
.left-nav #nav .current{
|
||||
background-color: rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
.left-nav #nav li a{
|
||||
font-size: 14px;
|
||||
padding: 10px 15px 10px 20px;
|
||||
display: block;
|
||||
cursor: pointer;
|
||||
}
|
||||
.left-nav #nav li a cite{
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.left-nav #nav li .sub-menu{
|
||||
display: none;
|
||||
}
|
||||
.left-nav #nav li .opened{
|
||||
display: block;
|
||||
}
|
||||
.left-nav #nav li .opened:hover{
|
||||
/*background: #fff url() 0 0 no-repeat;*/
|
||||
}
|
||||
.left-nav #nav li .opened .current{
|
||||
|
||||
}
|
||||
.left-nav #nav li .sub-menu li:hover{
|
||||
/*color: blue;*/
|
||||
/*background: #fff url() 0 0 no-repeat;*/
|
||||
}
|
||||
.left-nav #nav li .sub-menu li a{
|
||||
padding: 12px 15px 12px 30px;
|
||||
font-size: 14px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.left-nav #nav li .sub-menu li .sub-menu li a{
|
||||
padding-left: 45px;
|
||||
}
|
||||
.left-nav #nav li .sub-menu li a:hover{
|
||||
color: #148cf1;
|
||||
}
|
||||
.left-nav #nav li .sub-menu li a i{
|
||||
font-size: 12px;
|
||||
}
|
||||
.left-nav #nav li a i{
|
||||
padding-right: 10px;
|
||||
line-height: 14px;
|
||||
}
|
||||
.left-nav #nav li .nav_right{
|
||||
float: right;
|
||||
font-size: 16px;
|
||||
}
|
||||
.x-slide_left {
|
||||
width: 17px;
|
||||
height: 61px;
|
||||
background: url(../images/icon.png) 0 0 no-repeat;
|
||||
position: absolute;
|
||||
top: 200px;
|
||||
left: 221px;
|
||||
cursor: pointer;
|
||||
z-index: 3;
|
||||
}
|
||||
.page-content{
|
||||
position: absolute;
|
||||
top: 46px;
|
||||
right: 0;
|
||||
bottom: 42px;
|
||||
left: 221px;
|
||||
overflow: hidden;
|
||||
z-index: 1;
|
||||
}
|
||||
.page-content-bg{
|
||||
position: absolute;
|
||||
top: 46px;
|
||||
right: 0;
|
||||
bottom: 42px;
|
||||
left: 221px;
|
||||
background: rgba(0,0,0,0.5); url() 0 0 no-repeat;
|
||||
overflow: hidden;
|
||||
z-index: 100;
|
||||
display: none;
|
||||
}
|
||||
|
||||
.page-content .tab{
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
background: #EFEEF0 url() 0 0 no-repeat;
|
||||
margin: 0px;
|
||||
}
|
||||
.page-content .layui-tab-title{
|
||||
/*padding-top: 5px;*/
|
||||
height: 35px;
|
||||
background: #EFEEF0 url() 0 0 no-repeat;
|
||||
position: relative;
|
||||
z-index: 100;
|
||||
}
|
||||
.page-content .layui-tab-title li{
|
||||
line-height: 35px;
|
||||
}
|
||||
.page-content .layui-tab-title .layui-this:after{
|
||||
height: 36px;
|
||||
}
|
||||
.page-content .layui-tab-title li .layui-tab-close{
|
||||
border-radius: 50%;
|
||||
}
|
||||
.page-content .layui-tab-title .layui-this{
|
||||
background: #fff url() 0 0 no-repeat;
|
||||
}
|
||||
.page-content .layui-tab-bar{
|
||||
height:34px;
|
||||
line-height: 35px;
|
||||
}
|
||||
.page-content .layui-tab-content{
|
||||
position: absolute;
|
||||
top: 36px;
|
||||
bottom: 0px;
|
||||
width: 100%;
|
||||
background: #fff url() 0 0 no-repeat;
|
||||
padding: 0px;
|
||||
overflow: hidden;
|
||||
}
|
||||
.page-content .layui-tab-content .layui-tab-item{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
}
|
||||
.page-content .layui-tab-content .layui-tab-item iframe{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
}
|
||||
|
||||
.welcome-footer{padding: 30px 0; line-height: 30px; text-align: center; background-color: #eee; color: #666; font-weight: 300;}
|
||||
body .layui-layout-admin .footer-demo{height: auto; padding: 15px 0; line-height: 26px;}
|
||||
.welcome-footer a{padding: 0 5px;}
|
||||
|
||||
table th, table td {
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.footer{
|
||||
position: fixed;
|
||||
bottom: 0px;
|
||||
width: 100%;
|
||||
background-color: #222;
|
||||
border-top: 1px solid rgba(255, 255, 255, 0.2);
|
||||
line-height: 41px;
|
||||
color: #fff;
|
||||
/*padding-left: 10px;*/
|
||||
}
|
||||
.footer .copyright{
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
|
||||
@media screen and (max-width: 768px){
|
||||
.fast-add{
|
||||
display: none;
|
||||
}
|
||||
.layui-nav .to-index{
|
||||
display: none;
|
||||
}
|
||||
.container .logo a{
|
||||
width: 140px;
|
||||
}
|
||||
.container .left_open {
|
||||
/*float: right;*/
|
||||
}
|
||||
.left-nav{
|
||||
left: -221px;
|
||||
}
|
||||
.page-content{
|
||||
left: 0px;
|
||||
}
|
||||
.page-content .layui-tab-content .layui-tab-item{
|
||||
-webkit-overflow-scrolling: touch;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
.x-so input.layui-input{
|
||||
width: 100%;
|
||||
margin: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
|
After Width: | Height: | Size: 315 KiB |
|
After Width: | Height: | Size: 3.0 KiB |
|
After Width: | Height: | Size: 28 KiB |
@ -0,0 +1,22 @@
|
||||
var utilRequest = {
|
||||
|
||||
/**
|
||||
* request method
|
||||
* @returns {string}
|
||||
*/
|
||||
GET : function () {
|
||||
return "GET";
|
||||
},
|
||||
|
||||
POST : function () {
|
||||
return "post";
|
||||
},
|
||||
|
||||
DELETE : function () {
|
||||
return "DELETE";
|
||||
},
|
||||
|
||||
PUT : function () {
|
||||
return "PUT";
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,42 @@
|
||||
var login = {
|
||||
|
||||
URL : {
|
||||
/**
|
||||
* login url
|
||||
* @returns {string}
|
||||
*/
|
||||
login : function () {
|
||||
return "/tokens"
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* login 登陆
|
||||
*/
|
||||
login : function () {
|
||||
layui.use('form', function(){
|
||||
var form = layui.form;
|
||||
/**表单提交事件*/
|
||||
$('#login-form').submit(function () {
|
||||
var username = $("#username").val();
|
||||
var password = $("#password").val();
|
||||
console.log(username);
|
||||
console.log(password);
|
||||
$.ajax({
|
||||
type : utilRequest.POST(),
|
||||
url : login.URL.login(),
|
||||
data : "userName=" + username + "&password=" + password + "&status=0",
|
||||
success : function (msg) {
|
||||
alert(JSON.stringify(msg));
|
||||
console.log(msg);
|
||||
location.href='management.html';
|
||||
},
|
||||
fail : function (msg) {
|
||||
alert(msg);
|
||||
console.log(msg);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,2 @@
|
||||
/** layui-v2.0.2 MIT License By http://www.layui.com */
|
||||
html #layuicss-skincodecss{display:none;position:absolute;width:1989px}.layui-code-h3,.layui-code-view{position:relative;font-size:12px}.layui-code-view{display:block;margin:10px 0;padding:0;border:1px solid #e2e2e2;border-left-width:6px;background-color:#F2F2F2;color:#333;font-family:Courier New}.layui-code-h3{padding:0 10px;height:32px;line-height:32px;border-bottom:1px solid #e2e2e2}.layui-code-h3 a{position:absolute;right:10px;top:0;color:#999}.layui-code-view .layui-code-ol{position:relative;overflow:auto}.layui-code-view .layui-code-ol li{position:relative;margin-left:45px;line-height:20px;padding:0 5px;border-left:1px solid #e2e2e2;list-style-type:decimal-leading-zero;*list-style-type:decimal;background-color:#fff}.layui-code-view pre{margin:0}.layui-code-notepad{border:1px solid #0C0C0C;border-left-color:#3F3F3F;background-color:#0C0C0C;color:#C2BE9E}.layui-code-notepad .layui-code-h3{border-bottom:none}.layui-code-notepad .layui-code-ol li{background-color:#3F3F3F;border-left:none}
|
||||
|
After Width: | Height: | Size: 5.8 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 5.7 KiB |
|
After Width: | Height: | Size: 701 B |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 200 KiB |