├── .gitignore ├── .mvn └── wrapper │ ├── maven-wrapper.jar │ └── maven-wrapper.properties ├── README.md ├── mvnw ├── mvnw.cmd ├── platform.iml ├── pom.xml ├── settings.xml └── src ├── main ├── java │ └── com │ │ └── tool │ │ └── plaform │ │ ├── PlaformApplication.java │ │ ├── controller │ │ ├── ApiController.java │ │ ├── MockController.java │ │ ├── PlaformController.java │ │ ├── RuleController.java │ │ ├── TestToolsController.java │ │ └── UserController.java │ │ ├── dao │ │ ├── ApiMapper.java │ │ ├── MockDao.java │ │ ├── ResultMapper.java │ │ ├── RuleDao.java │ │ ├── RuleMapper.java │ │ ├── TestMobileDao.java │ │ ├── TestToolsDao.java │ │ └── UserMapper.java │ │ ├── entity │ │ ├── Api.java │ │ ├── Http.java │ │ ├── HttpBean.java │ │ ├── Mock.java │ │ ├── Result.java │ │ ├── Rule.java │ │ ├── RuleWithBLOBs.java │ │ ├── TestPlaform.java │ │ ├── User.java │ │ └── UserQuery.java │ │ ├── impl │ │ ├── ApiServiceImpl.java │ │ ├── ResultServiceImpl.java │ │ ├── RuleServiceImpl.java │ │ └── UserServiceImpl.java │ │ ├── myConfig.java │ │ ├── service │ │ ├── ApiService.java │ │ ├── ResultService.java │ │ ├── RuleService.java │ │ └── UserService.java │ │ ├── utils │ │ ├── ApiResult.java │ │ ├── DBObjectUtil.java │ │ ├── ErrorCode.java │ │ ├── HttpClientUtil.java │ │ ├── MGO.java │ │ ├── MongoDbUtils.java │ │ ├── StringUtils.java │ │ └── UpdatePasswordInput.java │ │ └── vo │ │ └── ApiVo.java └── resources │ ├── application.properties │ ├── generatorConfig.xml │ ├── mapping │ ├── ApiMapper.xml │ ├── ResultMapper.xml │ ├── RuleMapper.xml │ └── UserMapper.xml │ ├── mybatis_generator.properties │ ├── static │ ├── css │ │ ├── bootstrap-theme.css │ │ ├── bootstrap-theme.css.map │ │ ├── bootstrap-theme.min.css │ │ ├── bootstrap-theme.min.css.map │ │ ├── bootstrap.css │ │ ├── bootstrap.css.map │ │ ├── bootstrap.min.css │ │ ├── bootstrap.min.css.map │ │ ├── common.css │ │ ├── css-index.css │ │ ├── dataTables.bootstrap.min.css │ │ └── mystyle.css │ ├── fonts │ │ ├── glyphicons-halflings-regular.eot │ │ ├── glyphicons-halflings-regular.svg │ │ ├── glyphicons-halflings-regular.ttf │ │ ├── glyphicons-halflings-regular.woff │ │ └── glyphicons-halflings-regular.woff2 │ ├── img │ │ ├── bg.jpg │ │ ├── favicon.ico │ │ ├── loading.GIF │ │ └── logo.png │ ├── imges │ │ └── top.jpg │ └── js │ │ ├── bootstrap.js │ │ ├── bootstrap.min.js │ │ ├── jquery-3.2.1.min.js │ │ ├── jquery.min.js │ │ └── npm.js │ └── templates │ ├── 1.html │ ├── addmock.html │ ├── index.html │ ├── login.html │ ├── mock.html │ ├── register.html │ ├── test.html │ └── top.jpg └── test └── java └── com └── tool └── plaform ├── PlaformApplicationTests.java └── Test.java /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by .ignore support plugin (hsz.mobi) 2 | .idea 3 | .mvn -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaox196/TestPlaform/066671fcf13ee95333eefb3d4680d42b28e548a0/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.2/apache-maven-3.5.2-bin.zip 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # TestPlaform 2 | 3 | # 测试平台 4 | 使用了spring boot + thymeleaf + bootstrap 5 | 6 | 第一阶段先增加设备管理 7 | 遇到的问题: 8 | ## 1.加入了thymeleaf后 html无法启动, 9 | 10 | ## 2.mybatis新增一个自定义查询需要自己加如: 11 | 21 | 22 | 23 | ## 3.遇到问题 24 | Description: 25 | Field apiService in com.tool.plaform.controller.ApiController required a bean of type 'com.tool.plaform.service.ApiService' that could not be found. 26 | Action: 27 | Consider defining a bean of type 'com.tool.plaform.service.ApiService' in your configuration. 28 | Process finished with exit code 0 29 | 30 | 解决办法: 31 | 忘记加服务service 32 | 33 | ## 4.post 请求数组采用bean list形式 34 | ## 5. 加入vo层 Value Object,用于和前端解耦 35 | ## 6. IDEA使用 @Autowired和@Resource时报错 36 | 解决办法:https://blog.csdn.net/u010679782/article/details/52094893 37 | ## 5. mybatis 新增一个表获取修改一个表,需要只对该表进行操作,只需要在generatorconfig.xml 38 | 加入如下一个: 39 | 40 |
43 | -------------------------------------------------------------------------------- /mvnw: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # ---------------------------------------------------------------------------- 3 | # Licensed to the Apache Software Foundation (ASF) under one 4 | # or more contributor license agreements. See the NOTICE file 5 | # distributed with this work for additional information 6 | # regarding copyright ownership. The ASF licenses this file 7 | # to you under the Apache License, Version 2.0 (the 8 | # "License"); you may not use this file except in compliance 9 | # with the License. You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, 14 | # software distributed under the License is distributed on an 15 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | # KIND, either express or implied. See the License for the 17 | # specific language governing permissions and limitations 18 | # under the License. 19 | # ---------------------------------------------------------------------------- 20 | 21 | # ---------------------------------------------------------------------------- 22 | # Maven2 Start Up Batch script 23 | # 24 | # Required ENV vars: 25 | # ------------------ 26 | # JAVA_HOME - location of a JDK home dir 27 | # 28 | # Optional ENV vars 29 | # ----------------- 30 | # M2_HOME - location of maven2's installed home dir 31 | # MAVEN_OPTS - parameters passed to the Java VM when running Maven 32 | # e.g. to debug Maven itself, use 33 | # set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 34 | # MAVEN_SKIP_RC - flag to disable loading of mavenrc files 35 | # ---------------------------------------------------------------------------- 36 | 37 | if [ -z "$MAVEN_SKIP_RC" ] ; then 38 | 39 | if [ -f /etc/mavenrc ] ; then 40 | . /etc/mavenrc 41 | fi 42 | 43 | if [ -f "$HOME/.mavenrc" ] ; then 44 | . "$HOME/.mavenrc" 45 | fi 46 | 47 | fi 48 | 49 | # OS specific support. $var _must_ be set to either true or false. 50 | cygwin=false; 51 | darwin=false; 52 | mingw=false 53 | case "`uname`" in 54 | CYGWIN*) cygwin=true ;; 55 | MINGW*) mingw=true;; 56 | Darwin*) darwin=true 57 | # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home 58 | # See https://developer.apple.com/library/mac/qa/qa1170/_index.html 59 | if [ -z "$JAVA_HOME" ]; then 60 | if [ -x "/usr/libexec/java_home" ]; then 61 | export JAVA_HOME="`/usr/libexec/java_home`" 62 | else 63 | export JAVA_HOME="/Library/Java/Home" 64 | fi 65 | fi 66 | ;; 67 | esac 68 | 69 | if [ -z "$JAVA_HOME" ] ; then 70 | if [ -r /etc/gentoo-release ] ; then 71 | JAVA_HOME=`java-config --jre-home` 72 | fi 73 | fi 74 | 75 | if [ -z "$M2_HOME" ] ; then 76 | ## resolve links - $0 may be a link to maven's home 77 | PRG="$0" 78 | 79 | # need this for relative symlinks 80 | while [ -h "$PRG" ] ; do 81 | ls=`ls -ld "$PRG"` 82 | link=`expr "$ls" : '.*-> \(.*\)$'` 83 | if expr "$link" : '/.*' > /dev/null; then 84 | PRG="$link" 85 | else 86 | PRG="`dirname "$PRG"`/$link" 87 | fi 88 | done 89 | 90 | saveddir=`pwd` 91 | 92 | M2_HOME=`dirname "$PRG"`/.. 93 | 94 | # make it fully qualified 95 | M2_HOME=`cd "$M2_HOME" && pwd` 96 | 97 | cd "$saveddir" 98 | # echo Using m2 at $M2_HOME 99 | fi 100 | 101 | # For Cygwin, ensure paths are in UNIX format before anything is touched 102 | if $cygwin ; then 103 | [ -n "$M2_HOME" ] && 104 | M2_HOME=`cygpath --unix "$M2_HOME"` 105 | [ -n "$JAVA_HOME" ] && 106 | JAVA_HOME=`cygpath --unix "$JAVA_HOME"` 107 | [ -n "$CLASSPATH" ] && 108 | CLASSPATH=`cygpath --path --unix "$CLASSPATH"` 109 | fi 110 | 111 | # For Migwn, ensure paths are in UNIX format before anything is touched 112 | if $mingw ; then 113 | [ -n "$M2_HOME" ] && 114 | M2_HOME="`(cd "$M2_HOME"; pwd)`" 115 | [ -n "$JAVA_HOME" ] && 116 | JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" 117 | # TODO classpath? 118 | fi 119 | 120 | if [ -z "$JAVA_HOME" ]; then 121 | javaExecutable="`which javac`" 122 | if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then 123 | # readlink(1) is not available as standard on Solaris 10. 124 | readLink=`which readlink` 125 | if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then 126 | if $darwin ; then 127 | javaHome="`dirname \"$javaExecutable\"`" 128 | javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" 129 | else 130 | javaExecutable="`readlink -f \"$javaExecutable\"`" 131 | fi 132 | javaHome="`dirname \"$javaExecutable\"`" 133 | javaHome=`expr "$javaHome" : '\(.*\)/bin'` 134 | JAVA_HOME="$javaHome" 135 | export JAVA_HOME 136 | fi 137 | fi 138 | fi 139 | 140 | if [ -z "$JAVACMD" ] ; then 141 | if [ -n "$JAVA_HOME" ] ; then 142 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 143 | # IBM's JDK on AIX uses strange locations for the executables 144 | JAVACMD="$JAVA_HOME/jre/sh/java" 145 | else 146 | JAVACMD="$JAVA_HOME/bin/java" 147 | fi 148 | else 149 | JAVACMD="`which java`" 150 | fi 151 | fi 152 | 153 | if [ ! -x "$JAVACMD" ] ; then 154 | echo "Error: JAVA_HOME is not defined correctly." >&2 155 | echo " We cannot execute $JAVACMD" >&2 156 | exit 1 157 | fi 158 | 159 | if [ -z "$JAVA_HOME" ] ; then 160 | echo "Warning: JAVA_HOME environment variable is not set." 161 | fi 162 | 163 | CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher 164 | 165 | # traverses directory structure from process work directory to filesystem root 166 | # first directory with .mvn subdirectory is considered project base directory 167 | find_maven_basedir() { 168 | 169 | if [ -z "$1" ] 170 | then 171 | echo "Path not specified to find_maven_basedir" 172 | return 1 173 | fi 174 | 175 | basedir="$1" 176 | wdir="$1" 177 | while [ "$wdir" != '/' ] ; do 178 | if [ -d "$wdir"/.mvn ] ; then 179 | basedir=$wdir 180 | break 181 | fi 182 | # workaround for JBEAP-8937 (on Solaris 10/Sparc) 183 | if [ -d "${wdir}" ]; then 184 | wdir=`cd "$wdir/.."; pwd` 185 | fi 186 | # end of workaround 187 | done 188 | echo "${basedir}" 189 | } 190 | 191 | # concatenates all lines of a file 192 | concat_lines() { 193 | if [ -f "$1" ]; then 194 | echo "$(tr -s '\n' ' ' < "$1")" 195 | fi 196 | } 197 | 198 | BASE_DIR=`find_maven_basedir "$(pwd)"` 199 | if [ -z "$BASE_DIR" ]; then 200 | exit 1; 201 | fi 202 | 203 | export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} 204 | echo $MAVEN_PROJECTBASEDIR 205 | MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" 206 | 207 | # For Cygwin, switch paths to Windows format before running java 208 | if $cygwin; then 209 | [ -n "$M2_HOME" ] && 210 | M2_HOME=`cygpath --path --windows "$M2_HOME"` 211 | [ -n "$JAVA_HOME" ] && 212 | JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` 213 | [ -n "$CLASSPATH" ] && 214 | CLASSPATH=`cygpath --path --windows "$CLASSPATH"` 215 | [ -n "$MAVEN_PROJECTBASEDIR" ] && 216 | MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` 217 | fi 218 | 219 | WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain 220 | 221 | exec "$JAVACMD" \ 222 | $MAVEN_OPTS \ 223 | -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ 224 | "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ 225 | ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" 226 | -------------------------------------------------------------------------------- /mvnw.cmd: -------------------------------------------------------------------------------- 1 | @REM ---------------------------------------------------------------------------- 2 | @REM Licensed to the Apache Software Foundation (ASF) under one 3 | @REM or more contributor license agreements. See the NOTICE file 4 | @REM distributed with this work for additional information 5 | @REM regarding copyright ownership. The ASF licenses this file 6 | @REM to you under the Apache License, Version 2.0 (the 7 | @REM "License"); you may not use this file except in compliance 8 | @REM with the License. You may obtain a copy of the License at 9 | @REM 10 | @REM http://www.apache.org/licenses/LICENSE-2.0 11 | @REM 12 | @REM Unless required by applicable law or agreed to in writing, 13 | @REM software distributed under the License is distributed on an 14 | @REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | @REM KIND, either express or implied. See the License for the 16 | @REM specific language governing permissions and limitations 17 | @REM under the License. 18 | @REM ---------------------------------------------------------------------------- 19 | 20 | @REM ---------------------------------------------------------------------------- 21 | @REM Maven2 Start Up Batch script 22 | @REM 23 | @REM Required ENV vars: 24 | @REM JAVA_HOME - location of a JDK home dir 25 | @REM 26 | @REM Optional ENV vars 27 | @REM M2_HOME - location of maven2's installed home dir 28 | @REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands 29 | @REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending 30 | @REM MAVEN_OPTS - parameters passed to the Java VM when running Maven 31 | @REM e.g. to debug Maven itself, use 32 | @REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 33 | @REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files 34 | @REM ---------------------------------------------------------------------------- 35 | 36 | @REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' 37 | @echo off 38 | @REM enable echoing my setting MAVEN_BATCH_ECHO to 'on' 39 | @if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% 40 | 41 | @REM set %HOME% to equivalent of $HOME 42 | if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") 43 | 44 | @REM Execute a user defined script before this one 45 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre 46 | @REM check for pre script, once with legacy .bat ending and once with .cmd ending 47 | if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" 48 | if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" 49 | :skipRcPre 50 | 51 | @setlocal 52 | 53 | set ERROR_CODE=0 54 | 55 | @REM To isolate internal variables from possible post scripts, we use another setlocal 56 | @setlocal 57 | 58 | @REM ==== START VALIDATION ==== 59 | if not "%JAVA_HOME%" == "" goto OkJHome 60 | 61 | echo. 62 | echo Error: JAVA_HOME not found in your environment. >&2 63 | echo Please set the JAVA_HOME variable in your environment to match the >&2 64 | echo location of your Java installation. >&2 65 | echo. 66 | goto error 67 | 68 | :OkJHome 69 | if exist "%JAVA_HOME%\bin\java.exe" goto init 70 | 71 | echo. 72 | echo Error: JAVA_HOME is set to an invalid directory. >&2 73 | echo JAVA_HOME = "%JAVA_HOME%" >&2 74 | echo Please set the JAVA_HOME variable in your environment to match the >&2 75 | echo location of your Java installation. >&2 76 | echo. 77 | goto error 78 | 79 | @REM ==== END VALIDATION ==== 80 | 81 | :init 82 | 83 | @REM Find the project base dir, i.e. the directory that contains the folder ".mvn". 84 | @REM Fallback to current working directory if not found. 85 | 86 | set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% 87 | IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir 88 | 89 | set EXEC_DIR=%CD% 90 | set WDIR=%EXEC_DIR% 91 | :findBaseDir 92 | IF EXIST "%WDIR%"\.mvn goto baseDirFound 93 | cd .. 94 | IF "%WDIR%"=="%CD%" goto baseDirNotFound 95 | set WDIR=%CD% 96 | goto findBaseDir 97 | 98 | :baseDirFound 99 | set MAVEN_PROJECTBASEDIR=%WDIR% 100 | cd "%EXEC_DIR%" 101 | goto endDetectBaseDir 102 | 103 | :baseDirNotFound 104 | set MAVEN_PROJECTBASEDIR=%EXEC_DIR% 105 | cd "%EXEC_DIR%" 106 | 107 | :endDetectBaseDir 108 | 109 | IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig 110 | 111 | @setlocal EnableExtensions EnableDelayedExpansion 112 | for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a 113 | @endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% 114 | 115 | :endReadAdditionalConfig 116 | 117 | SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" 118 | 119 | set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" 120 | set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain 121 | 122 | %MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* 123 | if ERRORLEVEL 1 goto error 124 | goto end 125 | 126 | :error 127 | set ERROR_CODE=1 128 | 129 | :end 130 | @endlocal & set ERROR_CODE=%ERROR_CODE% 131 | 132 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost 133 | @REM check for post script, once with legacy .bat ending and once with .cmd ending 134 | if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" 135 | if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" 136 | :skipRcPost 137 | 138 | @REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' 139 | if "%MAVEN_BATCH_PAUSE%" == "on" pause 140 | 141 | if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% 142 | 143 | exit /B %ERROR_CODE% 144 | -------------------------------------------------------------------------------- /platform.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | com.tool 7 | plaform 8 | 0.0.1-SNAPSHOT 9 | jar 10 | 11 | plaform 12 | Demo project for Spring Boot 13 | 14 | 15 | org.springframework.boot 16 | spring-boot-starter-parent 17 | 1.5.9.RELEASE 18 | 19 | 20 | 21 | 22 | UTF-8 23 | UTF-8 24 | 1.8 25 | 26 | 27 | 3.0.2.RELEASE 28 | 2.0.5 29 | 30 | 31 | 32 | 34 | 35 | 36 | org.springframework.boot 37 | spring-boot-starter-thymeleaf 38 | 39 | 40 | junit 41 | junit 42 | test 43 | 44 | 45 | 46 | org.springframework.boot 47 | spring-boot-devtools 48 | 49 | 50 | 51 | org.springframework.boot 52 | spring-boot-starter-test 53 | test 54 | 55 | 56 | 57 | org.apache.httpcomponents 58 | httpclient 59 | 4.5.2 60 | 61 | 62 | 63 | org.springframework.boot 64 | spring-boot-starter-data-mongodb 65 | 66 | 67 | 68 | 69 | org.apache.httpcomponents 70 | fluent-hc 71 | 4.5.1 72 | 73 | 74 | 75 | 76 | org.mybatis.generator 77 | mybatis-generator-core 78 | 1.3.5 79 | 80 | 81 | mysql 82 | mysql-connector-java 83 | runtime 84 | 85 | 86 | 87 | 88 | org.apache.httpcomponents 89 | httpclient 90 | 4.5.1 91 | 92 | 93 | 94 | 95 | com.alibaba 96 | druid 97 | 1.0.19 98 | 99 | 100 | com.alibaba 101 | fastjson 102 | 1.2.31 103 | 104 | 105 | org.mybatis.spring.boot 106 | mybatis-spring-boot-starter 107 | 1.2.0 108 | 109 | 110 | io.swagger 111 | swagger-annotations 112 | 1.5.13 113 | 114 | 115 | 116 | 117 | 118 | 119 | org.springframework.boot 120 | spring-boot-maven-plugin 121 | 122 | 123 | 124 | org.mybatis.generator 125 | mybatis-generator-maven-plugin 126 | 1.3.5 127 | 128 | 129 | 130 | mysql 131 | mysql-connector-java 132 | ${mysql.version} 133 | 134 | 135 | 136 | 137 | 138 | Generate MyBatis Artifacts 139 | 140 | generate 141 | 142 | 143 | 144 | src/main/resources/generatorConfig.xml 145 | 146 | true 147 | 148 | true 149 | 150 | 151 | 152 | 153 | 154 | org.apache.maven.plugins 155 | maven-compiler-plugin 156 | 157 | 1.7 158 | 1.7 159 | UTF-8 160 | 161 | 162 | 163 | 164 | 165 | 166 | src/main/resources 167 | 168 | 169 | 170 | 171 | 172 | 173 | -------------------------------------------------------------------------------- /settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 21 | 22 | 46 | 49 | 55 | C:/Users/jervis.yao/.m2/repository 56 | 57 | 65 | 66 | 73 | 74 | 79 | 80 | 84 | 85 | 86 | 91 | 92 | 106 | 107 | 108 | 112 | 113 | 126 | 127 | 134 | 135 | 136 | 147 | 148 | 160 | 161 | 167 | 168 | 169 | 170 | 191 | 192 | 221 | 222 | 256 | 257 | 258 | nexus 259 | 260 | 261 | aliyunmaven 262 | http://maven.aliyun.com/nexus/content/groups/public/ 263 | 264 | 265 | public 266 | wolaidai nexus public repo 267 | http://192.168.200.4:8081/nexus/content/groups/public 268 | default 269 | 270 | true 271 | always 272 | 273 | 274 | 275 | thirdparty 276 | wolaidai nexus third party repo 277 | http://192.168.200.4:8081/nexus/content/repositories/thirdparty 278 | default 279 | 280 | true 281 | always 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 298 | 299 | 300 | nexus 301 | 302 | 303 | 304 | 305 | -------------------------------------------------------------------------------- /src/main/java/com/tool/plaform/PlaformApplication.java: -------------------------------------------------------------------------------- 1 | package com.tool.plaform; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class PlaformApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(PlaformApplication.class, args); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/tool/plaform/controller/ApiController.java: -------------------------------------------------------------------------------- 1 | package com.tool.plaform.controller; 2 | 3 | import com.alibaba.fastjson.JSON; 4 | import com.tool.plaform.entity.Api; 5 | import com.tool.plaform.entity.HttpBean; 6 | import com.tool.plaform.service.ApiService; 7 | import com.tool.plaform.utils.ApiResult; 8 | import com.tool.plaform.vo.ApiVo; 9 | import io.swagger.annotations.ApiOperation; 10 | import org.springframework.beans.factory.annotation.Autowired; 11 | import org.springframework.web.bind.annotation.RequestBody; 12 | import org.springframework.web.bind.annotation.RequestMapping; 13 | import org.springframework.web.bind.annotation.RequestMethod; 14 | import org.springframework.web.bind.annotation.RestController; 15 | import java.util.ArrayList; 16 | import java.util.List; 17 | 18 | @RestController 19 | @RequestMapping(value = "/api") 20 | public class ApiController { 21 | 22 | @Autowired 23 | ApiService apiService; 24 | 25 | @RequestMapping(value = "/save",method = RequestMethod.POST) 26 | public ApiResult saveApi(@RequestBody ApiVo apiVo){ 27 | Api api=setApi(apiVo); 28 | apiService.insert(api); 29 | return ApiResult.success(api); 30 | } 31 | 32 | public static Api setApi(ApiVo apiVo){ 33 | Api api=new Api(); 34 | api.setMethod(apiVo.getMethod()); 35 | String params = JSON.toJSONString(apiVo.getParams()); 36 | api.setParam(params); 37 | api.setExpect(apiVo.getExpect()); 38 | api.setPort(apiVo.getPort()); 39 | api.setUrl(apiVo.getUrl()); 40 | api.setRooturl(apiVo.getRootUrl()); 41 | api.setType(apiVo.getType()); 42 | return api; 43 | } 44 | 45 | 46 | @ApiOperation(value = "查找所有数据", notes = "使用GET方法") 47 | @RequestMapping(value = "/findall",method = RequestMethod.GET) 48 | public ApiResult> FindAll(){ 49 | return ApiResult.success(apiService.findAllApi()); 50 | } 51 | 52 | @RequestMapping(value = "/find",method = RequestMethod.POST) 53 | public ApiResult FindBy(@RequestBody HttpBean httpBean){ 54 | List list=new ArrayList<>(); 55 | Api api=new Api(); 56 | return ApiResult.success(apiService.selectByPrimaryKey(httpBean.getId())); 57 | } 58 | 59 | @ApiOperation(value = "接口测试", notes = "使用post方法") 60 | @RequestMapping(value = "/test",method = RequestMethod.POST) 61 | public String doTest(@RequestBody ApiVo apiVo){ 62 | String result=apiService.apiTest(apiVo); 63 | return result; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /src/main/java/com/tool/plaform/controller/MockController.java: -------------------------------------------------------------------------------- 1 | package com.tool.plaform.controller; 2 | 3 | import com.tool.plaform.dao.MockDao; 4 | import com.tool.plaform.entity.Mock; 5 | import org.springframework.web.bind.annotation.*; 6 | 7 | @RestController 8 | public class MockController { 9 | MockDao mockDao = new MockDao(); 10 | 11 | 12 | 13 | @RequestMapping(value = "/mock/{applicationId}") 14 | public static String executeMock(@PathVariable("applicationId") String applicationId,String param) { 15 | 16 | return param; 17 | } 18 | 19 | @ModelAttribute 20 | Mock setmock() { 21 | return new Mock(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/tool/plaform/controller/PlaformController.java: -------------------------------------------------------------------------------- 1 | package com.tool.plaform.controller; 2 | 3 | import com.tool.plaform.dao.MockDao; 4 | import com.tool.plaform.dao.TestMobileDao; 5 | import com.tool.plaform.entity.Mock; 6 | import com.tool.plaform.entity.TestPlaform; 7 | import org.springframework.stereotype.Controller; 8 | import org.springframework.ui.Model; 9 | import org.springframework.web.bind.annotation.ModelAttribute; 10 | import org.springframework.web.bind.annotation.RequestMapping; 11 | import org.springframework.web.bind.annotation.RequestMethod; 12 | 13 | import java.util.List; 14 | 15 | @Controller 16 | public class PlaformController { 17 | 18 | TestMobileDao dao = new TestMobileDao(); 19 | MockDao mockDao = new MockDao(); 20 | @RequestMapping("/") 21 | public String index(Model model) { 22 | List testPlaforms = dao.findAllTestMobile(); 23 | model.addAttribute("mobileInfoList", testPlaforms); 24 | return "index"; 25 | } 26 | 27 | @RequestMapping(value = "/search", method = RequestMethod.POST) 28 | public String searchByPlaform(TestPlaform testPlaform, Model model) { 29 | List testPlaforms = dao.findTestMobileByPlaform(testPlaform.getMobile()); 30 | model.addAttribute("mobileInfoList", testPlaforms); 31 | return "index"; 32 | } 33 | 34 | @RequestMapping(value = "/register",method = RequestMethod.GET) 35 | public String register(){ 36 | return "register"; 37 | } 38 | 39 | @RequestMapping(value = "/testshow",method = RequestMethod.GET) 40 | public String show(){ 41 | return "test"; 42 | } 43 | 44 | @ModelAttribute 45 | TestPlaform setTestPlaform() { 46 | return new TestPlaform(); 47 | } 48 | 49 | @ModelAttribute 50 | Mock setmock() { 51 | return new Mock(); 52 | } 53 | 54 | @RequestMapping(value = "/mock") 55 | public String getMockServer(Model model) { 56 | List list=mockDao.findMockDataAll(); 57 | for (Mock mock:list){ 58 | MockController.executeMock(mock.ApiPath,mock.resultMsg); 59 | } 60 | model.addAttribute("mockList", list); 61 | return "mock"; 62 | } 63 | 64 | @RequestMapping(value = "/addmock") 65 | public String toMockHtml() { 66 | return "addmock"; 67 | } 68 | 69 | @RequestMapping(value = "/addmockdata", method = RequestMethod.POST) 70 | public String addMockServer(Mock mock) { 71 | mockDao.addMockDataToDb(mock); 72 | return "mock"; 73 | } 74 | 75 | } 76 | -------------------------------------------------------------------------------- /src/main/java/com/tool/plaform/controller/RuleController.java: -------------------------------------------------------------------------------- 1 | package com.tool.plaform.controller; 2 | 3 | import com.tool.plaform.dao.RuleMapper; 4 | import com.tool.plaform.entity.Rule; 5 | import com.tool.plaform.entity.RuleWithBLOBs; 6 | import com.tool.plaform.service.RuleService; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.web.bind.annotation.RequestMapping; 9 | import org.springframework.web.bind.annotation.RequestMethod; 10 | import org.springframework.web.bind.annotation.RequestParam; 11 | import org.springframework.web.bind.annotation.RestController; 12 | 13 | import java.util.List; 14 | 15 | @RestController 16 | @RequestMapping(value = "/rule") 17 | public class RuleController { 18 | @Autowired 19 | RuleService ruleMapper; 20 | 21 | @RequestMapping(value = "/findall",method = RequestMethod.GET) 22 | public List findAllRule(){ 23 | return ruleMapper.findAllRule(); 24 | } 25 | 26 | 27 | public void findRuleByCode(@RequestParam(value = "code")String code){ 28 | 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/tool/plaform/controller/TestToolsController.java: -------------------------------------------------------------------------------- 1 | package com.tool.plaform.controller; 2 | 3 | import com.mongodb.BasicDBObject; 4 | import com.tool.plaform.dao.TestToolsDao; 5 | import org.springframework.stereotype.Controller; 6 | import org.springframework.web.bind.annotation.*; 7 | 8 | 9 | /* 10 | * post请求必须要要使用RestController 11 | * 12 | * 在controller上加注解@Controller 和@RestController都可以在前端调通接口,但是二者的区别在于, 13 | * 当用前者的时候在方法上必须添加注解@ResponseBody,如果不添加@ResponseBody,就会报上面错误, 14 | * 因为当使用@Controller 注解时,spring默认方法返回的是view对象(页面)。 15 | * 而加上@ResponseBody,则方法返回的就是具体对象了。@RestController的作用就相当于@Controller+@ResponseBody的结合体 16 | * */ 17 | 18 | @RestController 19 | 20 | public class TestToolsController { 21 | // TestToolsDao testToolsDao=new TestToolsDao(); 22 | 23 | @RequestMapping(value = "/loan/replay" ,method = RequestMethod.GET) 24 | public boolean updateLoanDabaBase(@RequestParam(value = "env") String env,@RequestParam(value = "loanId") String loanId){ 25 | boolean isAdd=TestToolsDao.save(loanId,env); 26 | if(isAdd){ 27 | return true; 28 | } 29 | return false; 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/tool/plaform/controller/UserController.java: -------------------------------------------------------------------------------- 1 | package com.tool.plaform.controller; 2 | 3 | import com.tool.plaform.entity.User; 4 | import com.tool.plaform.service.UserService; 5 | import com.tool.plaform.utils.ApiResult; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.web.bind.annotation.RequestBody; 8 | import org.springframework.web.bind.annotation.RequestMapping; 9 | import org.springframework.web.bind.annotation.RequestMethod; 10 | import org.springframework.web.bind.annotation.RestController; 11 | 12 | @RestController 13 | @RequestMapping("/user") 14 | public class UserController { 15 | 16 | /** 17 | * 18 | */ 19 | @Autowired 20 | UserService userService; 21 | 22 | @RequestMapping(value = "/save",method = RequestMethod.POST) 23 | public ApiResult saveUser(@RequestBody User user){ 24 | 25 | userService.insert(user); 26 | return ApiResult.success(user); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/tool/plaform/dao/ApiMapper.java: -------------------------------------------------------------------------------- 1 | package com.tool.plaform.dao; 2 | 3 | import com.tool.plaform.entity.Api; 4 | import org.apache.ibatis.annotations.Mapper; 5 | 6 | import java.util.List; 7 | 8 | @Mapper 9 | public interface ApiMapper { 10 | /** 11 | * This method was generated by MyBatis Generator. 12 | * This method corresponds to the database table api 13 | * 14 | * @mbg.generated 15 | */ 16 | int deleteByPrimaryKey(Integer id); 17 | 18 | /** 19 | * This method was generated by MyBatis Generator. 20 | * This method corresponds to the database table api 21 | * 22 | * @mbg.generated 23 | */ 24 | int insert(Api record); 25 | 26 | /** 27 | * This method was generated by MyBatis Generator. 28 | * This method corresponds to the database table api 29 | * 30 | * @mbg.generated 31 | */ 32 | int insertSelective(Api record); 33 | 34 | /** 35 | * This method was generated by MyBatis Generator. 36 | * This method corresponds to the database table api 37 | * 38 | * @mbg.generated 39 | */ 40 | Api selectByPrimaryKey(Integer id); 41 | 42 | /** 43 | * This method was generated by MyBatis Generator. 44 | * This method corresponds to the database table api 45 | * 46 | * @mbg.generated 47 | */ 48 | int updateByPrimaryKeySelective(Api record); 49 | 50 | /** 51 | * This method was generated by MyBatis Generator. 52 | * This method corresponds to the database table api 53 | * 54 | * @mbg.generated 55 | */ 56 | int updateByPrimaryKey(Api record); 57 | 58 | Api queryApiByParam(String param); 59 | 60 | List findAllApi(); 61 | } -------------------------------------------------------------------------------- /src/main/java/com/tool/plaform/dao/MockDao.java: -------------------------------------------------------------------------------- 1 | package com.tool.plaform.dao; 2 | 3 | import com.mongodb.BasicDBObject; 4 | import com.mongodb.client.MongoCursor; 5 | import com.tool.plaform.entity.Mock; 6 | import com.tool.plaform.myConfig; 7 | import com.tool.plaform.utils.MongoDbUtils; 8 | import org.bson.Document; 9 | 10 | import java.util.ArrayList; 11 | import java.util.List; 12 | 13 | 14 | public class MockDao { 15 | 16 | public boolean addMockDataToDb(Mock mock){ 17 | BasicDBObject obj=new BasicDBObject(); 18 | String path=mock.getApiPath(); 19 | obj.append("describe",mock.getApidescribe()); 20 | obj.append("name",mock.getName()); 21 | obj.append("project",mock.getProject()); 22 | obj.append("method","get"); 23 | obj.append("path",path); 24 | obj.append("operator","alun"); 25 | obj.append("update",System.currentTimeMillis()); 26 | obj.append("resultMsg",mock.getResultMsg()); 27 | obj.append("returnUrl",myConfig.baseUrl+"mock/"+path); 28 | boolean issuccess=MongoDbUtils.insertOne("MockApiData", myConfig.db_thirdparty, obj); 29 | if(issuccess){ 30 | return true; 31 | }else{ 32 | return false; 33 | } 34 | } 35 | 36 | public List findMockDataAll(){ 37 | List list=new ArrayList<>(); 38 | BasicDBObject query=new BasicDBObject(); 39 | MongoCursor cursor= MongoDbUtils.find("MockApiData",myConfig.db_thirdparty,query); 40 | try { 41 | while (cursor!=null && cursor.hasNext()) { 42 | Document doc = cursor.next(); 43 | System.out.println("doc"+doc); 44 | if(doc.containsKey("_id")){ 45 | System.out.println("describe"+doc.getString("describe")); 46 | Mock mock=new Mock(); 47 | mock.setApidescribe(doc.getString("describe")); 48 | mock.setApiPath(doc.getString("path")); 49 | mock.setName(doc.getString("name")); 50 | mock.setCreater(doc.getString("operator")); 51 | mock.setMethod("get"); 52 | mock.setProject(doc.getString("project")); 53 | mock.setStuts("在用"); 54 | mock.setOperator("add"); 55 | mock.setUpdateTime(doc.getLong("update")); 56 | mock.setResultMsg(doc.getString("resultMsg")); 57 | list.add(mock); 58 | } 59 | } 60 | } catch (Exception e) { 61 | e.printStackTrace(); 62 | 63 | } finally { 64 | if (cursor!=null) 65 | cursor.close(); 66 | } 67 | return list; 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /src/main/java/com/tool/plaform/dao/ResultMapper.java: -------------------------------------------------------------------------------- 1 | package com.tool.plaform.dao; 2 | 3 | import com.tool.plaform.entity.Result; 4 | import org.apache.ibatis.annotations.Mapper; 5 | 6 | @Mapper 7 | public interface ResultMapper { 8 | /** 9 | * This method was generated by MyBatis Generator. 10 | * This method corresponds to the database table result 11 | * 12 | * @mbg.generated 13 | */ 14 | int deleteByPrimaryKey(Integer id); 15 | 16 | /** 17 | * This method was generated by MyBatis Generator. 18 | * This method corresponds to the database table result 19 | * 20 | * @mbg.generated 21 | */ 22 | int insert(Result record); 23 | 24 | /** 25 | * This method was generated by MyBatis Generator. 26 | * This method corresponds to the database table result 27 | * 28 | * @mbg.generated 29 | */ 30 | int insertSelective(Result record); 31 | 32 | /** 33 | * This method was generated by MyBatis Generator. 34 | * This method corresponds to the database table result 35 | * 36 | * @mbg.generated 37 | */ 38 | Result selectByPrimaryKey(Integer id); 39 | 40 | /** 41 | * This method was generated by MyBatis Generator. 42 | * This method corresponds to the database table result 43 | * 44 | * @mbg.generated 45 | */ 46 | int updateByPrimaryKeySelective(Result record); 47 | 48 | /** 49 | * This method was generated by MyBatis Generator. 50 | * This method corresponds to the database table result 51 | * 52 | * @mbg.generated 53 | */ 54 | int updateByPrimaryKeyWithBLOBs(Result record); 55 | 56 | /** 57 | * This method was generated by MyBatis Generator. 58 | * This method corresponds to the database table result 59 | * 60 | * @mbg.generated 61 | */ 62 | int updateByPrimaryKey(Result record); 63 | } -------------------------------------------------------------------------------- /src/main/java/com/tool/plaform/dao/RuleDao.java: -------------------------------------------------------------------------------- 1 | package com.tool.plaform.dao; 2 | 3 | public class RuleDao { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /src/main/java/com/tool/plaform/dao/RuleMapper.java: -------------------------------------------------------------------------------- 1 | package com.tool.plaform.dao; 2 | 3 | import com.tool.plaform.entity.Rule; 4 | import com.tool.plaform.entity.RuleWithBLOBs; 5 | import org.apache.ibatis.annotations.Mapper; 6 | 7 | import java.util.List; 8 | 9 | @Mapper 10 | public interface RuleMapper { 11 | /** 12 | * This method was generated by MyBatis Generator. 13 | * This method corresponds to the database table rule 14 | * 15 | * @mbg.generated 16 | */ 17 | int deleteByPrimaryKey(Integer id); 18 | 19 | /** 20 | * This method was generated by MyBatis Generator. 21 | * This method corresponds to the database table rule 22 | * 23 | * @mbg.generated 24 | */ 25 | int insert(RuleWithBLOBs record); 26 | 27 | /** 28 | * This method was generated by MyBatis Generator. 29 | * This method corresponds to the database table rule 30 | * 31 | * @mbg.generated 32 | */ 33 | int insertSelective(RuleWithBLOBs record); 34 | 35 | /** 36 | * This method was generated by MyBatis Generator. 37 | * This method corresponds to the database table rule 38 | * 39 | * @mbg.generated 40 | */ 41 | RuleWithBLOBs selectByPrimaryKey(Integer id); 42 | 43 | /** 44 | * This method was generated by MyBatis Generator. 45 | * This method corresponds to the database table rule 46 | * 47 | * @mbg.generated 48 | */ 49 | int updateByPrimaryKeySelective(RuleWithBLOBs record); 50 | 51 | /** 52 | * This method was generated by MyBatis Generator. 53 | * This method corresponds to the database table rule 54 | * 55 | * @mbg.generated 56 | */ 57 | int updateByPrimaryKeyWithBLOBs(RuleWithBLOBs record); 58 | 59 | /** 60 | * This method was generated by MyBatis Generator. 61 | * This method corresponds to the database table rule 62 | * 63 | * @mbg.generated 64 | */ 65 | int updateByPrimaryKey(Rule record); 66 | List findAllRule(); 67 | } -------------------------------------------------------------------------------- /src/main/java/com/tool/plaform/dao/TestMobileDao.java: -------------------------------------------------------------------------------- 1 | package com.tool.plaform.dao; 2 | 3 | import com.mongodb.BasicDBObject; 4 | import com.mongodb.client.MongoCursor; 5 | import com.tool.plaform.entity.TestPlaform; 6 | import com.tool.plaform.myConfig; 7 | import com.tool.plaform.utils.MongoDbUtils; 8 | import org.bson.Document; 9 | 10 | import java.util.ArrayList; 11 | import java.util.List; 12 | 13 | public class TestMobileDao { 14 | 15 | public List findAllTestMobile(){ 16 | BasicDBObject query=new BasicDBObject(); 17 | MongoCursor cursor=MongoDbUtils.find("TestMobile", myConfig.db_thirdparty,query); 18 | List list=parseTestPlaform(cursor); 19 | return list; 20 | } 21 | 22 | public List findTestMobileByPlaform(String plaform){ 23 | 24 | BasicDBObject query=new BasicDBObject(); 25 | query.append("型号",plaform); 26 | MongoCursor cursor=MongoDbUtils.find("TestMobile",myConfig.db_thirdparty,query); 27 | System.out.println(cursor); 28 | List list=parseTestPlaform(cursor); 29 | return list; 30 | } 31 | 32 | public List parseTestPlaform(MongoCursor cursor){ 33 | List list=new ArrayList<>(); 34 | try { 35 | while (cursor!=null && cursor.hasNext()) { 36 | Document doc = cursor.next(); 37 | if(doc.containsKey("_id")){ 38 | TestPlaform aa=setTestMobileObj(doc); 39 | list.add(aa); 40 | } 41 | } 42 | } catch (Exception e) { 43 | 44 | } finally { 45 | if (cursor!=null) 46 | cursor.close(); 47 | } 48 | return list; 49 | } 50 | 51 | 52 | public TestPlaform setTestMobileObj(Document doc ){ 53 | TestPlaform testPlaform=new TestPlaform(); 54 | String mobile=doc.getString("型号"); 55 | String plaform=doc.getString("厂家"); 56 | String uuid=doc.getString("uuid"); 57 | String owner=doc.getString("保管人"); 58 | String remark=doc.getString("备注"); 59 | testPlaform.setMobile(mobile); 60 | testPlaform.setOwner(owner); 61 | testPlaform.setPlaform(plaform); 62 | testPlaform.setRemark(remark); 63 | testPlaform.setUuid(uuid); 64 | return testPlaform; 65 | } 66 | 67 | } 68 | -------------------------------------------------------------------------------- /src/main/java/com/tool/plaform/dao/TestToolsDao.java: -------------------------------------------------------------------------------- 1 | package com.tool.plaform.dao; 2 | 3 | import com.mongodb.BasicDBObject; 4 | import com.tool.plaform.myConfig; 5 | import com.tool.plaform.utils.MongoDbUtils; 6 | 7 | public class TestToolsDao { 8 | 9 | /* 10 | * 1.代表 apply 11 | * 2.代表 stat 12 | * */ 13 | 14 | public static boolean save(String id,String which){ 15 | BasicDBObject obj = QueueLoanInfo(id); 16 | if(obj!=null){ 17 | SaveToQueueStat(obj,which); 18 | return true; 19 | }else{ 20 | System.out.println("数据库里面不存在这个订单的数据"); 21 | return false; 22 | } 23 | } 24 | 25 | public static BasicDBObject QueueLoanInfo(String id) { 26 | BasicDBObject obj = null; 27 | BasicDBObject query = new BasicDBObject(); 28 | BasicDBObject orderby = new BasicDBObject("logTime", -1); 29 | query.append("id", id); 30 | obj = MongoDbUtils.findOne("LoanApplication", myConfig.db_business, query, orderby); 31 | System.out.println(obj); 32 | if(obj!=null){ 33 | obj.removeField("_id"); 34 | } 35 | return obj; 36 | } 37 | 38 | public static void SaveToQueueStat(BasicDBObject obj,String which) { 39 | String platform = ""; 40 | String id = ""; 41 | String account = ""; 42 | String sourceServer = ""; 43 | BasicDBObject query = new BasicDBObject(); 44 | System.out.println(obj); 45 | if (obj.containsField("platform")) { 46 | platform = obj.getString("platform"); 47 | } 48 | if (obj.containsField("id")) { 49 | id = obj.getString("id"); 50 | System.out.println(id); 51 | } 52 | if (obj.containsField("account")) { 53 | account = obj.getString("account"); 54 | } 55 | 56 | query.append("id", id); 57 | query.append("account", account); 58 | query.append("platform", platform); 59 | query.append("applyTime", 1493807358); 60 | query.append("sourceServer", which); 61 | query.append("status", 0); 62 | query.append("productId", 1000); 63 | query.append("tryCount", 0); 64 | query.append("updateTime", 1493807358); 65 | query.append("logTime", 1493807358); 66 | System.out.println("-------------"); 67 | System.out.println("插入querystat表的数据 :" + query); 68 | 69 | MongoDbUtils.insertOne(which, myConfig.db_business,query); 70 | } 71 | 72 | } 73 | -------------------------------------------------------------------------------- /src/main/java/com/tool/plaform/dao/UserMapper.java: -------------------------------------------------------------------------------- 1 | package com.tool.plaform.dao; 2 | 3 | import com.tool.plaform.entity.User; 4 | import com.tool.plaform.entity.UserQuery; 5 | import org.apache.ibatis.annotations.Mapper; 6 | 7 | @Mapper 8 | public interface UserMapper { 9 | /** 10 | * This method was generated by MyBatis Generator. 11 | * This method corresponds to the database table user 12 | * 13 | * @mbg.generated 14 | */ 15 | int insert(User record); 16 | 17 | /** 18 | * This method was generated by MyBatis Generator. 19 | * This method corresponds to the database table user 20 | * 21 | * @mbg.generated 22 | */ 23 | int insertSelective(User record); 24 | 25 | User queryUserByLoginName(UserQuery userQuery); 26 | } -------------------------------------------------------------------------------- /src/main/java/com/tool/plaform/entity/Api.java: -------------------------------------------------------------------------------- 1 | package com.tool.plaform.entity; 2 | 3 | public class Api { 4 | /** 5 | * 6 | * This field was generated by MyBatis Generator. 7 | * This field corresponds to the database column api.id 8 | * 9 | * @mbg.generated 10 | */ 11 | private Integer id; 12 | 13 | private String rooturl; 14 | 15 | public String getRooturl() { 16 | return rooturl; 17 | } 18 | 19 | public void setRooturl(String rooturl) { 20 | this.rooturl = rooturl; 21 | } 22 | 23 | /** 24 | * 25 | * This field was generated by MyBatis Generator. 26 | * This field corresponds to the database column api.method 27 | * 28 | * @mbg.generated 29 | */ 30 | private String method; 31 | 32 | /** 33 | * 34 | * This field was generated by MyBatis Generator. 35 | * This field corresponds to the database column api.url 36 | * 37 | * @mbg.generated 38 | */ 39 | private String url; 40 | 41 | /** 42 | * 43 | * This field was generated by MyBatis Generator. 44 | * This field corresponds to the database column api.param 45 | * 46 | * @mbg.generated 47 | */ 48 | private String param; 49 | 50 | /** 51 | * 52 | * This field was generated by MyBatis Generator. 53 | * This field corresponds to the database column api.type 54 | * 55 | * @mbg.generated 56 | */ 57 | private String type; 58 | 59 | /** 60 | * 61 | * This field was generated by MyBatis Generator. 62 | * This field corresponds to the database column api.contenttype 63 | * 64 | * @mbg.generated 65 | */ 66 | private String contenttype; 67 | 68 | /** 69 | * 70 | * This field was generated by MyBatis Generator. 71 | * This field corresponds to the database column api.expect 72 | * 73 | * @mbg.generated 74 | */ 75 | private String expect; 76 | 77 | /** 78 | * 79 | * This field was generated by MyBatis Generator. 80 | * This field corresponds to the database column api.port 81 | * 82 | * @mbg.generated 83 | */ 84 | private Integer port; 85 | 86 | /** 87 | * This method was generated by MyBatis Generator. 88 | * This method returns the value of the database column api.id 89 | * 90 | * @return the value of api.id 91 | * 92 | * @mbg.generated 93 | */ 94 | public Integer getId() { 95 | return id; 96 | } 97 | 98 | /** 99 | * This method was generated by MyBatis Generator. 100 | * This method sets the value of the database column api.id 101 | * 102 | * @param id the value for api.id 103 | * 104 | * @mbg.generated 105 | */ 106 | public void setId(Integer id) { 107 | this.id = id; 108 | } 109 | 110 | /** 111 | * This method was generated by MyBatis Generator. 112 | * This method returns the value of the database column api.method 113 | * 114 | * @return the value of api.method 115 | * 116 | * @mbg.generated 117 | */ 118 | public String getMethod() { 119 | return method; 120 | } 121 | 122 | /** 123 | * This method was generated by MyBatis Generator. 124 | * This method sets the value of the database column api.method 125 | * 126 | * @param method the value for api.method 127 | * 128 | * @mbg.generated 129 | */ 130 | public void setMethod(String method) { 131 | this.method = method == null ? null : method.trim(); 132 | } 133 | 134 | /** 135 | * This method was generated by MyBatis Generator. 136 | * This method returns the value of the database column api.url 137 | * 138 | * @return the value of api.url 139 | * 140 | * @mbg.generated 141 | */ 142 | public String getUrl() { 143 | return url; 144 | } 145 | 146 | /** 147 | * This method was generated by MyBatis Generator. 148 | * This method sets the value of the database column api.url 149 | * 150 | * @param url the value for api.url 151 | * 152 | * @mbg.generated 153 | */ 154 | public void setUrl(String url) { 155 | this.url = url == null ? null : url.trim(); 156 | } 157 | 158 | /** 159 | * This method was generated by MyBatis Generator. 160 | * This method returns the value of the database column api.param 161 | * 162 | * @return the value of api.param 163 | * 164 | * @mbg.generated 165 | */ 166 | public String getParam() { 167 | return param; 168 | } 169 | 170 | /** 171 | * This method was generated by MyBatis Generator. 172 | * This method sets the value of the database column api.param 173 | * 174 | * @param param the value for api.param 175 | * 176 | * @mbg.generated 177 | */ 178 | public void setParam(String param) { 179 | this.param = param == null ? null : param.trim(); 180 | } 181 | 182 | /** 183 | * This method was generated by MyBatis Generator. 184 | * This method returns the value of the database column api.type 185 | * 186 | * @return the value of api.type 187 | * 188 | * @mbg.generated 189 | */ 190 | public String getType() { 191 | return type; 192 | } 193 | 194 | /** 195 | * This method was generated by MyBatis Generator. 196 | * This method sets the value of the database column api.type 197 | * 198 | * @param type the value for api.type 199 | * 200 | * @mbg.generated 201 | */ 202 | public void setType(String type) { 203 | this.type = type == null ? null : type.trim(); 204 | } 205 | 206 | /** 207 | * This method was generated by MyBatis Generator. 208 | * This method returns the value of the database column api.contenttype 209 | * 210 | * @return the value of api.contenttype 211 | * 212 | * @mbg.generated 213 | */ 214 | public String getContenttype() { 215 | return contenttype; 216 | } 217 | 218 | /** 219 | * This method was generated by MyBatis Generator. 220 | * This method sets the value of the database column api.contenttype 221 | * 222 | * @param contenttype the value for api.contenttype 223 | * 224 | * @mbg.generated 225 | */ 226 | public void setContenttype(String contenttype) { 227 | this.contenttype = contenttype == null ? null : contenttype.trim(); 228 | } 229 | 230 | /** 231 | * This method was generated by MyBatis Generator. 232 | * This method returns the value of the database column api.expect 233 | * 234 | * @return the value of api.expect 235 | * 236 | * @mbg.generated 237 | */ 238 | public String getExpect() { 239 | return expect; 240 | } 241 | 242 | /** 243 | * This method was generated by MyBatis Generator. 244 | * This method sets the value of the database column api.expect 245 | * 246 | * @param expect the value for api.expect 247 | * 248 | * @mbg.generated 249 | */ 250 | public void setExpect(String expect) { 251 | this.expect = expect == null ? null : expect.trim(); 252 | } 253 | 254 | /** 255 | * This method was generated by MyBatis Generator. 256 | * This method returns the value of the database column api.port 257 | * 258 | * @return the value of api.port 259 | * 260 | * @mbg.generated 261 | */ 262 | public Integer getPort() { 263 | return port; 264 | } 265 | 266 | /** 267 | * This method was generated by MyBatis Generator. 268 | * This method sets the value of the database column api.port 269 | * 270 | * @param port the value for api.port 271 | * 272 | * @mbg.generated 273 | */ 274 | public void setPort(Integer port) { 275 | this.port = port; 276 | } 277 | } -------------------------------------------------------------------------------- /src/main/java/com/tool/plaform/entity/Http.java: -------------------------------------------------------------------------------- 1 | package com.tool.plaform.entity; 2 | 3 | public class Http { 4 | public String url; 5 | public String method; 6 | public String desc; 7 | public String param; 8 | public String type; 9 | public String header; 10 | public String ContentType; 11 | 12 | 13 | public String getUrl() { 14 | return url; 15 | } 16 | 17 | public String getMethod() { 18 | return method; 19 | } 20 | 21 | public String getDesc() { 22 | return desc; 23 | } 24 | 25 | public String getParam() { 26 | return param; 27 | } 28 | 29 | public String getType() { 30 | return type; 31 | } 32 | 33 | public String getHeader() { 34 | return header; 35 | } 36 | 37 | public String getContentType() { 38 | return ContentType; 39 | } 40 | 41 | public void setUrl(String url) { 42 | this.url = url; 43 | } 44 | 45 | public void setMethod(String method) { 46 | this.method = method; 47 | } 48 | 49 | public void setDesc(String desc) { 50 | this.desc = desc; 51 | } 52 | 53 | public void setParam(String param) { 54 | this.param = param; 55 | } 56 | 57 | public void setType(String type) { 58 | this.type = type; 59 | } 60 | 61 | public void setHeader(String header) { 62 | this.header = header; 63 | } 64 | 65 | public void setContentType(String contentType) { 66 | ContentType = contentType; 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /src/main/java/com/tool/plaform/entity/HttpBean.java: -------------------------------------------------------------------------------- 1 | package com.tool.plaform.entity; 2 | 3 | import org.springframework.data.annotation.Id; 4 | 5 | import java.util.List; 6 | 7 | public class HttpBean { 8 | public int id; 9 | public List ids; 10 | 11 | public int getId() { 12 | return id; 13 | } 14 | 15 | public void setId(int id) { 16 | this.id = id; 17 | } 18 | 19 | public List getIds() { 20 | return ids; 21 | } 22 | 23 | public void setIds(List ids) { 24 | this.ids = ids; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/tool/plaform/entity/Mock.java: -------------------------------------------------------------------------------- 1 | package com.tool.plaform.entity; 2 | 3 | public class Mock { 4 | 5 | public static final int GET_OPERATE = 0; 6 | public static final int POST_OPERATE = 1; 7 | 8 | public String project = ""; 9 | public String name = ""; 10 | public String Apidescribe = ""; 11 | public String method = ""; 12 | public String type = ""; 13 | public String ApiPath = ""; 14 | public long updateTime = 0; 15 | public String ischeck = ""; 16 | public String stuts = ""; 17 | public String creater = ""; 18 | public String operator = ""; 19 | public String returnUrl; 20 | public String resultMsg; 21 | public int operateCode = GET_OPERATE; 22 | 23 | public void setResultMsg(String resultMsg) { 24 | this.resultMsg = resultMsg; 25 | } 26 | 27 | public String getReturnUrl() { 28 | return returnUrl; 29 | } 30 | 31 | public String getResultMsg() { 32 | return resultMsg; 33 | } 34 | 35 | public void setProject(String project) { 36 | this.project = project; 37 | } 38 | 39 | public void setName(String name) { 40 | this.name = name; 41 | } 42 | 43 | public void setApidescribe(String apidescribe) { 44 | Apidescribe = apidescribe; 45 | } 46 | 47 | public void setMethod(String method) { 48 | this.method = method; 49 | } 50 | 51 | public void setType(String type) { 52 | this.type = type; 53 | } 54 | 55 | public void setApiPath(String apiPath) { 56 | ApiPath = apiPath; 57 | } 58 | 59 | public void setUpdateTime(long updateTime) { 60 | this.updateTime = updateTime; 61 | } 62 | 63 | public void setIscheck(String ischeck) { 64 | this.ischeck = ischeck; 65 | } 66 | 67 | public void setStuts(String stuts) { 68 | this.stuts = stuts; 69 | } 70 | 71 | public void setCreater(String creater) { 72 | this.creater = creater; 73 | } 74 | 75 | public void setOperator(String operator) { 76 | this.operator = operator; 77 | } 78 | 79 | public String getProject() { 80 | return project; 81 | } 82 | 83 | public String getName() { 84 | return name; 85 | } 86 | 87 | public String getApidescribe() { 88 | return Apidescribe; 89 | } 90 | 91 | public String getMethod() { 92 | return method; 93 | } 94 | 95 | public String getType() { 96 | return type; 97 | } 98 | 99 | public String getApiPath() { 100 | return ApiPath; 101 | } 102 | 103 | public long getUpdateTime() { 104 | return updateTime; 105 | } 106 | 107 | public String getIscheck() { 108 | return ischeck; 109 | } 110 | 111 | public String getStuts() { 112 | return stuts; 113 | } 114 | 115 | public String getCreater() { 116 | return creater; 117 | } 118 | 119 | public String getOperator() { 120 | return operator; 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /src/main/java/com/tool/plaform/entity/Result.java: -------------------------------------------------------------------------------- 1 | package com.tool.plaform.entity; 2 | 3 | import java.util.Date; 4 | 5 | public class Result { 6 | /** 7 | * 8 | * This field was generated by MyBatis Generator. 9 | * This field corresponds to the database column result.id 10 | * 11 | * @mbg.generated 12 | */ 13 | private Integer id; 14 | 15 | /** 16 | * 17 | * This field was generated by MyBatis Generator. 18 | * This field corresponds to the database column result.httpid 19 | * 20 | * @mbg.generated 21 | */ 22 | private Integer httpid; 23 | 24 | /** 25 | * 26 | * This field was generated by MyBatis Generator. 27 | * This field corresponds to the database column result.creatertime 28 | * 29 | * @mbg.generated 30 | */ 31 | private Date creatertime; 32 | 33 | /** 34 | * 35 | * This field was generated by MyBatis Generator. 36 | * This field corresponds to the database column result.updatetime 37 | * 38 | * @mbg.generated 39 | */ 40 | private Date updatetime; 41 | 42 | /** 43 | * 44 | * This field was generated by MyBatis Generator. 45 | * This field corresponds to the database column result.result 46 | * 47 | * @mbg.generated 48 | */ 49 | private String result; 50 | 51 | /** 52 | * This method was generated by MyBatis Generator. 53 | * This method returns the value of the database column result.id 54 | * 55 | * @return the value of result.id 56 | * 57 | * @mbg.generated 58 | */ 59 | public Integer getId() { 60 | return id; 61 | } 62 | 63 | /** 64 | * This method was generated by MyBatis Generator. 65 | * This method sets the value of the database column result.id 66 | * 67 | * @param id the value for result.id 68 | * 69 | * @mbg.generated 70 | */ 71 | public void setId(Integer id) { 72 | this.id = id; 73 | } 74 | 75 | /** 76 | * This method was generated by MyBatis Generator. 77 | * This method returns the value of the database column result.httpid 78 | * 79 | * @return the value of result.httpid 80 | * 81 | * @mbg.generated 82 | */ 83 | public Integer getHttpid() { 84 | return httpid; 85 | } 86 | 87 | /** 88 | * This method was generated by MyBatis Generator. 89 | * This method sets the value of the database column result.httpid 90 | * 91 | * @param httpid the value for result.httpid 92 | * 93 | * @mbg.generated 94 | */ 95 | public void setHttpid(Integer httpid) { 96 | this.httpid = httpid; 97 | } 98 | 99 | /** 100 | * This method was generated by MyBatis Generator. 101 | * This method returns the value of the database column result.creatertime 102 | * 103 | * @return the value of result.creatertime 104 | * 105 | * @mbg.generated 106 | */ 107 | public Date getCreatertime() { 108 | return creatertime; 109 | } 110 | 111 | /** 112 | * This method was generated by MyBatis Generator. 113 | * This method sets the value of the database column result.creatertime 114 | * 115 | * @param creatertime the value for result.creatertime 116 | * 117 | * @mbg.generated 118 | */ 119 | public void setCreatertime(Date creatertime) { 120 | this.creatertime = creatertime; 121 | } 122 | 123 | /** 124 | * This method was generated by MyBatis Generator. 125 | * This method returns the value of the database column result.updatetime 126 | * 127 | * @return the value of result.updatetime 128 | * 129 | * @mbg.generated 130 | */ 131 | public Date getUpdatetime() { 132 | return updatetime; 133 | } 134 | 135 | /** 136 | * This method was generated by MyBatis Generator. 137 | * This method sets the value of the database column result.updatetime 138 | * 139 | * @param updatetime the value for result.updatetime 140 | * 141 | * @mbg.generated 142 | */ 143 | public void setUpdatetime(Date updatetime) { 144 | this.updatetime = updatetime; 145 | } 146 | 147 | /** 148 | * This method was generated by MyBatis Generator. 149 | * This method returns the value of the database column result.result 150 | * 151 | * @return the value of result.result 152 | * 153 | * @mbg.generated 154 | */ 155 | public String getResult() { 156 | return result; 157 | } 158 | 159 | /** 160 | * This method was generated by MyBatis Generator. 161 | * This method sets the value of the database column result.result 162 | * 163 | * @param result the value for result.result 164 | * 165 | * @mbg.generated 166 | */ 167 | public void setResult(String result) { 168 | this.result = result == null ? null : result.trim(); 169 | } 170 | } -------------------------------------------------------------------------------- /src/main/java/com/tool/plaform/entity/Rule.java: -------------------------------------------------------------------------------- 1 | package com.tool.plaform.entity; 2 | 3 | import java.util.Date; 4 | 5 | public class Rule { 6 | 7 | /** 8 | * 9 | * This field was generated by MyBatis Generator. 10 | * This field corresponds to the database column rule.cond 11 | * 12 | * @mbg.generated 13 | */ 14 | private String cond; 15 | 16 | /** 17 | * 18 | * This field was generated by MyBatis Generator. 19 | * This field corresponds to the database column rule.cond_content 20 | * 21 | * @mbg.generated 22 | */ 23 | private String condContent; 24 | 25 | /** 26 | * 27 | * This field was generated by MyBatis Generator. 28 | * This field corresponds to the database column rule.fields 29 | * 30 | * @mbg.generated 31 | */ 32 | private String fields; 33 | 34 | /** 35 | * This method was generated by MyBatis Generator. 36 | * This method returns the value of the database column rule.cond 37 | * 38 | * @return the value of rule.cond 39 | * 40 | * @mbg.generated 41 | */ 42 | public String getCond() { 43 | return cond; 44 | } 45 | 46 | /** 47 | * This method was generated by MyBatis Generator. 48 | * This method sets the value of the database column rule.cond 49 | * 50 | * @param cond the value for rule.cond 51 | * 52 | * @mbg.generated 53 | */ 54 | public void setCond(String cond) { 55 | this.cond = cond == null ? null : cond.trim(); 56 | } 57 | 58 | /** 59 | * This method was generated by MyBatis Generator. 60 | * This method returns the value of the database column rule.cond_content 61 | * 62 | * @return the value of rule.cond_content 63 | * 64 | * @mbg.generated 65 | */ 66 | public String getCondContent() { 67 | return condContent; 68 | } 69 | 70 | /** 71 | * This method was generated by MyBatis Generator. 72 | * This method sets the value of the database column rule.cond_content 73 | * 74 | * @param condContent the value for rule.cond_content 75 | * 76 | * @mbg.generated 77 | */ 78 | public void setCondContent(String condContent) { 79 | this.condContent = condContent == null ? null : condContent.trim(); 80 | } 81 | 82 | /** 83 | * This method was generated by MyBatis Generator. 84 | * This method returns the value of the database column rule.fields 85 | * 86 | * @return the value of rule.fields 87 | * 88 | * @mbg.generated 89 | */ 90 | public String getFields() { 91 | return fields; 92 | } 93 | 94 | /** 95 | * This method was generated by MyBatis Generator. 96 | * This method sets the value of the database column rule.fields 97 | * 98 | * @param fields the value for rule.fields 99 | * 100 | * @mbg.generated 101 | */ 102 | public void setFields(String fields) { 103 | this.fields = fields == null ? null : fields.trim(); 104 | } 105 | /** 106 | * 107 | * This field was generated by MyBatis Generator. 108 | * This field corresponds to the database column rule.id 109 | * 110 | * @mbg.generated 111 | */ 112 | private Integer id; 113 | 114 | /** 115 | * 116 | * This field was generated by MyBatis Generator. 117 | * This field corresponds to the database column rule.name 118 | * 119 | * @mbg.generated 120 | */ 121 | private String name; 122 | 123 | /** 124 | * 125 | * This field was generated by MyBatis Generator. 126 | * This field corresponds to the database column rule.desc 127 | * 128 | * @mbg.generated 129 | */ 130 | private String desc; 131 | 132 | /** 133 | * 134 | * This field was generated by MyBatis Generator. 135 | * This field corresponds to the database column rule.result 136 | * 137 | * @mbg.generated 138 | */ 139 | private String result; 140 | 141 | /** 142 | * 143 | * This field was generated by MyBatis Generator. 144 | * This field corresponds to the database column rule.result_field 145 | * 146 | * @mbg.generated 147 | */ 148 | private String resultField; 149 | 150 | /** 151 | * 152 | * This field was generated by MyBatis Generator. 153 | * This field corresponds to the database column rule.state 154 | * 155 | * @mbg.generated 156 | */ 157 | private Integer state; 158 | 159 | /** 160 | * 161 | * This field was generated by MyBatis Generator. 162 | * This field corresponds to the database column rule.created_at 163 | * 164 | * @mbg.generated 165 | */ 166 | private Date createdAt; 167 | 168 | /** 169 | * 170 | * This field was generated by MyBatis Generator. 171 | * This field corresponds to the database column rule.updated_at 172 | * 173 | * @mbg.generated 174 | */ 175 | private Date updatedAt; 176 | 177 | /** 178 | * 179 | * This field was generated by MyBatis Generator. 180 | * This field corresponds to the database column rule.operator 181 | * 182 | * @mbg.generated 183 | */ 184 | private String operator; 185 | 186 | /** 187 | * 188 | * This field was generated by MyBatis Generator. 189 | * This field corresponds to the database column rule.inner_description 190 | * 191 | * @mbg.generated 192 | */ 193 | private String innerDescription; 194 | 195 | /** 196 | * 197 | * This field was generated by MyBatis Generator. 198 | * This field corresponds to the database column rule.outer_description 199 | * 200 | * @mbg.generated 201 | */ 202 | private String outerDescription; 203 | 204 | /** 205 | * 206 | * This field was generated by MyBatis Generator. 207 | * This field corresponds to the database column rule.remark 208 | * 209 | * @mbg.generated 210 | */ 211 | private String remark; 212 | 213 | /** 214 | * This method was generated by MyBatis Generator. 215 | * This method returns the value of the database column rule.id 216 | * 217 | * @return the value of rule.id 218 | * 219 | * @mbg.generated 220 | */ 221 | public Integer getId() { 222 | return id; 223 | } 224 | 225 | /** 226 | * This method was generated by MyBatis Generator. 227 | * This method sets the value of the database column rule.id 228 | * 229 | * @param id the value for rule.id 230 | * 231 | * @mbg.generated 232 | */ 233 | public void setId(Integer id) { 234 | this.id = id; 235 | } 236 | 237 | /** 238 | * This method was generated by MyBatis Generator. 239 | * This method returns the value of the database column rule.name 240 | * 241 | * @return the value of rule.name 242 | * 243 | * @mbg.generated 244 | */ 245 | public String getName() { 246 | return name; 247 | } 248 | 249 | /** 250 | * This method was generated by MyBatis Generator. 251 | * This method sets the value of the database column rule.name 252 | * 253 | * @param name the value for rule.name 254 | * 255 | * @mbg.generated 256 | */ 257 | public void setName(String name) { 258 | this.name = name == null ? null : name.trim(); 259 | } 260 | 261 | /** 262 | * This method was generated by MyBatis Generator. 263 | * This method returns the value of the database column rule.desc 264 | * 265 | * @return the value of rule.desc 266 | * 267 | * @mbg.generated 268 | */ 269 | public String getDesc() { 270 | return desc; 271 | } 272 | 273 | /** 274 | * This method was generated by MyBatis Generator. 275 | * This method sets the value of the database column rule.desc 276 | * 277 | * @param desc the value for rule.desc 278 | * 279 | * @mbg.generated 280 | */ 281 | public void setDesc(String desc) { 282 | this.desc = desc == null ? null : desc.trim(); 283 | } 284 | 285 | /** 286 | * This method was generated by MyBatis Generator. 287 | * This method returns the value of the database column rule.result 288 | * 289 | * @return the value of rule.result 290 | * 291 | * @mbg.generated 292 | */ 293 | public String getResult() { 294 | return result; 295 | } 296 | 297 | /** 298 | * This method was generated by MyBatis Generator. 299 | * This method sets the value of the database column rule.result 300 | * 301 | * @param result the value for rule.result 302 | * 303 | * @mbg.generated 304 | */ 305 | public void setResult(String result) { 306 | this.result = result == null ? null : result.trim(); 307 | } 308 | 309 | /** 310 | * This method was generated by MyBatis Generator. 311 | * This method returns the value of the database column rule.result_field 312 | * 313 | * @return the value of rule.result_field 314 | * 315 | * @mbg.generated 316 | */ 317 | public String getResultField() { 318 | return resultField; 319 | } 320 | 321 | /** 322 | * This method was generated by MyBatis Generator. 323 | * This method sets the value of the database column rule.result_field 324 | * 325 | * @param resultField the value for rule.result_field 326 | * 327 | * @mbg.generated 328 | */ 329 | public void setResultField(String resultField) { 330 | this.resultField = resultField == null ? null : resultField.trim(); 331 | } 332 | 333 | /** 334 | * This method was generated by MyBatis Generator. 335 | * This method returns the value of the database column rule.state 336 | * 337 | * @return the value of rule.state 338 | * 339 | * @mbg.generated 340 | */ 341 | public Integer getState() { 342 | return state; 343 | } 344 | 345 | /** 346 | * This method was generated by MyBatis Generator. 347 | * This method sets the value of the database column rule.state 348 | * 349 | * @param state the value for rule.state 350 | * 351 | * @mbg.generated 352 | */ 353 | public void setState(Integer state) { 354 | this.state = state; 355 | } 356 | 357 | /** 358 | * This method was generated by MyBatis Generator. 359 | * This method returns the value of the database column rule.created_at 360 | * 361 | * @return the value of rule.created_at 362 | * 363 | * @mbg.generated 364 | */ 365 | public Date getCreatedAt() { 366 | return createdAt; 367 | } 368 | 369 | /** 370 | * This method was generated by MyBatis Generator. 371 | * This method sets the value of the database column rule.created_at 372 | * 373 | * @param createdAt the value for rule.created_at 374 | * 375 | * @mbg.generated 376 | */ 377 | public void setCreatedAt(Date createdAt) { 378 | this.createdAt = createdAt; 379 | } 380 | 381 | /** 382 | * This method was generated by MyBatis Generator. 383 | * This method returns the value of the database column rule.updated_at 384 | * 385 | * @return the value of rule.updated_at 386 | * 387 | * @mbg.generated 388 | */ 389 | public Date getUpdatedAt() { 390 | return updatedAt; 391 | } 392 | 393 | /** 394 | * This method was generated by MyBatis Generator. 395 | * This method sets the value of the database column rule.updated_at 396 | * 397 | * @param updatedAt the value for rule.updated_at 398 | * 399 | * @mbg.generated 400 | */ 401 | public void setUpdatedAt(Date updatedAt) { 402 | this.updatedAt = updatedAt; 403 | } 404 | 405 | /** 406 | * This method was generated by MyBatis Generator. 407 | * This method returns the value of the database column rule.operator 408 | * 409 | * @return the value of rule.operator 410 | * 411 | * @mbg.generated 412 | */ 413 | public String getOperator() { 414 | return operator; 415 | } 416 | 417 | /** 418 | * This method was generated by MyBatis Generator. 419 | * This method sets the value of the database column rule.operator 420 | * 421 | * @param operator the value for rule.operator 422 | * 423 | * @mbg.generated 424 | */ 425 | public void setOperator(String operator) { 426 | this.operator = operator == null ? null : operator.trim(); 427 | } 428 | 429 | /** 430 | * This method was generated by MyBatis Generator. 431 | * This method returns the value of the database column rule.inner_description 432 | * 433 | * @return the value of rule.inner_description 434 | * 435 | * @mbg.generated 436 | */ 437 | public String getInnerDescription() { 438 | return innerDescription; 439 | } 440 | 441 | /** 442 | * This method was generated by MyBatis Generator. 443 | * This method sets the value of the database column rule.inner_description 444 | * 445 | * @param innerDescription the value for rule.inner_description 446 | * 447 | * @mbg.generated 448 | */ 449 | public void setInnerDescription(String innerDescription) { 450 | this.innerDescription = innerDescription == null ? null : innerDescription.trim(); 451 | } 452 | 453 | /** 454 | * This method was generated by MyBatis Generator. 455 | * This method returns the value of the database column rule.outer_description 456 | * 457 | * @return the value of rule.outer_description 458 | * 459 | * @mbg.generated 460 | */ 461 | public String getOuterDescription() { 462 | return outerDescription; 463 | } 464 | 465 | /** 466 | * This method was generated by MyBatis Generator. 467 | * This method sets the value of the database column rule.outer_description 468 | * 469 | * @param outerDescription the value for rule.outer_description 470 | * 471 | * @mbg.generated 472 | */ 473 | public void setOuterDescription(String outerDescription) { 474 | this.outerDescription = outerDescription == null ? null : outerDescription.trim(); 475 | } 476 | 477 | /** 478 | * This method was generated by MyBatis Generator. 479 | * This method returns the value of the database column rule.remark 480 | * 481 | * @return the value of rule.remark 482 | * 483 | * @mbg.generated 484 | */ 485 | public String getRemark() { 486 | return remark; 487 | } 488 | 489 | /** 490 | * This method was generated by MyBatis Generator. 491 | * This method sets the value of the database column rule.remark 492 | * 493 | * @param remark the value for rule.remark 494 | * 495 | * @mbg.generated 496 | */ 497 | public void setRemark(String remark) { 498 | this.remark = remark == null ? null : remark.trim(); 499 | } 500 | 501 | } -------------------------------------------------------------------------------- /src/main/java/com/tool/plaform/entity/RuleWithBLOBs.java: -------------------------------------------------------------------------------- 1 | package com.tool.plaform.entity; 2 | 3 | public class RuleWithBLOBs extends Rule { 4 | /** 5 | * 6 | * This field was generated by MyBatis Generator. 7 | * This field corresponds to the database column rule.cond 8 | * 9 | * @mbg.generated 10 | */ 11 | private String cond; 12 | 13 | /** 14 | * 15 | * This field was generated by MyBatis Generator. 16 | * This field corresponds to the database column rule.cond_content 17 | * 18 | * @mbg.generated 19 | */ 20 | private String condContent; 21 | 22 | /** 23 | * 24 | * This field was generated by MyBatis Generator. 25 | * This field corresponds to the database column rule.fields 26 | * 27 | * @mbg.generated 28 | */ 29 | private String fields; 30 | 31 | /** 32 | * This method was generated by MyBatis Generator. 33 | * This method returns the value of the database column rule.cond 34 | * 35 | * @return the value of rule.cond 36 | * 37 | * @mbg.generated 38 | */ 39 | public String getCond() { 40 | return cond; 41 | } 42 | 43 | /** 44 | * This method was generated by MyBatis Generator. 45 | * This method sets the value of the database column rule.cond 46 | * 47 | * @param cond the value for rule.cond 48 | * 49 | * @mbg.generated 50 | */ 51 | public void setCond(String cond) { 52 | this.cond = cond == null ? null : cond.trim(); 53 | } 54 | 55 | /** 56 | * This method was generated by MyBatis Generator. 57 | * This method returns the value of the database column rule.cond_content 58 | * 59 | * @return the value of rule.cond_content 60 | * 61 | * @mbg.generated 62 | */ 63 | public String getCondContent() { 64 | return condContent; 65 | } 66 | 67 | /** 68 | * This method was generated by MyBatis Generator. 69 | * This method sets the value of the database column rule.cond_content 70 | * 71 | * @param condContent the value for rule.cond_content 72 | * 73 | * @mbg.generated 74 | */ 75 | public void setCondContent(String condContent) { 76 | this.condContent = condContent == null ? null : condContent.trim(); 77 | } 78 | 79 | /** 80 | * This method was generated by MyBatis Generator. 81 | * This method returns the value of the database column rule.fields 82 | * 83 | * @return the value of rule.fields 84 | * 85 | * @mbg.generated 86 | */ 87 | public String getFields() { 88 | return fields; 89 | } 90 | 91 | /** 92 | * This method was generated by MyBatis Generator. 93 | * This method sets the value of the database column rule.fields 94 | * 95 | * @param fields the value for rule.fields 96 | * 97 | * @mbg.generated 98 | */ 99 | public void setFields(String fields) { 100 | this.fields = fields == null ? null : fields.trim(); 101 | } 102 | } -------------------------------------------------------------------------------- /src/main/java/com/tool/plaform/entity/TestPlaform.java: -------------------------------------------------------------------------------- 1 | package com.tool.plaform.entity; 2 | 3 | import java.io.Serializable; 4 | 5 | public class TestPlaform implements Serializable { 6 | 7 | public String plaform; 8 | public String uuid; 9 | public String owner; 10 | public String remark; 11 | public String mobile; 12 | 13 | 14 | public String getPlaform() { 15 | return plaform; 16 | } 17 | 18 | public void setPlaform(String plaform) { 19 | this.plaform = plaform; 20 | } 21 | 22 | public String getUuid() { 23 | return uuid; 24 | } 25 | 26 | public void setUuid(String uuid) { 27 | this.uuid = uuid; 28 | } 29 | 30 | public String getOwner() { 31 | return owner; 32 | } 33 | 34 | public void setOwner(String owner) { 35 | this.owner = owner; 36 | } 37 | 38 | public String getRemark() { 39 | return remark; 40 | } 41 | 42 | public void setRemark(String remark) { 43 | this.remark = remark; 44 | } 45 | 46 | public String getMobile() { 47 | return mobile; 48 | } 49 | 50 | public void setMobile(String mobile) { 51 | this.mobile = mobile; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/main/java/com/tool/plaform/entity/User.java: -------------------------------------------------------------------------------- 1 | package com.tool.plaform.entity; 2 | 3 | import java.util.Date; 4 | 5 | public class User { 6 | /** 7 | * 8 | * This field was generated by MyBatis Generator. 9 | * This field corresponds to the database column user.id 10 | * 11 | * @mbg.generated 12 | */ 13 | private Integer id; 14 | 15 | /** 16 | * 17 | * This field was generated by MyBatis Generator. 18 | * This field corresponds to the database column user.name 19 | * 20 | * @mbg.generated 21 | */ 22 | private String name; 23 | 24 | /** 25 | * 26 | * This field was generated by MyBatis Generator. 27 | * This field corresponds to the database column user.password 28 | * 29 | * @mbg.generated 30 | */ 31 | private String password; 32 | 33 | /** 34 | * 35 | * This field was generated by MyBatis Generator. 36 | * This field corresponds to the database column user.createtime 37 | * 38 | * @mbg.generated 39 | */ 40 | private Date createtime; 41 | 42 | /** 43 | * 44 | * This field was generated by MyBatis Generator. 45 | * This field corresponds to the database column user.email 46 | * 47 | * @mbg.generated 48 | */ 49 | private String email; 50 | 51 | /** 52 | * This method was generated by MyBatis Generator. 53 | * This method returns the value of the database column user.id 54 | * 55 | * @return the value of user.id 56 | * 57 | * @mbg.generated 58 | */ 59 | public Integer getId() { 60 | return id; 61 | } 62 | 63 | /** 64 | * This method was generated by MyBatis Generator. 65 | * This method sets the value of the database column user.id 66 | * 67 | * @param id the value for user.id 68 | * 69 | * @mbg.generated 70 | */ 71 | public void setId(Integer id) { 72 | this.id = id; 73 | } 74 | 75 | /** 76 | * This method was generated by MyBatis Generator. 77 | * This method returns the value of the database column user.name 78 | * 79 | * @return the value of user.name 80 | * 81 | * @mbg.generated 82 | */ 83 | public String getName() { 84 | return name; 85 | } 86 | 87 | /** 88 | * This method was generated by MyBatis Generator. 89 | * This method sets the value of the database column user.name 90 | * 91 | * @param name the value for user.name 92 | * 93 | * @mbg.generated 94 | */ 95 | public void setName(String name) { 96 | this.name = name == null ? null : name.trim(); 97 | } 98 | 99 | /** 100 | * This method was generated by MyBatis Generator. 101 | * This method returns the value of the database column user.password 102 | * 103 | * @return the value of user.password 104 | * 105 | * @mbg.generated 106 | */ 107 | public String getPassword() { 108 | return password; 109 | } 110 | 111 | /** 112 | * This method was generated by MyBatis Generator. 113 | * This method sets the value of the database column user.password 114 | * 115 | * @param password the value for user.password 116 | * 117 | * @mbg.generated 118 | */ 119 | public void setPassword(String password) { 120 | this.password = password == null ? null : password.trim(); 121 | } 122 | 123 | /** 124 | * This method was generated by MyBatis Generator. 125 | * This method returns the value of the database column user.createtime 126 | * 127 | * @return the value of user.createtime 128 | * 129 | * @mbg.generated 130 | */ 131 | public Date getCreatetime() { 132 | return createtime; 133 | } 134 | 135 | /** 136 | * This method was generated by MyBatis Generator. 137 | * This method sets the value of the database column user.createtime 138 | * 139 | * @param createtime the value for user.createtime 140 | * 141 | * @mbg.generated 142 | */ 143 | public void setCreatetime(Date createtime) { 144 | this.createtime = createtime; 145 | } 146 | 147 | /** 148 | * This method was generated by MyBatis Generator. 149 | * This method returns the value of the database column user.email 150 | * 151 | * @return the value of user.email 152 | * 153 | * @mbg.generated 154 | */ 155 | public String getEmail() { 156 | return email; 157 | } 158 | 159 | /** 160 | * This method was generated by MyBatis Generator. 161 | * This method sets the value of the database column user.email 162 | * 163 | * @param email the value for user.email 164 | * 165 | * @mbg.generated 166 | */ 167 | public void setEmail(String email) { 168 | this.email = email == null ? null : email.trim(); 169 | } 170 | } -------------------------------------------------------------------------------- /src/main/java/com/tool/plaform/entity/UserQuery.java: -------------------------------------------------------------------------------- 1 | package com.tool.plaform.entity; 2 | 3 | public class UserQuery 4 | { 5 | /**登录名称*/ 6 | private String loginName; 7 | 8 | /**登录密码*/ 9 | private String password; 10 | 11 | /**是否允许登录*/ 12 | private Boolean enable; 13 | 14 | /**注册开始时间*/ 15 | private String createStartTime; 16 | 17 | /**注册结束时间*/ 18 | private String createEndTime; 19 | 20 | public String getLoginName() 21 | { 22 | return loginName; 23 | } 24 | 25 | public void setLoginName(String loginName) 26 | { 27 | this.loginName = loginName; 28 | } 29 | 30 | public String getPassword() 31 | { 32 | return password; 33 | } 34 | 35 | public void setPassword(String password) 36 | { 37 | this.password = password; 38 | } 39 | 40 | public Boolean getEnable() 41 | { 42 | return enable; 43 | } 44 | 45 | public void setEnable(Boolean enable) 46 | { 47 | this.enable = enable; 48 | } 49 | 50 | public String getCreateStartTime() 51 | { 52 | return createStartTime; 53 | } 54 | 55 | public void setCreateStartTime(String createStartTime) 56 | { 57 | this.createStartTime = createStartTime; 58 | } 59 | 60 | public String getCreateEndTime() 61 | { 62 | return createEndTime; 63 | } 64 | 65 | public void setCreateEndTime(String createEndTime) 66 | { 67 | this.createEndTime = createEndTime; 68 | } 69 | 70 | @Override 71 | public String toString() 72 | { 73 | return "UserQuery [loginName=" + loginName + ", password=" + password + ", enable=" + enable 74 | + ", createStartTime=" + createStartTime + ", createEndTime=" + createEndTime + "]"; 75 | } 76 | 77 | } 78 | -------------------------------------------------------------------------------- /src/main/java/com/tool/plaform/impl/ApiServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.tool.plaform.impl; 2 | 3 | import com.alibaba.fastjson.JSON; 4 | import com.tool.plaform.dao.ApiMapper; 5 | import com.tool.plaform.dao.ResultMapper; 6 | import com.tool.plaform.entity.Api; 7 | import com.tool.plaform.entity.Result; 8 | import com.tool.plaform.service.ApiService; 9 | import com.tool.plaform.utils.HttpClientUtil; 10 | import com.tool.plaform.vo.ApiVo; 11 | import org.springframework.beans.factory.annotation.Autowired; 12 | import org.springframework.stereotype.Service; 13 | 14 | import java.sql.Timestamp; 15 | import java.util.List; 16 | import java.util.Map; 17 | 18 | @Service 19 | public class ApiServiceImpl implements ApiService { 20 | 21 | @Autowired 22 | ApiMapper apiMapper; 23 | 24 | @Autowired 25 | ResultMapper resultMapper; 26 | 27 | @Override 28 | public int insert(Api api) { 29 | if (api.getMethod().isEmpty()) { 30 | throw new IllegalArgumentException("请求方法不能为空"); 31 | } 32 | if (api.getParam().isEmpty() || api.getParam().equals("")) { 33 | throw new IllegalArgumentException("请求参数不能为空"); 34 | } 35 | if (api.getUrl().isEmpty() || api.getUrl().equals("")) { 36 | throw new IllegalArgumentException("请求url不能为空"); 37 | } 38 | return apiMapper.insert(api); 39 | } 40 | 41 | @Override 42 | public Api queryApiByparam(String param) { 43 | return null; 44 | } 45 | 46 | @Override 47 | public List findAllApi() { 48 | return apiMapper.findAllApi(); 49 | } 50 | 51 | @Override 52 | public String apiTest(ApiVo apiVo) { 53 | Api api = new Api(); 54 | api.setExpect(apiVo.getExpect()); 55 | Map paramsMap = apiVo.getParams(); 56 | String params = JSON.toJSONString(paramsMap); 57 | api.setParam(params); 58 | 59 | String result=null; 60 | String url=apiVo.getUrl(); 61 | String param=api.getParam(); 62 | int port=apiVo.getPort(); 63 | String rootUrl=apiVo.getRootUrl(); 64 | String method=apiVo.getMethod(); 65 | url=buildUrl(rootUrl,url,port,param,method); 66 | if(method.equalsIgnoreCase("get")){ 67 | result=HttpClientUtil.get(url,5000); 68 | }else if(method.equalsIgnoreCase("post")){ 69 | result=HttpClientUtil.post(url,param,5000); 70 | } 71 | 72 | Result testRusult=new Result(); 73 | testRusult.setCreatertime(new Timestamp(System.currentTimeMillis())); 74 | testRusult.setHttpid(apiVo.getId()); 75 | testRusult.setResult(result); 76 | testRusult.setUpdatetime(new Timestamp(System.currentTimeMillis())); 77 | resultMapper.insert(testRusult); 78 | return result; 79 | } 80 | 81 | @Override 82 | public int updateByPrimaryKey(Api record) { 83 | return 0; 84 | } 85 | 86 | @Override 87 | public Api selectByPrimaryKey(Integer id) { 88 | return apiMapper.selectByPrimaryKey(id); 89 | } 90 | 91 | public static String buildUrl(String rootUrl,String url,int port,String param,String method){ 92 | if(!rootUrl.startsWith("http")){ 93 | rootUrl="http://"+rootUrl; 94 | } 95 | 96 | if(method.equalsIgnoreCase("get")){ 97 | url =rootUrl+":"+port+url+"?"+param; 98 | }else if(method.equalsIgnoreCase("post")){ 99 | url =rootUrl+":"+port+url; 100 | } 101 | System.out.println("==================================================="); 102 | System.out.println("request method:"+method+" request url:"+url+" request param:"+param); 103 | return url; 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /src/main/java/com/tool/plaform/impl/ResultServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.tool.plaform.impl; 2 | 3 | import com.tool.plaform.dao.ResultMapper; 4 | import com.tool.plaform.entity.Result; 5 | import com.tool.plaform.service.ResultService; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | 9 | @Service 10 | public class ResultServiceImpl implements ResultService{ 11 | 12 | @Autowired 13 | ResultMapper resultMapper; 14 | 15 | @Override 16 | public int insert(Result result) { 17 | if(result.getResult()!=null&&!result.getResult().equals("")){ 18 | return resultMapper.insert(result); 19 | }else { 20 | return 0; 21 | } 22 | } 23 | 24 | @Override 25 | public Result selectByPrimaryKey(Integer id) { 26 | return null; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/tool/plaform/impl/RuleServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.tool.plaform.impl; 2 | 3 | import com.tool.plaform.dao.RuleMapper; 4 | import com.tool.plaform.entity.Rule; 5 | import com.tool.plaform.service.RuleService; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | 9 | import java.util.ArrayList; 10 | import java.util.List; 11 | 12 | @Service 13 | public class RuleServiceImpl implements RuleService{ 14 | 15 | @Autowired 16 | RuleMapper ruleMapper; 17 | 18 | @Override 19 | public int insert(Rule rule) { 20 | return 0; 21 | } 22 | 23 | @Override 24 | public Rule queryRuleByCode(String code) { 25 | return null; 26 | } 27 | 28 | @Override 29 | public List findAllRule() { 30 | List rules=ruleMapper.findAllRule(); 31 | List resultCode=new ArrayList<>(); 32 | List resultList=new ArrayList<>(); 33 | for(Rule rule:rules){ 34 | String result=rule.getResult(); 35 | String condContent=rule.getCondContent(); 36 | if(result!=null&&!result.equalsIgnoreCase("")&&condContent!=null&&!resultCode.contains(result)){ 37 | resultCode.add(result); 38 | resultList.add(rule); 39 | } 40 | } 41 | return resultList; 42 | } 43 | 44 | @Override 45 | public int updateByPrimaryKey(Rule record) { 46 | return 0; 47 | } 48 | 49 | @Override 50 | public Rule selectByPrimaryKey(Integer id) { 51 | return null; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/main/java/com/tool/plaform/impl/UserServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.tool.plaform.impl; 2 | 3 | import com.tool.plaform.dao.UserMapper; 4 | import com.tool.plaform.entity.User; 5 | import com.tool.plaform.entity.UserQuery; 6 | import com.tool.plaform.service.UserService; 7 | import com.tool.plaform.utils.UpdatePasswordInput; 8 | 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.stereotype.Service; 11 | 12 | import java.util.List; 13 | 14 | @Service 15 | public class UserServiceImpl implements UserService { 16 | 17 | /** 18 | * 19 | */ 20 | @Autowired 21 | UserMapper userMapper; 22 | 23 | @Override 24 | public int insert(User user) { 25 | if (user.getName().isEmpty()||user.getName().equals("")) 26 | { 27 | throw new IllegalArgumentException("登录名称不能为空"); 28 | } 29 | if (user.getPassword().isEmpty()||user.getPassword().equals("")) 30 | { 31 | throw new IllegalArgumentException("用户密码不能为空"); 32 | } 33 | UserQuery newUser = new UserQuery(); 34 | newUser.setLoginName(user.getName()); 35 | User otherUser=userMapper.queryUserByLoginName(newUser); 36 | if(otherUser!=null){ 37 | throw new IllegalArgumentException("用户名已经存在"); 38 | } 39 | return userMapper.insert(user); 40 | } 41 | 42 | @Override 43 | public int updateUser(User user) { 44 | return 0; 45 | } 46 | 47 | @Override 48 | public User queryUserById(int id) { 49 | return null; 50 | } 51 | 52 | @Override 53 | public User login(UserQuery userQuery) { 54 | return null; 55 | } 56 | 57 | @Override 58 | public int updatePassword(UpdatePasswordInput input, int userId) { 59 | return 0; 60 | } 61 | 62 | @Override 63 | public int updateNickname(int userId, String nickname) { 64 | return 0; 65 | } 66 | 67 | @Override 68 | public List findUserList(UserQuery userQuery) { 69 | return null; 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /src/main/java/com/tool/plaform/myConfig.java: -------------------------------------------------------------------------------- 1 | package com.tool.plaform; 2 | 3 | public class myConfig { 4 | 5 | public static String ip="192.168.130.3"; 6 | public static String db_thirdparty="thirdparty"; 7 | public static String user="test"; 8 | public static String password="123456"; 9 | public static String db_business="business"; 10 | public static String baseUrl="http://localhost:4501/"; 11 | 12 | 13 | 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/tool/plaform/service/ApiService.java: -------------------------------------------------------------------------------- 1 | package com.tool.plaform.service; 2 | 3 | import com.tool.plaform.entity.Api; 4 | import com.tool.plaform.vo.ApiVo; 5 | 6 | import java.util.List; 7 | 8 | public interface ApiService { 9 | public int insert(Api api); 10 | public Api queryApiByparam(String param); 11 | public List findAllApi(); 12 | public String apiTest(ApiVo apiVo); 13 | int updateByPrimaryKey(Api record); 14 | Api selectByPrimaryKey(Integer id); 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/tool/plaform/service/ResultService.java: -------------------------------------------------------------------------------- 1 | package com.tool.plaform.service; 2 | 3 | import com.tool.plaform.entity.Result; 4 | 5 | 6 | public interface ResultService { 7 | int insert(Result result); 8 | Result selectByPrimaryKey(Integer id); 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/com/tool/plaform/service/RuleService.java: -------------------------------------------------------------------------------- 1 | package com.tool.plaform.service; 2 | 3 | import com.tool.plaform.entity.Rule; 4 | import com.tool.plaform.entity.RuleWithBLOBs; 5 | 6 | import java.util.List; 7 | 8 | public interface RuleService { 9 | public int insert(Rule rule); 10 | public Rule queryRuleByCode(String code); 11 | public List findAllRule(); 12 | int updateByPrimaryKey(Rule record); 13 | Rule selectByPrimaryKey(Integer id); 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/com/tool/plaform/service/UserService.java: -------------------------------------------------------------------------------- 1 | package com.tool.plaform.service; 2 | 3 | import com.tool.plaform.entity.User; 4 | import com.tool.plaform.entity.UserQuery; 5 | import com.tool.plaform.utils.UpdatePasswordInput; 6 | 7 | import java.util.List; 8 | 9 | public interface UserService { 10 | int insert(User user); 11 | int updateUser(User user); 12 | User queryUserById(int id); 13 | User login(UserQuery userQuery); 14 | int updatePassword(UpdatePasswordInput input, int userId); 15 | int updateNickname(int userId, String nickname); 16 | List findUserList(UserQuery userQuery); 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/tool/plaform/utils/ApiResult.java: -------------------------------------------------------------------------------- 1 | package com.tool.plaform.utils; 2 | 3 | 4 | /** 5 | * web api 返回值的基础实体,web api 的返回对象建议都使用此对象包装。 6 | * 7 | * @param 8 | */ 9 | public class ApiResult { 10 | public boolean success; 11 | public String message; 12 | public int retCode; 13 | public T data; 14 | 15 | public static ApiResult fail(String message) { 16 | ApiResult result = new ApiResult(); 17 | result.success = false; 18 | result.message = message; 19 | result.retCode = ErrorCode.EXCEPTION; 20 | return result; 21 | } 22 | 23 | public static ApiResult fail(int retCode, String message) { 24 | ApiResult result = new ApiResult(); 25 | result.success = false; 26 | result.message = message; 27 | result.retCode = retCode; 28 | return result; 29 | } 30 | 31 | public static ApiResult fail(Exception e) { 32 | ApiResult result = new ApiResult(); 33 | result.success = false; 34 | result.retCode = ErrorCode.EXCEPTION; 35 | if (e.getLocalizedMessage()==null) { 36 | result.message = e.toString(); 37 | } else { 38 | result.message = e.getLocalizedMessage(); 39 | } 40 | 41 | return result; 42 | } 43 | 44 | public static ApiResult success() { 45 | return success(null, "success"); 46 | } 47 | 48 | public static ApiResult success(U data) { 49 | return success(data, "success"); 50 | } 51 | 52 | public static ApiResult success(U data, String message) { 53 | ApiResult result = new ApiResult(); 54 | result.success = true; 55 | result.data = data; 56 | result.retCode = ErrorCode.OK; 57 | result.message = message; 58 | return result; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/main/java/com/tool/plaform/utils/DBObjectUtil.java: -------------------------------------------------------------------------------- 1 | package com.tool.plaform.utils; 2 | 3 | import com.mongodb.BasicDBObject; 4 | import com.mongodb.DBObject; 5 | import com.mongodb.util.JSON; 6 | 7 | public class DBObjectUtil { 8 | public static DBObject parseJson(String strJson){ 9 | BasicDBObject obj = new BasicDBObject(); 10 | try { 11 | obj = (BasicDBObject) JSON.parse(strJson); 12 | } catch(Exception e) { 13 | System.out.print("解析jason异常:"+e); 14 | } 15 | return obj; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/tool/plaform/utils/ErrorCode.java: -------------------------------------------------------------------------------- 1 | package com.tool.plaform.utils; 2 | 3 | public class ErrorCode 4 | { 5 | public static final int OK = 0; //成功 6 | public static final int RE_LOGIN = -1; //重新登录 7 | public static final int EXCEPTION = 100; //暂时没有细分其他异常 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/com/tool/plaform/utils/MGO.java: -------------------------------------------------------------------------------- 1 | package com.tool.plaform.utils; 2 | 3 | public class MGO { 4 | public static final int business = 0; 5 | public static final int applogs = 1; 6 | public static final int thirdparty = 2; 7 | public static final int privateland = 3; 8 | public static final int size = 4; 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/com/tool/plaform/utils/MongoDbUtils.java: -------------------------------------------------------------------------------- 1 | package com.tool.plaform.utils; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | 7 | import com.tool.plaform.myConfig; 8 | import org.bson.Document; 9 | 10 | import com.mongodb.BasicDBObject; 11 | import com.mongodb.MongoClient; 12 | import com.mongodb.MongoCredential; 13 | import com.mongodb.ServerAddress; 14 | import com.mongodb.client.MongoCollection; 15 | import com.mongodb.client.MongoCursor; 16 | import com.mongodb.client.MongoDatabase; 17 | import com.mongodb.util.JSON; 18 | 19 | 20 | public class MongoDbUtils { 21 | 22 | 23 | 24 | private static String user= myConfig.user; 25 | 26 | private static String password=myConfig.password; 27 | 28 | 29 | private static String ip=myConfig.ip; 30 | 31 | 32 | 33 | public static MongoDatabase getMongo(String db){ 34 | MongoDatabase mongoDatabase=null; 35 | try { 36 | //连接到MongoDB服务 如果是远程连接可以替换“localhost”为服务器所在IP地址 37 | //ServerAddress()两个参数分别为 服务器地址 和 端口 38 | ServerAddress serverAddress = new ServerAddress(ip,27014); 39 | List addrs = new ArrayList(); 40 | addrs.add(serverAddress); 41 | 42 | //MongoCredential.createScramSha1Credential()三个参数分别为 用户名 数据库名称 密码 43 | MongoCredential credential = MongoCredential.createScramSha1Credential(user, db, password.toCharArray()); 44 | List credentials = new ArrayList(); 45 | credentials.add(credential); 46 | //通过连接认证获取MongoDB连接 47 | MongoClient mongoClient = new MongoClient(addrs,credentials); 48 | 49 | //连接到数据库 50 | mongoDatabase= mongoClient.getDatabase(db); 51 | System.out.println("Connect to database successfully"); 52 | } catch (Exception e) { 53 | System.err.println( e.getClass().getName() + ": " + e.getMessage() ); 54 | } 55 | return mongoDatabase; 56 | } 57 | 58 | public static boolean insertOne(String coll,String db, BasicDBObject obj) { 59 | long start = System.currentTimeMillis(); 60 | try { 61 | MongoDbUtils.getInstance().getColl(coll,db).insertOne(Document.parse(obj.toString())); 62 | } catch (Throwable e) { 63 | System.err.println("coll:"+coll+", insertOne db exception: " + e.getMessage()+e); 64 | return false; 65 | } finally { 66 | long spend = System.currentTimeMillis() - start; 67 | System.err.println("coll:"+coll+", time:"+spend); 68 | } 69 | return true; 70 | } 71 | 72 | public static boolean updateOne(String coll,String db, BasicDBObject query, BasicDBObject obj) { 73 | long start = System.currentTimeMillis(); 74 | try { 75 | MongoDbUtils.getInstance().getColl(coll,db).updateOne(query, obj); 76 | } catch (Throwable e) { 77 | return false; 78 | } finally { 79 | long spend = System.currentTimeMillis() - start; 80 | } 81 | return true; 82 | } 83 | 84 | /** 85 | * 查询被匹配到的所有记录 86 | 87 | * @param coll 数据集名称 88 | * @param query 查询条件 89 | * @return MongoCursor 90 | */ 91 | public static MongoCursor find(String coll,String db, BasicDBObject query) { 92 | return find(coll, db,query, null); 93 | } 94 | 95 | /** 96 | * 查询被匹配到的按排序规则排序后的所有记录 97 | 98 | * @param coll 数据集名称 99 | * @param query 查询条件 100 | * @param orderby 排序规则 101 | * @return MongoCursor 102 | */ 103 | public static MongoCursor find(String coll,String db ,BasicDBObject query, BasicDBObject orderby) { 104 | long start = System.currentTimeMillis(); 105 | MongoCursor cursor = null; 106 | try { 107 | if (orderby != null) { 108 | cursor = MongoDbUtils.getInstance().getColl(coll,db).find(query).sort(orderby).iterator(); 109 | } else { 110 | cursor = MongoDbUtils.getInstance().getColl(coll,db).find(query).iterator(); 111 | } 112 | } catch (Throwable e) { 113 | System.err.println("coll:"+coll+", query:"+query+", find db exception: " + e.getMessage()+e); 114 | } finally { 115 | long spend = System.currentTimeMillis() - start; 116 | System.err.println("coll:"+coll+", query:"+query+", orderby:"+orderby+", time:"+spend); 117 | } 118 | return cursor; 119 | } 120 | public static BasicDBObject findOne(String coll, String db,BasicDBObject query, BasicDBObject orderby) { 121 | long start = System.currentTimeMillis(); 122 | BasicDBObject resObj = null; 123 | try { 124 | Document doc = null; 125 | if (orderby != null) { 126 | doc = MongoDbUtils.getInstance().getColl(coll,db).find(query).sort(orderby).first(); 127 | } else { 128 | doc = MongoDbUtils.getInstance().getColl(coll,db).find(query).first(); 129 | } 130 | if (doc != null) { 131 | resObj = (BasicDBObject)JSON.parse(doc.toJson()); 132 | } 133 | } catch (Throwable e) { 134 | System.err.println("coll:"+coll+", query:"+query+", orderby:"+orderby+", find db exception: " + e.getMessage()+e); 135 | return null; 136 | } finally { 137 | long spend = System.currentTimeMillis() - start; 138 | System.err.println("coll:"+coll+", query:"+query+", orderby:"+orderby+", time:"+spend); 139 | } 140 | return resObj; 141 | } 142 | 143 | private static class SingletonClassInstance { 144 | private static final MongoDbUtils instance = new MongoDbUtils(); 145 | } 146 | 147 | public static MongoDbUtils getInstance() { 148 | return SingletonClassInstance.instance; 149 | } 150 | 151 | public MongoCollection getColl(String coll,String db) { 152 | return getMongo(db).getCollection(coll); 153 | } 154 | } 155 | -------------------------------------------------------------------------------- /src/main/java/com/tool/plaform/utils/StringUtils.java: -------------------------------------------------------------------------------- 1 | package com.tool.plaform.utils; 2 | 3 | import java.util.regex.Matcher; 4 | import java.util.regex.Pattern; 5 | 6 | public class StringUtils { 7 | 8 | public static boolean isNotEmpty(String str){ 9 | return str == null || str.length() == 0; 10 | } 11 | 12 | public static boolean isEmpty(String str) { 13 | if (str == null || str.trim().length() <= 0) { 14 | return true; 15 | } 16 | return false; 17 | } 18 | 19 | public static String unicodeToString(String str) { 20 | Pattern pattern = Pattern.compile("(\\\\u(\\p{XDigit}{4}))"); 21 | Matcher matcher = pattern.matcher(str); 22 | char ch; 23 | while (matcher.find()) { 24 | ch = (char) Integer.parseInt(matcher.group(2), 16); 25 | str = str.replace(matcher.group(1), ch + ""); 26 | } 27 | return str; 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/tool/plaform/utils/UpdatePasswordInput.java: -------------------------------------------------------------------------------- 1 | package com.tool.plaform.utils; 2 | 3 | public class UpdatePasswordInput 4 | { 5 | /**旧登录密码*/ 6 | private String oldPassword; 7 | 8 | /**新登录密码*/ 9 | private String newPassword; 10 | 11 | public String getOldPassword() 12 | { 13 | return oldPassword; 14 | } 15 | 16 | public void setOldPassword(String oldPassword) 17 | { 18 | this.oldPassword = oldPassword; 19 | } 20 | 21 | public String getNewPassword() 22 | { 23 | return newPassword; 24 | } 25 | 26 | public void setNewPassword(String newPassword) 27 | { 28 | this.newPassword = newPassword; 29 | } 30 | 31 | @Override 32 | public String toString() 33 | { 34 | return "UpdatePasswordInput [oldPassword=" + oldPassword + ", newPassword=" + newPassword + "]"; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/tool/plaform/vo/ApiVo.java: -------------------------------------------------------------------------------- 1 | package com.tool.plaform.vo; 2 | 3 | import java.util.Map; 4 | 5 | public class ApiVo { 6 | 7 | private String rootUrl; 8 | 9 | private String url; 10 | private int id; 11 | 12 | private Map params; 13 | 14 | private String type; 15 | 16 | private String contentType; 17 | 18 | private String expect; 19 | private int port; 20 | private String method; 21 | 22 | public void setId(int id) { 23 | this.id = id; 24 | } 25 | 26 | public int getId() { 27 | return id; 28 | } 29 | 30 | public void setPort(int port) { 31 | this.port = port; 32 | } 33 | 34 | public void setMethod(String method) { 35 | this.method = method; 36 | } 37 | 38 | public int getPort() { 39 | return port; 40 | } 41 | 42 | public String getMethod() { 43 | return method; 44 | } 45 | 46 | public String getRootUrl() { 47 | return rootUrl; 48 | } 49 | 50 | public void setRootUrl(String rootUrl) { 51 | this.rootUrl = rootUrl; 52 | } 53 | 54 | public String getUrl() { 55 | return url; 56 | } 57 | 58 | public void setUrl(String url) { 59 | this.url = url; 60 | } 61 | 62 | public Map getParams() { 63 | return params; 64 | } 65 | 66 | public void setParams(Map params) { 67 | this.params = params; 68 | } 69 | 70 | public String getType() { 71 | return type; 72 | } 73 | 74 | public void setType(String type) { 75 | this.type = type; 76 | } 77 | 78 | public String getContentType() { 79 | return contentType; 80 | } 81 | 82 | public void setContentType(String contentType) { 83 | this.contentType = contentType; 84 | } 85 | 86 | public String getExpect() { 87 | return expect; 88 | } 89 | 90 | public void setExpect(String expect) { 91 | this.expect = expect; 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port=4501 2 | spring.mvc.static-path-pattern=/static/** 3 | 4 | spring.datasource.url=jdbc:mysql://192.168.130.10:3306/engine_db2?useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true 5 | spring.datasource.username=root 6 | spring.datasource.password=root 7 | spring.datasource.driver-class-name=com.mysql.jdbc.Driver 8 | 9 | spring.data.mongodb.uri=mongodb://test:123456@192.168.130.7:27014/thirdparty 10 | 11 | mybatis.mapperLocations=classpath*:/mapping/**/*.xml 12 | mybatis.typeAliasesPackage=com.tool.plaform.entity -------------------------------------------------------------------------------- /src/main/resources/generatorConfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 7 | 8 | 9 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 |
58 |
59 |
60 | -------------------------------------------------------------------------------- /src/main/resources/mapping/ApiMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 24 | id, method, url, param, type, contenttype, expect, port, rooturl 25 | 26 | 36 | 37 | 41 | delete from api 42 | where id = #{id,jdbcType=INTEGER} 43 | 44 | 45 | 49 | insert into api (id, method, url, 50 | param, type, contenttype, 51 | expect, port, rooturl 52 | ) 53 | values (#{id,jdbcType=INTEGER}, #{method,jdbcType=VARCHAR}, #{url,jdbcType=VARCHAR}, 54 | #{param,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{contenttype,jdbcType=VARCHAR}, 55 | #{expect,jdbcType=VARCHAR}, #{port,jdbcType=INTEGER}, #{rooturl,jdbcType=VARCHAR} 56 | ) 57 | 58 | 59 | 63 | insert into api 64 | 65 | 66 | id, 67 | 68 | 69 | method, 70 | 71 | 72 | url, 73 | 74 | 75 | param, 76 | 77 | 78 | type, 79 | 80 | 81 | contenttype, 82 | 83 | 84 | expect, 85 | 86 | 87 | port, 88 | 89 | 90 | rooturl, 91 | 92 | 93 | 94 | 95 | #{id,jdbcType=INTEGER}, 96 | 97 | 98 | #{method,jdbcType=VARCHAR}, 99 | 100 | 101 | #{url,jdbcType=VARCHAR}, 102 | 103 | 104 | #{param,jdbcType=VARCHAR}, 105 | 106 | 107 | #{type,jdbcType=VARCHAR}, 108 | 109 | 110 | #{contenttype,jdbcType=VARCHAR}, 111 | 112 | 113 | #{expect,jdbcType=VARCHAR}, 114 | 115 | 116 | #{port,jdbcType=INTEGER}, 117 | 118 | 119 | #{rooturl,jdbcType=VARCHAR}, 120 | 121 | 122 | 123 | 124 | 128 | update api 129 | 130 | 131 | method = #{method,jdbcType=VARCHAR}, 132 | 133 | 134 | url = #{url,jdbcType=VARCHAR}, 135 | 136 | 137 | param = #{param,jdbcType=VARCHAR}, 138 | 139 | 140 | type = #{type,jdbcType=VARCHAR}, 141 | 142 | 143 | contenttype = #{contenttype,jdbcType=VARCHAR}, 144 | 145 | 146 | expect = #{expect,jdbcType=VARCHAR}, 147 | 148 | 149 | port = #{port,jdbcType=INTEGER}, 150 | 151 | 152 | rooturl = #{rooturl,jdbcType=VARCHAR}, 153 | 154 | 155 | where id = #{id,jdbcType=INTEGER} 156 | 157 | 158 | 162 | update api 163 | set method = #{method,jdbcType=VARCHAR}, 164 | url = #{url,jdbcType=VARCHAR}, 165 | param = #{param,jdbcType=VARCHAR}, 166 | type = #{type,jdbcType=VARCHAR}, 167 | contenttype = #{contenttype,jdbcType=VARCHAR}, 168 | expect = #{expect,jdbcType=VARCHAR}, 169 | port = #{port,jdbcType=INTEGER}, 170 | rooturl = #{rooturl,jdbcType=VARCHAR} 171 | where id = #{id,jdbcType=INTEGER} 172 | 173 | 174 | 184 | 185 | 190 | -------------------------------------------------------------------------------- /src/main/resources/mapping/ResultMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 19 | 20 | 21 | 22 | 26 | id, httpid, creatertime, updatetime 27 | 28 | 29 | 33 | result 34 | 35 | 47 | 48 | 52 | delete from result 53 | where id = #{id,jdbcType=INTEGER} 54 | 55 | 56 | 60 | insert into result (id, httpid, creatertime, 61 | updatetime, result) 62 | values (#{id,jdbcType=INTEGER}, #{httpid,jdbcType=INTEGER}, #{creatertime,jdbcType=TIMESTAMP}, 63 | #{updatetime,jdbcType=TIME}, #{result,jdbcType=LONGVARCHAR}) 64 | 65 | 66 | 70 | insert into result 71 | 72 | 73 | id, 74 | 75 | 76 | httpid, 77 | 78 | 79 | creatertime, 80 | 81 | 82 | updatetime, 83 | 84 | 85 | result, 86 | 87 | 88 | 89 | 90 | #{id,jdbcType=INTEGER}, 91 | 92 | 93 | #{httpid,jdbcType=INTEGER}, 94 | 95 | 96 | #{creatertime,jdbcType=TIMESTAMP}, 97 | 98 | 99 | #{updatetime,jdbcType=TIME}, 100 | 101 | 102 | #{result,jdbcType=LONGVARCHAR}, 103 | 104 | 105 | 106 | 107 | 111 | update result 112 | 113 | 114 | httpid = #{httpid,jdbcType=INTEGER}, 115 | 116 | 117 | creatertime = #{creatertime,jdbcType=TIMESTAMP}, 118 | 119 | 120 | updatetime = #{updatetime,jdbcType=TIME}, 121 | 122 | 123 | result = #{result,jdbcType=LONGVARCHAR}, 124 | 125 | 126 | where id = #{id,jdbcType=INTEGER} 127 | 128 | 129 | 133 | update result 134 | set httpid = #{httpid,jdbcType=INTEGER}, 135 | creatertime = #{creatertime,jdbcType=TIMESTAMP}, 136 | updatetime = #{updatetime,jdbcType=TIME}, 137 | result = #{result,jdbcType=LONGVARCHAR} 138 | where id = #{id,jdbcType=INTEGER} 139 | 140 | 141 | 145 | update result 146 | set httpid = #{httpid,jdbcType=INTEGER}, 147 | creatertime = #{creatertime,jdbcType=TIMESTAMP}, 148 | updatetime = #{updatetime,jdbcType=TIME} 149 | where id = #{id,jdbcType=INTEGER} 150 | 151 | -------------------------------------------------------------------------------- /src/main/resources/mapping/RuleMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 37 | id, name, desc, result, result_field, state, created_at, updated_at, operator, inner_description, 38 | outer_description, remark 39 | 40 | 41 | 45 | cond, cond_content, fields 46 | 47 | 59 | 60 | 64 | delete from rule 65 | where id = #{id,jdbcType=INTEGER} 66 | 67 | 68 | 72 | insert into rule (id, name, desc, 73 | result, result_field, state, 74 | created_at, updated_at, operator, 75 | inner_description, outer_description, remark, 76 | cond, cond_content, fields 77 | ) 78 | values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{desc,jdbcType=VARCHAR}, 79 | #{result,jdbcType=VARCHAR}, #{resultField,jdbcType=VARCHAR}, #{state,jdbcType=INTEGER}, 80 | #{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP}, #{operator,jdbcType=VARCHAR}, 81 | #{innerDescription,jdbcType=VARCHAR}, #{outerDescription,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, 82 | #{cond,jdbcType=LONGVARCHAR}, #{condContent,jdbcType=LONGVARCHAR}, #{fields,jdbcType=LONGVARCHAR} 83 | ) 84 | 85 | 86 | 90 | insert into rule 91 | 92 | 93 | id, 94 | 95 | 96 | name, 97 | 98 | 99 | desc, 100 | 101 | 102 | result, 103 | 104 | 105 | result_field, 106 | 107 | 108 | state, 109 | 110 | 111 | created_at, 112 | 113 | 114 | updated_at, 115 | 116 | 117 | operator, 118 | 119 | 120 | inner_description, 121 | 122 | 123 | outer_description, 124 | 125 | 126 | remark, 127 | 128 | 129 | cond, 130 | 131 | 132 | cond_content, 133 | 134 | 135 | fields, 136 | 137 | 138 | 139 | 140 | #{id,jdbcType=INTEGER}, 141 | 142 | 143 | #{name,jdbcType=VARCHAR}, 144 | 145 | 146 | #{desc,jdbcType=VARCHAR}, 147 | 148 | 149 | #{result,jdbcType=VARCHAR}, 150 | 151 | 152 | #{resultField,jdbcType=VARCHAR}, 153 | 154 | 155 | #{state,jdbcType=INTEGER}, 156 | 157 | 158 | #{createdAt,jdbcType=TIMESTAMP}, 159 | 160 | 161 | #{updatedAt,jdbcType=TIMESTAMP}, 162 | 163 | 164 | #{operator,jdbcType=VARCHAR}, 165 | 166 | 167 | #{innerDescription,jdbcType=VARCHAR}, 168 | 169 | 170 | #{outerDescription,jdbcType=VARCHAR}, 171 | 172 | 173 | #{remark,jdbcType=VARCHAR}, 174 | 175 | 176 | #{cond,jdbcType=LONGVARCHAR}, 177 | 178 | 179 | #{condContent,jdbcType=LONGVARCHAR}, 180 | 181 | 182 | #{fields,jdbcType=LONGVARCHAR}, 183 | 184 | 185 | 186 | 187 | 191 | update rule 192 | 193 | 194 | name = #{name,jdbcType=VARCHAR}, 195 | 196 | 197 | desc = #{desc,jdbcType=VARCHAR}, 198 | 199 | 200 | result = #{result,jdbcType=VARCHAR}, 201 | 202 | 203 | result_field = #{resultField,jdbcType=VARCHAR}, 204 | 205 | 206 | state = #{state,jdbcType=INTEGER}, 207 | 208 | 209 | created_at = #{createdAt,jdbcType=TIMESTAMP}, 210 | 211 | 212 | updated_at = #{updatedAt,jdbcType=TIMESTAMP}, 213 | 214 | 215 | operator = #{operator,jdbcType=VARCHAR}, 216 | 217 | 218 | inner_description = #{innerDescription,jdbcType=VARCHAR}, 219 | 220 | 221 | outer_description = #{outerDescription,jdbcType=VARCHAR}, 222 | 223 | 224 | remark = #{remark,jdbcType=VARCHAR}, 225 | 226 | 227 | cond = #{cond,jdbcType=LONGVARCHAR}, 228 | 229 | 230 | cond_content = #{condContent,jdbcType=LONGVARCHAR}, 231 | 232 | 233 | fields = #{fields,jdbcType=LONGVARCHAR}, 234 | 235 | 236 | where id = #{id,jdbcType=INTEGER} 237 | 238 | 239 | 243 | update rule 244 | set name = #{name,jdbcType=VARCHAR}, 245 | desc = #{desc,jdbcType=VARCHAR}, 246 | result = #{result,jdbcType=VARCHAR}, 247 | result_field = #{resultField,jdbcType=VARCHAR}, 248 | state = #{state,jdbcType=INTEGER}, 249 | created_at = #{createdAt,jdbcType=TIMESTAMP}, 250 | updated_at = #{updatedAt,jdbcType=TIMESTAMP}, 251 | operator = #{operator,jdbcType=VARCHAR}, 252 | inner_description = #{innerDescription,jdbcType=VARCHAR}, 253 | outer_description = #{outerDescription,jdbcType=VARCHAR}, 254 | remark = #{remark,jdbcType=VARCHAR}, 255 | cond = #{cond,jdbcType=LONGVARCHAR}, 256 | cond_content = #{condContent,jdbcType=LONGVARCHAR}, 257 | fields = #{fields,jdbcType=LONGVARCHAR} 258 | where id = #{id,jdbcType=INTEGER} 259 | 260 | 261 | 265 | update rule 266 | set name = #{name,jdbcType=VARCHAR}, 267 | desc = #{desc,jdbcType=VARCHAR}, 268 | result = #{result,jdbcType=VARCHAR}, 269 | result_field = #{resultField,jdbcType=VARCHAR}, 270 | state = #{state,jdbcType=INTEGER}, 271 | created_at = #{createdAt,jdbcType=TIMESTAMP}, 272 | updated_at = #{updatedAt,jdbcType=TIMESTAMP}, 273 | operator = #{operator,jdbcType=VARCHAR}, 274 | inner_description = #{innerDescription,jdbcType=VARCHAR}, 275 | outer_description = #{outerDescription,jdbcType=VARCHAR}, 276 | remark = #{remark,jdbcType=VARCHAR} 277 | where id = #{id,jdbcType=INTEGER} 278 | 279 | 280 | 286 | -------------------------------------------------------------------------------- /src/main/resources/mapping/UserMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 26 | 27 | 28 | 32 | insert into user (id, name, password, 33 | createtime, email) 34 | values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR}, 35 | #{createtime,jdbcType=TIMESTAMP}, #{email,jdbcType=VARCHAR}) 36 | 37 | 38 | 42 | insert into user 43 | 44 | 45 | id, 46 | 47 | 48 | name, 49 | 50 | 51 | password, 52 | 53 | 54 | createtime, 55 | 56 | 57 | email, 58 | 59 | 60 | 61 | 62 | #{id,jdbcType=INTEGER}, 63 | 64 | 65 | #{name,jdbcType=VARCHAR}, 66 | 67 | 68 | #{password,jdbcType=VARCHAR}, 69 | 70 | 71 | #{createtime,jdbcType=TIMESTAMP}, 72 | 73 | 74 | #{email,jdbcType=VARCHAR}, 75 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /src/main/resources/mybatis_generator.properties: -------------------------------------------------------------------------------- 1 | #数据库配置 2 | #jdbc:mysql://127.0.0.1:3306/test?useUnicode=true&characterEncoding=UTF-8 3 | jdbc_url=jdbc:mysql://192.168.130.10:3306/engine_db2 4 | jdbc_driver=com.mysql.jdbc.Driver 5 | jdbc_username=root 6 | jdbc_password=root 7 | 8 | #执行:右键 Run As ---->Maven build ---->Goals:mybatis-generator:generate 9 | #输出目录 10 | targetProject=src/main/java 11 | #modelPackage,sqlMapperPackage,daoMapperPackage 通常一致 12 | modelPackage=com.tool.plaform.entity 13 | sqlMapperPackage=com.tool.plaform.mapping 14 | daoMapperPackage=com.tool.plaform.dao -------------------------------------------------------------------------------- /src/main/resources/static/css/common.css: -------------------------------------------------------------------------------- 1 | textarea.effect{ 2 | -webkit-box-shadow: 0 2px 1px -1px #777; 3 | -moz-box-shadow: 0 2px 1px -1px #777; 4 | box-shadow: 0 2px 1px -1px #777; 5 | } 6 | 7 | .btn-group-vertical > button{ 8 | margin-bottom:5px; 9 | border-radius:5px !important; 10 | } 11 | 12 | .dropdown-menu li{ 13 | font-size:20px 14 | } 15 | 16 | .dropdown-submenu { 17 | position: relative; 18 | color:#0000FF; 19 | } 20 | 21 | .dropdown-submenu > .dropdown-menu { 22 | top: 0; 23 | left: 100%; 24 | margin-top: -6px; 25 | margin-left: -1px; 26 | -webkit-border-radius: 0 6px 6px 6px; 27 | -moz-border-radius: 0 6px 6px; 28 | border-radius: 0 6px 6px 6px; 29 | } 30 | 31 | .dropdown-submenu:hover > .dropdown-menu { 32 | display: block; 33 | } 34 | 35 | .dropdown-submenu > a:after { 36 | display: block; 37 | content: " "; 38 | float: right; 39 | width: 0; 40 | height: 0; 41 | border-color: transparent; 42 | border-style: solid; 43 | border-width: 5px 0 5px 5px; 44 | border-left-color: #ccc; 45 | margin-top: 5px; 46 | margin-right: -10px; 47 | } 48 | 49 | .dropdown-submenu:hover > a:after { 50 | border-left-color: #fff; 51 | } 52 | 53 | .dropdown-submenu.pull-left { 54 | float: none; 55 | } 56 | 57 | .dropdown-submenu.pull-left > .dropdown-menu { 58 | left: -100%; 59 | margin-left: 10px; 60 | -webkit-border-radius: 6px 0 6px 6px; 61 | -moz-border-radius: 6px 0 6px 6px; 62 | border-radius: 6px 0 6px 6px; 63 | } 64 | 65 | .modal-header { 66 | color:#fff; 67 | padding:9px 15px; 68 | border-bottom:1px solid #eee; 69 | background-color: #696969; 70 | -webkit-border-top-left-radius: 5px; 71 | -webkit-border-top-right-radius: 5px; 72 | -moz-border-radius-topleft: 5px; 73 | -moz-border-radius-topright: 5px; 74 | border-top-left-radius: 5px; 75 | border-top-right-radius: 5px; 76 | } 77 | 78 | .pop-box { 79 | z-index: 9999; 80 | /* border: 2px solid #FFFFFF; */ 81 | margin: 0; 82 | display: none; 83 | position: fixed; 84 | /* background-color: #FFFFFF; */ 85 | } 86 | .mask { 87 | width: 100%; 88 | height: 100%; 89 | position: fixed; 90 | top: 0; 91 | left: 0; 92 | background-color: #FFFFFF; 93 | filter: Alpha(Opacity = 80); 94 | -moz-opacity: 0.8; 95 | opacity: 0.8; 96 | z-index: 9998; 97 | } -------------------------------------------------------------------------------- /src/main/resources/static/css/dataTables.bootstrap.min.css: -------------------------------------------------------------------------------- 1 | table.dataTable{clear:both;margin-top:6px !important;margin-bottom:6px !important;max-width:none !important;border-collapse:separate !important}table.dataTable td,table.dataTable th{-webkit-box-sizing:content-box;box-sizing:content-box}table.dataTable td.dataTables_empty,table.dataTable th.dataTables_empty{text-align:center}table.dataTable.nowrap th,table.dataTable.nowrap td{white-space:nowrap}div.dataTables_wrapper div.dataTables_length label{font-weight:normal;text-align:left;white-space:nowrap}div.dataTables_wrapper div.dataTables_length select{width:75px;display:inline-block}div.dataTables_wrapper div.dataTables_filter{text-align:right}div.dataTables_wrapper div.dataTables_filter label{font-weight:normal;white-space:nowrap;text-align:left}div.dataTables_wrapper div.dataTables_filter input{margin-left:0.5em;display:inline-block;width:auto}div.dataTables_wrapper div.dataTables_info{padding-top:8px;white-space:nowrap}div.dataTables_wrapper div.dataTables_paginate{margin:0;white-space:nowrap;text-align:right}div.dataTables_wrapper div.dataTables_paginate ul.pagination{margin:2px 0;white-space:nowrap}div.dataTables_wrapper div.dataTables_processing{position:absolute;top:50%;left:50%;width:200px;margin-left:-100px;margin-top:-26px;text-align:center;padding:1em 0}table.dataTable thead>tr>th.sorting_asc,table.dataTable thead>tr>th.sorting_desc,table.dataTable thead>tr>th.sorting,table.dataTable thead>tr>td.sorting_asc,table.dataTable thead>tr>td.sorting_desc,table.dataTable thead>tr>td.sorting{padding-right:30px}table.dataTable thead>tr>th:active,table.dataTable thead>tr>td:active{outline:none}table.dataTable thead .sorting,table.dataTable thead .sorting_asc,table.dataTable thead .sorting_desc,table.dataTable thead .sorting_asc_disabled,table.dataTable thead .sorting_desc_disabled{cursor:pointer;position:relative}table.dataTable thead .sorting:after,table.dataTable thead .sorting_asc:after,table.dataTable thead .sorting_desc:after,table.dataTable thead .sorting_asc_disabled:after,table.dataTable thead .sorting_desc_disabled:after{position:absolute;bottom:8px;right:8px;display:block;font-family:'Glyphicons Halflings';opacity:0.5}table.dataTable thead .sorting:after{opacity:0.2;content:"\e150"}table.dataTable thead .sorting_asc:after{content:"\e155"}table.dataTable thead .sorting_desc:after{content:"\e156"}table.dataTable thead .sorting_asc_disabled:after,table.dataTable thead .sorting_desc_disabled:after{color:#eee}div.dataTables_scrollHead table.dataTable{margin-bottom:0 !important}div.dataTables_scrollBody table{border-top:none;margin-top:0 !important;margin-bottom:0 !important}div.dataTables_scrollBody table thead .sorting:after,div.dataTables_scrollBody table thead .sorting_asc:after,div.dataTables_scrollBody table thead .sorting_desc:after{display:none}div.dataTables_scrollBody table tbody tr:first-child th,div.dataTables_scrollBody table tbody tr:first-child td{border-top:none}div.dataTables_scrollFoot table{margin-top:0 !important;border-top:none}@media screen and (max-width: 767px){div.dataTables_wrapper div.dataTables_length,div.dataTables_wrapper div.dataTables_filter,div.dataTables_wrapper div.dataTables_info,div.dataTables_wrapper div.dataTables_paginate{text-align:center}}table.dataTable.table-condensed>thead>tr>th{padding-right:20px}table.dataTable.table-condensed .sorting:after,table.dataTable.table-condensed .sorting_asc:after,table.dataTable.table-condensed .sorting_desc:after{top:6px;right:6px}table.table-bordered.dataTable th,table.table-bordered.dataTable td{border-left-width:0}table.table-bordered.dataTable th:last-child,table.table-bordered.dataTable th:last-child,table.table-bordered.dataTable td:last-child,table.table-bordered.dataTable td:last-child{border-right-width:0}table.table-bordered.dataTable tbody th,table.table-bordered.dataTable tbody td{border-bottom-width:0}div.dataTables_scrollHead table.table-bordered{border-bottom-width:0}div.table-responsive>div.dataTables_wrapper>div.row{margin:0}div.table-responsive>div.dataTables_wrapper>div.row>div[class^="col-"]:first-child{padding-left:0}div.table-responsive>div.dataTables_wrapper>div.row>div[class^="col-"]:last-child{padding-right:0} 2 | -------------------------------------------------------------------------------- /src/main/resources/static/css/mystyle.css: -------------------------------------------------------------------------------- 1 | @charset "utf-8"; 2 | 3 | .head-top { 4 | font-size: 15px; 5 | } 6 | 7 | .data { 8 | margin-top: 30px; 9 | } 10 | 11 | .search { 12 | margin-top: 65px; 13 | } 14 | 15 | .select{ 16 | margin-left: 10px; 17 | margin-top: 75px; 18 | } 19 | 20 | #container{ 21 | width:95%; 22 | } 23 | 24 | body{ 25 | margin-left: 5%; 26 | margin-right: 5%; 27 | } 28 | .experl { 29 | margin-top: 80px; 30 | 31 | } 32 | .search-button{ 33 | 34 | 35 | 36 | } 37 | 38 | .btn-group{ 39 | float: right; 40 | 41 | } 42 | 43 | .input-group{ 44 | margin: 5px auto; 45 | } 46 | 47 | .show-result{ 48 | text-align: center; 49 | } 50 | 51 | .mock_add_button{ 52 | 53 | } -------------------------------------------------------------------------------- /src/main/resources/static/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaox196/TestPlaform/066671fcf13ee95333eefb3d4680d42b28e548a0/src/main/resources/static/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /src/main/resources/static/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaox196/TestPlaform/066671fcf13ee95333eefb3d4680d42b28e548a0/src/main/resources/static/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /src/main/resources/static/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaox196/TestPlaform/066671fcf13ee95333eefb3d4680d42b28e548a0/src/main/resources/static/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /src/main/resources/static/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaox196/TestPlaform/066671fcf13ee95333eefb3d4680d42b28e548a0/src/main/resources/static/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /src/main/resources/static/img/bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaox196/TestPlaform/066671fcf13ee95333eefb3d4680d42b28e548a0/src/main/resources/static/img/bg.jpg -------------------------------------------------------------------------------- /src/main/resources/static/img/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaox196/TestPlaform/066671fcf13ee95333eefb3d4680d42b28e548a0/src/main/resources/static/img/favicon.ico -------------------------------------------------------------------------------- /src/main/resources/static/img/loading.GIF: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaox196/TestPlaform/066671fcf13ee95333eefb3d4680d42b28e548a0/src/main/resources/static/img/loading.GIF -------------------------------------------------------------------------------- /src/main/resources/static/img/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaox196/TestPlaform/066671fcf13ee95333eefb3d4680d42b28e548a0/src/main/resources/static/img/logo.png -------------------------------------------------------------------------------- /src/main/resources/static/imges/top.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaox196/TestPlaform/066671fcf13ee95333eefb3d4680d42b28e548a0/src/main/resources/static/imges/top.jpg -------------------------------------------------------------------------------- /src/main/resources/static/js/npm.js: -------------------------------------------------------------------------------- 1 | // This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment. 2 | require('../../js/transition.js') 3 | require('../../js/alert.js') 4 | require('../../js/button.js') 5 | require('../../js/carousel.js') 6 | require('../../js/collapse.js') 7 | require('../../js/dropdown.js') 8 | require('../../js/modal.js') 9 | require('../../js/tooltip.js') 10 | require('../../js/popover.js') 11 | require('../../js/scrollspy.js') 12 | require('../../js/tab.js') 13 | require('../../js/affix.js') -------------------------------------------------------------------------------- /src/main/resources/templates/1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Title 6 | 7 | 8 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/main/resources/templates/addmock.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 测试平台 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 31 |
32 |
33 |

添加mockserver端口

34 |
35 |
36 | 37 |
38 | 39 |
40 |
41 |
42 | 43 |
44 | 45 |
46 |
47 |
48 | 49 |
50 | 51 |
52 |
53 |
54 | 55 |
56 | 57 |
58 |
59 | 60 |
61 | 62 |
63 | 66 |
67 |
68 | 69 |
70 | 71 |
72 | 74 |
75 |
76 | 77 |
78 | 79 |
80 | 81 |
82 |
83 | 84 |
85 | 86 |
87 | 88 |
89 |
90 |
91 | 92 |
93 | 94 |
95 |
96 | 97 |
98 | 99 |
100 | 101 |
102 |
103 |
104 | 105 |
106 | 107 |
108 |
109 |
110 | 111 |
112 | 113 |
114 |
115 | 116 |
117 |
118 |
119 |
120 | 121 | 122 | 123 | 124 | 125 | 126 | -------------------------------------------------------------------------------- /src/main/resources/templates/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 测试平台 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 31 | 32 | 33 | 45 | 46 |
47 | 48 | 49 | 50 | 53 | 56 | 59 | 62 | 65 | 66 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 |
51 | 编号 52 | 54 | 厂家 55 | 57 | 型号 58 | 60 | UUID 61 | 63 | 保管人 64 | 67 | 备注 68 |
1mobileiphone 7TYKHJKHJKxiaoming未借出
84 |
85 | 86 |
87 | 88 | 89 | 90 | 91 | -------------------------------------------------------------------------------- /src/main/resources/templates/login.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 登录 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 22 | 23 | 24 | 25 | 26 | 27 |
28 |
29 | 30 | 31 |
33 | 34 |
35 |
36 |
37 |
38 | 39 | 40 | 42 | 43 | 44 |

45 | Test Platform V1.0 46 |

47 | 48 | 49 |
50 |

Take full reuse of Java's existing powerful libraries: Requests, unittest and Locust. And 51 | achieve the goal of API automation test, production environment monitoring, and API 52 | performance test, with a concise and elegant manner. 53 | 54 |

55 |
56 | 57 | 58 |
59 | Download 60 |
61 | 62 | 63 |
64 | 65 | 66 |
67 | 68 | 86 | 87 |
88 |
89 |
90 |
91 |
92 | 93 | 94 | 95 | 96 | -------------------------------------------------------------------------------- /src/main/resources/templates/mock.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 测试平台 8 | 9 | 10 | 11 | 12 | 13 | 18 | 19 | 20 | 37 | 38 | 39 |
40 | 41 |
42 | 54 | 61 |
62 |
63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 |
项目名接口名接口描述接口路径请求方式类型更新时间是否校验状态创建人操作
mockmocktesttest 87 | 88 | gettext2017-12-29 09:46:36在用alunadd
99 |
100 |
101 | 102 | 103 | 104 | 105 | 106 | 107 | -------------------------------------------------------------------------------- /src/main/resources/templates/register.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 注册 7 | 8 | 9 | 10 | 11 | 12 | 13 | 18 | 19 | 20 | 21 | 22 |
23 |
24 | 25 |
27 | 28 |
29 |
30 |
31 |
32 | 33 | 34 | 36 | 37 | 38 |

39 | Test Platform V1.0 40 |

41 | 42 | 43 |
44 |

Take full reuse of java's existing powerful libraries: Requests, unittest and Locust. And 45 | achieve the goal of API automation test, production environment monitoring, and API 46 | performance test, with a concise and elegant manner. 47 | 48 |

49 |
50 | 51 | 52 |
53 | Download 54 |
55 | 56 | 57 |
58 | 59 | 60 |
61 | 62 | 89 | 90 |
91 |
92 |
93 |
94 |
95 | 96 | 97 | 98 | 184 | 185 | 186 | -------------------------------------------------------------------------------- /src/main/resources/templates/test.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 测试平台 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 31 | 32 | 33 |
34 |
35 | 36 |
37 | 38 | 42 | 49 | 50 | 51 |
52 | 53 |
54 |
55 |
56 | 57 |
58 |
59 |
60 | 61 | 62 | 63 | 64 | 65 |
66 |
67 | 68 |
69 | 70 | 71 | 72 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /src/main/resources/templates/top.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaox196/TestPlaform/066671fcf13ee95333eefb3d4680d42b28e548a0/src/main/resources/templates/top.jpg -------------------------------------------------------------------------------- /src/test/java/com/tool/plaform/PlaformApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.tool.plaform; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.boot.test.context.SpringBootTest; 6 | import org.springframework.test.context.junit4.SpringRunner; 7 | 8 | @RunWith(SpringRunner.class) 9 | @SpringBootTest 10 | public class PlaformApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/test/java/com/tool/plaform/Test.java: -------------------------------------------------------------------------------- 1 | package com.tool.plaform; 2 | 3 | import java.util.regex.Matcher; 4 | import java.util.regex.Pattern; 5 | 6 | public class Test { 7 | public static void main(String[] args) { 8 | Pattern p = Pattern.compile("\\$\\{(.*?)\\}"); 9 | Pattern funPattern = Pattern 10 | .compile("__(\\w*?)\\((([\\w\\\\\\/:\\.\\$]*,?)*)\\)"); 11 | Matcher m=p.matcher("${_csv(bbb,11)}"); 12 | if(m.find()){ 13 | System.out.println(m.group(1)); 14 | } 15 | Matcher m2=funPattern.matcher("__xxx(ooo)}"); 16 | if(m2.find()){ 17 | System.out.println(m2.group(1)); 18 | System.out.println(m2.group(2)); 19 | } 20 | } 21 | } 22 | --------------------------------------------------------------------------------