瀏覽代碼

创建making_friends相亲交友管理系统

yanliming 3 年之前
當前提交
9745058f93
共有 100 個文件被更改,包括 11930 次插入0 次删除
  1. 33 0
      .gitignore
  2. 316 0
      mvnw
  3. 188 0
      mvnw.cmd
  4. 314 0
      pom.xml
  5. 20 0
      src/main/java/com/jpsoft/making_friends/MakingFriendsApplication.java
  6. 153 0
      src/main/java/com/jpsoft/making_friends/common/controller/JwtsUserController.java
  7. 62 0
      src/main/java/com/jpsoft/making_friends/common/controller/TinymceController.java
  8. 47 0
      src/main/java/com/jpsoft/making_friends/common/controller/fileUploadController.java
  9. 51 0
      src/main/java/com/jpsoft/making_friends/common/utils/JwtUtil.java
  10. 17 0
      src/main/java/com/jpsoft/making_friends/config/OSSConfig.java
  11. 25 0
      src/main/java/com/jpsoft/making_friends/config/ParkingConfig.java
  12. 180 0
      src/main/java/com/jpsoft/making_friends/config/RedisConfig.java
  13. 75 0
      src/main/java/com/jpsoft/making_friends/config/SwaggerConfig.java
  14. 131 0
      src/main/java/com/jpsoft/making_friends/config/WebMvcConfig.java
  15. 18 0
      src/main/java/com/jpsoft/making_friends/dao/base/HobbyInfoDAO.java
  16. 18 0
      src/main/java/com/jpsoft/making_friends/dao/base/MemberHobbyDAO.java
  17. 18 0
      src/main/java/com/jpsoft/making_friends/dao/base/MemberInfoDAO.java
  18. 18 0
      src/main/java/com/jpsoft/making_friends/dao/base/NewsInfoDAO.java
  19. 18 0
      src/main/java/com/jpsoft/making_friends/dao/base/NewsTypeDAO.java
  20. 18 0
      src/main/java/com/jpsoft/making_friends/dao/base/OrgInfoDAO.java
  21. 30 0
      src/main/java/com/jpsoft/making_friends/dao/sys/DataDictionaryDAO.java
  22. 21 0
      src/main/java/com/jpsoft/making_friends/dao/sys/MenuDAO.java
  23. 21 0
      src/main/java/com/jpsoft/making_friends/dao/sys/PermissionDAO.java
  24. 21 0
      src/main/java/com/jpsoft/making_friends/dao/sys/RoleDAO.java
  25. 23 0
      src/main/java/com/jpsoft/making_friends/dao/sys/RoleMenuDAO.java
  26. 21 0
      src/main/java/com/jpsoft/making_friends/dao/sys/RolePermissionDAO.java
  27. 19 0
      src/main/java/com/jpsoft/making_friends/dao/sys/SysLogDAO.java
  28. 26 0
      src/main/java/com/jpsoft/making_friends/dao/sys/UserDAO.java
  29. 22 0
      src/main/java/com/jpsoft/making_friends/dao/sys/UserRoleDAO.java
  30. 51 0
      src/main/java/com/jpsoft/making_friends/dto/MessageResult.java
  31. 24 0
      src/main/java/com/jpsoft/making_friends/dto/RoleRelatedDTO.java
  32. 32 0
      src/main/java/com/jpsoft/making_friends/dto/Sort.java
  33. 21 0
      src/main/java/com/jpsoft/making_friends/dto/service/BaseService.java
  34. 105 0
      src/main/java/com/jpsoft/making_friends/dto/service/IRedisService.java
  35. 37 0
      src/main/java/com/jpsoft/making_friends/dto/service/imp/RedisServiceImpl.java
  36. 136 0
      src/main/java/com/jpsoft/making_friends/dto/utils/AESUtil.java
  37. 273 0
      src/main/java/com/jpsoft/making_friends/dto/utils/Base64.java
  38. 198 0
      src/main/java/com/jpsoft/making_friends/dto/utils/CheckIdCard.java
  39. 78 0
      src/main/java/com/jpsoft/making_friends/dto/utils/DES3.java
  40. 137 0
      src/main/java/com/jpsoft/making_friends/dto/utils/DigestRequest.java
  41. 143 0
      src/main/java/com/jpsoft/making_friends/dto/utils/Digests.java
  42. 197 0
      src/main/java/com/jpsoft/making_friends/dto/utils/GPSUtil.java
  43. 423 0
      src/main/java/com/jpsoft/making_friends/dto/utils/HttpConnectionUtil.java
  44. 60 0
      src/main/java/com/jpsoft/making_friends/dto/utils/HttpUtil.java
  45. 38 0
      src/main/java/com/jpsoft/making_friends/dto/utils/IdCardUtils.java
  46. 32 0
      src/main/java/com/jpsoft/making_friends/dto/utils/JwtUtil2.java
  47. 24 0
      src/main/java/com/jpsoft/making_friends/dto/utils/MyX509TrustManager.java
  48. 202 0
      src/main/java/com/jpsoft/making_friends/dto/utils/NewWordUtils.java
  49. 351 0
      src/main/java/com/jpsoft/making_friends/dto/utils/OSSUtil.java
  50. 428 0
      src/main/java/com/jpsoft/making_friends/dto/utils/POIUtils.java
  51. 84 0
      src/main/java/com/jpsoft/making_friends/dto/utils/PojoUtils.java
  52. 140 0
      src/main/java/com/jpsoft/making_friends/dto/utils/Sign.java
  53. 203 0
      src/main/java/com/jpsoft/making_friends/dto/utils/StringUtils.java
  54. 93 0
      src/main/java/com/jpsoft/making_friends/dto/utils/TimeZonesUtil.java
  55. 60 0
      src/main/java/com/jpsoft/making_friends/dto/utils/enterprise/AesException.java
  56. 26 0
      src/main/java/com/jpsoft/making_friends/dto/utils/enterprise/ByteGroup.java
  57. 67 0
      src/main/java/com/jpsoft/making_friends/dto/utils/enterprise/PKCS7Encoder.java
  58. 63 0
      src/main/java/com/jpsoft/making_friends/dto/utils/enterprise/SHA1.java
  59. 290 0
      src/main/java/com/jpsoft/making_friends/dto/utils/enterprise/WXBizMsgCrypt.java
  60. 72 0
      src/main/java/com/jpsoft/making_friends/dto/utils/enterprise/XMLParse.java
  61. 117 0
      src/main/java/com/jpsoft/making_friends/entity/base/HobbyInfo.java
  62. 131 0
      src/main/java/com/jpsoft/making_friends/entity/base/MemberHobby.java
  63. 539 0
      src/main/java/com/jpsoft/making_friends/entity/base/MemberInfo.java
  64. 187 0
      src/main/java/com/jpsoft/making_friends/entity/base/NewsInfo.java
  65. 117 0
      src/main/java/com/jpsoft/making_friends/entity/base/NewsType.java
  66. 117 0
      src/main/java/com/jpsoft/making_friends/entity/base/OrgInfo.java
  67. 203 0
      src/main/java/com/jpsoft/making_friends/entity/sys/DataDictionary.java
  68. 199 0
      src/main/java/com/jpsoft/making_friends/entity/sys/Menu.java
  69. 143 0
      src/main/java/com/jpsoft/making_friends/entity/sys/Permission.java
  70. 129 0
      src/main/java/com/jpsoft/making_friends/entity/sys/Role.java
  71. 129 0
      src/main/java/com/jpsoft/making_friends/entity/sys/RoleMenu.java
  72. 129 0
      src/main/java/com/jpsoft/making_friends/entity/sys/RolePermission.java
  73. 37 0
      src/main/java/com/jpsoft/making_friends/entity/sys/SysLog.java
  74. 197 0
      src/main/java/com/jpsoft/making_friends/entity/sys/User.java
  75. 129 0
      src/main/java/com/jpsoft/making_friends/entity/sys/UserRole.java
  76. 64 0
      src/main/java/com/jpsoft/making_friends/interceptor/LoginInterceptor.java
  77. 177 0
      src/main/java/com/jpsoft/making_friends/modules/mgr/controller/HobbyInfoController.java
  78. 177 0
      src/main/java/com/jpsoft/making_friends/modules/mgr/controller/MemberHobbyController.java
  79. 177 0
      src/main/java/com/jpsoft/making_friends/modules/mgr/controller/MemberInfoController.java
  80. 177 0
      src/main/java/com/jpsoft/making_friends/modules/mgr/controller/NewsInfoController.java
  81. 177 0
      src/main/java/com/jpsoft/making_friends/modules/mgr/controller/NewsTypeController.java
  82. 191 0
      src/main/java/com/jpsoft/making_friends/modules/mgr/controller/OrgInfoController.java
  83. 37 0
      src/main/java/com/jpsoft/making_friends/modules/sys/controller/ApiController.java
  84. 309 0
      src/main/java/com/jpsoft/making_friends/modules/sys/controller/DataDictionaryController.java
  85. 128 0
      src/main/java/com/jpsoft/making_friends/modules/sys/controller/LogController.java
  86. 283 0
      src/main/java/com/jpsoft/making_friends/modules/sys/controller/MenuController.java
  87. 310 0
      src/main/java/com/jpsoft/making_friends/modules/sys/controller/PermissionController.java
  88. 377 0
      src/main/java/com/jpsoft/making_friends/modules/sys/controller/RoleController.java
  89. 379 0
      src/main/java/com/jpsoft/making_friends/modules/sys/controller/UserController.java
  90. 17 0
      src/main/java/com/jpsoft/making_friends/service/base/HobbyInfoService.java
  91. 17 0
      src/main/java/com/jpsoft/making_friends/service/base/MemberHobbyService.java
  92. 17 0
      src/main/java/com/jpsoft/making_friends/service/base/MemberInfoService.java
  93. 17 0
      src/main/java/com/jpsoft/making_friends/service/base/NewsInfoService.java
  94. 17 0
      src/main/java/com/jpsoft/making_friends/service/base/NewsTypeService.java
  95. 17 0
      src/main/java/com/jpsoft/making_friends/service/base/OrgInfoService.java
  96. 70 0
      src/main/java/com/jpsoft/making_friends/service/base/imp/HobbyInfoServiceImpl.java
  97. 70 0
      src/main/java/com/jpsoft/making_friends/service/base/imp/MemberHobbyServiceImpl.java
  98. 70 0
      src/main/java/com/jpsoft/making_friends/service/base/imp/MemberInfoServiceImpl.java
  99. 70 0
      src/main/java/com/jpsoft/making_friends/service/base/imp/NewsInfoServiceImpl.java
  100. 70 0
      src/main/java/com/jpsoft/making_friends/service/base/imp/NewsTypeServiceImpl.java

+ 33 - 0
.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/

+ 316 - 0
mvnw

@@ -0,0 +1,316 @@
+#!/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 /usr/local/etc/mavenrc ] ; then
+    . /usr/local/etc/mavenrc
+  fi
+
+  if [ -f /etc/mavenrc ] ; then
+    . /etc/mavenrc
+  fi
+
+  if [ -f "$HOME/.mavenrc" ] ; then
+    . "$HOME/.mavenrc"
+  fi
+
+fi
+
+# OS specific support.  $var _must_ be set to either true or false.
+cygwin=false;
+darwin=false;
+mingw=false
+case "`uname`" in
+  CYGWIN*) cygwin=true ;;
+  MINGW*) mingw=true;;
+  Darwin*) darwin=true
+    # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
+    # See https://developer.apple.com/library/mac/qa/qa1170/_index.html
+    if [ -z "$JAVA_HOME" ]; then
+      if [ -x "/usr/libexec/java_home" ]; then
+        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="`\\unset -f command; \\command -v java`"
+  fi
+fi
+
+if [ ! -x "$JAVACMD" ] ; then
+  echo "Error: JAVA_HOME is not defined correctly." >&2
+  echo "  We cannot execute $JAVACMD" >&2
+  exit 1
+fi
+
+if [ -z "$JAVA_HOME" ] ; then
+  echo "Warning: JAVA_HOME environment variable is not set."
+fi
+
+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/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar"
+    else
+      jarUrl="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.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" || rm -f "$wrapperJarPath"
+        else
+            wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" || rm -f "$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 \
+  $MAVEN_DEBUG_OPTS \
+  -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
+  "-Dmaven.home=${M2_HOME}" \
+  "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
+  ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"

+ 188 - 0
mvnw.cmd

@@ -0,0 +1,188 @@
+@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 "%USERPROFILE%\mavenrc_pre.bat" call "%USERPROFILE%\mavenrc_pre.bat" %*
+if exist "%USERPROFILE%\mavenrc_pre.cmd" call "%USERPROFILE%\mavenrc_pre.cmd" %*
+:skipRcPre
+
+@setlocal
+
+set ERROR_CODE=0
+
+@REM To isolate internal variables from possible post scripts, we use another setlocal
+@setlocal
+
+@REM ==== START VALIDATION ====
+if not "%JAVA_HOME%" == "" goto OkJHome
+
+echo.
+echo Error: JAVA_HOME not found in your environment. >&2
+echo Please set the JAVA_HOME variable in your environment to match the >&2
+echo location of your Java installation. >&2
+echo.
+goto error
+
+:OkJHome
+if exist "%JAVA_HOME%\bin\java.exe" goto init
+
+echo.
+echo Error: JAVA_HOME is set to an invalid directory. >&2
+echo JAVA_HOME = "%JAVA_HOME%" >&2
+echo Please set the JAVA_HOME variable in your environment to match the >&2
+echo location of your Java installation. >&2
+echo.
+goto error
+
+@REM ==== END VALIDATION ====
+
+:init
+
+@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
+@REM Fallback to current working directory if not found.
+
+set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
+IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
+
+set EXEC_DIR=%CD%
+set WDIR=%EXEC_DIR%
+:findBaseDir
+IF EXIST "%WDIR%"\.mvn goto baseDirFound
+cd ..
+IF "%WDIR%"=="%CD%" goto baseDirNotFound
+set WDIR=%CD%
+goto findBaseDir
+
+:baseDirFound
+set MAVEN_PROJECTBASEDIR=%WDIR%
+cd "%EXEC_DIR%"
+goto endDetectBaseDir
+
+:baseDirNotFound
+set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
+cd "%EXEC_DIR%"
+
+:endDetectBaseDir
+
+IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
+
+@setlocal EnableExtensions EnableDelayedExpansion
+for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
+@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
+
+:endReadAdditionalConfig
+
+SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
+set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
+set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
+
+set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar"
+
+FOR /F "usebackq 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%/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.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 "%USERPROFILE%\mavenrc_post.bat" call "%USERPROFILE%\mavenrc_post.bat"
+if exist "%USERPROFILE%\mavenrc_post.cmd" call "%USERPROFILE%\mavenrc_post.cmd"
+:skipRcPost
+
+@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
+if "%MAVEN_BATCH_PAUSE%"=="on" pause
+
+if "%MAVEN_TERMINATE_CMD%"=="on" exit %ERROR_CODE%
+
+cmd /C exit /B %ERROR_CODE%

+ 314 - 0
pom.xml

@@ -0,0 +1,314 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.springframework.boot</groupId>
+        <artifactId>spring-boot-starter-parent</artifactId>
+        <version>2.2.1.RELEASE</version>
+        <relativePath/> <!-- lookup parent from repository -->
+    </parent>
+    <groupId>com.jpsoft</groupId>
+    <artifactId>making_friends</artifactId>
+    <version>0.0.1-SNAPSHOT</version>
+    <name>making_friends</name>
+    <description>Demo project for Spring Boot</description>
+    <properties>
+        <java.version>1.8</java.version>
+        <swagger2.version>2.7.0</swagger2.version>
+        <jwts.version>0.10.5</jwts.version>
+        <netty-all.version>4.1.6.Final</netty-all.version>
+        <fastjson.version>1.2.29</fastjson.version>
+        <alipay.version>4.8.10.ALL</alipay.version>
+        <ijpay.version>2.3.2</ijpay.version>
+        <poi.version>4.1.0</poi.version>
+        <lombok.version>1.18.12</lombok.version>
+    </properties>
+    <dependencies>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-thymeleaf</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>net.sourceforge.nekohtml</groupId>
+            <artifactId>nekohtml</artifactId>
+            <version>1.9.22</version>
+        </dependency>
+        <dependency>
+            <groupId>com.github.pagehelper</groupId>
+            <artifactId>pagehelper-spring-boot-starter</artifactId>
+            <version>LATEST</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.poi</groupId>
+            <artifactId>poi</artifactId>
+            <version>${poi.version}</version>
+            <scope>compile</scope>
+            <exclusions>
+                <exclusion>
+                    <artifactId>commons-codec</artifactId>
+                    <groupId>commons-codec</groupId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.poi</groupId>
+            <artifactId>poi-scratchpad</artifactId>
+            <version>${poi.version}</version>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.poi</groupId>
+            <artifactId>poi-ooxml</artifactId>
+            <version>${poi.version}</version>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.poi</groupId>
+            <artifactId>poi-ooxml-schemas</artifactId>
+            <version>${poi.version}</version>
+            <!--  <scope>compile</scope>-->
+            <exclusions>
+                <exclusion>
+                    <groupId>commons-codec</groupId>
+                    <artifactId>commons-codec</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-lang3</artifactId>
+            <version>3.7</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.httpcomponents</groupId>
+            <artifactId>httpclient</artifactId>
+            <exclusions>
+                <exclusion>
+                    <groupId>commons-codec</groupId>
+                    <artifactId>commons-codec</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>druid-spring-boot-starter</artifactId>
+            <version>1.1.10</version>
+        </dependency>
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>fastjson</artifactId>
+            <version>${fastjson.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-aop</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>io.springfox</groupId>
+            <artifactId>springfox-swagger2</artifactId>
+            <version>${swagger2.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>io.springfox</groupId>
+            <artifactId>springfox-swagger-ui</artifactId>
+            <version>${swagger2.version}</version>
+        </dependency>
+        <!--整合Knife4j-->
+        <dependency>
+            <groupId>com.github.xiaoymin</groupId>
+            <artifactId>knife4j-spring-boot-starter</artifactId>
+            <version>2.0.4</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.httpcomponents</groupId>
+            <artifactId>httpclient</artifactId>
+        </dependency>
+        <!--jwt start-->
+        <dependency>
+            <groupId>io.jsonwebtoken</groupId>
+            <artifactId>jjwt-api</artifactId>
+            <version>0.10.5</version>
+        </dependency>
+        <dependency>
+            <groupId>io.jsonwebtoken</groupId>
+            <artifactId>jjwt-impl</artifactId>
+            <version>${jwts.version}</version>
+            <scope>runtime</scope>
+        </dependency>
+        <dependency>
+            <groupId>io.jsonwebtoken</groupId>
+            <artifactId>jjwt-jackson</artifactId>
+            <version>${jwts.version}</version>
+            <scope>runtime</scope>
+        </dependency>
+        <!--jwt end-->
+        <dependency>
+            <groupId>joda-time</groupId>
+            <artifactId>joda-time</artifactId>
+            <version>2.10.5</version>
+        </dependency>
+
+        <!-- 数据库相关 start-->
+        <dependency>
+            <groupId>org.mybatis.spring.boot</groupId>
+            <artifactId>mybatis-spring-boot-starter</artifactId>
+            <version>2.0.1</version>
+        </dependency>
+
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>com.github.pagehelper</groupId>
+            <artifactId>pagehelper-spring-boot-starter</artifactId>
+            <version>LATEST</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>druid-spring-boot-starter</artifactId>
+            <version>1.1.10</version>
+        </dependency>
+
+
+        <dependency>
+            <groupId>io.jsonwebtoken</groupId>
+            <artifactId>jjwt-api</artifactId>
+            <version>0.10.5</version>
+        </dependency>
+        <dependency>
+            <groupId>io.jsonwebtoken</groupId>
+            <artifactId>jjwt-impl</artifactId>
+            <version>${jwts.version}</version>
+            <scope>runtime</scope>
+        </dependency>
+        <dependency>
+            <groupId>io.jsonwebtoken</groupId>
+            <artifactId>jjwt-jackson</artifactId>
+            <version>${jwts.version}</version>
+            <scope>runtime</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-data-redis</artifactId>
+            <version>2.2.1.RELEASE</version>
+        </dependency>
+        <!-- 数据库相关 end-->
+        <dependency>
+            <groupId>org.lazyluke</groupId>
+            <artifactId>log4jdbc-remix</artifactId>
+            <version>0.2.7</version>
+        </dependency>
+
+        <!-- aliyun oss start -->
+        <dependency>
+            <groupId>com.aliyun.oss</groupId>
+            <artifactId>aliyun-sdk-oss</artifactId>
+            <version>3.1.0</version>
+        </dependency>
+        <!-- aliyun oss end -->
+        <dependency>
+            <groupId>net.sf.json-lib</groupId>
+            <artifactId>json-lib</artifactId>
+            <version>2.4</version>
+            <type>jar</type>
+            <classifier>jdk15</classifier>
+        </dependency>
+        <dependency>
+            <groupId>com.github.dozermapper</groupId>
+            <artifactId>dozer-core</artifactId>
+            <version>6.4.1</version>
+        </dependency>
+        <dependency>
+            <groupId>org.bouncycastle</groupId>
+            <artifactId>bcprov-jdk16</artifactId>
+            <version>1.46</version>
+        </dependency>
+        <dependency>
+            <groupId>cn.hutool</groupId>
+            <artifactId>hutool-all</artifactId>
+            <version>5.0.6</version>
+        </dependency>
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+            <optional>true</optional>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-test</artifactId>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+                <configuration>
+                    <excludes>
+                        <exclude>
+                            <groupId>org.projectlombok</groupId>
+                            <artifactId>lombok</artifactId>
+                        </exclude>
+                    </excludes>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+    <profiles>
+        <profile>
+            <id>dev</id>
+            <dependencies>
+                <dependency>
+                    <groupId>org.springframework.boot</groupId>
+                    <artifactId>spring-boot-starter-tomcat</artifactId>
+                </dependency>
+            </dependencies>
+            <properties>
+                <active.profile>dev</active.profile>
+            </properties>
+            <activation>
+                <activeByDefault>true</activeByDefault>
+            </activation>
+        </profile>
+        <profile>
+            <id>test</id>
+            <dependencies>
+                <dependency>
+                    <groupId>javax.servlet</groupId>
+                    <artifactId>javax.servlet-api</artifactId>
+                    <version>3.1.0</version>
+                    <scope>provided</scope>
+                </dependency>
+            </dependencies>
+            <properties>
+                <active.profile>test</active.profile>
+            </properties>
+        </profile>
+        <profile>
+            <id>production</id>
+            <properties>
+                <active.profile>production</active.profile>
+            </properties>
+            <dependencies>
+                <dependency>
+                    <groupId>javax.servlet</groupId>
+                    <artifactId>javax.servlet-api</artifactId>
+                    <version>3.1.0</version>
+                    <scope>provided</scope>
+                </dependency>
+            </dependencies>
+        </profile>
+    </profiles>
+
+</project>

+ 20 - 0
src/main/java/com/jpsoft/making_friends/MakingFriendsApplication.java

@@ -0,0 +1,20 @@
+package com.jpsoft.making_friends;
+
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
+import org.springframework.scheduling.annotation.EnableAsync;
+import org.springframework.transaction.annotation.EnableTransactionManagement;
+
+@SpringBootApplication
+@EnableTransactionManagement
+@EnableAsync
+@MapperScan("com.jpsoft.making_friends.**.dao")
+public class MakingFriendsApplication extends SpringBootServletInitializer {
+
+    public static void main(String[] args) {
+        SpringApplication.run(MakingFriendsApplication.class, args);
+    }
+
+}

+ 153 - 0
src/main/java/com/jpsoft/making_friends/common/controller/JwtsUserController.java

@@ -0,0 +1,153 @@
+package com.jpsoft.making_friends.common.controller;
+
+import com.jpsoft.making_friends.dto.MessageResult;
+import com.jpsoft.making_friends.dto.utils.DES3;
+import com.jpsoft.making_friends.common.utils.JwtUtil;
+import com.jpsoft.making_friends.entity.sys.User;
+import com.jpsoft.making_friends.service.sys.UserService;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.joda.time.DateTime;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.web.bind.annotation.*;
+import springfox.documentation.annotations.ApiIgnore;
+
+import javax.servlet.http.HttpSession;
+
+@Slf4j
+@RestController
+public class JwtsUserController {
+    @Value("${jwt.secret}")
+    private String jwtSecret;
+
+    @Autowired
+    private UserService userService;
+
+//    @Autowired
+//    private ValueOperations<String,Object> valueOperations;
+
+    /**
+     * 接收扫码登录回调
+     * @param eventKey
+     * @param openId
+     * @return 返回值会在微信中显示
+     */
+    @ApiOperation(value = "接收扫码登录回调")
+    @PostMapping(value="/qrcode/scanLogin")
+    @ResponseBody
+    public MessageResult<String> scanLogin(String eventKey,String openId){
+        MessageResult<String> messageResult = new MessageResult<>();
+        log.warn(openId + "请求登录!");
+        String result;
+
+        User user = userService.findByOpenId(openId);
+
+        if(user!=null) {
+            String[] arr = eventKey.split(",");
+            String randNum = arr[1];
+
+            long expireSeconds = 3000; //5分钟
+
+            //生成token
+            String token = JwtUtil.createToken(jwtSecret,user.getId(),DateTime.now().plusHours(6).toDate());
+
+            //valueOperations.set("scan_qrcode_login_" + randNum, token, expireSeconds, TimeUnit.SECONDS);
+            messageResult.setMessage("扫码登录成功!");
+            messageResult.setResult(true);
+        }
+        else{
+            messageResult.setMessage("当前用户未绑定微信!");
+            messageResult.setResult(false);
+        }
+
+        return messageResult;
+    }
+
+//    @PostMapping("/qrcode/queryScanResult")
+//    @ApiOperation(value="查询扫码结果")
+//    public MessageResult<String> queryScanResult(String rnd){
+//        MessageResult<String> messageResult = new MessageResult<>();
+//
+//        try {
+//            String data = (String)valueOperations.get("scan_qrcode_login_" + rnd);
+//
+//            if(StringUtils.isNotEmpty(data)) {
+//                messageResult.setData(data);
+//                messageResult.setResult(true);
+//            }
+//            else{
+//                messageResult.setResult(false);
+//                messageResult.setMessage("暂无扫码结果");
+//            }
+//        }
+//        catch (Exception ex){
+//            log.error(ex.getMessage(),ex);
+//
+//            messageResult.setResult(false);
+//            messageResult.setMessage(ex.getMessage());
+//        }
+//
+//        return messageResult;
+//    }
+
+    @PostMapping("/login")
+    @ApiOperation(value="登录获取token,在swagger ui中获取token时将写入session,调用其它接口时不用再设置header")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name="userName", paramType="query", required=true, value="用户名"),
+            @ApiImplicitParam(name="password", paramType="query", required=true, value="密码")
+    })
+    public MessageResult<String> login(String userName, String password, @ApiIgnore HttpSession session){
+        MessageResult<String> messageResult = new MessageResult<>();
+
+        try {
+            User user = userService.findByUserName(userName);
+
+            DES3 des3 = new DES3();
+
+            String passwordEnc = des3.encrypt(jwtSecret,password);
+
+            if(user!=null && passwordEnc.equals(user.getPassword())){
+
+                //生成token
+                String token = JwtUtil.createToken(jwtSecret,user.getId(),DateTime.now().plusHours(12).toDate());
+
+                session.setAttribute("token",token);
+
+                messageResult.setResult(true);
+                messageResult.setData(token);
+            }
+            else{
+                messageResult.setResult(false);
+                messageResult.setMessage("用户不存在或密码错误!");
+            }
+
+        }
+        catch(Exception ex){
+            messageResult.setResult(false);
+            messageResult.setMessage(ex.getMessage());
+        }
+
+        return messageResult;
+    }
+
+    @GetMapping("/userInfo")
+    public MessageResult<User> userInfo(@RequestAttribute String subject){
+        MessageResult<User> messageResult = new MessageResult<>();
+
+        try {
+            User user = userService.get(subject);
+
+            messageResult.setResult(true);
+            messageResult.setData(user);
+        }
+        catch(Exception ex){
+            messageResult.setResult(false);
+            messageResult.setMessage(ex.getMessage());
+        }
+
+        return messageResult;
+    }
+}

+ 62 - 0
src/main/java/com/jpsoft/making_friends/common/controller/TinymceController.java

@@ -0,0 +1,62 @@
+package com.jpsoft.making_friends.common.controller;
+
+import com.jpsoft.making_friends.config.OSSConfig;
+import com.jpsoft.making_friends.dto.utils.OSSUtil;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+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.ResponseBody;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+
+@Controller
+@RequestMapping("/tinymce")
+public class TinymceController {
+    @Autowired
+    private OSSConfig ossConfig;
+
+    @RequestMapping(value = "/upload", method = RequestMethod.POST)
+    @ResponseBody
+    public Map<String, String> upload(HttpServletRequest request, HttpServletResponse response, @RequestParam MultipartFile upfile) throws IOException {
+	    Map<String, String> result = new HashMap<>();
+
+	    if (request.getMethod().equals("OPTIONS")){
+            response.setStatus(202);
+            return result;
+        }
+
+    	String retImgUrl = "";
+		String subFolder ="/editor";
+
+		try {
+            retImgUrl = OSSUtil.upload(ossConfig,subFolder,upfile.getOriginalFilename(),upfile.getInputStream());
+		} catch (Exception e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+
+    	String oldFileName= upfile.getOriginalFilename();
+
+    	//返回类型
+        if(StringUtils.isNotEmpty(retImgUrl)){
+	    	result.put("url", retImgUrl);
+	        result.put("size", String.valueOf(upfile.getSize()));  
+	        result.put("type", oldFileName.substring(oldFileName.lastIndexOf(".")));
+	        result.put("title", oldFileName.substring(0,oldFileName.lastIndexOf(".")));
+	        result.put("original", oldFileName.substring(0,oldFileName.lastIndexOf(".")));//文件名称
+	        result.put("state", STATE_SUCESS);
+        }
+
+        return result;  
+    }
+
+    private final static String STATE_SUCESS = "SUCCESS";
+}

+ 47 - 0
src/main/java/com/jpsoft/making_friends/common/controller/fileUploadController.java

@@ -0,0 +1,47 @@
+package com.jpsoft.making_friends.common.controller;
+
+import com.jpsoft.making_friends.config.OSSConfig;
+import com.jpsoft.making_friends.dto.MessageResult;
+import com.jpsoft.making_friends.dto.utils.OSSUtil;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.multipart.MultipartFile;
+
+@RestController
+public class fileUploadController {
+    private Logger logger = LoggerFactory.getLogger(getClass());
+
+    @Autowired
+    private OSSConfig ossConfig;
+
+    @PostMapping("uploadPicture")
+    @ApiOperation(value="人员照片上传")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name="subFolder",value = "路径",required = true,paramType = "form"),
+            @ApiImplicitParam(name = "photoFile",value = "员工照片", required = true,paramType="form", dataType = "__file")
+    })
+    public MessageResult<String> uploadPicture(String subFolder, MultipartFile photoFile){
+        MessageResult<String> messageResult = new MessageResult<>();
+
+        try {
+            String retFileUrl = OSSUtil.upload(ossConfig,"/" + subFolder,photoFile.getOriginalFilename(),photoFile.getInputStream());
+
+            messageResult.setResult(true);
+            messageResult.setData(retFileUrl);
+            messageResult.setCode(200);
+        } catch (Exception e) {
+            logger.error(e.getMessage(),e);
+
+            messageResult.setResult(false);
+            messageResult.setMessage(e.getMessage());
+        }
+
+        return messageResult;
+    }
+}

+ 51 - 0
src/main/java/com/jpsoft/making_friends/common/utils/JwtUtil.java

@@ -0,0 +1,51 @@
+package com.jpsoft.making_friends.common.utils;
+
+import io.jsonwebtoken.Claims;
+import io.jsonwebtoken.Jwts;
+import io.jsonwebtoken.security.Keys;
+
+import java.security.Key;
+import java.util.Base64;
+import java.util.Date;
+
+public class JwtUtil {
+    public static String createToken(String jwtSecret, String subject, Date expiration) {
+        //token有效时间天
+        byte[] privateKey = Base64.getDecoder().decode(jwtSecret);
+
+        Key key = Keys.hmacShaKeyFor(privateKey);
+
+        String token = Jwts.builder()
+                    .setSubject(subject)
+                //设置自定义claims后,setSubject值将失效
+//               .setClaims(extraInfo)
+                    .signWith(key)
+                    .setExpiration(expiration)
+                    .compact();
+
+        return "Bearer " + token;
+    }
+
+    public static String decodeToken(String jwtSecret,String token) throws Exception{
+        String prefix = "Bearer ";
+
+        if (token==null || token.length() < prefix.length()){
+            throw new Exception("未传递令牌或未带前缀Bearer!");
+        }
+
+        token = token.substring(prefix.length());
+
+        byte[] privateKey = Base64.getDecoder().decode(jwtSecret);
+
+        Key key = Keys.hmacShaKeyFor(privateKey);
+
+        Claims claims = Jwts.parser()
+                .setSigningKey(key)
+                .parseClaimsJws(token)
+                .getBody();
+
+        String subject = claims.getSubject();
+
+        return subject;
+    }
+}

+ 17 - 0
src/main/java/com/jpsoft/making_friends/config/OSSConfig.java

@@ -0,0 +1,17 @@
+package com.jpsoft.making_friends.config;
+
+import lombok.Data;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.stereotype.Component;
+
+@Component
+@ConfigurationProperties(prefix = "oss")
+@Data
+public class OSSConfig {
+    private String accessKeyId;
+    private String accessKeySecret;
+    private String endpoint;
+    private String bucketName;
+    private String urlPrefix;
+    private String objectPre;
+}

+ 25 - 0
src/main/java/com/jpsoft/making_friends/config/ParkingConfig.java

@@ -0,0 +1,25 @@
+package com.jpsoft.making_friends.config;
+
+import lombok.Data;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.stereotype.Component;
+
+/**
+ * @author 墨鱼_mo
+ * @date 2020-4-13 14:47
+ */
+@Component
+@ConfigurationProperties(prefix = "parking")
+@Data
+public class ParkingConfig {
+
+
+    private String userName;
+    private String ip;
+    private String interfaceUrl;
+    private String key;
+    private String uname;
+    private String password;
+    private String fileUrl;
+
+}

+ 180 - 0
src/main/java/com/jpsoft/making_friends/config/RedisConfig.java

@@ -0,0 +1,180 @@
+package com.jpsoft.making_friends.config;
+
+import com.fasterxml.jackson.annotation.JsonAutoDetect;
+import com.fasterxml.jackson.annotation.PropertyAccessor;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.jsontype.impl.LaissezFaireSubTypeValidator;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.cache.annotation.CachingConfigurerSupport;
+import org.springframework.cache.annotation.EnableCaching;
+import org.springframework.cache.interceptor.KeyGenerator;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.data.redis.cache.RedisCacheConfiguration;
+import org.springframework.data.redis.cache.RedisCacheManager;
+import org.springframework.data.redis.cache.RedisCacheWriter;
+import org.springframework.data.redis.connection.RedisConnectionFactory;
+import org.springframework.data.redis.core.*;
+import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
+import org.springframework.data.redis.serializer.RedisSerializationContext;
+import org.springframework.data.redis.serializer.RedisSerializer;
+import org.springframework.data.redis.serializer.StringRedisSerializer;
+
+import java.lang.reflect.Method;
+
+
+@Configuration
+@EnableCaching
+public class RedisConfig extends CachingConfigurerSupport {
+    public final static String WX_COMMON_ACCESS_TOKEN = "wx_common_accessToken";
+    public final static String JS_API_TICKET = "js_api_ticket";
+    public final static String PERSON_SELECT_COMPANY = "psc_";
+
+    /**
+     * 注入 RedisConnectionFactory,注意maven中要有redis.clients.jedis
+     */
+    @Autowired
+    RedisConnectionFactory redisConnectionFactory;
+
+    /**
+     * 实例化 RedisTemplate 对象
+     * @return
+     */
+    @Bean
+    public RedisTemplate<String, Object> getRedisTemplate() {
+        RedisTemplate<String, Object> redisTemplate = new RedisTemplate<>();
+        initDomainRedisTemplate(redisTemplate, redisConnectionFactory);
+        return redisTemplate;
+    }
+
+    /**
+     * 设置数据存入 redis 的序列化方式
+     *
+     * @param redisTemplate
+     * @param factory
+     */
+    private void initDomainRedisTemplate(RedisTemplate<String, Object> redisTemplate, RedisConnectionFactory factory) {
+        redisTemplate.setKeySerializer(new StringRedisSerializer());
+        redisTemplate.setValueSerializer(valueSerializer());
+        redisTemplate.setHashKeySerializer(new StringRedisSerializer());
+        redisTemplate.setHashValueSerializer(valueSerializer());
+        redisTemplate.setConnectionFactory(factory);
+    }
+
+    @Bean
+    public KeyGenerator keyGenerator() {
+        return new KeyGenerator() {
+            @Override
+            public Object generate(Object target, Method method, Object... params) {
+                StringBuilder sb = new StringBuilder();
+                sb.append(target.getClass().getName());
+                sb.append(method.getName());
+                for (Object obj : params) {
+                    sb.append(obj.toString());
+                }
+
+                return sb.toString();
+            }
+        };
+    }
+
+    /**
+     * 实例化 HashOperations 对象,可以使用 Hash 类型操作
+     *
+     * @param redisTemplate
+     * @return
+     */
+    @Bean
+    public HashOperations<String, String, Object> hashOperations(RedisTemplate<String, Object> redisTemplate) {
+        return redisTemplate.opsForHash();
+    }
+
+    /**
+     * 实例化 ValueOperations 对象,可以使用 String 操作
+     *
+     * @param redisTemplate
+     * @return
+     */
+    @Bean
+    public ValueOperations<String, Object> valueOperations(RedisTemplate<String, Object> redisTemplate) {
+        return redisTemplate.opsForValue();
+    }
+
+    /**
+     * 实例化 ListOperations 对象,可以使用 List 操作
+     *
+     * @param redisTemplate
+     * @return
+     */
+    @Bean
+    public ListOperations<String, Object> listOperations(RedisTemplate<String, Object> redisTemplate) {
+        return redisTemplate.opsForList();
+    }
+
+    /**
+     * 实例化 SetOperations 对象,可以使用 Set 操作
+     *
+     * @param redisTemplate
+     * @return
+     */
+    @Bean
+    public SetOperations<String, Object> setOperations(RedisTemplate<String, Object> redisTemplate) {
+        return redisTemplate.opsForSet();
+    }
+
+    /**
+     * 实例化 ZSetOperations 对象,可以使用 ZSet 操作
+     *
+     * @param redisTemplate
+     * @return
+     */
+    @Bean
+    public ZSetOperations<String, Object> zSetOperations(RedisTemplate<String, Object> redisTemplate) {
+        return redisTemplate.opsForZSet();
+    }
+
+    @Bean
+    public RedisCacheManager redisCacheManager(RedisConnectionFactory redisConnectionFactory) {
+        RedisCacheWriter redisCacheWriter = RedisCacheWriter.nonLockingRedisCacheWriter(redisConnectionFactory);
+        RedisCacheConfiguration redisCacheConfiguration = RedisCacheConfiguration.defaultCacheConfig()
+                .serializeValuesWith(RedisSerializationContext.SerializationPair.fromSerializer(valueSerializer()));
+        redisCacheConfiguration.serializeKeysWith(RedisSerializationContext.SerializationPair.fromSerializer(new StringRedisSerializer()));
+        return new RedisCacheManager(redisCacheWriter, redisCacheConfiguration);
+    }
+
+    /**
+     * 使用Jackson序列化器
+     * @return
+     */
+    private RedisSerializer<Object> valueSerializer() {
+        Jackson2JsonRedisSerializer<Object> serializer = new Jackson2JsonRedisSerializer<Object>(Object.class);
+        ObjectMapper objectMapper = new ObjectMapper();
+        objectMapper.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY);
+        /**
+         * 这一句必须要,作用是序列化时将对象全类名一起保存下来
+         * 设置之后的序列化结果如下:
+         *  [
+         *   "com.dxy.cache.pojo.Dept",
+         *   {
+         *     "pid": 1,
+         *     "code": "11",
+         *     "name": "财务部1"
+         *   }
+         * ]
+         *
+         * 不设置的话,序列化结果如下,将无法反序列化
+         *
+         *  {
+         *     "pid": 1,
+         *     "code": "11",
+         *     "name": "财务部1"
+         *   }
+         */
+//                objectMapper.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL);
+        //因为上面那句代码已经被标记成作废,因此用下面这个方法代替,仅仅测试了一下,不知道是否完全正确
+        objectMapper.activateDefaultTyping(LaissezFaireSubTypeValidator.instance,ObjectMapper.DefaultTyping.NON_FINAL);
+        serializer.setObjectMapper(objectMapper);
+
+        return serializer;
+    }
+}

+ 75 - 0
src/main/java/com/jpsoft/making_friends/config/SwaggerConfig.java

@@ -0,0 +1,75 @@
+package com.jpsoft.making_friends.config;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import springfox.documentation.builders.ApiInfoBuilder;
+import springfox.documentation.builders.PathSelectors;
+import springfox.documentation.builders.RequestHandlerSelectors;
+import springfox.documentation.service.ApiInfo;
+import springfox.documentation.service.ApiKey;
+import springfox.documentation.service.AuthorizationScope;
+import springfox.documentation.service.SecurityReference;
+import springfox.documentation.spi.DocumentationType;
+import springfox.documentation.spi.service.contexts.SecurityContext;
+import springfox.documentation.spring.web.plugins.Docket;
+import springfox.documentation.swagger2.annotations.EnableSwagger2;
+
+import java.util.ArrayList;
+import java.util.List;
+
+@Configuration
+@EnableSwagger2
+public class SwaggerConfig {
+    @Bean
+    public Docket createRestApi() {
+        return new Docket(DocumentationType.SWAGGER_2)
+                .apiInfo(apiInfo())
+                .select()
+                .apis(RequestHandlerSelectors.basePackage("com.jpsoft.making_friends"))
+                .paths(PathSelectors.any())
+                .build()
+                //添加登录认证
+                .securitySchemes(securitySchemes())
+                .securityContexts(securityContexts());
+    }
+
+    private List<ApiKey> securitySchemes() {
+        //设置请求头信息
+        List<ApiKey> result = new ArrayList<>();
+        ApiKey apiKey = new ApiKey("Authorization", "Authorization", "header");
+        result.add(apiKey);
+        return result;
+    }
+
+    private List<SecurityContext> securityContexts() {
+        //设置需要登录认证的路径
+        List<SecurityContext> result = new ArrayList<>();
+        result.add(getContextByPath("/*"));
+        return result;
+    }
+
+    private SecurityContext getContextByPath(String pathRegex){
+        return SecurityContext.builder()
+                .securityReferences(defaultAuth())
+                .forPaths(PathSelectors.regex(pathRegex))
+                .build();
+    }
+
+    private List<SecurityReference> defaultAuth() {
+        List<SecurityReference> result = new ArrayList<>();
+        AuthorizationScope authorizationScope = new AuthorizationScope("global", "accessEverything");
+        AuthorizationScope[] authorizationScopes = new AuthorizationScope[1];
+        authorizationScopes[0] = authorizationScope;
+        result.add(new SecurityReference("Authorization", authorizationScopes));
+        return result;
+    }
+
+    private ApiInfo apiInfo() {
+        return new ApiInfoBuilder()
+                .title("后台接口文档")
+                .description("")
+                .termsOfServiceUrl("")
+                .version("1.0")
+                .build();
+    }
+}

+ 131 - 0
src/main/java/com/jpsoft/making_friends/config/WebMvcConfig.java

@@ -0,0 +1,131 @@
+package com.jpsoft.making_friends.config;
+
+import com.jpsoft.making_friends.interceptor.LoginInterceptor;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.servlet.config.annotation.*;
+
+@Configuration
+public class WebMvcConfig implements WebMvcConfigurer {
+	@Autowired
+	private LoginInterceptor loginInterceptor;
+
+	@Override
+	public void addCorsMappings(CorsRegistry registry) {
+		registry.addMapping("/**")
+				.allowedOrigins("*")
+				.allowedHeaders("*")
+				.allowedMethods("*")
+				.allowCredentials(false)
+				.exposedHeaders("access-control-allow-headers",
+						"access-control-allow-methods",
+						"access-control-allow-origin",
+						"access-control-max-age",
+						"X-Frame-Options",
+						"token-status")
+				.maxAge(3600);
+	}
+
+	@Override
+	public void addResourceHandlers(ResourceHandlerRegistry registry) {
+		registry.addResourceHandler("/static/**").addResourceLocations("classpath:/static/");
+
+		registry.addResourceHandler("swagger-ui.html")
+				.addResourceLocations("classpath:/META-INF/resources/");
+
+		registry.addResourceHandler("/webjars/**")
+				.addResourceLocations("classpath:/META-INF/resources/webjars/");
+	}
+
+	@Override
+	public void addViewControllers(ViewControllerRegistry registry) {
+		// registry.addViewController("/login").setViewName("login");
+	}
+
+	@Override
+	public void addInterceptors(InterceptorRegistry registry) {
+		registry.addInterceptor(loginInterceptor)
+				.addPathPatterns("/**")
+                .excludePathPatterns("/login",
+						"/swagger-resources/**",
+                        "/webjars/**",
+                        "/swagger-ui.html",
+						"/doc.html",
+                        "/v2/**",
+                        "/mobileApi/**")
+				.excludePathPatterns("/wxPay/webPay")
+				.excludePathPatterns("/aliPay/tradePrecreatePay")
+				.excludePathPatterns("/wxPay/parkingWxPay")
+				.excludePathPatterns("/aliPay/parkingTradeWebPay")
+				.excludePathPatterns("/aliPay/payNotify")
+				.excludePathPatterns("/wxPay/payNotify")
+				.excludePathPatterns("/wxPay/wxJsapiPayNotify")
+				.excludePathPatterns("/aliPay/**")
+				.excludePathPatterns("/wxPay/parkingWxPayNotify")
+				.excludePathPatterns("/base/alarmInfo/alarmNotify")
+				.excludePathPatterns("/base/informationInfo/addMobile")
+				.excludePathPatterns("/base/employeeInfo/mobile/**")
+//				.excludePathPatterns("/base/companyInfo/list")
+				.excludePathPatterns("/wechat/**")
+				.excludePathPatterns("/wxCp/**")
+				.excludePathPatterns("/rabbit/**")
+				.excludePathPatterns("/mobile/personInfoApi/findByNameAndPhone")
+				.excludePathPatterns("/mobile/personInfoApi/getVerifyCode")
+				.excludePathPatterns("/mobile/personInfoApi/validateCode")
+				.excludePathPatterns("/mobile/personInfoApi/findByOpenId")
+				.excludePathPatterns("/mobile/personInfoApi/uploadBase64")
+				.excludePathPatterns("/mobile/personDeviceLogApi/detail")
+				.excludePathPatterns("/mobile/PersonDeviceFilterLog/queryUnmeasureGroupList")
+				.excludePathPatterns("/mobile/healthShowApi/getCompanyToken")
+				.excludePathPatterns("/healthPublicity")
+				.excludePathPatterns("/static/**")
+				.excludePathPatterns("/mobile/guestInfoRecordApi/detail/*")
+				.excludePathPatterns("/mobile/guestInfoRecordApi/update")
+				.excludePathPatterns("/mobile/guestInfoRecordApi/getInfo")
+                .excludePathPatterns("/mobile/guestInfoRecordApi/currentPageList")
+				.excludePathPatterns("/mobile/guestInfoRecordApi/save")
+				.excludePathPatterns("/mobile/companyInfoApi/schoolServeList")
+				.excludePathPatterns("/mobile/companyInfoApi/serviceCompanyIdList")
+				.excludePathPatterns("/devOps/login")
+				.excludePathPatterns("/mobile/scene/sceneList")
+				.excludePathPatterns("/mobile/scene/regionList")
+				.excludePathPatterns("/mobile/scene/companyListByRegion")
+				.excludePathPatterns("/mobile/scene/personRoleListByScene")
+				.excludePathPatterns("/mobile/scene/companyStructureList")
+				.excludePathPatterns("/mobile/scene/companyStructureByParentId")
+				.excludePathPatterns("/mobile/scene/companyBySceneAndName")
+				.excludePathPatterns("/mobile/scene/companyStructureByName")
+				.excludePathPatterns("/mobile/personInfoApi/register")
+                .excludePathPatterns("/mobile/personInfoApi/relationOlder")
+                .excludePathPatterns("/mobile/personInfoApi/olderDetail")
+				.excludePathPatterns("/ehome/**")
+				.excludePathPatterns("/mobile/personInfoApi/sendMessage")
+				.excludePathPatterns("/mobile/personInfoApi/regionList")
+				.excludePathPatterns("/mobile/personInfoApi/returnInfoDetail")
+				.excludePathPatterns("/mobile/personInfoApi/submitReturnInfo")
+				.excludePathPatterns("/mobile/personInfoApi/confirmReturnInfo")
+				.excludePathPatterns("/qrcode/**")
+				.excludePathPatterns("/mobile/companyInfoApi/link")
+				.excludePathPatterns("/sys/dataDictionary/edit/**")
+				.excludePathPatterns("/mobile/parkingInfoApi/inParkDate")
+				.excludePathPatterns("/mobile/parkingInfoApi/outParkDate")
+				.excludePathPatterns("/mobile/parkingInfoApi/findByOpenIdAndMerchant")
+				.excludePathPatterns("/mobile/parkingInfoApi/carPayDetail")
+				.excludePathPatterns("/mobile/parkingInfoApi/userGetCarDetail")
+				.excludePathPatterns("/mobile/parkingInfoApi/userGetCarMember")
+				.excludePathPatterns("/mobile/parkingInfoApi/validQrCode")
+				.excludePathPatterns("/mobile/parkingInfoApi/channelPayDetail")
+				.excludePathPatterns("/mobile/parkingInfoApi/findByCompanyId")
+				.excludePathPatterns("/mobile/parkingInfoApi/bindParkMerchant")
+				.excludePathPatterns("/sdcapi/*")
+				.excludePathPatterns("/mobile/callApi/*")
+				.excludePathPatterns("/mobile/workAttendance/queryMonthWorkStatus")
+				.excludePathPatterns("/mobile/workAttendance/queryMonthWorkDays")
+				.excludePathPatterns("/mobile/workAttendance/queryMonthErrorTimes")
+				.excludePathPatterns("/mobile/workAttendance/queryPersonMonthRestDays")
+				.excludePathPatterns("/mobile/workAttendance/queryPersonMonthWorkStatus")
+				.excludePathPatterns("/mobile/workAttendance/queryPersonMonthLateLackDays")
+				.excludePathPatterns("/mobile/workAttendance/queryMonthHalfWorkDays")
+		;
+	}
+}

+ 18 - 0
src/main/java/com/jpsoft/making_friends/dao/base/HobbyInfoDAO.java

@@ -0,0 +1,18 @@
+package com.jpsoft.making_friends.dao.base;
+
+import java.util.List;
+import org.springframework.stereotype.Repository;
+import com.jpsoft.making_friends.entity.base.HobbyInfo;
+import java.util.Map;
+import com.jpsoft.making_friends.dto.Sort;
+
+@Repository
+public interface HobbyInfoDAO {
+	int insert(HobbyInfo entity);
+	int update(HobbyInfo entity);
+	int exist(String id);
+	HobbyInfo get(String id);
+	int delete(String id);
+	List<HobbyInfo> list();
+	List<HobbyInfo> search(Map<String, Object> searchParams, List<Sort> sortList);
+}

+ 18 - 0
src/main/java/com/jpsoft/making_friends/dao/base/MemberHobbyDAO.java

@@ -0,0 +1,18 @@
+package com.jpsoft.making_friends.dao.base;
+
+import java.util.List;
+import org.springframework.stereotype.Repository;
+import com.jpsoft.making_friends.entity.base.MemberHobby;
+import java.util.Map;
+import com.jpsoft.making_friends.dto.Sort;
+
+@Repository
+public interface MemberHobbyDAO {
+	int insert(MemberHobby entity);
+	int update(MemberHobby entity);
+	int exist(String id);
+	MemberHobby get(String id);
+	int delete(String id);
+	List<MemberHobby> list();
+	List<MemberHobby> search(Map<String, Object> searchParams, List<Sort> sortList);
+}

+ 18 - 0
src/main/java/com/jpsoft/making_friends/dao/base/MemberInfoDAO.java

@@ -0,0 +1,18 @@
+package com.jpsoft.making_friends.dao.base;
+
+import java.util.List;
+import org.springframework.stereotype.Repository;
+import com.jpsoft.making_friends.entity.base.MemberInfo;
+import java.util.Map;
+import com.jpsoft.making_friends.dto.Sort;
+
+@Repository
+public interface MemberInfoDAO {
+	int insert(MemberInfo entity);
+	int update(MemberInfo entity);
+	int exist(String id);
+	MemberInfo get(String id);
+	int delete(String id);
+	List<MemberInfo> list();
+	List<MemberInfo> search(Map<String, Object> searchParams, List<Sort> sortList);
+}

+ 18 - 0
src/main/java/com/jpsoft/making_friends/dao/base/NewsInfoDAO.java

@@ -0,0 +1,18 @@
+package com.jpsoft.making_friends.dao.base;
+
+import java.util.List;
+import org.springframework.stereotype.Repository;
+import com.jpsoft.making_friends.entity.base.NewsInfo;
+import java.util.Map;
+import com.jpsoft.making_friends.dto.Sort;
+
+@Repository
+public interface NewsInfoDAO {
+	int insert(NewsInfo entity);
+	int update(NewsInfo entity);
+	int exist(String id);
+	NewsInfo get(String id);
+	int delete(String id);
+	List<NewsInfo> list();
+	List<NewsInfo> search(Map<String, Object> searchParams, List<Sort> sortList);
+}

+ 18 - 0
src/main/java/com/jpsoft/making_friends/dao/base/NewsTypeDAO.java

@@ -0,0 +1,18 @@
+package com.jpsoft.making_friends.dao.base;
+
+import java.util.List;
+import org.springframework.stereotype.Repository;
+import com.jpsoft.making_friends.entity.base.NewsType;
+import java.util.Map;
+import com.jpsoft.making_friends.dto.Sort;
+
+@Repository
+public interface NewsTypeDAO {
+	int insert(NewsType entity);
+	int update(NewsType entity);
+	int exist(String id);
+	NewsType get(String id);
+	int delete(String id);
+	List<NewsType> list();
+	List<NewsType> search(Map<String, Object> searchParams, List<Sort> sortList);
+}

+ 18 - 0
src/main/java/com/jpsoft/making_friends/dao/base/OrgInfoDAO.java

@@ -0,0 +1,18 @@
+package com.jpsoft.making_friends.dao.base;
+
+import java.util.List;
+import org.springframework.stereotype.Repository;
+import com.jpsoft.making_friends.entity.base.OrgInfo;
+import java.util.Map;
+import com.jpsoft.making_friends.dto.Sort;
+
+@Repository
+public interface OrgInfoDAO {
+	int insert(OrgInfo entity);
+	int update(OrgInfo entity);
+	int exist(String id);
+	OrgInfo get(String id);
+	int delete(String id);
+	List<OrgInfo> list();
+	List<OrgInfo> search(Map<String, Object> searchParams, List<Sort> sortList);
+}

+ 30 - 0
src/main/java/com/jpsoft/making_friends/dao/sys/DataDictionaryDAO.java

@@ -0,0 +1,30 @@
+package com.jpsoft.making_friends.dao.sys;
+
+import com.jpsoft.making_friends.dto.Sort;
+import com.jpsoft.making_friends.entity.sys.DataDictionary;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+import java.util.Map;
+
+
+@Repository
+public interface DataDictionaryDAO {
+	int insert(DataDictionary entity);
+	int update(DataDictionary entity);
+	int exist(String id);
+	DataDictionary get(String id);
+	int delete(String id);
+	String getName(String id);
+	String getValue(String id);
+	List<DataDictionary> list();
+	String findParentId(String parentId, String value);
+	List<Map<String, Object>> queryChildren(String parentId);
+	List<DataDictionary> search(Map<String, Object> searchParams, List<Sort> sortList);
+
+	List<DataDictionary> findByCatalogName(String catalogName);
+
+	String findNameByCatalogNameAndValue(String catalogName, String value);
+
+    DataDictionary findByName(String name);
+}

+ 21 - 0
src/main/java/com/jpsoft/making_friends/dao/sys/MenuDAO.java

@@ -0,0 +1,21 @@
+package com.jpsoft.making_friends.dao.sys;
+
+import com.jpsoft.making_friends.dto.Sort;
+import com.jpsoft.making_friends.entity.sys.Menu;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+import java.util.Map;
+
+@Repository
+public interface MenuDAO {
+	int insert(Menu entity);
+	int update(Menu entity);
+	int exist(String id);
+	Menu get(String id);
+	int delete(String id);
+	List<Menu> list();
+	List<Menu> search(Map<String, Object> searchParams, List<Sort> sortList);
+    List<Menu> findAllocMenu(@Param("userId") String userId, @Param("parentId") String parentId);
+}

+ 21 - 0
src/main/java/com/jpsoft/making_friends/dao/sys/PermissionDAO.java

@@ -0,0 +1,21 @@
+package com.jpsoft.making_friends.dao.sys;
+
+import com.jpsoft.making_friends.dto.Sort;
+import com.jpsoft.making_friends.entity.sys.Permission;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+import java.util.Map;
+
+@Repository
+public interface PermissionDAO {
+	int insert(Permission entity);
+	int update(Permission entity);
+	int exist(@Param("path") String path, @Param("method") String method);
+	Permission get(String id);
+	int delete(String id);
+	List<Permission> list();
+	List<Permission> search(Map<String, Object> searchParams, List<Sort> sortList);
+    int hasPermitted(@Param("userId") String userId, @Param("path") String path, @Param("method") String method);
+}

+ 21 - 0
src/main/java/com/jpsoft/making_friends/dao/sys/RoleDAO.java

@@ -0,0 +1,21 @@
+package com.jpsoft.making_friends.dao.sys;
+
+import com.jpsoft.making_friends.dto.Sort;
+import com.jpsoft.making_friends.entity.sys.Role;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+import java.util.Map;
+
+@Repository
+public interface RoleDAO {
+	int insert(Role entity);
+	int update(Role entity);
+	int exist(String id);
+	Role get(String id);
+	int delete(String id);
+	List<Role> list();
+	List<Role> search(Map<String, Object> searchParams, List<Sort> sortList);
+
+    Role findByName(String name);
+}

+ 23 - 0
src/main/java/com/jpsoft/making_friends/dao/sys/RoleMenuDAO.java

@@ -0,0 +1,23 @@
+package com.jpsoft.making_friends.dao.sys;
+
+import com.jpsoft.making_friends.dto.Sort;
+import com.jpsoft.making_friends.entity.sys.RoleMenu;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+import java.util.Map;
+
+@Repository
+public interface RoleMenuDAO {
+	int insert(RoleMenu entity);
+	int update(RoleMenu entity);
+	int exist(String id);
+	RoleMenu get(String id);
+	int delete(String id);
+	List<RoleMenu> list();
+	List<RoleMenu> search(Map<String, Object> searchParams, List<Sort> sortList);
+
+	List<RoleMenu> findByRoleId(String roleId);
+
+	int deleteByRoleId(String roleId);
+}

+ 21 - 0
src/main/java/com/jpsoft/making_friends/dao/sys/RolePermissionDAO.java

@@ -0,0 +1,21 @@
+package com.jpsoft.making_friends.dao.sys;
+
+import com.jpsoft.making_friends.dto.Sort;
+import com.jpsoft.making_friends.entity.sys.RolePermission;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+import java.util.Map;
+
+@Repository
+public interface RolePermissionDAO {
+	int insert(RolePermission entity);
+	int update(RolePermission entity);
+	int exist(String id);
+	RolePermission get(String id);
+	int delete(String id);
+	List<RolePermission> list();
+	List<RolePermission> search(Map<String, Object> searchParams, List<Sort> sortList);
+    List<RolePermission> findByRoleId(String roleId);
+	int deleteByRoleId(String roleId);
+}

+ 19 - 0
src/main/java/com/jpsoft/making_friends/dao/sys/SysLogDAO.java

@@ -0,0 +1,19 @@
+package com.jpsoft.making_friends.dao.sys;
+
+import com.jpsoft.making_friends.dto.Sort;
+import com.jpsoft.making_friends.entity.sys.SysLog;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+import java.util.Map;
+
+@Repository
+public interface SysLogDAO {
+	int insert(SysLog entity);
+	int update(SysLog entity);
+	int exist(Long id);
+	SysLog get(Long id);
+	int delete(Long id);
+	List<SysLog> list();
+	List<SysLog> search(Map<String, Object> searchParams, List<Sort> sortList);
+}

+ 26 - 0
src/main/java/com/jpsoft/making_friends/dao/sys/UserDAO.java

@@ -0,0 +1,26 @@
+package com.jpsoft.making_friends.dao.sys;
+
+import com.jpsoft.making_friends.entity.sys.User;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+import com.jpsoft.making_friends.dto.Sort;
+
+import java.util.List;
+import java.util.Map;
+
+@Repository
+public interface UserDAO {
+
+    int insert(User entity);
+    int update(User entity);
+    int exist(String id);
+    User get(String id);
+    int delete(String id);
+    List<User> list();
+    List<User> findByCompanyId(String companyId);
+    List<User> findByCompanyList(@Param("searchParams")Map<String,Object> searchParams, @Param("sortList")List<Sort> sortList);
+    List<User> search(Map<String,Object> searchParams,List<Sort> sortList);
+    User findByUserName(@Param("userName") String userName);
+    long hasRole(@Param("userId") String userId,@Param("roleName") String roleName);
+    User findByOpenId(String openId);
+}

+ 22 - 0
src/main/java/com/jpsoft/making_friends/dao/sys/UserRoleDAO.java

@@ -0,0 +1,22 @@
+package com.jpsoft.making_friends.dao.sys;
+
+import com.jpsoft.making_friends.entity.sys.Role;
+import com.jpsoft.making_friends.entity.sys.UserRole;
+import org.springframework.stereotype.Repository;
+import com.jpsoft.making_friends.dto.Sort;
+
+import java.util.List;
+import java.util.Map;
+
+@Repository
+public interface UserRoleDAO {
+	int insert(UserRole entity);
+	int update(UserRole entity);
+	int exist(String id);
+	UserRole get(String id);
+	int delete(String id);
+	List<UserRole> list();
+	List<UserRole> search(Map<String, Object> searchParams, List<Sort> sortList);
+    List<Role> findRoleByUserId(String userId);
+	int deleteByUserId(String userId);
+}

+ 51 - 0
src/main/java/com/jpsoft/making_friends/dto/MessageResult.java

@@ -0,0 +1,51 @@
+package com.jpsoft.making_friends.dto;
+
+public class MessageResult<T> {
+
+    private boolean result = true;
+    private String message;
+    private T data;
+    private int code = 200;
+
+    public MessageResult() {
+    }
+
+    public MessageResult(boolean result, String message, T data, int code) {
+        this.result = result;
+        this.message = message;
+        this.data = data;
+        this.code = code;
+    }
+
+    public boolean isResult() {
+        return result;
+    }
+
+    public void setResult(boolean result) {
+        this.result = result;
+    }
+
+    public String getMessage() {
+        return message;
+    }
+
+    public void setMessage(String message) {
+        this.message = message;
+    }
+
+    public T getData() {
+        return data;
+    }
+
+    public void setData(T data) {
+        this.data = data;
+    }
+
+    public int getCode() {
+        return code;
+    }
+
+    public void setCode(int code) {
+        this.code = code;
+    }
+}

+ 24 - 0
src/main/java/com/jpsoft/making_friends/dto/RoleRelatedDTO.java

@@ -0,0 +1,24 @@
+package com.jpsoft.making_friends.dto;
+
+import java.util.List;
+
+public class RoleRelatedDTO {
+    private String roleId;
+    private List<String> relatedList;
+
+    public String getRoleId() {
+        return roleId;
+    }
+
+    public void setRoleId(String roleId) {
+        this.roleId = roleId;
+    }
+
+    public List<String> getRelatedList() {
+        return relatedList;
+    }
+
+    public void setRelatedList(List<String> relatedList) {
+        this.relatedList = relatedList;
+    }
+}

+ 32 - 0
src/main/java/com/jpsoft/making_friends/dto/Sort.java

@@ -0,0 +1,32 @@
+package com.jpsoft.making_friends.dto;
+
+import java.io.Serializable;
+
+public class Sort implements Serializable {
+    private String name;
+    private String order;
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getOrder() {
+        return order;
+    }
+
+    public void setOrder(String order) {
+        this.order = order;
+    }
+
+    public Sort() {
+    }
+
+    public Sort(String name, String order) {
+        this.name = name;
+        this.order = order;
+    }
+}

+ 21 - 0
src/main/java/com/jpsoft/making_friends/dto/service/BaseService.java

@@ -0,0 +1,21 @@
+package com.jpsoft.making_friends.dto.service;
+
+import com.github.pagehelper.Page;
+import com.jpsoft.making_friends.dto.Sort;
+
+import java.util.List;
+import java.util.Map;
+
+public interface BaseService<T> {
+    List<T> selectAll();
+
+    Page<T> pageList(int pageIndex, int pageSize, Map<String, Object> searchParams, List<Sort> orderList);
+
+    T get(String id);
+
+    int insert(T record);
+
+    int update(T record);
+
+    int delete(String id);
+}

+ 105 - 0
src/main/java/com/jpsoft/making_friends/dto/service/IRedisService.java

@@ -0,0 +1,105 @@
+package com.jpsoft.making_friends.dto.service;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.redis.core.HashOperations;
+import org.springframework.data.redis.core.RedisTemplate;
+
+import javax.annotation.Resource;
+import java.util.List;
+import java.util.Set;
+import java.util.concurrent.TimeUnit;
+
+public abstract class IRedisService<T> {
+    @Autowired
+    protected RedisTemplate<String, Object> redisTemplate;
+    @Resource
+    protected HashOperations<String, String, T> hashOperations;
+
+    /**
+     * 存入redis中的key
+     *
+     * @return
+     */
+    protected abstract String getRedisKey(String jpKey);
+
+    /**
+     * 添加
+     *
+     * @param key    key
+     * @param doamin 对象
+     * @param expire 过期时间(单位:秒),传入 -1 时表示不设置过期时间
+     */
+    public void put(String jpKey, String key, T doamin, long expire) {
+        hashOperations.put(getRedisKey(jpKey), key, doamin);
+        if (expire != -1) {
+            redisTemplate.expire(getRedisKey(jpKey), expire, TimeUnit.SECONDS);
+        }
+    }
+
+    /**
+     * 删除
+     *
+     * @param key 传入key的名称
+     */
+    public void remove(String key) {
+        hashOperations.delete(getRedisKey(""), key);
+    }
+
+    /**
+     * 查询
+     *
+     * @param key 查询的key
+     * @return
+     */
+    public T get(String jpKey ,String key) {
+        return hashOperations.get(getRedisKey(jpKey), key);
+    }
+
+    /**
+     * 获取当前redis库下所有对象
+     *
+     * @return
+     */
+    public List<T> getAll(String jpkey) {
+        return hashOperations.values(getRedisKey(jpkey));
+    }
+
+    /**
+     * 查询查询当前redis库下所有key
+     *
+     * @return
+     */
+    public Set<String> getKeys() {
+        return hashOperations.keys(getRedisKey(""));
+    }
+
+    /**
+     * 判断key是否存在redis中
+     *
+     * @param key 传入key的名称
+     * @return
+     */
+    public boolean isKeyExists(String key) {
+        return hashOperations.hasKey(getRedisKey(""), key);
+    }
+
+    /**
+     * 查询当前key下缓存数量
+     *
+     * @return
+     */
+    public long count() {
+        return hashOperations.size(getRedisKey(""));
+    }
+
+    /**
+     * 清空redis
+     */
+    public void empty() {
+        Set<String> set = hashOperations.keys(getRedisKey(""));
+
+        for (String key : set) {
+        	hashOperations.delete(getRedisKey(""), key);
+        }
+    }
+}

+ 37 - 0
src/main/java/com/jpsoft/making_friends/dto/service/imp/RedisServiceImpl.java

@@ -0,0 +1,37 @@
+package com.jpsoft.making_friends.dto.service.imp;
+
+import com.jpsoft.making_friends.dto.service.IRedisService;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.stereotype.Service;
+
+@Service(value="redisService")
+public class RedisServiceImpl extends IRedisService<Object> {
+    private static final String REDIS_KEY = "JP_HOUSEPROPERTY_REDIS_KEY";
+    private static final String REDIS_KEY1 = "VERIFYCODE_REDIS_KEY";
+    private static final String REDIS_KEY2 = "APITOKEN_REDIS_KEY";
+    private static final String REDIS_KEY3 = "ACCESSTOKEN_REDIS_KEY";
+    private static final String REDIS_KEY4 = "PERSONINFO_REDIS_KEY";
+
+
+    @SuppressWarnings("static-access")
+	@Override
+    protected String getRedisKey(String jpKey) {
+        if (jpKey.equals("code")){
+            return REDIS_KEY1;
+        }
+        if (jpKey.equals("apiToken")){
+            return REDIS_KEY2;
+        }
+        if (jpKey.equals("accessToken")){
+            return REDIS_KEY3;
+        }
+        if (jpKey.equals("personInfo")){
+            return REDIS_KEY4;
+        }
+        if (StringUtils.isBlank(jpKey)){
+            return REDIS_KEY;
+        }
+        return REDIS_KEY;
+
+    }
+}

+ 136 - 0
src/main/java/com/jpsoft/making_friends/dto/utils/AESUtil.java

@@ -0,0 +1,136 @@
+package com.jpsoft.making_friends.dto.utils;
+
+import com.jpsoft.making_friends.dto.utils.Base64;
+import org.bouncycastle.jce.provider.BouncyCastleProvider;
+
+import javax.crypto.Cipher;
+import javax.crypto.spec.IvParameterSpec;
+import javax.crypto.spec.SecretKeySpec;
+import java.io.UnsupportedEncodingException;
+import java.security.Security;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+public class AESUtil{
+    private static final String KEY_ALGORITHM = "AES";
+    private static final String DEFAULT_CIPHER_ALGORITHM = "AES/CBC/PKCS7Padding";//默认的加密算法
+    /**
+     * mysql默认取秘钥的ascii编码前16位
+     */
+    public static String MYSQL_ENC_KEY = "jpsoft8121234888";
+
+
+    static {
+        Security.addProvider(new BouncyCastleProvider());
+    }
+
+    /**
+     * AES 加密操作,注意要先替换jre/lib/security/local_policy.jar和US_export_policy.jar,否则会报keysize不对
+     * @param content 待加密内容
+     * @param key 加密密钥
+     * @return 返回Base64转码后的加密数据
+     */
+    public static String encrypt(String content, String key) {
+        try {
+            Cipher cipher = Cipher.getInstance(DEFAULT_CIPHER_ALGORITHM);// 创建密码器
+
+            byte[] byteContent = content.getBytes("utf-8");
+            IvParameterSpec ivParameterSpec = createIV(key);
+
+            cipher.init(Cipher.ENCRYPT_MODE, getSecretKey(key),ivParameterSpec);// 初始化为加密模式的密码器
+
+            byte[] result = cipher.doFinal(byteContent);// 加密
+
+            System.out.println(cipher.getBlockSize());
+
+            return Base64.encode(result);//通过Base64转码返回
+
+        } catch (Exception ex) {
+            Logger.getLogger(com.jpsoft.making_friends.dto.utils.AESUtil.class.getName()).log(Level.SEVERE, null, ex);
+        }
+
+        return null;
+    }
+
+    /**
+     * AES 解密操作
+     *
+     * @param content
+     * @param key
+     * @return
+     */
+    public static String decrypt(String content, String key) {
+
+        try {
+            //实例化
+            Cipher cipher = Cipher.getInstance(DEFAULT_CIPHER_ALGORITHM);
+            IvParameterSpec ivParameterSpec = createIV(key);
+
+            //使用密钥初始化,设置为解密模式
+            cipher.init(Cipher.DECRYPT_MODE, getSecretKey(key),ivParameterSpec);
+
+            //执行操作
+            byte[] result = cipher.doFinal(Base64.decode(content));
+
+            return new String(result, "utf-8");
+        } catch (Exception ex) {
+            Logger.getLogger(com.jpsoft.making_friends.dto.utils.AESUtil.class.getName()).log(Level.SEVERE, null, ex);
+        }
+
+        return null;
+    }
+
+    // 创建初始化向量, 长度为16bytes, 向量的作用其实就是salt
+    private static IvParameterSpec createIV(String key) throws UnsupportedEncodingException {
+        byte[] src = key.getBytes("UTF-8");
+
+        if (src.length < 16) {
+            throw new RuntimeException("无法从Key中获取偏移量!");
+        }
+
+        byte[] bs = new byte[16];
+        for (int i=0; i<16; i++){
+            bs[i] = src[i];
+        }
+
+        return new IvParameterSpec(bs);
+    }
+
+    /**
+     * 生成加密秘钥
+     *
+     * @return
+     */
+    private static SecretKeySpec getSecretKey(final String key) throws UnsupportedEncodingException {
+        //返回生成指定算法密钥生成器的 KeyGenerator 对象
+//        KeyGenerator kg = null;
+//
+//        try {
+//            kg = KeyGenerator.getInstance(KEY_ALGORITHM);
+//
+//            //AES 要求密钥长度为 256
+//            kg.init(256, new SecureRandom(key.getBytes("UTF-8")));
+//
+//            //生成一个密钥
+//            SecretKey secretKey = kg.generateKey();
+//
+//            return new SecretKeySpec(secretKey.getEncoded(), KEY_ALGORITHM);// 转换为AES专用密钥
+//        } catch (Exception ex) {
+//            Logger.getLogger(AESUtil.class.getName()).log(Level.SEVERE, null, ex);
+//        }
+
+        SecretKeySpec keySpec = new SecretKeySpec(key.getBytes("UTF-8"), KEY_ALGORITHM);
+
+        return keySpec;
+    }
+
+    public static void main(String[] args) {
+        String content = "421002198311131816";
+        String key = "534a33e888b001a246b635b76e42d0dd";
+
+        //g5mIt+8LgfpLWpPOXg1vyl7j1jv+wN3vwIb6wdpir5M=
+        String enc = encrypt(content,key);
+
+        System.out.println(enc);
+    }
+}

+ 273 - 0
src/main/java/com/jpsoft/making_friends/dto/utils/Base64.java

@@ -0,0 +1,273 @@
+package com.jpsoft.making_friends.dto.utils;
+
+public final class Base64 {
+
+    static private final int     BASELENGTH           = 128;
+    static private final int     LOOKUPLENGTH         = 64;
+    static private final int     TWENTYFOURBITGROUP   = 24;
+    static private final int     EIGHTBIT             = 8;
+    static private final int     SIXTEENBIT           = 16;
+    static private final int     FOURBYTE             = 4;
+    static private final int     SIGN                 = -128;
+    static private final char    PAD                  = '=';
+    static private final boolean fDebug               = false;
+    static final private byte[]  base64Alphabet       = new byte[BASELENGTH];
+    static final private char[]  lookUpBase64Alphabet = new char[LOOKUPLENGTH];
+
+    static {
+        for (int i = 0; i < BASELENGTH; ++i) {
+            base64Alphabet[i] = -1;
+        }
+        for (int i = 'Z'; i >= 'A'; i--) {
+            base64Alphabet[i] = (byte) (i - 'A');
+        }
+        for (int i = 'z'; i >= 'a'; i--) {
+            base64Alphabet[i] = (byte) (i - 'a' + 26);
+        }
+
+        for (int i = '9'; i >= '0'; i--) {
+            base64Alphabet[i] = (byte) (i - '0' + 52);
+        }
+
+        base64Alphabet['+'] = 62;
+        base64Alphabet['/'] = 63;
+
+        for (int i = 0; i <= 25; i++) {
+            lookUpBase64Alphabet[i] = (char) ('A' + i);
+        }
+
+        for (int i = 26, j = 0; i <= 51; i++, j++) {
+            lookUpBase64Alphabet[i] = (char) ('a' + j);
+        }
+
+        for (int i = 52, j = 0; i <= 61; i++, j++) {
+            lookUpBase64Alphabet[i] = (char) ('0' + j);
+        }
+        lookUpBase64Alphabet[62] = (char) '+';
+        lookUpBase64Alphabet[63] = (char) '/';
+
+    }
+
+    private static boolean isWhiteSpace(char octect) {
+        return (octect == 0x20 || octect == 0xd || octect == 0xa || octect == 0x9);
+    }
+
+    private static boolean isPad(char octect) {
+        return (octect == PAD);
+    }
+
+    private static boolean isData(char octect) {
+        return (octect < BASELENGTH && base64Alphabet[octect] != -1);
+    }
+
+    /**
+     * Encodes hex octects into Base64
+     *
+     * @param binaryData Array containing binaryData
+     * @return Encoded Base64 array
+     */
+    public static String encode(byte[] binaryData) {
+
+        if (binaryData == null) {
+            return null;
+        }
+
+        int lengthDataBits = binaryData.length * EIGHTBIT;
+        if (lengthDataBits == 0) {
+            return "";
+        }
+
+        int fewerThan24bits = lengthDataBits % TWENTYFOURBITGROUP;
+        int numberTriplets = lengthDataBits / TWENTYFOURBITGROUP;
+        int numberQuartet = fewerThan24bits != 0 ? numberTriplets + 1 : numberTriplets;
+        char encodedData[] = null;
+
+        encodedData = new char[numberQuartet * 4];
+
+        byte k = 0, l = 0, b1 = 0, b2 = 0, b3 = 0;
+
+        int encodedIndex = 0;
+        int dataIndex = 0;
+        if (fDebug) {
+            System.out.println("number of triplets = " + numberTriplets);
+        }
+
+        for (int i = 0; i < numberTriplets; i++) {
+            b1 = binaryData[dataIndex++];
+            b2 = binaryData[dataIndex++];
+            b3 = binaryData[dataIndex++];
+
+            if (fDebug) {
+                System.out.println("b1= " + b1 + ", b2= " + b2 + ", b3= " + b3);
+            }
+
+            l = (byte) (b2 & 0x0f);
+            k = (byte) (b1 & 0x03);
+
+            byte val1 = ((b1 & SIGN) == 0) ? (byte) (b1 >> 2) : (byte) ((b1) >> 2 ^ 0xc0);
+            byte val2 = ((b2 & SIGN) == 0) ? (byte) (b2 >> 4) : (byte) ((b2) >> 4 ^ 0xf0);
+            byte val3 = ((b3 & SIGN) == 0) ? (byte) (b3 >> 6) : (byte) ((b3) >> 6 ^ 0xfc);
+
+            if (fDebug) {
+                System.out.println("val2 = " + val2);
+                System.out.println("k4   = " + (k << 4));
+                System.out.println("vak  = " + (val2 | (k << 4)));
+            }
+
+            encodedData[encodedIndex++] = lookUpBase64Alphabet[val1];
+            encodedData[encodedIndex++] = lookUpBase64Alphabet[val2 | (k << 4)];
+            encodedData[encodedIndex++] = lookUpBase64Alphabet[(l << 2) | val3];
+            encodedData[encodedIndex++] = lookUpBase64Alphabet[b3 & 0x3f];
+        }
+
+        // form integral number of 6-bit groups
+        if (fewerThan24bits == EIGHTBIT) {
+            b1 = binaryData[dataIndex];
+            k = (byte) (b1 & 0x03);
+            if (fDebug) {
+                System.out.println("b1=" + b1);
+                System.out.println("b1<<2 = " + (b1 >> 2));
+            }
+            byte val1 = ((b1 & SIGN) == 0) ? (byte) (b1 >> 2) : (byte) ((b1) >> 2 ^ 0xc0);
+            encodedData[encodedIndex++] = lookUpBase64Alphabet[val1];
+            encodedData[encodedIndex++] = lookUpBase64Alphabet[k << 4];
+            encodedData[encodedIndex++] = PAD;
+            encodedData[encodedIndex++] = PAD;
+        } else if (fewerThan24bits == SIXTEENBIT) {
+            b1 = binaryData[dataIndex];
+            b2 = binaryData[dataIndex + 1];
+            l = (byte) (b2 & 0x0f);
+            k = (byte) (b1 & 0x03);
+
+            byte val1 = ((b1 & SIGN) == 0) ? (byte) (b1 >> 2) : (byte) ((b1) >> 2 ^ 0xc0);
+            byte val2 = ((b2 & SIGN) == 0) ? (byte) (b2 >> 4) : (byte) ((b2) >> 4 ^ 0xf0);
+
+            encodedData[encodedIndex++] = lookUpBase64Alphabet[val1];
+            encodedData[encodedIndex++] = lookUpBase64Alphabet[val2 | (k << 4)];
+            encodedData[encodedIndex++] = lookUpBase64Alphabet[l << 2];
+            encodedData[encodedIndex++] = PAD;
+        }
+
+        return new String(encodedData);
+    }
+
+    /**
+     * Decodes Base64 data into octects
+     *
+     * @param encoded string containing Base64 data
+     * @return Array containind decoded data.
+     */
+    public static byte[] decode(String encoded) {
+
+        if (encoded == null) {
+            return null;
+        }
+
+        char[] base64Data = encoded.toCharArray();
+        // remove white spaces
+        int len = removeWhiteSpace(base64Data);
+
+        if (len % FOURBYTE != 0) {
+            return null;//should be divisible by four
+        }
+
+        int numberQuadruple = (len / FOURBYTE);
+
+        if (numberQuadruple == 0) {
+            return new byte[0];
+        }
+
+        byte decodedData[] = null;
+        byte b1 = 0, b2 = 0, b3 = 0, b4 = 0;
+        char d1 = 0, d2 = 0, d3 = 0, d4 = 0;
+
+        int i = 0;
+        int encodedIndex = 0;
+        int dataIndex = 0;
+        decodedData = new byte[(numberQuadruple) * 3];
+
+        for (; i < numberQuadruple - 1; i++) {
+
+            if (!isData((d1 = base64Data[dataIndex++])) || !isData((d2 = base64Data[dataIndex++]))
+                    || !isData((d3 = base64Data[dataIndex++]))
+                    || !isData((d4 = base64Data[dataIndex++]))) {
+                return null;
+            }//if found "no data" just return null
+
+            b1 = base64Alphabet[d1];
+            b2 = base64Alphabet[d2];
+            b3 = base64Alphabet[d3];
+            b4 = base64Alphabet[d4];
+
+            decodedData[encodedIndex++] = (byte) (b1 << 2 | b2 >> 4);
+            decodedData[encodedIndex++] = (byte) (((b2 & 0xf) << 4) | ((b3 >> 2) & 0xf));
+            decodedData[encodedIndex++] = (byte) (b3 << 6 | b4);
+        }
+
+        if (!isData((d1 = base64Data[dataIndex++])) || !isData((d2 = base64Data[dataIndex++]))) {
+            return null;//if found "no data" just return null
+        }
+
+        b1 = base64Alphabet[d1];
+        b2 = base64Alphabet[d2];
+
+        d3 = base64Data[dataIndex++];
+        d4 = base64Data[dataIndex++];
+        if (!isData((d3)) || !isData((d4))) {//Check if they are PAD characters
+            if (isPad(d3) && isPad(d4)) {
+                if ((b2 & 0xf) != 0)//last 4 bits should be zero
+                {
+                    return null;
+                }
+                byte[] tmp = new byte[i * 3 + 1];
+                System.arraycopy(decodedData, 0, tmp, 0, i * 3);
+                tmp[encodedIndex] = (byte) (b1 << 2 | b2 >> 4);
+                return tmp;
+            } else if (!isPad(d3) && isPad(d4)) {
+                b3 = base64Alphabet[d3];
+                if ((b3 & 0x3) != 0)//last 2 bits should be zero
+                {
+                    return null;
+                }
+                byte[] tmp = new byte[i * 3 + 2];
+                System.arraycopy(decodedData, 0, tmp, 0, i * 3);
+                tmp[encodedIndex++] = (byte) (b1 << 2 | b2 >> 4);
+                tmp[encodedIndex] = (byte) (((b2 & 0xf) << 4) | ((b3 >> 2) & 0xf));
+                return tmp;
+            } else {
+                return null;
+            }
+        } else { //No PAD e.g 3cQl
+            b3 = base64Alphabet[d3];
+            b4 = base64Alphabet[d4];
+            decodedData[encodedIndex++] = (byte) (b1 << 2 | b2 >> 4);
+            decodedData[encodedIndex++] = (byte) (((b2 & 0xf) << 4) | ((b3 >> 2) & 0xf));
+            decodedData[encodedIndex++] = (byte) (b3 << 6 | b4);
+
+        }
+
+        return decodedData;
+    }
+
+    /**
+     * remove WhiteSpace from MIME containing encoded Base64 data.
+     *
+     * @param data  the byte array of base64 data (with WS)
+     * @return      the new length
+     */
+    private static int removeWhiteSpace(char[] data) {
+        if (data == null) {
+            return 0;
+        }
+
+        // count characters that's not whitespace
+        int newSize = 0;
+        int len = data.length;
+        for (int i = 0; i < len; i++) {
+            if (!isWhiteSpace(data[i])) {
+                data[newSize++] = data[i];
+            }
+        }
+        return newSize;
+    }
+}

+ 198 - 0
src/main/java/com/jpsoft/making_friends/dto/utils/CheckIdCard.java

@@ -0,0 +1,198 @@
+package com.jpsoft.making_friends.dto.utils;
+
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.GregorianCalendar;
+
+/**
+ * 验证身份证号码 身份证号码, 可以解析身份证号码的各个字段,以及验证身份证号码是否有效; 身份证号码构成:6位地址编码+8位生日+3位顺序码+1位校验码
+ * 
+ * @ClassName: CheckIdCard
+ * @Description: TODO
+ * @author suncy
+ * @date 2013-1-4 上午11:06:09
+ * 
+ */
+public class CheckIdCard {
+	private String cardNumber; // 完整的身份证号码
+	private Boolean cacheValidateResult = null; // 缓存身份证是否有效,因为验证有效性使用频繁且计算复杂
+	private Date cacheBirthDate = null; // 缓存出生日期,因为出生日期使用频繁且计算复杂
+	private final static String BIRTH_DATE_FORMAT = "yyyyMMdd"; // 身份证号码中的出生日期的格式
+	private final static Date MINIMAL_BIRTH_DATE = new Date(-2209017600000L); // 身份证的最小出生日期,1900年1月1日
+	private final static int NEW_CARD_NUMBER_LENGTH = 18;
+	private final static int OLD_CARD_NUMBER_LENGTH = 15;
+	private final static char[] VERIFY_CODE = { '1', '0', 'X', '9', '8', '7',
+			'6', '5', '4', '3', '2' }; // 18位身份证中最后一位校验码
+	private final static int[] VERIFY_CODE_WEIGHT = { 7, 9, 10, 5, 8, 4, 2, 1,
+			6, 3, 7, 9, 10, 5, 8, 4, 2 };// 18位身份证中,各个数字的生成校验码时的权值
+
+	public boolean validate() {
+		if (null == cacheValidateResult) {
+			boolean result = true;
+			result = result && (null != cardNumber); // 身份证号不能为空
+			result = result && NEW_CARD_NUMBER_LENGTH == cardNumber.length(); // 身份证号长度是18(新证)
+			// 身份证号的前17位必须是阿拉伯数字
+			for (int i = 0; result && i < NEW_CARD_NUMBER_LENGTH - 1; i++) {
+				char ch = cardNumber.charAt(i);
+				result = result && ch >= '0' && ch <= '9';
+			}
+			// 身份证号的第18位校验正确
+			result = result
+					&& (calculateVerifyCode(cardNumber) == cardNumber
+							.charAt(NEW_CARD_NUMBER_LENGTH - 1));
+			// 出生日期不能晚于当前时间,并且不能早于1900年
+			try {
+				Date birthDate = this.getBirthDate();
+				result = result && null != birthDate;
+				result = result && birthDate.before(new Date());
+				result = result && birthDate.after(MINIMAL_BIRTH_DATE);
+				/**
+				 * 出生日期中的年、月、日必须正确,比如月份范围是[1,12],日期范围是[1,31],还需要校验闰年、大月、小月的情况时,
+				 * 月份和日期相符合
+				 */
+				String birthdayPart = this.getBirthDayPart();
+				String realBirthdayPart = this.createBirthDateParser().format(
+						birthDate);
+				result = result && (birthdayPart.equals(realBirthdayPart));
+			} catch (Exception e) {
+				result = false;
+			}
+			cacheValidateResult = Boolean.valueOf(result);// TODO
+			// 完整身份证号码的省市县区检验规则
+		}
+		return cacheValidateResult;
+	}
+
+	/**
+	 * 如果是15位身份证号码,则自动转换为18位
+	 * 
+	 * @param cardNumber
+	 * @return
+	 */
+	public CheckIdCard(String cardNumber) {
+		if (null != cardNumber) {
+			cardNumber = cardNumber.trim();
+			if (OLD_CARD_NUMBER_LENGTH == cardNumber.length()) {
+				cardNumber = contertToNewCardNumber(cardNumber);
+			}
+		}
+		this.cardNumber = cardNumber;
+	}
+
+	public String getCardNumber() {
+		return cardNumber;
+	}
+
+	public String getAddressCode() {
+		this.checkIfValid();
+		return this.cardNumber.substring(0, 6);
+	}
+
+	public Date getBirthDate() {
+		if (null == this.cacheBirthDate) {
+			try {
+				this.cacheBirthDate = this.createBirthDateParser().parse(
+						this.getBirthDayPart());
+			} catch (Exception e) {
+				throw new RuntimeException("身份证的出生日期无效");
+			}
+		}
+		return new Date(this.cacheBirthDate.getTime());
+	}
+
+	public boolean isMale() {
+		return 1 == this.getGenderCode();
+	}
+
+	public boolean isFemal() {
+		return false == this.isMale();
+	}
+
+	/**
+	 * 获取身份证的第17位,奇数为男性,偶数为女性
+	 * 
+	 * @return
+	 */
+	private int getGenderCode() {
+		this.checkIfValid();
+		char genderCode = this.cardNumber.charAt(NEW_CARD_NUMBER_LENGTH - 2);
+		return (((int) (genderCode - '0')) & 0x1);
+	}
+
+	private String getBirthDayPart() {
+		return this.cardNumber.substring(6, 14);
+	}
+
+	private SimpleDateFormat createBirthDateParser() {
+		return new SimpleDateFormat(BIRTH_DATE_FORMAT);
+	}
+
+	private void checkIfValid() {
+		if (false == this.validate()) {
+			throw new RuntimeException("身份证号码不正确!");
+		}
+	}
+
+	/**
+	 * 校验码(第十八位数):
+	 * 
+	 * 十七位数字本体码加权求和公式 S = Sum(Ai * Wi), i = 0...16 ,先对前17位数字的权求和;
+	 * Ai:表示第i位置上的身份证号码数字值 Wi:表示第i位置上的加权因子 Wi: 7 9 10 5 8 4 2 1 6 3 7 9 10 5 8 4
+	 * 2; 计算模 Y = mod(S, 11)< 通过模得到对应的校验码 Y: 0 1 2 3 4 5 6 7 8 9 10 校验码: 1 0 X 9
+	 * 8 7 6 5 4 3 2
+	 * 
+	 * @param cardNumber
+	 * @return
+	 */
+	private static char calculateVerifyCode(CharSequence cardNumber) {
+		int sum = 0;
+		for (int i = 0; i < NEW_CARD_NUMBER_LENGTH - 1; i++) {
+			char ch = cardNumber.charAt(i);
+			sum += ((int) (ch - '0')) * VERIFY_CODE_WEIGHT[i];
+		}
+		return VERIFY_CODE[sum % 11];
+	}
+	
+	/**  
+     * 获取年龄
+     */    
+    public Integer getAge() {    
+        try {    
+            boolean validateAccess = validate();    
+            if (validateAccess) {
+                // 获取出生日期    
+                Date birthdate = getBirthDate();    
+                GregorianCalendar currentDay = new GregorianCalendar();
+                currentDay.setTime(birthdate);    
+                int year = currentDay.get(Calendar.YEAR);
+                //获取年龄  
+                SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyy");
+                String nowYear=simpleDateFormat.format(new Date());  
+                return Integer.parseInt(nowYear)-year;     
+            }else{
+            	return null;
+            }
+        } catch (Exception e) {    
+            return null; 
+        }    
+    }    
+
+	/**
+	 * 把15位身份证号码转换到18位身份证号码<br>
+	 * 15位身份证号码与18位身份证号码的区别为:<br>
+	 * 1、15位身份证号码中,"出生年份"字段是2位,转换时需要补入"19",表示20世纪<br>
+	 * 2、15位身份证无最后一位校验码。18位身份证中,校验码根据根据前17位生成
+	 * 
+	 * @param oldCardNumber
+	 * @return
+	 */
+	private static String contertToNewCardNumber(String oldCardNumber) {
+		StringBuilder buf = new StringBuilder(NEW_CARD_NUMBER_LENGTH);
+		buf.append(oldCardNumber.substring(0, 6));
+		buf.append("19");
+		buf.append(oldCardNumber.substring(6));
+		buf.append(com.jpsoft.making_friends.dto.utils.CheckIdCard.calculateVerifyCode(buf));
+		return buf.toString();
+	}
+}

+ 78 - 0
src/main/java/com/jpsoft/making_friends/dto/utils/DES3.java

@@ -0,0 +1,78 @@
+package com.jpsoft.making_friends.dto.utils;
+
+import com.jpsoft.making_friends.dto.utils.Base64;
+
+import javax.crypto.Cipher;
+import javax.crypto.SecretKeyFactory;
+import javax.crypto.spec.DESedeKeySpec;
+import java.io.UnsupportedEncodingException;
+import java.security.Key;
+
+public class DES3 {
+	public String encrypt(byte[] key, byte[] data)  throws Exception {
+
+        Key deskey = null;
+        DESedeKeySpec spec = new DESedeKeySpec(key);
+        SecretKeyFactory keyfactory = SecretKeyFactory.getInstance("desede");
+        deskey = keyfactory.generateSecret(spec);
+        Cipher cipher = Cipher.getInstance("desede" + "/ECB/PKCS5Padding");
+        cipher.init(Cipher.ENCRYPT_MODE, deskey);
+        byte[] bOut = cipher.doFinal(data);
+
+        return Base64.encode(bOut);
+    }
+    
+    public String encrypt(String key, String data)  throws Exception {
+    	return encrypt(getKeyByte(key),data.getBytes("UTF-8"));
+    }
+
+    public String decrypt(byte[] key, byte[] data) throws Exception {
+        Key deskey = null;
+        DESedeKeySpec spec = new DESedeKeySpec(key);
+        SecretKeyFactory keyfactory = SecretKeyFactory.getInstance("desede");
+        deskey = keyfactory.generateSecret(spec);
+
+        Cipher cipher = Cipher.getInstance("desede" + "/ECB/PKCS5Padding");
+
+        cipher.init(Cipher.DECRYPT_MODE, deskey);
+
+        byte[] bOut = cipher.doFinal(data);
+
+        return new String(bOut, "UTF-8");
+    }
+    
+    public String decrypt(String key, String data)  throws Exception {
+    	return decrypt(getKeyByte(key), Base64.decode(data));
+    }
+
+    public byte[] getKeyByte(String key) throws UnsupportedEncodingException {
+        if (key == null) {
+            return new byte[0];
+        }
+
+        int length = key.length();
+        if (length >= 24) {
+            return key.substring(0, 24).getBytes("UTF-8");
+        } else {
+            for (int i = 0; i < (24 - length); i++) {
+                key += "0";
+            }
+            
+            return key.getBytes("UTF-8");
+        }
+    }
+    
+    public static void main(String[] args) {
+    	com.jpsoft.making_friends.dto.utils.DES3 des3 = new com.jpsoft.making_friends.dto.utils.DES3();
+		String appKey = "8ZZAHLlTMeNRCP6X";
+		
+		try {
+			System.out.println(des3.encrypt(appKey, "ac5c629f-068d-4b8d-8700-3c3d362337f0"));
+
+			System.out.println(des3.decrypt(appKey, "Xkb9FDXbmw8tEybl2ItjvomEK0QrL+pn6wt9yO7/vA7G9jIUiDhFLg=="));
+		} catch (Exception e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+	}
+}

+ 137 - 0
src/main/java/com/jpsoft/making_friends/dto/utils/DigestRequest.java

@@ -0,0 +1,137 @@
+package com.jpsoft.making_friends.dto.utils;
+
+import com.alibaba.fastjson.JSONObject;
+import com.jpsoft.making_friends.dto.utils.Digests;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.net.URLConnection;
+import java.util.Arrays;
+
+@Slf4j
+public class DigestRequest {
+    private String username;
+    private String password;
+
+    public DigestRequest(String username, String password){
+        this.username = username;
+        this.password = password;
+    }
+
+    /**
+     *
+     * @param url
+     * @param method
+     * @return
+     * @throws Exception
+     */
+    private String getAuthorization(String url, String method) throws Exception {
+        String authorization = "";
+
+        URL realUrl = new URL(url);
+
+        // 打开和URL之间的连接
+        URLConnection connection = realUrl.openConnection();
+        // 设置通用的请求属性
+        connection.setRequestProperty("accept", "*/*");
+        connection.setRequestProperty("connection", "Keep-Alive");
+        connection.setRequestProperty("user-agent","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");
+
+        connection.connect();
+
+        String authenticate = "";
+
+        //返回401时需再次用用户名和密码请求
+        //此情况返回服务器的 WWW-Authenticate 信息
+        if (((HttpURLConnection) connection).getResponseCode() == 401) {
+            authenticate = connection.getHeaderFields().get("WWW-Authenticate").get(0);
+        }
+
+        JSONObject authenticateJson = new JSONObject();
+
+        Arrays.stream(authenticate.split(",")).forEach(pair->{
+            String[] arr = pair.split("=");
+            authenticateJson.put(arr[0].trim(),arr[1].replaceAll("\"",""));
+        });
+
+        String algorithm = authenticateJson.getString("algorithm");
+
+        //注意nonce在服务器端会定时变化,所以不要收到nonce值后设断点调试,这样会导致nonce值验证不通过
+        String nonce = authenticateJson.getString("nonce");
+        String realm = authenticateJson.getString("realm");
+
+        String uri = realUrl.getPath();
+
+        if(StringUtils.isNotEmpty(realUrl.getQuery())){
+            uri += "?" + realUrl.getQuery();
+        }
+
+        String response = Digests.http_da_calc_HA1(username, realm, password,
+                nonce, null, null, null,
+                method, uri, algorithm);
+
+        //组成响应authorization
+        authorization = "Digest username=\"" + username
+                + "\",realm=\"" + realm
+                + "\",nonce=\"" + nonce
+                + "\",uri=\"" + uri
+                + "\",algorithm=\"" + algorithm
+                + "\",response=\"" + response+"\"";
+
+        return authorization;
+    }
+
+    public String send(String url, String method, String data){
+        String responseText = "";
+
+        try {
+            String authorization = getAuthorization(url,method);
+
+            URL realUrl = new URL(url);
+
+            HttpURLConnection conn = (HttpURLConnection) realUrl.openConnection();
+
+            conn.setRequestProperty("Authorization", authorization);
+            conn.setRequestMethod(method);
+
+            if(StringUtils.isNotEmpty(data)){
+                conn.setDoOutput(true);
+
+                if (StringUtils.isNotEmpty(data)) {
+                    byte[] buffer = data.getBytes("UTF-8");
+                    conn.setRequestProperty("Content-Length", String.valueOf(buffer.length));
+
+                    OutputStream output = conn.getOutputStream();
+                    output.write(buffer);
+                    output.flush();
+                    output.close();
+                }
+            }
+
+            if (conn.getResponseCode() == 200 || conn.getResponseCode() == 201) {
+                BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream(),"UTF-8"));
+                String line;
+                StringBuilder sb = new StringBuilder();
+
+                while ((line = in.readLine()) != null) {
+                    sb.append(line);
+                }
+
+                responseText = sb.toString();
+            }
+            else{
+                log.error("responseCode={}", conn.getResponseCode());
+            }
+        }
+        catch (Exception ex){
+            log.error(ex.getMessage(),ex);
+        }
+
+        return responseText;
+    }
+}

+ 143 - 0
src/main/java/com/jpsoft/making_friends/dto/utils/Digests.java

@@ -0,0 +1,143 @@
+package com.jpsoft.making_friends.dto.utils;
+
+import org.apache.commons.codec.binary.Hex;
+import org.apache.commons.lang3.Validate;
+
+import java.io.UnsupportedEncodingException;
+import java.security.GeneralSecurityException;
+import java.security.MessageDigest;
+import java.security.SecureRandom;
+import java.util.Random;
+
+/**
+ * Http Digest
+ * @author zhouzhixiang
+ * @date 2019-05-14
+ */
+public class Digests {
+
+    private static SecureRandom random = new SecureRandom();
+    /**
+     * 加密遵循RFC2671规范 将相关参数加密生成一个MD5字符串,并返回
+     */
+    public static String http_da_calc_HA1(String username, String realm, String password,
+                                          String nonce, String nc, String cnonce, String qop,
+                                          String method, String uri, String algorithm) throws Exception {
+        String HA1, HA2;
+        if ("MD5-sess".equals(algorithm)) {
+            HA1 = HA1_MD5_sess(username, realm, password, nonce, cnonce);
+        } else {
+            HA1 = HA1_MD5(username, realm, password);
+        }
+        byte[] md5Byte = md5(HA1.getBytes("UTF-8"));
+        HA1 = new String(Hex.encodeHex(md5Byte));
+
+        md5Byte = md5(HA2(method, uri).getBytes("UTF-8"));
+        HA2 = new String(Hex.encodeHex(md5Byte));
+
+        //":" + cnonce + ":" + qop
+        String original = HA1 + ":" + nonce + ":" + HA2;
+
+        md5Byte = md5(original.getBytes("UTF-8"));
+        return new String(Hex.encodeHex(md5Byte));
+
+    }
+
+    /**
+     * algorithm值为MD5时规则
+     */
+    private static String HA1_MD5(String username, String realm, String password) {
+        return username + ":" + realm + ":" + password;
+    }
+
+    /**
+     * algorithm值为MD5-sess时规则
+     */
+    private static String HA1_MD5_sess(String username, String realm, String password, String nonce, String cnonce) {
+        //      MD5(username:realm:password):nonce:cnonce
+
+        String s = HA1_MD5(username, realm, password);
+        byte[] md5Byte = md5(s.getBytes());
+        String smd5 = new String(Hex.encodeHex(md5Byte));
+
+        return smd5 + ":" + nonce + ":" + cnonce;
+    }
+
+    private static String HA2(String method, String uri) {
+        return method + ":" + uri;
+    }
+
+    /**
+     * 对输入字符串进行md5散列.
+     */
+    public static byte[] md5(byte[] input) {
+        return digest(input, "MD5", null, 1);
+    }
+
+    /**
+     * 对字符串进行散列, 支持md5与sha1算法.
+     */
+    private static byte[] digest(byte[] input, String algorithm, byte[] salt, int iterations) {
+        try {
+            MessageDigest digest = MessageDigest.getInstance(algorithm);
+
+            if (salt != null) {
+                digest.update(salt);
+            }
+
+            byte[] result = digest.digest(input);
+
+            for (int i = 1; i < iterations; i++) {
+                digest.reset();
+                result = digest.digest(result);
+            }
+            return result;
+        } catch (GeneralSecurityException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    /**
+     * 随机生成numBytes长度数组
+     * @param numBytes
+     * @return
+     */
+    public static byte[] generateSalt(int numBytes) {
+        Validate.isTrue(numBytes > 0, "numBytes argument must be a positive integer (1 or larger)", (long)numBytes);
+        byte[] bytes = new byte[numBytes];
+        random.nextBytes(bytes);
+        return bytes;
+    }
+
+    @Deprecated
+    public static String generateSalt2(int length) {
+        String val = "";
+        Random random = new Random();
+        //参数length,表示生成几位随机数
+        for(int i = 0; i < length; i++) {
+            String charOrNum = random.nextInt(2) % 2 == 0 ? "char" : "num";
+            //输出字母还是数字
+            if( "char".equalsIgnoreCase(charOrNum) ) {
+                //输出是大写字母还是小写字母
+                int temp = random.nextInt(2)%2 == 0 ? 65 : 97;
+                val += (char)(random.nextInt(26) + temp);
+            } else if( "num".equalsIgnoreCase(charOrNum) ) {
+                val += String.valueOf(random.nextInt(10));
+            }
+        }
+        return val.toLowerCase();
+    }
+
+
+    //测试
+    public static void main(String[] args) throws UnsupportedEncodingException {
+        // String s = http_da_calc_HA1("povodo", "realm@easycwmp", "povodo",
+        //                             "c10c9897f05a9aee2e2c5fdebf03bb5b0001b1ef", "00000001", "d5324153548c43d8", "auth",
+        //                             "GET", "/", "MD5");
+        // System.out.println("加密后response为:" + s);
+
+        // String s = new String(generateSalt(8),"UTF-8");
+
+        // System.out.println(s);
+    }
+}

+ 197 - 0
src/main/java/com/jpsoft/making_friends/dto/utils/GPSUtil.java

@@ -0,0 +1,197 @@
+package com.jpsoft.making_friends.dto.utils;
+
+import com.alibaba.fastjson.JSONObject;
+
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.net.URL;
+import java.net.URLConnection;
+import java.text.DecimalFormat;
+
+public class GPSUtil {
+    public static double pi = 3.1415926535897932384626;  
+    public static double x_pi = 3.14159265358979324 * 3000.0 / 180.0;  
+    public static double a = 6378245.0;  
+    public static double ee = 0.00669342162296594323;  
+
+    public static double transformLat(double x, double y) {  
+        double ret = -100.0 + 2.0 * x + 3.0 * y + 0.2 * y * y + 0.1 * x * y  
+                + 0.2 * Math.sqrt(Math.abs(x));  
+        ret += (20.0 * Math.sin(6.0 * x * pi) + 20.0 * Math.sin(2.0 * x * pi)) * 2.0 / 3.0;  
+        ret += (20.0 * Math.sin(y * pi) + 40.0 * Math.sin(y / 3.0 * pi)) * 2.0 / 3.0;  
+        ret += (160.0 * Math.sin(y / 12.0 * pi) + 320 * Math.sin(y * pi / 30.0)) * 2.0 / 3.0;  
+        return ret;  
+    }  
+
+    public static double transformLon(double x, double y) {  
+        double ret = 300.0 + x + 2.0 * y + 0.1 * x * x + 0.1 * x * y + 0.1  
+                * Math.sqrt(Math.abs(x));  
+        ret += (20.0 * Math.sin(6.0 * x * pi) + 20.0 * Math.sin(2.0 * x * pi)) * 2.0 / 3.0;  
+        ret += (20.0 * Math.sin(x * pi) + 40.0 * Math.sin(x / 3.0 * pi)) * 2.0 / 3.0;  
+        ret += (150.0 * Math.sin(x / 12.0 * pi) + 300.0 * Math.sin(x / 30.0  
+                * pi)) * 2.0 / 3.0;  
+        return ret;  
+    }  
+    public static double[] transform(double lat, double lon) {  
+        if (outOfChina(lat, lon)) {  
+            return new double[]{lat,lon};  
+        }  
+        double dLat = transformLat(lon - 105.0, lat - 35.0);  
+        double dLon = transformLon(lon - 105.0, lat - 35.0);  
+        double radLat = lat / 180.0 * pi;  
+        double magic = Math.sin(radLat);  
+        magic = 1 - ee * magic * magic;  
+        double sqrtMagic = Math.sqrt(magic);  
+        dLat = (dLat * 180.0) / ((a * (1 - ee)) / (magic * sqrtMagic) * pi);  
+        dLon = (dLon * 180.0) / (a / sqrtMagic * Math.cos(radLat) * pi);  
+        double mgLat = lat + dLat;  
+        double mgLon = lon + dLon;  
+        return new double[]{mgLat,mgLon};  
+    }  
+    public static boolean outOfChina(double lat, double lon) {  
+        if (lon < 72.004 || lon > 137.8347)  
+            return true;  
+        if (lat < 0.8293 || lat > 55.8271)  
+            return true;  
+        return false;  
+    }  
+    /** 
+     * 84 to 火星坐标系 (GCJ-02) World Geodetic System ==> Mars Geodetic System 
+     * 
+     * @param lat 
+     * @param lon 
+     * @return 
+     */  
+    public static double[] gps84_To_Gcj02(double lat, double lon) {  
+        if (outOfChina(lat, lon)) {  
+            return new double[]{lat,lon};  
+        }  
+        double dLat = transformLat(lon - 105.0, lat - 35.0);  
+        double dLon = transformLon(lon - 105.0, lat - 35.0);  
+        double radLat = lat / 180.0 * pi;  
+        double magic = Math.sin(radLat);  
+        magic = 1 - ee * magic * magic;  
+        double sqrtMagic = Math.sqrt(magic);  
+        dLat = (dLat * 180.0) / ((a * (1 - ee)) / (magic * sqrtMagic) * pi);  
+        dLon = (dLon * 180.0) / (a / sqrtMagic * Math.cos(radLat) * pi);  
+        double mgLat = lat + dLat;  
+        double mgLon = lon + dLon;  
+        return new double[]{mgLat, mgLon};  
+    }  
+
+    /** 
+     * * 火星坐标系 (GCJ-02) to 84 * * @param lon * @param lat * @return 
+     * */  
+    public static double[] gcj02_To_Gps84(double lat, double lon) {  
+        double[] gps = transform(lat, lon);  
+        double lontitude = lon * 2 - gps[1];  
+        double latitude = lat * 2 - gps[0];  
+        return new double[]{latitude, lontitude};  
+    }  
+    /** 
+     * 火星坐标系 (GCJ-02) 与百度坐标系 (BD-09) 的转换算法 将 GCJ-02 坐标转换成 BD-09 坐标 
+     * 
+     * @param lat 
+     * @param lon 
+     */  
+    public static double[] gcj02_To_Bd09(double lat, double lon) {  
+        double x = lon, y = lat;  
+        double z = Math.sqrt(x * x + y * y) + 0.00002 * Math.sin(y * x_pi);  
+        double theta = Math.atan2(y, x) + 0.000003 * Math.cos(x * x_pi);  
+        double tempLon = z * Math.cos(theta) + 0.0065;  
+        double tempLat = z * Math.sin(theta) + 0.006;  
+        double[] gps = {tempLat,tempLon};  
+        return gps;  
+    }  
+
+    /** 
+     * * 火星坐标系 (GCJ-02) 与百度坐标系 (BD-09) 的转换算法 * * 将 BD-09 坐标转换成GCJ-02 坐标 * * @param 
+     * bd_lat * @param bd_lon * @return 
+     */  
+    public static double[] bd09_To_Gcj02(double lat, double lon) {  
+        double x = lon - 0.0065, y = lat - 0.006;  
+        double z = Math.sqrt(x * x + y * y) - 0.00002 * Math.sin(y * x_pi);  
+        double theta = Math.atan2(y, x) - 0.000003 * Math.cos(x * x_pi);  
+        double tempLon = z * Math.cos(theta);  
+        double tempLat = z * Math.sin(theta);  
+        double[] gps = {tempLat,tempLon};  
+        return gps;  
+    }  
+
+    /**将gps84转为bd09 
+     * @param lat 
+     * @param lon 
+     * @return 
+     */  
+    public static double[] gps84_To_bd09(double lat,double lon){  
+        double[] gcj02 = gps84_To_Gcj02(lat,lon);  
+        double[] bd09 = gcj02_To_Bd09(gcj02[0],gcj02[1]);  
+        return bd09;  
+    }  
+    public static double[] bd09_To_gps84(double lat,double lon){  
+        double[] gcj02 = bd09_To_Gcj02(lat, lon);  
+        double[] gps84 = gcj02_To_Gps84(gcj02[0], gcj02[1]);  
+        //保留小数点后六位  
+        gps84[0] = retain6(gps84[0]);  
+        gps84[1] = retain6(gps84[1]);  
+        return gps84;  
+    }  
+
+    /**保留小数点后六位 
+     * @param num 
+     * @return 
+     */  
+    private static double retain6(double num){  
+        String result = String .format("%.6f", num);  
+        return Double.valueOf(result);  
+    }
+
+    public static String regeo(String longitude,String latitude,String key) {
+        StringBuffer json = new StringBuffer();
+
+        //09abadb2e35fc61fd84042c518e9aebf
+        try {
+            URL u = new URL(String.format("https://restapi.amap.com/v3/geocode/regeo?location=%s,%s&key=%s",
+                    longitude,latitude,key));
+
+            URLConnection yc = u.openConnection();
+            //读取返回的数据
+            BufferedReader in = new BufferedReader(new InputStreamReader(yc.getInputStream(),"UTF-8"));
+            String inputline = null;
+
+            while((inputline=in.readLine())!=null){
+                json.append(inputline);
+            }
+
+            in.close();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+        String jsonStr = json.toString();
+
+        System.out.println(jsonStr);
+
+        JSONObject jsonObject = JSONObject.parseObject(jsonStr);
+
+        JSONObject regeocode = jsonObject.getJSONObject("regeocode");
+
+        //判断输入的位置点是否存在
+        if(regeocode!=null) {
+            return regeocode.getString("formatted_address");
+        }
+        else {
+            return null;
+        }
+    }
+
+    public static void main(String[] args) {
+        //112.270696,30.309306
+        //112.270920,30.308930
+        double[] points = com.jpsoft.making_friends.dto.utils.GPSUtil.gps84_To_Gcj02(30.308930F,112.270920F);
+
+        DecimalFormat df = new DecimalFormat("#.######");
+
+        System.out.println(df.format(points[1]) + "," + df.format(points[0]));
+    }
+}

+ 423 - 0
src/main/java/com/jpsoft/making_friends/dto/utils/HttpConnectionUtil.java

@@ -0,0 +1,423 @@
+package com.jpsoft.making_friends.dto.utils;
+
+import com.jpsoft.making_friends.dto.utils.MyX509TrustManager;
+import net.sf.json.JSONObject;
+import org.apache.http.HttpEntity;
+import org.apache.http.HttpResponse;
+import org.apache.http.client.HttpClient;
+import org.apache.http.client.config.RequestConfig;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.config.RegistryBuilder;
+import org.apache.http.conn.socket.ConnectionSocketFactory;
+import org.apache.http.conn.socket.PlainConnectionSocketFactory;
+import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
+import org.apache.http.entity.StringEntity;
+import org.apache.http.impl.client.DefaultHttpRequestRetryHandler;
+import org.apache.http.impl.client.HttpClientBuilder;
+import org.apache.http.impl.conn.BasicHttpClientConnectionManager;
+import org.apache.http.util.EntityUtils;
+
+import javax.net.ssl.HttpsURLConnection;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.SSLSocketFactory;
+import javax.net.ssl.TrustManager;
+import java.io.*;
+import java.net.ConnectException;
+import java.net.HttpURLConnection;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Iterator;
+import java.util.Map;
+
+public class HttpConnectionUtil {
+	private static int connectTimeoutMs = 10000;
+	private static int readTimeoutMs = 10000;
+	private static String charSet = "UTF-8";
+
+	public static String getHttpContent(String url) {
+        return getHttpContent(url, "UTF-8");
+    }
+
+    public static String getHttpContent(String url, String charSet) {
+        HttpURLConnection connection = null;
+        String content = "";
+        try {
+            URL address_url = new URL(url);
+            connection = (HttpURLConnection) address_url.openConnection();
+            connection.setRequestMethod("GET");
+            //设置访问超时时间及读取网页流的超市时间,毫秒值
+            System.setProperty("sun.net.client.defaultConnectTimeout","30000");
+            System.setProperty("sun.net.client.defaultReadTimeout", "30000");
+
+            //after JDK 1.5
+//            connection.setConnectTimeout(10000);
+//            connection.setReadTimeout(10000);
+            //得到访问页面的返回值
+            int response_code = connection.getResponseCode();
+            if (response_code == HttpURLConnection.HTTP_OK) {
+                InputStream in = connection.getInputStream();
+//                InputStreamReader reader = new InputStreamReader(in,charSet);
+                BufferedReader reader = new BufferedReader(new InputStreamReader(in, charSet));
+                String line = null;
+                while ((line = reader.readLine()) != null) {
+                    content+=line;
+                }
+                return content;
+            }
+        } catch (MalformedURLException e) {
+            e.printStackTrace();
+        } catch (IOException e) {
+            e.printStackTrace();
+        } finally {
+            if(connection !=null){
+                connection.disconnect();
+            }
+        }
+        return "";
+    }
+    
+    @SuppressWarnings("rawtypes")
+    public static String getHttpContentByPost(String url, String charSet,Map<String, Object> requestParamsMap) {
+        HttpURLConnection connection = null;
+        DataOutputStream out = null;
+        String content = "";
+        StringBuffer params = new StringBuffer();  
+        try {
+        	
+        	// 组织请求参数  
+            Iterator it = requestParamsMap.entrySet().iterator();  
+            while (it.hasNext()) {  
+				Map.Entry element = (Map.Entry) it.next();  
+                params.append(element.getKey());  
+                params.append("=");  
+                params.append(element.getValue());  
+                params.append("&");  
+            }  
+            if (params.length() > 0) {  
+                params.deleteCharAt(params.length() - 1);  
+            }  
+        	
+            System.out.println("url>>>>>>>>>>" + url);
+            System.out.println("params>>>>>>>>>>" + params);
+            
+            URL address_url = new URL(url);
+            connection = (HttpURLConnection) address_url.openConnection();
+            connection.setRequestMethod("POST");
+            //设置访问超时时间及读取网页流的超市时间,毫秒值
+            System.setProperty("sun.net.client.defaultConnectTimeout","30000");
+            System.setProperty("sun.net.client.defaultReadTimeout", "30000");
+
+         // 设置通用的请求属性  
+            connection.setRequestProperty("accept", "*/*");  
+            connection.setRequestProperty("connection", "Keep-Alive");  
+            connection.setRequestProperty("Content-Length", String.valueOf(params.length()));  
+            // 发送POST请求必须设置如下两行  
+            connection.setDoOutput(true);  
+            connection.setDoInput(true);  
+            // 获取URLConnection对象对应的输出流  
+            out = new DataOutputStream(connection.getOutputStream());
+            // 发送请求参数 
+            out.write(params.toString().getBytes("utf-8"));
+            out.flush();
+            out.close();
+            //得到访问页面的返回值
+            int response_code = connection.getResponseCode();
+            
+            System.out.println("response_code>>>>>" + response_code);
+            
+            if (response_code == HttpURLConnection.HTTP_OK) {
+                InputStream in = connection.getInputStream();
+//                InputStreamReader reader = new InputStreamReader(in,charSet);
+                BufferedReader reader = new BufferedReader(new InputStreamReader(in, charSet));
+                String line = null;
+                while ((line = reader.readLine()) != null) {
+                    content+=line;
+                }
+                
+                System.out.println("content>>>>>" + content);
+                return content;
+            }
+            
+            
+        } catch (MalformedURLException e) {
+            e.printStackTrace();
+        } catch (IOException e) {
+            e.printStackTrace();
+        } finally {
+            if(connection !=null){
+                connection.disconnect();
+            }
+        }
+        return "";
+    }
+    
+    public static String getHttpContentByPost(String url, String charSet,String params) {
+        HttpURLConnection connection = null;
+        String content = "";
+        PrintWriter printWriter = null;
+        try {
+
+            URL address_url = new URL(url);
+            connection = (HttpURLConnection) address_url.openConnection();
+            connection.setRequestMethod("POST");
+            //设置访问超时时间及读取网页流的超市时间,毫秒值
+            System.setProperty("sun.net.client.defaultConnectTimeout","30000");
+            System.setProperty("sun.net.client.defaultReadTimeout", "30000");
+
+         // 设置通用的请求属性  
+            connection.setRequestProperty("accept", "*/*");  
+            connection.setRequestProperty("connection", "Keep-Alive");  
+            connection.setRequestProperty("Content-Length", String.valueOf(params.length()));  
+            // 发送POST请求必须设置如下两行  
+            connection.setDoOutput(true);  
+            connection.setDoInput(true);  
+            // 获取URLConnection对象对应的输出流  
+            printWriter = new PrintWriter(connection.getOutputStream());  
+            // 发送请求参数  
+            printWriter.write(params);  
+            // flush输出流的缓冲  
+            printWriter.flush();  
+            //得到访问页面的返回值
+            int response_code = connection.getResponseCode();
+            if (response_code == HttpURLConnection.HTTP_OK) {
+                InputStream in = connection.getInputStream();
+//                InputStreamReader reader = new InputStreamReader(in,charSet);
+                BufferedReader reader = new BufferedReader(new InputStreamReader(in, charSet));
+                String line = null;
+                while ((line = reader.readLine()) != null) {
+                    content+=line;
+                }
+                return content;
+            }
+        } catch (MalformedURLException e) {
+            e.printStackTrace();
+        } catch (IOException e) {
+            e.printStackTrace();
+        } finally {
+            if(connection !=null){
+                connection.disconnect();
+            }
+        }
+        return "";
+    }
+
+	/**
+	 * 以http post方式请求
+	 * @param url 请求地址
+	 * @param data 请求参数
+	 * @return
+	 */
+	public static String requestByPost(String url,String data){
+		return requestByPost(url,charSet,data,connectTimeoutMs,readTimeoutMs);
+	}
+	
+	/**
+	 * 以http get方式请求
+	 * @param url 请求地址
+	 * @return
+	 */
+	public static String requestByGet(String url){
+		return requestByGet(url,charSet,connectTimeoutMs,readTimeoutMs);
+	}
+	
+	/**
+	 * 以http post方式请求
+	 * @param url 请求地址
+	 * @param charSet 字符编码
+	 * @param data 请求参数
+	 * @param connectTimeoutMs 连接超时(毫秒)
+	 * @param readTimeoutMs 数据读取超时(毫秒)
+	 * @return
+	 */
+    public static String requestByPost(String url,String charSet,String data, int connectTimeoutMs, int readTimeoutMs){
+    	try{
+	        BasicHttpClientConnectionManager connManager;
+
+	        connManager = new BasicHttpClientConnectionManager(
+	                RegistryBuilder.<ConnectionSocketFactory>create()
+	                        .register("http", PlainConnectionSocketFactory.getSocketFactory())
+	                        .register("https", SSLConnectionSocketFactory.getSocketFactory())
+	                        .build(),
+	                null,
+	                null,
+	                null
+	        );
+
+	        HttpClient httpClient = HttpClientBuilder.create()
+					//取消HttpClient 设置超时后,若在设定的时间内没有返回数据,httpClient底层会重复请求
+					.setRetryHandler(new DefaultHttpRequestRetryHandler(0, false))
+	                .setConnectionManager(connManager)
+	                .build();
+
+	        HttpPost httpPost = new HttpPost(url);
+
+	        RequestConfig requestConfig = RequestConfig.custom()
+					.setSocketTimeout(readTimeoutMs)
+					.setConnectTimeout(connectTimeoutMs)
+					.build();
+
+	        httpPost.setConfig(requestConfig);
+
+	        StringEntity postEntity = new StringEntity(data, charSet);
+	        httpPost.addHeader("Content-Type", "text/xml");
+	        httpPost.setEntity(postEntity);
+
+	        HttpResponse httpResponse = httpClient.execute(httpPost);
+	        HttpEntity httpEntity = httpResponse.getEntity();
+	        return EntityUtils.toString(httpEntity, "UTF-8");
+    	}catch(Exception e){
+    		e.printStackTrace();
+    	}
+    	
+    	return "";
+
+    }
+    
+    /**
+	 * 以http get方式请求
+	 * @param url 请求地址
+	 * @param charSet 字符编码
+	 * @param connectTimeoutMs 连接超时(毫秒)
+	 * @param readTimeoutMs 数据读取超时(毫秒)
+	 * @return
+	 */
+    public static String requestByGet(String url,String charSet,int connectTimeoutMs, int readTimeoutMs){
+    	try{
+	        BasicHttpClientConnectionManager connManager;
+	        
+	        connManager = new BasicHttpClientConnectionManager(
+	                RegistryBuilder.<ConnectionSocketFactory>create()
+	                        .register("http", PlainConnectionSocketFactory.getSocketFactory())
+	                        .register("https", SSLConnectionSocketFactory.getSocketFactory())
+	                        .build(),
+	                null,
+	                null,
+	                null
+	        );
+	
+	        HttpClient httpClient = HttpClientBuilder.create()
+	                .setConnectionManager(connManager)
+	                .build();
+	        
+	        HttpGet httpGet = new HttpGet(url);
+	        
+	        RequestConfig requestConfig = RequestConfig.custom().setSocketTimeout(readTimeoutMs).setConnectTimeout(connectTimeoutMs).build();
+	        httpGet.setConfig(requestConfig);	
+	        httpGet.addHeader("Content-Type", "text/xml");
+	
+	        HttpResponse httpResponse = httpClient.execute(httpGet);
+	        HttpEntity httpEntity = httpResponse.getEntity();
+	        return EntityUtils.toString(httpEntity, "UTF-8");
+    	}catch(Exception e){
+    		e.printStackTrace();
+    	}
+    	
+    	return "";
+
+    }
+    
+    /**
+	 * 发起https请求并获取结果
+	 * 
+	 * @param requestUrl 请求地址
+	 * @param requestMethod 请求方式(GET、POST)
+	 * @param outputStr 提交的数据
+	 * @return JSONObject(通过JSONObject.get(key)的方式获取json对象的属性值)
+	 */
+	public static JSONObject httpRequest(String requestUrl, String requestMethod, String outputStr) {
+		JSONObject jsonObject = null;
+		StringBuffer buffer = new StringBuffer();
+		try {
+			URL url = new URL(requestUrl);
+			HttpURLConnection httpUrlConn = (HttpURLConnection)url.openConnection();
+
+			if (requestUrl.startsWith("https")) {
+				HttpsURLConnection httpsURLConnection = (HttpsURLConnection)httpUrlConn;
+
+				// 创建SSLContext对象,并使用我们指定的信任管理器初始化
+				TrustManager[] tm = { new MyX509TrustManager() };
+				SSLContext sslContext = SSLContext.getInstance("SSL", "SunJSSE");
+				sslContext.init(null, tm, new java.security.SecureRandom());
+				// 从上述SSLContext对象中得到SSLSocketFactory对象
+				SSLSocketFactory ssf = sslContext.getSocketFactory();
+
+				httpsURLConnection.setSSLSocketFactory(ssf);
+			}
+
+			httpUrlConn.setDoOutput(true);
+			httpUrlConn.setDoInput(true);
+			httpUrlConn.setUseCaches(false);
+			httpUrlConn.setRequestMethod(requestMethod);
+
+			if ("GET".equalsIgnoreCase(requestMethod))
+				httpUrlConn.connect();
+
+			// 当有数据需要提交时
+			if (null != outputStr) {
+				OutputStream outputStream = httpUrlConn.getOutputStream();
+				// 注意编码格式,防止中文乱码
+				outputStream.write(outputStr.getBytes("UTF-8"));
+				outputStream.close();
+			}
+
+			// 将返回的输入流转换成字符串
+			InputStream inputStream = httpUrlConn.getInputStream();
+			InputStreamReader inputStreamReader = new InputStreamReader(inputStream, "utf-8");
+			BufferedReader bufferedReader = new BufferedReader(inputStreamReader);
+
+			String str = null;
+			while ((str = bufferedReader.readLine()) != null) {
+				buffer.append(str);
+			}
+			bufferedReader.close();
+			inputStreamReader.close();
+			// 释放资源
+			inputStream.close();
+			inputStream = null;
+			httpUrlConn.disconnect();
+			jsonObject = JSONObject.fromObject(buffer.toString());
+		} catch (ConnectException ce) {
+			System.out.println("Weixin server connection timed out.");
+		} catch (Exception e) {
+			System.out.println("https request error:" +  e.getMessage());
+		}
+		return jsonObject;
+	}
+
+	public static InputStream downloadStream(String requestUrl){
+		InputStream inputStream = null;
+
+		try {
+			URL url = new URL(requestUrl);
+			HttpURLConnection httpUrlConn = (HttpURLConnection) url.openConnection();
+
+			if (requestUrl.startsWith("https")) {
+				HttpsURLConnection httpsURLConnection = (HttpsURLConnection) httpUrlConn;
+
+				// 创建SSLContext对象,并使用我们指定的信任管理器初始化
+				TrustManager[] tm = {new MyX509TrustManager()};
+				SSLContext sslContext = SSLContext.getInstance("SSL", "SunJSSE");
+				sslContext.init(null, tm, new java.security.SecureRandom());
+				// 从上述SSLContext对象中得到SSLSocketFactory对象
+				SSLSocketFactory ssf = sslContext.getSocketFactory();
+
+				httpsURLConnection.setSSLSocketFactory(ssf);
+			}
+
+			httpUrlConn.setDoOutput(true);
+			httpUrlConn.setDoInput(true);
+			httpUrlConn.setUseCaches(false);
+			httpUrlConn.setRequestMethod("GET");
+			httpUrlConn.connect();
+
+			inputStream = httpUrlConn.getInputStream();
+		}
+		catch (Exception ex){
+			System.out.println(ex.getMessage());
+		}
+
+		return inputStream;
+	}
+
+}

+ 60 - 0
src/main/java/com/jpsoft/making_friends/dto/utils/HttpUtil.java

@@ -0,0 +1,60 @@
+package com.jpsoft.making_friends.dto.utils;
+
+import lombok.extern.slf4j.Slf4j;
+
+import javax.servlet.http.HttpServletRequest;
+
+@Slf4j
+public class HttpUtil {
+    public final static String getIpAddress(HttpServletRequest request){
+        // 获取请求主机IP地址,如果通过代理进来,则透过防火墙获取真实IP地址  
+
+        String ip = request.getHeader("X-Forwarded-For");
+        if (log.isInfoEnabled()) {
+            log.info("getIpAddress(HttpServletRequest) - X-Forwarded-For - String ip=" + ip);
+        }
+
+        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
+            if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
+                ip = request.getHeader("Proxy-Client-IP");
+                if (log.isInfoEnabled()) {
+                    log.info("getIpAddress(HttpServletRequest) - Proxy-Client-IP - String ip=" + ip);
+                }
+            }
+            if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
+                ip = request.getHeader("WL-Proxy-Client-IP");
+                if (log.isInfoEnabled()) {
+                    log.info("getIpAddress(HttpServletRequest) - WL-Proxy-Client-IP - String ip=" + ip);
+                }
+            }
+            if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
+                ip = request.getHeader("HTTP_CLIENT_IP");
+                if (log.isInfoEnabled()) {
+                    log.info("getIpAddress(HttpServletRequest) - HTTP_CLIENT_IP - String ip=" + ip);
+                }
+            }
+            if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
+                ip = request.getHeader("HTTP_X_FORWARDED_FOR");
+                if (log.isInfoEnabled()) {
+                    log.info("getIpAddress(HttpServletRequest) - HTTP_X_FORWARDED_FOR - String ip=" + ip);
+                }
+            }
+            if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
+                ip = request.getRemoteAddr();
+                if (log.isInfoEnabled()) {
+                    log.info("getIpAddress(HttpServletRequest) - getRemoteAddr - String ip=" + ip);
+                }
+            }
+        } else if (ip.length() > 15) {
+            String[] ips = ip.split(",");
+            for (int index = 0; index < ips.length; index++) {
+                String strIp = (String) ips[index];
+                if (!("unknown".equalsIgnoreCase(strIp))) {
+                    ip = strIp;
+                    break;
+                }
+            }
+        }
+        return ip;
+    }
+}

+ 38 - 0
src/main/java/com/jpsoft/making_friends/dto/utils/IdCardUtils.java

@@ -0,0 +1,38 @@
+package com.jpsoft.making_friends.dto.utils;
+
+import com.jpsoft.making_friends.dto.utils.AESUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+
+@Slf4j
+public class IdCardUtils {
+    public static String decrypt(String idCard){
+        String data = idCard;
+
+        if (StringUtils.isNotBlank(idCard) && idCard.length() > 18) {
+            try {
+                data = AESUtil.decrypt(idCard, AESUtil.MYSQL_ENC_KEY);
+            } catch (Exception ex) {
+               log.error(ex.getMessage(),ex);
+            }
+        }
+
+        return data;
+    }
+
+    public static String encrypt(String idCard) {
+        String result = idCard;
+
+
+        //身份证加密
+       /* try {
+            if(StringUtils.isNotBlank(idCard) && idCard.length()<=18){
+                result = AESUtil.encrypt(idCard.trim(), AESUtil.MYSQL_ENC_KEY);
+            }
+        } catch (Exception ex) {
+            log.error(ex.getMessage(),ex);
+        }*/
+
+        return result;
+    }
+}

+ 32 - 0
src/main/java/com/jpsoft/making_friends/dto/utils/JwtUtil2.java

@@ -0,0 +1,32 @@
+package com.jpsoft.making_friends.dto.utils;
+
+import io.jsonwebtoken.Jwts;
+import io.jsonwebtoken.security.Keys;
+
+import java.security.Key;
+import java.util.Base64;
+import java.util.Date;
+
+/**
+ * @author 墨鱼_mo
+ * @date 2020-11-2 13:55
+ */
+public class JwtUtil2 {
+
+    public static String createToken(String jwtSecret, String subject, Date expiration) {
+        //token有效时间天
+        byte[] privateKey = Base64.getDecoder().decode(jwtSecret);
+
+        Key key = Keys.hmacShaKeyFor(privateKey);
+
+        String token = Jwts.builder()
+                .setSubject(subject)
+                //设置自定义claims后,setSubject值将失效
+//               .setClaims(extraInfo)
+                .signWith(key)
+                .setExpiration(expiration)
+                .compact();
+
+        return "Bearer " + token;
+    }
+}

+ 24 - 0
src/main/java/com/jpsoft/making_friends/dto/utils/MyX509TrustManager.java

@@ -0,0 +1,24 @@
+package com.jpsoft.making_friends.dto.utils;
+
+import javax.net.ssl.X509TrustManager;
+import java.security.cert.CertificateException;
+import java.security.cert.X509Certificate;
+
+/**
+ * 证书信任管理器(用于https请求)
+ * 
+ * @author lt
+ * @date 2013-08-08
+ */
+public class MyX509TrustManager implements X509TrustManager {
+
+	public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException {
+	}
+
+	public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException {
+	}
+
+	public X509Certificate[] getAcceptedIssuers() {
+		return null;
+	}
+}

+ 202 - 0
src/main/java/com/jpsoft/making_friends/dto/utils/NewWordUtils.java

@@ -0,0 +1,202 @@
+package com.jpsoft.making_friends.dto.utils;
+
+import com.jpsoft.making_friends.config.OSSConfig;
+import com.jpsoft.making_friends.dto.utils.OSSUtil;
+import org.apache.poi.xwpf.usermodel.*;
+import org.springframework.core.io.ClassPathResource;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * word生成
+ * @author sz
+ */
+public class NewWordUtils {
+	/**
+	 * 根据模板生成新word文档
+	 * 判断表格是需要替换还是需要插入,判断逻辑有$为替换,表格无$为插入
+	 * @param inputUrl 模板存放地址
+	 * @param textMap 需要替换的信息集合
+	 * @param tableList 需要插入的表格信息集合
+	 * @return 成功返回true,失败返回false
+	 */
+	public static String changWord(String inputUrl, OSSConfig ossConfig, Map<String, String> textMap, List<String[]> tableList) {
+		String downloadUrl = "";
+		try {
+			//获取docx解析对象
+			ClassPathResource resource = new ClassPathResource(inputUrl);
+			//XWPFDocument document = new XWPFDocument(POIXMLDocument.openPackage(inputUrl));
+			XWPFDocument document = new XWPFDocument(resource.getInputStream());
+			//解析替换文本段落对象
+			changeText(document, textMap);
+			//解析替换表格对象
+			changeTable(document, textMap, tableList);
+
+			//生成新的word
+			ByteArrayOutputStream baos = new ByteArrayOutputStream();//二进制OutputStream
+			document.write(baos);//文档写入流
+			ByteArrayInputStream input = new ByteArrayInputStream(baos.toByteArray());
+
+			Date dt = new Date();
+			SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
+			String str = "请假单" + sdf.format(dt) + ".docx";
+
+			downloadUrl = OSSUtil.upload(ossConfig,"import",str,input);
+//            FileOutputStream stream = new FileOutputStream(file);
+//            document.write(stream);
+			//stream.close();
+
+		} catch (IOException e) {
+			e.printStackTrace();
+		}
+
+		return downloadUrl;
+
+	}
+
+
+	/**
+	 * 替换段落文本
+	 * @param document docx解析对象
+	 * @param textMap 需要替换的信息集合
+	 */
+	public static void changeText(XWPFDocument document, Map<String, String> textMap){
+		//获取段落集合
+		List<XWPFParagraph> paragraphs = document.getParagraphs();
+
+		for (XWPFParagraph paragraph : paragraphs) {
+			//判断此段落时候需要进行替换
+			String text = paragraph.getText();
+			if(checkText(text)){
+				List<XWPFRun> runs = paragraph.getRuns();
+				for (XWPFRun run : runs) {
+					//替换模板原来位置
+					run.setText(changeValue(run.toString(), textMap),0);
+				}
+			}
+		}
+
+	}
+
+	/**
+	 * 替换表格对象方法
+	 * @param document docx解析对象
+	 * @param textMap 需要替换的信息集合
+	 * @param tableList 需要插入的表格信息集合
+	 */
+	public static void changeTable(XWPFDocument document, Map<String, String> textMap,
+								   List<String[]> tableList){
+		//获取表格对象集合
+		List<XWPFTable> tables = document.getTables();
+		for (int i = 0; i < tables.size(); i++) {
+			//只处理行数大于等于2的表格,且不循环表头
+			XWPFTable table = tables.get(i);
+			if(table.getRows().size()>1){
+				//判断表格是需要替换还是需要插入,判断逻辑有$为替换,表格无$为插入
+				if(checkText(table.getText())){
+					List<XWPFTableRow> rows = table.getRows();
+					//遍历表格,并替换模板
+					eachTable(rows, textMap);
+				}else{
+//                  System.out.println("插入"+table.getText());
+					insertTable(table, tableList);
+				}
+			}
+		}
+	}
+
+
+
+
+
+	/**
+	 * 遍历表格
+	 * @param rows 表格行对象
+	 * @param textMap 需要替换的信息集合
+	 */
+	public static void eachTable(List<XWPFTableRow> rows ,Map<String, String> textMap){
+		for (XWPFTableRow row : rows) {
+			List<XWPFTableCell> cells = row.getTableCells();
+			for (XWPFTableCell cell : cells) {
+				//判断单元格是否需要替换
+				if(checkText(cell.getText())){
+					List<XWPFParagraph> paragraphs = cell.getParagraphs();
+					for (XWPFParagraph paragraph : paragraphs) {
+						List<XWPFRun> runs = paragraph.getRuns();
+						for (XWPFRun run : runs) {
+							run.setText(changeValue(run.toString(), textMap),0);
+						}
+					}
+				}
+			}
+		}
+	}
+
+	/**
+	 * 为表格插入数据,行数不够添加新行
+	 * @param table 需要插入数据的表格
+	 * @param tableList 插入数据集合
+	 */
+	public static void insertTable(XWPFTable table, List<String[]> tableList){
+		//创建行,根据需要插入的数据添加新行,不处理表头
+		for(int i = 1; i < tableList.size(); i++){
+			XWPFTableRow row =table.createRow();
+		}
+		//遍历表格插入数据
+		List<XWPFTableRow> rows = table.getRows();
+		for(int i = 1; i < rows.size(); i++){
+			XWPFTableRow newRow = table.getRow(i);
+			List<XWPFTableCell> cells = newRow.getTableCells();
+			for(int j = 0; j < cells.size(); j++){
+				XWPFTableCell cell = cells.get(j);
+				cell.setText(tableList.get(i-1)[j]);
+			}
+		}
+
+	}
+
+
+
+	/**
+	 * 判断文本中时候包含$
+	 * @param text 文本
+	 * @return 包含返回true,不包含返回false
+	 */
+	public static boolean checkText(String text){
+		boolean check  =  false;
+		if(text.indexOf("$")!= -1){
+			check = true;
+		}
+		return check;
+
+	}
+
+	/**
+	 * 匹配传入信息集合与模板
+	 * @param value 模板需要替换的区域
+	 * @param textMap 传入信息集合
+	 * @return 模板需要替换区域信息集合对应值
+	 */
+	public static String changeValue(String value, Map<String, String> textMap){
+		Set<Map.Entry<String, String>> textSets = textMap.entrySet();
+		for (Map.Entry<String, String> textSet : textSets) {
+			//匹配模板与替换值 格式${key}
+			String key = "${"+textSet.getKey()+"}";
+			if(value.indexOf(key)!= -1){
+				value = textSet.getValue();
+			}
+		}
+		//模板未匹配到区域替换为空
+		if(checkText(value)){
+			value = "";
+		}
+		return value;
+	}
+}

+ 351 - 0
src/main/java/com/jpsoft/making_friends/dto/utils/OSSUtil.java

@@ -0,0 +1,351 @@
+package com.jpsoft.making_friends.dto.utils;
+
+import cn.hutool.core.codec.Base64Encoder;
+import com.aliyun.oss.HttpMethod;
+import com.aliyun.oss.OSS;
+import com.aliyun.oss.OSSClientBuilder;
+import com.aliyun.oss.model.GeneratePresignedUrlRequest;
+import com.aliyun.oss.model.OSSObject;
+import com.aliyun.oss.model.PutObjectResult;
+import com.jpsoft.making_friends.config.OSSConfig;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+
+import java.io.*;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.net.URLConnection;
+import java.net.URLEncoder;
+import java.util.*;
+import java.util.stream.Collectors;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipOutputStream;
+
+@Slf4j
+public class OSSUtil {
+    public static String upload(OSSConfig ossConfig,
+                                   String subFolder, String fileName,
+                                   InputStream fileInputStream) {
+        Date now = new Date();
+
+        Calendar cal = Calendar.getInstance();
+        cal.setTime(now);
+
+        String savePath = ossConfig.getObjectPre();
+
+        if (!subFolder.startsWith("/")) {
+            savePath += "/";
+        }
+
+        savePath += subFolder;
+
+        //增加一级uuid目录
+        savePath += "/" + cal.get(Calendar.YEAR)
+                 + "/" + (cal.get(Calendar.MONTH) + 1)
+                 + "/" + cal.get(Calendar.DAY_OF_MONTH)
+                 + "/" + UUID.randomUUID().toString() + "/";
+
+        OSS ossClient = new OSSClientBuilder().build(ossConfig.getEndpoint(), ossConfig.getAccessKeyId(), ossConfig.getAccessKeySecret());
+
+//      int index = fileName.indexOf(".");
+//      String prefix = fileName.substring(0,index);
+//      String ext = fileName.substring(index);
+//      String newFileName = DateTime.now().toString("ddHHmmssSSS") + ext;
+//      String retFileUrl = savePath + newFileName;
+        String retFileUrl = savePath + fileName;
+
+        // 上传文件流
+        PutObjectResult result = ossClient.putObject(ossConfig.getBucketName(), retFileUrl, fileInputStream);
+
+        // 关闭OSSClient
+        ossClient.shutdown();
+
+        return ossConfig.getUrlPrefix() + "/" + retFileUrl;
+    }
+
+    public static boolean download(String fileUrl,String filePath){
+        boolean result;
+
+        try {
+            FileOutputStream output = new FileOutputStream(filePath);
+
+            URL url = new URL(encodeFileName(fileUrl));
+            URLConnection conn = url.openConnection();
+            InputStream input = conn.getInputStream();
+
+            byte[] buffs = new byte[1024 * 10];
+
+            BufferedInputStream bis = new BufferedInputStream(input, 1024 * 10);
+
+            int read;
+            while ((read = bis.read(buffs, 0, 1024 * 10)) != -1) {
+                output.write(buffs, 0, read);
+            }
+
+            input.close();
+            output.close();
+
+            result = true;
+        } catch (Exception e) {
+            result = false;
+            log.error(e.getMessage(),e);
+        }
+
+        return result;
+    }
+    public static String  downloadToBase64(String fileUrl){
+            ByteArrayOutputStream data = new ByteArrayOutputStream();;
+        try {
+       //     FileOutputStream output = new FileOutputStream();
+       //     OutputStream outputStream =null;
+
+
+
+            URL url = new URL(encodeFileName(fileUrl));
+        //    URLConnection conn = url.openConnection();
+        //    InputStream input = conn.getInputStream();
+
+            byte[] buffs = new byte[1024 * 10];
+            //创建连接
+            HttpURLConnection conn = (HttpURLConnection) url.openConnection();
+            conn.setRequestMethod("GET");
+            conn.setConnectTimeout(5000);
+            InputStream input = conn.getInputStream();
+            //将内容读到内存中
+            int len = -1;
+            while ((len =input.read(buffs))!=-1){
+                data.write(buffs,0,len);
+            }
+            input.close();
+
+
+
+        } catch (Exception e) {
+
+            log.error(e.getMessage(),e);
+        }
+
+
+        return Base64Encoder.encode(data.toByteArray());
+    }
+
+    public static boolean deleteFile(OSSConfig ossConfig, String filePath) {
+        OSS ossClient = new OSSClientBuilder().build(ossConfig.getEndpoint(), ossConfig.getAccessKeyId(), ossConfig.getAccessKeySecret());
+
+        String key = "";
+
+        if (filePath.startsWith(ossConfig.getUrlPrefix())) {
+            key = filePath.substring(ossConfig.getUrlPrefix().length());
+        }
+
+        if (key.startsWith("/")) {
+            key = key.substring(1);
+        }
+
+        boolean exist = ossClient.doesObjectExist(ossConfig.getBucketName(), key);
+
+        if (!exist) {
+            log.error("文件不存在,key={}", key);
+            return false;
+        }
+
+        log.info("删除文件,key={}", key);
+        ossClient.deleteObject(ossConfig.getBucketName(), key);
+
+        ossClient.shutdown();
+
+        return true;
+    }
+
+    public static void batchDownload(List<Map<String,Object>> fileList, OutputStream output){
+        try{
+            ZipOutputStream zos = new ZipOutputStream(output);
+
+            for (Map<String,Object> map : fileList) {
+                String fileUrl = (String)map.get("fileUrl");
+                String filePath = (String)map.get("filePath");
+                String fileName = (String)map.get("fileName");
+
+                try {
+                    if (StringUtils.isEmpty(fileName)) {
+                        fileName = fileUrl;
+                    }
+
+                    if (fileName.indexOf("?") != -1) {
+                        fileName = fileName.substring(0, fileName.indexOf("?"));
+                    }
+
+                    fileName = fileName.substring(fileName.lastIndexOf("/") + 1);
+
+                    String zipFile = fileName;
+
+                    if(StringUtils.isNotEmpty(filePath)){
+                        zipFile = filePath + fileName;
+                    }
+
+                    if(StringUtils.isNotEmpty(fileUrl)) {
+                        ZipEntry zipEntry = new ZipEntry(zipFile);
+                        zos.putNextEntry(zipEntry);
+
+                        URL url = new URL(encodeFileName(fileUrl));
+
+                        HttpURLConnection conn = (HttpURLConnection)url.openConnection();
+                        // 设置连接主机超时(单位:毫秒)
+                        conn.setConnectTimeout(5000);
+                        // 设置从主机读取数据超时(单位:毫秒)
+                        conn.setReadTimeout(5000);
+
+                        if(conn.getResponseCode()==200) {
+                            InputStream inputStream = conn.getInputStream();
+
+                            byte[] buffs = new byte[1024 * 10];
+
+                            BufferedInputStream bis = new BufferedInputStream(inputStream, 1024 * 10);
+
+                            int read;
+                            while ((read = bis.read(buffs, 0, 1024 * 10)) != -1) {
+                                zos.write(buffs, 0, read);
+                            }
+
+                            bis.close();
+                        }
+                    }
+                    else if(map.containsKey("localPath")){
+                        ZipEntry zipEntry = new ZipEntry(zipFile);
+                        zos.putNextEntry(zipEntry);
+
+                        String localPath = (String)map.get("localPath");
+                        byte[] buffs = new byte[1024 * 10];
+
+                        InputStream bis = new BufferedInputStream(new FileInputStream(localPath));
+
+                        int read;
+                        while ((read = bis.read(buffs, 0, 1024 * 10)) != -1) {
+                            zos.write(buffs, 0, read);
+                        }
+
+                        bis.close();
+                    }
+                    else if(map.containsKey("fileData")){
+                        ZipEntry zipEntry = new ZipEntry(zipFile);
+                        zos.putNextEntry(zipEntry);
+
+                        byte[] data = (byte[])map.get("fileData");
+
+                        zos.write(data, 0, data.length);
+                    }
+                }
+                catch(Exception ex){
+                    log.error(ex.getMessage(),ex);
+                }
+            }
+
+            zos.close();
+        }
+        catch(Exception ex){
+            log.error(ex.getMessage(),ex);
+        }
+    }
+
+    private static String encodeFileName(String fileUrl) throws Exception{
+        String[] segements = fileUrl.split("\\?");
+
+        String[] arr = segements[0].split("/");
+
+        //文件名可能是中文,用utf-8编码
+        arr[arr.length - 1] = URLEncoder.encode(arr[arr.length - 1],"UTF-8");
+
+        String encFileUrl = Arrays.stream(arr).collect(Collectors.joining("/"));
+
+        if (segements.length>1){
+            encFileUrl += "?" + segements[1];
+        }
+
+        return encFileUrl;
+    }
+
+    public static void presignedDownload(OSSConfig ossConfig, List<Map> fileList, OutputStream output){
+        BufferedInputStream bis = null;
+
+        try{
+            ZipOutputStream zos = new ZipOutputStream(output);
+
+            OSS ossClient = new OSSClientBuilder().build(ossConfig.getEndpoint(), ossConfig.getAccessKeyId(), ossConfig.getAccessKeySecret());
+
+            for (Map<String,String> map : fileList) {
+                try {
+                    String fileUrl = map.get("fileUrl");
+                    String filePath = map.get("filePath");
+
+                    Date expiration = new Date(System.currentTimeMillis() + 3600 * 1000);
+
+                    if (fileUrl.startsWith(ossConfig.getUrlPrefix())) {
+                        fileUrl = fileUrl.substring(ossConfig.getUrlPrefix().length());
+                    }
+
+                    if (fileUrl.indexOf("?") != -1) {
+                        fileUrl = fileUrl.substring(0, fileUrl.indexOf("?"));
+                    }
+
+                    if (fileUrl.startsWith("/")) {
+                        fileUrl = fileUrl.substring(1);
+                    }
+
+                    GeneratePresignedUrlRequest request = new GeneratePresignedUrlRequest(ossConfig.getBucketName(), fileUrl, HttpMethod.GET);
+
+                    // 设置过期时间。
+                    request.setExpiration(expiration);
+
+                    //设置缩放
+                    request.setProcess("image/resize,l_1024,limit_1");
+
+                    // 生成签名URL(HTTP GET请求)。
+                    URL signedUrl = ossClient.generatePresignedUrl(request);
+
+                    // 使用签名URL发送请求。
+                    OSSObject ossObject = ossClient.getObject(signedUrl, new HashMap<>());
+
+                    if (ossObject != null) {
+                        InputStream inputStream = ossObject.getObjectContent();
+                        byte[] buffs = new byte[1024 * 10];
+                        String fileName = fileUrl.substring(fileUrl.lastIndexOf("/") + 1);
+                        String zipFile = fileName;
+
+                        if (StringUtils.isNotEmpty(filePath)){
+                            zipFile = filePath + fileName;
+                        }
+
+                        ZipEntry zipEntry = new ZipEntry(zipFile);
+                        zos.putNextEntry(zipEntry);
+                        bis = new BufferedInputStream(inputStream, 1024 * 10);
+
+                        int read;
+                        while ((read = bis.read(buffs, 0, 1024 * 10)) != -1) {
+                            zos.write(buffs, 0, read);
+                        }
+
+                        ossObject.close();
+                    }
+                }
+                catch(Exception ex){
+                    log.error(ex.getMessage(),ex);
+                }
+            }
+
+            zos.close();
+            ossClient.shutdown();
+        }
+        catch(Exception ex){
+            log.error(ex.getMessage(),ex);
+        }
+        finally {
+            if(bis!=null){
+                try {
+                    bis.close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+    }
+}

+ 428 - 0
src/main/java/com/jpsoft/making_friends/dto/utils/POIUtils.java

@@ -0,0 +1,428 @@
+package com.jpsoft.making_friends.dto.utils;
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.poi.hssf.converter.ExcelToHtmlConverter;
+import org.apache.poi.hssf.usermodel.HSSFWorkbook;
+import org.apache.poi.ss.usermodel.*;
+import org.w3c.dom.Document;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.transform.OutputKeys;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+import java.io.*;
+import java.math.BigDecimal;
+import java.text.DecimalFormat;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Description:POI解析Excel获取所有数据(支持xls/xlsx)
+ *
+ * @author zhjun 2015-11-5
+ */
+public class POIUtils {
+    InputStream ins = null;
+    Workbook wb = null;
+    List<Object[]> dataList = new ArrayList<Object[]>(100);
+
+    public static void CreateBorder(CellStyle cellStyle) {
+        if (cellStyle != null) {
+            cellStyle.setBorderTop(BorderStyle.THIN);
+            cellStyle.setBorderBottom(BorderStyle.THIN);
+            cellStyle.setBorderLeft(BorderStyle.THIN);
+            cellStyle.setBorderRight(BorderStyle.THIN);
+        }
+    }
+
+    public static Cell setCellValue(Row row, int i, String value) {
+        // TODO Auto-generated method stub
+        Cell cell = row.createCell(i);
+        cell.setCellValue(value);
+
+        return cell;
+    }
+
+    public static Cell setCellValue(Row row, int i, int value) {
+        // TODO Auto-generated method stub
+        Cell cell = row.createCell(i);
+        cell.setCellValue(value);
+
+        return cell;
+    }
+
+    public static Cell setCellValue(Row row, int cellIndex, CellStyle cellStyle, Object value) {
+        Cell cell = row.createCell(cellIndex);
+        cell.setCellStyle(cellStyle);
+
+        if (value != null) {
+            if (value instanceof BigDecimal) {
+                cell.setCellValue(((BigDecimal) value).doubleValue());
+            } else if (value instanceof String) {
+                cell.setCellValue(value.toString());
+            } else if (value instanceof Integer) {
+                cell.setCellValue(Double.valueOf(value.toString()));
+            } else if (value instanceof Long) {
+                cell.setCellValue(Double.valueOf(value.toString()));
+            }
+        }
+
+        return cell;
+    }
+
+    public static String xls2html(HSSFWorkbook wb) {
+        String result = "";
+
+        try {
+            ExcelToHtmlConverter converter = new ExcelToHtmlConverter(DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument());
+            converter.setOutputColumnHeaders(false);
+            converter.setOutputRowNumbers(false);
+
+            converter.processWorkbook(wb);
+
+            Document htmlDocument = converter.getDocument();
+            ByteArrayOutputStream out = new ByteArrayOutputStream();
+            DOMSource domSource = new DOMSource(htmlDocument);
+            StreamResult streamResult = new StreamResult(out);
+            TransformerFactory tf = TransformerFactory.newInstance();
+            Transformer serializer = tf.newTransformer();
+            serializer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
+            serializer.setOutputProperty(OutputKeys.INDENT, "yes");
+            serializer.setOutputProperty(OutputKeys.METHOD, "html");
+            serializer.transform(domSource, streamResult);
+            out.close();
+
+            result = new String(out.toByteArray(), "UTF-8");
+        } catch (Exception ex) {
+            ex.printStackTrace();
+        }
+
+        return result;
+    }
+
+    /**
+     * 通过流读取
+     *
+     * @param ins
+     */
+    public POIUtils(InputStream ins) {
+        try {
+            wb = WorkbookFactory.create(ins);
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+            if (ins != null) {
+                try {
+                    ins.close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+    }
+
+    public POIUtils() {
+        wb = new HSSFWorkbook();
+    }
+
+    public Sheet getSheetAt(int sheetIndex){
+        return wb.getSheetAt(sheetIndex);
+    }
+
+    public Workbook getWorkbook(){
+        return wb;
+    }
+
+    /**
+     * 通过文件读取
+     *
+     * @param file
+     */
+    public POIUtils(File file) {
+        try {
+            ins = new FileInputStream(file);
+            wb = WorkbookFactory.create(ins);
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+            if (ins != null) {
+                try {
+                    ins.close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+    }
+
+    /**
+     * 通过文件路径读取
+     *
+     * @param path
+     */
+    public POIUtils(String path) {
+        try {
+            ins = new FileInputStream(path);
+            wb = WorkbookFactory.create(ins);
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+            if (ins != null) {
+                try {
+                    ins.close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+    }
+
+    /**
+     * 取Excel所有数据,包含header
+     *
+     * @return List<Object   [   ]>
+     */
+    public List<Object[]> getAllData(int sheetIndex) {
+        int columnNum = 0;
+        Sheet sheet = wb.getSheetAt(sheetIndex);
+        if (sheet.getRow(0) != null) {
+            columnNum = sheet.getRow(0).getLastCellNum() - sheet.getRow(0).getFirstCellNum();
+        }
+        if (columnNum > 0) {
+            for (Row row : sheet) {
+                Object[] singleRow = new Object[columnNum];
+                int n = 0;
+
+                for (int i = 0; i < columnNum; i++) {
+                    Cell cell = row.getCell(i, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK);
+                    singleRow[n] = getCellValue(cell);
+                    n++;
+                }
+
+                //在后续方法中校验
+//				if("".equals(singleRow[0])){continue;}//如果第一列为空,跳过
+
+                dataList.add(singleRow);
+            }
+        }
+        return dataList;
+    }
+
+    public List<Object[]> getAllData(int sheetIndex, int firstRowNum) {
+        int columnNum = 0;
+        Sheet sheet = wb.getSheetAt(sheetIndex);
+        if (sheet.getRow(0) != null) {
+            columnNum = sheet.getRow(firstRowNum).getLastCellNum();
+        }
+        if (columnNum > 0) {
+            for (Row row : sheet) {
+                Object[] singleRow = new Object[columnNum];
+                int n = 0;
+                for (int i = 0; i < columnNum; i++) {
+                    Cell cell = row.getCell(i, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK);
+                    singleRow[n] = getCellValue(cell);
+                    n++;
+                }
+                if ("".equals(singleRow[0])) {
+                    continue;
+                }//如果第一行为空,跳过
+                dataList.add(singleRow);
+            }
+        }
+        return dataList;
+    }
+
+    public Object getCellValue(int sheetIndex,int rowIndex,int colIndex){
+        Row row = wb.getSheetAt(sheetIndex).getRow(rowIndex);
+        Cell cell = row.getCell(colIndex, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK);
+
+        return getCellValue(cell);
+    }
+
+    /**
+     * 获取列的数据信息
+     *
+     * @param cell
+     * @return
+     */
+    private Object getCellValue(Cell cell) {
+        Object cellValue = null;
+        FormulaEvaluator evaluator = wb.getCreationHelper().createFormulaEvaluator();
+
+        switch (cell.getCellType()) {
+            case BLANK:
+                cellValue = "";
+                break;
+            case BOOLEAN:
+                cellValue = Boolean.toString(cell.getBooleanCellValue());
+                break;
+            //数值
+            case NUMERIC:
+                DecimalFormat df = new DecimalFormat("0");
+                double value = cell.getNumericCellValue();
+
+                if (value > Math.floor(value)) {
+                    df = new DecimalFormat("0.00");
+                }
+
+                cellValue = df.format(value);
+                break;
+            case STRING:
+                cellValue = cell.getStringCellValue().trim();
+                break;
+            case ERROR:
+                cellValue = "";
+                break;
+            case FORMULA:
+                CellValue cv = evaluator.evaluate(cell);
+
+                if (cv.getCellType() == CellType.STRING) {
+                    cellValue = cv.getStringValue();
+                } else if (cv.getCellType() == CellType.NUMERIC) {
+                    cellValue = cv.getNumberValue();
+                } else {
+                    cellValue = cell.getCellFormula();
+                }
+
+                break;
+            default:
+                cellValue = "";
+        }
+
+        return cellValue;
+    }
+
+
+    /**
+     * 返回Excel最大行index值,实际行数要加1
+     *
+     * @return
+     */
+    public int getRowNum(int sheetIndex) {
+        Sheet sheet = wb.getSheetAt(sheetIndex);
+        return sheet.getLastRowNum();
+    }
+
+    /**
+     * 返回数据的列数
+     *
+     * @param sheetIndex
+     * @return
+     */
+    public int getColumnNum(int sheetIndex) {
+        Sheet sheet = wb.getSheetAt(sheetIndex);
+        Row row = sheet.getRow(0);
+        if (row != null && row.getLastCellNum() > 0) {
+            return row.getLastCellNum();
+        }
+        return 0;
+    }
+
+    /**
+     * 获取某一行数据
+     *
+     * @param rowIndex 计数从0开始,rowIndex为0代表header行
+     * @return
+     */
+    public Object[] getRowData(int sheetIndex, int rowIndex) {
+        Object[] dataArray = null;
+        if (rowIndex > this.getColumnNum(sheetIndex)) {
+            return dataArray;
+        } else {
+//			dataArray = new Object[this.getColumnNum(sheetIndex)];
+            return this.dataList.get(rowIndex);
+        }
+    }
+
+
+    /**
+     * 获取某一列数据
+     *
+     * @param colIndex
+     * @return
+     */
+    public Object[] getColumnData(int sheetIndex, int colIndex) {
+        Object[] dataArray = null;
+        if (colIndex > this.getColumnNum(sheetIndex)) {
+            return dataArray;
+        } else {
+            if (this.dataList != null && this.dataList.size() > 0) {
+                dataArray = new Object[this.getRowNum(sheetIndex) + 1];
+                int index = 0;
+                for (Object[] rowData : dataList) {
+                    if (rowData != null) {
+                        dataArray[index] = rowData[colIndex];
+                        index++;
+                    }
+                }
+            }
+        }
+
+        return dataArray;
+    }
+
+    public static void main(String[] args) {
+        com.jpsoft.making_friends.dto.utils.POIUtils re = new com.jpsoft.making_friends.dto.utils.POIUtils("D:\\fpb.xlsx");
+
+        List<Object[]> objList = re.getAllData(0);
+
+        for (int i = 0; i < objList.size(); i++) {
+            String result = "";
+            for (int j = 0; j < objList.get(i).length; j++) {
+                result += objList.get(i)[j] + "_";
+            }
+
+            System.out.println(result);
+        }
+    }
+
+    public Workbook exportErrorXls(int sheetIndex,int validateColIndex, int rowNum) {
+        Workbook destBook = new HSSFWorkbook();
+        Sheet destSheet = destBook.createSheet();
+
+        //复制列头
+        Sheet srcSheet = wb.getSheetAt(sheetIndex);
+        Row srcHeaderRow = wb.getSheetAt(sheetIndex).getRow(0);
+        Row destHeaderRow = destSheet.createRow(0);
+
+        for (int i=0;i<srcHeaderRow.getLastCellNum();i++){
+            if (srcHeaderRow.getCell(i)!=null) {
+                destHeaderRow.createCell(i).setCellValue(srcHeaderRow.getCell(i).getStringCellValue());
+            }
+            else{
+                break;
+            }
+        }
+
+        int srcRowIndex = 1;
+        int destRowIndex = 1;
+
+        while(srcRowIndex<= rowNum){
+            Row dataRow1 = srcSheet.getRow(srcRowIndex);
+
+            if(dataRow1!=null) {
+                Cell cell = dataRow1.getCell(validateColIndex);
+
+                if (cell != null && StringUtils.isNotEmpty(cell.getStringCellValue())) {
+                    Row dataRow2 = destSheet.createRow(destRowIndex);
+
+                    int lastCellNum = Math.min(dataRow1.getLastCellNum(),100);
+
+                    for (int i = 0; i < lastCellNum; i++) {
+                        if (dataRow1.getCell(i) != null) {
+                            dataRow2.createCell(i).setCellValue((String) getCellValue(0, srcRowIndex, i));
+                        }
+                    }
+
+                    destRowIndex++;
+                }
+            }
+
+            srcRowIndex++;
+        }
+
+        return destBook;
+    }
+}

+ 84 - 0
src/main/java/com/jpsoft/making_friends/dto/utils/PojoUtils.java

@@ -0,0 +1,84 @@
+package com.jpsoft.making_friends.dto.utils;
+
+import com.github.dozermapper.core.DozerBeanMapperBuilder;
+import com.github.dozermapper.core.Mapper;
+import com.github.pagehelper.Page;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.beans.BeanInfo;
+import java.beans.Introspector;
+import java.beans.PropertyDescriptor;
+import java.util.HashMap;
+import java.util.Map;
+
+public class PojoUtils {
+    private static Logger logger = LoggerFactory.getLogger("root");
+    private static Mapper MAPPER = DozerBeanMapperBuilder.buildDefault();
+
+    public static <T> T map(Object source, Class<T> destinationClass) {
+        if (source == null) {
+            return null;
+        }
+        return MAPPER.map(source, destinationClass);
+    }
+
+    public static void map(Object source, Object destination) {
+        MAPPER.map(source, destination);
+    }
+
+    public static <T> Map<String, Object> pojo2map(T t) {
+        // TODO Auto-generated method stub
+        Map<String,Object> map = new HashMap<String,Object>();
+
+        try{
+            BeanInfo beanInfo  = Introspector.getBeanInfo(t.getClass());
+            PropertyDescriptor[] props = beanInfo.getPropertyDescriptors();
+
+            for (PropertyDescriptor pd : props) {
+                if (pd.getReadMethod()!=null) {
+                    try {
+                        Object srcValue = pd.getReadMethod().invoke(t);
+                        map.put(pd.getName(), srcValue);
+                    }
+                    catch (Exception ex){
+                        logger.error(ex.getMessage(),ex);
+                    }
+                }
+            }
+        }
+        catch(Exception ex){
+            ex.printStackTrace();
+        }
+
+        return map;
+    }
+
+    public static Map pageWrapper(Page page){
+        Map<String,Object> pageMap = new HashMap<>();
+
+        pageMap.put("recordsTotal",page.getTotal());
+        pageMap.put("recordsFiltered",page.getTotal());
+        pageMap.put("totalPage",page.getPages());
+        pageMap.put("pageNumber",page.getPageNum());
+        pageMap.put("pageSize",page.getPageSize());
+        pageMap.put("data", page.getResult());
+
+        return pageMap;
+    }
+
+    public static <T> Page<T> convertPage(Page page, Class<T> destinationClass){
+        Page newPage = new Page();
+
+        newPage.setPageNum(page.getPageNum());
+        newPage.setPageSize(page.getPageSize());
+        newPage.setPages(page.getPages());
+        newPage.setTotal(page.getTotal());
+
+        for (Object obj: page) {
+            newPage.add(map(obj,destinationClass));
+        }
+
+        return newPage;
+    }
+}

+ 140 - 0
src/main/java/com/jpsoft/making_friends/dto/utils/Sign.java

@@ -0,0 +1,140 @@
+package com.jpsoft.making_friends.dto.utils;
+
+import java.io.UnsupportedEncodingException;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+import java.util.*;
+
+public class Sign {
+
+    public static Map<String, String> sign(String jsapi_ticket, String url) {
+        Map<String, String> ret = new HashMap<String, String>();
+        String nonce_str = create_nonce_str();
+        String timestamp = create_timestamp();
+        String string1;
+        String signature = "";
+
+        //注意这里参数名必须全部小写,且必须有序
+        string1 = "jsapi_ticket=" + jsapi_ticket +
+                "&noncestr=" + nonce_str +
+                "&timestamp=" + timestamp +
+                "&url=" + url;
+
+        try {
+            MessageDigest crypt = MessageDigest.getInstance("SHA-1");
+            crypt.reset();
+            crypt.update(string1.getBytes("UTF-8"));
+            signature = byteToHex(crypt.digest());
+        } catch (NoSuchAlgorithmException e) {
+            e.printStackTrace();
+        } catch (UnsupportedEncodingException e) {
+            e.printStackTrace();
+        }
+
+        ret.put("url", url);
+        ret.put("jsapi_ticket", jsapi_ticket);
+        ret.put("nonceStr", nonce_str);
+        ret.put("timestamp", timestamp);
+        ret.put("signature", signature);
+
+        return ret;
+    }
+
+    private static String byteToHex(final byte[] hash) {
+        Formatter formatter = new Formatter();
+        for (byte b : hash) {
+            formatter.format("%02x", b);
+        }
+        String result = formatter.toString();
+        formatter.close();
+        return result;
+    }
+
+    private static String create_nonce_str() {
+        return UUID.randomUUID().toString();
+    }
+
+    private static String create_timestamp() {
+        return Long.toString(System.currentTimeMillis() / 1000);
+    }
+
+
+    public static String parkSign(Map<String, Object> map, String signKey) {
+
+
+        if (map == null) {
+            return null;
+        }
+        if (map.containsKey("sign")) {
+            map.remove("sign");
+        }
+
+        List<String> keyList = new ArrayList<String>(map.keySet());
+        Collections.sort(keyList);
+        StringBuffer sb = new StringBuffer();
+        for (int i = 0; i < keyList.size(); i++) {
+            String key = keyList.get(i);
+            Object value = map.get(key);
+            sb.append(key + "=" + value + "&");
+        }
+        String signStr = (sb.substring(0,
+                sb.length() - 1) + signKey).toLowerCase();
+        System.out.println("before sign: " + signStr);
+        String md5Str = MD5(signStr);
+        System.out.println("after sign: " + md5Str);
+        return md5Str;
+
+
+    }
+
+    /**
+     * 生成MD5
+     */
+    public static String
+
+    MD5(String s) {
+        return MD5(s, "utf-8");
+    }
+
+    /**
+     * 生成MD5
+     */
+    public static String
+
+    MD5(String s, String charset) {
+
+        try {
+            MessageDigest messagedigest =
+                    MessageDigest.getInstance("MD5");
+            messagedigest.reset();
+            byte abyte0[] = messagedigest.digest(s.getBytes(charset));
+            return byteToString(abyte0);
+        } catch (NoSuchAlgorithmException e) {
+            e.printStackTrace();
+        } catch (UnsupportedEncodingException e) {
+            e.printStackTrace();
+        }
+        return "";
+    }
+
+    private static String
+
+    byteToString(byte abyte0[]) {
+        int i = abyte0.length;
+        char ac[] = new char[i * 2];
+        int j = 0;
+        for (int k = 0; k < i; k++) {
+            byte byte0 = abyte0[k];
+            ac[j++] = hexDigits[byte0 >>> 4 & 0xf];
+            ac[j++] = hexDigits[byte0 & 0xf];
+        }
+        return new String(ac);
+    }
+
+    private static final char hexDigits[] =
+
+            {
+                    '0', '1', '2', '3', '4', '5',
+                    '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'
+            };
+}

+ 203 - 0
src/main/java/com/jpsoft/making_friends/dto/utils/StringUtils.java

@@ -0,0 +1,203 @@
+package com.jpsoft.making_friends.dto.utils;
+
+import cn.hutool.core.util.StrUtil;
+
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+import java.text.MessageFormat;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.Locale;
+import java.util.Random;
+import java.util.UUID;
+
+/**
+ * 字符串工具类,继承lang3字符串工具类
+ * @author L.com
+ */
+public final class StringUtils extends org.apache.commons.lang3.StringUtils {
+
+	public static String encode(String str){
+		String encode=null;
+		try {
+			encode = URLEncoder.encode(str, "UTF-8");
+		} catch (UnsupportedEncodingException e) {
+			e.printStackTrace();
+		}
+		return encode;
+	}
+
+	/**
+	 * 获取UUID,去掉`-`的
+	 * @return {String}
+	 *
+	 */
+	public static String generateStr () {
+		return UUID.randomUUID().toString().replace("-", "");
+	}
+
+
+	/**
+	 * 要求外部订单号必须唯一。
+	 * @return {String}
+	 */
+	public synchronized static String getOutTradeNo() {
+		SimpleDateFormat format = new SimpleDateFormat("MMddHHmmss", Locale.getDefault());
+		Date date = new Date();
+		String key = format.format(date);
+		Integer ran = (int)((Math.random()*9+1)*100000);
+		key = key +ran.toString();
+	//	key = key.substring(0, 24);
+		return key;
+	}
+
+
+	/**
+	 * 审批编号生成。
+	 * @return {String}
+	 */
+	public synchronized static String getApprovalNo() {
+		SimpleDateFormat format = new SimpleDateFormat("MMddHHmmss", Locale.getDefault());
+		Date date = new Date();
+		String key = format.format(date);
+		Integer ran = (int)((Math.random()*9+1)*100000);
+		key = ran.toString() + key;
+		//	key = key.substring(0, 24);
+		return key;
+	}
+
+	/**
+	 * 字符串格式化
+	 *
+	 * use: format("my name is {0}, and i like {1}!", "L.cm", "java")
+	 *
+	 * int long use {0,number,#}
+	 *
+	 * @param s
+	 * @param args
+	 * @return {String}转换后的字符串
+	 */
+	public static String format(String s, Object... args) {
+		return MessageFormat.format(s, args);
+	}
+
+	/**
+	 * 替换某个字符
+	 * @param str
+	 * @param regex
+	 * @param args
+	 * @return {String}
+	 */
+	public static String replace(String str,String regex,String... args){
+		int length = args.length;
+		for (int i = 0; i < length; i++) {
+			str=str.replaceFirst(regex, args[i]);
+		}
+		return str;
+	}
+
+	/**
+	 * 清理字符串,清理出某些不可见字符
+	 * @param txt
+	 * @return {String}
+	 */
+	public static String cleanChars(String txt) {
+		return txt.replaceAll("[  	`·•�\\f\\t\\v]", "");
+	}
+
+	/**
+	 *  随机字符串
+	 */
+	private static final String INT_TEMP = "0123456789";
+	private static final String STR_TEMP = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
+	private static final String ALL_TEMP = INT_TEMP + STR_TEMP;
+
+	private static final Random RANDOM = new Random();
+
+	/**
+	 * 生成的随机数类型
+	 */
+	public enum RandomType {
+		/**
+		 * 整数
+		 */
+		INT,
+		/**
+		 * 字符串
+		 */
+		STRING,
+		/**
+		 * 所有类型
+		 */
+		ALL
+	}
+
+	/**
+	 * 随机数生成
+	 * @param count
+	 * @return {String}
+	 */
+	public static String random(int count, RandomType randomType) {
+		if (count == 0) {
+			return "";
+		}
+		if (count < 0) {
+			throw new IllegalArgumentException("Requested random string length " + count + " is less than 0.");
+		}
+		char[] buffer = new char[count];
+		for (int i = 0; i < count; i++) {
+			if (randomType.equals(RandomType.INT)) {
+				buffer[i] = INT_TEMP.charAt(RANDOM.nextInt(INT_TEMP.length()));
+			} else if (randomType.equals(RandomType.STRING)) {
+				buffer[i] = STR_TEMP.charAt(RANDOM.nextInt(STR_TEMP.length()));
+			}else {
+				buffer[i] = ALL_TEMP.charAt(RANDOM.nextInt(ALL_TEMP.length()));
+			}
+		}
+		return new String(buffer);
+	}
+
+	public static String strValue(Object object,String defaultValue) {
+		if (object!=null){
+			return String.valueOf(object);
+		}
+		else{
+			return defaultValue;
+		}
+	}
+
+	public static String toUnicode(String str) {
+		char[] chars = str.toCharArray();
+
+		StringBuilder sb = new StringBuilder();
+
+		for (int i = 0; i < chars.length; i++) {
+			sb.append(Integer.toString(chars[i], 16));
+		}
+
+		return sb.toString();
+	}
+
+
+	public static String getParkingUserNo(){
+
+		String n1 = random(4, RandomType.INT);
+		String a = String.valueOf (new Date().getTime()) ;
+
+		String b = StrUtil.sub(a,9,13);
+		String c = n1 + b;
+
+
+
+
+		return c;
+	}
+
+	public static void main(String[] args) {
+
+		String n = getParkingUserNo();
+
+		System.out.println(n);
+
+	}
+}

+ 93 - 0
src/main/java/com/jpsoft/making_friends/dto/utils/TimeZonesUtil.java

@@ -0,0 +1,93 @@
+package com.jpsoft.making_friends.dto.utils;
+
+/**
+ * @author 墨鱼_mo
+ * @date 2020-4-1 13:14
+ */
+public class TimeZonesUtil {
+    public static String getUpperTimeZone(String timeZones){
+        String timeZoneStr = timeZones.substring(0,timeZones.lastIndexOf("-")+1);
+        String minStr = timeZones.substring(timeZones.lastIndexOf("-")+1,timeZones.length());
+        String s = minStr.replace("",".");
+        Double minDou = Double.valueOf(s.substring(1,s.length()-1));
+        Double timeZoneMinDou = minDou;
+        String resultTimeZoneMinStr = "";
+        /*String timZoneMinStr = String.valueOf(timeZoneMinDou*10);
+        String resultTimeZoneMinStr = timZoneMinStr.substring(0,timZoneMinStr.indexOf("."));
+        if ("0".equals(resultTimeZoneMinStr)){
+            resultTimeZoneMinStr = resultTimeZoneMinStr+"0";
+        }*/
+        if (timeZoneMinDou.compareTo(0.5) ==-1){
+            resultTimeZoneMinStr ="00";
+        }
+        if (timeZoneMinDou.compareTo(0.5) !=-1 && timeZoneMinDou.compareTo(1.0) ==-1){
+            resultTimeZoneMinStr = "05";
+        }
+        if (timeZoneMinDou.compareTo(1.0) !=-1 && timeZoneMinDou.compareTo(1.5) ==-1){
+            resultTimeZoneMinStr = "10";
+        }
+        if (timeZoneMinDou.compareTo(1.5) !=-1 && timeZoneMinDou.compareTo(2.0) ==-1){
+            resultTimeZoneMinStr = "15";
+        }
+        if (timeZoneMinDou.compareTo(2.0) !=-1 && timeZoneMinDou.compareTo(2.5) ==-1){
+            resultTimeZoneMinStr = "20";
+        }
+        if (timeZoneMinDou.compareTo(2.5) !=-1 && timeZoneMinDou.compareTo(3.0) ==-1){
+            resultTimeZoneMinStr = "25";
+        }
+        if (timeZoneMinDou.compareTo(3.0) !=-1 && timeZoneMinDou.compareTo(3.5) ==-1){
+            resultTimeZoneMinStr = "30";
+        }
+        if (timeZoneMinDou.compareTo(3.5) !=-1 && timeZoneMinDou.compareTo(4.0) ==-1){
+            resultTimeZoneMinStr = "35";
+        }
+        if (timeZoneMinDou.compareTo(4.0) !=-1 && timeZoneMinDou.compareTo(4.5) ==-1){
+            resultTimeZoneMinStr = "40";
+        }
+        if (timeZoneMinDou.compareTo(4.5) !=-1 && timeZoneMinDou.compareTo(5.0) ==-1){
+            resultTimeZoneMinStr = "45";
+        }
+        if (timeZoneMinDou.compareTo(5.0) !=-1 && timeZoneMinDou.compareTo(5.5) ==-1){
+            resultTimeZoneMinStr = "50";
+        }
+        if (timeZoneMinDou.compareTo(5.5) !=-1 && timeZoneMinDou.compareTo(6.0) ==-1){
+            resultTimeZoneMinStr = "55";
+        }
+
+        String resultTimeZone = timeZoneStr + resultTimeZoneMinStr;
+
+        return resultTimeZone;
+    }
+
+    public static String parseSecond(Long second){
+        int h= Math.toIntExact(second / 3600);
+        int m= Math.toIntExact((second % 3600) / 60);
+        int s= Math.toIntExact((second % 3600) % 60);
+
+
+        return h+"时"+m+"分"+s+"秒";
+    }
+
+    public static String friendlyTimeFormat(long time){
+        long sec = 1000;
+        long min = 60*sec;
+
+        StringBuilder sb = new StringBuilder();
+
+        if (time>min) {
+            sb.append(String.format("%d分",time/min));
+        }
+
+        long remainder = time % min;
+
+        if (remainder>sec){
+            sb.append(String.format("%d秒",remainder/sec));
+        }
+
+        remainder = remainder % sec;
+
+        sb.append(String.format("%d毫秒",remainder));
+
+        return sb.toString();
+    }
+}

+ 60 - 0
src/main/java/com/jpsoft/making_friends/dto/utils/enterprise/AesException.java

@@ -0,0 +1,60 @@
+package com.jpsoft.making_friends.dto.utils.enterprise;
+
+/**
+ * @author 墨鱼_mo
+ * @date 2020-4-1 11:52
+ */
+public class AesException extends Exception{
+    public final static int OK = 0;
+    public final static int ValidateSignatureError = -40001;
+    public final static int ParseXmlError = -40002;
+    public final static int ComputeSignatureError = -40003;
+    public final static int IllegalAesKey = -40004;
+    public final static int ValidateCorpidError = -40005;
+    public final static int EncryptAESError = -40006;
+    public final static int DecryptAESError = -40007;
+    public final static int IllegalBuffer = -40008;
+    //public final static int EncodeBase64Error = -40009;
+    //public final static int DecodeBase64Error = -40010;
+    //public final static int GenReturnXmlError = -40011;
+
+    private int code;
+
+    private static String getMessage(int code) {
+        switch (code) {
+            case ValidateSignatureError:
+                return "签名验证错误";
+            case ParseXmlError:
+                return "xml解析失败";
+            case ComputeSignatureError:
+                return "sha加密生成签名失败";
+            case IllegalAesKey:
+                return "SymmetricKey非法";
+            case ValidateCorpidError:
+                return "corpid校验失败";
+            case EncryptAESError:
+                return "aes加密失败";
+            case DecryptAESError:
+                return "aes解密失败";
+            case IllegalBuffer:
+                return "解密后得到的buffer非法";
+//		case EncodeBase64Error:
+//			return "base64加密错误";
+//		case DecodeBase64Error:
+//			return "base64解密错误";
+//		case GenReturnXmlError:
+//			return "xml生成失败";
+            default:
+                return null; // cannot be
+        }
+    }
+
+    public int getCode() {
+        return code;
+    }
+
+    AesException(int code) {
+        super(getMessage(code));
+        this.code = code;
+    }
+}

+ 26 - 0
src/main/java/com/jpsoft/making_friends/dto/utils/enterprise/ByteGroup.java

@@ -0,0 +1,26 @@
+package com.jpsoft.making_friends.dto.utils.enterprise;
+
+import java.util.ArrayList;
+
+class ByteGroup {
+	ArrayList<Byte> byteContainer = new ArrayList<Byte>();
+
+	public byte[] toBytes() {
+		byte[] bytes = new byte[byteContainer.size()];
+		for (int i = 0; i < byteContainer.size(); i++) {
+			bytes[i] = byteContainer.get(i);
+		}
+		return bytes;
+	}
+
+	public com.jpsoft.making_friends.dto.utils.enterprise.ByteGroup addBytes(byte[] bytes) {
+		for (byte b : bytes) {
+			byteContainer.add(b);
+		}
+		return this;
+	}
+
+	public int size() {
+		return byteContainer.size();
+	}
+}

+ 67 - 0
src/main/java/com/jpsoft/making_friends/dto/utils/enterprise/PKCS7Encoder.java

@@ -0,0 +1,67 @@
+/**
+ * 对公众平台发送给公众账号的消息加解密示例代码.
+ *
+ * @copyright Copyright (c) 1998-2014 Tencent Inc.
+ */
+
+// ------------------------------------------------------------------------
+
+package com.jpsoft.making_friends.dto.utils.enterprise;
+
+import java.nio.charset.Charset;
+import java.util.Arrays;
+
+/**
+ * 提供基于PKCS7算法的加解密接口.
+ */
+class PKCS7Encoder {
+	static Charset CHARSET = Charset.forName("utf-8");
+	static int BLOCK_SIZE = 32;
+
+	/**
+	 * 获得对明文进行补位填充的字节.
+	 *
+	 * @param count 需要进行填充补位操作的明文字节个数
+	 * @return 补齐用的字节数组
+	 */
+	static byte[] encode(int count) {
+		// 计算需要填充的位数
+		int amountToPad = BLOCK_SIZE - (count % BLOCK_SIZE);
+		if (amountToPad == 0) {
+			amountToPad = BLOCK_SIZE;
+		}
+		// 获得补位所用的字符
+		char padChr = chr(amountToPad);
+		String tmp = new String();
+		for (int index = 0; index < amountToPad; index++) {
+			tmp += padChr;
+		}
+		return tmp.getBytes(CHARSET);
+	}
+
+	/**
+	 * 删除解密后明文的补位字符
+	 *
+	 * @param decrypted 解密后的明文
+	 * @return 删除补位字符后的明文
+	 */
+	static byte[] decode(byte[] decrypted) {
+		int pad = (int) decrypted[decrypted.length - 1];
+		if (pad < 1 || pad > 32) {
+			pad = 0;
+		}
+		return Arrays.copyOfRange(decrypted, 0, decrypted.length - pad);
+	}
+
+	/**
+	 * 将数字转化成ASCII码对应的字符,用于对明文进行补码
+	 *
+	 * @param a 需要转化的数字
+	 * @return 转化得到的字符
+	 */
+	static char chr(int a) {
+		byte target = (byte) (a & 0xFF);
+		return (char) target;
+	}
+
+}

+ 63 - 0
src/main/java/com/jpsoft/making_friends/dto/utils/enterprise/SHA1.java

@@ -0,0 +1,63 @@
+/**
+ * 对公众平台发送给公众账号的消息加解密示例代码.
+ *
+ * @copyright Copyright (c) 1998-2014 Tencent Inc.
+ */
+
+// ------------------------------------------------------------------------
+
+package com.jpsoft.making_friends.dto.utils.enterprise;
+
+import com.jpsoft.making_friends.dto.utils.enterprise.AesException;
+
+import java.security.MessageDigest;
+import java.util.Arrays;
+
+/**
+ * SHA1 class
+ *
+ * 计算公众平台的消息签名接口.
+ */
+class SHA1 {
+
+	/**
+	 * 用SHA1算法生成安全签名
+	 * @param token 票据
+	 * @param timestamp 时间戳
+	 * @param nonce 随机字符串
+	 * @param encrypt 密文
+	 * @return 安全签名
+	 * @throws AesException
+	 */
+	public static String getSHA1(String token, String timestamp, String nonce, String encrypt) throws AesException
+			  {
+		try {
+			String[] array = new String[] { token, timestamp, nonce, encrypt };
+			StringBuffer sb = new StringBuffer();
+			// 字符串排序
+			Arrays.sort(array);
+			for (int i = 0; i < 4; i++) {
+				sb.append(array[i]);
+			}
+			String str = sb.toString();
+			// SHA1签名生成
+			MessageDigest md = MessageDigest.getInstance("SHA-1");
+			md.update(str.getBytes());
+			byte[] digest = md.digest();
+
+			StringBuffer hexstr = new StringBuffer();
+			String shaHex = "";
+			for (int i = 0; i < digest.length; i++) {
+				shaHex = Integer.toHexString(digest[i] & 0xFF);
+				if (shaHex.length() < 2) {
+					hexstr.append(0);
+				}
+				hexstr.append(shaHex);
+			}
+			return hexstr.toString();
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw new AesException(AesException.ComputeSignatureError);
+		}
+	}
+}

+ 290 - 0
src/main/java/com/jpsoft/making_friends/dto/utils/enterprise/WXBizMsgCrypt.java

@@ -0,0 +1,290 @@
+package com.jpsoft.making_friends.dto.utils.enterprise; /**
+ * 对公众平台发送给公众账号的消息加解密示例代码.
+ *
+ * @copyright Copyright (c) 1998-2014 Tencent Inc.
+ */
+
+// ------------------------------------------------------------------------
+
+/**
+ * 针对org.apache.commons.codec.binary.Base64,
+ * 需要导入架包commons-codec-1.9(或commons-codec-1.8等其他版本)
+ * 官方下载地址:http://commons.apache.org/proper/commons-codec/download_codec.cgi
+ */
+
+
+import com.jpsoft.making_friends.dto.utils.enterprise.AesException;
+import org.apache.commons.codec.binary.Base64;
+
+import javax.crypto.Cipher;
+import javax.crypto.spec.IvParameterSpec;
+import javax.crypto.spec.SecretKeySpec;
+import java.nio.charset.Charset;
+import java.util.Arrays;
+import java.util.Random;
+
+
+/**
+ * 提供接收和推送给公众平台消息的加解密接口(UTF8编码的字符串).
+ * <ol>
+ * 	<li>第三方回复加密消息给公众平台</li>
+ * 	<li>第三方收到公众平台发送的消息,验证消息的安全性,并对消息进行解密。</li>
+ * </ol>
+ * 说明:异常java.security.InvalidKeyException:illegal Key Size的解决方案
+ * <ol>
+ * 	<li>在官方网站下载JCE无限制权限策略文件(JDK7的下载地址:
+ *      http://www.oracle.com/technetwork/java/javase/downloads/jce-7-download-432124.html</li>
+ * 	<li>下载后解压,可以看到local_policy.jar和US_export_policy.jar以及readme.txt</li>
+ * 	<li>如果安装了JRE,将两个jar文件放到%JRE_HOME%\lib\security目录下覆盖原来的文件</li>
+ * 	<li>如果安装了JDK,将两个jar文件放到%JDK_HOME%\jre\lib\security目录下覆盖原来文件</li>
+ * </ol>
+ */
+public class WXBizMsgCrypt {
+    static Charset CHARSET = Charset.forName("utf-8");
+    Base64 base64 = new Base64();
+    byte[] aesKey;
+    String token;
+    String corpId;
+
+    /**
+     * 构造函数
+     * @param token 公众平台上,开发者设置的token
+     * @param encodingAesKey 公众平台上,开发者设置的EncodingAESKey
+     * @param corpId 企业的corpid
+     *
+     * @throws AesException 执行失败,请查看该异常的错误码和具体的错误信息
+     */
+    public WXBizMsgCrypt(String token, String encodingAesKey, String corpId) throws AesException {
+        if (encodingAesKey.length() != 43) {
+            throw new AesException(AesException.IllegalAesKey);
+        }
+
+        this.token = token;
+        this.corpId = corpId;
+        aesKey = Base64.decodeBase64(encodingAesKey);
+    }
+
+    // 生成4个字节的网络字节序
+    byte[] getNetworkBytesOrder(int sourceNumber) {
+        byte[] orderBytes = new byte[4];
+        orderBytes[3] = (byte) (sourceNumber & 0xFF);
+        orderBytes[2] = (byte) (sourceNumber >> 8 & 0xFF);
+        orderBytes[1] = (byte) (sourceNumber >> 16 & 0xFF);
+        orderBytes[0] = (byte) (sourceNumber >> 24 & 0xFF);
+        return orderBytes;
+    }
+
+    // 还原4个字节的网络字节序
+    int recoverNetworkBytesOrder(byte[] orderBytes) {
+        int sourceNumber = 0;
+        for (int i = 0; i < 4; i++) {
+            sourceNumber <<= 8;
+            sourceNumber |= orderBytes[i] & 0xff;
+        }
+        return sourceNumber;
+    }
+
+    // 随机生成16位字符串
+    String getRandomStr() {
+        String base = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
+        Random random = new Random();
+        StringBuffer sb = new StringBuffer();
+        for (int i = 0; i < 16; i++) {
+            int number = random.nextInt(base.length());
+            sb.append(base.charAt(number));
+        }
+        return sb.toString();
+    }
+
+    /**
+     * 对明文进行加密.
+     *
+     * @param text 需要加密的明文
+     * @return 加密后base64编码的字符串
+     * @throws AesException aes加密失败
+     */
+    String encrypt(String randomStr, String text) throws AesException {
+        com.jpsoft.making_friends.dto.utils.enterprise.ByteGroup byteCollector = new com.jpsoft.making_friends.dto.utils.enterprise.ByteGroup();
+        byte[] randomStrBytes = randomStr.getBytes(CHARSET);
+        byte[] textBytes = text.getBytes(CHARSET);
+        byte[] networkBytesOrder = getNetworkBytesOrder(textBytes.length);
+        byte[] corpidBytes = corpId.getBytes(CHARSET);
+
+        // randomStr + networkBytesOrder + text + corpid
+        byteCollector.addBytes(randomStrBytes);
+        byteCollector.addBytes(networkBytesOrder);
+        byteCollector.addBytes(textBytes);
+        byteCollector.addBytes(corpidBytes);
+
+        // ... + pad: 使用自定义的填充方式对明文进行补位填充
+        byte[] padBytes = PKCS7Encoder.encode(byteCollector.size());
+        byteCollector.addBytes(padBytes);
+
+        // 获得最终的字节流, 未加密
+        byte[] unencrypted = byteCollector.toBytes();
+
+        try {
+            // 设置加密模式为AES的CBC模式
+            Cipher cipher = Cipher.getInstance("AES/CBC/NoPadding");
+            SecretKeySpec keySpec = new SecretKeySpec(aesKey, "AES");
+            IvParameterSpec iv = new IvParameterSpec(aesKey, 0, 16);
+            cipher.init(Cipher.ENCRYPT_MODE, keySpec, iv);
+
+            // 加密
+            byte[] encrypted = cipher.doFinal(unencrypted);
+
+            // 使用BASE64对加密后的字符串进行编码
+            String base64Encrypted = base64.encodeToString(encrypted);
+
+            return base64Encrypted;
+        } catch (Exception e) {
+            e.printStackTrace();
+            throw new AesException(AesException.EncryptAESError);
+        }
+    }
+
+    /**
+     * 对密文进行解密.
+     *
+     * @param text 需要解密的密文
+     * @return 解密得到的明文
+     * @throws AesException aes解密失败
+     */
+    String decrypt(String text) throws AesException {
+        byte[] original;
+        try {
+            // 设置解密模式为AES的CBC模式
+            Cipher cipher = Cipher.getInstance("AES/CBC/NoPadding");
+            SecretKeySpec key_spec = new SecretKeySpec(aesKey, "AES");
+            IvParameterSpec iv = new IvParameterSpec(Arrays.copyOfRange(aesKey, 0, 16));
+            cipher.init(Cipher.DECRYPT_MODE, key_spec, iv);
+
+            // 使用BASE64对密文进行解码
+            byte[] encrypted = Base64.decodeBase64(text);
+
+            // 解密
+            original = cipher.doFinal(encrypted);
+        } catch (Exception e) {
+            e.printStackTrace();
+            throw new AesException(AesException.DecryptAESError);
+        }
+
+        String xmlContent, from_corpid;
+        try {
+            // 去除补位字符
+            byte[] bytes = PKCS7Encoder.decode(original);
+
+            // 分离16位随机字符串,网络字节序和corpId
+            byte[] networkOrder = Arrays.copyOfRange(bytes, 16, 20);
+
+            int xmlLength = recoverNetworkBytesOrder(networkOrder);
+
+            xmlContent = new String(Arrays.copyOfRange(bytes, 20, 20 + xmlLength), CHARSET);
+            from_corpid = new String(Arrays.copyOfRange(bytes, 20 + xmlLength, bytes.length),
+                    CHARSET);
+        } catch (Exception e) {
+            e.printStackTrace();
+            throw new AesException(AesException.IllegalBuffer);
+        }
+
+        // corpid不相同的情况
+        if (!from_corpid.equals(corpId)) {
+            throw new AesException(AesException.ValidateCorpidError);
+        }
+        return xmlContent;
+
+    }
+
+    /**
+     * 将公众平台回复用户的消息加密打包.
+     * <ol>
+     * 	<li>对要发送的消息进行AES-CBC加密</li>
+     * 	<li>生成安全签名</li>
+     * 	<li>将消息密文和安全签名打包成xml格式</li>
+     * </ol>
+     *
+     * @param replyMsg 公众平台待回复用户的消息,xml格式的字符串
+     * @param timeStamp 时间戳,可以自己生成,也可以用URL参数的timestamp
+     * @param nonce 随机串,可以自己生成,也可以用URL参数的nonce
+     *
+     * @return 加密后的可以直接回复用户的密文,包括msg_signature, timestamp, nonce, encrypt的xml格式的字符串
+     * @throws AesException 执行失败,请查看该异常的错误码和具体的错误信息
+     */
+    public String EncryptMsg(String replyMsg, String timeStamp, String nonce) throws AesException {
+        // 加密
+        String encrypt = encrypt(getRandomStr(), replyMsg);
+
+        // 生成安全签名
+        if (timeStamp == "") {
+            timeStamp = Long.toString(System.currentTimeMillis());
+        }
+
+        String signature = com.jpsoft.making_friends.dto.utils.enterprise.SHA1.getSHA1(token, timeStamp, nonce, encrypt);
+
+        // System.out.println("发送给平台的签名是: " + signature[1].toString());
+        // 生成发送的xml
+        String result = XMLParse.generate(encrypt, signature, timeStamp, nonce);
+        return result;
+    }
+
+    /**
+     * 检验消息的真实性,并且获取解密后的明文.
+     * <ol>
+     * 	<li>利用收到的密文生成安全签名,进行签名验证</li>
+     * 	<li>若验证通过,则提取xml中的加密消息</li>
+     * 	<li>对消息进行解密</li>
+     * </ol>
+     *
+     * @param msgSignature 签名串,对应URL参数的msg_signature
+     * @param timeStamp 时间戳,对应URL参数的timestamp
+     * @param nonce 随机串,对应URL参数的nonce
+     * @param postData 密文,对应POST请求的数据
+     *
+     * @return 解密后的原文
+     * @throws AesException 执行失败,请查看该异常的错误码和具体的错误信息
+     */
+    public String DecryptMsg(String msgSignature, String timeStamp, String nonce, String postData)
+            throws AesException {
+
+        // 密钥,公众账号的app secret
+        // 提取密文
+        Object[] encrypt = XMLParse.extract(postData);
+
+        // 验证安全签名
+        String signature = com.jpsoft.making_friends.dto.utils.enterprise.SHA1.getSHA1(token, timeStamp, nonce, encrypt[1].toString());
+
+        // 和URL中的签名比较是否相等
+        // System.out.println("第三方收到URL中的签名:" + msg_sign);
+        // System.out.println("第三方校验签名:" + signature);
+        if (!signature.equals(msgSignature)) {
+            throw new AesException(AesException.ValidateSignatureError);
+        }
+
+        // 解密
+        String result = decrypt(encrypt[1].toString());
+        return result;
+    }
+
+    /**
+     * 验证URL
+     * @param msgSignature 签名串,对应URL参数的msg_signature
+     * @param timeStamp 时间戳,对应URL参数的timestamp
+     * @param nonce 随机串,对应URL参数的nonce
+     * @param echoStr 随机串,对应URL参数的echostr
+     *
+     * @return 解密之后的echostr
+     * @throws AesException 执行失败,请查看该异常的错误码和具体的错误信息
+     */
+    public String VerifyURL(String msgSignature, String timeStamp, String nonce, String echoStr)
+            throws AesException {
+        String signature = com.jpsoft.making_friends.dto.utils.enterprise.SHA1.getSHA1(token, timeStamp, nonce, echoStr);
+
+        if (!signature.equals(msgSignature)) {
+            throw new AesException(AesException.ValidateSignatureError);
+        }
+
+        String result = decrypt(echoStr);
+        return result;
+    }
+
+}

+ 72 - 0
src/main/java/com/jpsoft/making_friends/dto/utils/enterprise/XMLParse.java

@@ -0,0 +1,72 @@
+/**
+ * 对公众平台发送给公众账号的消息加解密示例代码.
+ *
+ * @copyright Copyright (c) 1998-2014 Tencent Inc.
+ */
+
+// ------------------------------------------------------------------------
+
+package com.jpsoft.making_friends.dto.utils.enterprise;
+
+import com.jpsoft.making_friends.dto.utils.enterprise.AesException;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+import org.xml.sax.InputSource;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import java.io.StringReader;
+
+/**
+ * XMLParse class
+ *
+ * 提供提取消息格式中的密文及生成回复消息格式的接口.
+ */
+class XMLParse {
+
+	/**
+	 * 提取出xml数据包中的加密消息
+	 * @param xmltext 待提取的xml字符串
+	 * @return 提取出的加密消息字符串
+	 * @throws AesException
+	 */
+	public static Object[] extract(String xmltext) throws AesException {
+		Object[] result = new Object[3];
+		try {
+			DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+			DocumentBuilder db = dbf.newDocumentBuilder();
+			StringReader sr = new StringReader(xmltext);
+			InputSource is = new InputSource(sr);
+			Document document = db.parse(is);
+
+			Element root = document.getDocumentElement();
+			NodeList nodelist1 = root.getElementsByTagName("Encrypt");
+			NodeList nodelist2 = root.getElementsByTagName("ToUserName");
+			result[0] = 0;
+			result[1] = nodelist1.item(0).getTextContent();
+			result[2] = nodelist2.item(0).getTextContent();
+			return result;
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw new AesException(AesException.ParseXmlError);
+		}
+	}
+
+	/**
+	 * 生成xml消息
+	 * @param encrypt 加密后的消息密文
+	 * @param signature 安全签名
+	 * @param timestamp 时间戳
+	 * @param nonce 随机字符串
+	 * @return 生成的xml字符串
+	 */
+	public static String generate(String encrypt, String signature, String timestamp, String nonce) {
+
+		String format = "<xml>\n" + "<Encrypt><![CDATA[%1$s]]></Encrypt>\n"
+				+ "<MsgSignature><![CDATA[%2$s]]></MsgSignature>\n"
+				+ "<TimeStamp>%3$s</TimeStamp>\n" + "<Nonce><![CDATA[%4$s]]></Nonce>\n" + "</xml>";
+		return String.format(format, encrypt, signature, timestamp, nonce);
+
+	}
+}

+ 117 - 0
src/main/java/com/jpsoft/making_friends/entity/base/HobbyInfo.java

@@ -0,0 +1,117 @@
+package com.jpsoft.making_friends.entity.base;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.text.SimpleDateFormat;
+import java.math.BigDecimal;
+import org.springframework.format.annotation.DateTimeFormat;
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+/**
+  描述:base_hobby_info的实体类
+ */
+public class HobbyInfo {
+	private String id;
+	private String name;
+	private Date createTime;
+	private Date updateTime;
+	private Boolean delFlag;
+	private String createBy;
+	private String updateBy;
+	
+		/**
+	 *获取ID
+	 */
+	public String getId(){
+		return id;
+	}
+	
+	/**
+	 *设置ID
+	 */
+	public void setId(String id){
+		this.id = id;
+	}
+		/**
+	 *获取兴趣名称
+	 */
+	public String getName(){
+		return name;
+	}
+	
+	/**
+	 *设置兴趣名称
+	 */
+	public void setName(String name){
+		this.name = name;
+	}
+		@DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
+		/**
+	 *获取创建时间
+	 */
+	public Date getCreateTime(){
+		return createTime;
+	}
+	
+	/**
+	 *设置创建时间
+	 */
+	public void setCreateTime(Date createTime){
+		this.createTime = createTime;
+	}
+		@DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
+		/**
+	 *获取更新时间
+	 */
+	public Date getUpdateTime(){
+		return updateTime;
+	}
+	
+	/**
+	 *设置更新时间
+	 */
+	public void setUpdateTime(Date updateTime){
+		this.updateTime = updateTime;
+	}
+		/**
+	 *获取删除标示
+	 */
+	public Boolean getDelFlag(){
+		return delFlag;
+	}
+	
+	/**
+	 *设置删除标示
+	 */
+	public void setDelFlag(Boolean delFlag){
+		this.delFlag = delFlag;
+	}
+		/**
+	 *获取创建人
+	 */
+	public String getCreateBy(){
+		return createBy;
+	}
+	
+	/**
+	 *设置创建人
+	 */
+	public void setCreateBy(String createBy){
+		this.createBy = createBy;
+	}
+		/**
+	 *获取更新人
+	 */
+	public String getUpdateBy(){
+		return updateBy;
+	}
+	
+	/**
+	 *设置更新人
+	 */
+	public void setUpdateBy(String updateBy){
+		this.updateBy = updateBy;
+	}
+}

+ 131 - 0
src/main/java/com/jpsoft/making_friends/entity/base/MemberHobby.java

@@ -0,0 +1,131 @@
+package com.jpsoft.making_friends.entity.base;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.text.SimpleDateFormat;
+import java.math.BigDecimal;
+import org.springframework.format.annotation.DateTimeFormat;
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+/**
+  描述:base_member_hobby的实体类
+ */
+public class MemberHobby {
+	private String id;
+	private String memberId;
+	private String hobbyId;
+	private Date createTime;
+	private Date updateTime;
+	private Boolean delFlag;
+	private String createBy;
+	private String updateBy;
+	
+		/**
+	 *获取ID
+	 */
+	public String getId(){
+		return id;
+	}
+	
+	/**
+	 *设置ID
+	 */
+	public void setId(String id){
+		this.id = id;
+	}
+		/**
+	 *获取会员ID
+	 */
+	public String getMemberId(){
+		return memberId;
+	}
+	
+	/**
+	 *设置会员ID
+	 */
+	public void setMemberId(String memberId){
+		this.memberId = memberId;
+	}
+		/**
+	 *获取兴趣爱好ID
+	 */
+	public String getHobbyId(){
+		return hobbyId;
+	}
+	
+	/**
+	 *设置兴趣爱好ID
+	 */
+	public void setHobbyId(String hobbyId){
+		this.hobbyId = hobbyId;
+	}
+		@DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
+		/**
+	 *获取创建时间
+	 */
+	public Date getCreateTime(){
+		return createTime;
+	}
+	
+	/**
+	 *设置创建时间
+	 */
+	public void setCreateTime(Date createTime){
+		this.createTime = createTime;
+	}
+		@DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
+		/**
+	 *获取更新时间
+	 */
+	public Date getUpdateTime(){
+		return updateTime;
+	}
+	
+	/**
+	 *设置更新时间
+	 */
+	public void setUpdateTime(Date updateTime){
+		this.updateTime = updateTime;
+	}
+		/**
+	 *获取删除标示
+	 */
+	public Boolean getDelFlag(){
+		return delFlag;
+	}
+	
+	/**
+	 *设置删除标示
+	 */
+	public void setDelFlag(Boolean delFlag){
+		this.delFlag = delFlag;
+	}
+		/**
+	 *获取创建人
+	 */
+	public String getCreateBy(){
+		return createBy;
+	}
+	
+	/**
+	 *设置创建人
+	 */
+	public void setCreateBy(String createBy){
+		this.createBy = createBy;
+	}
+		/**
+	 *获取更新人
+	 */
+	public String getUpdateBy(){
+		return updateBy;
+	}
+	
+	/**
+	 *设置更新人
+	 */
+	public void setUpdateBy(String updateBy){
+		this.updateBy = updateBy;
+	}
+}

+ 539 - 0
src/main/java/com/jpsoft/making_friends/entity/base/MemberInfo.java

@@ -0,0 +1,539 @@
+package com.jpsoft.making_friends.entity.base;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.text.SimpleDateFormat;
+import java.math.BigDecimal;
+import org.springframework.format.annotation.DateTimeFormat;
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+/**
+  描述:base_member_info的实体类
+ */
+public class MemberInfo {
+	private String id;
+	private String faceImage;
+	private String idCard;
+	private String phone;
+	private String password;
+	private String orgId;
+	private Boolean gender;
+	private String birthday;
+	private BigDecimal height;
+	private BigDecimal weight;
+	private String birthplace;
+	private String registeredResidence;
+	private String workplace;
+	private String education;
+	private String industry;
+	private String workUnit;
+	private String post;
+	private String salaryRange;
+	private String housingSituation;
+	private String maritalStatus;
+	private String childStatus;
+	private String selfEvaluation;
+	private Date createTime;
+	private Date updateTime;
+	private Boolean delFlag;
+	private String createBy;
+	private String updateBy;
+	private String taAgeRange;
+	private String taEdu;
+	private String taIncomeRange;
+	private String taOccupation;
+	private String taWorkplace;
+	private String taOther;
+	private String status;
+	private String reviewer;
+	private Date revieTime;
+	private Boolean publicNot;
+	
+		/**
+	 *获取ID
+	 */
+	public String getId(){
+		return id;
+	}
+	
+	/**
+	 *设置ID
+	 */
+	public void setId(String id){
+		this.id = id;
+	}
+		/**
+	 *获取头像
+	 */
+	public String getFaceImage(){
+		return faceImage;
+	}
+	
+	/**
+	 *设置头像
+	 */
+	public void setFaceImage(String faceImage){
+		this.faceImage = faceImage;
+	}
+		/**
+	 *获取身份证号
+	 */
+	public String getIdCard(){
+		return idCard;
+	}
+	
+	/**
+	 *设置身份证号
+	 */
+	public void setIdCard(String idCard){
+		this.idCard = idCard;
+	}
+		/**
+	 *获取手机号码
+	 */
+	public String getPhone(){
+		return phone;
+	}
+	
+	/**
+	 *设置手机号码
+	 */
+	public void setPhone(String phone){
+		this.phone = phone;
+	}
+		/**
+	 *获取密码
+	 */
+	public String getPassword(){
+		return password;
+	}
+	
+	/**
+	 *设置密码
+	 */
+	public void setPassword(String password){
+		this.password = password;
+	}
+		/**
+	 *获取工会ID
+	 */
+	public String getOrgId(){
+		return orgId;
+	}
+	
+	/**
+	 *设置工会ID
+	 */
+	public void setOrgId(String orgId){
+		this.orgId = orgId;
+	}
+		/**
+	 *获取性别(0:男,1:女)
+	 */
+	public Boolean getGender(){
+		return gender;
+	}
+	
+	/**
+	 *设置性别(0:男,1:女)
+	 */
+	public void setGender(Boolean gender){
+		this.gender = gender;
+	}
+		/**
+	 *获取出生日期
+	 */
+	public String getBirthday(){
+		return birthday;
+	}
+	
+	/**
+	 *设置出生日期
+	 */
+	public void setBirthday(String birthday){
+		this.birthday = birthday;
+	}
+		/**
+	 *获取身高
+	 */
+	public BigDecimal getHeight(){
+		return height;
+	}
+	
+	/**
+	 *设置身高
+	 */
+	public void setHeight(BigDecimal height){
+		this.height = height;
+	}
+		/**
+	 *获取体重
+	 */
+	public BigDecimal getWeight(){
+		return weight;
+	}
+	
+	/**
+	 *设置体重
+	 */
+	public void setWeight(BigDecimal weight){
+		this.weight = weight;
+	}
+		/**
+	 *获取出生地
+	 */
+	public String getBirthplace(){
+		return birthplace;
+	}
+	
+	/**
+	 *设置出生地
+	 */
+	public void setBirthplace(String birthplace){
+		this.birthplace = birthplace;
+	}
+		/**
+	 *获取户口所在地
+	 */
+	public String getRegisteredResidence(){
+		return registeredResidence;
+	}
+	
+	/**
+	 *设置户口所在地
+	 */
+	public void setRegisteredResidence(String registeredResidence){
+		this.registeredResidence = registeredResidence;
+	}
+		/**
+	 *获取工作所在地
+	 */
+	public String getWorkplace(){
+		return workplace;
+	}
+	
+	/**
+	 *设置工作所在地
+	 */
+	public void setWorkplace(String workplace){
+		this.workplace = workplace;
+	}
+		/**
+	 *获取学历
+	 */
+	public String getEducation(){
+		return education;
+	}
+	
+	/**
+	 *设置学历
+	 */
+	public void setEducation(String education){
+		this.education = education;
+	}
+		/**
+	 *获取行业
+	 */
+	public String getIndustry(){
+		return industry;
+	}
+	
+	/**
+	 *设置行业
+	 */
+	public void setIndustry(String industry){
+		this.industry = industry;
+	}
+		/**
+	 *获取工作单位
+	 */
+	public String getWorkUnit(){
+		return workUnit;
+	}
+	
+	/**
+	 *设置工作单位
+	 */
+	public void setWorkUnit(String workUnit){
+		this.workUnit = workUnit;
+	}
+		/**
+	 *获取我的岗位
+	 */
+	public String getPost(){
+		return post;
+	}
+	
+	/**
+	 *设置我的岗位
+	 */
+	public void setPost(String post){
+		this.post = post;
+	}
+		/**
+	 *获取薪资范围
+	 */
+	public String getSalaryRange(){
+		return salaryRange;
+	}
+	
+	/**
+	 *设置薪资范围
+	 */
+	public void setSalaryRange(String salaryRange){
+		this.salaryRange = salaryRange;
+	}
+		/**
+	 *获取住房情况
+	 */
+	public String getHousingSituation(){
+		return housingSituation;
+	}
+	
+	/**
+	 *设置住房情况
+	 */
+	public void setHousingSituation(String housingSituation){
+		this.housingSituation = housingSituation;
+	}
+		/**
+	 *获取婚姻状况
+	 */
+	public String getMaritalStatus(){
+		return maritalStatus;
+	}
+	
+	/**
+	 *设置婚姻状况
+	 */
+	public void setMaritalStatus(String maritalStatus){
+		this.maritalStatus = maritalStatus;
+	}
+		/**
+	 *获取子女状况
+	 */
+	public String getChildStatus(){
+		return childStatus;
+	}
+	
+	/**
+	 *设置子女状况
+	 */
+	public void setChildStatus(String childStatus){
+		this.childStatus = childStatus;
+	}
+		/**
+	 *获取自我评价
+	 */
+	public String getSelfEvaluation(){
+		return selfEvaluation;
+	}
+	
+	/**
+	 *设置自我评价
+	 */
+	public void setSelfEvaluation(String selfEvaluation){
+		this.selfEvaluation = selfEvaluation;
+	}
+		@DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
+		/**
+	 *获取创建时间
+	 */
+	public Date getCreateTime(){
+		return createTime;
+	}
+	
+	/**
+	 *设置创建时间
+	 */
+	public void setCreateTime(Date createTime){
+		this.createTime = createTime;
+	}
+		@DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
+		/**
+	 *获取更新时间
+	 */
+	public Date getUpdateTime(){
+		return updateTime;
+	}
+	
+	/**
+	 *设置更新时间
+	 */
+	public void setUpdateTime(Date updateTime){
+		this.updateTime = updateTime;
+	}
+		/**
+	 *获取删除标示
+	 */
+	public Boolean getDelFlag(){
+		return delFlag;
+	}
+	
+	/**
+	 *设置删除标示
+	 */
+	public void setDelFlag(Boolean delFlag){
+		this.delFlag = delFlag;
+	}
+		/**
+	 *获取创建人
+	 */
+	public String getCreateBy(){
+		return createBy;
+	}
+	
+	/**
+	 *设置创建人
+	 */
+	public void setCreateBy(String createBy){
+		this.createBy = createBy;
+	}
+		/**
+	 *获取更新人
+	 */
+	public String getUpdateBy(){
+		return updateBy;
+	}
+	
+	/**
+	 *设置更新人
+	 */
+	public void setUpdateBy(String updateBy){
+		this.updateBy = updateBy;
+	}
+		/**
+	 *获取ta的年龄范围
+	 */
+	public String getTaAgeRange(){
+		return taAgeRange;
+	}
+	
+	/**
+	 *设置ta的年龄范围
+	 */
+	public void setTaAgeRange(String taAgeRange){
+		this.taAgeRange = taAgeRange;
+	}
+		/**
+	 *获取ta的学历
+	 */
+	public String getTaEdu(){
+		return taEdu;
+	}
+	
+	/**
+	 *设置ta的学历
+	 */
+	public void setTaEdu(String taEdu){
+		this.taEdu = taEdu;
+	}
+		/**
+	 *获取ta的收入范围
+	 */
+	public String getTaIncomeRange(){
+		return taIncomeRange;
+	}
+	
+	/**
+	 *设置ta的收入范围
+	 */
+	public void setTaIncomeRange(String taIncomeRange){
+		this.taIncomeRange = taIncomeRange;
+	}
+		/**
+	 *获取ta的职业
+	 */
+	public String getTaOccupation(){
+		return taOccupation;
+	}
+	
+	/**
+	 *设置ta的职业
+	 */
+	public void setTaOccupation(String taOccupation){
+		this.taOccupation = taOccupation;
+	}
+		/**
+	 *获取ta的工作地
+	 */
+	public String getTaWorkplace(){
+		return taWorkplace;
+	}
+	
+	/**
+	 *设置ta的工作地
+	 */
+	public void setTaWorkplace(String taWorkplace){
+		this.taWorkplace = taWorkplace;
+	}
+		/**
+	 *获取其他要求
+	 */
+	public String getTaOther(){
+		return taOther;
+	}
+	
+	/**
+	 *设置其他要求
+	 */
+	public void setTaOther(String taOther){
+		this.taOther = taOther;
+	}
+		/**
+	 *获取审核状态(0:未审核,1:已审核,2:审核不通过)
+	 */
+	public String getStatus(){
+		return status;
+	}
+	
+	/**
+	 *设置审核状态(0:未审核,1:已审核,2:审核不通过)
+	 */
+	public void setStatus(String status){
+		this.status = status;
+	}
+		/**
+	 *获取审核人
+	 */
+	public String getReviewer(){
+		return reviewer;
+	}
+	
+	/**
+	 *设置审核人
+	 */
+	public void setReviewer(String reviewer){
+		this.reviewer = reviewer;
+	}
+		@DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
+		/**
+	 *获取审核时间
+	 */
+	public Date getRevieTime(){
+		return revieTime;
+	}
+	
+	/**
+	 *设置审核时间
+	 */
+	public void setRevieTime(Date revieTime){
+		this.revieTime = revieTime;
+	}
+		/**
+	 *获取是否公开(0:不公开,1:公开)
+	 */
+	public Boolean getPublicNot(){
+		return publicNot;
+	}
+	
+	/**
+	 *设置是否公开(0:不公开,1:公开)
+	 */
+	public void setPublicNot(Boolean publicNot){
+		this.publicNot = publicNot;
+	}
+}

+ 187 - 0
src/main/java/com/jpsoft/making_friends/entity/base/NewsInfo.java

@@ -0,0 +1,187 @@
+package com.jpsoft.making_friends.entity.base;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.text.SimpleDateFormat;
+import java.math.BigDecimal;
+import org.springframework.format.annotation.DateTimeFormat;
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+/**
+  描述:base_news_info的实体类
+ */
+public class NewsInfo {
+	private String id;
+	private String newsTypeId;
+	private String title;
+	private String content;
+	private String images;
+	private Integer visitorsNum;
+	private String author;
+	private Date createTime;
+	private Date updateTime;
+	private Boolean delFlag;
+	private String createBy;
+	private String updateBy;
+	
+		/**
+	 *获取ID
+	 */
+	public String getId(){
+		return id;
+	}
+	
+	/**
+	 *设置ID
+	 */
+	public void setId(String id){
+		this.id = id;
+	}
+		/**
+	 *获取新闻类型ID
+	 */
+	public String getNewsTypeId(){
+		return newsTypeId;
+	}
+	
+	/**
+	 *设置新闻类型ID
+	 */
+	public void setNewsTypeId(String newsTypeId){
+		this.newsTypeId = newsTypeId;
+	}
+		/**
+	 *获取新闻标题
+	 */
+	public String getTitle(){
+		return title;
+	}
+	
+	/**
+	 *设置新闻标题
+	 */
+	public void setTitle(String title){
+		this.title = title;
+	}
+		/**
+	 *获取新闻内容
+	 */
+	public String getContent(){
+		return content;
+	}
+	
+	/**
+	 *设置新闻内容
+	 */
+	public void setContent(String content){
+		this.content = content;
+	}
+		/**
+	 *获取新闻图片集
+	 */
+	public String getImages(){
+		return images;
+	}
+	
+	/**
+	 *设置新闻图片集
+	 */
+	public void setImages(String images){
+		this.images = images;
+	}
+		/**
+	 *获取浏览人数
+	 */
+	public Integer getVisitorsNum(){
+		return visitorsNum;
+	}
+	
+	/**
+	 *设置浏览人数
+	 */
+	public void setVisitorsNum(Integer visitorsNum){
+		this.visitorsNum = visitorsNum;
+	}
+		/**
+	 *获取作者
+	 */
+	public String getAuthor(){
+		return author;
+	}
+	
+	/**
+	 *设置作者
+	 */
+	public void setAuthor(String author){
+		this.author = author;
+	}
+		@DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
+		/**
+	 *获取创建时间
+	 */
+	public Date getCreateTime(){
+		return createTime;
+	}
+	
+	/**
+	 *设置创建时间
+	 */
+	public void setCreateTime(Date createTime){
+		this.createTime = createTime;
+	}
+		@DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
+		/**
+	 *获取更新时间
+	 */
+	public Date getUpdateTime(){
+		return updateTime;
+	}
+	
+	/**
+	 *设置更新时间
+	 */
+	public void setUpdateTime(Date updateTime){
+		this.updateTime = updateTime;
+	}
+		/**
+	 *获取删除标示
+	 */
+	public Boolean getDelFlag(){
+		return delFlag;
+	}
+	
+	/**
+	 *设置删除标示
+	 */
+	public void setDelFlag(Boolean delFlag){
+		this.delFlag = delFlag;
+	}
+		/**
+	 *获取创建人
+	 */
+	public String getCreateBy(){
+		return createBy;
+	}
+	
+	/**
+	 *设置创建人
+	 */
+	public void setCreateBy(String createBy){
+		this.createBy = createBy;
+	}
+		/**
+	 *获取更新人
+	 */
+	public String getUpdateBy(){
+		return updateBy;
+	}
+	
+	/**
+	 *设置更新人
+	 */
+	public void setUpdateBy(String updateBy){
+		this.updateBy = updateBy;
+	}
+}

+ 117 - 0
src/main/java/com/jpsoft/making_friends/entity/base/NewsType.java

@@ -0,0 +1,117 @@
+package com.jpsoft.making_friends.entity.base;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.text.SimpleDateFormat;
+import java.math.BigDecimal;
+import org.springframework.format.annotation.DateTimeFormat;
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+/**
+  描述:base_news_type的实体类
+ */
+public class NewsType {
+	private String id;
+	private String name;
+	private Date createTime;
+	private Date updateTime;
+	private Boolean delFlag;
+	private String createBy;
+	private String updateBy;
+	
+		/**
+	 *获取ID
+	 */
+	public String getId(){
+		return id;
+	}
+	
+	/**
+	 *设置ID
+	 */
+	public void setId(String id){
+		this.id = id;
+	}
+		/**
+	 *获取列表名称
+	 */
+	public String getName(){
+		return name;
+	}
+	
+	/**
+	 *设置列表名称
+	 */
+	public void setName(String name){
+		this.name = name;
+	}
+		@DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
+		/**
+	 *获取创建时间
+	 */
+	public Date getCreateTime(){
+		return createTime;
+	}
+	
+	/**
+	 *设置创建时间
+	 */
+	public void setCreateTime(Date createTime){
+		this.createTime = createTime;
+	}
+		@DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
+		/**
+	 *获取更新时间
+	 */
+	public Date getUpdateTime(){
+		return updateTime;
+	}
+	
+	/**
+	 *设置更新时间
+	 */
+	public void setUpdateTime(Date updateTime){
+		this.updateTime = updateTime;
+	}
+		/**
+	 *获取删除标示
+	 */
+	public Boolean getDelFlag(){
+		return delFlag;
+	}
+	
+	/**
+	 *设置删除标示
+	 */
+	public void setDelFlag(Boolean delFlag){
+		this.delFlag = delFlag;
+	}
+		/**
+	 *获取创建人
+	 */
+	public String getCreateBy(){
+		return createBy;
+	}
+	
+	/**
+	 *设置创建人
+	 */
+	public void setCreateBy(String createBy){
+		this.createBy = createBy;
+	}
+		/**
+	 *获取更新人
+	 */
+	public String getUpdateBy(){
+		return updateBy;
+	}
+	
+	/**
+	 *设置更新人
+	 */
+	public void setUpdateBy(String updateBy){
+		this.updateBy = updateBy;
+	}
+}

+ 117 - 0
src/main/java/com/jpsoft/making_friends/entity/base/OrgInfo.java

@@ -0,0 +1,117 @@
+package com.jpsoft.making_friends.entity.base;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.text.SimpleDateFormat;
+import java.math.BigDecimal;
+import org.springframework.format.annotation.DateTimeFormat;
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+/**
+  描述:base_org_info的实体类
+ */
+public class OrgInfo {
+	private String id;
+	private String name;
+	private Date createTime;
+	private Date updateTime;
+	private Boolean delFlag;
+	private String createBy;
+	private String updateBy;
+	
+		/**
+	 *获取ID
+	 */
+	public String getId(){
+		return id;
+	}
+	
+	/**
+	 *设置ID
+	 */
+	public void setId(String id){
+		this.id = id;
+	}
+		/**
+	 *获取工会名称
+	 */
+	public String getName(){
+		return name;
+	}
+	
+	/**
+	 *设置工会名称
+	 */
+	public void setName(String name){
+		this.name = name;
+	}
+		@DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
+		/**
+	 *获取创建时间
+	 */
+	public Date getCreateTime(){
+		return createTime;
+	}
+	
+	/**
+	 *设置创建时间
+	 */
+	public void setCreateTime(Date createTime){
+		this.createTime = createTime;
+	}
+		@DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
+		/**
+	 *获取更新时间
+	 */
+	public Date getUpdateTime(){
+		return updateTime;
+	}
+	
+	/**
+	 *设置更新时间
+	 */
+	public void setUpdateTime(Date updateTime){
+		this.updateTime = updateTime;
+	}
+		/**
+	 *获取删除标示
+	 */
+	public Boolean getDelFlag(){
+		return delFlag;
+	}
+	
+	/**
+	 *设置删除标示
+	 */
+	public void setDelFlag(Boolean delFlag){
+		this.delFlag = delFlag;
+	}
+		/**
+	 *获取创建人
+	 */
+	public String getCreateBy(){
+		return createBy;
+	}
+	
+	/**
+	 *设置创建人
+	 */
+	public void setCreateBy(String createBy){
+		this.createBy = createBy;
+	}
+		/**
+	 *获取更新人
+	 */
+	public String getUpdateBy(){
+		return updateBy;
+	}
+	
+	/**
+	 *设置更新人
+	 */
+	public void setUpdateBy(String updateBy){
+		this.updateBy = updateBy;
+	}
+}

+ 203 - 0
src/main/java/com/jpsoft/making_friends/entity/sys/DataDictionary.java

@@ -0,0 +1,203 @@
+package com.jpsoft.making_friends.entity.sys;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+/**
+  描述:sys_data_dictionary的实体类
+ */
+public class DataDictionary {
+	private String id;
+	private String name;
+	private String value;
+	private Integer sortNo;
+	private String parentName;
+	private String parentId;
+	private String dataType;
+	private String createBy;
+	private Date createDate;
+	private String updateBy;
+	private Date updateDate;
+	private Boolean activated;
+	private Boolean delFlag;
+	/*private List<DataDictionary> children;*/
+		/**
+	 *获取编号
+	 */
+	public String getId(){
+		return id;
+	}
+	
+	/**
+	 *设置编号
+	 */
+	public void setId(String id){
+		this.id = id;
+	}
+		/**
+	 *获取名称
+	 */
+	public String getName(){
+		return name;
+	}
+	
+	/**
+	 *设置名称
+	 */
+	public void setName(String name){
+		this.name = name;
+	}
+		/**
+	 *获取数值
+	 */
+	public String getValue(){
+		return value;
+	}
+	
+	/**
+	 *设置数值
+	 */
+	public void setValue(String value){
+		this.value = value;
+	}
+		/**
+	 *获取显示序号
+	 */
+	public Integer getSortNo(){
+		return sortNo;
+	}
+	
+	/**
+	 *设置显示序号
+	 */
+	public void setSortNo(Integer sortNo){
+		this.sortNo = sortNo;
+	}
+		/**
+	 *获取所属目录
+	 */
+	public String getParentId(){
+		return parentId;
+	}
+	
+	/**
+	 *设置所属目录
+	 */
+	public void setParentId(String parentId){
+		this.parentId = parentId;
+	}
+		/**
+	 *获取1-字典目录,2-数据
+	 */
+	public String getDataType(){
+		return dataType;
+	}
+	
+	/**
+	 *设置1-字典目录,2-数据
+	 */
+	public void setDataType(String dataType){
+		this.dataType = dataType;
+	}
+		/**
+	 *获取
+	 */
+	public String getCreateBy(){
+		return createBy;
+	}
+	
+	/**
+	 *设置
+	 */
+	public void setCreateBy(String createBy){
+		this.createBy = createBy;
+	}
+		@DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
+		/**
+	 *获取
+	 */
+	public Date getCreateDate(){
+		return createDate;
+	}
+	
+	/**
+	 *设置
+	 */
+	public void setCreateDate(Date createDate){
+		this.createDate = createDate;
+	}
+		/**
+	 *获取
+	 */
+	public String getUpdateBy(){
+		return updateBy;
+	}
+	
+	/**
+	 *设置
+	 */
+	public void setUpdateBy(String updateBy){
+		this.updateBy = updateBy;
+	}
+		@DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
+		/**
+	 *获取
+	 */
+	public Date getUpdateDate(){
+		return updateDate;
+	}
+	
+	/**
+	 *设置
+	 */
+	public void setUpdateDate(Date updateDate){
+		this.updateDate = updateDate;
+	}
+		/**
+	 *获取
+	 */
+	public Boolean getActivated(){
+		return activated;
+	}
+	
+	/**
+	 *设置
+	 */
+	public void setActivated(Boolean activated){
+		this.activated = activated;
+	}
+
+	/**
+	 *获取
+	 */
+	public Boolean getDelFlag(){
+		return delFlag;
+	}
+
+	/**
+	 *设置
+	 */
+	public void setDelFlag(Boolean delFlag){
+		this.delFlag = delFlag;
+	}
+
+	/*public List<DataDictionary> getChildren() {
+		return children;
+	}
+
+	public void setChildren(List<DataDictionary> children) {
+		this.children = children;
+	}*/
+
+	public String getParentName() {
+		return parentName;
+	}
+
+	public void setParentName(String parentName) {
+		this.parentName = parentName;
+	}
+}

+ 199 - 0
src/main/java/com/jpsoft/making_friends/entity/sys/Menu.java

@@ -0,0 +1,199 @@
+package com.jpsoft.making_friends.entity.sys;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+  描述:sys_menu的实体类
+ */
+public class Menu {
+	private String id;
+	private String menuName;
+	private String parentId;
+	private Integer sortNo;
+	private String menuUrl;
+	private String menuType;
+	private Date createTime;
+	private String createBy;
+	private Date updateTime;
+	private String updateBy;
+	private Boolean delFlag;
+	private String parentName;
+	private List<Menu> children;
+	private String icon;
+
+		/**
+	 *获取菜单编号
+	 */
+	public String getId(){
+		return id;
+	}
+	
+	/**
+	 *设置菜单编号
+	 */
+	public void setId(String id){
+		this.id = id;
+	}
+		/**
+	 *获取菜单名称
+	 */
+	public String getMenuName(){
+		return menuName;
+	}
+	
+	/**
+	 *设置菜单名称
+	 */
+	public void setMenuName(String menuName){
+		this.menuName = menuName;
+	}
+		/**
+	 *获取上级菜单
+	 */
+	public String getParentId(){
+		return parentId;
+	}
+	
+	/**
+	 *设置上级菜单
+	 */
+	public void setParentId(String parentId){
+		this.parentId = parentId;
+	}
+		/**
+	 *获取排序号
+	 */
+	public Integer getSortNo(){
+		return sortNo;
+	}
+	
+	/**
+	 *设置排序号
+	 */
+	public void setSortNo(Integer sortNo){
+		this.sortNo = sortNo;
+	}
+		/**
+	 *获取菜单地址
+	 */
+	public String getMenuUrl(){
+		return menuUrl;
+	}
+	
+	/**
+	 *设置菜单地址
+	 */
+	public void setMenuUrl(String menuUrl){
+		this.menuUrl = menuUrl;
+	}
+		/**
+	 *获取菜单类型(1-后端、2-前端)
+	 */
+	public String getMenuType(){
+		return menuType;
+	}
+	
+	/**
+	 *设置菜单类型(1-后端、2-前端)
+	 */
+	public void setMenuType(String menuType){
+		this.menuType = menuType;
+	}
+		@DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
+		/**
+	 *获取
+	 */
+	public Date getCreateTime(){
+		return createTime;
+	}
+	
+	/**
+	 *设置
+	 */
+	public void setCreateTime(Date createTime){
+		this.createTime = createTime;
+	}
+		/**
+	 *获取
+	 */
+	public String getCreateBy(){
+		return createBy;
+	}
+	
+	/**
+	 *设置
+	 */
+	public void setCreateBy(String createBy){
+		this.createBy = createBy;
+	}
+		@DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
+		/**
+	 *获取
+	 */
+	public Date getUpdateTime(){
+		return updateTime;
+	}
+	
+	/**
+	 *设置
+	 */
+	public void setUpdateTime(Date updateTime){
+		this.updateTime = updateTime;
+	}
+		/**
+	 *获取
+	 */
+	public String getUpdateBy(){
+		return updateBy;
+	}
+	
+	/**
+	 *设置
+	 */
+	public void setUpdateBy(String updateBy){
+		this.updateBy = updateBy;
+	}
+		/**
+	 *获取
+	 */
+	public Boolean getDelFlag(){
+		return delFlag;
+	}
+	
+	/**
+	 *设置
+	 */
+	public void setDelFlag(Boolean delFlag){
+		this.delFlag = delFlag;
+	}
+
+	public String getParentName() {
+		return parentName;
+	}
+
+	public void setParentName(String parentName) {
+		this.parentName = parentName;
+	}
+
+	public List<Menu> getChildren() {
+		return children;
+	}
+
+	public void setChildren(List<Menu> children) {
+		this.children = children;
+	}
+
+	public String getIcon() {
+		return icon;
+	}
+
+	public void setIcon(String icon) {
+		this.icon = icon;
+	}
+}

+ 143 - 0
src/main/java/com/jpsoft/making_friends/entity/sys/Permission.java

@@ -0,0 +1,143 @@
+package com.jpsoft.making_friends.entity.sys;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+/**
+ 描述:sys_permission的实体类
+ */
+public class Permission {
+	private String id;
+	private String path;
+	private String method;
+	private String summary;
+	private Boolean delFlag;
+	private String createBy;
+	private String updateBy;
+	private Date createTime;
+	private Date updateTime;
+
+	/**
+	 *获取主键
+	 */
+	public String getId(){
+		return id;
+	}
+
+	/**
+	 *设置主键
+	 */
+	public void setId(String id){
+		this.id = id;
+	}
+	/**
+	 *获取访问路径
+	 */
+	public String getPath(){
+		return path;
+	}
+
+	/**
+	 *设置访问路径
+	 */
+	public void setPath(String path){
+		this.path = path;
+	}
+	/**
+	 *获取访问方式
+	 */
+	public String getMethod(){
+		return method;
+	}
+
+	/**
+	 *设置访问方式
+	 */
+	public void setMethod(String method){
+		this.method = method;
+	}
+	/**
+	 *获取简介
+	 */
+	public String getSummary(){
+		return summary;
+	}
+
+	/**
+	 *设置简介
+	 */
+	public void setSummary(String summary){
+		this.summary = summary;
+	}
+	/**
+	 *获取是否删除
+	 */
+	public Boolean getDelFlag(){
+		return delFlag;
+	}
+
+	/**
+	 *设置是否删除
+	 */
+	public void setDelFlag(Boolean delFlag){
+		this.delFlag = delFlag;
+	}
+	/**
+	 *获取创建人
+	 */
+	public String getCreateBy(){
+		return createBy;
+	}
+
+	/**
+	 *设置创建人
+	 */
+	public void setCreateBy(String createBy){
+		this.createBy = createBy;
+	}
+	/**
+	 *获取更新人
+	 */
+	public String getUpdateBy(){
+		return updateBy;
+	}
+
+	/**
+	 *设置更新人
+	 */
+	public void setUpdateBy(String updateBy){
+		this.updateBy = updateBy;
+	}
+	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
+	/**
+	 *获取创建时间
+	 */
+	public Date getCreateTime(){
+		return createTime;
+	}
+
+	/**
+	 *设置创建时间
+	 */
+	public void setCreateTime(Date createTime){
+		this.createTime = createTime;
+	}
+	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
+	/**
+	 *获取更新时间
+	 */
+	public Date getUpdateTime(){
+		return updateTime;
+	}
+
+	/**
+	 *设置更新时间
+	 */
+	public void setUpdateTime(Date updateTime){
+		this.updateTime = updateTime;
+	}
+}

+ 129 - 0
src/main/java/com/jpsoft/making_friends/entity/sys/Role.java

@@ -0,0 +1,129 @@
+package com.jpsoft.making_friends.entity.sys;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+/**
+  描述:sys_role的实体类
+ */
+public class Role {
+	private String id;
+	private String name;
+	private String description;
+	private Date createTime;
+	private Date updateTime;
+	private Boolean delFlag;
+	private String createBy;
+	private String updateBy;
+	
+		/**
+	 *获取角色编号
+	 */
+	public String getId(){
+		return id;
+	}
+	
+	/**
+	 *设置角色编号
+	 */
+	public void setId(String id){
+		this.id = id;
+	}
+		/**
+	 *获取角色名称
+	 */
+	public String getName(){
+		return name;
+	}
+	
+	/**
+	 *设置角色名称
+	 */
+	public void setName(String name){
+		this.name = name;
+	}
+		/**
+	 *获取角色描述
+	 */
+	public String getDescription(){
+		return description;
+	}
+	
+	/**
+	 *设置角色描述
+	 */
+	public void setDescription(String description){
+		this.description = description;
+	}
+		@DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
+		/**
+	 *获取创建时间
+	 */
+	public Date getCreateTime(){
+		return createTime;
+	}
+	
+	/**
+	 *设置创建时间
+	 */
+	public void setCreateTime(Date createTime){
+		this.createTime = createTime;
+	}
+		@DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
+		/**
+	 *获取更新时间
+	 */
+	public Date getUpdateTime(){
+		return updateTime;
+	}
+	
+	/**
+	 *设置更新时间
+	 */
+	public void setUpdateTime(Date updateTime){
+		this.updateTime = updateTime;
+	}
+		/**
+	 *获取删除标示
+	 */
+	public Boolean getDelFlag(){
+		return delFlag;
+	}
+	
+	/**
+	 *设置删除标示
+	 */
+	public void setDelFlag(Boolean delFlag){
+		this.delFlag = delFlag;
+	}
+		/**
+	 *获取创建人
+	 */
+	public String getCreateBy(){
+		return createBy;
+	}
+	
+	/**
+	 *设置创建人
+	 */
+	public void setCreateBy(String createBy){
+		this.createBy = createBy;
+	}
+		/**
+	 *获取更新人
+	 */
+	public String getUpdateBy(){
+		return updateBy;
+	}
+	
+	/**
+	 *设置更新人
+	 */
+	public void setUpdateBy(String updateBy){
+		this.updateBy = updateBy;
+	}
+}

+ 129 - 0
src/main/java/com/jpsoft/making_friends/entity/sys/RoleMenu.java

@@ -0,0 +1,129 @@
+package com.jpsoft.making_friends.entity.sys;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+/**
+  描述:sys_role_menu的实体类
+ */
+public class RoleMenu {
+	private String id;
+	private String roleId;
+	private String menuId;
+	private Boolean delFlag;
+	private String createBy;
+	private Date createTime;
+	private String updateBy;
+	private Date updateTime;
+	
+		/**
+	 *获取
+	 */
+	public String getId(){
+		return id;
+	}
+	
+	/**
+	 *设置
+	 */
+	public void setId(String id){
+		this.id = id;
+	}
+		/**
+	 *获取
+	 */
+	public String getRoleId(){
+		return roleId;
+	}
+	
+	/**
+	 *设置
+	 */
+	public void setRoleId(String roleId){
+		this.roleId = roleId;
+	}
+		/**
+	 *获取
+	 */
+	public String getMenuId(){
+		return menuId;
+	}
+	
+	/**
+	 *设置
+	 */
+	public void setMenuId(String menuId){
+		this.menuId = menuId;
+	}
+		/**
+	 *获取是否删除
+	 */
+	public Boolean getDelFlag(){
+		return delFlag;
+	}
+	
+	/**
+	 *设置是否删除
+	 */
+	public void setDelFlag(Boolean delFlag){
+		this.delFlag = delFlag;
+	}
+		/**
+	 *获取创建人
+	 */
+	public String getCreateBy(){
+		return createBy;
+	}
+	
+	/**
+	 *设置创建人
+	 */
+	public void setCreateBy(String createBy){
+		this.createBy = createBy;
+	}
+		@DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
+		/**
+	 *获取创建时间
+	 */
+	public Date getCreateTime(){
+		return createTime;
+	}
+	
+	/**
+	 *设置创建时间
+	 */
+	public void setCreateTime(Date createTime){
+		this.createTime = createTime;
+	}
+		/**
+	 *获取更新人
+	 */
+	public String getUpdateBy(){
+		return updateBy;
+	}
+	
+	/**
+	 *设置更新人
+	 */
+	public void setUpdateBy(String updateBy){
+		this.updateBy = updateBy;
+	}
+		@DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
+		/**
+	 *获取更新时间
+	 */
+	public Date getUpdateTime(){
+		return updateTime;
+	}
+	
+	/**
+	 *设置更新时间
+	 */
+	public void setUpdateTime(Date updateTime){
+		this.updateTime = updateTime;
+	}
+}

+ 129 - 0
src/main/java/com/jpsoft/making_friends/entity/sys/RolePermission.java

@@ -0,0 +1,129 @@
+package com.jpsoft.making_friends.entity.sys;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+/**
+  描述:sys_role_permission的实体类
+ */
+public class RolePermission {
+	private String id;
+	private String permId;
+	private String roleId;
+	private Boolean delFlag;
+	private String createBy;
+	private String updateBy;
+	private Date createTime;
+	private Date updateTime;
+	
+		/**
+	 *获取
+	 */
+	public String getId(){
+		return id;
+	}
+	
+	/**
+	 *设置
+	 */
+	public void setId(String id){
+		this.id = id;
+	}
+		/**
+	 *获取
+	 */
+	public String getPermId(){
+		return permId;
+	}
+	
+	/**
+	 *设置
+	 */
+	public void setPermId(String permId){
+		this.permId = permId;
+	}
+		/**
+	 *获取
+	 */
+	public String getRoleId(){
+		return roleId;
+	}
+	
+	/**
+	 *设置
+	 */
+	public void setRoleId(String roleId){
+		this.roleId = roleId;
+	}
+		/**
+	 *获取是否删除
+	 */
+	public Boolean getDelFlag(){
+		return delFlag;
+	}
+	
+	/**
+	 *设置是否删除
+	 */
+	public void setDelFlag(Boolean delFlag){
+		this.delFlag = delFlag;
+	}
+		/**
+	 *获取创建人
+	 */
+	public String getCreateBy(){
+		return createBy;
+	}
+	
+	/**
+	 *设置创建人
+	 */
+	public void setCreateBy(String createBy){
+		this.createBy = createBy;
+	}
+		/**
+	 *获取更新人
+	 */
+	public String getUpdateBy(){
+		return updateBy;
+	}
+	
+	/**
+	 *设置更新人
+	 */
+	public void setUpdateBy(String updateBy){
+		this.updateBy = updateBy;
+	}
+		@DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
+		/**
+	 *获取创建时间
+	 */
+	public Date getCreateTime(){
+		return createTime;
+	}
+	
+	/**
+	 *设置创建时间
+	 */
+	public void setCreateTime(Date createTime){
+		this.createTime = createTime;
+	}
+		@DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
+		/**
+	 *获取更新时间
+	 */
+	public Date getUpdateTime(){
+		return updateTime;
+	}
+	
+	/**
+	 *设置更新时间
+	 */
+	public void setUpdateTime(Date updateTime){
+		this.updateTime = updateTime;
+	}
+}

+ 37 - 0
src/main/java/com/jpsoft/making_friends/entity/sys/SysLog.java

@@ -0,0 +1,37 @@
+package com.jpsoft.making_friends.entity.sys;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+/**
+  描述:sys_log的实体类
+ */
+@Data
+@ApiModel(value = "sys_log的实体类")
+public class SysLog {
+    @ApiModelProperty(value = "日志编号")
+	private Long id;
+    @ApiModelProperty(value = "客户端IP")
+	private String remoteIp;
+    @ApiModelProperty(value = "访问url")
+	private String url;
+    @ApiModelProperty(value = "提交参数")
+	private String data;
+    @ApiModelProperty(value = "用户编号")
+	private String userId;
+	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
+    @ApiModelProperty(value = "创建时间")
+	private Date createTime;
+	@ApiModelProperty(value = "备注")
+	private String remark;
+	@ApiModelProperty(value = "耗时(毫秒)")
+	private Long elapse;
+	@ApiModelProperty(value = "入口")
+	private String pointcut;
+}

+ 197 - 0
src/main/java/com/jpsoft/making_friends/entity/sys/User.java

@@ -0,0 +1,197 @@
+package com.jpsoft.making_friends.entity.sys;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ 描述:sys_user的实体类
+ */
+public class User {
+
+    private String id;
+    private String companyId;
+    private String companyName;
+    private String userName;
+    private String password;
+    private String realName;
+    private Date createTime;
+    private Date updateTime;
+    private Boolean delFlag;
+    private String createBy;
+    private String updateBy;
+    private List<String> roles;
+    private String openId;
+    private String orgId;
+
+    /**
+     *获取用户编号
+     */
+    public String getId(){
+        return id;
+    }
+
+    /**
+     *设置用户编号
+     */
+    public void setId(String id){
+        this.id = id;
+    }
+    /**
+     *获取用户名
+     */
+    public String getUserName(){
+        return userName;
+    }
+
+    /**
+     *设置用户名
+     */
+    public void setUserName(String userName){
+        this.userName = userName;
+    }
+    /**
+     *获取密码
+     */
+    public String getPassword(){
+        return password;
+    }
+
+    /**
+     *设置密码
+     */
+    public void setPassword(String password){
+        this.password = password;
+    }
+    /**
+     *获取真实名称
+     */
+    public String getRealName(){
+        return realName;
+    }
+
+    /**
+     *设置真实名称
+     */
+    public void setRealName(String realName){
+        this.realName = realName;
+    }
+
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
+    /**
+     *获取创建时间
+     */
+    public Date getCreateTime(){
+        return createTime;
+    }
+
+    /**
+     *设置创建时间
+     */
+    public void setCreateTime(Date createTime){
+        this.createTime = createTime;
+    }
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
+    /**
+     *获取更新时间
+     */
+    public Date getUpdateTime(){
+        return updateTime;
+    }
+
+    /**
+     *设置更新时间
+     */
+    public void setUpdateTime(Date updateTime){
+        this.updateTime = updateTime;
+    }
+    /**
+     *获取删除标示
+     */
+    public Boolean getDelFlag(){
+        return delFlag;
+    }
+
+    /**
+     *设置删除标示
+     */
+    public void setDelFlag(Boolean delFlag){
+        this.delFlag = delFlag;
+    }
+    /**
+     *获取创建人
+     */
+    public String getCreateBy(){
+        return createBy;
+    }
+
+    /**
+     *设置创建人
+     */
+    public void setCreateBy(String createBy){
+        this.createBy = createBy;
+    }
+    /**
+     *获取更新人
+     */
+    public String getUpdateBy(){
+        return updateBy;
+    }
+
+    /**
+     *设置更新人
+     */
+    public void setUpdateBy(String updateBy){
+        this.updateBy = updateBy;
+    }
+
+    public List<String> getRoles() {
+        return roles;
+    }
+
+    public void setRoles(List<String> roles) {
+        this.roles = roles;
+    }
+
+    /**
+     *设置企业名称
+     */
+    public String getCompanyId() {
+        return companyId;
+    }
+
+    public void setCompanyId(String companyId) {
+        this.companyId = companyId;
+    }
+
+    /**
+     *设置企业名称
+     */
+    public String getCompanyName() {
+        return companyName;
+    }
+
+    public void setCompanyName(String companyName) {
+        this.companyName = companyName;
+    }
+
+    public String getOpenId() {
+        return openId;
+    }
+
+    public void setOpenId(String openId) {
+        this.openId = openId;
+    }
+
+    public String getOrgId() {
+        return orgId;
+    }
+
+    public void setOrgId(String orgId) {
+        this.orgId = orgId;
+    }
+}

+ 129 - 0
src/main/java/com/jpsoft/making_friends/entity/sys/UserRole.java

@@ -0,0 +1,129 @@
+package com.jpsoft.making_friends.entity.sys;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+/**
+  描述:sys_user_role的实体类
+ */
+public class UserRole {
+	private String id;
+	private String roleId;
+	private String userId;
+	private Boolean delFlag;
+	private String createBy;
+	private String updateBy;
+	private Date createTime;
+	private Date updateTime;
+	
+		/**
+	 *获取用户角色关联编号
+	 */
+	public String getId(){
+		return id;
+	}
+	
+	/**
+	 *设置用户角色关联编号
+	 */
+	public void setId(String id){
+		this.id = id;
+	}
+		/**
+	 *获取角色编号
+	 */
+	public String getRoleId(){
+		return roleId;
+	}
+	
+	/**
+	 *设置角色编号
+	 */
+	public void setRoleId(String roleId){
+		this.roleId = roleId;
+	}
+		/**
+	 *获取用户编号
+	 */
+	public String getUserId(){
+		return userId;
+	}
+	
+	/**
+	 *设置用户编号
+	 */
+	public void setUserId(String userId){
+		this.userId = userId;
+	}
+		/**
+	 *获取是否删除
+	 */
+	public Boolean getDelFlag(){
+		return delFlag;
+	}
+	
+	/**
+	 *设置是否删除
+	 */
+	public void setDelFlag(Boolean delFlag){
+		this.delFlag = delFlag;
+	}
+		/**
+	 *获取创建人
+	 */
+	public String getCreateBy(){
+		return createBy;
+	}
+	
+	/**
+	 *设置创建人
+	 */
+	public void setCreateBy(String createBy){
+		this.createBy = createBy;
+	}
+		/**
+	 *获取更新人
+	 */
+	public String getUpdateBy(){
+		return updateBy;
+	}
+	
+	/**
+	 *设置更新人
+	 */
+	public void setUpdateBy(String updateBy){
+		this.updateBy = updateBy;
+	}
+		@DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
+		/**
+	 *获取创建时间
+	 */
+	public Date getCreateTime(){
+		return createTime;
+	}
+	
+	/**
+	 *设置创建时间
+	 */
+	public void setCreateTime(Date createTime){
+		this.createTime = createTime;
+	}
+		@DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
+		/**
+	 *获取更新时间
+	 */
+	public Date getUpdateTime(){
+		return updateTime;
+	}
+	
+	/**
+	 *设置更新时间
+	 */
+	public void setUpdateTime(Date updateTime){
+		this.updateTime = updateTime;
+	}
+}

+ 64 - 0
src/main/java/com/jpsoft/making_friends/interceptor/LoginInterceptor.java

@@ -0,0 +1,64 @@
+package com.jpsoft.making_friends.interceptor;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.jpsoft.making_friends.dto.MessageResult;
+import com.jpsoft.making_friends.common.utils.JwtUtil;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+import org.springframework.util.StringUtils;
+import org.springframework.web.servlet.HandlerInterceptor;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+@Component
+public class LoginInterceptor implements HandlerInterceptor {
+    @Value("${jwt.secret}")
+    private String jwtSecret;
+
+    @Override
+    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
+        if (request.getMethod().equals("OPTIONS")){
+            return true;
+        }
+
+        String token = request.getHeader("Authorization");
+
+        if (StringUtils.isEmpty(token)){
+            token = (String)request.getSession().getAttribute("token");
+        }
+
+        if (StringUtils.isEmpty(token)) {
+            token = request.getParameter("token");
+        }
+
+        boolean result = false;
+
+        try {
+            String userId = JwtUtil.decodeToken(jwtSecret,token);
+
+            request.setAttribute("subject",userId);
+
+            result = true;
+        }
+        catch(Exception ex){
+            MessageResult<String> msgResult = new MessageResult<>();
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+            msgResult.setCode(415);
+
+            ObjectMapper mapper = new ObjectMapper();
+            String json = mapper.writeValueAsString(msgResult);
+
+            response.setContentType("application/json");
+            response.setCharacterEncoding("UTF-8");
+            response.setHeader("access-control-allow-origin","*");
+            response.getWriter().print(json);
+
+            result = false;
+        }
+
+        return result;
+    }
+}

+ 177 - 0
src/main/java/com/jpsoft/making_friends/modules/mgr/controller/HobbyInfoController.java

@@ -0,0 +1,177 @@
+package com.jpsoft.making_friends.modules.mgr.controller;
+
+import com.github.pagehelper.Page;
+import com.jpsoft.making_friends.dto.Sort;
+import com.jpsoft.making_friends.dto.MessageResult;
+import com.jpsoft.making_friends.dto.utils.PojoUtils;
+import com.jpsoft.making_friends.entity.base.HobbyInfo;
+import com.jpsoft.making_friends.service.base.HobbyInfoService;
+import io.swagger.annotations.ApiOperation;
+import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+@RestController
+@RequestMapping("/hobbyInfo")
+public class HobbyInfoController {
+    private Logger logger = LoggerFactory.getLogger(getClass());
+
+    @Autowired
+    private HobbyInfoService hobbyInfoService;
+
+    @ApiOperation(value="添加信息")
+    @PostMapping("add")
+    public MessageResult<HobbyInfo> add(@ModelAttribute HobbyInfo hobbyInfo){
+        MessageResult<HobbyInfo> msgResult = new MessageResult<>();
+
+        try {
+            hobbyInfo.setId(UUID.randomUUID().toString());
+
+            int affectCount = hobbyInfoService.insert(hobbyInfo);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(hobbyInfo);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库添加失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="获取信息")
+    @GetMapping("detail/{id}")
+    public MessageResult<HobbyInfo> detail(@PathVariable("id") String id){
+        MessageResult<HobbyInfo> msgResult = new MessageResult<>();
+
+        try {
+            HobbyInfo hobbyInfo = hobbyInfoService.get(id);
+
+            if (hobbyInfo != null) {
+                msgResult.setResult(true);
+                msgResult.setData(hobbyInfo);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库不存在该记录!");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="更新用户")
+    @PostMapping("update")
+    public MessageResult<HobbyInfo> update(@ModelAttribute HobbyInfo hobbyInfo){
+        MessageResult<HobbyInfo> msgResult = new MessageResult<>();
+
+        try {
+            int affectCount = hobbyInfoService.update(hobbyInfo);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(hobbyInfo);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库更新失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="删除用户")
+    @PostMapping("delete/{id}")
+    public MessageResult<HobbyInfo> delete(@PathVariable("id") String id){
+        MessageResult<HobbyInfo> msgResult = new MessageResult<>();
+
+        try {
+            int affectCount = hobbyInfoService.delete(id);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库删除失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+
+    @ApiOperation(value="批量删除")
+    @PostMapping("batchDelete/{id}")
+    public MessageResult<HobbyInfo> batchDelete(@PathVariable("id") String id){
+        MessageResult<HobbyInfo> msgResult = new MessageResult<>();
+
+        msgResult.setResult(false);
+        msgResult.setMessage("未实现");
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="列表")
+    @RequestMapping(value = "list",method = RequestMethod.POST)
+    public MessageResult<Map> list(
+            String id,
+            @RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
+            @RequestParam(value="pageSize",defaultValue="20") int pageSize,
+            HttpServletRequest request){
+        String subject = (String)request.getAttribute("subject");
+
+        //当前用户ID
+        System.out.println(subject);
+
+        MessageResult<Map> msgResult = new MessageResult<>();
+
+        Map<String,Object> searchParams = new HashMap<>();
+
+        List<Sort> sortList = new ArrayList<>();
+        sortList.add(new Sort("id_","asc"));
+
+        if (StringUtils.isNotEmpty(id)) {
+            searchParams.put("id","%" + id + "%");
+        }
+
+
+        Page<HobbyInfo> page = hobbyInfoService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
+
+
+        msgResult.setResult(true);
+        msgResult.setData(PojoUtils.pageWrapper(page));
+
+        return msgResult;
+    }
+}

+ 177 - 0
src/main/java/com/jpsoft/making_friends/modules/mgr/controller/MemberHobbyController.java

@@ -0,0 +1,177 @@
+package com.jpsoft.making_friends.modules.mgr.controller;
+
+import com.github.pagehelper.Page;
+import com.jpsoft.making_friends.dto.Sort;
+import com.jpsoft.making_friends.dto.MessageResult;
+import com.jpsoft.making_friends.dto.utils.PojoUtils;
+import com.jpsoft.making_friends.entity.base.MemberHobby;
+import com.jpsoft.making_friends.service.base.MemberHobbyService;
+import io.swagger.annotations.ApiOperation;
+import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+@RestController
+@RequestMapping("/memberHobby")
+public class MemberHobbyController {
+    private Logger logger = LoggerFactory.getLogger(getClass());
+
+    @Autowired
+    private MemberHobbyService memberHobbyService;
+
+    @ApiOperation(value="添加信息")
+    @PostMapping("add")
+    public MessageResult<MemberHobby> add(@ModelAttribute MemberHobby memberHobby){
+        MessageResult<MemberHobby> msgResult = new MessageResult<>();
+
+        try {
+            memberHobby.setId(UUID.randomUUID().toString());
+
+            int affectCount = memberHobbyService.insert(memberHobby);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(memberHobby);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库添加失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="获取信息")
+    @GetMapping("detail/{id}")
+    public MessageResult<MemberHobby> detail(@PathVariable("id") String id){
+        MessageResult<MemberHobby> msgResult = new MessageResult<>();
+
+        try {
+            MemberHobby memberHobby = memberHobbyService.get(id);
+
+            if (memberHobby != null) {
+                msgResult.setResult(true);
+                msgResult.setData(memberHobby);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库不存在该记录!");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="更新用户")
+    @PostMapping("update")
+    public MessageResult<MemberHobby> update(@ModelAttribute MemberHobby memberHobby){
+        MessageResult<MemberHobby> msgResult = new MessageResult<>();
+
+        try {
+            int affectCount = memberHobbyService.update(memberHobby);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(memberHobby);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库更新失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="删除用户")
+    @PostMapping("delete/{id}")
+    public MessageResult<MemberHobby> delete(@PathVariable("id") String id){
+        MessageResult<MemberHobby> msgResult = new MessageResult<>();
+
+        try {
+            int affectCount = memberHobbyService.delete(id);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库删除失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+
+    @ApiOperation(value="批量删除")
+    @PostMapping("batchDelete/{id}")
+    public MessageResult<MemberHobby> batchDelete(@PathVariable("id") String id){
+        MessageResult<MemberHobby> msgResult = new MessageResult<>();
+
+        msgResult.setResult(false);
+        msgResult.setMessage("未实现");
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="列表")
+    @RequestMapping(value = "list",method = RequestMethod.POST)
+    public MessageResult<Map> list(
+            String id,
+            @RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
+            @RequestParam(value="pageSize",defaultValue="20") int pageSize,
+            HttpServletRequest request){
+        String subject = (String)request.getAttribute("subject");
+
+        //当前用户ID
+        System.out.println(subject);
+
+        MessageResult<Map> msgResult = new MessageResult<>();
+
+        Map<String,Object> searchParams = new HashMap<>();
+
+        List<Sort> sortList = new ArrayList<>();
+        sortList.add(new Sort("id_","asc"));
+
+        if (StringUtils.isNotEmpty(id)) {
+            searchParams.put("id","%" + id + "%");
+        }
+
+
+        Page<MemberHobby> page = memberHobbyService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
+
+
+        msgResult.setResult(true);
+        msgResult.setData(PojoUtils.pageWrapper(page));
+
+        return msgResult;
+    }
+}

+ 177 - 0
src/main/java/com/jpsoft/making_friends/modules/mgr/controller/MemberInfoController.java

@@ -0,0 +1,177 @@
+package com.jpsoft.making_friends.modules.mgr.controller;
+
+import com.github.pagehelper.Page;
+import com.jpsoft.making_friends.dto.Sort;
+import com.jpsoft.making_friends.dto.MessageResult;
+import com.jpsoft.making_friends.dto.utils.PojoUtils;
+import com.jpsoft.making_friends.entity.base.MemberInfo;
+import com.jpsoft.making_friends.service.base.MemberInfoService;
+import io.swagger.annotations.ApiOperation;
+import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+@RestController
+@RequestMapping("/memberInfo")
+public class MemberInfoController {
+    private Logger logger = LoggerFactory.getLogger(getClass());
+
+    @Autowired
+    private MemberInfoService memberInfoService;
+
+    @ApiOperation(value="添加信息")
+    @PostMapping("add")
+    public MessageResult<MemberInfo> add(@ModelAttribute MemberInfo memberInfo){
+        MessageResult<MemberInfo> msgResult = new MessageResult<>();
+
+        try {
+            memberInfo.setId(UUID.randomUUID().toString());
+
+            int affectCount = memberInfoService.insert(memberInfo);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(memberInfo);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库添加失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="获取信息")
+    @GetMapping("detail/{id}")
+    public MessageResult<MemberInfo> detail(@PathVariable("id") String id){
+        MessageResult<MemberInfo> msgResult = new MessageResult<>();
+
+        try {
+            MemberInfo memberInfo = memberInfoService.get(id);
+
+            if (memberInfo != null) {
+                msgResult.setResult(true);
+                msgResult.setData(memberInfo);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库不存在该记录!");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="更新用户")
+    @PostMapping("update")
+    public MessageResult<MemberInfo> update(@ModelAttribute MemberInfo memberInfo){
+        MessageResult<MemberInfo> msgResult = new MessageResult<>();
+
+        try {
+            int affectCount = memberInfoService.update(memberInfo);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(memberInfo);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库更新失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="删除用户")
+    @PostMapping("delete/{id}")
+    public MessageResult<MemberInfo> delete(@PathVariable("id") String id){
+        MessageResult<MemberInfo> msgResult = new MessageResult<>();
+
+        try {
+            int affectCount = memberInfoService.delete(id);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库删除失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+
+    @ApiOperation(value="批量删除")
+    @PostMapping("batchDelete/{id}")
+    public MessageResult<MemberInfo> batchDelete(@PathVariable("id") String id){
+        MessageResult<MemberInfo> msgResult = new MessageResult<>();
+
+        msgResult.setResult(false);
+        msgResult.setMessage("未实现");
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="列表")
+    @RequestMapping(value = "list",method = RequestMethod.POST)
+    public MessageResult<Map> list(
+            String id,
+            @RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
+            @RequestParam(value="pageSize",defaultValue="20") int pageSize,
+            HttpServletRequest request){
+        String subject = (String)request.getAttribute("subject");
+
+        //当前用户ID
+        System.out.println(subject);
+
+        MessageResult<Map> msgResult = new MessageResult<>();
+
+        Map<String,Object> searchParams = new HashMap<>();
+
+        List<Sort> sortList = new ArrayList<>();
+        sortList.add(new Sort("id_","asc"));
+
+        if (StringUtils.isNotEmpty(id)) {
+            searchParams.put("id","%" + id + "%");
+        }
+
+
+        Page<MemberInfo> page = memberInfoService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
+
+
+        msgResult.setResult(true);
+        msgResult.setData(PojoUtils.pageWrapper(page));
+
+        return msgResult;
+    }
+}

+ 177 - 0
src/main/java/com/jpsoft/making_friends/modules/mgr/controller/NewsInfoController.java

@@ -0,0 +1,177 @@
+package com.jpsoft.making_friends.modules.mgr.controller;
+
+import com.github.pagehelper.Page;
+import com.jpsoft.making_friends.dto.Sort;
+import com.jpsoft.making_friends.dto.MessageResult;
+import com.jpsoft.making_friends.dto.utils.PojoUtils;
+import com.jpsoft.making_friends.entity.base.NewsInfo;
+import com.jpsoft.making_friends.service.base.NewsInfoService;
+import io.swagger.annotations.ApiOperation;
+import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+@RestController
+@RequestMapping("/newsInfo")
+public class NewsInfoController {
+    private Logger logger = LoggerFactory.getLogger(getClass());
+
+    @Autowired
+    private NewsInfoService newsInfoService;
+
+    @ApiOperation(value="添加信息")
+    @PostMapping("add")
+    public MessageResult<NewsInfo> add(@ModelAttribute NewsInfo newsInfo){
+        MessageResult<NewsInfo> msgResult = new MessageResult<>();
+
+        try {
+            newsInfo.setId(UUID.randomUUID().toString());
+
+            int affectCount = newsInfoService.insert(newsInfo);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(newsInfo);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库添加失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="获取信息")
+    @GetMapping("detail/{id}")
+    public MessageResult<NewsInfo> detail(@PathVariable("id") String id){
+        MessageResult<NewsInfo> msgResult = new MessageResult<>();
+
+        try {
+            NewsInfo newsInfo = newsInfoService.get(id);
+
+            if (newsInfo != null) {
+                msgResult.setResult(true);
+                msgResult.setData(newsInfo);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库不存在该记录!");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="更新用户")
+    @PostMapping("update")
+    public MessageResult<NewsInfo> update(@ModelAttribute NewsInfo newsInfo){
+        MessageResult<NewsInfo> msgResult = new MessageResult<>();
+
+        try {
+            int affectCount = newsInfoService.update(newsInfo);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(newsInfo);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库更新失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="删除用户")
+    @PostMapping("delete/{id}")
+    public MessageResult<NewsInfo> delete(@PathVariable("id") String id){
+        MessageResult<NewsInfo> msgResult = new MessageResult<>();
+
+        try {
+            int affectCount = newsInfoService.delete(id);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库删除失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+
+    @ApiOperation(value="批量删除")
+    @PostMapping("batchDelete/{id}")
+    public MessageResult<NewsInfo> batchDelete(@PathVariable("id") String id){
+        MessageResult<NewsInfo> msgResult = new MessageResult<>();
+
+        msgResult.setResult(false);
+        msgResult.setMessage("未实现");
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="列表")
+    @RequestMapping(value = "list",method = RequestMethod.POST)
+    public MessageResult<Map> list(
+            String id,
+            @RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
+            @RequestParam(value="pageSize",defaultValue="20") int pageSize,
+            HttpServletRequest request){
+        String subject = (String)request.getAttribute("subject");
+
+        //当前用户ID
+        System.out.println(subject);
+
+        MessageResult<Map> msgResult = new MessageResult<>();
+
+        Map<String,Object> searchParams = new HashMap<>();
+
+        List<Sort> sortList = new ArrayList<>();
+        sortList.add(new Sort("id_","asc"));
+
+        if (StringUtils.isNotEmpty(id)) {
+            searchParams.put("id","%" + id + "%");
+        }
+
+
+        Page<NewsInfo> page = newsInfoService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
+
+
+        msgResult.setResult(true);
+        msgResult.setData(PojoUtils.pageWrapper(page));
+
+        return msgResult;
+    }
+}

+ 177 - 0
src/main/java/com/jpsoft/making_friends/modules/mgr/controller/NewsTypeController.java

@@ -0,0 +1,177 @@
+package com.jpsoft.making_friends.modules.mgr.controller;
+
+import com.github.pagehelper.Page;
+import com.jpsoft.making_friends.dto.Sort;
+import com.jpsoft.making_friends.dto.MessageResult;
+import com.jpsoft.making_friends.dto.utils.PojoUtils;
+import com.jpsoft.making_friends.entity.base.NewsType;
+import com.jpsoft.making_friends.service.base.NewsTypeService;
+import io.swagger.annotations.ApiOperation;
+import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+@RestController
+@RequestMapping("/newsType")
+public class NewsTypeController {
+    private Logger logger = LoggerFactory.getLogger(getClass());
+
+    @Autowired
+    private NewsTypeService newsTypeService;
+
+    @ApiOperation(value="添加信息")
+    @PostMapping("add")
+    public MessageResult<NewsType> add(@ModelAttribute NewsType newsType){
+        MessageResult<NewsType> msgResult = new MessageResult<>();
+
+        try {
+            newsType.setId(UUID.randomUUID().toString());
+
+            int affectCount = newsTypeService.insert(newsType);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(newsType);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库添加失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="获取信息")
+    @GetMapping("detail/{id}")
+    public MessageResult<NewsType> detail(@PathVariable("id") String id){
+        MessageResult<NewsType> msgResult = new MessageResult<>();
+
+        try {
+            NewsType newsType = newsTypeService.get(id);
+
+            if (newsType != null) {
+                msgResult.setResult(true);
+                msgResult.setData(newsType);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库不存在该记录!");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="更新用户")
+    @PostMapping("update")
+    public MessageResult<NewsType> update(@ModelAttribute NewsType newsType){
+        MessageResult<NewsType> msgResult = new MessageResult<>();
+
+        try {
+            int affectCount = newsTypeService.update(newsType);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(newsType);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库更新失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="删除用户")
+    @PostMapping("delete/{id}")
+    public MessageResult<NewsType> delete(@PathVariable("id") String id){
+        MessageResult<NewsType> msgResult = new MessageResult<>();
+
+        try {
+            int affectCount = newsTypeService.delete(id);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库删除失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+
+    @ApiOperation(value="批量删除")
+    @PostMapping("batchDelete/{id}")
+    public MessageResult<NewsType> batchDelete(@PathVariable("id") String id){
+        MessageResult<NewsType> msgResult = new MessageResult<>();
+
+        msgResult.setResult(false);
+        msgResult.setMessage("未实现");
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="列表")
+    @RequestMapping(value = "list",method = RequestMethod.POST)
+    public MessageResult<Map> list(
+            String id,
+            @RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
+            @RequestParam(value="pageSize",defaultValue="20") int pageSize,
+            HttpServletRequest request){
+        String subject = (String)request.getAttribute("subject");
+
+        //当前用户ID
+        System.out.println(subject);
+
+        MessageResult<Map> msgResult = new MessageResult<>();
+
+        Map<String,Object> searchParams = new HashMap<>();
+
+        List<Sort> sortList = new ArrayList<>();
+        sortList.add(new Sort("id_","asc"));
+
+        if (StringUtils.isNotEmpty(id)) {
+            searchParams.put("id","%" + id + "%");
+        }
+
+
+        Page<NewsType> page = newsTypeService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
+
+
+        msgResult.setResult(true);
+        msgResult.setData(PojoUtils.pageWrapper(page));
+
+        return msgResult;
+    }
+}

+ 191 - 0
src/main/java/com/jpsoft/making_friends/modules/mgr/controller/OrgInfoController.java

@@ -0,0 +1,191 @@
+package com.jpsoft.making_friends.modules.mgr.controller;
+
+import com.github.pagehelper.Page;
+import com.jpsoft.making_friends.dto.Sort;
+import com.jpsoft.making_friends.dto.MessageResult;
+import com.jpsoft.making_friends.dto.utils.PojoUtils;
+import com.jpsoft.making_friends.entity.base.OrgInfo;
+import com.jpsoft.making_friends.service.base.OrgInfoService;
+import io.swagger.annotations.ApiOperation;
+import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+@RestController
+@RequestMapping("/base/orgInfo")
+public class OrgInfoController {
+    private Logger logger = LoggerFactory.getLogger(getClass());
+
+    @Autowired
+    private OrgInfoService orgInfoService;
+
+
+    @ApiOperation(value="初始化")
+    @GetMapping("create")
+    public MessageResult<OrgInfo> create(){
+        MessageResult<OrgInfo> msgResult = new MessageResult<>();
+
+        OrgInfo orgInfo = new OrgInfo();
+
+        msgResult.setResult(true);
+        msgResult.setData(orgInfo);
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="添加信息")
+    @PostMapping("add")
+    public MessageResult<OrgInfo> add(@ModelAttribute OrgInfo orgInfo){
+        MessageResult<OrgInfo> msgResult = new MessageResult<>();
+
+        try {
+            orgInfo.setId(UUID.randomUUID().toString());
+
+            int affectCount = orgInfoService.insert(orgInfo);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(orgInfo);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库添加失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="获取信息")
+    @GetMapping("edit/{id}")
+    public MessageResult<OrgInfo> detail(@PathVariable("id") String id){
+        MessageResult<OrgInfo> msgResult = new MessageResult<>();
+
+        try {
+            OrgInfo orgInfo = orgInfoService.get(id);
+
+            if (orgInfo != null) {
+                msgResult.setResult(true);
+                msgResult.setData(orgInfo);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库不存在该记录!");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="更新用户")
+    @PostMapping("update")
+    public MessageResult<OrgInfo> update(@ModelAttribute OrgInfo orgInfo){
+        MessageResult<OrgInfo> msgResult = new MessageResult<>();
+
+        try {
+            int affectCount = orgInfoService.update(orgInfo);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(orgInfo);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库更新失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="删除用户")
+    @PostMapping("delete/{id}")
+    public MessageResult<OrgInfo> delete(@PathVariable("id") String id){
+        MessageResult<OrgInfo> msgResult = new MessageResult<>();
+
+        try {
+            int affectCount = orgInfoService.delete(id);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库删除失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+
+    @ApiOperation(value="批量删除")
+    @PostMapping("batchDelete/{id}")
+    public MessageResult<OrgInfo> batchDelete(@PathVariable("id") String id){
+        MessageResult<OrgInfo> msgResult = new MessageResult<>();
+
+        msgResult.setResult(false);
+        msgResult.setMessage("未实现");
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="列表")
+    @RequestMapping(value = "pageList",method = RequestMethod.POST)
+    public MessageResult<Map> list(
+            String name,
+            @RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
+            @RequestParam(value="pageSize",defaultValue="20") int pageSize,
+            HttpServletRequest request){
+        String subject = (String)request.getAttribute("subject");
+
+        //当前用户ID
+        System.out.println(subject);
+
+        MessageResult<Map> msgResult = new MessageResult<>();
+
+        Map<String,Object> searchParams = new HashMap<>();
+
+        List<Sort> sortList = new ArrayList<>();
+        sortList.add(new Sort("create_time","desc"));
+
+        if (StringUtils.isNotEmpty(name)) {
+            searchParams.put("name","%" + name + "%");
+        }
+
+
+        Page<OrgInfo> page = orgInfoService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
+
+
+        msgResult.setResult(true);
+        msgResult.setData(PojoUtils.pageWrapper(page));
+
+        return msgResult;
+    }
+}

+ 37 - 0
src/main/java/com/jpsoft/making_friends/modules/sys/controller/ApiController.java

@@ -0,0 +1,37 @@
+package com.jpsoft.making_friends.modules.sys.controller;
+
+import io.swagger.annotations.ApiOperation;
+import org.springframework.http.ResponseEntity;
+import org.springframework.http.converter.HttpMessageConverter;
+import org.springframework.http.converter.StringHttpMessageConverter;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.client.RestTemplate;
+
+import javax.servlet.http.HttpServletRequest;
+import java.nio.charset.Charset;
+
+@RestController
+@RequestMapping("/sys/api")
+public class ApiController {
+    @ApiOperation("获取后端api列表")
+    @GetMapping("selectAll")
+    public ResponseEntity<String> selectAll(HttpServletRequest request){
+        RestTemplate restTemplate = new RestTemplate();
+
+        for (HttpMessageConverter<?> httpMessageConverter : restTemplate.getMessageConverters()) {
+            if(httpMessageConverter instanceof StringHttpMessageConverter) {
+                ((StringHttpMessageConverter) httpMessageConverter).setDefaultCharset(Charset.forName("UTF-8"));
+                break;
+            }
+        }
+
+        String path = request.getContextPath();
+        String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
+
+        ResponseEntity<String> entity = restTemplate.getForEntity(basePath + "v2/api-docs",String.class);
+
+        return entity;
+    }
+}

+ 309 - 0
src/main/java/com/jpsoft/making_friends/modules/sys/controller/DataDictionaryController.java

@@ -0,0 +1,309 @@
+package com.jpsoft.making_friends.modules.sys.controller;
+
+import com.github.pagehelper.Page;
+import com.jpsoft.making_friends.dto.MessageResult;
+import com.jpsoft.making_friends.dto.Sort;
+import com.jpsoft.making_friends.dto.utils.PojoUtils;
+import com.jpsoft.making_friends.entity.sys.DataDictionary;
+import com.jpsoft.making_friends.service.sys.DataDictionaryService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.*;
+
+@RestController
+@RequestMapping("/sys/dataDictionary")
+@Api(description = "数据字典")
+public class DataDictionaryController {
+    private Logger logger = LoggerFactory.getLogger(getClass());
+
+    @Autowired
+    private DataDictionaryService dataDictionaryService;
+
+    @ApiOperation(value="创建空记录")
+    @GetMapping("create")
+    public MessageResult<DataDictionary> create(){
+        MessageResult<DataDictionary> msgResult = new MessageResult<>();
+
+        DataDictionary dataDictionary = new DataDictionary();
+
+        msgResult.setData(dataDictionary);
+        msgResult.setResult(true);
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="添加信息")
+    @PostMapping("add")
+    public MessageResult<DataDictionary> add(@RequestBody DataDictionary dataDictionary,@RequestAttribute String subject){
+        MessageResult<DataDictionary> msgResult = new MessageResult<>();
+
+        try {
+            dataDictionary.setId(UUID.randomUUID().toString());
+            dataDictionary.setDelFlag(false);
+            dataDictionary.setCreateBy(subject);
+            dataDictionary.setCreateDate(new Date());
+
+            int affectCount = dataDictionaryService.insert(dataDictionary);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(dataDictionary);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("添加失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage("添加失败");
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="获取信息")
+    @GetMapping("edit/{id}")
+    public MessageResult<DataDictionary> edit(@PathVariable("id") String id){
+        MessageResult<DataDictionary> msgResult = new MessageResult<>();
+
+        try {
+            DataDictionary dataDictionary = dataDictionaryService.get(id);
+
+            if (dataDictionary != null) {
+                msgResult.setResult(true);
+                msgResult.setData(dataDictionary);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("不存在该记录!");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="更新用户")
+    @PostMapping("update")
+    public MessageResult<DataDictionary> update(@RequestBody DataDictionary dataDictionary,@RequestAttribute String subject){
+        MessageResult<DataDictionary> msgResult = new MessageResult<>();
+
+        try {
+            dataDictionary.setUpdateBy(subject);
+            dataDictionary.setUpdateDate(new Date());
+
+            int affectCount = dataDictionaryService.update(dataDictionary);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(dataDictionary);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("更新失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage("更新失败");
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="删除")
+    @PostMapping("delete/{id}")
+    public MessageResult<Integer> delete(@PathVariable("id") String id,@RequestAttribute String subject){
+        MessageResult<Integer> msgResult = new MessageResult<>();
+
+        try {
+            DataDictionary dataDictionary = dataDictionaryService.get(id);
+            dataDictionary.setDelFlag(true);
+            dataDictionary.setUpdateBy(subject);
+            dataDictionary.setUpdateDate(new Date());
+
+            int affectCount = dataDictionaryService.update(dataDictionary);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(affectCount);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("删除失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+
+    @ApiOperation(value="批量删除")
+    @PostMapping("batchDelete")
+    public MessageResult<Integer> batchDelete(@RequestBody List<String> idList,@RequestAttribute String subject){
+        MessageResult<Integer> msgResult = new MessageResult<>();
+
+        try {
+            int affectCount = 0;
+
+            for (String id : idList) {
+                DataDictionary dataDictionary = dataDictionaryService.get(id);
+                dataDictionary.setDelFlag(true);
+                dataDictionary.setUpdateBy(subject);
+                dataDictionary.setUpdateDate(new Date());
+
+                affectCount += dataDictionaryService.update(dataDictionary);
+            }
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(affectCount);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("删除失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="列表")
+    @RequestMapping(value = "pageList",method = RequestMethod.POST)
+    public MessageResult<Map> pageList(
+            String id,
+            String name,
+            String parentId,
+            @RequestParam(name="pageIndex",defaultValue = "1") int pageIndex,
+            @RequestParam(name="pageSize",defaultValue = "10") int pageSize,
+            @RequestAttribute String subject){
+
+        //当前用户ID
+        System.out.println(subject);
+
+        MessageResult<Map> msgResult = new MessageResult<>();
+
+        Map<String,Object> searchParams = new HashMap<>();
+
+        List<Sort> sortList = new ArrayList<>();
+        sortList.add(new Sort("sort_no","asc"));
+
+        if (StringUtils.isNotEmpty(parentId)) {
+            searchParams.put("parentId",parentId);
+        }
+
+        if (StringUtils.isNotEmpty(id)) {
+            searchParams.put("id",id);
+        }
+
+        if (StringUtils.isNotEmpty(name)) {
+            searchParams.put("name","%" + name + "%");
+        }
+
+        Page<DataDictionary> page = dataDictionaryService.pageSearch(searchParams,pageIndex, pageSize,sortList);
+
+        msgResult.setResult(true);
+        msgResult.setData(PojoUtils.pageWrapper(page));
+
+        return msgResult;
+    }
+
+    @ApiOperation(value = "查询")
+    @RequestMapping(value = "query", method = RequestMethod.POST)
+    public MessageResult<List> query(
+            String keywords,
+            String excludeId,
+            @RequestParam(value = "dataType", defaultValue = "null") String dataType,
+            @RequestParam(value = "limit", defaultValue = "20") int limit,
+            @RequestAttribute String subject) {
+        MessageResult<List> msgResult = new MessageResult<>();
+
+        Map<String, Object> searchParams = new HashMap<>();
+
+        List<Sort> sortList = new ArrayList<>();
+        sortList.add(new Sort("a.sort_no", "asc"));
+
+        if (StringUtils.isNotEmpty(keywords)) {
+            searchParams.put("name", "%" + keywords + "%");
+        }
+
+        if (StringUtils.isNotEmpty(excludeId)) {
+            searchParams.put("excludeId", excludeId);
+        }
+
+        if (StringUtils.isNotEmpty(dataType)) {
+            //1查目录-2查值
+            searchParams.put("dataType", dataType);
+        }
+
+
+        Page<DataDictionary> page = dataDictionaryService.pageSearch(searchParams,0, limit,sortList);
+        List<DataDictionary> dataDictionaryList = page.getResult();
+        msgResult.setResult(true);
+        msgResult.setData(dataDictionaryList);
+
+        return msgResult;
+    }
+
+
+    @ApiOperation(value = "查询字典")
+    @RequestMapping(value = "queryChildren", method = RequestMethod.POST)
+    public MessageResult<List> queryChildren(
+            @RequestParam(value = "parentId", defaultValue = "") String parentId,
+            @RequestAttribute String subject) {
+        MessageResult<List> msgResult = new MessageResult<>();
+
+        List<Map<String, Object>> dataDictionaryList = dataDictionaryService.queryChildren(parentId);
+        msgResult.setResult(true);
+        msgResult.setData(dataDictionaryList);
+        return msgResult;
+    }
+
+    @PostMapping("findByCatalogName")
+    @ApiOperation(value = "根据目录名称查询数据列表")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "catalogName",value = "数据目录名称", required = true, paramType = "form",dataType = "String"),
+    })
+    public MessageResult<List> findByCatalogName(String catalogName){
+        MessageResult<List> messageResult = new MessageResult<>();
+
+        try {
+            //todo
+            List<DataDictionary> list = dataDictionaryService.findByCatalogName(catalogName);
+            messageResult.setData(list);
+
+            messageResult.setResult(true);
+        }
+        catch (Exception ex){
+            messageResult.setResult(false);
+            messageResult.setMessage(ex.getMessage());
+        }
+
+        return messageResult;
+    }
+}

+ 128 - 0
src/main/java/com/jpsoft/making_friends/modules/sys/controller/LogController.java

@@ -0,0 +1,128 @@
+package com.jpsoft.making_friends.modules.sys.controller;
+
+import com.github.pagehelper.Page;
+import com.jpsoft.making_friends.dto.MessageResult;
+import com.jpsoft.making_friends.dto.Sort;
+import com.jpsoft.making_friends.dto.utils.PojoUtils;
+import com.jpsoft.making_friends.entity.sys.SysLog;
+import com.jpsoft.making_friends.service.sys.SysLogService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.format.annotation.DateTimeFormat;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.*;
+
+@RestController
+@RequestMapping("/sys/log")
+@Api(description = "系统日志")
+public class LogController {
+    private Logger logger = LoggerFactory.getLogger(getClass());
+
+    @Autowired
+    private SysLogService sysLogService;
+
+    @GetMapping("add")
+    @Transactional(rollbackFor = Exception.class)
+    public MessageResult<SysLog> add() throws Exception{
+        MessageResult<SysLog> messageResult = new MessageResult<>();
+
+        SysLog sysLog = new SysLog();
+        sysLog.setUserId("test");
+        messageResult.setData(sysLog);
+
+        int affectCount = sysLogService.insert(sysLog);
+
+        logger.warn("affectCount=" + affectCount);
+
+        if (affectCount>0){
+            throw new Exception("回滚测试");
+        }
+
+        return messageResult;
+    }
+
+    @ApiOperation(value="列表")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "userId",value = "用户编号", paramType = "form"),
+            @ApiImplicitParam(name = "url",value = "url",  paramType = "form"),
+            @ApiImplicitParam(name = "remoteIP",value = "远程IP", paramType="form"),
+            @ApiImplicitParam(name = "startTime",value = "开始时间", paramType="form"),
+            @ApiImplicitParam(name = "endTime",value = "结束时间", paramType="form"),
+            @ApiImplicitParam(name = "elapseMin",value = "耗时大于(毫秒)", paramType="form"),
+            @ApiImplicitParam(name = "elapseMax",value = "耗时小于(毫秒)", paramType="form"),
+            @ApiImplicitParam(name = "pointcut",value = "切入口", paramType="form"),
+            @ApiImplicitParam(name = "remoteIP",value = "远程IP", paramType="form"),
+            @ApiImplicitParam(name = "remark",value = "备注", paramType="form")
+    })
+    @RequestMapping(value = "pageList",method = RequestMethod.POST)
+    public MessageResult<Map> pageList(
+            String userId,
+            String url,
+            String remoteIP,
+            Long elapseMin,
+            Long elapseMax,
+            String pointcut,
+            String remark,
+            @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm") Date startTime,
+            @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm") Date endTime,
+            @RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
+            @RequestParam(value="pageSize",defaultValue="20") int pageSize){
+        MessageResult<Map> msgResult = new MessageResult<>();
+
+        Map<String,Object> searchParams = new HashMap<>();
+
+        List<Sort> sortList = new ArrayList<>();
+        sortList.add(new Sort("create_time","desc"));
+
+        if (StringUtils.isNotEmpty(userId)) {
+            searchParams.put("userId",userId);
+        }
+
+        if (StringUtils.isNotEmpty(url)) {
+            searchParams.put("url",url + "%");
+        }
+
+        if (StringUtils.isNotEmpty(remoteIP)) {
+            searchParams.put("remoteIP",remoteIP + "%");
+        }
+
+        if (StringUtils.isNotEmpty(pointcut)) {
+            searchParams.put("pointcut",pointcut + "%");
+        }
+
+        if (startTime!=null) {
+            searchParams.put("startTime",startTime);
+        }
+
+        if (endTime!=null) {
+            searchParams.put("endTime",endTime);
+        }
+
+        if (elapseMin!=null){
+            searchParams.put("elapseMin",elapseMin);
+        }
+
+        if (elapseMax!=null){
+            searchParams.put("elapseMax",elapseMax);
+        }
+
+        if (StringUtils.isNotEmpty(remark)) {
+            searchParams.put("remark","%" + remark + "%");
+        }
+
+        Page<SysLog> page = sysLogService.pageSearch(searchParams,pageIndex,pageSize,sortList);
+
+        msgResult.setResult(true);
+        msgResult.setData(PojoUtils.pageWrapper(page));
+
+        return msgResult;
+    }
+}

+ 283 - 0
src/main/java/com/jpsoft/making_friends/modules/sys/controller/MenuController.java

@@ -0,0 +1,283 @@
+package com.jpsoft.making_friends.modules.sys.controller;
+
+import com.github.pagehelper.Page;
+import com.jpsoft.making_friends.dto.MessageResult;
+import com.jpsoft.making_friends.dto.Sort;
+import com.jpsoft.making_friends.dto.utils.PojoUtils;
+import com.jpsoft.making_friends.entity.sys.Menu;
+import com.jpsoft.making_friends.service.sys.MenuService;
+import io.swagger.annotations.ApiOperation;
+import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.*;
+
+@RestController
+@RequestMapping("/sys/menu")
+public class MenuController {
+    private Logger logger = LoggerFactory.getLogger(getClass());
+
+    @Autowired
+    private MenuService menuService;
+
+    @ApiOperation(value = "创建空记录")
+    @GetMapping("create")
+    public MessageResult<Menu> create() {
+        MessageResult<Menu> msgResult = new MessageResult<>();
+
+        Menu menu = new Menu();
+
+        msgResult.setData(menu);
+        msgResult.setResult(true);
+
+        return msgResult;
+    }
+
+    @ApiOperation(value = "添加信息")
+    @PostMapping("add")
+    public MessageResult<Menu> add(@RequestBody Menu menu, @RequestAttribute String subject) {
+        MessageResult<Menu> msgResult = new MessageResult<>();
+
+        try {
+            menu.setId(UUID.randomUUID().toString());
+            menu.setDelFlag(false);
+            menu.setCreateBy(subject);
+            menu.setCreateTime(new Date());
+
+            int affectCount = menuService.insert(menu);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(menu);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库添加失败");
+            }
+        } catch (Exception ex) {
+            logger.error(ex.getMessage(), ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value = "获取信息")
+    @GetMapping("edit/{id}")
+    public MessageResult<Menu> edit(@PathVariable("id") String id) {
+        MessageResult<Menu> msgResult = new MessageResult<>();
+
+        try {
+            Menu menu = menuService.get(id);
+
+            if (menu != null) {
+                msgResult.setResult(true);
+                msgResult.setData(menu);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库不存在该记录!");
+            }
+        } catch (Exception ex) {
+            logger.error(ex.getMessage(), ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value = "更新用户")
+    @PostMapping("update")
+    public MessageResult<Menu> update(@RequestBody Menu menu, @RequestAttribute String subject) {
+        MessageResult<Menu> msgResult = new MessageResult<>();
+
+        try {
+            menu.setUpdateBy(subject);
+            menu.setUpdateTime(new Date());
+
+            int affectCount = menuService.update(menu);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(menu);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库更新失败");
+            }
+        } catch (Exception ex) {
+            logger.error(ex.getMessage(), ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value = "删除")
+    @PostMapping("delete/{id}")
+    public MessageResult<Integer> delete(@PathVariable("id") String id, @RequestAttribute String subject) {
+        MessageResult<Integer> msgResult = new MessageResult<>();
+
+        try {
+            Menu menu = menuService.get(id);
+            menu.setDelFlag(true);
+            menu.setUpdateBy(subject);
+            menu.setUpdateTime(new Date());
+
+            int affectCount = menuService.update(menu);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(affectCount);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("删除失败");
+            }
+        } catch (Exception ex) {
+            logger.error(ex.getMessage(), ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+
+    @ApiOperation(value = "批量删除")
+    @PostMapping("batchDelete")
+    public MessageResult<Integer> batchDelete(@RequestBody List<String> idList, @RequestAttribute String subject) {
+        MessageResult<Integer> msgResult = new MessageResult<>();
+
+        try {
+            int affectCount = 0;
+
+            for (String id : idList) {
+                Menu menu = menuService.get(id);
+                menu.setDelFlag(true);
+                menu.setUpdateBy(subject);
+                menu.setUpdateTime(new Date());
+
+                affectCount += menuService.update(menu);
+            }
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(affectCount);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("删除失败");
+            }
+        } catch (Exception ex) {
+            logger.error(ex.getMessage(), ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value = "查询")
+    @RequestMapping(value = "query", method = RequestMethod.POST)
+    public MessageResult<List> query(
+            String keywords,
+            String excludeId,
+            @RequestParam(value = "limit", defaultValue = "20") int limit,
+            @RequestAttribute String subject) {
+        MessageResult<List> msgResult = new MessageResult<>();
+
+        Map<String, Object> searchParams = new HashMap<>();
+
+        List<Sort> sortList = new ArrayList<>();
+        sortList.add(new Sort("a.sort_no", "asc"));
+
+        if (StringUtils.isNotEmpty(keywords)) {
+            searchParams.put("menuName", "%" + keywords + "%");
+        }
+
+        if (StringUtils.isNotEmpty(excludeId)) {
+            searchParams.put("excludeId", excludeId);
+        }
+
+        List<Menu> menuList = menuService.query(searchParams, limit, sortList);
+
+        msgResult.setResult(true);
+        msgResult.setData(menuList);
+
+        return msgResult;
+    }
+
+    @ApiOperation(value = "列表")
+    @RequestMapping(value = "pageList", method = RequestMethod.POST)
+    public MessageResult<Map> pageList(
+            String menuName,
+            String menuType,
+            String parentId,
+            @RequestParam(name="pageIndex",defaultValue = "1") int pageIndex,
+            @RequestParam(name="pageSize",defaultValue = "10") int pageSize,
+            @RequestAttribute String subject) {
+
+        //当前用户ID
+        System.out.println(subject);
+
+        MessageResult<Map> msgResult = new MessageResult<>();
+
+        Map<String, Object> searchParams = new HashMap<>();
+
+        List<Sort> sortList = new ArrayList<>();
+        sortList.add(new Sort("sort_no", "asc"));
+
+        if (StringUtils.isNotEmpty(menuName)) {
+            searchParams.put("menuName", "%" + menuName + "%");
+        }
+
+        if (StringUtils.isNotEmpty(menuType)) {
+            searchParams.put("menuType", menuType);
+        }
+
+        if (StringUtils.isNotEmpty(parentId)) {
+            searchParams.put("parentId", parentId);
+        }
+
+        Page<Menu> page = menuService.pageSearch(searchParams, pageIndex, pageSize, sortList);
+
+        msgResult.setResult(true);
+        msgResult.setData(PojoUtils.pageWrapper(page));
+
+        return msgResult;
+    }
+
+    @ApiOperation(value = "获取授权菜单")
+    @GetMapping("tree")
+    public MessageResult<List> tree(@RequestAttribute("subject") String subject) {
+        MessageResult<List> msgResult = new MessageResult<>();
+
+        List<Menu> list = menuService.findAllocMenu(subject,null);
+
+        findChildrenLoop(list,subject,0,5);
+
+        msgResult.setData(list);
+        msgResult.setResult(true);
+
+        return msgResult;
+    }
+
+    private void findChildrenLoop(List<Menu> list, String subject,int deep,int max) {
+        if (deep<max) {
+            for (Menu menu : list) {
+                List<Menu> children = menuService.findAllocMenu(subject,menu.getId());
+
+                menu.setChildren(children);
+
+                findChildrenLoop(children,subject,deep+1,max);
+            }
+        }
+    }
+}

+ 310 - 0
src/main/java/com/jpsoft/making_friends/modules/sys/controller/PermissionController.java

@@ -0,0 +1,310 @@
+package com.jpsoft.making_friends.modules.sys.controller;
+
+import com.github.pagehelper.Page;
+import com.jpsoft.making_friends.dto.MessageResult;
+import com.jpsoft.making_friends.dto.Sort;
+import com.jpsoft.making_friends.dto.utils.PojoUtils;
+import com.jpsoft.making_friends.entity.sys.Permission;
+import com.jpsoft.making_friends.service.sys.PermissionService;
+import com.jpsoft.making_friends.service.sys.RolePermissionService;
+import io.swagger.annotations.ApiOperation;
+import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.*;
+
+@RestController
+@RequestMapping("/sys/permission")
+public class PermissionController {
+    private Logger logger = LoggerFactory.getLogger(getClass());
+
+    @Autowired
+    private PermissionService permissionService;
+
+    @Autowired
+    private RolePermissionService rolePermissionService;
+
+    @ApiOperation(value="创建空记录")
+    @GetMapping("create")
+    public MessageResult<Permission> create(){
+        MessageResult<Permission> msgResult = new MessageResult<>();
+
+        Permission permission = new Permission();
+
+        msgResult.setData(permission);
+        msgResult.setResult(true);
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="批量导入")
+    @PostMapping("batchImport")
+    public MessageResult<Integer> batchImport(@RequestBody List<Permission> permList,@RequestAttribute String subject){
+        MessageResult<Integer> msgResult = new MessageResult<>();
+
+        try {
+            int affectCount = 0;
+
+            for (Permission permission : permList) {
+                if(!permissionService.exist(permission.getPath(),permission.getMethod())){
+                    permission.setId(UUID.randomUUID().toString());
+                    permission.setDelFlag(false);
+                    permission.setCreateBy(subject);
+                    permission.setCreateTime(new Date());
+
+                    affectCount += permissionService.insert(permission);
+                }
+            }
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(affectCount);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("未导入新记录!");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+    
+    @ApiOperation(value="添加信息")
+    @PostMapping("add")
+    public MessageResult<Permission> add(@RequestBody Permission permission,@RequestAttribute String subject){
+        MessageResult<Permission> msgResult = new MessageResult<>();
+
+        try {
+            permission.setId(UUID.randomUUID().toString());
+            permission.setDelFlag(false);
+            permission.setCreateBy(subject);
+            permission.setCreateTime(new Date());
+            
+            int affectCount = permissionService.insert(permission);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(permission);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库添加失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="获取信息")
+    @GetMapping("edit/{id}")
+    public MessageResult<Permission> edit(@PathVariable("id") String id){
+        MessageResult<Permission> msgResult = new MessageResult<>();
+
+        try {
+            Permission permission = permissionService.get(id);
+
+            if (permission != null) {
+                msgResult.setResult(true);
+                msgResult.setData(permission);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库不存在该记录!");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="更新用户")
+    @PostMapping("update")
+    public MessageResult<Permission> update(@RequestBody Permission permission,@RequestAttribute String subject){
+        MessageResult<Permission> msgResult = new MessageResult<>();
+
+        try {
+            permission.setUpdateBy(subject);
+            permission.setUpdateTime(new Date());
+            
+            int affectCount = permissionService.update(permission);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(permission);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库更新失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+	@ApiOperation(value="删除")
+    @PostMapping("delete/{id}")
+    public MessageResult<Integer> delete(@PathVariable("id") String id,@RequestAttribute String subject){
+        MessageResult<Integer> msgResult = new MessageResult<>();
+
+        try {
+            Permission permission = permissionService.get(id);
+            permission.setDelFlag(true);
+            permission.setUpdateBy(subject);
+            permission.setUpdateTime(new Date());
+
+            int affectCount = permissionService.update(permission);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(affectCount);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("删除失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="获取所有权限")
+    @GetMapping(value = "selectAll")
+    public MessageResult<List> selectAll(){
+        MessageResult<List> msgResult = new MessageResult<>();
+
+        try {
+            List<Permission> perms = permissionService.list();
+
+            msgResult.setResult(true);
+            msgResult.setData(perms);
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="批量删除")
+    @PostMapping("batchDelete")
+    public MessageResult<Integer> batchDelete(@RequestBody List<String> idList,@RequestAttribute String subject){
+        MessageResult<Integer> msgResult = new MessageResult<>();
+
+        try {
+            int affectCount = 0;
+
+            for (String id : idList) {
+                Permission permission = permissionService.get(id);
+                permission.setDelFlag(true);
+                permission.setUpdateBy(subject);
+                permission.setUpdateTime(new Date());
+
+                affectCount += permissionService.update(permission);
+            }
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(affectCount);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("删除失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="列表")
+    @RequestMapping(value = "pageList",method = RequestMethod.POST)
+    public MessageResult<Map> pageList(
+            String path,
+            @RequestParam(name="pageIndex",defaultValue = "1") int pageIndex,
+            @RequestParam(name="pageSize",defaultValue = "10") int pageSize,
+            @RequestAttribute String subject){
+
+        //当前用户ID
+        System.out.println(subject);
+
+        MessageResult<Map> msgResult = new MessageResult<>();
+
+        Map<String,Object> searchParams = new HashMap<>();
+
+        List<Sort> sortList = new ArrayList<>();
+        sortList.add(new Sort("path_","asc"));
+
+        if (StringUtils.isNotEmpty(path)) {
+            searchParams.put("path","%" + path + "%");
+        }
+
+        Page<Permission> page = permissionService.pageSearch(searchParams,pageIndex,pageSize,sortList);
+
+        msgResult.setResult(true);
+        msgResult.setData(PojoUtils.pageWrapper(page));
+
+        return msgResult;
+    }
+
+    @PostMapping("hasPermission")
+    @ApiOperation(value="是否拥有权限")
+    public MessageResult<String> hasPermission(String path,String method,@RequestAttribute String subject){
+        MessageResult<String> messageResult = new MessageResult<>();
+
+        try {
+            String data = null;
+
+            String userId = subject;
+
+            boolean permitted = permissionService.hasPermitted(userId, path, method);
+
+            messageResult.setResult(permitted);
+
+            if (!permitted){
+                messageResult.setMessage("当前用户无权限访问该接口!");
+            }
+        }
+        catch (Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            messageResult.setResult(false);
+            messageResult.setMessage(ex.getMessage());
+        }
+
+        return messageResult;
+    }
+}

+ 377 - 0
src/main/java/com/jpsoft/making_friends/modules/sys/controller/RoleController.java

@@ -0,0 +1,377 @@
+package com.jpsoft.making_friends.modules.sys.controller;
+
+import com.github.pagehelper.Page;
+import com.jpsoft.making_friends.dto.MessageResult;
+import com.jpsoft.making_friends.dto.Sort;
+import com.jpsoft.making_friends.dto.utils.PojoUtils;
+import com.jpsoft.making_friends.dto.RoleRelatedDTO;
+import com.jpsoft.making_friends.entity.sys.Role;
+import com.jpsoft.making_friends.entity.sys.RoleMenu;
+import com.jpsoft.making_friends.entity.sys.RolePermission;
+import com.jpsoft.making_friends.service.sys.RoleMenuService;
+import com.jpsoft.making_friends.service.sys.RolePermissionService;
+import com.jpsoft.making_friends.service.sys.RoleService;
+import io.swagger.annotations.ApiOperation;
+import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.*;
+
+@RestController
+@RequestMapping("/sys/role")
+public class RoleController {
+    private Logger logger = LoggerFactory.getLogger(getClass());
+
+    @Autowired
+    private RoleService roleService;
+
+    @Autowired
+    private RoleMenuService roleMenuService;
+
+    @Autowired
+    private RolePermissionService rolePermissionService;
+
+    @ApiOperation(value="创建空记录")
+    @GetMapping("create")
+    public MessageResult<Role> create(){
+        MessageResult<Role> msgResult = new MessageResult<>();
+
+        Role role = new Role();
+
+        msgResult.setData(role);
+        msgResult.setResult(true);
+
+        return msgResult;
+    }
+    
+    @ApiOperation(value="添加信息")
+    @PostMapping("add")
+    public MessageResult<Role> add(@RequestBody Role role,@RequestAttribute String subject){
+        MessageResult<Role> msgResult = new MessageResult<>();
+
+            try {
+            role.setId(UUID.randomUUID().toString());
+            role.setDelFlag(false);
+            role.setCreateBy(subject);
+            role.setCreateTime(new Date());
+            
+            int affectCount = roleService.insert(role);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(role);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库添加失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="获取信息")
+    @GetMapping("edit/{id}")
+    public MessageResult<Role> edit(@PathVariable("id") String id){
+        MessageResult<Role> msgResult = new MessageResult<>();
+
+        try {
+            Role role = roleService.get(id);
+
+            if (role != null) {
+                msgResult.setResult(true);
+                msgResult.setData(role);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库不存在该记录!");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="更新用户")
+    @PostMapping("update")
+    public MessageResult<Role> update(@RequestBody Role role,@RequestAttribute String subject){
+        MessageResult<Role> msgResult = new MessageResult<>();
+
+        try {
+            role.setUpdateBy(subject);
+            role.setUpdateTime(new Date());
+            
+            int affectCount = roleService.update(role);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(role);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库更新失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+	@ApiOperation(value="删除")
+    @PostMapping("delete/{id}")
+    public MessageResult<Integer> delete(@PathVariable("id") String id,@RequestAttribute String subject){
+        MessageResult<Integer> msgResult = new MessageResult<>();
+
+        try {
+            Role role = roleService.get(id);
+            role.setDelFlag(true);
+            role.setUpdateBy(subject);
+            role.setUpdateTime(new Date());
+
+            int affectCount = roleService.update(role);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(affectCount);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("删除失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+
+    @ApiOperation(value="批量删除")
+    @PostMapping("batchDelete")
+    public MessageResult<Integer> batchDelete(@RequestBody List<String> idList,@RequestAttribute String subject){
+        MessageResult<Integer> msgResult = new MessageResult<>();
+
+        try {
+            int affectCount = 0;
+
+            for (String id : idList) {
+                Role role = roleService.get(id);
+                role.setDelFlag(true);
+                role.setUpdateBy(subject);
+                role.setUpdateTime(new Date());
+
+                affectCount += roleService.update(role);
+            }
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(affectCount);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("删除失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="获取所有角色")
+    @GetMapping(value = "selectAll")
+    public MessageResult<List> selectAll(){
+        MessageResult<List> msgResult = new MessageResult<>();
+
+        try {
+            List<Role> roles = roleService.list();
+
+            msgResult.setResult(true);
+            msgResult.setData(roles);
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="列表")
+    @RequestMapping(value = "pageList",method = RequestMethod.POST)
+    public MessageResult<Map> pageList(
+            String roleName,
+            String roleDesc,
+            @RequestParam(name="pageIndex",defaultValue = "1") int pageIndex,
+            @RequestParam(name="pageSize",defaultValue = "10") int pageSize,
+            @RequestParam(value="field",defaultValue="create_time") String field,
+            @RequestParam(value="direction",defaultValue="asc") String direction,
+            HttpServletRequest request){
+        String subject = (String)request.getAttribute("subject");
+
+        //当前用户ID
+        System.out.println(subject);
+
+        MessageResult<Map> msgResult = new MessageResult<>();
+
+        Map<String,Object> searchParams = new HashMap<>();
+
+        List<Sort> sortList = new ArrayList<>();
+        sortList.add(new Sort(field,direction));
+
+        if (StringUtils.isNotEmpty(roleName)) {
+            searchParams.put("roleName","%" + roleName + "%");
+        }
+
+        if (StringUtils.isNotEmpty(roleDesc)) {
+            searchParams.put("roleDesc","%" + roleDesc + "%");
+        }
+
+        Page<Role> page = roleService.pageSearch(searchParams,pageIndex,pageSize,sortList);
+
+        msgResult.setResult(true);
+        msgResult.setData(PojoUtils.pageWrapper(page));
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="获取已分配菜单列表")
+    @GetMapping(value = "queryRelatedMenuList")
+    public MessageResult<List> queryRelatedMenuList(String roleId){
+        MessageResult<List> msgResult = new MessageResult<>();
+
+        try {
+            List<RoleMenu> list = roleMenuService.findByRoleId(roleId);
+
+            msgResult.setResult(true);
+            msgResult.setData(list);
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="保存关联菜单")
+    @PostMapping(value = "saveRelatedMenu")
+    @Transactional(rollbackFor = Exception.class)
+    public MessageResult<Integer> saveRelatedMenu(@RequestBody RoleRelatedDTO dto,String subject){
+        MessageResult<Integer> msgResult = new MessageResult<>();
+
+        try {
+            roleMenuService.deleteByRoleId(dto.getRoleId());
+
+            int affectCount = 0;
+
+            for (String menuId : dto.getRelatedList()) {
+                RoleMenu rm = new RoleMenu();
+                rm.setId(UUID.randomUUID().toString());
+                rm.setRoleId(dto.getRoleId());
+                rm.setMenuId(menuId);
+                rm.setDelFlag(false);
+                rm.setCreateBy(subject);
+                rm.setCreateTime(new Date());
+
+                affectCount+= roleMenuService.insert(rm);
+            }
+
+            msgResult.setResult(true);
+            msgResult.setData(affectCount);
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="获取已分配接口权限列表")
+    @GetMapping(value = "queryRelatedPerms")
+    @Transactional(rollbackFor = Exception.class)
+    public MessageResult<List> queryRelatedPerms(String roleId){
+        MessageResult<List> msgResult = new MessageResult<>();
+
+        try {
+            List<RolePermission> list = rolePermissionService.findByRoleId(roleId);
+
+            msgResult.setResult(true);
+            msgResult.setData(list);
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="保存关联接口权限")
+    @PostMapping(value = "saveRelatedPermission")
+    public MessageResult<Integer> saveRelatedPermission(@RequestBody RoleRelatedDTO dto,String subject){
+        MessageResult<Integer> msgResult = new MessageResult<>();
+
+        try {
+            rolePermissionService.deleteByRoleId(dto.getRoleId());
+
+            int affectCount = 0;
+
+            for (String permissionId : dto.getRelatedList()) {
+                RolePermission rp = new RolePermission();
+                rp.setId(UUID.randomUUID().toString());
+                rp.setRoleId(dto.getRoleId());
+                rp.setPermId(permissionId);
+                rp.setDelFlag(false);
+                rp.setCreateBy(subject);
+                rp.setCreateTime(new Date());
+
+                affectCount+= rolePermissionService.insert(rp);
+            }
+
+            msgResult.setResult(true);
+            msgResult.setData(affectCount);
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+}

+ 379 - 0
src/main/java/com/jpsoft/making_friends/modules/sys/controller/UserController.java

@@ -0,0 +1,379 @@
+package com.jpsoft.making_friends.modules.sys.controller;
+
+import com.github.pagehelper.Page;
+import com.jpsoft.making_friends.dto.MessageResult;
+import com.jpsoft.making_friends.dto.Sort;
+import com.jpsoft.making_friends.dto.utils.DES3;
+import com.jpsoft.making_friends.dto.utils.PojoUtils;
+import com.jpsoft.making_friends.entity.sys.Role;
+import com.jpsoft.making_friends.entity.sys.User;
+import com.jpsoft.making_friends.entity.sys.UserRole;
+import com.jpsoft.making_friends.service.sys.UserRoleService;
+import com.jpsoft.making_friends.service.sys.UserService;
+import io.swagger.annotations.ApiOperation;
+import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.*;
+import java.util.stream.Collectors;
+
+@RestController
+@RequestMapping("/sys/user")
+public class UserController {
+    private Logger logger = LoggerFactory.getLogger(getClass());
+
+    @Autowired
+    private UserService userService;
+
+    @Autowired
+    private UserRoleService userRoleService;
+
+    @Value("${jwt.secret}")
+    private String jwtSecret;
+
+    @ApiOperation(value="创建空记录")
+    @GetMapping("create")
+    public MessageResult<User> create(){
+        MessageResult<User> msgResult = new MessageResult<>();
+
+        User user = new User();
+
+        msgResult.setData(user);
+        msgResult.setResult(true);
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="添加信息")
+    @PostMapping("add")
+    public MessageResult<User> add(@RequestBody User user, @RequestAttribute  String subject){
+        MessageResult<User> msgResult = new MessageResult<>();
+
+        try {
+            if(StringUtils.isEmpty(user.getUserName())){
+                throw new Exception("用户名不能为空!");
+            }
+
+            if(StringUtils.isEmpty(user.getPassword())){
+                throw new Exception("密码不能为空!");
+            }
+
+            User existUser = userService.findByUserName(user.getUserName());
+
+            if (existUser!=null){
+                throw new Exception("用户名已存在!");
+            }
+
+            user.setId(UUID.randomUUID().toString());
+            DES3 des3 = new DES3();
+            user.setPassword(des3.encrypt(jwtSecret,user.getPassword()));
+            user.setCreateBy(subject);
+            user.setCreateTime(new Date());
+            user.setDelFlag(false);
+
+            int affectCount = userService.insert(user);
+
+            if (affectCount > 0) {
+                if(user.getRoles()!=null){
+                    for (String roleId : user.getRoles()) {
+                        UserRole ur = new UserRole();
+
+                        ur.setId(UUID.randomUUID().toString());
+                        ur.setUserId(user.getId());
+                        ur.setRoleId(roleId);
+                        ur.setCreateBy(subject);
+                        ur.setCreateTime(new Date());
+                        ur.setDelFlag(false);
+
+                        userRoleService.insert(ur);
+                    }
+                }
+
+                msgResult.setResult(true);
+                msgResult.setData(user);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库添加失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="获取信息")
+    @GetMapping("edit/{id}")
+    public MessageResult<User> edit(@PathVariable("id") String id){
+        MessageResult<User> msgResult = new MessageResult<>();
+
+        try {
+            User user = userService.get(id);
+
+            if (user != null) {
+                List<Role> roles = userRoleService.findRoleByUserId(user.getId());
+
+                user.setRoles(roles.stream().map((role)->role.getId()).collect(Collectors.toList()));
+
+                msgResult.setResult(true);
+                msgResult.setData(user);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库不存在该记录!");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="更新用户")
+    @PostMapping("update")
+    @Transactional(rollbackFor = Exception.class)
+    public MessageResult<User> update(@RequestBody User user,@RequestAttribute String subject){
+        MessageResult<User> msgResult = new MessageResult<>();
+
+        try {
+            //设置密码为空 不做修改
+            user.setPassword(null);
+
+            int affectCount = userService.update(user);
+
+            user.setUpdateBy(subject);
+            user.setUpdateTime(new Date());
+
+            if(user.getRoles()!=null){
+                affectCount = userRoleService.deleteByUserId(user.getId());
+
+                for (String roleId : user.getRoles()) {
+                    UserRole ur = new UserRole();
+
+                    ur.setId(UUID.randomUUID().toString());
+                    ur.setUserId(user.getId());
+                    ur.setRoleId(roleId);
+                    ur.setCreateBy(subject);
+                    ur.setCreateTime(new Date());
+                    ur.setDelFlag(false);
+
+                    affectCount += userRoleService.insert(ur);
+                }
+            }
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(user);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库更新失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="删除用户")
+    @PostMapping("delete/{id}")
+    public MessageResult<Integer> delete(@PathVariable("id") String id,@RequestAttribute String subject){
+        MessageResult<Integer> msgResult = new MessageResult<>();
+
+        try {
+            User user = userService.get(id);
+            user.setDelFlag(true);
+            user.setUpdateBy(subject);
+            user.setUpdateTime(new Date());
+
+            int affectCount = userService.update(user);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(affectCount);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("删除失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+
+    @ApiOperation(value="批量删除")
+    @PostMapping("batchDelete")
+    public MessageResult<Integer> batchDelete(@RequestBody List<String> idList,@RequestAttribute String subject){
+        MessageResult<Integer> msgResult = new MessageResult<>();
+
+        try {
+            int affectCount = 0;
+
+            for (String id : idList) {
+                User user = userService.get(id);
+                user.setDelFlag(true);
+                user.setUpdateBy(subject);
+                user.setUpdateTime(new Date());
+
+                affectCount += userService.update(user);
+            }
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(affectCount);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("删除失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="列表")
+    @RequestMapping(value = "pageList",method = RequestMethod.POST)
+    public MessageResult<Map> pageList(
+            String userName,String realName,String companyId,String roleId,
+            @RequestParam(name="pageIndex",defaultValue = "1") int pageIndex,
+            @RequestParam(name="pageSize",defaultValue = "10") int pageSize,
+            @RequestAttribute String subject){
+        MessageResult<Map> msgResult = new MessageResult<>();
+
+        Map<String,Object> searchParms = new HashMap<>();
+
+        List<Sort> sortList = new ArrayList<>();
+        sortList.add(new Sort("a.create_time","asc"));
+
+        if (StringUtils.isNotEmpty(userName)) {
+            searchParms.put("userName","%" + userName + "%");
+        }
+
+        if (StringUtils.isNotEmpty(realName)) {
+            searchParms.put("realName","%" + realName + "%");
+        }
+
+        if (StringUtils.isNotEmpty(companyId)) {
+            searchParms.put("companyId",companyId);
+        }
+
+        if (StringUtils.isNotEmpty(roleId)) {
+            searchParms.put("roleId",roleId);
+        }
+
+        Page<User> page = userService.pageSearch(searchParms,pageIndex,pageSize,sortList);
+
+        msgResult.setResult(true);
+
+        msgResult.setData(PojoUtils.pageWrapper(page));
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="修改用户密码")
+    @PostMapping("changeUserPassword")
+    public MessageResult<Integer> changeUserPassword(String userId,String newPwd,@RequestAttribute String subject) {
+
+        MessageResult<Integer> msgResult = new MessageResult<>();
+
+        try {
+
+            User user = userService.get(userId);
+
+            DES3 des3 = new DES3();
+
+            user.setPassword(des3.encrypt(jwtSecret, newPwd));
+            user.setUpdateBy(subject);
+            user.setUpdateTime(new Date());
+
+            int affectCount = userService.update(user);
+
+            if(affectCount>0){
+                msgResult.setResult(true);
+                msgResult.setData(affectCount);
+            }
+            else{
+                msgResult.setResult(false);
+                msgResult.setMessage("修改失败!");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+
+    @ApiOperation(value="登录用户修改密码")
+    @PostMapping("changeLoginPassword")
+    public MessageResult<Integer> changeLoginPassword(
+            @RequestParam(name="oldPassword",defaultValue = "") String oldPassword,
+            @RequestParam(name="newPassword",defaultValue = "") String newPassword,
+            @RequestAttribute String subject) {
+
+        MessageResult<Integer> msgResult = new MessageResult<>();
+
+        try {
+            DES3 des3 = new DES3();
+            User user = userService.get(subject);
+
+            oldPassword = des3.encrypt(jwtSecret, oldPassword);
+            //不相同
+            if(!user.getPassword().equals(oldPassword)){
+                throw new Exception("旧密码输入错误");
+            }
+
+            user.setPassword(des3.encrypt(jwtSecret, newPassword));
+            user.setUpdateBy(subject);
+            user.setUpdateTime(new Date());
+
+            int affectCount = userService.update(user);
+
+            if(affectCount>0){
+                msgResult.setResult(true);
+                msgResult.setData(affectCount);
+            }
+            else{
+                msgResult.setResult(false);
+                msgResult.setMessage("修改失败!");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+}

+ 17 - 0
src/main/java/com/jpsoft/making_friends/service/base/HobbyInfoService.java

@@ -0,0 +1,17 @@
+package com.jpsoft.making_friends.service.base;
+
+import java.util.List;
+import java.util.Map;
+import com.jpsoft.making_friends.entity.base.HobbyInfo;
+import com.github.pagehelper.Page;
+import com.jpsoft.making_friends.dto.Sort;
+
+public interface HobbyInfoService {
+	HobbyInfo get(String id);
+	boolean exist(String id);
+	int insert(HobbyInfo model);
+	int update(HobbyInfo model);
+	int delete(String id);
+	List<HobbyInfo> list();
+	Page<HobbyInfo> pageSearch(Map<String, Object> searchParams, int pageNum, int pageSize, boolean count, List<Sort> sortList);
+}

+ 17 - 0
src/main/java/com/jpsoft/making_friends/service/base/MemberHobbyService.java

@@ -0,0 +1,17 @@
+package com.jpsoft.making_friends.service.base;
+
+import java.util.List;
+import java.util.Map;
+import com.jpsoft.making_friends.entity.base.MemberHobby;
+import com.github.pagehelper.Page;
+import com.jpsoft.making_friends.dto.Sort;
+
+public interface MemberHobbyService {
+	MemberHobby get(String id);
+	boolean exist(String id);
+	int insert(MemberHobby model);
+	int update(MemberHobby model);
+	int delete(String id);
+	List<MemberHobby> list();
+	Page<MemberHobby> pageSearch(Map<String, Object> searchParams, int pageNum, int pageSize, boolean count, List<Sort> sortList);
+}

+ 17 - 0
src/main/java/com/jpsoft/making_friends/service/base/MemberInfoService.java

@@ -0,0 +1,17 @@
+package com.jpsoft.making_friends.service.base;
+
+import java.util.List;
+import java.util.Map;
+import com.jpsoft.making_friends.entity.base.MemberInfo;
+import com.github.pagehelper.Page;
+import com.jpsoft.making_friends.dto.Sort;
+
+public interface MemberInfoService {
+	MemberInfo get(String id);
+	boolean exist(String id);
+	int insert(MemberInfo model);
+	int update(MemberInfo model);
+	int delete(String id);
+	List<MemberInfo> list();
+	Page<MemberInfo> pageSearch(Map<String, Object> searchParams, int pageNum, int pageSize, boolean count, List<Sort> sortList);
+}

+ 17 - 0
src/main/java/com/jpsoft/making_friends/service/base/NewsInfoService.java

@@ -0,0 +1,17 @@
+package com.jpsoft.making_friends.service.base;
+
+import java.util.List;
+import java.util.Map;
+import com.jpsoft.making_friends.entity.base.NewsInfo;
+import com.github.pagehelper.Page;
+import com.jpsoft.making_friends.dto.Sort;
+
+public interface NewsInfoService {
+	NewsInfo get(String id);
+	boolean exist(String id);
+	int insert(NewsInfo model);
+	int update(NewsInfo model);
+	int delete(String id);
+	List<NewsInfo> list();
+	Page<NewsInfo> pageSearch(Map<String, Object> searchParams, int pageNum, int pageSize, boolean count, List<Sort> sortList);
+}

+ 17 - 0
src/main/java/com/jpsoft/making_friends/service/base/NewsTypeService.java

@@ -0,0 +1,17 @@
+package com.jpsoft.making_friends.service.base;
+
+import java.util.List;
+import java.util.Map;
+import com.jpsoft.making_friends.entity.base.NewsType;
+import com.github.pagehelper.Page;
+import com.jpsoft.making_friends.dto.Sort;
+
+public interface NewsTypeService {
+	NewsType get(String id);
+	boolean exist(String id);
+	int insert(NewsType model);
+	int update(NewsType model);
+	int delete(String id);
+	List<NewsType> list();
+	Page<NewsType> pageSearch(Map<String, Object> searchParams, int pageNum, int pageSize, boolean count, List<Sort> sortList);
+}

+ 17 - 0
src/main/java/com/jpsoft/making_friends/service/base/OrgInfoService.java

@@ -0,0 +1,17 @@
+package com.jpsoft.making_friends.service.base;
+
+import java.util.List;
+import java.util.Map;
+import com.jpsoft.making_friends.entity.base.OrgInfo;
+import com.github.pagehelper.Page;
+import com.jpsoft.making_friends.dto.Sort;
+
+public interface OrgInfoService {
+	OrgInfo get(String id);
+	boolean exist(String id);
+	int insert(OrgInfo model);
+	int update(OrgInfo model);
+	int delete(String id);
+	List<OrgInfo> list();
+	Page<OrgInfo> pageSearch(Map<String, Object> searchParams, int pageNum, int pageSize, boolean count, List<Sort> sortList);
+}

+ 70 - 0
src/main/java/com/jpsoft/making_friends/service/base/imp/HobbyInfoServiceImpl.java

@@ -0,0 +1,70 @@
+package com.jpsoft.making_friends.service.base.imp;
+
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+import javax.annotation.Resource;
+import org.springframework.stereotype.Component;
+import org.springframework.transaction.annotation.Transactional;
+import com.jpsoft.making_friends.dao.base.HobbyInfoDAO;
+import com.jpsoft.making_friends.entity.base.HobbyInfo;
+import com.jpsoft.making_friends.service.base.HobbyInfoService;
+import com.github.pagehelper.Page;
+import com.jpsoft.making_friends.dto.Sort;
+import com.github.pagehelper.PageHelper;
+
+@Transactional
+@Component(value="hobbyInfoService")
+public class HobbyInfoServiceImpl implements HobbyInfoService {
+	@Resource(name="hobbyInfoDAO")
+	private HobbyInfoDAO hobbyInfoDAO;
+
+	@Override
+	public HobbyInfo get(String id) {
+		// TODO Auto-generated method stub
+		return hobbyInfoDAO.get(id);
+	}
+
+	@Override
+	public int insert(HobbyInfo model) {
+		// TODO Auto-generated method stub
+		//model.setId(UUID.randomUUID().toString());
+		
+		return hobbyInfoDAO.insert(model);
+	}
+
+	@Override
+	public int update(HobbyInfo model) {
+		// TODO Auto-generated method stub
+		return hobbyInfoDAO.update(model);		
+	}
+
+	@Override
+	public int delete(String id) {
+		// TODO Auto-generated method stub
+		return hobbyInfoDAO.delete(id);
+	}
+
+	@Override
+	public boolean exist(String id) {
+		// TODO Auto-generated method stub
+		int count = hobbyInfoDAO.exist(id);
+		
+		return count > 0 ? true : false;
+	}
+	
+	@Override
+	public List<HobbyInfo> list() {
+		// TODO Auto-generated method stub
+		return hobbyInfoDAO.list();
+	}
+		
+	@Override
+	public Page<HobbyInfo> pageSearch(Map<String, Object> searchParams, int pageNumber, int pageSize,boolean count,List<Sort> sortList) {
+        Page<HobbyInfo> page = PageHelper.startPage(pageNumber,pageSize,count).doSelectPage(()->{
+            hobbyInfoDAO.search(searchParams,sortList);
+        });
+        
+        return page;
+	}
+}

+ 70 - 0
src/main/java/com/jpsoft/making_friends/service/base/imp/MemberHobbyServiceImpl.java

@@ -0,0 +1,70 @@
+package com.jpsoft.making_friends.service.base.imp;
+
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+import javax.annotation.Resource;
+import org.springframework.stereotype.Component;
+import org.springframework.transaction.annotation.Transactional;
+import com.jpsoft.making_friends.dao.base.MemberHobbyDAO;
+import com.jpsoft.making_friends.entity.base.MemberHobby;
+import com.jpsoft.making_friends.service.base.MemberHobbyService;
+import com.github.pagehelper.Page;
+import com.jpsoft.making_friends.dto.Sort;
+import com.github.pagehelper.PageHelper;
+
+@Transactional
+@Component(value="memberHobbyService")
+public class MemberHobbyServiceImpl implements MemberHobbyService {
+	@Resource(name="memberHobbyDAO")
+	private MemberHobbyDAO memberHobbyDAO;
+
+	@Override
+	public MemberHobby get(String id) {
+		// TODO Auto-generated method stub
+		return memberHobbyDAO.get(id);
+	}
+
+	@Override
+	public int insert(MemberHobby model) {
+		// TODO Auto-generated method stub
+		//model.setId(UUID.randomUUID().toString());
+		
+		return memberHobbyDAO.insert(model);
+	}
+
+	@Override
+	public int update(MemberHobby model) {
+		// TODO Auto-generated method stub
+		return memberHobbyDAO.update(model);		
+	}
+
+	@Override
+	public int delete(String id) {
+		// TODO Auto-generated method stub
+		return memberHobbyDAO.delete(id);
+	}
+
+	@Override
+	public boolean exist(String id) {
+		// TODO Auto-generated method stub
+		int count = memberHobbyDAO.exist(id);
+		
+		return count > 0 ? true : false;
+	}
+	
+	@Override
+	public List<MemberHobby> list() {
+		// TODO Auto-generated method stub
+		return memberHobbyDAO.list();
+	}
+		
+	@Override
+	public Page<MemberHobby> pageSearch(Map<String, Object> searchParams, int pageNumber, int pageSize,boolean count,List<Sort> sortList) {
+        Page<MemberHobby> page = PageHelper.startPage(pageNumber,pageSize,count).doSelectPage(()->{
+            memberHobbyDAO.search(searchParams,sortList);
+        });
+        
+        return page;
+	}
+}

+ 70 - 0
src/main/java/com/jpsoft/making_friends/service/base/imp/MemberInfoServiceImpl.java

@@ -0,0 +1,70 @@
+package com.jpsoft.making_friends.service.base.imp;
+
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+import javax.annotation.Resource;
+import org.springframework.stereotype.Component;
+import org.springframework.transaction.annotation.Transactional;
+import com.jpsoft.making_friends.dao.base.MemberInfoDAO;
+import com.jpsoft.making_friends.entity.base.MemberInfo;
+import com.jpsoft.making_friends.service.base.MemberInfoService;
+import com.github.pagehelper.Page;
+import com.jpsoft.making_friends.dto.Sort;
+import com.github.pagehelper.PageHelper;
+
+@Transactional
+@Component(value="memberInfoService")
+public class MemberInfoServiceImpl implements MemberInfoService {
+	@Resource(name="memberInfoDAO")
+	private MemberInfoDAO memberInfoDAO;
+
+	@Override
+	public MemberInfo get(String id) {
+		// TODO Auto-generated method stub
+		return memberInfoDAO.get(id);
+	}
+
+	@Override
+	public int insert(MemberInfo model) {
+		// TODO Auto-generated method stub
+		//model.setId(UUID.randomUUID().toString());
+		
+		return memberInfoDAO.insert(model);
+	}
+
+	@Override
+	public int update(MemberInfo model) {
+		// TODO Auto-generated method stub
+		return memberInfoDAO.update(model);		
+	}
+
+	@Override
+	public int delete(String id) {
+		// TODO Auto-generated method stub
+		return memberInfoDAO.delete(id);
+	}
+
+	@Override
+	public boolean exist(String id) {
+		// TODO Auto-generated method stub
+		int count = memberInfoDAO.exist(id);
+		
+		return count > 0 ? true : false;
+	}
+	
+	@Override
+	public List<MemberInfo> list() {
+		// TODO Auto-generated method stub
+		return memberInfoDAO.list();
+	}
+		
+	@Override
+	public Page<MemberInfo> pageSearch(Map<String, Object> searchParams, int pageNumber, int pageSize,boolean count,List<Sort> sortList) {
+        Page<MemberInfo> page = PageHelper.startPage(pageNumber,pageSize,count).doSelectPage(()->{
+            memberInfoDAO.search(searchParams,sortList);
+        });
+        
+        return page;
+	}
+}

+ 70 - 0
src/main/java/com/jpsoft/making_friends/service/base/imp/NewsInfoServiceImpl.java

@@ -0,0 +1,70 @@
+package com.jpsoft.making_friends.service.base.imp;
+
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+import javax.annotation.Resource;
+import org.springframework.stereotype.Component;
+import org.springframework.transaction.annotation.Transactional;
+import com.jpsoft.making_friends.dao.base.NewsInfoDAO;
+import com.jpsoft.making_friends.entity.base.NewsInfo;
+import com.jpsoft.making_friends.service.base.NewsInfoService;
+import com.github.pagehelper.Page;
+import com.jpsoft.making_friends.dto.Sort;
+import com.github.pagehelper.PageHelper;
+
+@Transactional
+@Component(value="newsInfoService")
+public class NewsInfoServiceImpl implements NewsInfoService {
+	@Resource(name="newsInfoDAO")
+	private NewsInfoDAO newsInfoDAO;
+
+	@Override
+	public NewsInfo get(String id) {
+		// TODO Auto-generated method stub
+		return newsInfoDAO.get(id);
+	}
+
+	@Override
+	public int insert(NewsInfo model) {
+		// TODO Auto-generated method stub
+		//model.setId(UUID.randomUUID().toString());
+		
+		return newsInfoDAO.insert(model);
+	}
+
+	@Override
+	public int update(NewsInfo model) {
+		// TODO Auto-generated method stub
+		return newsInfoDAO.update(model);		
+	}
+
+	@Override
+	public int delete(String id) {
+		// TODO Auto-generated method stub
+		return newsInfoDAO.delete(id);
+	}
+
+	@Override
+	public boolean exist(String id) {
+		// TODO Auto-generated method stub
+		int count = newsInfoDAO.exist(id);
+		
+		return count > 0 ? true : false;
+	}
+	
+	@Override
+	public List<NewsInfo> list() {
+		// TODO Auto-generated method stub
+		return newsInfoDAO.list();
+	}
+		
+	@Override
+	public Page<NewsInfo> pageSearch(Map<String, Object> searchParams, int pageNumber, int pageSize,boolean count,List<Sort> sortList) {
+        Page<NewsInfo> page = PageHelper.startPage(pageNumber,pageSize,count).doSelectPage(()->{
+            newsInfoDAO.search(searchParams,sortList);
+        });
+        
+        return page;
+	}
+}

+ 70 - 0
src/main/java/com/jpsoft/making_friends/service/base/imp/NewsTypeServiceImpl.java

@@ -0,0 +1,70 @@
+package com.jpsoft.making_friends.service.base.imp;
+
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+import javax.annotation.Resource;
+import org.springframework.stereotype.Component;
+import org.springframework.transaction.annotation.Transactional;
+import com.jpsoft.making_friends.dao.base.NewsTypeDAO;
+import com.jpsoft.making_friends.entity.base.NewsType;
+import com.jpsoft.making_friends.service.base.NewsTypeService;
+import com.github.pagehelper.Page;
+import com.jpsoft.making_friends.dto.Sort;
+import com.github.pagehelper.PageHelper;
+
+@Transactional
+@Component(value="newsTypeService")
+public class NewsTypeServiceImpl implements NewsTypeService {
+	@Resource(name="newsTypeDAO")
+	private NewsTypeDAO newsTypeDAO;
+
+	@Override
+	public NewsType get(String id) {
+		// TODO Auto-generated method stub
+		return newsTypeDAO.get(id);
+	}
+
+	@Override
+	public int insert(NewsType model) {
+		// TODO Auto-generated method stub
+		//model.setId(UUID.randomUUID().toString());
+		
+		return newsTypeDAO.insert(model);
+	}
+
+	@Override
+	public int update(NewsType model) {
+		// TODO Auto-generated method stub
+		return newsTypeDAO.update(model);		
+	}
+
+	@Override
+	public int delete(String id) {
+		// TODO Auto-generated method stub
+		return newsTypeDAO.delete(id);
+	}
+
+	@Override
+	public boolean exist(String id) {
+		// TODO Auto-generated method stub
+		int count = newsTypeDAO.exist(id);
+		
+		return count > 0 ? true : false;
+	}
+	
+	@Override
+	public List<NewsType> list() {
+		// TODO Auto-generated method stub
+		return newsTypeDAO.list();
+	}
+		
+	@Override
+	public Page<NewsType> pageSearch(Map<String, Object> searchParams, int pageNumber, int pageSize,boolean count,List<Sort> sortList) {
+        Page<NewsType> page = PageHelper.startPage(pageNumber,pageSize,count).doSelectPage(()->{
+            newsTypeDAO.search(searchParams,sortList);
+        });
+        
+        return page;
+	}
+}

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