commit 182eb516b6ea97870a88d8c4755967d0418f54a2
Author: zhizhi wu <2377881365@qq.com>
Date: Mon Jan 24 16:14:43 2022 +0800
init
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..549e00a
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,33 @@
+HELP.md
+target/
+!.mvn/wrapper/maven-wrapper.jar
+!**/src/main/**/target/
+!**/src/test/**/target/
+
+### STS ###
+.apt_generated
+.classpath
+.factorypath
+.project
+.settings
+.springBeans
+.sts4-cache
+
+### IntelliJ IDEA ###
+.idea
+*.iws
+*.iml
+*.ipr
+
+### NetBeans ###
+/nbproject/private/
+/nbbuild/
+/dist/
+/nbdist/
+/.nb-gradle/
+build/
+!**/src/main/**/build/
+!**/src/test/**/build/
+
+### VS Code ###
+.vscode/
diff --git a/.mvn/wrapper/MavenWrapperDownloader.java b/.mvn/wrapper/MavenWrapperDownloader.java
new file mode 100644
index 0000000..a45eb6b
--- /dev/null
+++ b/.mvn/wrapper/MavenWrapperDownloader.java
@@ -0,0 +1,118 @@
+/*
+ * Copyright 2007-present the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.net.*;
+import java.io.*;
+import java.nio.channels.*;
+import java.util.Properties;
+
+public class MavenWrapperDownloader {
+
+ private static final String WRAPPER_VERSION = "0.5.6";
+ /**
+ * Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
+ */
+ private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
+ + WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar";
+
+ /**
+ * Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
+ * use instead of the default one.
+ */
+ private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
+ ".mvn/wrapper/maven-wrapper.properties";
+
+ /**
+ * Path where the maven-wrapper.jar will be saved to.
+ */
+ private static final String MAVEN_WRAPPER_JAR_PATH =
+ ".mvn/wrapper/maven-wrapper.jar";
+
+ /**
+ * Name of the property which should be used to override the default download url for the wrapper.
+ */
+ private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
+
+ public static void main(String args[]) {
+ System.out.println("- Downloader started");
+ File baseDirectory = new File(args[0]);
+ System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
+
+ // If the maven-wrapper.properties exists, read it and check if it contains a custom
+ // wrapperUrl parameter.
+ File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
+ String url = DEFAULT_DOWNLOAD_URL;
+ if (mavenWrapperPropertyFile.exists()) {
+ FileInputStream mavenWrapperPropertyFileInputStream = null;
+ try {
+ mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
+ Properties mavenWrapperProperties = new Properties();
+ mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
+ url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
+ } catch (IOException e) {
+ System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
+ } finally {
+ try {
+ if (mavenWrapperPropertyFileInputStream != null) {
+ mavenWrapperPropertyFileInputStream.close();
+ }
+ } catch (IOException e) {
+ // Ignore ...
+ }
+ }
+ }
+ System.out.println("- Downloading from: " + url);
+
+ File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
+ if (!outputFile.getParentFile().exists()) {
+ if (!outputFile.getParentFile().mkdirs()) {
+ System.out.println(
+ "- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'");
+ }
+ }
+ System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
+ try {
+ downloadFileFromURL(url, outputFile);
+ System.out.println("Done");
+ System.exit(0);
+ } catch (Throwable e) {
+ System.out.println("- Error downloading");
+ e.printStackTrace();
+ System.exit(1);
+ }
+ }
+
+ private static void downloadFileFromURL(String urlString, File destination) throws Exception {
+ if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
+ String username = System.getenv("MVNW_USERNAME");
+ char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
+ Authenticator.setDefault(new Authenticator() {
+ @Override
+ protected PasswordAuthentication getPasswordAuthentication() {
+ return new PasswordAuthentication(username, password);
+ }
+ });
+ }
+ URL website = new URL(urlString);
+ ReadableByteChannel rbc;
+ rbc = Channels.newChannel(website.openStream());
+ FileOutputStream fos = new FileOutputStream(destination);
+ fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
+ fos.close();
+ rbc.close();
+ }
+
+}
diff --git a/.mvn/wrapper/maven-wrapper.jar b/.mvn/wrapper/maven-wrapper.jar
new file mode 100644
index 0000000..2cc7d4a
Binary files /dev/null and b/.mvn/wrapper/maven-wrapper.jar differ
diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties
new file mode 100644
index 0000000..a9f1ef8
--- /dev/null
+++ b/.mvn/wrapper/maven-wrapper.properties
@@ -0,0 +1,2 @@
+distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.3/apache-maven-3.8.3-bin.zip
+wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
diff --git a/mvnw b/mvnw
new file mode 100644
index 0000000..3c8a553
--- /dev/null
+++ b/mvnw
@@ -0,0 +1,322 @@
+#!/bin/sh
+# ----------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+# ----------------------------------------------------------------------------
+
+# ----------------------------------------------------------------------------
+# Maven Start Up Batch script
+#
+# Required ENV vars:
+# ------------------
+# JAVA_HOME - location of a JDK home dir
+#
+# Optional ENV vars
+# -----------------
+# M2_HOME - location of maven2's installed home dir
+# MAVEN_OPTS - parameters passed to the Java VM when running Maven
+# e.g. to debug Maven itself, use
+# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
+# MAVEN_SKIP_RC - flag to disable loading of mavenrc files
+# ----------------------------------------------------------------------------
+
+if [ -z "$MAVEN_SKIP_RC" ]; then
+
+ if [ -f /etc/mavenrc ]; then
+ . /etc/mavenrc
+ fi
+
+ if [ -f "$HOME/.mavenrc" ]; then
+ . "$HOME/.mavenrc"
+ fi
+
+fi
+
+# OS specific support. $var _must_ be set to either true or false.
+cygwin=false
+darwin=false
+mingw=false
+case "$(uname)" in
+CYGWIN*) cygwin=true ;;
+MINGW*) mingw=true ;;
+Darwin*)
+ darwin=true
+ # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
+ # See https://developer.apple.com/library/mac/qa/qa1170/_index.html
+ if [ -z "$JAVA_HOME" ]; then
+ if [ -x "/usr/libexec/java_home" ]; then
+ export JAVA_HOME="$(/usr/libexec/java_home)"
+ else
+ export JAVA_HOME="/Library/Java/Home"
+ fi
+ fi
+ ;;
+esac
+
+if [ -z "$JAVA_HOME" ]; then
+ if [ -r /etc/gentoo-release ]; then
+ JAVA_HOME=$(java-config --jre-home)
+ fi
+fi
+
+if [ -z "$M2_HOME" ]; then
+ ## resolve links - $0 may be a link to maven's home
+ PRG="$0"
+
+ # need this for relative symlinks
+ while [ -h "$PRG" ]; do
+ ls=$(ls -ld "$PRG")
+ link=$(expr "$ls" : '.*-> \(.*\)$')
+ if expr "$link" : '/.*' >/dev/null; then
+ PRG="$link"
+ else
+ PRG="$(dirname "$PRG")/$link"
+ fi
+ done
+
+ saveddir=$(pwd)
+
+ M2_HOME=$(dirname "$PRG")/..
+
+ # make it fully qualified
+ M2_HOME=$(cd "$M2_HOME" && pwd)
+
+ cd "$saveddir"
+ # echo Using m2 at $M2_HOME
+fi
+
+# For Cygwin, ensure paths are in UNIX format before anything is touched
+if $cygwin; then
+ [ -n "$M2_HOME" ] &&
+ M2_HOME=$(cygpath --unix "$M2_HOME")
+ [ -n "$JAVA_HOME" ] &&
+ JAVA_HOME=$(cygpath --unix "$JAVA_HOME")
+ [ -n "$CLASSPATH" ] &&
+ CLASSPATH=$(cygpath --path --unix "$CLASSPATH")
+fi
+
+# For Mingw, ensure paths are in UNIX format before anything is touched
+if $mingw; then
+ [ -n "$M2_HOME" ] &&
+ M2_HOME="$( (
+ cd "$M2_HOME"
+ pwd
+ ))"
+ [ -n "$JAVA_HOME" ] &&
+ JAVA_HOME="$( (
+ cd "$JAVA_HOME"
+ pwd
+ ))"
+fi
+
+if [ -z "$JAVA_HOME" ]; then
+ javaExecutable="$(which javac)"
+ if [ -n "$javaExecutable" ] && ! [ "$(expr \"$javaExecutable\" : '\([^ ]*\)')" = "no" ]; then
+ # readlink(1) is not available as standard on Solaris 10.
+ readLink=$(which readlink)
+ if [ ! $(expr "$readLink" : '\([^ ]*\)') = "no" ]; then
+ if $darwin; then
+ javaHome="$(dirname \"$javaExecutable\")"
+ javaExecutable="$(cd \"$javaHome\" && pwd -P)/javac"
+ else
+ javaExecutable="$(readlink -f \"$javaExecutable\")"
+ fi
+ javaHome="$(dirname \"$javaExecutable\")"
+ javaHome=$(expr "$javaHome" : '\(.*\)/bin')
+ JAVA_HOME="$javaHome"
+ export JAVA_HOME
+ fi
+ fi
+fi
+
+if [ -z "$JAVACMD" ]; then
+ if [ -n "$JAVA_HOME" ]; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ]; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ else
+ JAVACMD="$(which java)"
+ fi
+fi
+
+if [ ! -x "$JAVACMD" ]; then
+ echo "Error: JAVA_HOME is not defined correctly." >&2
+ echo " We cannot execute $JAVACMD" >&2
+ exit 1
+fi
+
+if [ -z "$JAVA_HOME" ]; then
+ echo "Warning: JAVA_HOME environment variable is not set."
+fi
+
+CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
+
+# traverses directory structure from process work directory to filesystem root
+# first directory with .mvn subdirectory is considered project base directory
+find_maven_basedir() {
+
+ if [ -z "$1" ]; then
+ echo "Path not specified to find_maven_basedir"
+ return 1
+ fi
+
+ basedir="$1"
+ wdir="$1"
+ while [ "$wdir" != '/' ]; do
+ if [ -d "$wdir"/.mvn ]; then
+ basedir=$wdir
+ break
+ fi
+ # workaround for JBEAP-8937 (on Solaris 10/Sparc)
+ if [ -d "${wdir}" ]; then
+ wdir=$(
+ cd "$wdir/.."
+ pwd
+ )
+ fi
+ # end of workaround
+ done
+ echo "${basedir}"
+}
+
+# concatenates all lines of a file
+concat_lines() {
+ if [ -f "$1" ]; then
+ echo "$(tr -s '\n' ' ' <"$1")"
+ fi
+}
+
+BASE_DIR=$(find_maven_basedir "$(pwd)")
+if [ -z "$BASE_DIR" ]; then
+ exit 1
+fi
+
+##########################################################################################
+# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
+# This allows using the maven wrapper in projects that prohibit checking in binary data.
+##########################################################################################
+if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then
+ if [ "$MVNW_VERBOSE" = true ]; then
+ echo "Found .mvn/wrapper/maven-wrapper.jar"
+ fi
+else
+ if [ "$MVNW_VERBOSE" = true ]; then
+ echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
+ fi
+ if [ -n "$MVNW_REPOURL" ]; then
+ jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
+ else
+ jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
+ fi
+ while IFS="=" read key value; do
+ case "$key" in wrapperUrl)
+ jarUrl="$value"
+ break
+ ;;
+ esac
+ done <"$BASE_DIR/.mvn/wrapper/maven-wrapper.properties"
+ if [ "$MVNW_VERBOSE" = true ]; then
+ echo "Downloading from: $jarUrl"
+ fi
+ wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar"
+ if $cygwin; then
+ wrapperJarPath=$(cygpath --path --windows "$wrapperJarPath")
+ fi
+
+ if command -v wget >/dev/null; then
+ if [ "$MVNW_VERBOSE" = true ]; then
+ echo "Found wget ... using wget"
+ fi
+ if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
+ wget "$jarUrl" -O "$wrapperJarPath"
+ else
+ wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath"
+ fi
+ elif command -v curl >/dev/null; then
+ if [ "$MVNW_VERBOSE" = true ]; then
+ echo "Found curl ... using curl"
+ fi
+ if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
+ curl -o "$wrapperJarPath" "$jarUrl" -f
+ else
+ curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f
+ fi
+
+ else
+ if [ "$MVNW_VERBOSE" = true ]; then
+ echo "Falling back to using Java to download"
+ fi
+ javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java"
+ # For Cygwin, switch paths to Windows format before running javac
+ if $cygwin; then
+ javaClass=$(cygpath --path --windows "$javaClass")
+ fi
+ if [ -e "$javaClass" ]; then
+ if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
+ if [ "$MVNW_VERBOSE" = true ]; then
+ echo " - Compiling MavenWrapperDownloader.java ..."
+ fi
+ # Compiling the Java class
+ ("$JAVA_HOME/bin/javac" "$javaClass")
+ fi
+ if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
+ # Running the downloader
+ if [ "$MVNW_VERBOSE" = true ]; then
+ echo " - Running MavenWrapperDownloader.java ..."
+ fi
+ ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR")
+ fi
+ fi
+ fi
+fi
+##########################################################################################
+# End of extension
+##########################################################################################
+
+export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
+if [ "$MVNW_VERBOSE" = true ]; then
+ echo $MAVEN_PROJECTBASEDIR
+fi
+MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin; then
+ [ -n "$M2_HOME" ] &&
+ M2_HOME=$(cygpath --path --windows "$M2_HOME")
+ [ -n "$JAVA_HOME" ] &&
+ JAVA_HOME=$(cygpath --path --windows "$JAVA_HOME")
+ [ -n "$CLASSPATH" ] &&
+ CLASSPATH=$(cygpath --path --windows "$CLASSPATH")
+ [ -n "$MAVEN_PROJECTBASEDIR" ] &&
+ MAVEN_PROJECTBASEDIR=$(cygpath --path --windows "$MAVEN_PROJECTBASEDIR")
+fi
+
+# Provide a "standardized" way to retrieve the CLI args that will
+# work with both Windows and non-Windows executions.
+MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@"
+export MAVEN_CMD_LINE_ARGS
+
+WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
+
+exec "$JAVACMD" \
+ $MAVEN_OPTS \
+ -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
+ "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
+ ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"
diff --git a/mvnw.cmd b/mvnw.cmd
new file mode 100644
index 0000000..c8d4337
--- /dev/null
+++ b/mvnw.cmd
@@ -0,0 +1,182 @@
+@REM ----------------------------------------------------------------------------
+@REM Licensed to the Apache Software Foundation (ASF) under one
+@REM or more contributor license agreements. See the NOTICE file
+@REM distributed with this work for additional information
+@REM regarding copyright ownership. The ASF licenses this file
+@REM to you under the Apache License, Version 2.0 (the
+@REM "License"); you may not use this file except in compliance
+@REM with the License. You may obtain a copy of the License at
+@REM
+@REM https://www.apache.org/licenses/LICENSE-2.0
+@REM
+@REM Unless required by applicable law or agreed to in writing,
+@REM software distributed under the License is distributed on an
+@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+@REM KIND, either express or implied. See the License for the
+@REM specific language governing permissions and limitations
+@REM under the License.
+@REM ----------------------------------------------------------------------------
+
+@REM ----------------------------------------------------------------------------
+@REM Maven 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 keystroke before ending
+@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
+@REM e.g. to debug Maven itself, use
+@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
+@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
+@REM ----------------------------------------------------------------------------
+
+@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
+@echo off
+@REM set title of command window
+title %0
+@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on'
+@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
+
+@REM set %HOME% to equivalent of $HOME
+if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
+
+@REM Execute a user defined script before this one
+if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
+@REM check for pre script, once with legacy .bat ending and once with .cmd ending
+if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
+if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
+:skipRcPre
+
+@setlocal
+
+set ERROR_CODE=0
+
+@REM To isolate internal variables from possible post scripts, we use another setlocal
+@setlocal
+
+@REM ==== START VALIDATION ====
+if not "%JAVA_HOME%" == "" goto OkJHome
+
+echo.
+echo Error: JAVA_HOME not found in your environment. >&2
+echo Please set the JAVA_HOME variable in your environment to match the >&2
+echo location of your Java installation. >&2
+echo.
+goto error
+
+:OkJHome
+if exist "%JAVA_HOME%\bin\java.exe" goto init
+
+echo.
+echo Error: JAVA_HOME is set to an invalid directory. >&2
+echo JAVA_HOME = "%JAVA_HOME%" >&2
+echo Please set the JAVA_HOME variable in your environment to match the >&2
+echo location of your Java installation. >&2
+echo.
+goto error
+
+@REM ==== END VALIDATION ====
+
+:init
+
+@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
+@REM Fallback to current working directory if not found.
+
+set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
+IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
+
+set EXEC_DIR=%CD%
+set WDIR=%EXEC_DIR%
+:findBaseDir
+IF EXIST "%WDIR%"\.mvn goto baseDirFound
+cd ..
+IF "%WDIR%"=="%CD%" goto baseDirNotFound
+set WDIR=%CD%
+goto findBaseDir
+
+:baseDirFound
+set MAVEN_PROJECTBASEDIR=%WDIR%
+cd "%EXEC_DIR%"
+goto endDetectBaseDir
+
+:baseDirNotFound
+set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
+cd "%EXEC_DIR%"
+
+:endDetectBaseDir
+
+IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
+
+@setlocal EnableExtensions EnableDelayedExpansion
+for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
+@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
+
+:endReadAdditionalConfig
+
+SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
+set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
+set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
+
+set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
+
+FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
+ IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B
+)
+
+@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
+@REM This allows using the maven wrapper in projects that prohibit checking in binary data.
+if exist %WRAPPER_JAR% (
+ if "%MVNW_VERBOSE%" == "true" (
+ echo Found %WRAPPER_JAR%
+ )
+) else (
+ if not "%MVNW_REPOURL%" == "" (
+ SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
+ )
+ if "%MVNW_VERBOSE%" == "true" (
+ echo Couldn't find %WRAPPER_JAR%, downloading it ...
+ echo Downloading from: %DOWNLOAD_URL%
+ )
+
+ powershell -Command "&{"^
+ "$webclient = new-object System.Net.WebClient;"^
+ "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^
+ "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^
+ "}"^
+ "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^
+ "}"
+ if "%MVNW_VERBOSE%" == "true" (
+ echo Finished downloading %WRAPPER_JAR%
+ )
+)
+@REM End of extension
+
+@REM Provide a "standardized" way to retrieve the CLI args that will
+@REM work with both Windows and non-Windows executions.
+set MAVEN_CMD_LINE_ARGS=%*
+
+%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
+if ERRORLEVEL 1 goto error
+goto end
+
+:error
+set ERROR_CODE=1
+
+:end
+@endlocal & set ERROR_CODE=%ERROR_CODE%
+
+if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
+@REM check for post script, once with legacy .bat ending and once with .cmd ending
+if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
+if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
+:skipRcPost
+
+@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
+if "%MAVEN_BATCH_PAUSE%" == "on" pause
+
+if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
+
+exit /B %ERROR_CODE%
diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..02ca3d4
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,85 @@
+
+
+ 4.0.0
+
+
+ com.ccsens
+ ptccsens
+ 0.0.1-SNAPSHOT
+ ptccsens
+
+ Demo project for Spring Boot
+
+ 1.8
+
+
+
+
+
+ cloudutil
+ com.ccsens
+ 1.0-SNAPSHOT
+
+
+
+ common
+ com.ccsens
+ 1.0-SNAPSHOT
+
+
+
+ com.ccsens
+ util
+ 1.0-SNAPSHOT
+ compile
+
+
+
+ wechatutil
+ com.ccsens
+ 1.0-SNAPSHOT
+
+
+
+
+
+
+
+
+ org.mybatis.generator
+ mybatis-generator-maven-plugin
+ 1.3.7
+
+ ${basedir}/src/main/resources/mbg.xml
+ true
+
+
+
+ mysql
+ mysql-connector-java
+ 5.1.34
+
+
+
+
+ org.springframework.boot
+ spring-boot-maven-plugin
+
+ com.ccsens.ptccsens.PtCcsensApplication
+
+
+
+
+
+ repackage
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/java/com/ccsens/ptccsens/PtCcsensApplication.java b/src/main/java/com/ccsens/ptccsens/PtCcsensApplication.java
new file mode 100644
index 0000000..2b33b19
--- /dev/null
+++ b/src/main/java/com/ccsens/ptccsens/PtCcsensApplication.java
@@ -0,0 +1,31 @@
+package com.ccsens.ptccsens;
+
+import com.ccsens.cloudutil.ribbon.RibbonConfiguration;
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.web.servlet.ServletComponentScan;
+import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
+import org.springframework.cloud.openfeign.EnableFeignClients;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.context.annotation.FilterType;
+import org.springframework.scheduling.annotation.EnableAsync;
+
+/**
+ * @author whj
+ */
+@MapperScan(basePackages = {"com.ccsens.ptccsens.persist.*","com.ccsens.common.persist.*"})
+@ServletComponentScan
+@EnableAsync
+//开启断路器功能
+@EnableCircuitBreaker
+@EnableFeignClients(basePackages = "com.ccsens.cloudutil.feign")
+@SpringBootApplication
+@ComponentScan(basePackages = "com.ccsens", excludeFilters = { @ComponentScan.Filter(type= FilterType.ASSIGNABLE_TYPE, value = RibbonConfiguration.class)})
+public class PtCcsensApplication {
+
+ public static void main(String[] args) {
+ SpringApplication.run(PtCcsensApplication.class, args);
+ }
+
+}
diff --git a/src/main/java/com/ccsens/ptccsens/api/DebugController.java b/src/main/java/com/ccsens/ptccsens/api/DebugController.java
new file mode 100644
index 0000000..724e2fd
--- /dev/null
+++ b/src/main/java/com/ccsens/ptccsens/api/DebugController.java
@@ -0,0 +1,29 @@
+package com.ccsens.ptccsens.api;
+
+import com.ccsens.util.JsonResponse;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.servlet.http.HttpServletRequest;
+
+@Api(tags = "DEBUG" , description = "DebugController | ")
+@RestController
+@RequestMapping("/debug")
+@Slf4j
+public class DebugController {
+
+ @ApiOperation(value = "/测试",notes = "")
+ @ApiImplicitParams({
+ })
+ @RequestMapping(value="",method = RequestMethod.GET,produces = {"application/json;charset=UTF-8"})
+ public JsonResponse debug(HttpServletRequest request) throws Exception {
+
+ return JsonResponse.newInstance().ok("测试");
+ }
+
+}
diff --git a/src/main/java/com/ccsens/ptccsens/api/project/MemberController.java b/src/main/java/com/ccsens/ptccsens/api/project/MemberController.java
new file mode 100644
index 0000000..6dac44c
--- /dev/null
+++ b/src/main/java/com/ccsens/ptccsens/api/project/MemberController.java
@@ -0,0 +1,92 @@
+package com.ccsens.ptccsens.api.project;
+
+import com.ccsens.cloudutil.annotation.MustLogin;
+import com.ccsens.common.bean.dto.CMemberDto;
+import com.ccsens.common.bean.vo.CMemberVo;
+import com.ccsens.common.service.MemberService;
+import com.ccsens.util.JsonResponse;
+import com.ccsens.util.bean.dto.QueryDto;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+/**
+ * @author 逗
+ */
+@Api(tags = "角色相关" , description = "DebugController | ")
+@RestController
+@RequestMapping("/member")
+@Slf4j
+public class MemberController {
+ @Resource
+ private MemberService memberService;
+
+ @MustLogin
+ @ApiOperation(value = "查找项目下的成员", notes = "")
+ @RequestMapping(value = "/query", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
+ public JsonResponse> queryByProjectId(@ApiParam @Validated @RequestBody QueryDto params) {
+ log.info("查找项目下的成员:{}",params);
+ List memberInfoList = memberService.queryByProject(params.getParam(), params.getUserId());
+ log.info("项目下的成员列表:{}",memberInfoList);
+ return JsonResponse.newInstance().ok(memberInfoList);
+ }
+
+ @MustLogin
+ @ApiOperation(value = "根据id查找成员", notes = "")
+ @RequestMapping(value = "/getById", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
+ public JsonResponse> getMemberById(@ApiParam @Validated @RequestBody QueryDto params) {
+ log.info("根据id查找成员:{}",params);
+ CMemberVo.MemberInfo memberInfo = memberService.getMemberById(params.getParam(), params.getUserId());
+ log.info("根据id查找成员信息:{}",memberInfo);
+ return JsonResponse.newInstance().ok(memberInfo);
+ }
+
+ @MustLogin
+ @ApiOperation(value = "添加成员", notes = "")
+ @RequestMapping(value = "/save", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
+ public JsonResponse saveMember(@ApiParam @Validated @RequestBody QueryDto params) {
+ log.info("添加成员:{}",params);
+ memberService.saveMember(params.getParam(), params.getUserId());
+ log.info("添加成员成功");
+ return JsonResponse.newInstance().ok();
+ }
+
+ @MustLogin
+ @ApiOperation(value = "修改成员信息", notes = "")
+ @RequestMapping(value = "/update", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
+ public JsonResponse updateMember(@ApiParam @Validated @RequestBody QueryDto params) {
+ log.info("修改成员信息:{}",params);
+ memberService.updateMember(params.getParam(), params.getUserId());
+ log.info("修改成员信息成功");
+ return JsonResponse.newInstance().ok();
+ }
+
+ @MustLogin
+ @ApiOperation(value = "删除成员信息", notes = "")
+ @RequestMapping(value = "/delete", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
+ public JsonResponse delMember(@ApiParam @Validated @RequestBody QueryDto params) {
+ log.info("删除成员信息:{}",params);
+ memberService.deleteMember(params.getParam(), params.getUserId());
+ log.info("删除成员信息成功");
+ return JsonResponse.newInstance().ok();
+ }
+
+ @MustLogin
+ @ApiOperation(value = "修改成员所属的角色", notes = "")
+ @RequestMapping(value = "/memberRoles", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
+ public JsonResponse updateMemberRoles(@ApiParam @Validated @RequestBody QueryDto params) {
+ log.info("修改成员所属的角色:{}",params);
+ memberService.updateMemberRoles(params.getParam(), params.getUserId());
+ log.info("修改成员所属的角色成功");
+ return JsonResponse.newInstance().ok();
+ }
+}
diff --git a/src/main/java/com/ccsens/ptccsens/api/project/PluginController.java b/src/main/java/com/ccsens/ptccsens/api/project/PluginController.java
new file mode 100644
index 0000000..6311cc2
--- /dev/null
+++ b/src/main/java/com/ccsens/ptccsens/api/project/PluginController.java
@@ -0,0 +1,39 @@
+package com.ccsens.ptccsens.api.project;
+
+import com.ccsens.cloudutil.annotation.MustLogin;
+import com.ccsens.common.bean.dto.CPluginDto;
+import com.ccsens.common.service.IPluginService;
+import com.ccsens.util.JsonResponse;
+import com.ccsens.util.bean.dto.QueryDto;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+/**
+ * @author 逗
+ */
+@Api(tags = "插件相关" , description = "DebugController | ")
+@RestController
+@RequestMapping("/plugin")
+@Slf4j
+public class PluginController {
+ @Resource
+ private IPluginService pluginService;
+
+ @MustLogin
+ @ApiOperation(value = "给任务添加插件", notes = "")
+ @RequestMapping(value = "/save", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
+ public JsonResponse queryPatientList(@ApiParam @Validated @RequestBody QueryDto> params) throws Exception{
+ pluginService.updateTaskPlugin(params.getParam());
+ return JsonResponse.newInstance().ok();
+ }
+}
diff --git a/src/main/java/com/ccsens/ptccsens/api/project/PowerController.java b/src/main/java/com/ccsens/ptccsens/api/project/PowerController.java
new file mode 100644
index 0000000..9d40569
--- /dev/null
+++ b/src/main/java/com/ccsens/ptccsens/api/project/PowerController.java
@@ -0,0 +1,38 @@
+package com.ccsens.ptccsens.api.project;
+
+import com.ccsens.common.bean.dto.CProjectDto;
+import com.ccsens.common.service.IPowerService;
+import com.ccsens.util.JsonResponse;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+
+/**
+ * @author 逗
+ */
+@Api(tags = "权限相关" , description = "")
+@RestController
+@RequestMapping("/power")
+@Slf4j
+public class PowerController {
+
+ @Resource
+ private IPowerService powerService;
+
+
+ @ApiOperation(value = "查询用户在项目中的权限", notes = "")
+ @RequestMapping(value = "/query", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
+ public JsonResponse queryPatientList(@ApiParam @Validated @RequestBody CProjectDto.QueryPower params) throws Exception{
+ Integer power = powerService.queryUserPower(params.getProjectId(), params.getUserId());
+ return JsonResponse.newInstance().ok(power);
+ }
+
+}
diff --git a/src/main/java/com/ccsens/ptccsens/api/project/ProjectController.java b/src/main/java/com/ccsens/ptccsens/api/project/ProjectController.java
new file mode 100644
index 0000000..6e0ab89
--- /dev/null
+++ b/src/main/java/com/ccsens/ptccsens/api/project/ProjectController.java
@@ -0,0 +1,66 @@
+package com.ccsens.ptccsens.api.project;
+
+import com.ccsens.common.bean.dto.CProjectDto;
+import com.ccsens.common.bean.vo.CProjectVo;
+import com.ccsens.common.service.IProjectService;
+import com.ccsens.util.JsonResponse;
+import com.ccsens.util.bean.dto.QueryDto;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+/**
+ * @author 逗
+ */
+@Api(tags = "项目相关" , description = "DebugController | ")
+@RestController
+@RequestMapping("/project")
+@Slf4j
+public class ProjectController {
+
+ @Resource
+ private IProjectService projectService;
+
+ @ApiOperation(value = "根据id查询项目信息", notes = "根据id查询项目信息")
+ @RequestMapping(value = "/findProjectById", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
+ public JsonResponse findProjectById(@ApiParam @Validated @RequestBody QueryDto params) throws Exception{
+ CProjectVo.ProjectInfo projectById = projectService.findProjectById(params.getParam(), params.getUserId());
+ return JsonResponse.newInstance().ok(projectById);
+ }
+
+ @ApiOperation(value = "查询子项目", notes = "查询子项目")
+ @RequestMapping(value = "/findSonProject", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
+ public JsonResponse> findSonProject(@ApiParam @Validated @RequestBody QueryDto params) throws Exception{
+ log.info("查询子项目开始");
+ List projectInfoList = projectService.findSonProject(params.getParam(), params.getUserId());
+ log.info("查询子项目结束{}",projectInfoList);
+ return JsonResponse.newInstance().ok(projectInfoList);
+ }
+
+
+ @ApiOperation(value = "删除项目", notes = "删除项目")
+ @RequestMapping(value = "/deleteProject", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
+ public JsonResponse deleteProject(@ApiParam @Validated @RequestBody QueryDto params) throws Exception{
+ log.info("删除项目开始");
+ projectService.deleteProjectById(params.getParam(), params.getUserId());
+ log.info("删除项目结束");
+ return JsonResponse.newInstance().ok();
+ }
+
+ @RequestMapping(value = "/tallDelProject", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
+ public JsonResponse deleteProject(@ApiParam @Validated @RequestBody CProjectDto.ProjectById params) throws Exception{
+ log.info("删除项目开始");
+ projectService.deleteProjectById(params,null);
+ log.info("删除项目结束");
+ return JsonResponse.newInstance().ok();
+ }
+}
diff --git a/src/main/java/com/ccsens/ptccsens/api/project/RoleController.java b/src/main/java/com/ccsens/ptccsens/api/project/RoleController.java
new file mode 100644
index 0000000..d0b1668
--- /dev/null
+++ b/src/main/java/com/ccsens/ptccsens/api/project/RoleController.java
@@ -0,0 +1,99 @@
+package com.ccsens.ptccsens.api.project;
+
+import com.ccsens.cloudutil.annotation.MustLogin;
+import com.ccsens.common.bean.dto.CRoleDto;
+import com.ccsens.common.bean.vo.CRoleVo;
+import com.ccsens.common.service.IProRoleService;
+import com.ccsens.util.JsonResponse;
+import com.ccsens.util.bean.dto.QueryDto;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+/**
+ * @author 逗
+ */
+@Api(tags = "角色相关" , description = "DebugController | ")
+@RestController
+@RequestMapping("/role")
+@Slf4j
+public class RoleController {
+ @Resource
+ private IProRoleService roleService;
+
+ @MustLogin
+ @ApiOperation(value = "根据项目id查找角色", notes = "")
+ @RequestMapping(value = "/show", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
+ public JsonResponse queryByProjectId(@ApiParam @Validated @RequestBody QueryDto params) {
+ CRoleVo.QueryRole queryRole = roleService.queryShowRole(params.getParam(), params.getUserId());
+ return JsonResponse.newInstance().ok(queryRole);
+ }
+
+ @MustLogin
+ @ApiOperation(value = "修改角色展示", notes = "")
+ @RequestMapping(value = "/updateShow", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
+ public JsonResponse updateShow(@ApiParam @Validated @RequestBody QueryDto params) {
+ roleService.updateShowRole(params.getParam(),params.getUserId());
+ return JsonResponse.newInstance().ok();
+ }
+
+ @MustLogin
+ @ApiOperation(value = "查询角色下的所有成员", notes = "")
+ @RequestMapping(value = "/queryMemberOfRole", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
+ public JsonResponse> queryMemberOfRole(@ApiParam @Validated @RequestBody QueryDto params) {
+ log.info("查询角色下的所有成员开始{}",params);
+ List member = roleService.queryMemberOfRole(params.getParam(),params.getUserId());
+ log.info("查询角色下的所有成员开始{}",params);
+ return JsonResponse.newInstance().ok(member);
+ }
+
+ @MustLogin
+ @ApiOperation(value = "添加角色", notes = "")
+ @RequestMapping(value = "/save", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
+ public JsonResponse saveRole(@ApiParam @Validated @RequestBody QueryDto params) {
+ log.info("添加角色{}",params);
+ roleService.saveRole(params.getParam(),params.getUserId());
+ log.info("添加角色成功");
+ return JsonResponse.newInstance().ok();
+ }
+
+ @MustLogin
+ @ApiOperation(value = "修改角色信息", notes = "")
+ @RequestMapping(value = "/update", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
+ public JsonResponse updateRole(@ApiParam @Validated @RequestBody QueryDto params) {
+ log.info("修改角色信息{}",params);
+ roleService.updateRole(params.getParam(),params.getUserId());
+ log.info("修改角色信息成功");
+ return JsonResponse.newInstance().ok();
+ }
+
+ @MustLogin
+ @ApiOperation(value = "删除角色", notes = "")
+ @RequestMapping(value = "/delete", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
+ public JsonResponse deleteRole(@ApiParam @Validated @RequestBody QueryDto params) {
+ log.info("删除角色{}",params);
+ roleService.delRole(params.getParam(),params.getUserId());
+ log.info("删除角色成功");
+ return JsonResponse.newInstance().ok();
+ }
+
+ @MustLogin
+ @ApiOperation(value = "修改角色下的成员", notes = "")
+ @RequestMapping(value = "/roleMembers", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
+ public JsonResponse updateRoleMembers(@ApiParam @Validated @RequestBody QueryDto params) {
+ log.info("修改角色下的成员{}",params);
+ roleService.updateRoleMembers(params.getParam(),params.getUserId());
+ log.info("修改角色下的成员成功");
+ return JsonResponse.newInstance().ok();
+ }
+
+}
diff --git a/src/main/java/com/ccsens/ptccsens/api/project/ShareController.java b/src/main/java/com/ccsens/ptccsens/api/project/ShareController.java
new file mode 100644
index 0000000..6ef6de2
--- /dev/null
+++ b/src/main/java/com/ccsens/ptccsens/api/project/ShareController.java
@@ -0,0 +1,48 @@
+package com.ccsens.ptccsens.api.project;
+
+import com.ccsens.cloudutil.annotation.MustLogin;
+import com.ccsens.common.bean.dto.CShareDto;
+import com.ccsens.common.bean.vo.CShareVo;
+import com.ccsens.common.service.IShareService;
+import com.ccsens.util.JsonResponse;
+import com.ccsens.util.bean.dto.QueryDto;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+
+/**
+ * @author AUSU
+ */
+@Api(tags = "分享相关")
+@RestController
+@RequestMapping("/share")
+@Slf4j
+public class ShareController {
+
+ @Resource
+ private IShareService shareService;
+
+ @MustLogin
+ @ApiOperation(value = "创建分享连接", notes = "")
+ @RequestMapping(value = "/create", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
+ public JsonResponse createShareUrl(@ApiParam @Validated @RequestBody QueryDto params) {
+ CShareVo.CreateShareUrl shareUrl = shareService.createShareUrl(params.getParam(), params.getUserId());
+ return JsonResponse.newInstance().ok(shareUrl);
+ }
+
+ @MustLogin
+ @ApiOperation(value = "点击分享连接", notes = "")
+ @RequestMapping(value = "/click", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
+ public JsonResponse queryByProjectId(@ApiParam @Validated @RequestBody QueryDto params) {
+ CShareVo.ClickShareInfo clickShareInfo = shareService.clickShareUrl(params.getParam(), params.getUserId(),params.getUserName(),params.getPhone());
+ return JsonResponse.newInstance().ok(clickShareInfo);
+ }
+}
diff --git a/src/main/java/com/ccsens/ptccsens/api/project/TaskController.java b/src/main/java/com/ccsens/ptccsens/api/project/TaskController.java
new file mode 100644
index 0000000..fa02437
--- /dev/null
+++ b/src/main/java/com/ccsens/ptccsens/api/project/TaskController.java
@@ -0,0 +1,129 @@
+package com.ccsens.ptccsens.api.project;
+
+import com.ccsens.cloudutil.annotation.MustLogin;
+import com.ccsens.common.bean.dto.CPluginDto;
+import com.ccsens.common.bean.dto.CTaskDto;
+import com.ccsens.common.bean.vo.CPluginVo;
+import com.ccsens.common.bean.vo.CTaskVo;
+import com.ccsens.common.service.ITaskService;
+import com.ccsens.util.JsonResponse;
+import com.ccsens.util.bean.dto.QueryDto;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+/**
+ * @author 逗
+ */
+@Api(tags = "任务相关" , description = "DebugController | ")
+@RestController
+@RequestMapping("/task")
+@Slf4j
+public class TaskController {
+ @Resource
+ private ITaskService taskService;
+
+ @MustLogin
+ @ApiOperation(value = "查找永久日常任务", notes = "")
+ @RequestMapping(value = "/permanent", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
+ public JsonResponse> queryPermanentGlobalTask(@ApiParam @Validated @RequestBody QueryDto params) {
+ List queryTasks = taskService.queryPermanentGlobalTask(params.getParam(), params.getUserId());
+ return JsonResponse.newInstance().ok(queryTasks);
+ }
+
+ @MustLogin
+ @ApiOperation(value = "查找带时间的日常任务", notes = "")
+ @RequestMapping(value = "/global", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
+ public JsonResponse> queryGlobalTask(@ApiParam @Validated @RequestBody QueryDto params) {
+ List queryTasks = taskService.queryGlobalTask(params.getParam(), params.getUserId());
+ return JsonResponse.newInstance().ok(queryTasks);
+ }
+
+ @MustLogin
+ @ApiOperation(value = "查找定期任务", notes = "")
+ @RequestMapping(value = "/regular", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
+ public JsonResponse> queryRegularTask(@ApiParam @Validated @RequestBody QueryDto params) {
+ List queryTasks = taskService.queryRegularTask(params.getParam(), params.getUserId());
+ return JsonResponse.newInstance().ok(queryTasks);
+ }
+
+ @MustLogin
+ @ApiOperation(value = "修改任务状态", notes = "")
+ @RequestMapping(value = "/type", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
+ public JsonResponse updateTaskType(@ApiParam @Validated @RequestBody QueryDto params) throws Exception {
+ taskService.updateTaskType(params.getParam(),params.getUserId());
+ return JsonResponse.newInstance().ok();
+ }
+
+ @ApiOperation(value = "查询子任务", notes = "")
+ @RequestMapping(value = "/findSonTask", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
+ public JsonResponse> findSonTask(@ApiParam @Validated @RequestBody QueryDto params) throws Exception {
+ log.info("查询子任务开始");
+ List sonTask = taskService.findSonTask(params.getParam(), params.getUserId());
+ log.info("查询子任务开始{}",sonTask);
+ return JsonResponse.newInstance().ok(sonTask);
+ }
+
+ @ApiOperation(value = "添加任务", notes = "")
+ @RequestMapping(value = "/save", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
+ public JsonResponse> saveTask(@ApiParam @Validated @RequestBody QueryDto params) throws Exception {
+ log.info("添加任务开始");
+ List taskList = taskService.saveTask(params.getParam(), params.getUserId());
+ log.info("添加任务结束{}",taskList);
+ return JsonResponse.newInstance().ok(taskList);
+ }
+
+ @ApiOperation(value = "查找项目下的任务", notes = "")
+ @RequestMapping(value = "/queryTaskOfProject", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
+ public JsonResponse> queryTaskOfProject(@ApiParam @Validated @RequestBody QueryDto params) throws Exception {
+ log.info("查找项目下的任务开始{}",params);
+ List taskList = taskService.queryTaskOfProject(params.getParam(), params.getUserId());
+ log.info("查找项目下的任务结束{}",taskList);
+ return JsonResponse.newInstance().ok(taskList);
+ }
+
+ @ApiOperation(value = "修改任务信息", notes = "")
+ @RequestMapping(value = "/update", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
+ public JsonResponse updateTask(@ApiParam @Validated @RequestBody QueryDto params) throws Exception {
+ log.info("修改任务信息开始{}",params);
+ taskService.updateTaskDetail(params.getParam(), params.getUserId());
+ log.info("修改任务信息结束");
+ return JsonResponse.newInstance().ok();
+ }
+
+ @ApiOperation(value = "删除任务", notes = "")
+ @RequestMapping(value = "/delete", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
+ public JsonResponse deleteTask(@ApiParam @Validated @RequestBody QueryDto params) throws Exception {
+ log.info("删除任务开始{}",params);
+ taskService.deleteTaskDetail(params.getParam(), params.getUserId());
+ log.info("删除任务结束");
+ return JsonResponse.newInstance().ok();
+ }
+
+ @ApiOperation(value = "查找任务下的插件列表", notes = "")
+ @RequestMapping(value = "/queryTaskPlugin", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
+ public JsonResponse> queryTaskPlugin(@ApiParam @Validated @RequestBody QueryDto params) throws Exception {
+ log.info("查找任务下的插件列表开始{}",params);
+ List taskPlugins = taskService.queryPluginByTaskId(params.getParam(), params.getUserId());
+ log.info("查找任务下的插件列表结束:{}",taskPlugins);
+ return JsonResponse.newInstance().ok(taskPlugins);
+ }
+
+ @ApiOperation(value = "给任务添加关联插件", notes = "")
+ @RequestMapping(value = "/saveTaskPlugin", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
+ public JsonResponse saveTaskPlugin(@ApiParam @Validated @RequestBody QueryDto params) throws Exception {
+ log.info("给任务添加关联插件{}",params);
+ taskService.saveTaskPlugin(params.getParam(), params.getUserId());
+ log.info("给任务添加关联插件结束");
+ return JsonResponse.newInstance().ok();
+ }
+}
diff --git a/src/main/java/com/ccsens/ptccsens/api/project/UserController.java b/src/main/java/com/ccsens/ptccsens/api/project/UserController.java
new file mode 100644
index 0000000..d35848e
--- /dev/null
+++ b/src/main/java/com/ccsens/ptccsens/api/project/UserController.java
@@ -0,0 +1,46 @@
+package com.ccsens.ptccsens.api.project;
+
+import com.ccsens.common.bean.dto.CMemberDto;
+import com.ccsens.ptccsens.service.IUserService;
+import com.ccsens.util.JsonResponse;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+
+@Api(tags = "DEBUG" , description = "DebugController | ")
+@RestController
+@RequestMapping("/user")
+@Slf4j
+public class UserController {
+ @Resource
+ private IUserService userService;
+
+ @ApiOperation(value = "根据手机号更新成员的userId",notes = "")
+ @ApiImplicitParams({
+ })
+ @RequestMapping(value="/memberWithPhone",method = RequestMethod.POST,produces = {"application/json;charset=UTF-8"})
+ public JsonResponse memberWithPhone(@ApiParam @Validated @RequestBody CMemberDto.PhoneAndUserId params) throws Exception {
+ log.info("根据手机号更新成员userId");
+ userService.memberWithPhone(params);
+ return JsonResponse.newInstance().ok();
+ }
+
+ @ApiOperation(value = "合并用户后修改userId",notes = "")
+ @ApiImplicitParams({
+ })
+ @RequestMapping(value="/mergeUser",method = RequestMethod.POST,produces = {"application/json;charset=UTF-8"})
+ public JsonResponse mergeUser(@ApiParam @Validated @RequestBody CMemberDto.MergeUser params) throws Exception {
+ log.info("合并用户后修改userId");
+ userService.mergeUser(params);
+ return JsonResponse.newInstance().ok();
+ }
+}
diff --git a/src/main/java/com/ccsens/ptccsens/api/project/WbsController.java b/src/main/java/com/ccsens/ptccsens/api/project/WbsController.java
new file mode 100644
index 0000000..e675918
--- /dev/null
+++ b/src/main/java/com/ccsens/ptccsens/api/project/WbsController.java
@@ -0,0 +1,74 @@
+package com.ccsens.ptccsens.api.project;
+
+import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.io.FileUtil;
+import cn.hutool.core.util.IdUtil;
+import cn.hutool.core.util.StrUtil;
+import com.ccsens.ptccsens.util.BasicsConstant;
+import com.ccsens.ptccsens.util.BasicsCodeError;
+import com.ccsens.cloudutil.annotation.MustLogin;
+import com.ccsens.ptccsens.bean.vo.ProjectVo;
+import com.ccsens.ptccsens.service.IImportService;
+import com.ccsens.util.JsonResponse;
+import com.ccsens.util.WebConstant;
+import com.ccsens.util.bean.dto.QueryDto;
+import com.ccsens.util.exception.BaseException;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.annotation.Resource;
+import java.io.File;
+import java.util.Date;
+
+/**
+ * @author 逗
+ */
+@Api(tags = "导入wbs" , description = "DebugController | ")
+@RestController
+@RequestMapping("/wbs")
+@Slf4j
+public class WbsController {
+
+ @Resource
+ private IImportService importService;
+
+
+
+ @MustLogin
+ @ApiOperation(value = "导入WBS",notes = "文件大小不能超过20M,支持后缀:.xls|.xlsx")
+ @ApiImplicitParams({
+// @ApiImplicitParam(name = "file", value = "WBS表", required = true, paramType = "form",dataType = "__file")
+ })
+ @RequestMapping(value = "", method = RequestMethod.POST)
+ public JsonResponse importWbs(QueryDto params, Long projectId) throws Exception {
+
+ MultipartFile f = params.getParam();
+ String ext = FileUtil.extName(f.getOriginalFilename());
+ if(StrUtil.isEmpty(ext) || !BasicsConstant.WbsExcel.WBS_FILE_FORMAT.contains(ext)){
+ throw new BaseException(BasicsCodeError.FILE_FORMAT_ERROR);
+ }
+ //文件路径
+ String dir = WebConstant.UPLOAD_PROJECT_WBS + File.separator;
+ String extraPath = DateUtil.format(new Date(), "yyyyMMdd");
+ String path = extraPath + File.separator + IdUtil.simpleUUID() + "." + ext;
+ //转成file
+ File file = new File(dir + extraPath);
+ if (!file.exists()) {
+ file.mkdirs();
+ }
+ String fullPath = dir + File.separator + path;
+ FileUtil.writeFromStream(f.getInputStream(), fullPath);
+
+ //导入数据库
+ ProjectVo.ProjectInfo projectInfo = importService.importWbs(fullPath,params.getUserId(),projectId);
+
+ return JsonResponse.newInstance().ok(projectInfo);
+ }
+
+}
diff --git a/src/main/java/com/ccsens/ptccsens/bean/dto/RoleDto.java b/src/main/java/com/ccsens/ptccsens/bean/dto/RoleDto.java
new file mode 100644
index 0000000..3dc2a43
--- /dev/null
+++ b/src/main/java/com/ccsens/ptccsens/bean/dto/RoleDto.java
@@ -0,0 +1,20 @@
+package com.ccsens.ptccsens.bean.dto;
+
+import lombok.Data;
+
+@Data
+public class RoleDto {
+
+ @Data
+ public static class WbsMember{
+ //成员id
+ private Long id;
+ //userId
+ private Long userId;
+
+ public WbsMember(Long id, Long userId) {
+ this.id = id;
+ this.userId = userId;
+ }
+ }
+}
diff --git a/src/main/java/com/ccsens/ptccsens/bean/dto/TaskDto.java b/src/main/java/com/ccsens/ptccsens/bean/dto/TaskDto.java
new file mode 100644
index 0000000..1ac7532
--- /dev/null
+++ b/src/main/java/com/ccsens/ptccsens/bean/dto/TaskDto.java
@@ -0,0 +1,29 @@
+package com.ccsens.ptccsens.bean.dto;
+
+import lombok.Data;
+
+/**
+ * @author 逗
+ */
+@Data
+public class TaskDto {
+
+ /**
+ * 导入wbs--插件关联表id
+ */
+ @Data
+ public static class TaskPluginId{
+ private Long taskPluginId1;
+ private Long taskPluginId2;
+ private Long taskPluginId3;
+
+ public TaskPluginId(Long id1, Long id2,Long id3) {
+ this.taskPluginId1 = id1;
+ this.taskPluginId2 = id2;
+ this.taskPluginId3 = id3;
+ }
+
+ public TaskPluginId() {
+ }
+ }
+}
diff --git a/src/main/java/com/ccsens/ptccsens/bean/vo/ProjectVo.java b/src/main/java/com/ccsens/ptccsens/bean/vo/ProjectVo.java
new file mode 100644
index 0000000..db1d9e8
--- /dev/null
+++ b/src/main/java/com/ccsens/ptccsens/bean/vo/ProjectVo.java
@@ -0,0 +1,60 @@
+package com.ccsens.ptccsens.bean.vo;
+
+import cn.hutool.core.util.ObjectUtil;
+import com.ccsens.util.WebConstant;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * @author AUSU
+ */
+@Data
+public class ProjectVo {
+ @Data
+ @ApiModel("项目信息defaultProject")
+ public static class ProjectInfo{
+ @ApiModelProperty("id")
+ private Long id;
+ @ApiModelProperty("项目名")
+ private String name;
+ @ApiModelProperty("开始时间")
+ private Long startTime;
+ @ApiModelProperty("结束时间")
+ private Long endTime;
+ @ApiModelProperty("项目完成状态(0-未开始,1-进行中,2-暂停,3-已完成)")
+ private byte status;
+ @ApiModelProperty("访问路径)")
+ private String url;
+
+ public Byte getStatus() {
+ long current = System.currentTimeMillis();
+ if(ObjectUtil.isNull(getStartTime()) || ObjectUtil.isNull(getEndTime())) {
+ return null;
+ }
+ if(getStartTime() > current){
+ this.status = (byte) WebConstant.EVENT_PROCESS.Pending.value;
+ }else if(getEndTime() < current){
+ this.status = (byte) WebConstant.EVENT_PROCESS.Expired.value;
+ }else{
+ this.status = (byte) WebConstant.EVENT_PROCESS.Processing.value;
+ }
+ return this.status;
+ }
+
+ }
+
+ @Data
+ public static class SysProject{
+ @ApiModelProperty("项目id")
+ private Long id;
+ @ApiModelProperty("项目名称")
+ private String name;
+ @ApiModelProperty("开始时间")
+ private Long beginTime;
+ @ApiModelProperty("结束时间")
+ private Long endTime;
+ @ApiModelProperty("导入类型(0-第一次导入,1-修改WBS)")
+ private Byte importType = 0;;
+ }
+}
diff --git a/src/main/java/com/ccsens/ptccsens/config/BeanConfig.java b/src/main/java/com/ccsens/ptccsens/config/BeanConfig.java
new file mode 100644
index 0000000..8446d22
--- /dev/null
+++ b/src/main/java/com/ccsens/ptccsens/config/BeanConfig.java
@@ -0,0 +1,22 @@
+package com.ccsens.ptccsens.config;
+
+import com.ccsens.ptccsens.intercept.MybatisInterceptor;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+/**
+ * @description:
+ * @author: wuHuiJuan
+ * @create: 2019/12/03 18:01
+ */
+@Configuration
+public class BeanConfig {
+ /**
+ * 注册拦截器
+ */
+ @Bean
+ public MybatisInterceptor mybatisInterceptor() {
+ MybatisInterceptor interceptor = new MybatisInterceptor();
+ return interceptor;
+ }
+}
diff --git a/src/main/java/com/ccsens/ptccsens/config/SpringConfig.java b/src/main/java/com/ccsens/ptccsens/config/SpringConfig.java
new file mode 100644
index 0000000..70b8c25
--- /dev/null
+++ b/src/main/java/com/ccsens/ptccsens/config/SpringConfig.java
@@ -0,0 +1,128 @@
+package com.ccsens.ptccsens.config;
+
+
+import cn.hutool.core.lang.Snowflake;
+import cn.hutool.core.util.IdUtil;
+import com.ccsens.util.config.DruidProps;
+import com.fasterxml.jackson.databind.DeserializationFeature;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.module.SimpleModule;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.http.MediaType;
+import org.springframework.http.converter.HttpMessageConverter;
+import org.springframework.http.converter.StringHttpMessageConverter;
+import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
+import org.springframework.web.servlet.config.annotation.*;
+
+import javax.annotation.Resource;
+import javax.sql.DataSource;
+import java.nio.charset.Charset;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.TimeZone;
+
+@Configuration
+public class SpringConfig implements WebMvcConfigurer {
+ @Resource
+ private DruidProps druidPropsUtil;
+ @Value("${spring.snowflake.workerId}")
+ private String workerId;
+ @Value("${spring.snowflake.datacenterId}")
+ private String datacenterId;
+
+ /**
+ * 配置Converter
+ * @return
+ */
+ @Bean
+ public HttpMessageConverter responseStringConverter() {
+ StringHttpMessageConverter converter = new StringHttpMessageConverter(
+ Charset.forName("UTF-8"));
+ return converter;
+ }
+
+ @Bean
+ public HttpMessageConverter