张延森 před 4 roky
revize
52663b1860
100 změnil soubory, kde provedl 6577 přidání a 0 odebrání
  1. 33
    0
      .gitignore
  2. 310
    0
      mvnw
  3. 182
    0
      mvnw.cmd
  4. 213
    0
      pom.xml
  5. 16
    0
      src/main/java/com/yunzhi/demo/SpringApplication.java
  6. 4
    0
      src/main/java/com/yunzhi/demo/common/BaseController.java
  7. 7
    0
      src/main/java/com/yunzhi/demo/common/Constants.java
  8. 46
    0
      src/main/java/com/yunzhi/demo/common/CurrentContext.java
  9. 17
    0
      src/main/java/com/yunzhi/demo/common/EncryptUtils.java
  10. 26
    0
      src/main/java/com/yunzhi/demo/common/ExcelUtils.java
  11. 97
    0
      src/main/java/com/yunzhi/demo/common/JWTUtils.java
  12. 132
    0
      src/main/java/com/yunzhi/demo/common/OSSUtils.java
  13. 67
    0
      src/main/java/com/yunzhi/demo/common/ResponseBean.java
  14. 145
    0
      src/main/java/com/yunzhi/demo/common/SMSCaptcha.java
  15. 71
    0
      src/main/java/com/yunzhi/demo/common/SMSUtils.java
  16. 120
    0
      src/main/java/com/yunzhi/demo/common/StringUtils.java
  17. 34
    0
      src/main/java/com/yunzhi/demo/common/WxUtils.java
  18. 44
    0
      src/main/java/com/yunzhi/demo/config/AliyunConfig.java
  19. 35
    0
      src/main/java/com/yunzhi/demo/config/BaseConfig.java
  20. 34
    0
      src/main/java/com/yunzhi/demo/config/InterceptorConfig.java
  21. 14
    0
      src/main/java/com/yunzhi/demo/config/MybatisPlusConfig.java
  22. 24
    0
      src/main/java/com/yunzhi/demo/config/SwagggerConfig.java
  23. 24
    0
      src/main/java/com/yunzhi/demo/config/WeixinConfig.java
  24. 71
    0
      src/main/java/com/yunzhi/demo/controller/CommController.java
  25. 82
    0
      src/main/java/com/yunzhi/demo/controller/LoginController.java
  26. 119
    0
      src/main/java/com/yunzhi/demo/controller/SysBannerController.java
  27. 119
    0
      src/main/java/com/yunzhi/demo/controller/SysConfigController.java
  28. 119
    0
      src/main/java/com/yunzhi/demo/controller/SysLoginController.java
  29. 119
    0
      src/main/java/com/yunzhi/demo/controller/SysMenuController.java
  30. 119
    0
      src/main/java/com/yunzhi/demo/controller/SysRoleController.java
  31. 119
    0
      src/main/java/com/yunzhi/demo/controller/SysRoleMenuController.java
  32. 155
    0
      src/main/java/com/yunzhi/demo/controller/SysUserController.java
  33. 119
    0
      src/main/java/com/yunzhi/demo/controller/SysUserRoleController.java
  34. 119
    0
      src/main/java/com/yunzhi/demo/controller/TaMedicalLogController.java
  35. 119
    0
      src/main/java/com/yunzhi/demo/controller/TaPersonController.java
  36. 119
    0
      src/main/java/com/yunzhi/demo/controller/TaPersonDataController.java
  37. 119
    0
      src/main/java/com/yunzhi/demo/controller/TaPointsLogController.java
  38. 144
    0
      src/main/java/com/yunzhi/demo/controller/TaPostController.java
  39. 119
    0
      src/main/java/com/yunzhi/demo/controller/TaPostDataController.java
  40. 119
    0
      src/main/java/com/yunzhi/demo/controller/TaPostSaveController.java
  41. 119
    0
      src/main/java/com/yunzhi/demo/controller/TaPostTestController.java
  42. 119
    0
      src/main/java/com/yunzhi/demo/controller/TaReadLogController.java
  43. 119
    0
      src/main/java/com/yunzhi/demo/controller/TaTestLogController.java
  44. 119
    0
      src/main/java/com/yunzhi/demo/controller/TaTopicController.java
  45. 119
    0
      src/main/java/com/yunzhi/demo/controller/TdDepartmentController.java
  46. 119
    0
      src/main/java/com/yunzhi/demo/controller/TdHospitalController.java
  47. 122
    0
      src/main/java/com/yunzhi/demo/controller/TdPostTypeController.java
  48. 119
    0
      src/main/java/com/yunzhi/demo/controller/TdSchoolController.java
  49. 119
    0
      src/main/java/com/yunzhi/demo/controller/TdSpecialtyController.java
  50. 58
    0
      src/main/java/com/yunzhi/demo/entity/SysBanner.java
  51. 55
    0
      src/main/java/com/yunzhi/demo/entity/SysConfig.java
  52. 52
    0
      src/main/java/com/yunzhi/demo/entity/SysLogin.java
  53. 55
    0
      src/main/java/com/yunzhi/demo/entity/SysMenu.java
  54. 52
    0
      src/main/java/com/yunzhi/demo/entity/SysRole.java
  55. 36
    0
      src/main/java/com/yunzhi/demo/entity/SysRoleMenu.java
  56. 52
    0
      src/main/java/com/yunzhi/demo/entity/SysUser.java
  57. 36
    0
      src/main/java/com/yunzhi/demo/entity/SysUserRole.java
  58. 52
    0
      src/main/java/com/yunzhi/demo/entity/TaMedicalLog.java
  59. 70
    0
      src/main/java/com/yunzhi/demo/entity/TaPerson.java
  60. 45
    0
      src/main/java/com/yunzhi/demo/entity/TaPersonData.java
  61. 61
    0
      src/main/java/com/yunzhi/demo/entity/TaPointsLog.java
  62. 88
    0
      src/main/java/com/yunzhi/demo/entity/TaPost.java
  63. 42
    0
      src/main/java/com/yunzhi/demo/entity/TaPostData.java
  64. 49
    0
      src/main/java/com/yunzhi/demo/entity/TaPostSave.java
  65. 67
    0
      src/main/java/com/yunzhi/demo/entity/TaPostTest.java
  66. 55
    0
      src/main/java/com/yunzhi/demo/entity/TaReadLog.java
  67. 55
    0
      src/main/java/com/yunzhi/demo/entity/TaTestLog.java
  68. 51
    0
      src/main/java/com/yunzhi/demo/entity/TaTopic.java
  69. 52
    0
      src/main/java/com/yunzhi/demo/entity/TdDepartment.java
  70. 49
    0
      src/main/java/com/yunzhi/demo/entity/TdHospital.java
  71. 55
    0
      src/main/java/com/yunzhi/demo/entity/TdPostType.java
  72. 55
    0
      src/main/java/com/yunzhi/demo/entity/TdSchool.java
  73. 52
    0
      src/main/java/com/yunzhi/demo/entity/TdSpecialty.java
  74. 19
    0
      src/main/java/com/yunzhi/demo/exception/GlobalExceptionHandler.java
  75. 61
    0
      src/main/java/com/yunzhi/demo/interceptor/PermissionInterceptor.java
  76. 18
    0
      src/main/java/com/yunzhi/demo/mapper/SysBannerMapper.java
  77. 18
    0
      src/main/java/com/yunzhi/demo/mapper/SysConfigMapper.java
  78. 18
    0
      src/main/java/com/yunzhi/demo/mapper/SysLoginMapper.java
  79. 21
    0
      src/main/java/com/yunzhi/demo/mapper/SysMenuMapper.java
  80. 18
    0
      src/main/java/com/yunzhi/demo/mapper/SysRoleMapper.java
  81. 18
    0
      src/main/java/com/yunzhi/demo/mapper/SysRoleMenuMapper.java
  82. 18
    0
      src/main/java/com/yunzhi/demo/mapper/SysUserMapper.java
  83. 18
    0
      src/main/java/com/yunzhi/demo/mapper/SysUserRoleMapper.java
  84. 18
    0
      src/main/java/com/yunzhi/demo/mapper/TaMedicalLogMapper.java
  85. 18
    0
      src/main/java/com/yunzhi/demo/mapper/TaPersonDataMapper.java
  86. 18
    0
      src/main/java/com/yunzhi/demo/mapper/TaPersonMapper.java
  87. 18
    0
      src/main/java/com/yunzhi/demo/mapper/TaPointsLogMapper.java
  88. 18
    0
      src/main/java/com/yunzhi/demo/mapper/TaPostDataMapper.java
  89. 18
    0
      src/main/java/com/yunzhi/demo/mapper/TaPostMapper.java
  90. 18
    0
      src/main/java/com/yunzhi/demo/mapper/TaPostSaveMapper.java
  91. 18
    0
      src/main/java/com/yunzhi/demo/mapper/TaPostTestMapper.java
  92. 18
    0
      src/main/java/com/yunzhi/demo/mapper/TaReadLogMapper.java
  93. 18
    0
      src/main/java/com/yunzhi/demo/mapper/TaTestLogMapper.java
  94. 18
    0
      src/main/java/com/yunzhi/demo/mapper/TaTopicMapper.java
  95. 18
    0
      src/main/java/com/yunzhi/demo/mapper/TdDepartmentMapper.java
  96. 18
    0
      src/main/java/com/yunzhi/demo/mapper/TdHospitalMapper.java
  97. 18
    0
      src/main/java/com/yunzhi/demo/mapper/TdPostTypeMapper.java
  98. 18
    0
      src/main/java/com/yunzhi/demo/mapper/TdSchoolMapper.java
  99. 18
    0
      src/main/java/com/yunzhi/demo/mapper/TdSpecialtyMapper.java
  100. 0
    0
      src/main/java/com/yunzhi/demo/service/ISysBannerService.java

+ 33
- 0
.gitignore Zobrazit soubor

@@ -0,0 +1,33 @@
1
+HELP.md
2
+target/
3
+!.mvn/wrapper/maven-wrapper.jar
4
+!**/src/main/**/target/
5
+!**/src/test/**/target/
6
+
7
+### STS ###
8
+.apt_generated
9
+.classpath
10
+.factorypath
11
+.project
12
+.settings
13
+.springBeans
14
+.sts4-cache
15
+
16
+### IntelliJ IDEA ###
17
+.idea
18
+*.iws
19
+*.iml
20
+*.ipr
21
+
22
+### NetBeans ###
23
+/nbproject/private/
24
+/nbbuild/
25
+/dist/
26
+/nbdist/
27
+/.nb-gradle/
28
+build/
29
+!**/src/main/**/build/
30
+!**/src/test/**/build/
31
+
32
+### VS Code ###
33
+.vscode/

+ 310
- 0
mvnw Zobrazit soubor

@@ -0,0 +1,310 @@
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
+#    https://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
+# Maven 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 Mingw, 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
+fi
118
+
119
+if [ -z "$JAVA_HOME" ]; then
120
+  javaExecutable="`which javac`"
121
+  if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
122
+    # readlink(1) is not available as standard on Solaris 10.
123
+    readLink=`which readlink`
124
+    if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
125
+      if $darwin ; then
126
+        javaHome="`dirname \"$javaExecutable\"`"
127
+        javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
128
+      else
129
+        javaExecutable="`readlink -f \"$javaExecutable\"`"
130
+      fi
131
+      javaHome="`dirname \"$javaExecutable\"`"
132
+      javaHome=`expr "$javaHome" : '\(.*\)/bin'`
133
+      JAVA_HOME="$javaHome"
134
+      export JAVA_HOME
135
+    fi
136
+  fi
137
+fi
138
+
139
+if [ -z "$JAVACMD" ] ; then
140
+  if [ -n "$JAVA_HOME"  ] ; then
141
+    if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
142
+      # IBM's JDK on AIX uses strange locations for the executables
143
+      JAVACMD="$JAVA_HOME/jre/sh/java"
144
+    else
145
+      JAVACMD="$JAVA_HOME/bin/java"
146
+    fi
147
+  else
148
+    JAVACMD="`which java`"
149
+  fi
150
+fi
151
+
152
+if [ ! -x "$JAVACMD" ] ; then
153
+  echo "Error: JAVA_HOME is not defined correctly." >&2
154
+  echo "  We cannot execute $JAVACMD" >&2
155
+  exit 1
156
+fi
157
+
158
+if [ -z "$JAVA_HOME" ] ; then
159
+  echo "Warning: JAVA_HOME environment variable is not set."
160
+fi
161
+
162
+CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
163
+
164
+# traverses directory structure from process work directory to filesystem root
165
+# first directory with .mvn subdirectory is considered project base directory
166
+find_maven_basedir() {
167
+
168
+  if [ -z "$1" ]
169
+  then
170
+    echo "Path not specified to find_maven_basedir"
171
+    return 1
172
+  fi
173
+
174
+  basedir="$1"
175
+  wdir="$1"
176
+  while [ "$wdir" != '/' ] ; do
177
+    if [ -d "$wdir"/.mvn ] ; then
178
+      basedir=$wdir
179
+      break
180
+    fi
181
+    # workaround for JBEAP-8937 (on Solaris 10/Sparc)
182
+    if [ -d "${wdir}" ]; then
183
+      wdir=`cd "$wdir/.."; pwd`
184
+    fi
185
+    # end of workaround
186
+  done
187
+  echo "${basedir}"
188
+}
189
+
190
+# concatenates all lines of a file
191
+concat_lines() {
192
+  if [ -f "$1" ]; then
193
+    echo "$(tr -s '\n' ' ' < "$1")"
194
+  fi
195
+}
196
+
197
+BASE_DIR=`find_maven_basedir "$(pwd)"`
198
+if [ -z "$BASE_DIR" ]; then
199
+  exit 1;
200
+fi
201
+
202
+##########################################################################################
203
+# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
204
+# This allows using the maven wrapper in projects that prohibit checking in binary data.
205
+##########################################################################################
206
+if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then
207
+    if [ "$MVNW_VERBOSE" = true ]; then
208
+      echo "Found .mvn/wrapper/maven-wrapper.jar"
209
+    fi
210
+else
211
+    if [ "$MVNW_VERBOSE" = true ]; then
212
+      echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
213
+    fi
214
+    if [ -n "$MVNW_REPOURL" ]; then
215
+      jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
216
+    else
217
+      jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
218
+    fi
219
+    while IFS="=" read key value; do
220
+      case "$key" in (wrapperUrl) jarUrl="$value"; break ;;
221
+      esac
222
+    done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties"
223
+    if [ "$MVNW_VERBOSE" = true ]; then
224
+      echo "Downloading from: $jarUrl"
225
+    fi
226
+    wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar"
227
+    if $cygwin; then
228
+      wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"`
229
+    fi
230
+
231
+    if command -v wget > /dev/null; then
232
+        if [ "$MVNW_VERBOSE" = true ]; then
233
+          echo "Found wget ... using wget"
234
+        fi
235
+        if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
236
+            wget "$jarUrl" -O "$wrapperJarPath"
237
+        else
238
+            wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath"
239
+        fi
240
+    elif command -v curl > /dev/null; then
241
+        if [ "$MVNW_VERBOSE" = true ]; then
242
+          echo "Found curl ... using curl"
243
+        fi
244
+        if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
245
+            curl -o "$wrapperJarPath" "$jarUrl" -f
246
+        else
247
+            curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f
248
+        fi
249
+
250
+    else
251
+        if [ "$MVNW_VERBOSE" = true ]; then
252
+          echo "Falling back to using Java to download"
253
+        fi
254
+        javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java"
255
+        # For Cygwin, switch paths to Windows format before running javac
256
+        if $cygwin; then
257
+          javaClass=`cygpath --path --windows "$javaClass"`
258
+        fi
259
+        if [ -e "$javaClass" ]; then
260
+            if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
261
+                if [ "$MVNW_VERBOSE" = true ]; then
262
+                  echo " - Compiling MavenWrapperDownloader.java ..."
263
+                fi
264
+                # Compiling the Java class
265
+                ("$JAVA_HOME/bin/javac" "$javaClass")
266
+            fi
267
+            if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
268
+                # Running the downloader
269
+                if [ "$MVNW_VERBOSE" = true ]; then
270
+                  echo " - Running MavenWrapperDownloader.java ..."
271
+                fi
272
+                ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR")
273
+            fi
274
+        fi
275
+    fi
276
+fi
277
+##########################################################################################
278
+# End of extension
279
+##########################################################################################
280
+
281
+export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
282
+if [ "$MVNW_VERBOSE" = true ]; then
283
+  echo $MAVEN_PROJECTBASEDIR
284
+fi
285
+MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
286
+
287
+# For Cygwin, switch paths to Windows format before running java
288
+if $cygwin; then
289
+  [ -n "$M2_HOME" ] &&
290
+    M2_HOME=`cygpath --path --windows "$M2_HOME"`
291
+  [ -n "$JAVA_HOME" ] &&
292
+    JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
293
+  [ -n "$CLASSPATH" ] &&
294
+    CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
295
+  [ -n "$MAVEN_PROJECTBASEDIR" ] &&
296
+    MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
297
+fi
298
+
299
+# Provide a "standardized" way to retrieve the CLI args that will
300
+# work with both Windows and non-Windows executions.
301
+MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@"
302
+export MAVEN_CMD_LINE_ARGS
303
+
304
+WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
305
+
306
+exec "$JAVACMD" \
307
+  $MAVEN_OPTS \
308
+  -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
309
+  "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
310
+  ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"

+ 182
- 0
mvnw.cmd Zobrazit soubor

@@ -0,0 +1,182 @@
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    https://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 Maven 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 keystroke 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 set title of command window
39
+title %0
40
+@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on'
41
+@if "%MAVEN_BATCH_ECHO%" == "on"  echo %MAVEN_BATCH_ECHO%
42
+
43
+@REM set %HOME% to equivalent of $HOME
44
+if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
45
+
46
+@REM Execute a user defined script before this one
47
+if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
48
+@REM check for pre script, once with legacy .bat ending and once with .cmd ending
49
+if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
50
+if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
51
+:skipRcPre
52
+
53
+@setlocal
54
+
55
+set ERROR_CODE=0
56
+
57
+@REM To isolate internal variables from possible post scripts, we use another setlocal
58
+@setlocal
59
+
60
+@REM ==== START VALIDATION ====
61
+if not "%JAVA_HOME%" == "" goto OkJHome
62
+
63
+echo.
64
+echo Error: JAVA_HOME not found in your environment. >&2
65
+echo Please set the JAVA_HOME variable in your environment to match the >&2
66
+echo location of your Java installation. >&2
67
+echo.
68
+goto error
69
+
70
+:OkJHome
71
+if exist "%JAVA_HOME%\bin\java.exe" goto init
72
+
73
+echo.
74
+echo Error: JAVA_HOME is set to an invalid directory. >&2
75
+echo JAVA_HOME = "%JAVA_HOME%" >&2
76
+echo Please set the JAVA_HOME variable in your environment to match the >&2
77
+echo location of your Java installation. >&2
78
+echo.
79
+goto error
80
+
81
+@REM ==== END VALIDATION ====
82
+
83
+:init
84
+
85
+@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
86
+@REM Fallback to current working directory if not found.
87
+
88
+set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
89
+IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
90
+
91
+set EXEC_DIR=%CD%
92
+set WDIR=%EXEC_DIR%
93
+:findBaseDir
94
+IF EXIST "%WDIR%"\.mvn goto baseDirFound
95
+cd ..
96
+IF "%WDIR%"=="%CD%" goto baseDirNotFound
97
+set WDIR=%CD%
98
+goto findBaseDir
99
+
100
+:baseDirFound
101
+set MAVEN_PROJECTBASEDIR=%WDIR%
102
+cd "%EXEC_DIR%"
103
+goto endDetectBaseDir
104
+
105
+:baseDirNotFound
106
+set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
107
+cd "%EXEC_DIR%"
108
+
109
+:endDetectBaseDir
110
+
111
+IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
112
+
113
+@setlocal EnableExtensions EnableDelayedExpansion
114
+for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
115
+@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
116
+
117
+:endReadAdditionalConfig
118
+
119
+SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
120
+set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
121
+set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
122
+
123
+set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
124
+
125
+FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
126
+    IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B
127
+)
128
+
129
+@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
130
+@REM This allows using the maven wrapper in projects that prohibit checking in binary data.
131
+if exist %WRAPPER_JAR% (
132
+    if "%MVNW_VERBOSE%" == "true" (
133
+        echo Found %WRAPPER_JAR%
134
+    )
135
+) else (
136
+    if not "%MVNW_REPOURL%" == "" (
137
+        SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
138
+    )
139
+    if "%MVNW_VERBOSE%" == "true" (
140
+        echo Couldn't find %WRAPPER_JAR%, downloading it ...
141
+        echo Downloading from: %DOWNLOAD_URL%
142
+    )
143
+
144
+    powershell -Command "&{"^
145
+		"$webclient = new-object System.Net.WebClient;"^
146
+		"if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^
147
+		"$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^
148
+		"}"^
149
+		"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^
150
+		"}"
151
+    if "%MVNW_VERBOSE%" == "true" (
152
+        echo Finished downloading %WRAPPER_JAR%
153
+    )
154
+)
155
+@REM End of extension
156
+
157
+@REM Provide a "standardized" way to retrieve the CLI args that will
158
+@REM work with both Windows and non-Windows executions.
159
+set MAVEN_CMD_LINE_ARGS=%*
160
+
161
+%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
162
+if ERRORLEVEL 1 goto error
163
+goto end
164
+
165
+:error
166
+set ERROR_CODE=1
167
+
168
+:end
169
+@endlocal & set ERROR_CODE=%ERROR_CODE%
170
+
171
+if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
172
+@REM check for post script, once with legacy .bat ending and once with .cmd ending
173
+if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
174
+if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
175
+:skipRcPost
176
+
177
+@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
178
+if "%MAVEN_BATCH_PAUSE%" == "on" pause
179
+
180
+if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
181
+
182
+exit /B %ERROR_CODE%

+ 213
- 0
pom.xml Zobrazit soubor

@@ -0,0 +1,213 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
4
+	<modelVersion>4.0.0</modelVersion>
5
+	<parent>
6
+		<groupId>org.springframework.boot</groupId>
7
+		<artifactId>spring-boot-starter-parent</artifactId>
8
+		<version>2.3.2.RELEASE</version>
9
+		<relativePath/> <!-- lookup parent from repository -->
10
+	</parent>
11
+	<groupId>com.yunzhi</groupId>
12
+	<artifactId>serivce-template</artifactId>
13
+	<version>0.0.1-SNAPSHOT</version>
14
+	<name>demo</name>
15
+	<description>Demo project for Spring Boot</description>
16
+
17
+	<properties>
18
+		<java.version>1.8</java.version>
19
+	</properties>
20
+
21
+	<dependencies>
22
+		<dependency>
23
+			<groupId>org.springframework.boot</groupId>
24
+			<artifactId>spring-boot-starter-web</artifactId>
25
+		</dependency>
26
+
27
+		<dependency>
28
+			<groupId>org.springframework.boot</groupId>
29
+			<artifactId>spring-boot-starter-test</artifactId>
30
+			<scope>test</scope>
31
+			<exclusions>
32
+				<exclusion>
33
+					<groupId>org.junit.vintage</groupId>
34
+					<artifactId>junit-vintage-engine</artifactId>
35
+				</exclusion>
36
+			</exclusions>
37
+		</dependency>
38
+
39
+		<!--shiro start-->
40
+<!--		<dependency>-->
41
+<!--			<groupId>org.apache.shiro</groupId>-->
42
+<!--			<artifactId>shiro-spring-boot-starter</artifactId>-->
43
+<!--			<version>1.7.1</version>-->
44
+<!--		</dependency>-->
45
+		<!--shiro end-->
46
+
47
+		<!--mysql start-->
48
+		<dependency>
49
+			<groupId>mysql</groupId>
50
+			<artifactId>mysql-connector-java</artifactId>
51
+			<scope>runtime</scope>
52
+		</dependency>
53
+		<!--mysql end-->
54
+
55
+		<!--mybatis-plus start-->
56
+		<dependency>
57
+			<groupId>com.baomidou</groupId>
58
+			<artifactId>mybatis-plus-boot-starter</artifactId>
59
+			<version>3.1.1</version>
60
+		</dependency>
61
+		<!--mybatis-plus end-->
62
+
63
+		<!--fastjson start-->
64
+		<dependency>
65
+			<groupId>com.alibaba</groupId>
66
+			<artifactId>fastjson</artifactId>
67
+			<version>1.2.56</version>
68
+		</dependency>
69
+		<!--fastjson end-->
70
+
71
+		<!--jwt start-->
72
+		<dependency>
73
+			<groupId>io.jsonwebtoken</groupId>
74
+			<artifactId>jjwt-api</artifactId>
75
+			<version>0.11.2</version>
76
+		</dependency>
77
+		<dependency>
78
+			<groupId>io.jsonwebtoken</groupId>
79
+			<artifactId>jjwt-impl</artifactId>
80
+			<version>0.11.2</version>
81
+			<scope>runtime</scope>
82
+		</dependency>
83
+		<dependency>
84
+			<groupId>io.jsonwebtoken</groupId>
85
+			<artifactId>jjwt-jackson</artifactId> <!-- or jjwt-gson if Gson is preferred -->
86
+			<version>0.11.2</version>
87
+			<scope>runtime</scope>
88
+		</dependency>
89
+		<!--jwt end-->
90
+
91
+		<!--oss start-->
92
+		<dependency>
93
+			<groupId>com.aliyun.oss</groupId>
94
+			<artifactId>aliyun-sdk-oss</artifactId>
95
+			<version>2.8.3</version>
96
+		</dependency>
97
+		<!--oss end-->
98
+
99
+		<dependency>
100
+			<groupId>com.aliyun</groupId>
101
+			<artifactId>aliyun-java-sdk-core</artifactId>
102
+			<version>[4.4.9,5.0.0)</version>
103
+		</dependency>
104
+
105
+		<!--excel start-->
106
+		<dependency>
107
+			<groupId>com.alibaba</groupId>
108
+			<artifactId>easyexcel</artifactId>
109
+			<version>2.0.4</version>
110
+		</dependency>
111
+		<!--excel end-->
112
+
113
+		<!--weixin-miniapp start-->
114
+		<dependency>
115
+			<groupId>com.github.binarywang</groupId>
116
+			<artifactId>weixin-java-miniapp</artifactId>
117
+			<version>3.8.0</version>
118
+		</dependency>
119
+		<!--weixin-miniapp start-->
120
+
121
+		<!--lombok start-->
122
+		<dependency>
123
+			<groupId>org.projectlombok</groupId>
124
+			<artifactId>lombok</artifactId>
125
+			<optional>true</optional>
126
+		</dependency>
127
+		<!--lombok end-->
128
+
129
+		<!--swagger start-->
130
+		<dependency>
131
+			<groupId>io.springfox</groupId>
132
+			<artifactId>springfox-boot-starter</artifactId>
133
+			<version>3.0.0</version>
134
+		</dependency>
135
+		<!--swagger end-->
136
+	</dependencies>
137
+
138
+	<profiles>
139
+		<profile>
140
+			<id>dev</id>
141
+			<properties>
142
+				<profileActive>dev</profileActive>
143
+			</properties>
144
+			<activation>
145
+				<activeByDefault>true</activeByDefault>
146
+			</activation>
147
+
148
+			<build>
149
+				<plugins>
150
+					<plugin>
151
+						<groupId>org.springframework.boot</groupId>
152
+						<artifactId>spring-boot-maven-plugin</artifactId>
153
+					</plugin>
154
+				</plugins>
155
+				<resources>
156
+					<resource>
157
+						<directory>src/main/resources</directory>
158
+						<filtering>true</filtering>
159
+					</resource>
160
+				</resources>
161
+			</build>
162
+		</profile>
163
+
164
+		<profile>
165
+			<id>prod</id>
166
+			<properties>
167
+				<profileActive>prod</profileActive>
168
+			</properties>
169
+			<activation>
170
+				<activeByDefault>false</activeByDefault>
171
+			</activation>
172
+
173
+			<build>
174
+				<plugins>
175
+					<plugin>
176
+						<groupId>org.springframework.boot</groupId>
177
+						<artifactId>spring-boot-maven-plugin</artifactId>
178
+					</plugin>
179
+
180
+					<!-- 跳过测试 -->
181
+					<plugin>
182
+						<groupId>org.apache.maven.plugins</groupId>
183
+						<artifactId>maven-surefire-plugin</artifactId>
184
+						<configuration>
185
+							<skipTests>true</skipTests>
186
+							<testFailureIgnore>true</testFailureIgnore>
187
+						</configuration>
188
+					</plugin>
189
+				</plugins>
190
+				<resources>
191
+					<resource>
192
+						<directory>src/main/resources</directory>
193
+						<filtering>true</filtering>
194
+						<excludes>
195
+							<exclude>application.yml</exclude>
196
+							<exclude>application-*.yml</exclude>
197
+						</excludes>
198
+					</resource>
199
+					<resource>
200
+						<directory>src/main/resources</directory>
201
+						<filtering>true</filtering>
202
+						<includes>
203
+							<include>application.yml</include>
204
+							<include>application-${profileActive}.yml</include>
205
+						</includes>
206
+						<targetPath>${project.build.directory}/config</targetPath>
207
+					</resource>
208
+				</resources>
209
+			</build>
210
+		</profile>
211
+	</profiles>
212
+
213
+</project>

+ 16
- 0
src/main/java/com/yunzhi/demo/SpringApplication.java Zobrazit soubor

@@ -0,0 +1,16 @@
1
+package com.yunzhi.demo;
2
+
3
+import org.springframework.boot.autoconfigure.SpringBootApplication;
4
+import org.springframework.scheduling.annotation.EnableAsync;
5
+import org.springframework.transaction.annotation.EnableTransactionManagement;
6
+
7
+@EnableAsync
8
+@EnableTransactionManagement
9
+@SpringBootApplication
10
+public class SpringApplication {
11
+
12
+	public static void main(String[] args) {
13
+		org.springframework.boot.SpringApplication.run(SpringApplication.class, args);
14
+	}
15
+
16
+}

+ 4
- 0
src/main/java/com/yunzhi/demo/common/BaseController.java Zobrazit soubor

@@ -0,0 +1,4 @@
1
+package com.yunzhi.demo.common;
2
+
3
+public class BaseController {
4
+}

+ 7
- 0
src/main/java/com/yunzhi/demo/common/Constants.java Zobrazit soubor

@@ -0,0 +1,7 @@
1
+package com.yunzhi.demo.common;
2
+
3
+public class Constants {
4
+    public final static Integer STATUS_DELETED = -1;
5
+    public final static Integer STATUS_READY = 0;
6
+    public final static Integer STATUS_NORMAL = 1;
7
+}

+ 46
- 0
src/main/java/com/yunzhi/demo/common/CurrentContext.java Zobrazit soubor

@@ -0,0 +1,46 @@
1
+package com.yunzhi.demo.common;
2
+
3
+import com.yunzhi.demo.entity.SysUser;
4
+import com.yunzhi.demo.service.ISysUserService;
5
+import com.yunzhi.demo.vo.TokenParam;
6
+
7
+public class CurrentContext {
8
+
9
+    /**
10
+     * TokenParam 相关
11
+     */
12
+    private static final ThreadLocal<TokenParam> tokenParamHolder = new ThreadLocal<>();
13
+
14
+    public static void setTokenParam(TokenParam tokenParam) {
15
+        tokenParamHolder.remove();
16
+        tokenParamHolder.set(tokenParam);
17
+    }
18
+
19
+    public static TokenParam getTokenParam() {
20
+        return tokenParamHolder.get();
21
+    }
22
+
23
+    /**
24
+     * 获取当前请求用户
25
+     * @param iSysUserService
26
+     * @return
27
+     */
28
+    public static SysUser getCurrentUser(ISysUserService iSysUserService) {
29
+        try {
30
+            TokenParam tokenParam = getTokenParam();
31
+            if (null == tokenParam) {
32
+                return null;
33
+            }
34
+
35
+            SysUser sysUser = iSysUserService.getById(tokenParam.getUserId());
36
+            if (null == sysUser || Constants.STATUS_DELETED.equals(sysUser.getStatus())) {
37
+                return null;
38
+            }
39
+
40
+            return sysUser;
41
+        } catch (Exception e) {
42
+            e.printStackTrace();
43
+            return null;
44
+        }
45
+    }
46
+}

+ 17
- 0
src/main/java/com/yunzhi/demo/common/EncryptUtils.java Zobrazit soubor

@@ -0,0 +1,17 @@
1
+package com.yunzhi.demo.common;
2
+
3
+import org.springframework.util.DigestUtils;
4
+
5
+public class EncryptUtils {
6
+
7
+    public static String md5(String str, String ...slats) {
8
+        String slat = "";
9
+        if (null != slats && slats.length > 0) {
10
+            slat = slats[0];
11
+        }
12
+
13
+        String base = str + slat;
14
+        String md5 = DigestUtils.md5DigestAsHex(base.getBytes());
15
+        return md5;
16
+    }
17
+}

+ 26
- 0
src/main/java/com/yunzhi/demo/common/ExcelUtils.java Zobrazit soubor

@@ -0,0 +1,26 @@
1
+package com.yunzhi.demo.common;
2
+
3
+import com.alibaba.excel.EasyExcel;
4
+
5
+import javax.servlet.http.HttpServletResponse;
6
+import java.io.IOException;
7
+import java.util.List;
8
+
9
+public class ExcelUtils {
10
+
11
+    /**
12
+     * 发送 excel 到客户端
13
+     * 暂时只支持单 sheet 页
14
+     * @param response
15
+     * @param data
16
+     * @param fileName
17
+     * @throws IOException
18
+     */
19
+    public static void flush(HttpServletResponse response, Class dataClass, List data, String fileName) throws IOException {
20
+        response.setContentType("application/vnd.ms-excel");
21
+        response.setCharacterEncoding("utf-8");
22
+        response.setHeader("Content-disposition", "attachment;filename="+StringUtils.urlEncode(fileName)+".xlsx");
23
+
24
+        EasyExcel.write(response.getOutputStream(), dataClass).sheet("sheet1").doWrite(data);
25
+    }
26
+}

+ 97
- 0
src/main/java/com/yunzhi/demo/common/JWTUtils.java Zobrazit soubor

@@ -0,0 +1,97 @@
1
+package com.yunzhi.demo.common;
2
+
3
+import io.jsonwebtoken.Claims;
4
+import io.jsonwebtoken.Jws;
5
+import io.jsonwebtoken.Jwts;
6
+import io.jsonwebtoken.security.Keys;
7
+import lombok.extern.slf4j.Slf4j;
8
+
9
+import javax.crypto.SecretKey;
10
+import javax.servlet.http.HttpServletRequest;
11
+import javax.servlet.http.HttpServletResponse;
12
+import java.time.LocalDateTime;
13
+import java.time.ZoneId;
14
+import java.util.Base64;
15
+import java.util.Date;
16
+import java.util.Map;
17
+
18
+/**
19
+ * JWTUtils
20
+ * jwt 辅助类
21
+ * https://github.com/jwtk/jjwt
22
+ */
23
+@Slf4j
24
+public class JWTUtils {
25
+
26
+    // 过期时间 5 分钟
27
+    public static final long EXPIRE_TIME = 5 * 60;
28
+
29
+    // 私钥
30
+    static final SecretKey SECRET_KEY = Keys.hmacShaKeyFor(Base64.getEncoder().encode("Yansen is so handsome. He is a good man. Everyone like him !!!".getBytes()));
31
+
32
+    // 请求头
33
+    public static final String AUTH_HEADER = "X-Authorization-JWT";
34
+
35
+    /**
36
+     * 生成 token, claims 里必须要有 userId
37
+     * @param claims
38
+     * @return
39
+     */
40
+    public static String encode(Map<String, Object> claims) {
41
+        Date[] datePair = getDatePair();
42
+        Date iat = datePair[0];
43
+        Date exp = datePair[1];
44
+
45
+        if (null != claims.get("exp")) {
46
+            exp = (Date) claims.get("exp");
47
+        }
48
+
49
+        return Jwts.builder().setIssuer(claims.get("userId").toString()).setIssuedAt(iat).setExpiration(exp).addClaims(claims).signWith(SECRET_KEY).compact();
50
+    }
51
+
52
+    public static Map<String, Object> decode(String token) throws Exception {
53
+        return parse(token);
54
+    }
55
+
56
+    public static String refresh(String token) {
57
+        try {
58
+            Claims claims = parse(token);
59
+            return encode(claims);
60
+        } catch (Exception e) {
61
+            log.error("解析 JWT Token 失败: {}", e.getMessage());
62
+        }
63
+        return null;
64
+    }
65
+
66
+    public static void refresh(String jws, HttpServletResponse response) {
67
+        if (!StringUtils.isEmpty(jws)) {
68
+            String token =  refresh(jws);
69
+            response.addHeader(AUTH_HEADER, token);
70
+        }
71
+    }
72
+
73
+    public static String getToken(HttpServletRequest request) {
74
+        return request.getHeader(AUTH_HEADER);
75
+    }
76
+
77
+    public static void verify(String token) throws Exception {
78
+        parse(token);
79
+    }
80
+
81
+    private static Date[] getDatePair() {
82
+        LocalDateTime now = LocalDateTime.now();
83
+        Date iat = Date.from(now.atZone(ZoneId.systemDefault()).toInstant());
84
+        Date exp = Date.from(now.plusSeconds(EXPIRE_TIME).atZone(ZoneId.systemDefault()).toInstant());
85
+        return new Date[]{iat, exp};
86
+    }
87
+
88
+    private static Claims parse(String token) throws Exception {
89
+        if (token == null || "".equals(token)) {
90
+            throw new Exception("Token 不能为空");
91
+        }
92
+
93
+        long skew = 5;
94
+        Jws<Claims> claimsJws = Jwts.parserBuilder().setAllowedClockSkewSeconds(skew).setSigningKey(SECRET_KEY).build().parseClaimsJws(token);
95
+        return claimsJws.getBody();
96
+    }
97
+}

+ 132
- 0
src/main/java/com/yunzhi/demo/common/OSSUtils.java Zobrazit soubor

@@ -0,0 +1,132 @@
1
+package com.yunzhi.demo.common;
2
+
3
+import com.aliyun.oss.OSSClient;
4
+import com.aliyuncs.DefaultAcsClient;
5
+import com.aliyuncs.auth.sts.AssumeRoleRequest;
6
+import com.aliyuncs.auth.sts.AssumeRoleResponse;
7
+import com.aliyuncs.exceptions.ClientException;
8
+import com.aliyuncs.http.MethodType;
9
+import com.aliyuncs.profile.DefaultProfile;
10
+import com.aliyuncs.profile.IClientProfile;
11
+import com.yunzhi.demo.config.AliyunConfig;
12
+import lombok.extern.slf4j.Slf4j;
13
+import org.springframework.beans.factory.annotation.Autowired;
14
+import org.springframework.stereotype.Component;
15
+import org.springframework.web.multipart.MultipartFile;
16
+
17
+import java.io.*;
18
+import java.time.LocalDateTime;
19
+import java.time.format.DateTimeFormatter;
20
+import java.util.HashMap;
21
+import java.util.Map;
22
+
23
+@Slf4j
24
+@Component
25
+public class OSSUtils {
26
+
27
+    private final static String STS_ENDPOINT = "sts.aliyuncs.com";
28
+
29
+    @Autowired
30
+    AliyunConfig aliyunConfig;
31
+
32
+    private String getMonth() {
33
+        return DateTimeFormatter.ofPattern("yyyyMM").format(LocalDateTime.now());
34
+    }
35
+
36
+    private String getUploadPath(String[] toDirs) {
37
+        String path = toDirs.length > 0 ? toDirs[0] : "/";
38
+        if (!path.endsWith("/")) {
39
+            path += "/";
40
+        }
41
+
42
+        return path + getMonth() + "/";
43
+    }
44
+
45
+    /**
46
+     * 上传文件
47
+     * @param mf 上传的文件
48
+     * @param toDirs 上传到的目录
49
+     * @return
50
+     */
51
+    public String putObject(MultipartFile mf, String ... toDirs) throws IOException {
52
+        String fName = formatFileName(mf.getOriginalFilename());
53
+        String preFix = String.valueOf(System.currentTimeMillis());
54
+        String toDir = getUploadPath(toDirs);
55
+        String nwFName = toDir + preFix + "-" + fName;
56
+        nwFName = StringUtils.trim(nwFName,"/");
57
+
58
+        return putFile(nwFName, new ByteArrayInputStream(mf.getBytes()));
59
+    }
60
+
61
+    public String putObject(File f, String ... toDirs) throws FileNotFoundException {
62
+        String fName = formatFileName(f.getName());
63
+        String preFix = String.valueOf(System.currentTimeMillis());
64
+        String toDir = getUploadPath(toDirs);
65
+        String nwFName = toDir + preFix + "-" + fName;
66
+        nwFName = StringUtils.trim(nwFName,"/");
67
+
68
+        InputStream inputStream = new FileInputStream(f);
69
+        return putFile(nwFName, inputStream);
70
+    }
71
+
72
+    private String formatFileName(String fName) {
73
+        return StringUtils.ifNull(fName, StringUtils.random(16) + ".png");
74
+    }
75
+
76
+    private String putFile(String fname, InputStream input) {
77
+        OSSClient ossClient = new OSSClient(aliyunConfig.getOss().getEndpoint(), aliyunConfig.getAccessKeyId(), aliyunConfig.getAccessKeySecret());
78
+        ossClient.putObject(aliyunConfig.getOss().getBucketName(), fname, input);
79
+        ossClient.shutdown();
80
+
81
+        // String url = ossClient.generatePresignedUrl(AliOSSUtils.oss.getBucketName(), fname, expiration).toString();
82
+
83
+        String preURL = aliyunConfig.getOss().getBucketURL();
84
+        if (!preURL.endsWith("/")) {
85
+            preURL += "/";
86
+        }
87
+
88
+        return preURL + fname.replaceAll("\\ ", "%20");
89
+    }
90
+
91
+    /**
92
+     * 获取上传凭证
93
+     * @return
94
+     * @throws Exception
95
+     */
96
+    public Map<String, Object> getSTSAKToken() throws Exception {
97
+        AliyunConfig.Oss oss = aliyunConfig.getOss();
98
+
99
+        try {
100
+            // 添加endpoint(直接使用STS endpoint,无需添加region ID)
101
+            DefaultProfile.addEndpoint("", "Sts", STS_ENDPOINT);
102
+            // 构造default profile(参数留空,无需添加region ID)
103
+            IClientProfile profile = DefaultProfile.getProfile("", oss.getAccessKeyId(), oss.getAccessKeySecret());
104
+
105
+            // 用profile构造client
106
+            DefaultAcsClient client = new DefaultAcsClient(profile);
107
+            final AssumeRoleRequest request = new AssumeRoleRequest();
108
+            request.setSysMethod(MethodType.POST);
109
+            request.setRoleArn(oss.getArn());
110
+            request.setRoleSessionName(oss.getRoleSessionName());
111
+            request.setPolicy(null); // 若policy为空,则用户将获得该角色下所有权限
112
+            request.setDurationSeconds(1000L); // 设置凭证有效时间
113
+            final AssumeRoleResponse response = client.getAcsResponse(request);
114
+
115
+            AssumeRoleResponse.Credentials credentials = response.getCredentials();
116
+
117
+            Map<String, Object> res = new HashMap<>();
118
+            res.put("stsToken", credentials.getSecurityToken());
119
+            res.put("accessKeySecret", credentials.getAccessKeySecret());
120
+            res.put("accessKeyId", credentials.getAccessKeyId());
121
+            res.put("expiration", credentials.getExpiration());
122
+
123
+            return res;
124
+        } catch (ClientException e) {
125
+            e.printStackTrace();
126
+            log.error("Error code: " + e.getErrCode());
127
+            log.error("Error message: " + e.getErrMsg());
128
+            log.error("RequestId: " + e.getRequestId());
129
+            throw new Exception(e.getMessage());
130
+        }
131
+    }
132
+}

+ 67
- 0
src/main/java/com/yunzhi/demo/common/ResponseBean.java Zobrazit soubor

@@ -0,0 +1,67 @@
1
+package com.yunzhi.demo.common;
2
+
3
+import java.io.Serializable;
4
+
5
+/**
6
+ * 接口统一状态返回BEAN.
7
+ */
8
+public class ResponseBean<T> implements Serializable {
9
+
10
+    private static final long serialVersionUID = 3593827217136880822L;
11
+
12
+    public static final int CODE_SUCCESS = 1000;
13
+    public static final int ERROR_AUTH_FAIL = 1001;
14
+    public static final int ERROR_AUTH_EXPIRED = 1002;
15
+    public static final int ERROR_MISSING_PARAMS = 1003;
16
+    public static final int ERROR_ILLEGAL_PARAMS = 1004;
17
+    public static final int ERROR_UNAVAILABLE = 1005;
18
+
19
+    private int code;
20
+    private String message;
21
+    private T data;
22
+
23
+    public ResponseBean() {
24
+        code = ResponseBean.CODE_SUCCESS;
25
+    }
26
+
27
+    public static <T> ResponseBean success(T data, String ...msgs) {
28
+        ResponseBean responseBean = new ResponseBean();
29
+        responseBean.code = ResponseBean.CODE_SUCCESS;
30
+        responseBean.data = data;
31
+
32
+        if (null != msgs && msgs.length > 0) {
33
+            responseBean.message = msgs[0];
34
+        }
35
+
36
+        return responseBean;
37
+    }
38
+
39
+    public static <T> ResponseBean error(String msg, int code, T ...datas) {
40
+        ResponseBean responseBean = new ResponseBean();
41
+        responseBean.code = code;
42
+        responseBean.message = msg;
43
+
44
+        if (null != datas && datas.length > 0) {
45
+            responseBean.data = datas[0];
46
+        }
47
+
48
+        return responseBean;
49
+    }
50
+
51
+    public int getCode() {
52
+        return code;
53
+    }
54
+
55
+    public String getMessage() {
56
+        return message;
57
+    }
58
+
59
+    public T getData() {
60
+        return data;
61
+    }
62
+    
63
+    @Override
64
+    public String toString() {
65
+        return  "{ code: "+code+", message: "+message+", data: <T> }";
66
+    }
67
+}

+ 145
- 0
src/main/java/com/yunzhi/demo/common/SMSCaptcha.java Zobrazit soubor

@@ -0,0 +1,145 @@
1
+package com.yunzhi.demo.common;
2
+
3
+import com.yunzhi.demo.config.AliyunConfig;
4
+import lombok.Data;
5
+import lombok.experimental.Accessors;
6
+import lombok.extern.slf4j.Slf4j;
7
+import org.springframework.beans.factory.annotation.Autowired;
8
+import org.springframework.scheduling.annotation.EnableScheduling;
9
+import org.springframework.scheduling.annotation.Scheduled;
10
+import org.springframework.stereotype.Component;
11
+
12
+import java.time.LocalDateTime;
13
+import java.util.Hashtable;
14
+import java.util.Random;
15
+
16
+@Slf4j
17
+@Component
18
+@EnableScheduling
19
+public class SMSCaptcha {
20
+    @Autowired
21
+    AliyunConfig aliyunConfig;
22
+
23
+    @Autowired
24
+    SMSUtils smsUtils;
25
+
26
+    // 默认超时时间, 单位秒
27
+    Integer expireSec = 5 * 60;
28
+
29
+    // 缓存电话列表
30
+    Hashtable<String, Phone> allPhones = new Hashtable<>();
31
+
32
+    /**
33
+     * 发送验证码
34
+     * @param tel
35
+     * @param captcha
36
+     * @throws Exception
37
+     */
38
+    public void send(String tel, String captcha) throws Exception {
39
+        if (null == captcha) {
40
+            throw new Exception("没有有效的验证码");
41
+        }
42
+
43
+        Phone phone = new Phone()
44
+                .setNumber(tel)
45
+                .setCaptcha(captcha)
46
+                .setExpire(expireTime());
47
+
48
+
49
+        SMSUtils.Message message = new SMSUtils.Message()
50
+                .setCode(aliyunConfig.getSms().getCaptcha().getCode())
51
+                .setSign(aliyunConfig.getSms().getCaptcha().getSign())
52
+                .setTel(tel)
53
+                .setContent("{ \"code\": \"" + captcha + "\" }");
54
+
55
+        try {
56
+            smsUtils.sendMessage(message);
57
+        } catch (Exception e) {
58
+            // 修改友好点的错误
59
+            throw new Exception("发送验证码失败");
60
+        }
61
+
62
+        log.info(String.format("发送验证码 %s 到手机 %s", captcha, tel));
63
+
64
+        // 发送成功, 写入缓存
65
+        toCache(phone);
66
+    }
67
+
68
+    /**
69
+     * 校验验证码
70
+     * @param tel
71
+     * @param captcha
72
+     * @return
73
+     */
74
+    public boolean validate(String tel, String captcha) {
75
+        Phone phone = fromCache(tel);
76
+        if (null == phone) {
77
+            return false;
78
+        }
79
+
80
+        if (null == captcha || !captcha.equals(phone.getCaptcha())) {
81
+            return false;
82
+        }
83
+
84
+        // 过期则清除缓存
85
+        boolean res = checkExpire(phone);
86
+        if (res) {
87
+            clearCache(phone);
88
+        }
89
+
90
+        return !res;
91
+    }
92
+
93
+    /**
94
+     * 辅助方法: 随机生成验证码
95
+     * @param length
96
+     * @return
97
+     */
98
+    public String randCaptcha(int length) {
99
+        Random random = new Random();
100
+        String res = "";
101
+        for (int i = 0; i < length; i ++) {
102
+            int num = random.nextInt(10);
103
+            res += String.valueOf(num);
104
+        }
105
+        return res;
106
+    }
107
+
108
+    /**
109
+     * 定时任务 每半小时 清除一次不用的手机号
110
+     */
111
+    @Scheduled(fixedRate = 1000 * 60 * 30)
112
+    public void clearUnused() {
113
+        for (Phone phone: allPhones.values()) {
114
+            if (checkExpire(phone)) {
115
+                clearCache(phone);
116
+            }
117
+        }
118
+    }
119
+
120
+    private Phone fromCache(String phone) {
121
+        return allPhones.get(phone);
122
+    }
123
+    private void toCache(Phone phone) {
124
+        allPhones.put(phone.getNumber(), phone);
125
+    }
126
+    private void clearCache(Phone phone) { allPhones.remove(phone); }
127
+
128
+    private LocalDateTime expireTime() {
129
+        return LocalDateTime.now().plusSeconds(expireSec);
130
+    }
131
+
132
+    // 过期返回 true
133
+    private boolean checkExpire(Phone phone) {
134
+        return LocalDateTime.now().isAfter(phone.getExpire());
135
+    }
136
+
137
+    @Data
138
+    @Accessors(chain = true)
139
+    public static class Phone {
140
+        String number;
141
+        String captcha;
142
+        LocalDateTime expire;
143
+    }
144
+
145
+}

+ 71
- 0
src/main/java/com/yunzhi/demo/common/SMSUtils.java Zobrazit soubor

@@ -0,0 +1,71 @@
1
+package com.yunzhi.demo.common;
2
+
3
+import com.aliyuncs.CommonRequest;
4
+import com.aliyuncs.CommonResponse;
5
+import com.aliyuncs.DefaultAcsClient;
6
+import com.aliyuncs.IAcsClient;
7
+import com.aliyuncs.http.MethodType;
8
+import com.aliyuncs.profile.DefaultProfile;
9
+import com.yunzhi.demo.config.AliyunConfig;
10
+import lombok.Data;
11
+import lombok.experimental.Accessors;
12
+import lombok.extern.slf4j.Slf4j;
13
+import org.springframework.beans.factory.InitializingBean;
14
+import org.springframework.beans.factory.annotation.Autowired;
15
+import org.springframework.stereotype.Component;
16
+
17
+@Slf4j
18
+@Component
19
+public class SMSUtils implements InitializingBean {
20
+
21
+    IAcsClient acsClient;
22
+
23
+    //产品名称:云通信短信API产品,开发者无需替换
24
+    static final String product = "Dysmsapi";
25
+    //产品域名,开发者无需替换
26
+    static final String domain = "dysmsapi.aliyuncs.com";
27
+    //API 的名称,开发者无需替换
28
+    static final String action = "SendSms";
29
+    //API RegionId,开发者无需替换
30
+    static final String regionId = "cn-hangzhou";
31
+    //API 版本,开发者无需替换
32
+    static final String verison = "2017-05-25";
33
+
34
+    @Autowired
35
+    AliyunConfig aliyunConfig;
36
+
37
+    public void sendMessage(Message message) throws Exception {
38
+        request(message);
39
+    }
40
+
41
+    private CommonResponse request(Message message) throws Exception {
42
+        CommonRequest request = new CommonRequest();
43
+        request.setSysMethod(MethodType.POST);
44
+        request.setSysDomain(domain);
45
+        request.setSysVersion(verison);
46
+        request.setSysAction(action);
47
+        request.putQueryParameter("RegionId", regionId);
48
+        request.putQueryParameter("PhoneNumbers", message.getTel());
49
+        request.putQueryParameter("SignName", message.getSign());
50
+        request.putQueryParameter("TemplateCode", message.getCode());
51
+        request.putQueryParameter("TemplateParam", message.getContent());
52
+
53
+        return acsClient.getCommonResponse(request);
54
+    }
55
+
56
+    @Override
57
+    public void afterPropertiesSet() throws Exception {
58
+        AliyunConfig.Sms sms = aliyunConfig.getSms();
59
+        DefaultProfile profile = DefaultProfile.getProfile("cn-hangzhou", aliyunConfig.getAccessKeyId(), aliyunConfig.getAccessKeySecret());
60
+        acsClient = new DefaultAcsClient(profile);
61
+    }
62
+
63
+    @Data
64
+    @Accessors(chain = true)
65
+    public static class Message {
66
+        String code;
67
+        String tel;
68
+        String sign;
69
+        String content;
70
+    }
71
+}

+ 120
- 0
src/main/java/com/yunzhi/demo/common/StringUtils.java Zobrazit soubor

@@ -0,0 +1,120 @@
1
+package com.yunzhi.demo.common;
2
+
3
+import java.io.UnsupportedEncodingException;
4
+import java.net.URLEncoder;
5
+import java.util.Random;
6
+import java.util.regex.Matcher;
7
+import java.util.regex.Pattern;
8
+
9
+public class StringUtils {
10
+    private static Pattern humpPattern = Pattern.compile("[A-Z]");
11
+
12
+    public static boolean isEmpty(String str) {
13
+        return null == str || "".equals(str.trim()) || "null".equals(str) || "undefined".equals(str);
14
+    }
15
+
16
+    public static String trim(String src, String...st) {
17
+        if (null == src) return src;
18
+        if (null == st || st.length == 0) return src.trim();
19
+
20
+        String start = st[0];
21
+        if (!src.startsWith(start)) {
22
+            return src;
23
+        }
24
+
25
+        return src.substring(start.length());
26
+    }
27
+
28
+    public static String trimEnd(String src, String str) {
29
+        if (null == src || null == str) {
30
+            return src;
31
+        }
32
+
33
+        if (src.endsWith(str)) {
34
+            return src.substring(0, src.length() - str.length());
35
+        }
36
+
37
+        return src;
38
+    }
39
+
40
+    public static String ifNull(String src, String defaultVal) {
41
+        return isEmpty(src) ? defaultVal : src;
42
+    }
43
+
44
+    public static String random(int length) {
45
+        String str="abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
46
+        Random random = new Random();
47
+        StringBuffer sb = new StringBuffer();
48
+        for(int i=0;i<length;i++){
49
+            int number=random.nextInt(62);
50
+            sb.append(str.charAt(number));
51
+        }
52
+        return sb.toString();
53
+    }
54
+
55
+    public static String urlEncode(String str) {
56
+        try {
57
+            return URLEncoder.encode(str, "UTF-8");
58
+        } catch (UnsupportedEncodingException e) {
59
+            e.printStackTrace();
60
+            return str;
61
+        }
62
+    }
63
+
64
+    public static String humpToLine(String str) {
65
+        if (null == str || "".equals(str)) return "";
66
+
67
+        Matcher matcher = humpPattern.matcher(str);
68
+        StringBuffer sb = new StringBuffer();
69
+        while (matcher.find()) {
70
+            matcher.appendReplacement(sb, "_" + matcher.group(0).toLowerCase());
71
+        }
72
+        matcher.appendTail(sb);
73
+        return sb.toString();
74
+    }
75
+
76
+    public static String strToUnicode(String str) {
77
+        char[] chars = str.toCharArray();
78
+        String returnStr = "";
79
+        for (int i = 0; i < chars.length; i++) {
80
+            returnStr += "\\u" + Integer.toString(chars[i], 16);
81
+        }
82
+        return returnStr;
83
+    }
84
+
85
+    public static String repeat(String src, int len) {
86
+        if (null == src) {
87
+            return null;
88
+        }
89
+
90
+        if (len <= 0) {
91
+            return src;
92
+        }
93
+
94
+        String res = "";
95
+        for (int i = 0; i < len; i ++) {
96
+            res += src;
97
+        }
98
+
99
+        return res;
100
+    }
101
+
102
+    public static String lpad(String src, String padStr, int len) {
103
+        if (null == src) {
104
+            return null;
105
+        }
106
+
107
+        if (len <= 0 || src.length() >= len) {
108
+            return src;
109
+        }
110
+
111
+        if (null == padStr) {
112
+            padStr = "";
113
+        }
114
+
115
+        int padLen = len - src.length();
116
+        String prefix = repeat(padStr, padLen);
117
+        prefix = prefix.substring(0, padLen);
118
+        return prefix + src;
119
+    }
120
+}

+ 34
- 0
src/main/java/com/yunzhi/demo/common/WxUtils.java Zobrazit soubor

@@ -0,0 +1,34 @@
1
+package com.yunzhi.demo.common;
2
+
3
+import cn.binarywang.wx.miniapp.api.WxMaService;
4
+import cn.binarywang.wx.miniapp.api.impl.WxMaServiceImpl;
5
+import cn.binarywang.wx.miniapp.config.impl.WxMaDefaultConfigImpl;
6
+import com.yunzhi.demo.config.WeixinConfig;
7
+import org.springframework.beans.factory.annotation.Autowired;
8
+import org.springframework.stereotype.Component;
9
+
10
+@Component
11
+public class WxUtils {
12
+    private static WxMaService service;
13
+
14
+    @Autowired
15
+    public WxUtils(WeixinConfig config) {
16
+        setService(config);
17
+    }
18
+
19
+    private void setService(WeixinConfig config) {
20
+        WxMaDefaultConfigImpl conf = new WxMaDefaultConfigImpl();
21
+        conf.setAppid(config.getMiniapp().getAppid());
22
+        conf.setSecret(config.getMiniapp().getSecret());
23
+        conf.setToken(config.getMiniapp().getToken());
24
+        conf.setAesKey(config.getMiniapp().getAesKey());
25
+        conf.setMsgDataFormat(config.getMiniapp().getMsgDataFormat());
26
+
27
+        WxMaService service = new WxMaServiceImpl();
28
+        service.setWxMaConfig(conf);
29
+    }
30
+
31
+    public WxMaService getService() {
32
+        return service;
33
+    }
34
+}

+ 44
- 0
src/main/java/com/yunzhi/demo/config/AliyunConfig.java Zobrazit soubor

@@ -0,0 +1,44 @@
1
+package com.yunzhi.demo.config;
2
+
3
+import lombok.Data;
4
+import org.springframework.boot.context.properties.ConfigurationProperties;
5
+import org.springframework.boot.context.properties.NestedConfigurationProperty;
6
+import org.springframework.stereotype.Component;
7
+
8
+@Data
9
+@Component
10
+@ConfigurationProperties(prefix = "aliyun")
11
+public class AliyunConfig {
12
+    private String accessKeyId;
13
+    private String accessKeySecret;
14
+
15
+    @NestedConfigurationProperty
16
+    private Oss oss = new Oss();
17
+
18
+    @NestedConfigurationProperty
19
+    private Sms sms = new Sms();
20
+
21
+    @Data
22
+    public  static class Oss {
23
+        private String roleSessionName;
24
+        private String accessKeyId;
25
+        private String accessKeySecret;
26
+        private String arn;
27
+        private String region;
28
+        private String endpoint;
29
+        private String bucketName;
30
+        private String bucketURL;
31
+    }
32
+
33
+    @Data
34
+    public static class Sms {
35
+        @NestedConfigurationProperty
36
+        private Captcha captcha = new Captcha();
37
+    }
38
+
39
+    @Data
40
+    public static class Captcha {
41
+        private String code;
42
+        private String sign;
43
+    }
44
+}

+ 35
- 0
src/main/java/com/yunzhi/demo/config/BaseConfig.java Zobrazit soubor

@@ -0,0 +1,35 @@
1
+package com.yunzhi.demo.config;
2
+
3
+import com.yunzhi.demo.interceptor.PermissionInterceptor;
4
+import lombok.Data;
5
+import org.springframework.beans.factory.annotation.Autowired;
6
+import org.springframework.context.annotation.Configuration;
7
+import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
8
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
9
+
10
+import javax.annotation.PostConstruct;
11
+
12
+@Data
13
+@Configuration
14
+public class BaseConfig implements WebMvcConfigurer {
15
+
16
+    @Autowired
17
+    private PermissionInterceptor permissionInterceptor;
18
+
19
+    @Autowired
20
+    private InterceptorConfig interceptorConfig;
21
+
22
+    @PostConstruct
23
+    public void init() {
24
+    }
25
+
26
+    @Override
27
+    public void addInterceptors(InterceptorRegistry registry) {
28
+        // 自定义拦截器,添加拦截路径和排除拦截路径
29
+        if (interceptorConfig.getPermission().isEnable()) {
30
+            registry.addInterceptor(permissionInterceptor)
31
+                    .addPathPatterns(interceptorConfig.getPermission().getIncludePaths())
32
+                    .excludePathPatterns(interceptorConfig.getPermission().getExcludePaths());
33
+        }
34
+    }
35
+}

+ 34
- 0
src/main/java/com/yunzhi/demo/config/InterceptorConfig.java Zobrazit soubor

@@ -0,0 +1,34 @@
1
+package com.yunzhi.demo.config;
2
+
3
+import lombok.Data;
4
+import org.springframework.boot.context.properties.ConfigurationProperties;
5
+import org.springframework.boot.context.properties.NestedConfigurationProperty;
6
+import org.springframework.stereotype.Component;
7
+
8
+@Data
9
+@Component
10
+@ConfigurationProperties(prefix = "interceptor")
11
+public class InterceptorConfig {
12
+
13
+    @NestedConfigurationProperty
14
+    private Config permission = new Config();
15
+
16
+    @Data
17
+    public static class Config {
18
+
19
+        /**
20
+         * 是否启用
21
+         */
22
+        private boolean enable;
23
+
24
+        /**
25
+         * 包含的路径
26
+         */
27
+        private String[] includePaths = new String[]{};
28
+
29
+        /**
30
+         * 排除路径
31
+         */
32
+        private String[] excludePaths = new String[]{};
33
+    }
34
+}

+ 14
- 0
src/main/java/com/yunzhi/demo/config/MybatisPlusConfig.java Zobrazit soubor

@@ -0,0 +1,14 @@
1
+package com.yunzhi.demo.config;
2
+
3
+import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
4
+import org.springframework.context.annotation.Bean;
5
+import org.springframework.context.annotation.Configuration;
6
+
7
+@Configuration
8
+public class MybatisPlusConfig {
9
+
10
+    @Bean
11
+    public PaginationInterceptor paginationInterceptor() {
12
+        return new PaginationInterceptor();
13
+    }
14
+}

+ 24
- 0
src/main/java/com/yunzhi/demo/config/SwagggerConfig.java Zobrazit soubor

@@ -0,0 +1,24 @@
1
+package com.yunzhi.demo.config;
2
+
3
+import io.swagger.annotations.Api;
4
+import org.springframework.context.annotation.Bean;
5
+import org.springframework.context.annotation.Configuration;
6
+import springfox.documentation.builders.PathSelectors;
7
+import springfox.documentation.builders.RequestHandlerSelectors;
8
+import springfox.documentation.spi.DocumentationType;
9
+import springfox.documentation.spring.web.plugins.Docket;
10
+import springfox.documentation.swagger2.annotations.EnableSwagger2;
11
+
12
+@Configuration
13
+@EnableSwagger2
14
+public class SwagggerConfig {
15
+    @Bean
16
+    public Docket docket() {
17
+        return new Docket(DocumentationType.SWAGGER_2)
18
+                .select()
19
+                .apis(RequestHandlerSelectors.withClassAnnotation(Api.class))
20
+                .paths(PathSelectors.any())
21
+                .build();
22
+
23
+    }
24
+}

+ 24
- 0
src/main/java/com/yunzhi/demo/config/WeixinConfig.java Zobrazit soubor

@@ -0,0 +1,24 @@
1
+package com.yunzhi.demo.config;
2
+
3
+import lombok.Data;
4
+import org.springframework.boot.context.properties.ConfigurationProperties;
5
+import org.springframework.boot.context.properties.NestedConfigurationProperty;
6
+import org.springframework.stereotype.Component;
7
+
8
+@Data
9
+@Component
10
+@ConfigurationProperties(prefix = "weixin")
11
+public class WeixinConfig {
12
+
13
+    @NestedConfigurationProperty
14
+    private Miniapp miniapp = new Miniapp();
15
+
16
+    @Data
17
+    public static class Miniapp {
18
+        private String appid;
19
+        private String secret;
20
+        private String token;
21
+        private String aesKey;
22
+        private String msgDataFormat;
23
+    }
24
+}

+ 71
- 0
src/main/java/com/yunzhi/demo/controller/CommController.java Zobrazit soubor

@@ -0,0 +1,71 @@
1
+package com.yunzhi.demo.controller;
2
+
3
+import com.yunzhi.demo.common.BaseController;
4
+import com.yunzhi.demo.common.OSSUtils;
5
+import com.yunzhi.demo.common.ResponseBean;
6
+import com.yunzhi.demo.config.AliyunConfig;
7
+import io.swagger.annotations.Api;
8
+import io.swagger.annotations.ApiOperation;
9
+import org.springframework.beans.factory.annotation.Autowired;
10
+import org.springframework.web.bind.annotation.*;
11
+import org.springframework.web.multipart.MultipartFile;
12
+
13
+import java.io.IOException;
14
+import java.time.LocalDateTime;
15
+import java.time.format.DateTimeFormatter;
16
+import java.util.Map;
17
+
18
+@Api(tags = "通用")
19
+@RestController
20
+@RequestMapping("/")
21
+public class CommController extends BaseController {
22
+
23
+    @Autowired
24
+    OSSUtils ossUtils;
25
+
26
+    @Autowired
27
+    AliyunConfig aliyunConfig;
28
+
29
+    /**
30
+     * 图片
31
+     * @param multipartFile
32
+     * @return
33
+     */
34
+    @ApiOperation(value = "图片上传", notes = "图片上传")
35
+    @PostMapping("/{plat}/image")
36
+    public ResponseBean uploadImage(@RequestParam("file") MultipartFile multipartFile) {
37
+        try {
38
+            String img = ossUtils.putObject(multipartFile);
39
+            return ResponseBean.success(img);
40
+        } catch (IOException e) {
41
+            return ResponseBean.error("上传图片失败: " + e.getMessage(), ResponseBean.ERROR_UNAVAILABLE);
42
+        }
43
+    }
44
+
45
+    /**
46
+     * 获取文件上传凭证
47
+     * @return
48
+     */
49
+    @ApiOperation(value = "获取文件上传凭证", notes = "获取文件上传凭证")
50
+    @GetMapping("/{plat}/oss-sts")
51
+    public ResponseBean getOSSSTS() {
52
+        AliyunConfig.Oss oss = aliyunConfig.getOss();
53
+
54
+        try {
55
+            Map<String, Object> res = ossUtils.getSTSAKToken();
56
+            res.put("endpoint", oss.getEndpoint());
57
+            res.put("bucket", oss.getBucketName());
58
+            res.put("bucketURL", oss.getBucketURL());
59
+            res.put("region", oss.getRegion());
60
+            res.put("path", getMonth());
61
+
62
+            return ResponseBean.success(res);
63
+        } catch (Exception e) {
64
+            return ResponseBean.error("获取上传凭证失败! ", ResponseBean.ERROR_UNAVAILABLE);
65
+        }
66
+    }
67
+
68
+    private String getMonth() {
69
+        return DateTimeFormatter.ofPattern("yyyy-MM").format(LocalDateTime.now());
70
+    }
71
+}

+ 82
- 0
src/main/java/com/yunzhi/demo/controller/LoginController.java Zobrazit soubor

@@ -0,0 +1,82 @@
1
+package com.yunzhi.demo.controller;
2
+
3
+import com.yunzhi.demo.common.*;
4
+import com.yunzhi.demo.entity.SysLogin;
5
+import com.yunzhi.demo.entity.SysUser;
6
+import com.yunzhi.demo.service.ISysLoginService;
7
+import com.yunzhi.demo.service.ISysUserService;
8
+import com.yunzhi.demo.vo.LoginParam;
9
+import com.yunzhi.demo.vo.TokenParam;
10
+import io.swagger.annotations.Api;
11
+import io.swagger.annotations.ApiOperation;
12
+import io.swagger.annotations.ApiParam;
13
+import org.springframework.beans.factory.annotation.Autowired;
14
+import org.springframework.web.bind.annotation.PostMapping;
15
+import org.springframework.web.bind.annotation.RequestBody;
16
+import org.springframework.web.bind.annotation.RestController;
17
+
18
+import java.util.HashMap;
19
+import java.util.Map;
20
+
21
+//import java.util.HashMap;
22
+
23
+
24
+@Api(tags = "登入/登出")
25
+@RestController
26
+public class LoginController extends BaseController {
27
+
28
+    @Autowired
29
+    ISysLoginService iSysLoginService;
30
+
31
+    @Autowired
32
+    ISysUserService iSysUserService;
33
+
34
+    @PostMapping("/admin/login")
35
+    @ApiOperation(value="登录", notes = "登录", httpMethod = "POST", response = ResponseBean.class)
36
+    public ResponseBean login(@ApiParam("登录参数") @RequestBody LoginParam loginParam) throws Exception {
37
+        if (null == loginParam) {
38
+            return ResponseBean.error("账户或密码不能为空", ResponseBean.ERROR_ILLEGAL_PARAMS);
39
+        }
40
+
41
+        String userName = loginParam.getUserName();
42
+        String password = loginParam.getPassword();
43
+
44
+        if (StringUtils.isEmpty(userName) || StringUtils.isEmpty(password)) {
45
+            return ResponseBean.error("账户或密码不能为空", ResponseBean.ERROR_ILLEGAL_PARAMS);
46
+        }
47
+
48
+        SysLogin sysLogin = iSysLoginService.getByLoginName(userName);
49
+        if (null == sysLogin) {
50
+            return ResponseBean.error("账户或密码不正确", ResponseBean.ERROR_ILLEGAL_PARAMS);
51
+        }
52
+
53
+        SysUser sysUser = iSysUserService.getById(sysLogin.getUserId());
54
+        if (null == sysUser) {
55
+            return ResponseBean.error("账户或密码不正确", ResponseBean.ERROR_ILLEGAL_PARAMS);
56
+        }
57
+
58
+        if (!checkPassword(password, sysLogin.getPassword(), sysLogin.getUserId())) {
59
+            return ResponseBean.error("账户或密码不正确", ResponseBean.ERROR_ILLEGAL_PARAMS);
60
+        }
61
+
62
+        if (!Constants.STATUS_NORMAL.equals(sysUser.getStatus())) {
63
+            return ResponseBean.error("用户状态不正确, 请联系管理人员", ResponseBean.ERROR_UNAVAILABLE);
64
+        }
65
+
66
+        // 生成 token
67
+        TokenParam tokenParam = new TokenParam()
68
+                .setUserId(sysUser.getUserId())
69
+                .setOrgId("0");
70
+        String token = JWTUtils.encode(tokenParam.toMap());
71
+
72
+        Map<String, Object> res = new HashMap<String, Object>() {{
73
+            put("user", sysUser);
74
+            put("token", token);
75
+        }};
76
+        return ResponseBean.success(res);
77
+    }
78
+
79
+    private boolean checkPassword(String src, String targ, String salt) {
80
+        return EncryptUtils.md5(src, salt).equals(targ);
81
+    }
82
+}

+ 119
- 0
src/main/java/com/yunzhi/demo/controller/SysBannerController.java Zobrazit soubor

@@ -0,0 +1,119 @@
1
+package com.yunzhi.demo.controller;
2
+
3
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
+import com.baomidou.mybatisplus.core.metadata.IPage;
5
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
+import com.yunzhi.demo.common.BaseController;
7
+import com.yunzhi.demo.common.ResponseBean;
8
+import io.swagger.annotations.Api;
9
+import io.swagger.annotations.ApiOperation;
10
+import io.swagger.annotations.ApiParam;
11
+import org.slf4j.Logger;
12
+import org.slf4j.LoggerFactory;
13
+import org.springframework.beans.factory.annotation.Autowired;
14
+import org.springframework.web.bind.annotation.PathVariable;
15
+import org.springframework.web.bind.annotation.RequestBody;
16
+import org.springframework.web.bind.annotation.RequestMapping;
17
+import org.springframework.web.bind.annotation.RequestMethod;
18
+import org.springframework.web.bind.annotation.RequestParam;
19
+import com.yunzhi.demo.service.ISysBannerService;
20
+import com.yunzhi.demo.entity.SysBanner;
21
+import org.springframework.web.bind.annotation.RestController;
22
+
23
+/**
24
+ * <p>
25
+    * 广告栏 前端控制器
26
+    * </p>
27
+ *
28
+ * @author yansen
29
+ * @since 2021-04-15
30
+ */
31
+
32
+@Api(tags = "广告栏")
33
+@RestController
34
+@RequestMapping("/")
35
+public class SysBannerController extends BaseController {
36
+
37
+    private final Logger logger = LoggerFactory.getLogger(SysBannerController.class);
38
+
39
+    @Autowired
40
+    public ISysBannerService iSysBannerService;
41
+
42
+
43
+    /**
44
+     * 分页查询列表
45
+     * @param pageNum
46
+     * @param pageSize
47
+     * @return
48
+     */
49
+    @RequestMapping(value="/sysBanner",method= RequestMethod.GET)
50
+    @ApiOperation(value="列表", notes = "列表", httpMethod = "GET", response = ResponseBean.class)
51
+    public ResponseBean sysBannerList(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
52
+									 @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize) throws Exception{
53
+
54
+		    IPage<SysBanner> pg = new Page<>(pageNum, pageSize);
55
+            QueryWrapper<SysBanner> queryWrapper = new QueryWrapper<>();
56
+            queryWrapper.orderByDesc("create_date");
57
+
58
+            IPage<SysBanner> result = iSysBannerService.page(pg, queryWrapper);
59
+            return ResponseBean.success(result);
60
+    }
61
+
62
+    /**
63
+     * 保存对象
64
+     * @param sysBanner 实体对象
65
+     * @return
66
+     */
67
+    @RequestMapping(value="/sysBanner",method= RequestMethod.POST)
68
+    @ApiOperation(value="保存", notes = "保存", httpMethod = "POST", response = ResponseBean.class)
69
+    public ResponseBean sysBannerAdd(@ApiParam("保存内容") @RequestBody SysBanner sysBanner) throws Exception{
70
+
71
+        if (iSysBannerService.save(sysBanner)){
72
+            return ResponseBean.success(sysBanner);
73
+        }else {
74
+            return ResponseBean.error("保存失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
75
+        }
76
+    }
77
+
78
+    /**
79
+     * 根据id删除对象
80
+     * @param id  实体ID
81
+     */
82
+    @RequestMapping(value="/sysBanner/{id}", method= RequestMethod.DELETE)
83
+    @ApiOperation(value="删除", notes = "删除", httpMethod = "DELETE", response = ResponseBean.class)
84
+    public ResponseBean sysBannerDelete(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
85
+        if(iSysBannerService.removeById(id)){
86
+            return ResponseBean.success("success");
87
+        }else {
88
+            return ResponseBean.error("删除失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
89
+        }
90
+    }
91
+
92
+    /**
93
+     * 修改对象
94
+     * @param id  实体ID
95
+     * @param sysBanner 实体对象
96
+     * @return
97
+     */
98
+    @RequestMapping(value="/sysBanner/{id}",method= RequestMethod.PUT)
99
+    @ApiOperation(value="更新", notes = "更新", httpMethod = "PUT", response = ResponseBean.class)
100
+    public ResponseBean sysBannerUpdate(@ApiParam("对象ID") @PathVariable Integer id,
101
+                                        @ApiParam("更新内容") @RequestBody SysBanner sysBanner) throws Exception{
102
+
103
+        if (iSysBannerService.updateById(sysBanner)){
104
+            return ResponseBean.success(iSysBannerService.getById(id));
105
+        }else {
106
+            return ResponseBean.error("修改失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
107
+        }
108
+    }
109
+
110
+    /**
111
+     * 根据id查询对象
112
+     * @param id  实体ID
113
+     */
114
+    @RequestMapping(value="/sysBanner/{id}",method= RequestMethod.GET)
115
+    @ApiOperation(value="详情", notes = "详情", httpMethod = "GET", response = ResponseBean.class)
116
+    public ResponseBean sysBannerGet(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
117
+        return ResponseBean.success(iSysBannerService.getById(id));
118
+    }
119
+}

+ 119
- 0
src/main/java/com/yunzhi/demo/controller/SysConfigController.java Zobrazit soubor

@@ -0,0 +1,119 @@
1
+package com.yunzhi.demo.controller;
2
+
3
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
+import com.baomidou.mybatisplus.core.metadata.IPage;
5
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
+import com.yunzhi.demo.common.BaseController;
7
+import com.yunzhi.demo.common.ResponseBean;
8
+import io.swagger.annotations.Api;
9
+import io.swagger.annotations.ApiOperation;
10
+import io.swagger.annotations.ApiParam;
11
+import org.slf4j.Logger;
12
+import org.slf4j.LoggerFactory;
13
+import org.springframework.beans.factory.annotation.Autowired;
14
+import org.springframework.web.bind.annotation.PathVariable;
15
+import org.springframework.web.bind.annotation.RequestBody;
16
+import org.springframework.web.bind.annotation.RequestMapping;
17
+import org.springframework.web.bind.annotation.RequestMethod;
18
+import org.springframework.web.bind.annotation.RequestParam;
19
+import com.yunzhi.demo.service.ISysConfigService;
20
+import com.yunzhi.demo.entity.SysConfig;
21
+import org.springframework.web.bind.annotation.RestController;
22
+
23
+/**
24
+ * <p>
25
+    * 系统设定 前端控制器
26
+    * </p>
27
+ *
28
+ * @author yansen
29
+ * @since 2021-04-15
30
+ */
31
+
32
+@Api(tags = "系统设定")
33
+@RestController
34
+@RequestMapping("/")
35
+public class SysConfigController extends BaseController {
36
+
37
+    private final Logger logger = LoggerFactory.getLogger(SysConfigController.class);
38
+
39
+    @Autowired
40
+    public ISysConfigService iSysConfigService;
41
+
42
+
43
+    /**
44
+     * 分页查询列表
45
+     * @param pageNum
46
+     * @param pageSize
47
+     * @return
48
+     */
49
+    @RequestMapping(value="/sysConfig",method= RequestMethod.GET)
50
+    @ApiOperation(value="列表", notes = "列表", httpMethod = "GET", response = ResponseBean.class)
51
+    public ResponseBean sysConfigList(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
52
+									 @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize) throws Exception{
53
+
54
+		    IPage<SysConfig> pg = new Page<>(pageNum, pageSize);
55
+            QueryWrapper<SysConfig> queryWrapper = new QueryWrapper<>();
56
+            queryWrapper.orderByDesc("create_date");
57
+
58
+            IPage<SysConfig> result = iSysConfigService.page(pg, queryWrapper);
59
+            return ResponseBean.success(result);
60
+    }
61
+
62
+    /**
63
+     * 保存对象
64
+     * @param sysConfig 实体对象
65
+     * @return
66
+     */
67
+    @RequestMapping(value="/sysConfig",method= RequestMethod.POST)
68
+    @ApiOperation(value="保存", notes = "保存", httpMethod = "POST", response = ResponseBean.class)
69
+    public ResponseBean sysConfigAdd(@ApiParam("保存内容") @RequestBody SysConfig sysConfig) throws Exception{
70
+
71
+        if (iSysConfigService.save(sysConfig)){
72
+            return ResponseBean.success(sysConfig);
73
+        }else {
74
+            return ResponseBean.error("保存失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
75
+        }
76
+    }
77
+
78
+    /**
79
+     * 根据id删除对象
80
+     * @param id  实体ID
81
+     */
82
+    @RequestMapping(value="/sysConfig/{id}", method= RequestMethod.DELETE)
83
+    @ApiOperation(value="删除", notes = "删除", httpMethod = "DELETE", response = ResponseBean.class)
84
+    public ResponseBean sysConfigDelete(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
85
+        if(iSysConfigService.removeById(id)){
86
+            return ResponseBean.success("success");
87
+        }else {
88
+            return ResponseBean.error("删除失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
89
+        }
90
+    }
91
+
92
+    /**
93
+     * 修改对象
94
+     * @param id  实体ID
95
+     * @param sysConfig 实体对象
96
+     * @return
97
+     */
98
+    @RequestMapping(value="/sysConfig/{id}",method= RequestMethod.PUT)
99
+    @ApiOperation(value="更新", notes = "更新", httpMethod = "PUT", response = ResponseBean.class)
100
+    public ResponseBean sysConfigUpdate(@ApiParam("对象ID") @PathVariable Integer id,
101
+                                        @ApiParam("更新内容") @RequestBody SysConfig sysConfig) throws Exception{
102
+
103
+        if (iSysConfigService.updateById(sysConfig)){
104
+            return ResponseBean.success(iSysConfigService.getById(id));
105
+        }else {
106
+            return ResponseBean.error("修改失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
107
+        }
108
+    }
109
+
110
+    /**
111
+     * 根据id查询对象
112
+     * @param id  实体ID
113
+     */
114
+    @RequestMapping(value="/sysConfig/{id}",method= RequestMethod.GET)
115
+    @ApiOperation(value="详情", notes = "详情", httpMethod = "GET", response = ResponseBean.class)
116
+    public ResponseBean sysConfigGet(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
117
+        return ResponseBean.success(iSysConfigService.getById(id));
118
+    }
119
+}

+ 119
- 0
src/main/java/com/yunzhi/demo/controller/SysLoginController.java Zobrazit soubor

@@ -0,0 +1,119 @@
1
+package com.yunzhi.demo.controller;
2
+
3
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
+import com.baomidou.mybatisplus.core.metadata.IPage;
5
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
+import com.yunzhi.demo.common.BaseController;
7
+import com.yunzhi.demo.common.ResponseBean;
8
+import io.swagger.annotations.Api;
9
+import io.swagger.annotations.ApiOperation;
10
+import io.swagger.annotations.ApiParam;
11
+import org.slf4j.Logger;
12
+import org.slf4j.LoggerFactory;
13
+import org.springframework.beans.factory.annotation.Autowired;
14
+import org.springframework.web.bind.annotation.PathVariable;
15
+import org.springframework.web.bind.annotation.RequestBody;
16
+import org.springframework.web.bind.annotation.RequestMapping;
17
+import org.springframework.web.bind.annotation.RequestMethod;
18
+import org.springframework.web.bind.annotation.RequestParam;
19
+import com.yunzhi.demo.service.ISysLoginService;
20
+import com.yunzhi.demo.entity.SysLogin;
21
+import org.springframework.web.bind.annotation.RestController;
22
+
23
+/**
24
+ * <p>
25
+    * 用户登录 前端控制器
26
+    * </p>
27
+ *
28
+ * @author yansen
29
+ * @since 2021-04-15
30
+ */
31
+
32
+@Api(tags = "用户登录")
33
+@RestController
34
+@RequestMapping("/")
35
+public class SysLoginController extends BaseController {
36
+
37
+    private final Logger logger = LoggerFactory.getLogger(SysLoginController.class);
38
+
39
+    @Autowired
40
+    public ISysLoginService iSysLoginService;
41
+
42
+
43
+    /**
44
+     * 分页查询列表
45
+     * @param pageNum
46
+     * @param pageSize
47
+     * @return
48
+     */
49
+    @RequestMapping(value="/sysLogin",method= RequestMethod.GET)
50
+    @ApiOperation(value="列表", notes = "列表", httpMethod = "GET", response = ResponseBean.class)
51
+    public ResponseBean sysLoginList(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
52
+									 @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize) throws Exception{
53
+
54
+		    IPage<SysLogin> pg = new Page<>(pageNum, pageSize);
55
+            QueryWrapper<SysLogin> queryWrapper = new QueryWrapper<>();
56
+            queryWrapper.orderByDesc("create_date");
57
+
58
+            IPage<SysLogin> result = iSysLoginService.page(pg, queryWrapper);
59
+            return ResponseBean.success(result);
60
+    }
61
+
62
+    /**
63
+     * 保存对象
64
+     * @param sysLogin 实体对象
65
+     * @return
66
+     */
67
+    @RequestMapping(value="/sysLogin",method= RequestMethod.POST)
68
+    @ApiOperation(value="保存", notes = "保存", httpMethod = "POST", response = ResponseBean.class)
69
+    public ResponseBean sysLoginAdd(@ApiParam("保存内容") @RequestBody SysLogin sysLogin) throws Exception{
70
+
71
+        if (iSysLoginService.save(sysLogin)){
72
+            return ResponseBean.success(sysLogin);
73
+        }else {
74
+            return ResponseBean.error("保存失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
75
+        }
76
+    }
77
+
78
+    /**
79
+     * 根据id删除对象
80
+     * @param id  实体ID
81
+     */
82
+    @RequestMapping(value="/sysLogin/{id}", method= RequestMethod.DELETE)
83
+    @ApiOperation(value="删除", notes = "删除", httpMethod = "DELETE", response = ResponseBean.class)
84
+    public ResponseBean sysLoginDelete(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
85
+        if(iSysLoginService.removeById(id)){
86
+            return ResponseBean.success("success");
87
+        }else {
88
+            return ResponseBean.error("删除失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
89
+        }
90
+    }
91
+
92
+    /**
93
+     * 修改对象
94
+     * @param id  实体ID
95
+     * @param sysLogin 实体对象
96
+     * @return
97
+     */
98
+    @RequestMapping(value="/sysLogin/{id}",method= RequestMethod.PUT)
99
+    @ApiOperation(value="更新", notes = "更新", httpMethod = "PUT", response = ResponseBean.class)
100
+    public ResponseBean sysLoginUpdate(@ApiParam("对象ID") @PathVariable Integer id,
101
+                                        @ApiParam("更新内容") @RequestBody SysLogin sysLogin) throws Exception{
102
+
103
+        if (iSysLoginService.updateById(sysLogin)){
104
+            return ResponseBean.success(iSysLoginService.getById(id));
105
+        }else {
106
+            return ResponseBean.error("修改失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
107
+        }
108
+    }
109
+
110
+    /**
111
+     * 根据id查询对象
112
+     * @param id  实体ID
113
+     */
114
+    @RequestMapping(value="/sysLogin/{id}",method= RequestMethod.GET)
115
+    @ApiOperation(value="详情", notes = "详情", httpMethod = "GET", response = ResponseBean.class)
116
+    public ResponseBean sysLoginGet(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
117
+        return ResponseBean.success(iSysLoginService.getById(id));
118
+    }
119
+}

+ 119
- 0
src/main/java/com/yunzhi/demo/controller/SysMenuController.java Zobrazit soubor

@@ -0,0 +1,119 @@
1
+package com.yunzhi.demo.controller;
2
+
3
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
+import com.baomidou.mybatisplus.core.metadata.IPage;
5
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
+import com.yunzhi.demo.common.BaseController;
7
+import com.yunzhi.demo.common.ResponseBean;
8
+import io.swagger.annotations.Api;
9
+import io.swagger.annotations.ApiOperation;
10
+import io.swagger.annotations.ApiParam;
11
+import org.slf4j.Logger;
12
+import org.slf4j.LoggerFactory;
13
+import org.springframework.beans.factory.annotation.Autowired;
14
+import org.springframework.web.bind.annotation.PathVariable;
15
+import org.springframework.web.bind.annotation.RequestBody;
16
+import org.springframework.web.bind.annotation.RequestMapping;
17
+import org.springframework.web.bind.annotation.RequestMethod;
18
+import org.springframework.web.bind.annotation.RequestParam;
19
+import com.yunzhi.demo.service.ISysMenuService;
20
+import com.yunzhi.demo.entity.SysMenu;
21
+import org.springframework.web.bind.annotation.RestController;
22
+
23
+/**
24
+ * <p>
25
+    * 菜单管理 前端控制器
26
+    * </p>
27
+ *
28
+ * @author yansen
29
+ * @since 2021-04-15
30
+ */
31
+
32
+@Api(tags = "菜单管理")
33
+@RestController
34
+@RequestMapping("/")
35
+public class SysMenuController extends BaseController {
36
+
37
+    private final Logger logger = LoggerFactory.getLogger(SysMenuController.class);
38
+
39
+    @Autowired
40
+    public ISysMenuService iSysMenuService;
41
+
42
+
43
+    /**
44
+     * 分页查询列表
45
+     * @param pageNum
46
+     * @param pageSize
47
+     * @return
48
+     */
49
+    @RequestMapping(value="/sysMenu",method= RequestMethod.GET)
50
+    @ApiOperation(value="列表", notes = "列表", httpMethod = "GET", response = ResponseBean.class)
51
+    public ResponseBean sysMenuList(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
52
+									 @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize) throws Exception{
53
+
54
+		    IPage<SysMenu> pg = new Page<>(pageNum, pageSize);
55
+            QueryWrapper<SysMenu> queryWrapper = new QueryWrapper<>();
56
+            queryWrapper.orderByDesc("create_date");
57
+
58
+            IPage<SysMenu> result = iSysMenuService.page(pg, queryWrapper);
59
+            return ResponseBean.success(result);
60
+    }
61
+
62
+    /**
63
+     * 保存对象
64
+     * @param sysMenu 实体对象
65
+     * @return
66
+     */
67
+    @RequestMapping(value="/sysMenu",method= RequestMethod.POST)
68
+    @ApiOperation(value="保存", notes = "保存", httpMethod = "POST", response = ResponseBean.class)
69
+    public ResponseBean sysMenuAdd(@ApiParam("保存内容") @RequestBody SysMenu sysMenu) throws Exception{
70
+
71
+        if (iSysMenuService.save(sysMenu)){
72
+            return ResponseBean.success(sysMenu);
73
+        }else {
74
+            return ResponseBean.error("保存失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
75
+        }
76
+    }
77
+
78
+    /**
79
+     * 根据id删除对象
80
+     * @param id  实体ID
81
+     */
82
+    @RequestMapping(value="/sysMenu/{id}", method= RequestMethod.DELETE)
83
+    @ApiOperation(value="删除", notes = "删除", httpMethod = "DELETE", response = ResponseBean.class)
84
+    public ResponseBean sysMenuDelete(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
85
+        if(iSysMenuService.removeById(id)){
86
+            return ResponseBean.success("success");
87
+        }else {
88
+            return ResponseBean.error("删除失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
89
+        }
90
+    }
91
+
92
+    /**
93
+     * 修改对象
94
+     * @param id  实体ID
95
+     * @param sysMenu 实体对象
96
+     * @return
97
+     */
98
+    @RequestMapping(value="/sysMenu/{id}",method= RequestMethod.PUT)
99
+    @ApiOperation(value="更新", notes = "更新", httpMethod = "PUT", response = ResponseBean.class)
100
+    public ResponseBean sysMenuUpdate(@ApiParam("对象ID") @PathVariable Integer id,
101
+                                        @ApiParam("更新内容") @RequestBody SysMenu sysMenu) throws Exception{
102
+
103
+        if (iSysMenuService.updateById(sysMenu)){
104
+            return ResponseBean.success(iSysMenuService.getById(id));
105
+        }else {
106
+            return ResponseBean.error("修改失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
107
+        }
108
+    }
109
+
110
+    /**
111
+     * 根据id查询对象
112
+     * @param id  实体ID
113
+     */
114
+    @RequestMapping(value="/sysMenu/{id}",method= RequestMethod.GET)
115
+    @ApiOperation(value="详情", notes = "详情", httpMethod = "GET", response = ResponseBean.class)
116
+    public ResponseBean sysMenuGet(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
117
+        return ResponseBean.success(iSysMenuService.getById(id));
118
+    }
119
+}

+ 119
- 0
src/main/java/com/yunzhi/demo/controller/SysRoleController.java Zobrazit soubor

@@ -0,0 +1,119 @@
1
+package com.yunzhi.demo.controller;
2
+
3
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
+import com.baomidou.mybatisplus.core.metadata.IPage;
5
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
+import com.yunzhi.demo.common.BaseController;
7
+import com.yunzhi.demo.common.ResponseBean;
8
+import io.swagger.annotations.Api;
9
+import io.swagger.annotations.ApiOperation;
10
+import io.swagger.annotations.ApiParam;
11
+import org.slf4j.Logger;
12
+import org.slf4j.LoggerFactory;
13
+import org.springframework.beans.factory.annotation.Autowired;
14
+import org.springframework.web.bind.annotation.PathVariable;
15
+import org.springframework.web.bind.annotation.RequestBody;
16
+import org.springframework.web.bind.annotation.RequestMapping;
17
+import org.springframework.web.bind.annotation.RequestMethod;
18
+import org.springframework.web.bind.annotation.RequestParam;
19
+import com.yunzhi.demo.service.ISysRoleService;
20
+import com.yunzhi.demo.entity.SysRole;
21
+import org.springframework.web.bind.annotation.RestController;
22
+
23
+/**
24
+ * <p>
25
+    * 角色 前端控制器
26
+    * </p>
27
+ *
28
+ * @author yansen
29
+ * @since 2021-04-15
30
+ */
31
+
32
+@Api(tags = "角色")
33
+@RestController
34
+@RequestMapping("/")
35
+public class SysRoleController extends BaseController {
36
+
37
+    private final Logger logger = LoggerFactory.getLogger(SysRoleController.class);
38
+
39
+    @Autowired
40
+    public ISysRoleService iSysRoleService;
41
+
42
+
43
+    /**
44
+     * 分页查询列表
45
+     * @param pageNum
46
+     * @param pageSize
47
+     * @return
48
+     */
49
+    @RequestMapping(value="/sysRole",method= RequestMethod.GET)
50
+    @ApiOperation(value="列表", notes = "列表", httpMethod = "GET", response = ResponseBean.class)
51
+    public ResponseBean sysRoleList(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
52
+									 @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize) throws Exception{
53
+
54
+		    IPage<SysRole> pg = new Page<>(pageNum, pageSize);
55
+            QueryWrapper<SysRole> queryWrapper = new QueryWrapper<>();
56
+            queryWrapper.orderByDesc("create_date");
57
+
58
+            IPage<SysRole> result = iSysRoleService.page(pg, queryWrapper);
59
+            return ResponseBean.success(result);
60
+    }
61
+
62
+    /**
63
+     * 保存对象
64
+     * @param sysRole 实体对象
65
+     * @return
66
+     */
67
+    @RequestMapping(value="/sysRole",method= RequestMethod.POST)
68
+    @ApiOperation(value="保存", notes = "保存", httpMethod = "POST", response = ResponseBean.class)
69
+    public ResponseBean sysRoleAdd(@ApiParam("保存内容") @RequestBody SysRole sysRole) throws Exception{
70
+
71
+        if (iSysRoleService.save(sysRole)){
72
+            return ResponseBean.success(sysRole);
73
+        }else {
74
+            return ResponseBean.error("保存失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
75
+        }
76
+    }
77
+
78
+    /**
79
+     * 根据id删除对象
80
+     * @param id  实体ID
81
+     */
82
+    @RequestMapping(value="/sysRole/{id}", method= RequestMethod.DELETE)
83
+    @ApiOperation(value="删除", notes = "删除", httpMethod = "DELETE", response = ResponseBean.class)
84
+    public ResponseBean sysRoleDelete(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
85
+        if(iSysRoleService.removeById(id)){
86
+            return ResponseBean.success("success");
87
+        }else {
88
+            return ResponseBean.error("删除失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
89
+        }
90
+    }
91
+
92
+    /**
93
+     * 修改对象
94
+     * @param id  实体ID
95
+     * @param sysRole 实体对象
96
+     * @return
97
+     */
98
+    @RequestMapping(value="/sysRole/{id}",method= RequestMethod.PUT)
99
+    @ApiOperation(value="更新", notes = "更新", httpMethod = "PUT", response = ResponseBean.class)
100
+    public ResponseBean sysRoleUpdate(@ApiParam("对象ID") @PathVariable Integer id,
101
+                                        @ApiParam("更新内容") @RequestBody SysRole sysRole) throws Exception{
102
+
103
+        if (iSysRoleService.updateById(sysRole)){
104
+            return ResponseBean.success(iSysRoleService.getById(id));
105
+        }else {
106
+            return ResponseBean.error("修改失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
107
+        }
108
+    }
109
+
110
+    /**
111
+     * 根据id查询对象
112
+     * @param id  实体ID
113
+     */
114
+    @RequestMapping(value="/sysRole/{id}",method= RequestMethod.GET)
115
+    @ApiOperation(value="详情", notes = "详情", httpMethod = "GET", response = ResponseBean.class)
116
+    public ResponseBean sysRoleGet(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
117
+        return ResponseBean.success(iSysRoleService.getById(id));
118
+    }
119
+}

+ 119
- 0
src/main/java/com/yunzhi/demo/controller/SysRoleMenuController.java Zobrazit soubor

@@ -0,0 +1,119 @@
1
+package com.yunzhi.demo.controller;
2
+
3
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
+import com.baomidou.mybatisplus.core.metadata.IPage;
5
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
+import com.yunzhi.demo.common.BaseController;
7
+import com.yunzhi.demo.common.ResponseBean;
8
+import io.swagger.annotations.Api;
9
+import io.swagger.annotations.ApiOperation;
10
+import io.swagger.annotations.ApiParam;
11
+import org.slf4j.Logger;
12
+import org.slf4j.LoggerFactory;
13
+import org.springframework.beans.factory.annotation.Autowired;
14
+import org.springframework.web.bind.annotation.PathVariable;
15
+import org.springframework.web.bind.annotation.RequestBody;
16
+import org.springframework.web.bind.annotation.RequestMapping;
17
+import org.springframework.web.bind.annotation.RequestMethod;
18
+import org.springframework.web.bind.annotation.RequestParam;
19
+import com.yunzhi.demo.service.ISysRoleMenuService;
20
+import com.yunzhi.demo.entity.SysRoleMenu;
21
+import org.springframework.web.bind.annotation.RestController;
22
+
23
+/**
24
+ * <p>
25
+    * 角色菜单 前端控制器
26
+    * </p>
27
+ *
28
+ * @author yansen
29
+ * @since 2021-04-15
30
+ */
31
+
32
+@Api(tags = "角色菜单")
33
+@RestController
34
+@RequestMapping("/")
35
+public class SysRoleMenuController extends BaseController {
36
+
37
+    private final Logger logger = LoggerFactory.getLogger(SysRoleMenuController.class);
38
+
39
+    @Autowired
40
+    public ISysRoleMenuService iSysRoleMenuService;
41
+
42
+
43
+    /**
44
+     * 分页查询列表
45
+     * @param pageNum
46
+     * @param pageSize
47
+     * @return
48
+     */
49
+    @RequestMapping(value="/sysRoleMenu",method= RequestMethod.GET)
50
+    @ApiOperation(value="列表", notes = "列表", httpMethod = "GET", response = ResponseBean.class)
51
+    public ResponseBean sysRoleMenuList(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
52
+									 @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize) throws Exception{
53
+
54
+		    IPage<SysRoleMenu> pg = new Page<>(pageNum, pageSize);
55
+            QueryWrapper<SysRoleMenu> queryWrapper = new QueryWrapper<>();
56
+            queryWrapper.orderByDesc("create_date");
57
+
58
+            IPage<SysRoleMenu> result = iSysRoleMenuService.page(pg, queryWrapper);
59
+            return ResponseBean.success(result);
60
+    }
61
+
62
+    /**
63
+     * 保存对象
64
+     * @param sysRoleMenu 实体对象
65
+     * @return
66
+     */
67
+    @RequestMapping(value="/sysRoleMenu",method= RequestMethod.POST)
68
+    @ApiOperation(value="保存", notes = "保存", httpMethod = "POST", response = ResponseBean.class)
69
+    public ResponseBean sysRoleMenuAdd(@ApiParam("保存内容") @RequestBody SysRoleMenu sysRoleMenu) throws Exception{
70
+
71
+        if (iSysRoleMenuService.save(sysRoleMenu)){
72
+            return ResponseBean.success(sysRoleMenu);
73
+        }else {
74
+            return ResponseBean.error("保存失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
75
+        }
76
+    }
77
+
78
+    /**
79
+     * 根据id删除对象
80
+     * @param id  实体ID
81
+     */
82
+    @RequestMapping(value="/sysRoleMenu/{id}", method= RequestMethod.DELETE)
83
+    @ApiOperation(value="删除", notes = "删除", httpMethod = "DELETE", response = ResponseBean.class)
84
+    public ResponseBean sysRoleMenuDelete(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
85
+        if(iSysRoleMenuService.removeById(id)){
86
+            return ResponseBean.success("success");
87
+        }else {
88
+            return ResponseBean.error("删除失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
89
+        }
90
+    }
91
+
92
+    /**
93
+     * 修改对象
94
+     * @param id  实体ID
95
+     * @param sysRoleMenu 实体对象
96
+     * @return
97
+     */
98
+    @RequestMapping(value="/sysRoleMenu/{id}",method= RequestMethod.PUT)
99
+    @ApiOperation(value="更新", notes = "更新", httpMethod = "PUT", response = ResponseBean.class)
100
+    public ResponseBean sysRoleMenuUpdate(@ApiParam("对象ID") @PathVariable Integer id,
101
+                                        @ApiParam("更新内容") @RequestBody SysRoleMenu sysRoleMenu) throws Exception{
102
+
103
+        if (iSysRoleMenuService.updateById(sysRoleMenu)){
104
+            return ResponseBean.success(iSysRoleMenuService.getById(id));
105
+        }else {
106
+            return ResponseBean.error("修改失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
107
+        }
108
+    }
109
+
110
+    /**
111
+     * 根据id查询对象
112
+     * @param id  实体ID
113
+     */
114
+    @RequestMapping(value="/sysRoleMenu/{id}",method= RequestMethod.GET)
115
+    @ApiOperation(value="详情", notes = "详情", httpMethod = "GET", response = ResponseBean.class)
116
+    public ResponseBean sysRoleMenuGet(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
117
+        return ResponseBean.success(iSysRoleMenuService.getById(id));
118
+    }
119
+}

+ 155
- 0
src/main/java/com/yunzhi/demo/controller/SysUserController.java Zobrazit soubor

@@ -0,0 +1,155 @@
1
+package com.yunzhi.demo.controller;
2
+
3
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
+import com.baomidou.mybatisplus.core.metadata.IPage;
5
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
+import com.yunzhi.demo.common.BaseController;
7
+import com.yunzhi.demo.common.CurrentContext;
8
+import com.yunzhi.demo.common.ResponseBean;
9
+import com.yunzhi.demo.entity.SysMenu;
10
+import com.yunzhi.demo.entity.SysUserRole;
11
+import com.yunzhi.demo.service.ISysMenuService;
12
+import com.yunzhi.demo.service.ISysUserRoleService;
13
+import io.swagger.annotations.Api;
14
+import io.swagger.annotations.ApiOperation;
15
+import io.swagger.annotations.ApiParam;
16
+import org.slf4j.Logger;
17
+import org.slf4j.LoggerFactory;
18
+import org.springframework.beans.factory.annotation.Autowired;
19
+import org.springframework.web.bind.annotation.PathVariable;
20
+import org.springframework.web.bind.annotation.RequestBody;
21
+import org.springframework.web.bind.annotation.RequestMapping;
22
+import org.springframework.web.bind.annotation.RequestMethod;
23
+import org.springframework.web.bind.annotation.RequestParam;
24
+import com.yunzhi.demo.service.ISysUserService;
25
+import com.yunzhi.demo.entity.SysUser;
26
+import org.springframework.web.bind.annotation.RestController;
27
+
28
+import java.util.HashMap;
29
+import java.util.List;
30
+import java.util.Map;
31
+
32
+/**
33
+ * <p>
34
+    * 用户 前端控制器
35
+    * </p>
36
+ *
37
+ * @author yansen
38
+ * @since 2021-04-15
39
+ */
40
+
41
+@Api(tags = "用户")
42
+@RestController
43
+@RequestMapping("/")
44
+public class SysUserController extends BaseController {
45
+
46
+    private final Logger logger = LoggerFactory.getLogger(SysUserController.class);
47
+
48
+    @Autowired
49
+    public ISysUserService iSysUserService;
50
+
51
+    @Autowired
52
+    public ISysUserRoleService iSysUserRoleService;
53
+
54
+    @Autowired
55
+    public ISysMenuService iSysMenuService;
56
+
57
+
58
+    /**
59
+     * 分页查询列表
60
+     * @param pageNum
61
+     * @param pageSize
62
+     * @return
63
+     */
64
+    @RequestMapping(value="/sysUser",method= RequestMethod.GET)
65
+    @ApiOperation(value="列表", notes = "列表", httpMethod = "GET", response = ResponseBean.class)
66
+    public ResponseBean sysUserList(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
67
+									 @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize) throws Exception{
68
+
69
+		    IPage<SysUser> pg = new Page<>(pageNum, pageSize);
70
+            QueryWrapper<SysUser> queryWrapper = new QueryWrapper<>();
71
+            queryWrapper.orderByDesc("create_date");
72
+
73
+            IPage<SysUser> result = iSysUserService.page(pg, queryWrapper);
74
+            return ResponseBean.success(result);
75
+    }
76
+
77
+    /**
78
+     * 保存对象
79
+     * @param sysUser 实体对象
80
+     * @return
81
+     */
82
+    @RequestMapping(value="/sysUser",method= RequestMethod.POST)
83
+    @ApiOperation(value="保存", notes = "保存", httpMethod = "POST", response = ResponseBean.class)
84
+    public ResponseBean sysUserAdd(@ApiParam("保存内容") @RequestBody SysUser sysUser) throws Exception{
85
+
86
+        if (iSysUserService.save(sysUser)){
87
+            return ResponseBean.success(sysUser);
88
+        }else {
89
+            return ResponseBean.error("保存失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
90
+        }
91
+    }
92
+
93
+    /**
94
+     * 根据id删除对象
95
+     * @param id  实体ID
96
+     */
97
+    @RequestMapping(value="/sysUser/{id}", method= RequestMethod.DELETE)
98
+    @ApiOperation(value="删除", notes = "删除", httpMethod = "DELETE", response = ResponseBean.class)
99
+    public ResponseBean sysUserDelete(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
100
+        if(iSysUserService.removeById(id)){
101
+            return ResponseBean.success("success");
102
+        }else {
103
+            return ResponseBean.error("删除失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
104
+        }
105
+    }
106
+
107
+    /**
108
+     * 修改对象
109
+     * @param id  实体ID
110
+     * @param sysUser 实体对象
111
+     * @return
112
+     */
113
+    @RequestMapping(value="/sysUser/{id}",method= RequestMethod.PUT)
114
+    @ApiOperation(value="更新", notes = "更新", httpMethod = "PUT", response = ResponseBean.class)
115
+    public ResponseBean sysUserUpdate(@ApiParam("对象ID") @PathVariable Integer id,
116
+                                        @ApiParam("更新内容") @RequestBody SysUser sysUser) throws Exception{
117
+
118
+        if (iSysUserService.updateById(sysUser)){
119
+            return ResponseBean.success(iSysUserService.getById(id));
120
+        }else {
121
+            return ResponseBean.error("修改失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
122
+        }
123
+    }
124
+
125
+    /**
126
+     * 根据id查询对象
127
+     * @param id  实体ID
128
+     */
129
+    @RequestMapping(value="/sysUser/{id}",method= RequestMethod.GET)
130
+    @ApiOperation(value="详情", notes = "详情", httpMethod = "GET", response = ResponseBean.class)
131
+    public ResponseBean sysUserGet(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
132
+        return ResponseBean.success(iSysUserService.getById(id));
133
+    }
134
+
135
+
136
+    /**
137
+     * 当前用户
138
+     * @param id  实体ID
139
+     */
140
+    @RequestMapping(value="/admin/currentUser",method= RequestMethod.GET)
141
+    @ApiOperation(value="当前用户", notes = "详情", httpMethod = "GET", response = ResponseBean.class)
142
+    public ResponseBean currentUser() throws Exception{
143
+        SysUser sysUser = CurrentContext.getCurrentUser(iSysUserService);
144
+        List<SysMenu> sysMenuList = iSysMenuService.getListWithRoles();
145
+        List<SysUserRole> sysUserRoleList = iSysUserRoleService.getListByUser(sysUser.getUserId());
146
+
147
+        Map<String, Object> result = new HashMap<String, Object>() {{
148
+            put("user", sysUser);
149
+            put("menus", sysMenuList);
150
+            put("roles", sysUserRoleList);
151
+        }};
152
+
153
+        return ResponseBean.success(result);
154
+    }
155
+}

+ 119
- 0
src/main/java/com/yunzhi/demo/controller/SysUserRoleController.java Zobrazit soubor

@@ -0,0 +1,119 @@
1
+package com.yunzhi.demo.controller;
2
+
3
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
+import com.baomidou.mybatisplus.core.metadata.IPage;
5
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
+import com.yunzhi.demo.common.BaseController;
7
+import com.yunzhi.demo.common.ResponseBean;
8
+import io.swagger.annotations.Api;
9
+import io.swagger.annotations.ApiOperation;
10
+import io.swagger.annotations.ApiParam;
11
+import org.slf4j.Logger;
12
+import org.slf4j.LoggerFactory;
13
+import org.springframework.beans.factory.annotation.Autowired;
14
+import org.springframework.web.bind.annotation.PathVariable;
15
+import org.springframework.web.bind.annotation.RequestBody;
16
+import org.springframework.web.bind.annotation.RequestMapping;
17
+import org.springframework.web.bind.annotation.RequestMethod;
18
+import org.springframework.web.bind.annotation.RequestParam;
19
+import com.yunzhi.demo.service.ISysUserRoleService;
20
+import com.yunzhi.demo.entity.SysUserRole;
21
+import org.springframework.web.bind.annotation.RestController;
22
+
23
+/**
24
+ * <p>
25
+    * 用户角色 前端控制器
26
+    * </p>
27
+ *
28
+ * @author yansen
29
+ * @since 2021-04-15
30
+ */
31
+
32
+@Api(tags = "用户角色")
33
+@RestController
34
+@RequestMapping("/")
35
+public class SysUserRoleController extends BaseController {
36
+
37
+    private final Logger logger = LoggerFactory.getLogger(SysUserRoleController.class);
38
+
39
+    @Autowired
40
+    public ISysUserRoleService iSysUserRoleService;
41
+
42
+
43
+    /**
44
+     * 分页查询列表
45
+     * @param pageNum
46
+     * @param pageSize
47
+     * @return
48
+     */
49
+    @RequestMapping(value="/sysUserRole",method= RequestMethod.GET)
50
+    @ApiOperation(value="列表", notes = "列表", httpMethod = "GET", response = ResponseBean.class)
51
+    public ResponseBean sysUserRoleList(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
52
+									 @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize) throws Exception{
53
+
54
+		    IPage<SysUserRole> pg = new Page<>(pageNum, pageSize);
55
+            QueryWrapper<SysUserRole> queryWrapper = new QueryWrapper<>();
56
+            queryWrapper.orderByDesc("create_date");
57
+
58
+            IPage<SysUserRole> result = iSysUserRoleService.page(pg, queryWrapper);
59
+            return ResponseBean.success(result);
60
+    }
61
+
62
+    /**
63
+     * 保存对象
64
+     * @param sysUserRole 实体对象
65
+     * @return
66
+     */
67
+    @RequestMapping(value="/sysUserRole",method= RequestMethod.POST)
68
+    @ApiOperation(value="保存", notes = "保存", httpMethod = "POST", response = ResponseBean.class)
69
+    public ResponseBean sysUserRoleAdd(@ApiParam("保存内容") @RequestBody SysUserRole sysUserRole) throws Exception{
70
+
71
+        if (iSysUserRoleService.save(sysUserRole)){
72
+            return ResponseBean.success(sysUserRole);
73
+        }else {
74
+            return ResponseBean.error("保存失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
75
+        }
76
+    }
77
+
78
+    /**
79
+     * 根据id删除对象
80
+     * @param id  实体ID
81
+     */
82
+    @RequestMapping(value="/sysUserRole/{id}", method= RequestMethod.DELETE)
83
+    @ApiOperation(value="删除", notes = "删除", httpMethod = "DELETE", response = ResponseBean.class)
84
+    public ResponseBean sysUserRoleDelete(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
85
+        if(iSysUserRoleService.removeById(id)){
86
+            return ResponseBean.success("success");
87
+        }else {
88
+            return ResponseBean.error("删除失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
89
+        }
90
+    }
91
+
92
+    /**
93
+     * 修改对象
94
+     * @param id  实体ID
95
+     * @param sysUserRole 实体对象
96
+     * @return
97
+     */
98
+    @RequestMapping(value="/sysUserRole/{id}",method= RequestMethod.PUT)
99
+    @ApiOperation(value="更新", notes = "更新", httpMethod = "PUT", response = ResponseBean.class)
100
+    public ResponseBean sysUserRoleUpdate(@ApiParam("对象ID") @PathVariable Integer id,
101
+                                        @ApiParam("更新内容") @RequestBody SysUserRole sysUserRole) throws Exception{
102
+
103
+        if (iSysUserRoleService.updateById(sysUserRole)){
104
+            return ResponseBean.success(iSysUserRoleService.getById(id));
105
+        }else {
106
+            return ResponseBean.error("修改失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
107
+        }
108
+    }
109
+
110
+    /**
111
+     * 根据id查询对象
112
+     * @param id  实体ID
113
+     */
114
+    @RequestMapping(value="/sysUserRole/{id}",method= RequestMethod.GET)
115
+    @ApiOperation(value="详情", notes = "详情", httpMethod = "GET", response = ResponseBean.class)
116
+    public ResponseBean sysUserRoleGet(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
117
+        return ResponseBean.success(iSysUserRoleService.getById(id));
118
+    }
119
+}

+ 119
- 0
src/main/java/com/yunzhi/demo/controller/TaMedicalLogController.java Zobrazit soubor

@@ -0,0 +1,119 @@
1
+package com.yunzhi.demo.controller;
2
+
3
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
+import com.baomidou.mybatisplus.core.metadata.IPage;
5
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
+import com.yunzhi.demo.common.BaseController;
7
+import com.yunzhi.demo.common.ResponseBean;
8
+import io.swagger.annotations.Api;
9
+import io.swagger.annotations.ApiOperation;
10
+import io.swagger.annotations.ApiParam;
11
+import org.slf4j.Logger;
12
+import org.slf4j.LoggerFactory;
13
+import org.springframework.beans.factory.annotation.Autowired;
14
+import org.springframework.web.bind.annotation.PathVariable;
15
+import org.springframework.web.bind.annotation.RequestBody;
16
+import org.springframework.web.bind.annotation.RequestMapping;
17
+import org.springframework.web.bind.annotation.RequestMethod;
18
+import org.springframework.web.bind.annotation.RequestParam;
19
+import com.yunzhi.demo.service.ITaMedicalLogService;
20
+import com.yunzhi.demo.entity.TaMedicalLog;
21
+import org.springframework.web.bind.annotation.RestController;
22
+
23
+/**
24
+ * <p>
25
+    * 就诊记录 前端控制器
26
+    * </p>
27
+ *
28
+ * @author yansen
29
+ * @since 2021-04-15
30
+ */
31
+
32
+@Api(tags = "就诊记录")
33
+@RestController
34
+@RequestMapping("/")
35
+public class TaMedicalLogController extends BaseController {
36
+
37
+    private final Logger logger = LoggerFactory.getLogger(TaMedicalLogController.class);
38
+
39
+    @Autowired
40
+    public ITaMedicalLogService iTaMedicalLogService;
41
+
42
+
43
+    /**
44
+     * 分页查询列表
45
+     * @param pageNum
46
+     * @param pageSize
47
+     * @return
48
+     */
49
+    @RequestMapping(value="/taMedicalLog",method= RequestMethod.GET)
50
+    @ApiOperation(value="列表", notes = "列表", httpMethod = "GET", response = ResponseBean.class)
51
+    public ResponseBean taMedicalLogList(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
52
+									 @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize) throws Exception{
53
+
54
+		    IPage<TaMedicalLog> pg = new Page<>(pageNum, pageSize);
55
+            QueryWrapper<TaMedicalLog> queryWrapper = new QueryWrapper<>();
56
+            queryWrapper.orderByDesc("create_date");
57
+
58
+            IPage<TaMedicalLog> result = iTaMedicalLogService.page(pg, queryWrapper);
59
+            return ResponseBean.success(result);
60
+    }
61
+
62
+    /**
63
+     * 保存对象
64
+     * @param taMedicalLog 实体对象
65
+     * @return
66
+     */
67
+    @RequestMapping(value="/taMedicalLog",method= RequestMethod.POST)
68
+    @ApiOperation(value="保存", notes = "保存", httpMethod = "POST", response = ResponseBean.class)
69
+    public ResponseBean taMedicalLogAdd(@ApiParam("保存内容") @RequestBody TaMedicalLog taMedicalLog) throws Exception{
70
+
71
+        if (iTaMedicalLogService.save(taMedicalLog)){
72
+            return ResponseBean.success(taMedicalLog);
73
+        }else {
74
+            return ResponseBean.error("保存失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
75
+        }
76
+    }
77
+
78
+    /**
79
+     * 根据id删除对象
80
+     * @param id  实体ID
81
+     */
82
+    @RequestMapping(value="/taMedicalLog/{id}", method= RequestMethod.DELETE)
83
+    @ApiOperation(value="删除", notes = "删除", httpMethod = "DELETE", response = ResponseBean.class)
84
+    public ResponseBean taMedicalLogDelete(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
85
+        if(iTaMedicalLogService.removeById(id)){
86
+            return ResponseBean.success("success");
87
+        }else {
88
+            return ResponseBean.error("删除失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
89
+        }
90
+    }
91
+
92
+    /**
93
+     * 修改对象
94
+     * @param id  实体ID
95
+     * @param taMedicalLog 实体对象
96
+     * @return
97
+     */
98
+    @RequestMapping(value="/taMedicalLog/{id}",method= RequestMethod.PUT)
99
+    @ApiOperation(value="更新", notes = "更新", httpMethod = "PUT", response = ResponseBean.class)
100
+    public ResponseBean taMedicalLogUpdate(@ApiParam("对象ID") @PathVariable Integer id,
101
+                                        @ApiParam("更新内容") @RequestBody TaMedicalLog taMedicalLog) throws Exception{
102
+
103
+        if (iTaMedicalLogService.updateById(taMedicalLog)){
104
+            return ResponseBean.success(iTaMedicalLogService.getById(id));
105
+        }else {
106
+            return ResponseBean.error("修改失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
107
+        }
108
+    }
109
+
110
+    /**
111
+     * 根据id查询对象
112
+     * @param id  实体ID
113
+     */
114
+    @RequestMapping(value="/taMedicalLog/{id}",method= RequestMethod.GET)
115
+    @ApiOperation(value="详情", notes = "详情", httpMethod = "GET", response = ResponseBean.class)
116
+    public ResponseBean taMedicalLogGet(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
117
+        return ResponseBean.success(iTaMedicalLogService.getById(id));
118
+    }
119
+}

+ 119
- 0
src/main/java/com/yunzhi/demo/controller/TaPersonController.java Zobrazit soubor

@@ -0,0 +1,119 @@
1
+package com.yunzhi.demo.controller;
2
+
3
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
+import com.baomidou.mybatisplus.core.metadata.IPage;
5
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
+import com.yunzhi.demo.common.BaseController;
7
+import com.yunzhi.demo.common.ResponseBean;
8
+import io.swagger.annotations.Api;
9
+import io.swagger.annotations.ApiOperation;
10
+import io.swagger.annotations.ApiParam;
11
+import org.slf4j.Logger;
12
+import org.slf4j.LoggerFactory;
13
+import org.springframework.beans.factory.annotation.Autowired;
14
+import org.springframework.web.bind.annotation.PathVariable;
15
+import org.springframework.web.bind.annotation.RequestBody;
16
+import org.springframework.web.bind.annotation.RequestMapping;
17
+import org.springframework.web.bind.annotation.RequestMethod;
18
+import org.springframework.web.bind.annotation.RequestParam;
19
+import com.yunzhi.demo.service.ITaPersonService;
20
+import com.yunzhi.demo.entity.TaPerson;
21
+import org.springframework.web.bind.annotation.RestController;
22
+
23
+/**
24
+ * <p>
25
+    * 人员 前端控制器
26
+    * </p>
27
+ *
28
+ * @author yansen
29
+ * @since 2021-04-15
30
+ */
31
+
32
+@Api(tags = "人员")
33
+@RestController
34
+@RequestMapping("/")
35
+public class TaPersonController extends BaseController {
36
+
37
+    private final Logger logger = LoggerFactory.getLogger(TaPersonController.class);
38
+
39
+    @Autowired
40
+    public ITaPersonService iTaPersonService;
41
+
42
+
43
+    /**
44
+     * 分页查询列表
45
+     * @param pageNum
46
+     * @param pageSize
47
+     * @return
48
+     */
49
+    @RequestMapping(value="/taPerson",method= RequestMethod.GET)
50
+    @ApiOperation(value="列表", notes = "列表", httpMethod = "GET", response = ResponseBean.class)
51
+    public ResponseBean taPersonList(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
52
+									 @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize) throws Exception{
53
+
54
+		    IPage<TaPerson> pg = new Page<>(pageNum, pageSize);
55
+            QueryWrapper<TaPerson> queryWrapper = new QueryWrapper<>();
56
+            queryWrapper.orderByDesc("create_date");
57
+
58
+            IPage<TaPerson> result = iTaPersonService.page(pg, queryWrapper);
59
+            return ResponseBean.success(result);
60
+    }
61
+
62
+    /**
63
+     * 保存对象
64
+     * @param taPerson 实体对象
65
+     * @return
66
+     */
67
+    @RequestMapping(value="/taPerson",method= RequestMethod.POST)
68
+    @ApiOperation(value="保存", notes = "保存", httpMethod = "POST", response = ResponseBean.class)
69
+    public ResponseBean taPersonAdd(@ApiParam("保存内容") @RequestBody TaPerson taPerson) throws Exception{
70
+
71
+        if (iTaPersonService.save(taPerson)){
72
+            return ResponseBean.success(taPerson);
73
+        }else {
74
+            return ResponseBean.error("保存失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
75
+        }
76
+    }
77
+
78
+    /**
79
+     * 根据id删除对象
80
+     * @param id  实体ID
81
+     */
82
+    @RequestMapping(value="/taPerson/{id}", method= RequestMethod.DELETE)
83
+    @ApiOperation(value="删除", notes = "删除", httpMethod = "DELETE", response = ResponseBean.class)
84
+    public ResponseBean taPersonDelete(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
85
+        if(iTaPersonService.removeById(id)){
86
+            return ResponseBean.success("success");
87
+        }else {
88
+            return ResponseBean.error("删除失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
89
+        }
90
+    }
91
+
92
+    /**
93
+     * 修改对象
94
+     * @param id  实体ID
95
+     * @param taPerson 实体对象
96
+     * @return
97
+     */
98
+    @RequestMapping(value="/taPerson/{id}",method= RequestMethod.PUT)
99
+    @ApiOperation(value="更新", notes = "更新", httpMethod = "PUT", response = ResponseBean.class)
100
+    public ResponseBean taPersonUpdate(@ApiParam("对象ID") @PathVariable Integer id,
101
+                                        @ApiParam("更新内容") @RequestBody TaPerson taPerson) throws Exception{
102
+
103
+        if (iTaPersonService.updateById(taPerson)){
104
+            return ResponseBean.success(iTaPersonService.getById(id));
105
+        }else {
106
+            return ResponseBean.error("修改失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
107
+        }
108
+    }
109
+
110
+    /**
111
+     * 根据id查询对象
112
+     * @param id  实体ID
113
+     */
114
+    @RequestMapping(value="/taPerson/{id}",method= RequestMethod.GET)
115
+    @ApiOperation(value="详情", notes = "详情", httpMethod = "GET", response = ResponseBean.class)
116
+    public ResponseBean taPersonGet(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
117
+        return ResponseBean.success(iTaPersonService.getById(id));
118
+    }
119
+}

+ 119
- 0
src/main/java/com/yunzhi/demo/controller/TaPersonDataController.java Zobrazit soubor

@@ -0,0 +1,119 @@
1
+package com.yunzhi.demo.controller;
2
+
3
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
+import com.baomidou.mybatisplus.core.metadata.IPage;
5
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
+import com.yunzhi.demo.common.BaseController;
7
+import com.yunzhi.demo.common.ResponseBean;
8
+import io.swagger.annotations.Api;
9
+import io.swagger.annotations.ApiOperation;
10
+import io.swagger.annotations.ApiParam;
11
+import org.slf4j.Logger;
12
+import org.slf4j.LoggerFactory;
13
+import org.springframework.beans.factory.annotation.Autowired;
14
+import org.springframework.web.bind.annotation.PathVariable;
15
+import org.springframework.web.bind.annotation.RequestBody;
16
+import org.springframework.web.bind.annotation.RequestMapping;
17
+import org.springframework.web.bind.annotation.RequestMethod;
18
+import org.springframework.web.bind.annotation.RequestParam;
19
+import com.yunzhi.demo.service.ITaPersonDataService;
20
+import com.yunzhi.demo.entity.TaPersonData;
21
+import org.springframework.web.bind.annotation.RestController;
22
+
23
+/**
24
+ * <p>
25
+    * 人员统计 前端控制器
26
+    * </p>
27
+ *
28
+ * @author yansen
29
+ * @since 2021-04-15
30
+ */
31
+
32
+@Api(tags = "人员统计")
33
+@RestController
34
+@RequestMapping("/")
35
+public class TaPersonDataController extends BaseController {
36
+
37
+    private final Logger logger = LoggerFactory.getLogger(TaPersonDataController.class);
38
+
39
+    @Autowired
40
+    public ITaPersonDataService iTaPersonDataService;
41
+
42
+
43
+    /**
44
+     * 分页查询列表
45
+     * @param pageNum
46
+     * @param pageSize
47
+     * @return
48
+     */
49
+    @RequestMapping(value="/taPersonData",method= RequestMethod.GET)
50
+    @ApiOperation(value="列表", notes = "列表", httpMethod = "GET", response = ResponseBean.class)
51
+    public ResponseBean taPersonDataList(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
52
+									 @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize) throws Exception{
53
+
54
+		    IPage<TaPersonData> pg = new Page<>(pageNum, pageSize);
55
+            QueryWrapper<TaPersonData> queryWrapper = new QueryWrapper<>();
56
+            queryWrapper.orderByDesc("create_date");
57
+
58
+            IPage<TaPersonData> result = iTaPersonDataService.page(pg, queryWrapper);
59
+            return ResponseBean.success(result);
60
+    }
61
+
62
+    /**
63
+     * 保存对象
64
+     * @param taPersonData 实体对象
65
+     * @return
66
+     */
67
+    @RequestMapping(value="/taPersonData",method= RequestMethod.POST)
68
+    @ApiOperation(value="保存", notes = "保存", httpMethod = "POST", response = ResponseBean.class)
69
+    public ResponseBean taPersonDataAdd(@ApiParam("保存内容") @RequestBody TaPersonData taPersonData) throws Exception{
70
+
71
+        if (iTaPersonDataService.save(taPersonData)){
72
+            return ResponseBean.success(taPersonData);
73
+        }else {
74
+            return ResponseBean.error("保存失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
75
+        }
76
+    }
77
+
78
+    /**
79
+     * 根据id删除对象
80
+     * @param id  实体ID
81
+     */
82
+    @RequestMapping(value="/taPersonData/{id}", method= RequestMethod.DELETE)
83
+    @ApiOperation(value="删除", notes = "删除", httpMethod = "DELETE", response = ResponseBean.class)
84
+    public ResponseBean taPersonDataDelete(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
85
+        if(iTaPersonDataService.removeById(id)){
86
+            return ResponseBean.success("success");
87
+        }else {
88
+            return ResponseBean.error("删除失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
89
+        }
90
+    }
91
+
92
+    /**
93
+     * 修改对象
94
+     * @param id  实体ID
95
+     * @param taPersonData 实体对象
96
+     * @return
97
+     */
98
+    @RequestMapping(value="/taPersonData/{id}",method= RequestMethod.PUT)
99
+    @ApiOperation(value="更新", notes = "更新", httpMethod = "PUT", response = ResponseBean.class)
100
+    public ResponseBean taPersonDataUpdate(@ApiParam("对象ID") @PathVariable Integer id,
101
+                                        @ApiParam("更新内容") @RequestBody TaPersonData taPersonData) throws Exception{
102
+
103
+        if (iTaPersonDataService.updateById(taPersonData)){
104
+            return ResponseBean.success(iTaPersonDataService.getById(id));
105
+        }else {
106
+            return ResponseBean.error("修改失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
107
+        }
108
+    }
109
+
110
+    /**
111
+     * 根据id查询对象
112
+     * @param id  实体ID
113
+     */
114
+    @RequestMapping(value="/taPersonData/{id}",method= RequestMethod.GET)
115
+    @ApiOperation(value="详情", notes = "详情", httpMethod = "GET", response = ResponseBean.class)
116
+    public ResponseBean taPersonDataGet(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
117
+        return ResponseBean.success(iTaPersonDataService.getById(id));
118
+    }
119
+}

+ 119
- 0
src/main/java/com/yunzhi/demo/controller/TaPointsLogController.java Zobrazit soubor

@@ -0,0 +1,119 @@
1
+package com.yunzhi.demo.controller;
2
+
3
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
+import com.baomidou.mybatisplus.core.metadata.IPage;
5
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
+import com.yunzhi.demo.common.BaseController;
7
+import com.yunzhi.demo.common.ResponseBean;
8
+import io.swagger.annotations.Api;
9
+import io.swagger.annotations.ApiOperation;
10
+import io.swagger.annotations.ApiParam;
11
+import org.slf4j.Logger;
12
+import org.slf4j.LoggerFactory;
13
+import org.springframework.beans.factory.annotation.Autowired;
14
+import org.springframework.web.bind.annotation.PathVariable;
15
+import org.springframework.web.bind.annotation.RequestBody;
16
+import org.springframework.web.bind.annotation.RequestMapping;
17
+import org.springframework.web.bind.annotation.RequestMethod;
18
+import org.springframework.web.bind.annotation.RequestParam;
19
+import com.yunzhi.demo.service.ITaPointsLogService;
20
+import com.yunzhi.demo.entity.TaPointsLog;
21
+import org.springframework.web.bind.annotation.RestController;
22
+
23
+/**
24
+ * <p>
25
+    * 积分历史 前端控制器
26
+    * </p>
27
+ *
28
+ * @author yansen
29
+ * @since 2021-04-15
30
+ */
31
+
32
+@Api(tags = "积分历史")
33
+@RestController
34
+@RequestMapping("/")
35
+public class TaPointsLogController extends BaseController {
36
+
37
+    private final Logger logger = LoggerFactory.getLogger(TaPointsLogController.class);
38
+
39
+    @Autowired
40
+    public ITaPointsLogService iTaPointsLogService;
41
+
42
+
43
+    /**
44
+     * 分页查询列表
45
+     * @param pageNum
46
+     * @param pageSize
47
+     * @return
48
+     */
49
+    @RequestMapping(value="/taPointsLog",method= RequestMethod.GET)
50
+    @ApiOperation(value="列表", notes = "列表", httpMethod = "GET", response = ResponseBean.class)
51
+    public ResponseBean taPointsLogList(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
52
+									 @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize) throws Exception{
53
+
54
+		    IPage<TaPointsLog> pg = new Page<>(pageNum, pageSize);
55
+            QueryWrapper<TaPointsLog> queryWrapper = new QueryWrapper<>();
56
+            queryWrapper.orderByDesc("create_date");
57
+
58
+            IPage<TaPointsLog> result = iTaPointsLogService.page(pg, queryWrapper);
59
+            return ResponseBean.success(result);
60
+    }
61
+
62
+    /**
63
+     * 保存对象
64
+     * @param taPointsLog 实体对象
65
+     * @return
66
+     */
67
+    @RequestMapping(value="/taPointsLog",method= RequestMethod.POST)
68
+    @ApiOperation(value="保存", notes = "保存", httpMethod = "POST", response = ResponseBean.class)
69
+    public ResponseBean taPointsLogAdd(@ApiParam("保存内容") @RequestBody TaPointsLog taPointsLog) throws Exception{
70
+
71
+        if (iTaPointsLogService.save(taPointsLog)){
72
+            return ResponseBean.success(taPointsLog);
73
+        }else {
74
+            return ResponseBean.error("保存失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
75
+        }
76
+    }
77
+
78
+    /**
79
+     * 根据id删除对象
80
+     * @param id  实体ID
81
+     */
82
+    @RequestMapping(value="/taPointsLog/{id}", method= RequestMethod.DELETE)
83
+    @ApiOperation(value="删除", notes = "删除", httpMethod = "DELETE", response = ResponseBean.class)
84
+    public ResponseBean taPointsLogDelete(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
85
+        if(iTaPointsLogService.removeById(id)){
86
+            return ResponseBean.success("success");
87
+        }else {
88
+            return ResponseBean.error("删除失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
89
+        }
90
+    }
91
+
92
+    /**
93
+     * 修改对象
94
+     * @param id  实体ID
95
+     * @param taPointsLog 实体对象
96
+     * @return
97
+     */
98
+    @RequestMapping(value="/taPointsLog/{id}",method= RequestMethod.PUT)
99
+    @ApiOperation(value="更新", notes = "更新", httpMethod = "PUT", response = ResponseBean.class)
100
+    public ResponseBean taPointsLogUpdate(@ApiParam("对象ID") @PathVariable Integer id,
101
+                                        @ApiParam("更新内容") @RequestBody TaPointsLog taPointsLog) throws Exception{
102
+
103
+        if (iTaPointsLogService.updateById(taPointsLog)){
104
+            return ResponseBean.success(iTaPointsLogService.getById(id));
105
+        }else {
106
+            return ResponseBean.error("修改失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
107
+        }
108
+    }
109
+
110
+    /**
111
+     * 根据id查询对象
112
+     * @param id  实体ID
113
+     */
114
+    @RequestMapping(value="/taPointsLog/{id}",method= RequestMethod.GET)
115
+    @ApiOperation(value="详情", notes = "详情", httpMethod = "GET", response = ResponseBean.class)
116
+    public ResponseBean taPointsLogGet(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
117
+        return ResponseBean.success(iTaPointsLogService.getById(id));
118
+    }
119
+}

+ 144
- 0
src/main/java/com/yunzhi/demo/controller/TaPostController.java Zobrazit soubor

@@ -0,0 +1,144 @@
1
+package com.yunzhi.demo.controller;
2
+
3
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
+import com.baomidou.mybatisplus.core.metadata.IPage;
5
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
+import com.yunzhi.demo.common.BaseController;
7
+import com.yunzhi.demo.common.Constants;
8
+import com.yunzhi.demo.common.ResponseBean;
9
+import com.yunzhi.demo.common.StringUtils;
10
+import com.yunzhi.demo.entity.TdPostType;
11
+import com.yunzhi.demo.service.ITdPostTypeService;
12
+import io.swagger.annotations.Api;
13
+import io.swagger.annotations.ApiOperation;
14
+import io.swagger.annotations.ApiParam;
15
+import org.slf4j.Logger;
16
+import org.slf4j.LoggerFactory;
17
+import org.springframework.beans.factory.annotation.Autowired;
18
+import org.springframework.web.bind.annotation.PathVariable;
19
+import org.springframework.web.bind.annotation.RequestBody;
20
+import org.springframework.web.bind.annotation.RequestMapping;
21
+import org.springframework.web.bind.annotation.RequestMethod;
22
+import org.springframework.web.bind.annotation.RequestParam;
23
+import com.yunzhi.demo.service.ITaPostService;
24
+import com.yunzhi.demo.entity.TaPost;
25
+import org.springframework.web.bind.annotation.RestController;
26
+
27
+/**
28
+ * <p>
29
+    * 文章表 前端控制器
30
+    * </p>
31
+ *
32
+ * @author yansen
33
+ * @since 2021-04-15
34
+ */
35
+
36
+@Api(tags = "文章表")
37
+@RestController
38
+@RequestMapping("/")
39
+public class TaPostController extends BaseController {
40
+
41
+    private final Logger logger = LoggerFactory.getLogger(TaPostController.class);
42
+
43
+    @Autowired
44
+    public ITaPostService iTaPostService;
45
+
46
+    @Autowired
47
+    public ITdPostTypeService iTdPostTypeService;
48
+
49
+
50
+    /**
51
+     * 分页查询列表
52
+     * @param pageNum
53
+     * @param pageSize
54
+     * @return
55
+     */
56
+    @RequestMapping(value="/admin/post",method= RequestMethod.GET)
57
+    @ApiOperation(value="列表", notes = "列表", httpMethod = "GET", response = ResponseBean.class)
58
+    public ResponseBean taPostList(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
59
+                                   @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
60
+                                   @ApiParam("名称") @RequestParam(value = "name", required = false) String name,
61
+                                   @ApiParam("分类") @RequestParam(value = "typeId", required = false) String typeId,
62
+                                   @ApiParam("状态") @RequestParam(value = "status", required = false) Integer status) throws Exception{
63
+
64
+		    IPage<TaPost> pg = new Page<>(pageNum, pageSize);
65
+            QueryWrapper<TaPost> queryWrapper = new QueryWrapper<TaPost>()
66
+                    .like(!StringUtils.isEmpty(name), "name", name)
67
+                    .eq(!StringUtils.isEmpty(typeId), "type_id", typeId)
68
+                    .eq(null != status, "status", status)
69
+                    .gt("status", Constants.STATUS_DELETED)
70
+                    .orderByDesc("weight")
71
+                    .orderByDesc("create_date");
72
+
73
+            IPage<TaPost> result = iTaPostService.page(pg, queryWrapper);
74
+            return ResponseBean.success(result);
75
+    }
76
+
77
+    /**
78
+     * 保存对象
79
+     * @param taPost 实体对象
80
+     * @return
81
+     */
82
+    @RequestMapping(value="/admin/post",method= RequestMethod.POST)
83
+    @ApiOperation(value="保存", notes = "保存", httpMethod = "POST", response = ResponseBean.class)
84
+    public ResponseBean taPostAdd(@ApiParam("保存内容") @RequestBody TaPost taPost) throws Exception{
85
+
86
+        TdPostType postType = iTdPostTypeService.getById(taPost.getTypeId());
87
+        if (null != postType) {
88
+            taPost.setTypeName(postType.getName());
89
+        }
90
+
91
+        if (iTaPostService.save(taPost)){
92
+            return ResponseBean.success(iTaPostService.getById(taPost.getPostId()));
93
+        }else {
94
+            return ResponseBean.error("保存失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
95
+        }
96
+    }
97
+
98
+    /**
99
+     * 根据id删除对象
100
+     * @param id  实体ID
101
+     */
102
+    @RequestMapping(value="/admin/post/{id}", method= RequestMethod.DELETE)
103
+    @ApiOperation(value="删除", notes = "删除", httpMethod = "DELETE", response = ResponseBean.class)
104
+    public ResponseBean taPostDelete(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
105
+        if(iTaPostService.removeById(id)){
106
+            return ResponseBean.success("success");
107
+        }else {
108
+            return ResponseBean.error("删除失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
109
+        }
110
+    }
111
+
112
+    /**
113
+     * 修改对象
114
+     * @param id  实体ID
115
+     * @param taPost 实体对象
116
+     * @return
117
+     */
118
+    @RequestMapping(value="/admin/post/{id}",method= RequestMethod.PUT)
119
+    @ApiOperation(value="更新", notes = "更新", httpMethod = "PUT", response = ResponseBean.class)
120
+    public ResponseBean taPostUpdate(@ApiParam("对象ID") @PathVariable Integer id,
121
+                                        @ApiParam("更新内容") @RequestBody TaPost taPost) throws Exception{
122
+
123
+        TdPostType postType = iTdPostTypeService.getById(taPost.getTypeId());
124
+        if (null != postType) {
125
+            taPost.setTypeName(postType.getName());
126
+        }
127
+
128
+        if (iTaPostService.updateById(taPost)){
129
+            return ResponseBean.success(iTaPostService.getById(id));
130
+        }else {
131
+            return ResponseBean.error("修改失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
132
+        }
133
+    }
134
+
135
+    /**
136
+     * 根据id查询对象
137
+     * @param id  实体ID
138
+     */
139
+    @RequestMapping(value="/admin/post/{id}",method= RequestMethod.GET)
140
+    @ApiOperation(value="详情", notes = "详情", httpMethod = "GET", response = ResponseBean.class)
141
+    public ResponseBean taPostGet(@ApiParam("对象ID") @PathVariable String id) throws Exception{
142
+        return ResponseBean.success(iTaPostService.getById(id));
143
+    }
144
+}

+ 119
- 0
src/main/java/com/yunzhi/demo/controller/TaPostDataController.java Zobrazit soubor

@@ -0,0 +1,119 @@
1
+package com.yunzhi.demo.controller;
2
+
3
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
+import com.baomidou.mybatisplus.core.metadata.IPage;
5
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
+import com.yunzhi.demo.common.BaseController;
7
+import com.yunzhi.demo.common.ResponseBean;
8
+import io.swagger.annotations.Api;
9
+import io.swagger.annotations.ApiOperation;
10
+import io.swagger.annotations.ApiParam;
11
+import org.slf4j.Logger;
12
+import org.slf4j.LoggerFactory;
13
+import org.springframework.beans.factory.annotation.Autowired;
14
+import org.springframework.web.bind.annotation.PathVariable;
15
+import org.springframework.web.bind.annotation.RequestBody;
16
+import org.springframework.web.bind.annotation.RequestMapping;
17
+import org.springframework.web.bind.annotation.RequestMethod;
18
+import org.springframework.web.bind.annotation.RequestParam;
19
+import com.yunzhi.demo.service.ITaPostDataService;
20
+import com.yunzhi.demo.entity.TaPostData;
21
+import org.springframework.web.bind.annotation.RestController;
22
+
23
+/**
24
+ * <p>
25
+    * 文章统计 前端控制器
26
+    * </p>
27
+ *
28
+ * @author yansen
29
+ * @since 2021-04-15
30
+ */
31
+
32
+@Api(tags = "文章统计")
33
+@RestController
34
+@RequestMapping("/")
35
+public class TaPostDataController extends BaseController {
36
+
37
+    private final Logger logger = LoggerFactory.getLogger(TaPostDataController.class);
38
+
39
+    @Autowired
40
+    public ITaPostDataService iTaPostDataService;
41
+
42
+
43
+    /**
44
+     * 分页查询列表
45
+     * @param pageNum
46
+     * @param pageSize
47
+     * @return
48
+     */
49
+    @RequestMapping(value="/taPostData",method= RequestMethod.GET)
50
+    @ApiOperation(value="列表", notes = "列表", httpMethod = "GET", response = ResponseBean.class)
51
+    public ResponseBean taPostDataList(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
52
+									 @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize) throws Exception{
53
+
54
+		    IPage<TaPostData> pg = new Page<>(pageNum, pageSize);
55
+            QueryWrapper<TaPostData> queryWrapper = new QueryWrapper<>();
56
+            queryWrapper.orderByDesc("create_date");
57
+
58
+            IPage<TaPostData> result = iTaPostDataService.page(pg, queryWrapper);
59
+            return ResponseBean.success(result);
60
+    }
61
+
62
+    /**
63
+     * 保存对象
64
+     * @param taPostData 实体对象
65
+     * @return
66
+     */
67
+    @RequestMapping(value="/taPostData",method= RequestMethod.POST)
68
+    @ApiOperation(value="保存", notes = "保存", httpMethod = "POST", response = ResponseBean.class)
69
+    public ResponseBean taPostDataAdd(@ApiParam("保存内容") @RequestBody TaPostData taPostData) throws Exception{
70
+
71
+        if (iTaPostDataService.save(taPostData)){
72
+            return ResponseBean.success(taPostData);
73
+        }else {
74
+            return ResponseBean.error("保存失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
75
+        }
76
+    }
77
+
78
+    /**
79
+     * 根据id删除对象
80
+     * @param id  实体ID
81
+     */
82
+    @RequestMapping(value="/taPostData/{id}", method= RequestMethod.DELETE)
83
+    @ApiOperation(value="删除", notes = "删除", httpMethod = "DELETE", response = ResponseBean.class)
84
+    public ResponseBean taPostDataDelete(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
85
+        if(iTaPostDataService.removeById(id)){
86
+            return ResponseBean.success("success");
87
+        }else {
88
+            return ResponseBean.error("删除失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
89
+        }
90
+    }
91
+
92
+    /**
93
+     * 修改对象
94
+     * @param id  实体ID
95
+     * @param taPostData 实体对象
96
+     * @return
97
+     */
98
+    @RequestMapping(value="/taPostData/{id}",method= RequestMethod.PUT)
99
+    @ApiOperation(value="更新", notes = "更新", httpMethod = "PUT", response = ResponseBean.class)
100
+    public ResponseBean taPostDataUpdate(@ApiParam("对象ID") @PathVariable Integer id,
101
+                                        @ApiParam("更新内容") @RequestBody TaPostData taPostData) throws Exception{
102
+
103
+        if (iTaPostDataService.updateById(taPostData)){
104
+            return ResponseBean.success(iTaPostDataService.getById(id));
105
+        }else {
106
+            return ResponseBean.error("修改失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
107
+        }
108
+    }
109
+
110
+    /**
111
+     * 根据id查询对象
112
+     * @param id  实体ID
113
+     */
114
+    @RequestMapping(value="/taPostData/{id}",method= RequestMethod.GET)
115
+    @ApiOperation(value="详情", notes = "详情", httpMethod = "GET", response = ResponseBean.class)
116
+    public ResponseBean taPostDataGet(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
117
+        return ResponseBean.success(iTaPostDataService.getById(id));
118
+    }
119
+}

+ 119
- 0
src/main/java/com/yunzhi/demo/controller/TaPostSaveController.java Zobrazit soubor

@@ -0,0 +1,119 @@
1
+package com.yunzhi.demo.controller;
2
+
3
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
+import com.baomidou.mybatisplus.core.metadata.IPage;
5
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
+import com.yunzhi.demo.common.BaseController;
7
+import com.yunzhi.demo.common.ResponseBean;
8
+import io.swagger.annotations.Api;
9
+import io.swagger.annotations.ApiOperation;
10
+import io.swagger.annotations.ApiParam;
11
+import org.slf4j.Logger;
12
+import org.slf4j.LoggerFactory;
13
+import org.springframework.beans.factory.annotation.Autowired;
14
+import org.springframework.web.bind.annotation.PathVariable;
15
+import org.springframework.web.bind.annotation.RequestBody;
16
+import org.springframework.web.bind.annotation.RequestMapping;
17
+import org.springframework.web.bind.annotation.RequestMethod;
18
+import org.springframework.web.bind.annotation.RequestParam;
19
+import com.yunzhi.demo.service.ITaPostSaveService;
20
+import com.yunzhi.demo.entity.TaPostSave;
21
+import org.springframework.web.bind.annotation.RestController;
22
+
23
+/**
24
+ * <p>
25
+    * 收藏 前端控制器
26
+    * </p>
27
+ *
28
+ * @author yansen
29
+ * @since 2021-04-15
30
+ */
31
+
32
+@Api(tags = "收藏")
33
+@RestController
34
+@RequestMapping("/")
35
+public class TaPostSaveController extends BaseController {
36
+
37
+    private final Logger logger = LoggerFactory.getLogger(TaPostSaveController.class);
38
+
39
+    @Autowired
40
+    public ITaPostSaveService iTaPostSaveService;
41
+
42
+
43
+    /**
44
+     * 分页查询列表
45
+     * @param pageNum
46
+     * @param pageSize
47
+     * @return
48
+     */
49
+    @RequestMapping(value="/taPostSave",method= RequestMethod.GET)
50
+    @ApiOperation(value="列表", notes = "列表", httpMethod = "GET", response = ResponseBean.class)
51
+    public ResponseBean taPostSaveList(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
52
+									 @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize) throws Exception{
53
+
54
+		    IPage<TaPostSave> pg = new Page<>(pageNum, pageSize);
55
+            QueryWrapper<TaPostSave> queryWrapper = new QueryWrapper<>();
56
+            queryWrapper.orderByDesc("create_date");
57
+
58
+            IPage<TaPostSave> result = iTaPostSaveService.page(pg, queryWrapper);
59
+            return ResponseBean.success(result);
60
+    }
61
+
62
+    /**
63
+     * 保存对象
64
+     * @param taPostSave 实体对象
65
+     * @return
66
+     */
67
+    @RequestMapping(value="/taPostSave",method= RequestMethod.POST)
68
+    @ApiOperation(value="保存", notes = "保存", httpMethod = "POST", response = ResponseBean.class)
69
+    public ResponseBean taPostSaveAdd(@ApiParam("保存内容") @RequestBody TaPostSave taPostSave) throws Exception{
70
+
71
+        if (iTaPostSaveService.save(taPostSave)){
72
+            return ResponseBean.success(taPostSave);
73
+        }else {
74
+            return ResponseBean.error("保存失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
75
+        }
76
+    }
77
+
78
+    /**
79
+     * 根据id删除对象
80
+     * @param id  实体ID
81
+     */
82
+    @RequestMapping(value="/taPostSave/{id}", method= RequestMethod.DELETE)
83
+    @ApiOperation(value="删除", notes = "删除", httpMethod = "DELETE", response = ResponseBean.class)
84
+    public ResponseBean taPostSaveDelete(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
85
+        if(iTaPostSaveService.removeById(id)){
86
+            return ResponseBean.success("success");
87
+        }else {
88
+            return ResponseBean.error("删除失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
89
+        }
90
+    }
91
+
92
+    /**
93
+     * 修改对象
94
+     * @param id  实体ID
95
+     * @param taPostSave 实体对象
96
+     * @return
97
+     */
98
+    @RequestMapping(value="/taPostSave/{id}",method= RequestMethod.PUT)
99
+    @ApiOperation(value="更新", notes = "更新", httpMethod = "PUT", response = ResponseBean.class)
100
+    public ResponseBean taPostSaveUpdate(@ApiParam("对象ID") @PathVariable Integer id,
101
+                                        @ApiParam("更新内容") @RequestBody TaPostSave taPostSave) throws Exception{
102
+
103
+        if (iTaPostSaveService.updateById(taPostSave)){
104
+            return ResponseBean.success(iTaPostSaveService.getById(id));
105
+        }else {
106
+            return ResponseBean.error("修改失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
107
+        }
108
+    }
109
+
110
+    /**
111
+     * 根据id查询对象
112
+     * @param id  实体ID
113
+     */
114
+    @RequestMapping(value="/taPostSave/{id}",method= RequestMethod.GET)
115
+    @ApiOperation(value="详情", notes = "详情", httpMethod = "GET", response = ResponseBean.class)
116
+    public ResponseBean taPostSaveGet(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
117
+        return ResponseBean.success(iTaPostSaveService.getById(id));
118
+    }
119
+}

+ 119
- 0
src/main/java/com/yunzhi/demo/controller/TaPostTestController.java Zobrazit soubor

@@ -0,0 +1,119 @@
1
+package com.yunzhi.demo.controller;
2
+
3
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
+import com.baomidou.mybatisplus.core.metadata.IPage;
5
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
+import com.yunzhi.demo.common.BaseController;
7
+import com.yunzhi.demo.common.ResponseBean;
8
+import io.swagger.annotations.Api;
9
+import io.swagger.annotations.ApiOperation;
10
+import io.swagger.annotations.ApiParam;
11
+import org.slf4j.Logger;
12
+import org.slf4j.LoggerFactory;
13
+import org.springframework.beans.factory.annotation.Autowired;
14
+import org.springframework.web.bind.annotation.PathVariable;
15
+import org.springframework.web.bind.annotation.RequestBody;
16
+import org.springframework.web.bind.annotation.RequestMapping;
17
+import org.springframework.web.bind.annotation.RequestMethod;
18
+import org.springframework.web.bind.annotation.RequestParam;
19
+import com.yunzhi.demo.service.ITaPostTestService;
20
+import com.yunzhi.demo.entity.TaPostTest;
21
+import org.springframework.web.bind.annotation.RestController;
22
+
23
+/**
24
+ * <p>
25
+    * 题库 前端控制器
26
+    * </p>
27
+ *
28
+ * @author yansen
29
+ * @since 2021-04-15
30
+ */
31
+
32
+@Api(tags = "题库")
33
+@RestController
34
+@RequestMapping("/")
35
+public class TaPostTestController extends BaseController {
36
+
37
+    private final Logger logger = LoggerFactory.getLogger(TaPostTestController.class);
38
+
39
+    @Autowired
40
+    public ITaPostTestService iTaPostTestService;
41
+
42
+
43
+    /**
44
+     * 分页查询列表
45
+     * @param pageNum
46
+     * @param pageSize
47
+     * @return
48
+     */
49
+    @RequestMapping(value="/taPostTest",method= RequestMethod.GET)
50
+    @ApiOperation(value="列表", notes = "列表", httpMethod = "GET", response = ResponseBean.class)
51
+    public ResponseBean taPostTestList(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
52
+									 @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize) throws Exception{
53
+
54
+		    IPage<TaPostTest> pg = new Page<>(pageNum, pageSize);
55
+            QueryWrapper<TaPostTest> queryWrapper = new QueryWrapper<>();
56
+            queryWrapper.orderByDesc("create_date");
57
+
58
+            IPage<TaPostTest> result = iTaPostTestService.page(pg, queryWrapper);
59
+            return ResponseBean.success(result);
60
+    }
61
+
62
+    /**
63
+     * 保存对象
64
+     * @param taPostTest 实体对象
65
+     * @return
66
+     */
67
+    @RequestMapping(value="/taPostTest",method= RequestMethod.POST)
68
+    @ApiOperation(value="保存", notes = "保存", httpMethod = "POST", response = ResponseBean.class)
69
+    public ResponseBean taPostTestAdd(@ApiParam("保存内容") @RequestBody TaPostTest taPostTest) throws Exception{
70
+
71
+        if (iTaPostTestService.save(taPostTest)){
72
+            return ResponseBean.success(taPostTest);
73
+        }else {
74
+            return ResponseBean.error("保存失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
75
+        }
76
+    }
77
+
78
+    /**
79
+     * 根据id删除对象
80
+     * @param id  实体ID
81
+     */
82
+    @RequestMapping(value="/taPostTest/{id}", method= RequestMethod.DELETE)
83
+    @ApiOperation(value="删除", notes = "删除", httpMethod = "DELETE", response = ResponseBean.class)
84
+    public ResponseBean taPostTestDelete(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
85
+        if(iTaPostTestService.removeById(id)){
86
+            return ResponseBean.success("success");
87
+        }else {
88
+            return ResponseBean.error("删除失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
89
+        }
90
+    }
91
+
92
+    /**
93
+     * 修改对象
94
+     * @param id  实体ID
95
+     * @param taPostTest 实体对象
96
+     * @return
97
+     */
98
+    @RequestMapping(value="/taPostTest/{id}",method= RequestMethod.PUT)
99
+    @ApiOperation(value="更新", notes = "更新", httpMethod = "PUT", response = ResponseBean.class)
100
+    public ResponseBean taPostTestUpdate(@ApiParam("对象ID") @PathVariable Integer id,
101
+                                        @ApiParam("更新内容") @RequestBody TaPostTest taPostTest) throws Exception{
102
+
103
+        if (iTaPostTestService.updateById(taPostTest)){
104
+            return ResponseBean.success(iTaPostTestService.getById(id));
105
+        }else {
106
+            return ResponseBean.error("修改失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
107
+        }
108
+    }
109
+
110
+    /**
111
+     * 根据id查询对象
112
+     * @param id  实体ID
113
+     */
114
+    @RequestMapping(value="/taPostTest/{id}",method= RequestMethod.GET)
115
+    @ApiOperation(value="详情", notes = "详情", httpMethod = "GET", response = ResponseBean.class)
116
+    public ResponseBean taPostTestGet(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
117
+        return ResponseBean.success(iTaPostTestService.getById(id));
118
+    }
119
+}

+ 119
- 0
src/main/java/com/yunzhi/demo/controller/TaReadLogController.java Zobrazit soubor

@@ -0,0 +1,119 @@
1
+package com.yunzhi.demo.controller;
2
+
3
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
+import com.baomidou.mybatisplus.core.metadata.IPage;
5
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
+import com.yunzhi.demo.common.BaseController;
7
+import com.yunzhi.demo.common.ResponseBean;
8
+import io.swagger.annotations.Api;
9
+import io.swagger.annotations.ApiOperation;
10
+import io.swagger.annotations.ApiParam;
11
+import org.slf4j.Logger;
12
+import org.slf4j.LoggerFactory;
13
+import org.springframework.beans.factory.annotation.Autowired;
14
+import org.springframework.web.bind.annotation.PathVariable;
15
+import org.springframework.web.bind.annotation.RequestBody;
16
+import org.springframework.web.bind.annotation.RequestMapping;
17
+import org.springframework.web.bind.annotation.RequestMethod;
18
+import org.springframework.web.bind.annotation.RequestParam;
19
+import com.yunzhi.demo.service.ITaReadLogService;
20
+import com.yunzhi.demo.entity.TaReadLog;
21
+import org.springframework.web.bind.annotation.RestController;
22
+
23
+/**
24
+ * <p>
25
+    * 阅读记录 前端控制器
26
+    * </p>
27
+ *
28
+ * @author yansen
29
+ * @since 2021-04-15
30
+ */
31
+
32
+@Api(tags = "阅读记录")
33
+@RestController
34
+@RequestMapping("/")
35
+public class TaReadLogController extends BaseController {
36
+
37
+    private final Logger logger = LoggerFactory.getLogger(TaReadLogController.class);
38
+
39
+    @Autowired
40
+    public ITaReadLogService iTaReadLogService;
41
+
42
+
43
+    /**
44
+     * 分页查询列表
45
+     * @param pageNum
46
+     * @param pageSize
47
+     * @return
48
+     */
49
+    @RequestMapping(value="/taReadLog",method= RequestMethod.GET)
50
+    @ApiOperation(value="列表", notes = "列表", httpMethod = "GET", response = ResponseBean.class)
51
+    public ResponseBean taReadLogList(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
52
+									 @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize) throws Exception{
53
+
54
+		    IPage<TaReadLog> pg = new Page<>(pageNum, pageSize);
55
+            QueryWrapper<TaReadLog> queryWrapper = new QueryWrapper<>();
56
+            queryWrapper.orderByDesc("create_date");
57
+
58
+            IPage<TaReadLog> result = iTaReadLogService.page(pg, queryWrapper);
59
+            return ResponseBean.success(result);
60
+    }
61
+
62
+    /**
63
+     * 保存对象
64
+     * @param taReadLog 实体对象
65
+     * @return
66
+     */
67
+    @RequestMapping(value="/taReadLog",method= RequestMethod.POST)
68
+    @ApiOperation(value="保存", notes = "保存", httpMethod = "POST", response = ResponseBean.class)
69
+    public ResponseBean taReadLogAdd(@ApiParam("保存内容") @RequestBody TaReadLog taReadLog) throws Exception{
70
+
71
+        if (iTaReadLogService.save(taReadLog)){
72
+            return ResponseBean.success(taReadLog);
73
+        }else {
74
+            return ResponseBean.error("保存失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
75
+        }
76
+    }
77
+
78
+    /**
79
+     * 根据id删除对象
80
+     * @param id  实体ID
81
+     */
82
+    @RequestMapping(value="/taReadLog/{id}", method= RequestMethod.DELETE)
83
+    @ApiOperation(value="删除", notes = "删除", httpMethod = "DELETE", response = ResponseBean.class)
84
+    public ResponseBean taReadLogDelete(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
85
+        if(iTaReadLogService.removeById(id)){
86
+            return ResponseBean.success("success");
87
+        }else {
88
+            return ResponseBean.error("删除失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
89
+        }
90
+    }
91
+
92
+    /**
93
+     * 修改对象
94
+     * @param id  实体ID
95
+     * @param taReadLog 实体对象
96
+     * @return
97
+     */
98
+    @RequestMapping(value="/taReadLog/{id}",method= RequestMethod.PUT)
99
+    @ApiOperation(value="更新", notes = "更新", httpMethod = "PUT", response = ResponseBean.class)
100
+    public ResponseBean taReadLogUpdate(@ApiParam("对象ID") @PathVariable Integer id,
101
+                                        @ApiParam("更新内容") @RequestBody TaReadLog taReadLog) throws Exception{
102
+
103
+        if (iTaReadLogService.updateById(taReadLog)){
104
+            return ResponseBean.success(iTaReadLogService.getById(id));
105
+        }else {
106
+            return ResponseBean.error("修改失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
107
+        }
108
+    }
109
+
110
+    /**
111
+     * 根据id查询对象
112
+     * @param id  实体ID
113
+     */
114
+    @RequestMapping(value="/taReadLog/{id}",method= RequestMethod.GET)
115
+    @ApiOperation(value="详情", notes = "详情", httpMethod = "GET", response = ResponseBean.class)
116
+    public ResponseBean taReadLogGet(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
117
+        return ResponseBean.success(iTaReadLogService.getById(id));
118
+    }
119
+}

+ 119
- 0
src/main/java/com/yunzhi/demo/controller/TaTestLogController.java Zobrazit soubor

@@ -0,0 +1,119 @@
1
+package com.yunzhi.demo.controller;
2
+
3
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
+import com.baomidou.mybatisplus.core.metadata.IPage;
5
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
+import com.yunzhi.demo.common.BaseController;
7
+import com.yunzhi.demo.common.ResponseBean;
8
+import io.swagger.annotations.Api;
9
+import io.swagger.annotations.ApiOperation;
10
+import io.swagger.annotations.ApiParam;
11
+import org.slf4j.Logger;
12
+import org.slf4j.LoggerFactory;
13
+import org.springframework.beans.factory.annotation.Autowired;
14
+import org.springframework.web.bind.annotation.PathVariable;
15
+import org.springframework.web.bind.annotation.RequestBody;
16
+import org.springframework.web.bind.annotation.RequestMapping;
17
+import org.springframework.web.bind.annotation.RequestMethod;
18
+import org.springframework.web.bind.annotation.RequestParam;
19
+import com.yunzhi.demo.service.ITaTestLogService;
20
+import com.yunzhi.demo.entity.TaTestLog;
21
+import org.springframework.web.bind.annotation.RestController;
22
+
23
+/**
24
+ * <p>
25
+    * 体检记录 前端控制器
26
+    * </p>
27
+ *
28
+ * @author yansen
29
+ * @since 2021-04-15
30
+ */
31
+
32
+@Api(tags = "体检记录")
33
+@RestController
34
+@RequestMapping("/")
35
+public class TaTestLogController extends BaseController {
36
+
37
+    private final Logger logger = LoggerFactory.getLogger(TaTestLogController.class);
38
+
39
+    @Autowired
40
+    public ITaTestLogService iTaTestLogService;
41
+
42
+
43
+    /**
44
+     * 分页查询列表
45
+     * @param pageNum
46
+     * @param pageSize
47
+     * @return
48
+     */
49
+    @RequestMapping(value="/taTestLog",method= RequestMethod.GET)
50
+    @ApiOperation(value="列表", notes = "列表", httpMethod = "GET", response = ResponseBean.class)
51
+    public ResponseBean taTestLogList(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
52
+									 @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize) throws Exception{
53
+
54
+		    IPage<TaTestLog> pg = new Page<>(pageNum, pageSize);
55
+            QueryWrapper<TaTestLog> queryWrapper = new QueryWrapper<>();
56
+            queryWrapper.orderByDesc("create_date");
57
+
58
+            IPage<TaTestLog> result = iTaTestLogService.page(pg, queryWrapper);
59
+            return ResponseBean.success(result);
60
+    }
61
+
62
+    /**
63
+     * 保存对象
64
+     * @param taTestLog 实体对象
65
+     * @return
66
+     */
67
+    @RequestMapping(value="/taTestLog",method= RequestMethod.POST)
68
+    @ApiOperation(value="保存", notes = "保存", httpMethod = "POST", response = ResponseBean.class)
69
+    public ResponseBean taTestLogAdd(@ApiParam("保存内容") @RequestBody TaTestLog taTestLog) throws Exception{
70
+
71
+        if (iTaTestLogService.save(taTestLog)){
72
+            return ResponseBean.success(taTestLog);
73
+        }else {
74
+            return ResponseBean.error("保存失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
75
+        }
76
+    }
77
+
78
+    /**
79
+     * 根据id删除对象
80
+     * @param id  实体ID
81
+     */
82
+    @RequestMapping(value="/taTestLog/{id}", method= RequestMethod.DELETE)
83
+    @ApiOperation(value="删除", notes = "删除", httpMethod = "DELETE", response = ResponseBean.class)
84
+    public ResponseBean taTestLogDelete(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
85
+        if(iTaTestLogService.removeById(id)){
86
+            return ResponseBean.success("success");
87
+        }else {
88
+            return ResponseBean.error("删除失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
89
+        }
90
+    }
91
+
92
+    /**
93
+     * 修改对象
94
+     * @param id  实体ID
95
+     * @param taTestLog 实体对象
96
+     * @return
97
+     */
98
+    @RequestMapping(value="/taTestLog/{id}",method= RequestMethod.PUT)
99
+    @ApiOperation(value="更新", notes = "更新", httpMethod = "PUT", response = ResponseBean.class)
100
+    public ResponseBean taTestLogUpdate(@ApiParam("对象ID") @PathVariable Integer id,
101
+                                        @ApiParam("更新内容") @RequestBody TaTestLog taTestLog) throws Exception{
102
+
103
+        if (iTaTestLogService.updateById(taTestLog)){
104
+            return ResponseBean.success(iTaTestLogService.getById(id));
105
+        }else {
106
+            return ResponseBean.error("修改失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
107
+        }
108
+    }
109
+
110
+    /**
111
+     * 根据id查询对象
112
+     * @param id  实体ID
113
+     */
114
+    @RequestMapping(value="/taTestLog/{id}",method= RequestMethod.GET)
115
+    @ApiOperation(value="详情", notes = "详情", httpMethod = "GET", response = ResponseBean.class)
116
+    public ResponseBean taTestLogGet(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
117
+        return ResponseBean.success(iTaTestLogService.getById(id));
118
+    }
119
+}

+ 119
- 0
src/main/java/com/yunzhi/demo/controller/TaTopicController.java Zobrazit soubor

@@ -0,0 +1,119 @@
1
+package com.yunzhi.demo.controller;
2
+
3
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
+import com.baomidou.mybatisplus.core.metadata.IPage;
5
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
+import com.yunzhi.demo.common.BaseController;
7
+import com.yunzhi.demo.common.ResponseBean;
8
+import io.swagger.annotations.Api;
9
+import io.swagger.annotations.ApiOperation;
10
+import io.swagger.annotations.ApiParam;
11
+import org.slf4j.Logger;
12
+import org.slf4j.LoggerFactory;
13
+import org.springframework.beans.factory.annotation.Autowired;
14
+import org.springframework.web.bind.annotation.PathVariable;
15
+import org.springframework.web.bind.annotation.RequestBody;
16
+import org.springframework.web.bind.annotation.RequestMapping;
17
+import org.springframework.web.bind.annotation.RequestMethod;
18
+import org.springframework.web.bind.annotation.RequestParam;
19
+import com.yunzhi.demo.service.ITaTopicService;
20
+import com.yunzhi.demo.entity.TaTopic;
21
+import org.springframework.web.bind.annotation.RestController;
22
+
23
+/**
24
+ * <p>
25
+    * 热门 前端控制器
26
+    * </p>
27
+ *
28
+ * @author yansen
29
+ * @since 2021-04-15
30
+ */
31
+
32
+@Api(tags = "热门")
33
+@RestController
34
+@RequestMapping("/")
35
+public class TaTopicController extends BaseController {
36
+
37
+    private final Logger logger = LoggerFactory.getLogger(TaTopicController.class);
38
+
39
+    @Autowired
40
+    public ITaTopicService iTaTopicService;
41
+
42
+
43
+    /**
44
+     * 分页查询列表
45
+     * @param pageNum
46
+     * @param pageSize
47
+     * @return
48
+     */
49
+    @RequestMapping(value="/taTopic",method= RequestMethod.GET)
50
+    @ApiOperation(value="列表", notes = "列表", httpMethod = "GET", response = ResponseBean.class)
51
+    public ResponseBean taTopicList(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
52
+									 @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize) throws Exception{
53
+
54
+		    IPage<TaTopic> pg = new Page<>(pageNum, pageSize);
55
+            QueryWrapper<TaTopic> queryWrapper = new QueryWrapper<>();
56
+            queryWrapper.orderByDesc("create_date");
57
+
58
+            IPage<TaTopic> result = iTaTopicService.page(pg, queryWrapper);
59
+            return ResponseBean.success(result);
60
+    }
61
+
62
+    /**
63
+     * 保存对象
64
+     * @param taTopic 实体对象
65
+     * @return
66
+     */
67
+    @RequestMapping(value="/taTopic",method= RequestMethod.POST)
68
+    @ApiOperation(value="保存", notes = "保存", httpMethod = "POST", response = ResponseBean.class)
69
+    public ResponseBean taTopicAdd(@ApiParam("保存内容") @RequestBody TaTopic taTopic) throws Exception{
70
+
71
+        if (iTaTopicService.save(taTopic)){
72
+            return ResponseBean.success(taTopic);
73
+        }else {
74
+            return ResponseBean.error("保存失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
75
+        }
76
+    }
77
+
78
+    /**
79
+     * 根据id删除对象
80
+     * @param id  实体ID
81
+     */
82
+    @RequestMapping(value="/taTopic/{id}", method= RequestMethod.DELETE)
83
+    @ApiOperation(value="删除", notes = "删除", httpMethod = "DELETE", response = ResponseBean.class)
84
+    public ResponseBean taTopicDelete(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
85
+        if(iTaTopicService.removeById(id)){
86
+            return ResponseBean.success("success");
87
+        }else {
88
+            return ResponseBean.error("删除失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
89
+        }
90
+    }
91
+
92
+    /**
93
+     * 修改对象
94
+     * @param id  实体ID
95
+     * @param taTopic 实体对象
96
+     * @return
97
+     */
98
+    @RequestMapping(value="/taTopic/{id}",method= RequestMethod.PUT)
99
+    @ApiOperation(value="更新", notes = "更新", httpMethod = "PUT", response = ResponseBean.class)
100
+    public ResponseBean taTopicUpdate(@ApiParam("对象ID") @PathVariable Integer id,
101
+                                        @ApiParam("更新内容") @RequestBody TaTopic taTopic) throws Exception{
102
+
103
+        if (iTaTopicService.updateById(taTopic)){
104
+            return ResponseBean.success(iTaTopicService.getById(id));
105
+        }else {
106
+            return ResponseBean.error("修改失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
107
+        }
108
+    }
109
+
110
+    /**
111
+     * 根据id查询对象
112
+     * @param id  实体ID
113
+     */
114
+    @RequestMapping(value="/taTopic/{id}",method= RequestMethod.GET)
115
+    @ApiOperation(value="详情", notes = "详情", httpMethod = "GET", response = ResponseBean.class)
116
+    public ResponseBean taTopicGet(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
117
+        return ResponseBean.success(iTaTopicService.getById(id));
118
+    }
119
+}

+ 119
- 0
src/main/java/com/yunzhi/demo/controller/TdDepartmentController.java Zobrazit soubor

@@ -0,0 +1,119 @@
1
+package com.yunzhi.demo.controller;
2
+
3
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
+import com.baomidou.mybatisplus.core.metadata.IPage;
5
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
+import com.yunzhi.demo.common.BaseController;
7
+import com.yunzhi.demo.common.ResponseBean;
8
+import io.swagger.annotations.Api;
9
+import io.swagger.annotations.ApiOperation;
10
+import io.swagger.annotations.ApiParam;
11
+import org.slf4j.Logger;
12
+import org.slf4j.LoggerFactory;
13
+import org.springframework.beans.factory.annotation.Autowired;
14
+import org.springframework.web.bind.annotation.PathVariable;
15
+import org.springframework.web.bind.annotation.RequestBody;
16
+import org.springframework.web.bind.annotation.RequestMapping;
17
+import org.springframework.web.bind.annotation.RequestMethod;
18
+import org.springframework.web.bind.annotation.RequestParam;
19
+import com.yunzhi.demo.service.ITdDepartmentService;
20
+import com.yunzhi.demo.entity.TdDepartment;
21
+import org.springframework.web.bind.annotation.RestController;
22
+
23
+/**
24
+ * <p>
25
+    * 科室 前端控制器
26
+    * </p>
27
+ *
28
+ * @author yansen
29
+ * @since 2021-04-15
30
+ */
31
+
32
+@Api(tags = "科室")
33
+@RestController
34
+@RequestMapping("/")
35
+public class TdDepartmentController extends BaseController {
36
+
37
+    private final Logger logger = LoggerFactory.getLogger(TdDepartmentController.class);
38
+
39
+    @Autowired
40
+    public ITdDepartmentService iTdDepartmentService;
41
+
42
+
43
+    /**
44
+     * 分页查询列表
45
+     * @param pageNum
46
+     * @param pageSize
47
+     * @return
48
+     */
49
+    @RequestMapping(value="/tdDepartment",method= RequestMethod.GET)
50
+    @ApiOperation(value="列表", notes = "列表", httpMethod = "GET", response = ResponseBean.class)
51
+    public ResponseBean tdDepartmentList(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
52
+									 @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize) throws Exception{
53
+
54
+		    IPage<TdDepartment> pg = new Page<>(pageNum, pageSize);
55
+            QueryWrapper<TdDepartment> queryWrapper = new QueryWrapper<>();
56
+            queryWrapper.orderByDesc("create_date");
57
+
58
+            IPage<TdDepartment> result = iTdDepartmentService.page(pg, queryWrapper);
59
+            return ResponseBean.success(result);
60
+    }
61
+
62
+    /**
63
+     * 保存对象
64
+     * @param tdDepartment 实体对象
65
+     * @return
66
+     */
67
+    @RequestMapping(value="/tdDepartment",method= RequestMethod.POST)
68
+    @ApiOperation(value="保存", notes = "保存", httpMethod = "POST", response = ResponseBean.class)
69
+    public ResponseBean tdDepartmentAdd(@ApiParam("保存内容") @RequestBody TdDepartment tdDepartment) throws Exception{
70
+
71
+        if (iTdDepartmentService.save(tdDepartment)){
72
+            return ResponseBean.success(tdDepartment);
73
+        }else {
74
+            return ResponseBean.error("保存失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
75
+        }
76
+    }
77
+
78
+    /**
79
+     * 根据id删除对象
80
+     * @param id  实体ID
81
+     */
82
+    @RequestMapping(value="/tdDepartment/{id}", method= RequestMethod.DELETE)
83
+    @ApiOperation(value="删除", notes = "删除", httpMethod = "DELETE", response = ResponseBean.class)
84
+    public ResponseBean tdDepartmentDelete(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
85
+        if(iTdDepartmentService.removeById(id)){
86
+            return ResponseBean.success("success");
87
+        }else {
88
+            return ResponseBean.error("删除失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
89
+        }
90
+    }
91
+
92
+    /**
93
+     * 修改对象
94
+     * @param id  实体ID
95
+     * @param tdDepartment 实体对象
96
+     * @return
97
+     */
98
+    @RequestMapping(value="/tdDepartment/{id}",method= RequestMethod.PUT)
99
+    @ApiOperation(value="更新", notes = "更新", httpMethod = "PUT", response = ResponseBean.class)
100
+    public ResponseBean tdDepartmentUpdate(@ApiParam("对象ID") @PathVariable Integer id,
101
+                                        @ApiParam("更新内容") @RequestBody TdDepartment tdDepartment) throws Exception{
102
+
103
+        if (iTdDepartmentService.updateById(tdDepartment)){
104
+            return ResponseBean.success(iTdDepartmentService.getById(id));
105
+        }else {
106
+            return ResponseBean.error("修改失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
107
+        }
108
+    }
109
+
110
+    /**
111
+     * 根据id查询对象
112
+     * @param id  实体ID
113
+     */
114
+    @RequestMapping(value="/tdDepartment/{id}",method= RequestMethod.GET)
115
+    @ApiOperation(value="详情", notes = "详情", httpMethod = "GET", response = ResponseBean.class)
116
+    public ResponseBean tdDepartmentGet(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
117
+        return ResponseBean.success(iTdDepartmentService.getById(id));
118
+    }
119
+}

+ 119
- 0
src/main/java/com/yunzhi/demo/controller/TdHospitalController.java Zobrazit soubor

@@ -0,0 +1,119 @@
1
+package com.yunzhi.demo.controller;
2
+
3
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
+import com.baomidou.mybatisplus.core.metadata.IPage;
5
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
+import com.yunzhi.demo.common.BaseController;
7
+import com.yunzhi.demo.common.ResponseBean;
8
+import io.swagger.annotations.Api;
9
+import io.swagger.annotations.ApiOperation;
10
+import io.swagger.annotations.ApiParam;
11
+import org.slf4j.Logger;
12
+import org.slf4j.LoggerFactory;
13
+import org.springframework.beans.factory.annotation.Autowired;
14
+import org.springframework.web.bind.annotation.PathVariable;
15
+import org.springframework.web.bind.annotation.RequestBody;
16
+import org.springframework.web.bind.annotation.RequestMapping;
17
+import org.springframework.web.bind.annotation.RequestMethod;
18
+import org.springframework.web.bind.annotation.RequestParam;
19
+import com.yunzhi.demo.service.ITdHospitalService;
20
+import com.yunzhi.demo.entity.TdHospital;
21
+import org.springframework.web.bind.annotation.RestController;
22
+
23
+/**
24
+ * <p>
25
+    * 医务室 前端控制器
26
+    * </p>
27
+ *
28
+ * @author yansen
29
+ * @since 2021-04-15
30
+ */
31
+
32
+@Api(tags = "医务室")
33
+@RestController
34
+@RequestMapping("/")
35
+public class TdHospitalController extends BaseController {
36
+
37
+    private final Logger logger = LoggerFactory.getLogger(TdHospitalController.class);
38
+
39
+    @Autowired
40
+    public ITdHospitalService iTdHospitalService;
41
+
42
+
43
+    /**
44
+     * 分页查询列表
45
+     * @param pageNum
46
+     * @param pageSize
47
+     * @return
48
+     */
49
+    @RequestMapping(value="/tdHospital",method= RequestMethod.GET)
50
+    @ApiOperation(value="列表", notes = "列表", httpMethod = "GET", response = ResponseBean.class)
51
+    public ResponseBean tdHospitalList(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
52
+									 @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize) throws Exception{
53
+
54
+		    IPage<TdHospital> pg = new Page<>(pageNum, pageSize);
55
+            QueryWrapper<TdHospital> queryWrapper = new QueryWrapper<>();
56
+            queryWrapper.orderByDesc("create_date");
57
+
58
+            IPage<TdHospital> result = iTdHospitalService.page(pg, queryWrapper);
59
+            return ResponseBean.success(result);
60
+    }
61
+
62
+    /**
63
+     * 保存对象
64
+     * @param tdHospital 实体对象
65
+     * @return
66
+     */
67
+    @RequestMapping(value="/tdHospital",method= RequestMethod.POST)
68
+    @ApiOperation(value="保存", notes = "保存", httpMethod = "POST", response = ResponseBean.class)
69
+    public ResponseBean tdHospitalAdd(@ApiParam("保存内容") @RequestBody TdHospital tdHospital) throws Exception{
70
+
71
+        if (iTdHospitalService.save(tdHospital)){
72
+            return ResponseBean.success(tdHospital);
73
+        }else {
74
+            return ResponseBean.error("保存失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
75
+        }
76
+    }
77
+
78
+    /**
79
+     * 根据id删除对象
80
+     * @param id  实体ID
81
+     */
82
+    @RequestMapping(value="/tdHospital/{id}", method= RequestMethod.DELETE)
83
+    @ApiOperation(value="删除", notes = "删除", httpMethod = "DELETE", response = ResponseBean.class)
84
+    public ResponseBean tdHospitalDelete(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
85
+        if(iTdHospitalService.removeById(id)){
86
+            return ResponseBean.success("success");
87
+        }else {
88
+            return ResponseBean.error("删除失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
89
+        }
90
+    }
91
+
92
+    /**
93
+     * 修改对象
94
+     * @param id  实体ID
95
+     * @param tdHospital 实体对象
96
+     * @return
97
+     */
98
+    @RequestMapping(value="/tdHospital/{id}",method= RequestMethod.PUT)
99
+    @ApiOperation(value="更新", notes = "更新", httpMethod = "PUT", response = ResponseBean.class)
100
+    public ResponseBean tdHospitalUpdate(@ApiParam("对象ID") @PathVariable Integer id,
101
+                                        @ApiParam("更新内容") @RequestBody TdHospital tdHospital) throws Exception{
102
+
103
+        if (iTdHospitalService.updateById(tdHospital)){
104
+            return ResponseBean.success(iTdHospitalService.getById(id));
105
+        }else {
106
+            return ResponseBean.error("修改失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
107
+        }
108
+    }
109
+
110
+    /**
111
+     * 根据id查询对象
112
+     * @param id  实体ID
113
+     */
114
+    @RequestMapping(value="/tdHospital/{id}",method= RequestMethod.GET)
115
+    @ApiOperation(value="详情", notes = "详情", httpMethod = "GET", response = ResponseBean.class)
116
+    public ResponseBean tdHospitalGet(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
117
+        return ResponseBean.success(iTdHospitalService.getById(id));
118
+    }
119
+}

+ 122
- 0
src/main/java/com/yunzhi/demo/controller/TdPostTypeController.java Zobrazit soubor

@@ -0,0 +1,122 @@
1
+package com.yunzhi.demo.controller;
2
+
3
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
+import com.baomidou.mybatisplus.core.metadata.IPage;
5
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
+import com.yunzhi.demo.common.BaseController;
7
+import com.yunzhi.demo.common.Constants;
8
+import com.yunzhi.demo.common.ResponseBean;
9
+import io.swagger.annotations.Api;
10
+import io.swagger.annotations.ApiOperation;
11
+import io.swagger.annotations.ApiParam;
12
+import org.slf4j.Logger;
13
+import org.slf4j.LoggerFactory;
14
+import org.springframework.beans.factory.annotation.Autowired;
15
+import org.springframework.web.bind.annotation.PathVariable;
16
+import org.springframework.web.bind.annotation.RequestBody;
17
+import org.springframework.web.bind.annotation.RequestMapping;
18
+import org.springframework.web.bind.annotation.RequestMethod;
19
+import org.springframework.web.bind.annotation.RequestParam;
20
+import com.yunzhi.demo.service.ITdPostTypeService;
21
+import com.yunzhi.demo.entity.TdPostType;
22
+import org.springframework.web.bind.annotation.RestController;
23
+
24
+/**
25
+ * <p>
26
+    * 文章分类 前端控制器
27
+    * </p>
28
+ *
29
+ * @author yansen
30
+ * @since 2021-04-15
31
+ */
32
+
33
+@Api(tags = "文章分类")
34
+@RestController
35
+@RequestMapping("/")
36
+public class TdPostTypeController extends BaseController {
37
+
38
+    private final Logger logger = LoggerFactory.getLogger(TdPostTypeController.class);
39
+
40
+    @Autowired
41
+    public ITdPostTypeService iTdPostTypeService;
42
+
43
+
44
+    /**
45
+     * 分页查询列表
46
+     * @param pageNum
47
+     * @param pageSize
48
+     * @return
49
+     */
50
+    @RequestMapping(value="/admin/post-type",method= RequestMethod.GET)
51
+    @ApiOperation(value="列表", notes = "列表", httpMethod = "GET", response = ResponseBean.class)
52
+    public ResponseBean tdPostTypeList(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
53
+									 @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize) throws Exception{
54
+
55
+		    IPage<TdPostType> pg = new Page<>(pageNum, pageSize);
56
+            QueryWrapper<TdPostType> queryWrapper = new QueryWrapper<>();
57
+            queryWrapper.eq("status", Constants.STATUS_NORMAL);
58
+            queryWrapper.orderByDesc("sort_no");
59
+            queryWrapper.orderByDesc("create_date");
60
+
61
+            IPage<TdPostType> result = iTdPostTypeService.page(pg, queryWrapper);
62
+            return ResponseBean.success(result);
63
+    }
64
+
65
+    /**
66
+     * 保存对象
67
+     * @param tdPostType 实体对象
68
+     * @return
69
+     */
70
+    @RequestMapping(value="/tdPostType",method= RequestMethod.POST)
71
+    @ApiOperation(value="保存", notes = "保存", httpMethod = "POST", response = ResponseBean.class)
72
+    public ResponseBean tdPostTypeAdd(@ApiParam("保存内容") @RequestBody TdPostType tdPostType) throws Exception{
73
+
74
+        if (iTdPostTypeService.save(tdPostType)){
75
+            return ResponseBean.success(tdPostType);
76
+        }else {
77
+            return ResponseBean.error("保存失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
78
+        }
79
+    }
80
+
81
+    /**
82
+     * 根据id删除对象
83
+     * @param id  实体ID
84
+     */
85
+    @RequestMapping(value="/tdPostType/{id}", method= RequestMethod.DELETE)
86
+    @ApiOperation(value="删除", notes = "删除", httpMethod = "DELETE", response = ResponseBean.class)
87
+    public ResponseBean tdPostTypeDelete(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
88
+        if(iTdPostTypeService.removeById(id)){
89
+            return ResponseBean.success("success");
90
+        }else {
91
+            return ResponseBean.error("删除失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
92
+        }
93
+    }
94
+
95
+    /**
96
+     * 修改对象
97
+     * @param id  实体ID
98
+     * @param tdPostType 实体对象
99
+     * @return
100
+     */
101
+    @RequestMapping(value="/tdPostType/{id}",method= RequestMethod.PUT)
102
+    @ApiOperation(value="更新", notes = "更新", httpMethod = "PUT", response = ResponseBean.class)
103
+    public ResponseBean tdPostTypeUpdate(@ApiParam("对象ID") @PathVariable Integer id,
104
+                                        @ApiParam("更新内容") @RequestBody TdPostType tdPostType) throws Exception{
105
+
106
+        if (iTdPostTypeService.updateById(tdPostType)){
107
+            return ResponseBean.success(iTdPostTypeService.getById(id));
108
+        }else {
109
+            return ResponseBean.error("修改失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
110
+        }
111
+    }
112
+
113
+    /**
114
+     * 根据id查询对象
115
+     * @param id  实体ID
116
+     */
117
+    @RequestMapping(value="/tdPostType/{id}",method= RequestMethod.GET)
118
+    @ApiOperation(value="详情", notes = "详情", httpMethod = "GET", response = ResponseBean.class)
119
+    public ResponseBean tdPostTypeGet(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
120
+        return ResponseBean.success(iTdPostTypeService.getById(id));
121
+    }
122
+}

+ 119
- 0
src/main/java/com/yunzhi/demo/controller/TdSchoolController.java Zobrazit soubor

@@ -0,0 +1,119 @@
1
+package com.yunzhi.demo.controller;
2
+
3
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
+import com.baomidou.mybatisplus.core.metadata.IPage;
5
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
+import com.yunzhi.demo.common.BaseController;
7
+import com.yunzhi.demo.common.ResponseBean;
8
+import io.swagger.annotations.Api;
9
+import io.swagger.annotations.ApiOperation;
10
+import io.swagger.annotations.ApiParam;
11
+import org.slf4j.Logger;
12
+import org.slf4j.LoggerFactory;
13
+import org.springframework.beans.factory.annotation.Autowired;
14
+import org.springframework.web.bind.annotation.PathVariable;
15
+import org.springframework.web.bind.annotation.RequestBody;
16
+import org.springframework.web.bind.annotation.RequestMapping;
17
+import org.springframework.web.bind.annotation.RequestMethod;
18
+import org.springframework.web.bind.annotation.RequestParam;
19
+import com.yunzhi.demo.service.ITdSchoolService;
20
+import com.yunzhi.demo.entity.TdSchool;
21
+import org.springframework.web.bind.annotation.RestController;
22
+
23
+/**
24
+ * <p>
25
+    * 学校 前端控制器
26
+    * </p>
27
+ *
28
+ * @author yansen
29
+ * @since 2021-04-15
30
+ */
31
+
32
+@Api(tags = "学校")
33
+@RestController
34
+@RequestMapping("/")
35
+public class TdSchoolController extends BaseController {
36
+
37
+    private final Logger logger = LoggerFactory.getLogger(TdSchoolController.class);
38
+
39
+    @Autowired
40
+    public ITdSchoolService iTdSchoolService;
41
+
42
+
43
+    /**
44
+     * 分页查询列表
45
+     * @param pageNum
46
+     * @param pageSize
47
+     * @return
48
+     */
49
+    @RequestMapping(value="/tdSchool",method= RequestMethod.GET)
50
+    @ApiOperation(value="列表", notes = "列表", httpMethod = "GET", response = ResponseBean.class)
51
+    public ResponseBean tdSchoolList(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
52
+									 @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize) throws Exception{
53
+
54
+		    IPage<TdSchool> pg = new Page<>(pageNum, pageSize);
55
+            QueryWrapper<TdSchool> queryWrapper = new QueryWrapper<>();
56
+            queryWrapper.orderByDesc("create_date");
57
+
58
+            IPage<TdSchool> result = iTdSchoolService.page(pg, queryWrapper);
59
+            return ResponseBean.success(result);
60
+    }
61
+
62
+    /**
63
+     * 保存对象
64
+     * @param tdSchool 实体对象
65
+     * @return
66
+     */
67
+    @RequestMapping(value="/tdSchool",method= RequestMethod.POST)
68
+    @ApiOperation(value="保存", notes = "保存", httpMethod = "POST", response = ResponseBean.class)
69
+    public ResponseBean tdSchoolAdd(@ApiParam("保存内容") @RequestBody TdSchool tdSchool) throws Exception{
70
+
71
+        if (iTdSchoolService.save(tdSchool)){
72
+            return ResponseBean.success(tdSchool);
73
+        }else {
74
+            return ResponseBean.error("保存失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
75
+        }
76
+    }
77
+
78
+    /**
79
+     * 根据id删除对象
80
+     * @param id  实体ID
81
+     */
82
+    @RequestMapping(value="/tdSchool/{id}", method= RequestMethod.DELETE)
83
+    @ApiOperation(value="删除", notes = "删除", httpMethod = "DELETE", response = ResponseBean.class)
84
+    public ResponseBean tdSchoolDelete(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
85
+        if(iTdSchoolService.removeById(id)){
86
+            return ResponseBean.success("success");
87
+        }else {
88
+            return ResponseBean.error("删除失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
89
+        }
90
+    }
91
+
92
+    /**
93
+     * 修改对象
94
+     * @param id  实体ID
95
+     * @param tdSchool 实体对象
96
+     * @return
97
+     */
98
+    @RequestMapping(value="/tdSchool/{id}",method= RequestMethod.PUT)
99
+    @ApiOperation(value="更新", notes = "更新", httpMethod = "PUT", response = ResponseBean.class)
100
+    public ResponseBean tdSchoolUpdate(@ApiParam("对象ID") @PathVariable Integer id,
101
+                                        @ApiParam("更新内容") @RequestBody TdSchool tdSchool) throws Exception{
102
+
103
+        if (iTdSchoolService.updateById(tdSchool)){
104
+            return ResponseBean.success(iTdSchoolService.getById(id));
105
+        }else {
106
+            return ResponseBean.error("修改失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
107
+        }
108
+    }
109
+
110
+    /**
111
+     * 根据id查询对象
112
+     * @param id  实体ID
113
+     */
114
+    @RequestMapping(value="/tdSchool/{id}",method= RequestMethod.GET)
115
+    @ApiOperation(value="详情", notes = "详情", httpMethod = "GET", response = ResponseBean.class)
116
+    public ResponseBean tdSchoolGet(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
117
+        return ResponseBean.success(iTdSchoolService.getById(id));
118
+    }
119
+}

+ 119
- 0
src/main/java/com/yunzhi/demo/controller/TdSpecialtyController.java Zobrazit soubor

@@ -0,0 +1,119 @@
1
+package com.yunzhi.demo.controller;
2
+
3
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
+import com.baomidou.mybatisplus.core.metadata.IPage;
5
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
+import com.yunzhi.demo.common.BaseController;
7
+import com.yunzhi.demo.common.ResponseBean;
8
+import io.swagger.annotations.Api;
9
+import io.swagger.annotations.ApiOperation;
10
+import io.swagger.annotations.ApiParam;
11
+import org.slf4j.Logger;
12
+import org.slf4j.LoggerFactory;
13
+import org.springframework.beans.factory.annotation.Autowired;
14
+import org.springframework.web.bind.annotation.PathVariable;
15
+import org.springframework.web.bind.annotation.RequestBody;
16
+import org.springframework.web.bind.annotation.RequestMapping;
17
+import org.springframework.web.bind.annotation.RequestMethod;
18
+import org.springframework.web.bind.annotation.RequestParam;
19
+import com.yunzhi.demo.service.ITdSpecialtyService;
20
+import com.yunzhi.demo.entity.TdSpecialty;
21
+import org.springframework.web.bind.annotation.RestController;
22
+
23
+/**
24
+ * <p>
25
+    * 专业 前端控制器
26
+    * </p>
27
+ *
28
+ * @author yansen
29
+ * @since 2021-04-15
30
+ */
31
+
32
+@Api(tags = "专业")
33
+@RestController
34
+@RequestMapping("/")
35
+public class TdSpecialtyController extends BaseController {
36
+
37
+    private final Logger logger = LoggerFactory.getLogger(TdSpecialtyController.class);
38
+
39
+    @Autowired
40
+    public ITdSpecialtyService iTdSpecialtyService;
41
+
42
+
43
+    /**
44
+     * 分页查询列表
45
+     * @param pageNum
46
+     * @param pageSize
47
+     * @return
48
+     */
49
+    @RequestMapping(value="/tdSpecialty",method= RequestMethod.GET)
50
+    @ApiOperation(value="列表", notes = "列表", httpMethod = "GET", response = ResponseBean.class)
51
+    public ResponseBean tdSpecialtyList(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
52
+									 @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize) throws Exception{
53
+
54
+		    IPage<TdSpecialty> pg = new Page<>(pageNum, pageSize);
55
+            QueryWrapper<TdSpecialty> queryWrapper = new QueryWrapper<>();
56
+            queryWrapper.orderByDesc("create_date");
57
+
58
+            IPage<TdSpecialty> result = iTdSpecialtyService.page(pg, queryWrapper);
59
+            return ResponseBean.success(result);
60
+    }
61
+
62
+    /**
63
+     * 保存对象
64
+     * @param tdSpecialty 实体对象
65
+     * @return
66
+     */
67
+    @RequestMapping(value="/tdSpecialty",method= RequestMethod.POST)
68
+    @ApiOperation(value="保存", notes = "保存", httpMethod = "POST", response = ResponseBean.class)
69
+    public ResponseBean tdSpecialtyAdd(@ApiParam("保存内容") @RequestBody TdSpecialty tdSpecialty) throws Exception{
70
+
71
+        if (iTdSpecialtyService.save(tdSpecialty)){
72
+            return ResponseBean.success(tdSpecialty);
73
+        }else {
74
+            return ResponseBean.error("保存失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
75
+        }
76
+    }
77
+
78
+    /**
79
+     * 根据id删除对象
80
+     * @param id  实体ID
81
+     */
82
+    @RequestMapping(value="/tdSpecialty/{id}", method= RequestMethod.DELETE)
83
+    @ApiOperation(value="删除", notes = "删除", httpMethod = "DELETE", response = ResponseBean.class)
84
+    public ResponseBean tdSpecialtyDelete(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
85
+        if(iTdSpecialtyService.removeById(id)){
86
+            return ResponseBean.success("success");
87
+        }else {
88
+            return ResponseBean.error("删除失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
89
+        }
90
+    }
91
+
92
+    /**
93
+     * 修改对象
94
+     * @param id  实体ID
95
+     * @param tdSpecialty 实体对象
96
+     * @return
97
+     */
98
+    @RequestMapping(value="/tdSpecialty/{id}",method= RequestMethod.PUT)
99
+    @ApiOperation(value="更新", notes = "更新", httpMethod = "PUT", response = ResponseBean.class)
100
+    public ResponseBean tdSpecialtyUpdate(@ApiParam("对象ID") @PathVariable Integer id,
101
+                                        @ApiParam("更新内容") @RequestBody TdSpecialty tdSpecialty) throws Exception{
102
+
103
+        if (iTdSpecialtyService.updateById(tdSpecialty)){
104
+            return ResponseBean.success(iTdSpecialtyService.getById(id));
105
+        }else {
106
+            return ResponseBean.error("修改失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
107
+        }
108
+    }
109
+
110
+    /**
111
+     * 根据id查询对象
112
+     * @param id  实体ID
113
+     */
114
+    @RequestMapping(value="/tdSpecialty/{id}",method= RequestMethod.GET)
115
+    @ApiOperation(value="详情", notes = "详情", httpMethod = "GET", response = ResponseBean.class)
116
+    public ResponseBean tdSpecialtyGet(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
117
+        return ResponseBean.success(iTdSpecialtyService.getById(id));
118
+    }
119
+}

+ 58
- 0
src/main/java/com/yunzhi/demo/entity/SysBanner.java Zobrazit soubor

@@ -0,0 +1,58 @@
1
+package com.yunzhi.demo.entity;
2
+
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableId;
5
+import java.time.LocalDateTime;
6
+import java.io.Serializable;
7
+import io.swagger.annotations.ApiModel;
8
+import io.swagger.annotations.ApiModelProperty;
9
+import lombok.Data;
10
+import lombok.EqualsAndHashCode;
11
+import lombok.experimental.Accessors;
12
+
13
+/**
14
+ * <p>
15
+ * 广告栏
16
+ * </p>
17
+ *
18
+ * @author yansen
19
+ * @since 2021-04-15
20
+ */
21
+@Data
22
+@EqualsAndHashCode(callSuper = false)
23
+@Accessors(chain = true)
24
+@ApiModel(value="SysBanner对象", description="广告栏")
25
+public class SysBanner implements Serializable {
26
+
27
+    private static final long serialVersionUID = 1L;
28
+
29
+    @ApiModelProperty(value = "主键")
30
+    @TableId(value = "serial_no", type = IdType.AUTO)
31
+    private Integer serialNo;
32
+
33
+    @ApiModelProperty(value = "图片")
34
+    private String image;
35
+
36
+    @ApiModelProperty(value = "标题")
37
+    private String title;
38
+
39
+    @ApiModelProperty(value = "资源类型")
40
+    private String targetType;
41
+
42
+    @ApiModelProperty(value = "资源ID")
43
+    private String targetId;
44
+
45
+    @ApiModelProperty(value = "序号")
46
+    private Integer sortNo;
47
+
48
+    @ApiModelProperty(value = "状态")
49
+    private Integer status;
50
+
51
+    @ApiModelProperty(value = "创建时间")
52
+    private LocalDateTime createDate;
53
+
54
+    @ApiModelProperty(value = "更新时间")
55
+    private LocalDateTime updateDate;
56
+
57
+
58
+}

+ 55
- 0
src/main/java/com/yunzhi/demo/entity/SysConfig.java Zobrazit soubor

@@ -0,0 +1,55 @@
1
+package com.yunzhi.demo.entity;
2
+
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableId;
5
+import java.time.LocalDateTime;
6
+import java.io.Serializable;
7
+import io.swagger.annotations.ApiModel;
8
+import io.swagger.annotations.ApiModelProperty;
9
+import lombok.Data;
10
+import lombok.EqualsAndHashCode;
11
+import lombok.experimental.Accessors;
12
+
13
+/**
14
+ * <p>
15
+ * 系统设定
16
+ * </p>
17
+ *
18
+ * @author yansen
19
+ * @since 2021-04-15
20
+ */
21
+@Data
22
+@EqualsAndHashCode(callSuper = false)
23
+@Accessors(chain = true)
24
+@ApiModel(value="SysConfig对象", description="系统设定")
25
+public class SysConfig implements Serializable {
26
+
27
+    private static final long serialVersionUID = 1L;
28
+
29
+    @ApiModelProperty(value = "主键")
30
+    @TableId(value = "serial_no", type = IdType.AUTO)
31
+    private Integer serialNo;
32
+
33
+    @ApiModelProperty(value = "设置CODE")
34
+    private String code;
35
+
36
+    @ApiModelProperty(value = "描述")
37
+    private String description;
38
+
39
+    @ApiModelProperty(value = "值")
40
+    private String value;
41
+
42
+    @ApiModelProperty(value = "排序")
43
+    private Integer sortNo;
44
+
45
+    @ApiModelProperty(value = "状态")
46
+    private Integer status;
47
+
48
+    @ApiModelProperty(value = "创建时间")
49
+    private LocalDateTime createDate;
50
+
51
+    @ApiModelProperty(value = "更新时间")
52
+    private LocalDateTime updateDate;
53
+
54
+
55
+}

+ 52
- 0
src/main/java/com/yunzhi/demo/entity/SysLogin.java Zobrazit soubor

@@ -0,0 +1,52 @@
1
+package com.yunzhi.demo.entity;
2
+
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableId;
5
+import java.time.LocalDateTime;
6
+import java.io.Serializable;
7
+import io.swagger.annotations.ApiModel;
8
+import io.swagger.annotations.ApiModelProperty;
9
+import lombok.Data;
10
+import lombok.EqualsAndHashCode;
11
+import lombok.experimental.Accessors;
12
+
13
+/**
14
+ * <p>
15
+ * 用户登录
16
+ * </p>
17
+ *
18
+ * @author yansen
19
+ * @since 2021-04-15
20
+ */
21
+@Data
22
+@EqualsAndHashCode(callSuper = false)
23
+@Accessors(chain = true)
24
+@ApiModel(value="SysLogin对象", description="用户登录")
25
+public class SysLogin implements Serializable {
26
+
27
+    private static final long serialVersionUID = 1L;
28
+
29
+    @ApiModelProperty(value = "登录主键")
30
+    @TableId(value = "login_id", type = IdType.AUTO)
31
+    private Integer loginId;
32
+
33
+    @ApiModelProperty(value = "用户主键")
34
+    private String userId;
35
+
36
+    @ApiModelProperty(value = "登录名")
37
+    private String loginName;
38
+
39
+    @ApiModelProperty(value = "账户密码")
40
+    private String password;
41
+
42
+    @ApiModelProperty(value = "状态")
43
+    private Integer status;
44
+
45
+    @ApiModelProperty(value = "创建时间")
46
+    private LocalDateTime createDate;
47
+
48
+    @ApiModelProperty(value = "更新时间")
49
+    private LocalDateTime updateDate;
50
+
51
+
52
+}

+ 55
- 0
src/main/java/com/yunzhi/demo/entity/SysMenu.java Zobrazit soubor

@@ -0,0 +1,55 @@
1
+package com.yunzhi.demo.entity;
2
+
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableField;
5
+import com.baomidou.mybatisplus.annotation.TableId;
6
+import java.time.LocalDateTime;
7
+import java.io.Serializable;
8
+import io.swagger.annotations.ApiModel;
9
+import io.swagger.annotations.ApiModelProperty;
10
+import lombok.Data;
11
+import lombok.EqualsAndHashCode;
12
+import lombok.experimental.Accessors;
13
+
14
+/**
15
+ * <p>
16
+ * 菜单管理
17
+ * </p>
18
+ *
19
+ * @author yansen
20
+ * @since 2021-04-15
21
+ */
22
+@Data
23
+@EqualsAndHashCode(callSuper = false)
24
+@Accessors(chain = true)
25
+@ApiModel(value="SysMenu对象", description="菜单管理")
26
+public class SysMenu implements Serializable {
27
+
28
+    private static final long serialVersionUID = 1L;
29
+
30
+    @ApiModelProperty(value = "菜单ID")
31
+    @TableId(value = "menu_id", type = IdType.AUTO)
32
+    private Integer menuId;
33
+
34
+    @ApiModelProperty(value = "编码")
35
+    private String menuCode;
36
+
37
+    @ApiModelProperty(value = "名称")
38
+    private String name;
39
+
40
+    @ApiModelProperty(value = "父级")
41
+    private Integer menuPId;
42
+
43
+    @ApiModelProperty(value = "状态")
44
+    private Integer status;
45
+
46
+    @ApiModelProperty(value = "创建时间")
47
+    private LocalDateTime createDate;
48
+
49
+    @ApiModelProperty(value = "更新时间")
50
+    private LocalDateTime updateDate;
51
+
52
+    @ApiModelProperty(value = "角色字符串, 逗号连接")
53
+    @TableField(exist = false)
54
+    private String roleString;
55
+}

+ 52
- 0
src/main/java/com/yunzhi/demo/entity/SysRole.java Zobrazit soubor

@@ -0,0 +1,52 @@
1
+package com.yunzhi.demo.entity;
2
+
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableId;
5
+import java.time.LocalDateTime;
6
+import java.io.Serializable;
7
+import io.swagger.annotations.ApiModel;
8
+import io.swagger.annotations.ApiModelProperty;
9
+import lombok.Data;
10
+import lombok.EqualsAndHashCode;
11
+import lombok.experimental.Accessors;
12
+
13
+/**
14
+ * <p>
15
+ * 角色
16
+ * </p>
17
+ *
18
+ * @author yansen
19
+ * @since 2021-04-15
20
+ */
21
+@Data
22
+@EqualsAndHashCode(callSuper = false)
23
+@Accessors(chain = true)
24
+@ApiModel(value="SysRole对象", description="角色")
25
+public class SysRole implements Serializable {
26
+
27
+    private static final long serialVersionUID = 1L;
28
+
29
+    @ApiModelProperty(value = "角色ID")
30
+    @TableId(value = "role_id", type = IdType.AUTO)
31
+    private Integer roleId;
32
+
33
+    @ApiModelProperty(value = "角色名称")
34
+    private String name;
35
+
36
+    @ApiModelProperty(value = "描述")
37
+    private String desc;
38
+
39
+    @ApiModelProperty(value = "排序")
40
+    private Integer sortNo;
41
+
42
+    @ApiModelProperty(value = "状态")
43
+    private Integer status;
44
+
45
+    @ApiModelProperty(value = "创建时间")
46
+    private LocalDateTime createDate;
47
+
48
+    @ApiModelProperty(value = "更新时间")
49
+    private LocalDateTime updateDate;
50
+
51
+
52
+}

+ 36
- 0
src/main/java/com/yunzhi/demo/entity/SysRoleMenu.java Zobrazit soubor

@@ -0,0 +1,36 @@
1
+package com.yunzhi.demo.entity;
2
+
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableId;
5
+import java.io.Serializable;
6
+import io.swagger.annotations.ApiModel;
7
+import io.swagger.annotations.ApiModelProperty;
8
+import lombok.Data;
9
+import lombok.EqualsAndHashCode;
10
+import lombok.experimental.Accessors;
11
+
12
+/**
13
+ * <p>
14
+ * 角色菜单
15
+ * </p>
16
+ *
17
+ * @author yansen
18
+ * @since 2021-04-15
19
+ */
20
+@Data
21
+@EqualsAndHashCode(callSuper = false)
22
+@Accessors(chain = true)
23
+@ApiModel(value="SysRoleMenu对象", description="角色菜单")
24
+public class SysRoleMenu implements Serializable {
25
+
26
+    private static final long serialVersionUID = 1L;
27
+
28
+    @ApiModelProperty(value = "角色ID")
29
+    @TableId(value = "role_id", type = IdType.INPUT)
30
+    private Integer roleId;
31
+
32
+    @ApiModelProperty(value = "菜单id")
33
+    private Integer menuId;
34
+
35
+
36
+}

+ 52
- 0
src/main/java/com/yunzhi/demo/entity/SysUser.java Zobrazit soubor

@@ -0,0 +1,52 @@
1
+package com.yunzhi.demo.entity;
2
+
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import java.time.LocalDateTime;
5
+import com.baomidou.mybatisplus.annotation.TableId;
6
+import java.io.Serializable;
7
+import io.swagger.annotations.ApiModel;
8
+import io.swagger.annotations.ApiModelProperty;
9
+import lombok.Data;
10
+import lombok.EqualsAndHashCode;
11
+import lombok.experimental.Accessors;
12
+
13
+/**
14
+ * <p>
15
+ * 用户
16
+ * </p>
17
+ *
18
+ * @author yansen
19
+ * @since 2021-04-15
20
+ */
21
+@Data
22
+@EqualsAndHashCode(callSuper = false)
23
+@Accessors(chain = true)
24
+@ApiModel(value="SysUser对象", description="用户")
25
+public class SysUser implements Serializable {
26
+
27
+    private static final long serialVersionUID = 1L;
28
+
29
+    @ApiModelProperty(value = "用户id")
30
+    @TableId(value = "user_id", type = IdType.INPUT)
31
+    private String userId;
32
+
33
+    @ApiModelProperty(value = "用户名")
34
+    private String userName;
35
+
36
+    @ApiModelProperty(value = "头像")
37
+    private String avatar;
38
+
39
+    @ApiModelProperty(value = "手机号")
40
+    private String phone;
41
+
42
+    @ApiModelProperty(value = "状态")
43
+    private Integer status;
44
+
45
+    @ApiModelProperty(value = "创建时间")
46
+    private LocalDateTime createDate;
47
+
48
+    @ApiModelProperty(value = "更新时间")
49
+    private LocalDateTime updateDate;
50
+
51
+
52
+}

+ 36
- 0
src/main/java/com/yunzhi/demo/entity/SysUserRole.java Zobrazit soubor

@@ -0,0 +1,36 @@
1
+package com.yunzhi.demo.entity;
2
+
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableId;
5
+import java.io.Serializable;
6
+import io.swagger.annotations.ApiModel;
7
+import io.swagger.annotations.ApiModelProperty;
8
+import lombok.Data;
9
+import lombok.EqualsAndHashCode;
10
+import lombok.experimental.Accessors;
11
+
12
+/**
13
+ * <p>
14
+ * 用户角色
15
+ * </p>
16
+ *
17
+ * @author yansen
18
+ * @since 2021-04-15
19
+ */
20
+@Data
21
+@EqualsAndHashCode(callSuper = false)
22
+@Accessors(chain = true)
23
+@ApiModel(value="SysUserRole对象", description="用户角色")
24
+public class SysUserRole implements Serializable {
25
+
26
+    private static final long serialVersionUID = 1L;
27
+
28
+    @ApiModelProperty(value = "角色ID")
29
+    @TableId(value = "role_id", type = IdType.INPUT)
30
+    private Integer roleId;
31
+
32
+    @ApiModelProperty(value = "用户ID")
33
+    private String userId;
34
+
35
+
36
+}

+ 52
- 0
src/main/java/com/yunzhi/demo/entity/TaMedicalLog.java Zobrazit soubor

@@ -0,0 +1,52 @@
1
+package com.yunzhi.demo.entity;
2
+
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableId;
5
+import java.time.LocalDateTime;
6
+import java.io.Serializable;
7
+import io.swagger.annotations.ApiModel;
8
+import io.swagger.annotations.ApiModelProperty;
9
+import lombok.Data;
10
+import lombok.EqualsAndHashCode;
11
+import lombok.experimental.Accessors;
12
+
13
+/**
14
+ * <p>
15
+ * 就诊记录
16
+ * </p>
17
+ *
18
+ * @author yansen
19
+ * @since 2021-04-15
20
+ */
21
+@Data
22
+@EqualsAndHashCode(callSuper = false)
23
+@Accessors(chain = true)
24
+@ApiModel(value="TaMedicalLog对象", description="就诊记录")
25
+public class TaMedicalLog implements Serializable {
26
+
27
+    private static final long serialVersionUID = 1L;
28
+
29
+    @ApiModelProperty(value = "主键")
30
+    @TableId(value = "serial_no", type = IdType.AUTO)
31
+    private Integer serialNo;
32
+
33
+    @ApiModelProperty(value = "人员ID")
34
+    private String personId;
35
+
36
+    @ApiModelProperty(value = "就诊时间 YYYY-MM-DD格式")
37
+    private String recordDate;
38
+
39
+    @ApiModelProperty(value = "就诊报告")
40
+    private String attchment;
41
+
42
+    @ApiModelProperty(value = "状态")
43
+    private Integer status;
44
+
45
+    @ApiModelProperty(value = "创建时间")
46
+    private LocalDateTime createDate;
47
+
48
+    @ApiModelProperty(value = "更新时间")
49
+    private LocalDateTime updateDate;
50
+
51
+
52
+}

+ 70
- 0
src/main/java/com/yunzhi/demo/entity/TaPerson.java Zobrazit soubor

@@ -0,0 +1,70 @@
1
+package com.yunzhi.demo.entity;
2
+
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import java.time.LocalDateTime;
5
+import com.baomidou.mybatisplus.annotation.TableId;
6
+import java.io.Serializable;
7
+import io.swagger.annotations.ApiModel;
8
+import io.swagger.annotations.ApiModelProperty;
9
+import lombok.Data;
10
+import lombok.EqualsAndHashCode;
11
+import lombok.experimental.Accessors;
12
+
13
+/**
14
+ * <p>
15
+ * 人员
16
+ * </p>
17
+ *
18
+ * @author yansen
19
+ * @since 2021-04-15
20
+ */
21
+@Data
22
+@EqualsAndHashCode(callSuper = false)
23
+@Accessors(chain = true)
24
+@ApiModel(value="TaPerson对象", description="人员")
25
+public class TaPerson implements Serializable {
26
+
27
+    private static final long serialVersionUID = 1L;
28
+
29
+    @ApiModelProperty(value = "人员ID")
30
+    @TableId(value = "person_id", type = IdType.INPUT)
31
+    private String personId;
32
+
33
+    @ApiModelProperty(value = "姓名")
34
+    private String name;
35
+
36
+    @ApiModelProperty(value = "性别")
37
+    private Integer sex;
38
+
39
+    @ApiModelProperty(value = "昵称")
40
+    private String nickName;
41
+
42
+    @ApiModelProperty(value = "头像")
43
+    private String avatar;
44
+
45
+    @ApiModelProperty(value = "手机")
46
+    private String phone;
47
+
48
+    @ApiModelProperty(value = "邮箱")
49
+    private String eMail;
50
+
51
+    @ApiModelProperty(value = "学校")
52
+    private String school;
53
+
54
+    @ApiModelProperty(value = "学界")
55
+    private String schoolBatch;
56
+
57
+    @ApiModelProperty(value = "学号")
58
+    private String studentId;
59
+
60
+    @ApiModelProperty(value = "状态")
61
+    private Integer status;
62
+
63
+    @ApiModelProperty(value = "创建时间")
64
+    private LocalDateTime createDate;
65
+
66
+    @ApiModelProperty(value = "更新时间")
67
+    private LocalDateTime updateDate;
68
+
69
+
70
+}

+ 45
- 0
src/main/java/com/yunzhi/demo/entity/TaPersonData.java Zobrazit soubor

@@ -0,0 +1,45 @@
1
+package com.yunzhi.demo.entity;
2
+
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableId;
5
+import java.io.Serializable;
6
+import io.swagger.annotations.ApiModel;
7
+import io.swagger.annotations.ApiModelProperty;
8
+import lombok.Data;
9
+import lombok.EqualsAndHashCode;
10
+import lombok.experimental.Accessors;
11
+
12
+/**
13
+ * <p>
14
+ * 人员统计
15
+ * </p>
16
+ *
17
+ * @author yansen
18
+ * @since 2021-04-15
19
+ */
20
+@Data
21
+@EqualsAndHashCode(callSuper = false)
22
+@Accessors(chain = true)
23
+@ApiModel(value="TaPersonData对象", description="人员统计")
24
+public class TaPersonData implements Serializable {
25
+
26
+    private static final long serialVersionUID = 1L;
27
+
28
+    @ApiModelProperty(value = "人员ID")
29
+    @TableId(value = "person_id", type = IdType.INPUT)
30
+    private String personId;
31
+
32
+    @ApiModelProperty(value = "积分")
33
+    private Integer pointNum;
34
+
35
+    @ApiModelProperty(value = "学分")
36
+    private Integer creditNum;
37
+
38
+    @ApiModelProperty(value = "收藏文章")
39
+    private Integer savedNum;
40
+
41
+    @ApiModelProperty(value = "阅读文章")
42
+    private Integer readedNum;
43
+
44
+
45
+}

+ 61
- 0
src/main/java/com/yunzhi/demo/entity/TaPointsLog.java Zobrazit soubor

@@ -0,0 +1,61 @@
1
+package com.yunzhi.demo.entity;
2
+
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableId;
5
+import java.time.LocalDateTime;
6
+import java.io.Serializable;
7
+import io.swagger.annotations.ApiModel;
8
+import io.swagger.annotations.ApiModelProperty;
9
+import lombok.Data;
10
+import lombok.EqualsAndHashCode;
11
+import lombok.experimental.Accessors;
12
+
13
+/**
14
+ * <p>
15
+ * 积分历史
16
+ * </p>
17
+ *
18
+ * @author yansen
19
+ * @since 2021-04-15
20
+ */
21
+@Data
22
+@EqualsAndHashCode(callSuper = false)
23
+@Accessors(chain = true)
24
+@ApiModel(value="TaPointsLog对象", description="积分历史")
25
+public class TaPointsLog implements Serializable {
26
+
27
+    private static final long serialVersionUID = 1L;
28
+
29
+    @ApiModelProperty(value = "主键")
30
+    @TableId(value = "serial_no", type = IdType.AUTO)
31
+    private Integer serialNo;
32
+
33
+    @ApiModelProperty(value = "人员ID")
34
+    private String personId;
35
+
36
+    @ApiModelProperty(value = "积分")
37
+    private Integer pointsNum;
38
+
39
+    @ApiModelProperty(value = "学分")
40
+    private Integer creditNum;
41
+
42
+    @ApiModelProperty(value = "兑换比例")
43
+    private String ratio;
44
+
45
+    @ApiModelProperty(value = "资源类型")
46
+    private String targetType;
47
+
48
+    @ApiModelProperty(value = "资源ID")
49
+    private String targetId;
50
+
51
+    @ApiModelProperty(value = "状态")
52
+    private Integer status;
53
+
54
+    @ApiModelProperty(value = "创建时间")
55
+    private LocalDateTime createDate;
56
+
57
+    @ApiModelProperty(value = "更新时间")
58
+    private LocalDateTime updateDate;
59
+
60
+
61
+}

+ 88
- 0
src/main/java/com/yunzhi/demo/entity/TaPost.java Zobrazit soubor

@@ -0,0 +1,88 @@
1
+package com.yunzhi.demo.entity;
2
+
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import java.time.LocalDateTime;
5
+import com.baomidou.mybatisplus.annotation.TableId;
6
+import java.io.Serializable;
7
+import io.swagger.annotations.ApiModel;
8
+import io.swagger.annotations.ApiModelProperty;
9
+import lombok.Data;
10
+import lombok.EqualsAndHashCode;
11
+import lombok.experimental.Accessors;
12
+
13
+/**
14
+ * <p>
15
+ * 文章表
16
+ * </p>
17
+ *
18
+ * @author yansen
19
+ * @since 2021-04-15
20
+ */
21
+@Data
22
+@EqualsAndHashCode(callSuper = false)
23
+@Accessors(chain = true)
24
+@ApiModel(value="TaPost对象", description="文章表")
25
+public class TaPost implements Serializable {
26
+
27
+    private static final long serialVersionUID = 1L;
28
+
29
+    @ApiModelProperty(value = "文章ID")
30
+    @TableId(value = "post_id", type = IdType.UUID)
31
+    private String postId;
32
+
33
+    @ApiModelProperty(value = "名称")
34
+    private String name;
35
+
36
+    @ApiModelProperty(value = "作者")
37
+    private String author;
38
+
39
+    @ApiModelProperty(value = "分类")
40
+    private String typeId;
41
+
42
+    @ApiModelProperty(value = "分类名称")
43
+    private String typeName;
44
+
45
+    @ApiModelProperty(value = "发布时间")
46
+    private String publishDate;
47
+
48
+    @ApiModelProperty(value = "封面")
49
+    private String poster;
50
+
51
+    @ApiModelProperty(value = "简介")
52
+    private String summary;
53
+
54
+    @ApiModelProperty(value = "正文")
55
+    private String content;
56
+
57
+    @ApiModelProperty(value = "是否视频")
58
+    private Boolean isVideo;
59
+
60
+    @ApiModelProperty(value = "视频地址")
61
+    private String videoUrl;
62
+
63
+    @ApiModelProperty(value = "标签组")
64
+    private String tags;
65
+
66
+    @ApiModelProperty(value = "权重")
67
+    private Integer weight;
68
+
69
+    @ApiModelProperty(value = "是否热门")
70
+    private Boolean isTopic;
71
+
72
+    @ApiModelProperty(value = "答题个数")
73
+    private Integer answerNum;
74
+
75
+    @ApiModelProperty(value = "积分")
76
+    private Integer points;
77
+
78
+    @ApiModelProperty(value = "状态")
79
+    private Integer status;
80
+
81
+    @ApiModelProperty(value = "创建时间")
82
+    private LocalDateTime createDate;
83
+
84
+    @ApiModelProperty(value = "更新时间")
85
+    private LocalDateTime updateDate;
86
+
87
+
88
+}

+ 42
- 0
src/main/java/com/yunzhi/demo/entity/TaPostData.java Zobrazit soubor

@@ -0,0 +1,42 @@
1
+package com.yunzhi.demo.entity;
2
+
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableId;
5
+import java.io.Serializable;
6
+import io.swagger.annotations.ApiModel;
7
+import io.swagger.annotations.ApiModelProperty;
8
+import lombok.Data;
9
+import lombok.EqualsAndHashCode;
10
+import lombok.experimental.Accessors;
11
+
12
+/**
13
+ * <p>
14
+ * 文章统计
15
+ * </p>
16
+ *
17
+ * @author yansen
18
+ * @since 2021-04-15
19
+ */
20
+@Data
21
+@EqualsAndHashCode(callSuper = false)
22
+@Accessors(chain = true)
23
+@ApiModel(value="TaPostData对象", description="文章统计")
24
+public class TaPostData implements Serializable {
25
+
26
+    private static final long serialVersionUID = 1L;
27
+
28
+    @ApiModelProperty(value = "文章ID")
29
+    @TableId(value = "post_id", type = IdType.INPUT)
30
+    private String postId;
31
+
32
+    @ApiModelProperty(value = "阅读人数")
33
+    private Integer uV;
34
+
35
+    @ApiModelProperty(value = "浏览量")
36
+    private Integer pV;
37
+
38
+    @ApiModelProperty(value = "收藏")
39
+    private Integer savedNum;
40
+
41
+
42
+}

+ 49
- 0
src/main/java/com/yunzhi/demo/entity/TaPostSave.java Zobrazit soubor

@@ -0,0 +1,49 @@
1
+package com.yunzhi.demo.entity;
2
+
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableId;
5
+import java.time.LocalDateTime;
6
+import java.io.Serializable;
7
+import io.swagger.annotations.ApiModel;
8
+import io.swagger.annotations.ApiModelProperty;
9
+import lombok.Data;
10
+import lombok.EqualsAndHashCode;
11
+import lombok.experimental.Accessors;
12
+
13
+/**
14
+ * <p>
15
+ * 收藏
16
+ * </p>
17
+ *
18
+ * @author yansen
19
+ * @since 2021-04-15
20
+ */
21
+@Data
22
+@EqualsAndHashCode(callSuper = false)
23
+@Accessors(chain = true)
24
+@ApiModel(value="TaPostSave对象", description="收藏")
25
+public class TaPostSave implements Serializable {
26
+
27
+    private static final long serialVersionUID = 1L;
28
+
29
+    @ApiModelProperty(value = "主键")
30
+    @TableId(value = "serial_no", type = IdType.AUTO)
31
+    private Integer serialNo;
32
+
33
+    @ApiModelProperty(value = "人员ID")
34
+    private String personId;
35
+
36
+    @ApiModelProperty(value = "文章ID")
37
+    private String postId;
38
+
39
+    @ApiModelProperty(value = "状态")
40
+    private Integer status;
41
+
42
+    @ApiModelProperty(value = "创建时间")
43
+    private LocalDateTime createDate;
44
+
45
+    @ApiModelProperty(value = "更新时间")
46
+    private LocalDateTime updateDate;
47
+
48
+
49
+}

+ 67
- 0
src/main/java/com/yunzhi/demo/entity/TaPostTest.java Zobrazit soubor

@@ -0,0 +1,67 @@
1
+package com.yunzhi.demo.entity;
2
+
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableId;
5
+import java.time.LocalDateTime;
6
+import java.io.Serializable;
7
+import io.swagger.annotations.ApiModel;
8
+import io.swagger.annotations.ApiModelProperty;
9
+import lombok.Data;
10
+import lombok.EqualsAndHashCode;
11
+import lombok.experimental.Accessors;
12
+
13
+/**
14
+ * <p>
15
+ * 题库
16
+ * </p>
17
+ *
18
+ * @author yansen
19
+ * @since 2021-04-15
20
+ */
21
+@Data
22
+@EqualsAndHashCode(callSuper = false)
23
+@Accessors(chain = true)
24
+@ApiModel(value="TaPostTest对象", description="题库")
25
+public class TaPostTest implements Serializable {
26
+
27
+    private static final long serialVersionUID = 1L;
28
+
29
+    @ApiModelProperty(value = "主键")
30
+    @TableId(value = "serial_no", type = IdType.AUTO)
31
+    private Integer serialNo;
32
+
33
+    @ApiModelProperty(value = "关联文章")
34
+    private String postId;
35
+
36
+    @ApiModelProperty(value = "试题")
37
+    private String question;
38
+
39
+    @ApiModelProperty(value = "答案类型")
40
+    private String answerType;
41
+
42
+    @ApiModelProperty(value = "正确答案")
43
+    private String correctAnswers;
44
+
45
+    @ApiModelProperty(value = "选项A")
46
+    private String optionA;
47
+
48
+    @ApiModelProperty(value = "选项B")
49
+    private String optionB;
50
+
51
+    @ApiModelProperty(value = "选项C")
52
+    private String optionC;
53
+
54
+    @ApiModelProperty(value = "选项D")
55
+    private String optionD;
56
+
57
+    @ApiModelProperty(value = "状态")
58
+    private Integer status;
59
+
60
+    @ApiModelProperty(value = "创建时间")
61
+    private LocalDateTime createDate;
62
+
63
+    @ApiModelProperty(value = "更新时间")
64
+    private LocalDateTime updateDate;
65
+
66
+
67
+}

+ 55
- 0
src/main/java/com/yunzhi/demo/entity/TaReadLog.java Zobrazit soubor

@@ -0,0 +1,55 @@
1
+package com.yunzhi.demo.entity;
2
+
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableId;
5
+import java.time.LocalDateTime;
6
+import java.io.Serializable;
7
+import io.swagger.annotations.ApiModel;
8
+import io.swagger.annotations.ApiModelProperty;
9
+import lombok.Data;
10
+import lombok.EqualsAndHashCode;
11
+import lombok.experimental.Accessors;
12
+
13
+/**
14
+ * <p>
15
+ * 阅读记录
16
+ * </p>
17
+ *
18
+ * @author yansen
19
+ * @since 2021-04-15
20
+ */
21
+@Data
22
+@EqualsAndHashCode(callSuper = false)
23
+@Accessors(chain = true)
24
+@ApiModel(value="TaReadLog对象", description="阅读记录")
25
+public class TaReadLog implements Serializable {
26
+
27
+    private static final long serialVersionUID = 1L;
28
+
29
+    @ApiModelProperty(value = "主键")
30
+    @TableId(value = "serial_no", type = IdType.AUTO)
31
+    private Integer serialNo;
32
+
33
+    @ApiModelProperty(value = "人员ID")
34
+    private String personId;
35
+
36
+    @ApiModelProperty(value = "文章ID")
37
+    private String postId;
38
+
39
+    @ApiModelProperty(value = "标准时长 单位秒")
40
+    private Integer requireTimes;
41
+
42
+    @ApiModelProperty(value = "时长 单位秒")
43
+    private Integer duration;
44
+
45
+    @ApiModelProperty(value = "状态")
46
+    private Integer status;
47
+
48
+    @ApiModelProperty(value = "创建时间")
49
+    private LocalDateTime createDate;
50
+
51
+    @ApiModelProperty(value = "更新时间")
52
+    private LocalDateTime updateDate;
53
+
54
+
55
+}

+ 55
- 0
src/main/java/com/yunzhi/demo/entity/TaTestLog.java Zobrazit soubor

@@ -0,0 +1,55 @@
1
+package com.yunzhi.demo.entity;
2
+
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableId;
5
+import java.time.LocalDateTime;
6
+import java.io.Serializable;
7
+import io.swagger.annotations.ApiModel;
8
+import io.swagger.annotations.ApiModelProperty;
9
+import lombok.Data;
10
+import lombok.EqualsAndHashCode;
11
+import lombok.experimental.Accessors;
12
+
13
+/**
14
+ * <p>
15
+ * 体检记录
16
+ * </p>
17
+ *
18
+ * @author yansen
19
+ * @since 2021-04-15
20
+ */
21
+@Data
22
+@EqualsAndHashCode(callSuper = false)
23
+@Accessors(chain = true)
24
+@ApiModel(value="TaTestLog对象", description="体检记录")
25
+public class TaTestLog implements Serializable {
26
+
27
+    private static final long serialVersionUID = 1L;
28
+
29
+    @ApiModelProperty(value = "主键")
30
+    @TableId(value = "serial_no", type = IdType.AUTO)
31
+    private Integer serialNo;
32
+
33
+    @ApiModelProperty(value = "人员ID")
34
+    private String personId;
35
+
36
+    @ApiModelProperty(value = "报告名称")
37
+    private String name;
38
+
39
+    @ApiModelProperty(value = "报告时间 YYYY-MM-DD格式")
40
+    private String recordDate;
41
+
42
+    @ApiModelProperty(value = "报告内容")
43
+    private String attchment;
44
+
45
+    @ApiModelProperty(value = "状态")
46
+    private Integer status;
47
+
48
+    @ApiModelProperty(value = "创建时间")
49
+    private LocalDateTime createDate;
50
+
51
+    @ApiModelProperty(value = "更新时间")
52
+    private LocalDateTime updateDate;
53
+
54
+
55
+}

+ 51
- 0
src/main/java/com/yunzhi/demo/entity/TaTopic.java Zobrazit soubor

@@ -0,0 +1,51 @@
1
+package com.yunzhi.demo.entity;
2
+
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import java.time.LocalDateTime;
5
+import com.baomidou.mybatisplus.annotation.TableId;
6
+import java.io.Serializable;
7
+import io.swagger.annotations.ApiModel;
8
+import io.swagger.annotations.ApiModelProperty;
9
+import lombok.Data;
10
+import lombok.EqualsAndHashCode;
11
+import lombok.experimental.Accessors;
12
+
13
+/**
14
+ * <p>
15
+ * 热门
16
+ * </p>
17
+ *
18
+ * @author yansen
19
+ * @since 2021-04-15
20
+ */
21
+@Data
22
+@EqualsAndHashCode(callSuper = false)
23
+@Accessors(chain = true)
24
+@ApiModel(value="TaTopic对象", description="热门")
25
+public class TaTopic implements Serializable {
26
+
27
+    private static final long serialVersionUID = 1L;
28
+
29
+    @ApiModelProperty(value = "对象")
30
+    private String targetType;
31
+
32
+    @ApiModelProperty(value = "对象ID")
33
+    private String targetId;
34
+
35
+    @ApiModelProperty(value = "封面")
36
+    private String poster;
37
+
38
+    @ApiModelProperty(value = "序号")
39
+    private Integer sortNo;
40
+
41
+    @ApiModelProperty(value = "状态")
42
+    private Integer status;
43
+
44
+    @ApiModelProperty(value = "创建时间")
45
+    private LocalDateTime createDate;
46
+
47
+    @ApiModelProperty(value = "更新时间")
48
+    private LocalDateTime updateDate;
49
+
50
+
51
+}

+ 52
- 0
src/main/java/com/yunzhi/demo/entity/TdDepartment.java Zobrazit soubor

@@ -0,0 +1,52 @@
1
+package com.yunzhi.demo.entity;
2
+
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import java.time.LocalDateTime;
5
+import com.baomidou.mybatisplus.annotation.TableId;
6
+import java.io.Serializable;
7
+import io.swagger.annotations.ApiModel;
8
+import io.swagger.annotations.ApiModelProperty;
9
+import lombok.Data;
10
+import lombok.EqualsAndHashCode;
11
+import lombok.experimental.Accessors;
12
+
13
+/**
14
+ * <p>
15
+ * 科室
16
+ * </p>
17
+ *
18
+ * @author yansen
19
+ * @since 2021-04-15
20
+ */
21
+@Data
22
+@EqualsAndHashCode(callSuper = false)
23
+@Accessors(chain = true)
24
+@ApiModel(value="TdDepartment对象", description="科室")
25
+public class TdDepartment implements Serializable {
26
+
27
+    private static final long serialVersionUID = 1L;
28
+
29
+    @ApiModelProperty(value = "科室ID")
30
+    @TableId(value = "depart_id", type = IdType.INPUT)
31
+    private String departId;
32
+
33
+    @ApiModelProperty(value = "科室名称")
34
+    private String name;
35
+
36
+    @ApiModelProperty(value = "所属医务室")
37
+    private String hospitalId;
38
+
39
+    @ApiModelProperty(value = "排序")
40
+    private String sortNo;
41
+
42
+    @ApiModelProperty(value = "状态")
43
+    private Integer status;
44
+
45
+    @ApiModelProperty(value = "创建时间")
46
+    private LocalDateTime createDate;
47
+
48
+    @ApiModelProperty(value = "更新时间")
49
+    private LocalDateTime updateDate;
50
+
51
+
52
+}

+ 49
- 0
src/main/java/com/yunzhi/demo/entity/TdHospital.java Zobrazit soubor

@@ -0,0 +1,49 @@
1
+package com.yunzhi.demo.entity;
2
+
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import java.time.LocalDateTime;
5
+import com.baomidou.mybatisplus.annotation.TableId;
6
+import java.io.Serializable;
7
+import io.swagger.annotations.ApiModel;
8
+import io.swagger.annotations.ApiModelProperty;
9
+import lombok.Data;
10
+import lombok.EqualsAndHashCode;
11
+import lombok.experimental.Accessors;
12
+
13
+/**
14
+ * <p>
15
+ * 医务室
16
+ * </p>
17
+ *
18
+ * @author yansen
19
+ * @since 2021-04-15
20
+ */
21
+@Data
22
+@EqualsAndHashCode(callSuper = false)
23
+@Accessors(chain = true)
24
+@ApiModel(value="TdHospital对象", description="医务室")
25
+public class TdHospital implements Serializable {
26
+
27
+    private static final long serialVersionUID = 1L;
28
+
29
+    @ApiModelProperty(value = "医务室ID")
30
+    @TableId(value = "hospital_id", type = IdType.INPUT)
31
+    private String hospitalId;
32
+
33
+    @ApiModelProperty(value = "名称")
34
+    private String name;
35
+
36
+    @ApiModelProperty(value = "所属学校")
37
+    private String schoolId;
38
+
39
+    @ApiModelProperty(value = "状态")
40
+    private Integer status;
41
+
42
+    @ApiModelProperty(value = "创建时间")
43
+    private LocalDateTime createDate;
44
+
45
+    @ApiModelProperty(value = "更新时间")
46
+    private LocalDateTime updateDate;
47
+
48
+
49
+}

+ 55
- 0
src/main/java/com/yunzhi/demo/entity/TdPostType.java Zobrazit soubor

@@ -0,0 +1,55 @@
1
+package com.yunzhi.demo.entity;
2
+
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import java.time.LocalDateTime;
5
+import com.baomidou.mybatisplus.annotation.TableId;
6
+import java.io.Serializable;
7
+import io.swagger.annotations.ApiModel;
8
+import io.swagger.annotations.ApiModelProperty;
9
+import lombok.Data;
10
+import lombok.EqualsAndHashCode;
11
+import lombok.experimental.Accessors;
12
+
13
+/**
14
+ * <p>
15
+ * 文章分类
16
+ * </p>
17
+ *
18
+ * @author yansen
19
+ * @since 2021-04-15
20
+ */
21
+@Data
22
+@EqualsAndHashCode(callSuper = false)
23
+@Accessors(chain = true)
24
+@ApiModel(value="TdPostType对象", description="文章分类")
25
+public class TdPostType implements Serializable {
26
+
27
+    private static final long serialVersionUID = 1L;
28
+
29
+    @ApiModelProperty(value = "分类主键")
30
+    @TableId(value = "type_id", type = IdType.INPUT)
31
+    private String typeId;
32
+
33
+    @ApiModelProperty(value = "名称")
34
+    private String name;
35
+
36
+    @ApiModelProperty(value = "父级")
37
+    private String typePId;
38
+
39
+    @ApiModelProperty(value = "图标")
40
+    private String icon;
41
+
42
+    @ApiModelProperty(value = "排序")
43
+    private Integer sortNo;
44
+
45
+    @ApiModelProperty(value = "状态")
46
+    private Integer status;
47
+
48
+    @ApiModelProperty(value = "创建时间")
49
+    private LocalDateTime createDate;
50
+
51
+    @ApiModelProperty(value = "更新时间")
52
+    private LocalDateTime updateDate;
53
+
54
+
55
+}

+ 55
- 0
src/main/java/com/yunzhi/demo/entity/TdSchool.java Zobrazit soubor

@@ -0,0 +1,55 @@
1
+package com.yunzhi.demo.entity;
2
+
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import java.time.LocalDateTime;
5
+import com.baomidou.mybatisplus.annotation.TableId;
6
+import java.io.Serializable;
7
+import io.swagger.annotations.ApiModel;
8
+import io.swagger.annotations.ApiModelProperty;
9
+import lombok.Data;
10
+import lombok.EqualsAndHashCode;
11
+import lombok.experimental.Accessors;
12
+
13
+/**
14
+ * <p>
15
+ * 学校
16
+ * </p>
17
+ *
18
+ * @author yansen
19
+ * @since 2021-04-15
20
+ */
21
+@Data
22
+@EqualsAndHashCode(callSuper = false)
23
+@Accessors(chain = true)
24
+@ApiModel(value="TdSchool对象", description="学校")
25
+public class TdSchool implements Serializable {
26
+
27
+    private static final long serialVersionUID = 1L;
28
+
29
+    @ApiModelProperty(value = "学校ID")
30
+    @TableId(value = "school_id", type = IdType.INPUT)
31
+    private String schoolId;
32
+
33
+    @ApiModelProperty(value = "名称")
34
+    private String name;
35
+
36
+    @ApiModelProperty(value = "校徽")
37
+    private String logo;
38
+
39
+    @ApiModelProperty(value = "简介")
40
+    private String desc;
41
+
42
+    @ApiModelProperty(value = "排序")
43
+    private Integer sortNo;
44
+
45
+    @ApiModelProperty(value = "状态")
46
+    private Integer status;
47
+
48
+    @ApiModelProperty(value = "创建时间")
49
+    private LocalDateTime createDate;
50
+
51
+    @ApiModelProperty(value = "更新时间")
52
+    private LocalDateTime updateDate;
53
+
54
+
55
+}

+ 52
- 0
src/main/java/com/yunzhi/demo/entity/TdSpecialty.java Zobrazit soubor

@@ -0,0 +1,52 @@
1
+package com.yunzhi.demo.entity;
2
+
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import java.time.LocalDateTime;
5
+import com.baomidou.mybatisplus.annotation.TableId;
6
+import java.io.Serializable;
7
+import io.swagger.annotations.ApiModel;
8
+import io.swagger.annotations.ApiModelProperty;
9
+import lombok.Data;
10
+import lombok.EqualsAndHashCode;
11
+import lombok.experimental.Accessors;
12
+
13
+/**
14
+ * <p>
15
+ * 专业
16
+ * </p>
17
+ *
18
+ * @author yansen
19
+ * @since 2021-04-15
20
+ */
21
+@Data
22
+@EqualsAndHashCode(callSuper = false)
23
+@Accessors(chain = true)
24
+@ApiModel(value="TdSpecialty对象", description="专业")
25
+public class TdSpecialty implements Serializable {
26
+
27
+    private static final long serialVersionUID = 1L;
28
+
29
+    @ApiModelProperty(value = "主键")
30
+    @TableId(value = "specialty_id", type = IdType.INPUT)
31
+    private String specialtyId;
32
+
33
+    @ApiModelProperty(value = "名称")
34
+    private String name;
35
+
36
+    @ApiModelProperty(value = "所属学校")
37
+    private String schoolId;
38
+
39
+    @ApiModelProperty(value = "排序")
40
+    private Integer sortNo;
41
+
42
+    @ApiModelProperty(value = "状态")
43
+    private Integer status;
44
+
45
+    @ApiModelProperty(value = "创建时间")
46
+    private LocalDateTime createDate;
47
+
48
+    @ApiModelProperty(value = "更新时间")
49
+    private LocalDateTime updateDate;
50
+
51
+
52
+}

+ 19
- 0
src/main/java/com/yunzhi/demo/exception/GlobalExceptionHandler.java Zobrazit soubor

@@ -0,0 +1,19 @@
1
+package com.yunzhi.demo.exception;
2
+
3
+import com.yunzhi.demo.common.ResponseBean;
4
+import lombok.extern.slf4j.Slf4j;
5
+import org.springframework.web.bind.annotation.ExceptionHandler;
6
+import org.springframework.web.bind.annotation.ResponseBody;
7
+import org.springframework.web.bind.annotation.RestControllerAdvice;
8
+
9
+@Slf4j
10
+@RestControllerAdvice
11
+public class GlobalExceptionHandler {
12
+
13
+    @ResponseBody
14
+    @ExceptionHandler(Exception.class)
15
+    public ResponseBean handleException(Exception e){
16
+        log.error(e.getMessage(),e);
17
+        return ResponseBean.error(e.getMessage(), ResponseBean.ERROR_UNAVAILABLE);
18
+    }
19
+}

+ 61
- 0
src/main/java/com/yunzhi/demo/interceptor/PermissionInterceptor.java Zobrazit soubor

@@ -0,0 +1,61 @@
1
+package com.yunzhi.demo.interceptor;
2
+
3
+import com.alibaba.fastjson.JSONObject;
4
+import com.yunzhi.demo.common.CurrentContext;
5
+import com.yunzhi.demo.common.JWTUtils;
6
+import com.yunzhi.demo.common.ResponseBean;
7
+import com.yunzhi.demo.common.StringUtils;
8
+import com.yunzhi.demo.vo.TokenParam;
9
+import lombok.extern.slf4j.Slf4j;
10
+import org.springframework.stereotype.Component;
11
+import org.springframework.web.servlet.HandlerInterceptor;
12
+import org.springframework.web.servlet.ModelAndView;
13
+
14
+import javax.servlet.http.HttpServletRequest;
15
+import javax.servlet.http.HttpServletResponse;
16
+import java.io.IOException;
17
+import java.util.Map;
18
+
19
+
20
+@Slf4j
21
+@Component
22
+public class PermissionInterceptor implements HandlerInterceptor {
23
+
24
+    @Override
25
+    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object obj) throws Exception {
26
+        log.info("Request URI: {}", request.getRequestURI());
27
+
28
+        // JWT
29
+        String jws = JWTUtils.getToken(request);
30
+        if (StringUtils.isEmpty(jws)) {
31
+            responseTokenError(response, "鉴权失败, 请先进行登录操作");
32
+            return false;
33
+        }
34
+
35
+        try {
36
+            Map<String, Object> tokenMap = JWTUtils.decode(jws);
37
+            CurrentContext.setTokenParam(TokenParam.fromMap(tokenMap));
38
+        } catch (Exception e) {
39
+            log.error("鉴权失败: {}", e.getMessage());
40
+            responseTokenError(response, "鉴权失败, 请重新登录");
41
+            return false;
42
+        }
43
+
44
+        return true;
45
+    }
46
+
47
+    @Override
48
+    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object obj, ModelAndView mv) throws Exception {
49
+        // 刷新 TOKEN
50
+        String jws = JWTUtils.getToken(request);
51
+        JWTUtils.refresh(jws, response);
52
+    }
53
+
54
+    private void responseTokenError(HttpServletResponse response, String error) throws IOException {
55
+        response.addHeader("Content-type", "application/json");
56
+        response.getOutputStream().write(
57
+                JSONObject.toJSONBytes(
58
+                        ResponseBean.error(error, ResponseBean.ERROR_AUTH_FAIL)
59
+                ));
60
+    }
61
+}

+ 18
- 0
src/main/java/com/yunzhi/demo/mapper/SysBannerMapper.java Zobrazit soubor

@@ -0,0 +1,18 @@
1
+package com.yunzhi.demo.mapper;
2
+
3
+import com.yunzhi.demo.entity.SysBanner;
4
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5
+import org.apache.ibatis.annotations.Mapper;
6
+
7
+/**
8
+ * <p>
9
+ * 广告栏 Mapper 接口
10
+ * </p>
11
+ *
12
+ * @author yansen
13
+ * @since 2021-04-15
14
+ */
15
+@Mapper
16
+public interface SysBannerMapper extends BaseMapper<SysBanner> {
17
+
18
+}

+ 18
- 0
src/main/java/com/yunzhi/demo/mapper/SysConfigMapper.java Zobrazit soubor

@@ -0,0 +1,18 @@
1
+package com.yunzhi.demo.mapper;
2
+
3
+import com.yunzhi.demo.entity.SysConfig;
4
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5
+import org.apache.ibatis.annotations.Mapper;
6
+
7
+/**
8
+ * <p>
9
+ * 系统设定 Mapper 接口
10
+ * </p>
11
+ *
12
+ * @author yansen
13
+ * @since 2021-04-15
14
+ */
15
+@Mapper
16
+public interface SysConfigMapper extends BaseMapper<SysConfig> {
17
+
18
+}

+ 18
- 0
src/main/java/com/yunzhi/demo/mapper/SysLoginMapper.java Zobrazit soubor

@@ -0,0 +1,18 @@
1
+package com.yunzhi.demo.mapper;
2
+
3
+import com.yunzhi.demo.entity.SysLogin;
4
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5
+import org.apache.ibatis.annotations.Mapper;
6
+
7
+/**
8
+ * <p>
9
+ * 用户登录 Mapper 接口
10
+ * </p>
11
+ *
12
+ * @author yansen
13
+ * @since 2021-04-15
14
+ */
15
+@Mapper
16
+public interface SysLoginMapper extends BaseMapper<SysLogin> {
17
+
18
+}

+ 21
- 0
src/main/java/com/yunzhi/demo/mapper/SysMenuMapper.java Zobrazit soubor

@@ -0,0 +1,21 @@
1
+package com.yunzhi.demo.mapper;
2
+
3
+import com.yunzhi.demo.entity.SysMenu;
4
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5
+import org.apache.ibatis.annotations.Mapper;
6
+
7
+import java.util.List;
8
+
9
+/**
10
+ * <p>
11
+ * 菜单管理 Mapper 接口
12
+ * </p>
13
+ *
14
+ * @author yansen
15
+ * @since 2021-04-15
16
+ */
17
+@Mapper
18
+public interface SysMenuMapper extends BaseMapper<SysMenu> {
19
+
20
+    List<SysMenu> getListWithRoles();
21
+}

+ 18
- 0
src/main/java/com/yunzhi/demo/mapper/SysRoleMapper.java Zobrazit soubor

@@ -0,0 +1,18 @@
1
+package com.yunzhi.demo.mapper;
2
+
3
+import com.yunzhi.demo.entity.SysRole;
4
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5
+import org.apache.ibatis.annotations.Mapper;
6
+
7
+/**
8
+ * <p>
9
+ * 角色 Mapper 接口
10
+ * </p>
11
+ *
12
+ * @author yansen
13
+ * @since 2021-04-15
14
+ */
15
+@Mapper
16
+public interface SysRoleMapper extends BaseMapper<SysRole> {
17
+
18
+}

+ 18
- 0
src/main/java/com/yunzhi/demo/mapper/SysRoleMenuMapper.java Zobrazit soubor

@@ -0,0 +1,18 @@
1
+package com.yunzhi.demo.mapper;
2
+
3
+import com.yunzhi.demo.entity.SysRoleMenu;
4
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5
+import org.apache.ibatis.annotations.Mapper;
6
+
7
+/**
8
+ * <p>
9
+ * 角色菜单 Mapper 接口
10
+ * </p>
11
+ *
12
+ * @author yansen
13
+ * @since 2021-04-15
14
+ */
15
+@Mapper
16
+public interface SysRoleMenuMapper extends BaseMapper<SysRoleMenu> {
17
+
18
+}

+ 18
- 0
src/main/java/com/yunzhi/demo/mapper/SysUserMapper.java Zobrazit soubor

@@ -0,0 +1,18 @@
1
+package com.yunzhi.demo.mapper;
2
+
3
+import com.yunzhi.demo.entity.SysUser;
4
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5
+import org.apache.ibatis.annotations.Mapper;
6
+
7
+/**
8
+ * <p>
9
+ * 用户 Mapper 接口
10
+ * </p>
11
+ *
12
+ * @author yansen
13
+ * @since 2021-04-15
14
+ */
15
+@Mapper
16
+public interface SysUserMapper extends BaseMapper<SysUser> {
17
+
18
+}

+ 18
- 0
src/main/java/com/yunzhi/demo/mapper/SysUserRoleMapper.java Zobrazit soubor

@@ -0,0 +1,18 @@
1
+package com.yunzhi.demo.mapper;
2
+
3
+import com.yunzhi.demo.entity.SysUserRole;
4
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5
+import org.apache.ibatis.annotations.Mapper;
6
+
7
+/**
8
+ * <p>
9
+ * 用户角色 Mapper 接口
10
+ * </p>
11
+ *
12
+ * @author yansen
13
+ * @since 2021-04-15
14
+ */
15
+@Mapper
16
+public interface SysUserRoleMapper extends BaseMapper<SysUserRole> {
17
+
18
+}

+ 18
- 0
src/main/java/com/yunzhi/demo/mapper/TaMedicalLogMapper.java Zobrazit soubor

@@ -0,0 +1,18 @@
1
+package com.yunzhi.demo.mapper;
2
+
3
+import com.yunzhi.demo.entity.TaMedicalLog;
4
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5
+import org.apache.ibatis.annotations.Mapper;
6
+
7
+/**
8
+ * <p>
9
+ * 就诊记录 Mapper 接口
10
+ * </p>
11
+ *
12
+ * @author yansen
13
+ * @since 2021-04-15
14
+ */
15
+@Mapper
16
+public interface TaMedicalLogMapper extends BaseMapper<TaMedicalLog> {
17
+
18
+}

+ 18
- 0
src/main/java/com/yunzhi/demo/mapper/TaPersonDataMapper.java Zobrazit soubor

@@ -0,0 +1,18 @@
1
+package com.yunzhi.demo.mapper;
2
+
3
+import com.yunzhi.demo.entity.TaPersonData;
4
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5
+import org.apache.ibatis.annotations.Mapper;
6
+
7
+/**
8
+ * <p>
9
+ * 人员统计 Mapper 接口
10
+ * </p>
11
+ *
12
+ * @author yansen
13
+ * @since 2021-04-15
14
+ */
15
+@Mapper
16
+public interface TaPersonDataMapper extends BaseMapper<TaPersonData> {
17
+
18
+}

+ 18
- 0
src/main/java/com/yunzhi/demo/mapper/TaPersonMapper.java Zobrazit soubor

@@ -0,0 +1,18 @@
1
+package com.yunzhi.demo.mapper;
2
+
3
+import com.yunzhi.demo.entity.TaPerson;
4
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5
+import org.apache.ibatis.annotations.Mapper;
6
+
7
+/**
8
+ * <p>
9
+ * 人员 Mapper 接口
10
+ * </p>
11
+ *
12
+ * @author yansen
13
+ * @since 2021-04-15
14
+ */
15
+@Mapper
16
+public interface TaPersonMapper extends BaseMapper<TaPerson> {
17
+
18
+}

+ 18
- 0
src/main/java/com/yunzhi/demo/mapper/TaPointsLogMapper.java Zobrazit soubor

@@ -0,0 +1,18 @@
1
+package com.yunzhi.demo.mapper;
2
+
3
+import com.yunzhi.demo.entity.TaPointsLog;
4
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5
+import org.apache.ibatis.annotations.Mapper;
6
+
7
+/**
8
+ * <p>
9
+ * 积分历史 Mapper 接口
10
+ * </p>
11
+ *
12
+ * @author yansen
13
+ * @since 2021-04-15
14
+ */
15
+@Mapper
16
+public interface TaPointsLogMapper extends BaseMapper<TaPointsLog> {
17
+
18
+}

+ 18
- 0
src/main/java/com/yunzhi/demo/mapper/TaPostDataMapper.java Zobrazit soubor

@@ -0,0 +1,18 @@
1
+package com.yunzhi.demo.mapper;
2
+
3
+import com.yunzhi.demo.entity.TaPostData;
4
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5
+import org.apache.ibatis.annotations.Mapper;
6
+
7
+/**
8
+ * <p>
9
+ * 文章统计 Mapper 接口
10
+ * </p>
11
+ *
12
+ * @author yansen
13
+ * @since 2021-04-15
14
+ */
15
+@Mapper
16
+public interface TaPostDataMapper extends BaseMapper<TaPostData> {
17
+
18
+}

+ 18
- 0
src/main/java/com/yunzhi/demo/mapper/TaPostMapper.java Zobrazit soubor

@@ -0,0 +1,18 @@
1
+package com.yunzhi.demo.mapper;
2
+
3
+import com.yunzhi.demo.entity.TaPost;
4
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5
+import org.apache.ibatis.annotations.Mapper;
6
+
7
+/**
8
+ * <p>
9
+ * 文章表 Mapper 接口
10
+ * </p>
11
+ *
12
+ * @author yansen
13
+ * @since 2021-04-15
14
+ */
15
+@Mapper
16
+public interface TaPostMapper extends BaseMapper<TaPost> {
17
+
18
+}

+ 18
- 0
src/main/java/com/yunzhi/demo/mapper/TaPostSaveMapper.java Zobrazit soubor

@@ -0,0 +1,18 @@
1
+package com.yunzhi.demo.mapper;
2
+
3
+import com.yunzhi.demo.entity.TaPostSave;
4
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5
+import org.apache.ibatis.annotations.Mapper;
6
+
7
+/**
8
+ * <p>
9
+ * 收藏 Mapper 接口
10
+ * </p>
11
+ *
12
+ * @author yansen
13
+ * @since 2021-04-15
14
+ */
15
+@Mapper
16
+public interface TaPostSaveMapper extends BaseMapper<TaPostSave> {
17
+
18
+}

+ 18
- 0
src/main/java/com/yunzhi/demo/mapper/TaPostTestMapper.java Zobrazit soubor

@@ -0,0 +1,18 @@
1
+package com.yunzhi.demo.mapper;
2
+
3
+import com.yunzhi.demo.entity.TaPostTest;
4
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5
+import org.apache.ibatis.annotations.Mapper;
6
+
7
+/**
8
+ * <p>
9
+ * 题库 Mapper 接口
10
+ * </p>
11
+ *
12
+ * @author yansen
13
+ * @since 2021-04-15
14
+ */
15
+@Mapper
16
+public interface TaPostTestMapper extends BaseMapper<TaPostTest> {
17
+
18
+}

+ 18
- 0
src/main/java/com/yunzhi/demo/mapper/TaReadLogMapper.java Zobrazit soubor

@@ -0,0 +1,18 @@
1
+package com.yunzhi.demo.mapper;
2
+
3
+import com.yunzhi.demo.entity.TaReadLog;
4
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5
+import org.apache.ibatis.annotations.Mapper;
6
+
7
+/**
8
+ * <p>
9
+ * 阅读记录 Mapper 接口
10
+ * </p>
11
+ *
12
+ * @author yansen
13
+ * @since 2021-04-15
14
+ */
15
+@Mapper
16
+public interface TaReadLogMapper extends BaseMapper<TaReadLog> {
17
+
18
+}

+ 18
- 0
src/main/java/com/yunzhi/demo/mapper/TaTestLogMapper.java Zobrazit soubor

@@ -0,0 +1,18 @@
1
+package com.yunzhi.demo.mapper;
2
+
3
+import com.yunzhi.demo.entity.TaTestLog;
4
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5
+import org.apache.ibatis.annotations.Mapper;
6
+
7
+/**
8
+ * <p>
9
+ * 体检记录 Mapper 接口
10
+ * </p>
11
+ *
12
+ * @author yansen
13
+ * @since 2021-04-15
14
+ */
15
+@Mapper
16
+public interface TaTestLogMapper extends BaseMapper<TaTestLog> {
17
+
18
+}

+ 18
- 0
src/main/java/com/yunzhi/demo/mapper/TaTopicMapper.java Zobrazit soubor

@@ -0,0 +1,18 @@
1
+package com.yunzhi.demo.mapper;
2
+
3
+import com.yunzhi.demo.entity.TaTopic;
4
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5
+import org.apache.ibatis.annotations.Mapper;
6
+
7
+/**
8
+ * <p>
9
+ * 热门 Mapper 接口
10
+ * </p>
11
+ *
12
+ * @author yansen
13
+ * @since 2021-04-15
14
+ */
15
+@Mapper
16
+public interface TaTopicMapper extends BaseMapper<TaTopic> {
17
+
18
+}

+ 18
- 0
src/main/java/com/yunzhi/demo/mapper/TdDepartmentMapper.java Zobrazit soubor

@@ -0,0 +1,18 @@
1
+package com.yunzhi.demo.mapper;
2
+
3
+import com.yunzhi.demo.entity.TdDepartment;
4
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5
+import org.apache.ibatis.annotations.Mapper;
6
+
7
+/**
8
+ * <p>
9
+ * 科室 Mapper 接口
10
+ * </p>
11
+ *
12
+ * @author yansen
13
+ * @since 2021-04-15
14
+ */
15
+@Mapper
16
+public interface TdDepartmentMapper extends BaseMapper<TdDepartment> {
17
+
18
+}

+ 18
- 0
src/main/java/com/yunzhi/demo/mapper/TdHospitalMapper.java Zobrazit soubor

@@ -0,0 +1,18 @@
1
+package com.yunzhi.demo.mapper;
2
+
3
+import com.yunzhi.demo.entity.TdHospital;
4
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5
+import org.apache.ibatis.annotations.Mapper;
6
+
7
+/**
8
+ * <p>
9
+ * 医务室 Mapper 接口
10
+ * </p>
11
+ *
12
+ * @author yansen
13
+ * @since 2021-04-15
14
+ */
15
+@Mapper
16
+public interface TdHospitalMapper extends BaseMapper<TdHospital> {
17
+
18
+}

+ 18
- 0
src/main/java/com/yunzhi/demo/mapper/TdPostTypeMapper.java Zobrazit soubor

@@ -0,0 +1,18 @@
1
+package com.yunzhi.demo.mapper;
2
+
3
+import com.yunzhi.demo.entity.TdPostType;
4
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5
+import org.apache.ibatis.annotations.Mapper;
6
+
7
+/**
8
+ * <p>
9
+ * 文章分类 Mapper 接口
10
+ * </p>
11
+ *
12
+ * @author yansen
13
+ * @since 2021-04-15
14
+ */
15
+@Mapper
16
+public interface TdPostTypeMapper extends BaseMapper<TdPostType> {
17
+
18
+}

+ 18
- 0
src/main/java/com/yunzhi/demo/mapper/TdSchoolMapper.java Zobrazit soubor

@@ -0,0 +1,18 @@
1
+package com.yunzhi.demo.mapper;
2
+
3
+import com.yunzhi.demo.entity.TdSchool;
4
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5
+import org.apache.ibatis.annotations.Mapper;
6
+
7
+/**
8
+ * <p>
9
+ * 学校 Mapper 接口
10
+ * </p>
11
+ *
12
+ * @author yansen
13
+ * @since 2021-04-15
14
+ */
15
+@Mapper
16
+public interface TdSchoolMapper extends BaseMapper<TdSchool> {
17
+
18
+}

+ 18
- 0
src/main/java/com/yunzhi/demo/mapper/TdSpecialtyMapper.java Zobrazit soubor

@@ -0,0 +1,18 @@
1
+package com.yunzhi.demo.mapper;
2
+
3
+import com.yunzhi.demo.entity.TdSpecialty;
4
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5
+import org.apache.ibatis.annotations.Mapper;
6
+
7
+/**
8
+ * <p>
9
+ * 专业 Mapper 接口
10
+ * </p>
11
+ *
12
+ * @author yansen
13
+ * @since 2021-04-15
14
+ */
15
+@Mapper
16
+public interface TdSpecialtyMapper extends BaseMapper<TdSpecialty> {
17
+
18
+}

+ 0
- 0
src/main/java/com/yunzhi/demo/service/ISysBannerService.java Zobrazit soubor


Některé soubory nejsou zobrazny, neboť je v této revizi změněno mnoho souborů