Kaynağa Gözat

最新代码

Administrator 4 yıl önce
işleme
f507cba168
100 değiştirilmiş dosya ile 5054 ekleme ve 0 silme
  1. BIN
      .DS_Store
  2. 44 0
      .gitignore
  3. 20 0
      LICENSE
  4. 82 0
      README.md
  5. 12 0
      bin/clean.bat
  6. 12 0
      bin/package.bat
  7. 14 0
      bin/run.bat
  8. BIN
      doc/若依环境使用手册.docx
  9. 285 0
      pom.xml
  10. BIN
      ruoyi-admin/.DS_Store
  11. 108 0
      ruoyi-admin/pom.xml
  12. BIN
      ruoyi-admin/src/.DS_Store
  13. 31 0
      ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java
  14. 16 0
      ruoyi-admin/src/main/java/com/ruoyi/RuoYiServletInitializer.java
  15. 79 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CaptchaController.java
  16. 100 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java
  17. 217 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/ZbFileController.java
  18. 34 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/front/BannerController.java
  19. 91 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/front/CommentController.java
  20. 80 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/front/GalleryController.java
  21. 66 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/front/NoticeController.java
  22. 53 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/front/PicToPicController.java
  23. 42 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/front/PictureStoreController.java
  24. 113 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/gallery/ZbCommentController.java
  25. 117 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/gallery/ZbGalleryCategoryController.java
  26. 100 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/gallery/ZbGalleryController.java
  27. 104 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/gallery/ZbGalleryImgController.java
  28. 84 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/gallery/ZbPicToPicController.java
  29. 99 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/gallery/ZbPictureStoryController.java
  30. 28 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/ServerController.java
  31. 65 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysLogininforController.java
  32. 64 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysOperlogController.java
  33. 82 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysUserOnlineController.java
  34. 120 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysConfigController.java
  35. 133 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java
  36. 101 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictDataController.java
  37. 116 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictTypeController.java
  38. 95 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java
  39. 133 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysMenuController.java
  40. 85 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysNoticeController.java
  41. 119 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysPostController.java
  42. 111 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java
  43. 160 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java
  44. 186 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java
  45. 116 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/ZbAccessInfoController.java
  46. 104 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/ZbBannerController.java
  47. 24 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/SwaggerController.java
  48. 175 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/TestController.java
  49. 128 0
      ruoyi-admin/src/main/java/com/ruoyi/web/core/config/SwaggerConfig.java
  50. 22 0
      ruoyi-admin/src/main/java/com/ruoyi/web/core/config/WebConfig.java
  51. 78 0
      ruoyi-admin/src/main/java/com/ruoyi/web/core/inteceptors/AccessInterceptor.java
  52. 1 0
      ruoyi-admin/src/main/resources/META-INF/spring-devtools.properties
  53. 57 0
      ruoyi-admin/src/main/resources/application-druid.yml
  54. 191 0
      ruoyi-admin/src/main/resources/application-prod.yml
  55. 191 0
      ruoyi-admin/src/main/resources/application.yml
  56. 36 0
      ruoyi-admin/src/main/resources/i18n/messages.properties
  57. 93 0
      ruoyi-admin/src/main/resources/logback.xml
  58. BIN
      ruoyi-admin/src/main/resources/static/admin/favicon.ico
  59. 183 0
      ruoyi-admin/src/main/resources/static/admin/index.html
  60. 2 0
      ruoyi-admin/src/main/resources/static/admin/robots.txt
  61. 0 0
      ruoyi-admin/src/main/resources/static/admin/static/css/app.28bc501d.css
  62. 1 0
      ruoyi-admin/src/main/resources/static/admin/static/css/chunk-07e0cbc6.ab1588c9.css
  63. 0 0
      ruoyi-admin/src/main/resources/static/admin/static/css/chunk-2e6501c0.6c0ee1bf.css
  64. 1 0
      ruoyi-admin/src/main/resources/static/admin/static/css/chunk-345dd7f2.9183fc08.css
  65. 0 0
      ruoyi-admin/src/main/resources/static/admin/static/css/chunk-3e4360fd.d328a3ec.css
  66. 1 0
      ruoyi-admin/src/main/resources/static/admin/static/css/chunk-4b9a8bde.1196dae5.css
  67. 1 0
      ruoyi-admin/src/main/resources/static/admin/static/css/chunk-6daffd8a.03d4965d.css
  68. 12 0
      ruoyi-admin/src/main/resources/static/admin/static/css/chunk-79137a56.1f0a25b2.css
  69. 4 0
      ruoyi-admin/src/main/resources/static/admin/static/css/chunk-9e5fc220.84f98409.css
  70. 0 0
      ruoyi-admin/src/main/resources/static/admin/static/css/chunk-a7653e4c.0f159fef.css
  71. 0 0
      ruoyi-admin/src/main/resources/static/admin/static/css/chunk-c28ad000.cf54ef51.css
  72. 0 0
      ruoyi-admin/src/main/resources/static/admin/static/css/chunk-libs.3dfb7769.css
  73. BIN
      ruoyi-admin/src/main/resources/static/admin/static/fonts/element-icons.535877f5.woff
  74. BIN
      ruoyi-admin/src/main/resources/static/admin/static/fonts/element-icons.732389de.ttf
  75. BIN
      ruoyi-admin/src/main/resources/static/admin/static/img/401.089007e7.gif
  76. BIN
      ruoyi-admin/src/main/resources/static/admin/static/img/404.a57b6f31.png
  77. BIN
      ruoyi-admin/src/main/resources/static/admin/static/img/404_cloud.0f4bc32b.png
  78. BIN
      ruoyi-admin/src/main/resources/static/admin/static/img/login-background.f9f49138.jpg
  79. BIN
      ruoyi-admin/src/main/resources/static/admin/static/img/logo.4eeb8a8e.png
  80. BIN
      ruoyi-admin/src/main/resources/static/admin/static/img/profile.473f5971.jpg
  81. 0 0
      ruoyi-admin/src/main/resources/static/admin/static/js/app.fcefae5b.js
  82. 0 0
      ruoyi-admin/src/main/resources/static/admin/static/js/chunk-07e0cbc6.dd198dae.js
  83. 0 0
      ruoyi-admin/src/main/resources/static/admin/static/js/chunk-08486bce.d4e31f2d.js
  84. 0 0
      ruoyi-admin/src/main/resources/static/admin/static/js/chunk-2d0a2db2.e8344dfd.js
  85. 14 0
      ruoyi-admin/src/main/resources/static/admin/static/js/chunk-2d0d6345.6ed54a0c.js
  86. 0 0
      ruoyi-admin/src/main/resources/static/admin/static/js/chunk-2d0e2366.64c0e5da.js
  87. 1 0
      ruoyi-admin/src/main/resources/static/admin/static/js/chunk-2d0f012d.cc12ba57.js
  88. 0 0
      ruoyi-admin/src/main/resources/static/admin/static/js/chunk-2e6501c0.c3c40ac0.js
  89. 1 0
      ruoyi-admin/src/main/resources/static/admin/static/js/chunk-345dd7f2.de04953a.js
  90. 0 0
      ruoyi-admin/src/main/resources/static/admin/static/js/chunk-3e4360fd.c161f5c1.js
  91. 0 0
      ruoyi-admin/src/main/resources/static/admin/static/js/chunk-3f93175c.04b38f89.js
  92. 0 0
      ruoyi-admin/src/main/resources/static/admin/static/js/chunk-4b9a8bde.2b9c2dd9.js
  93. 0 0
      ruoyi-admin/src/main/resources/static/admin/static/js/chunk-582bd6c0.290ee44f.js
  94. 6 0
      ruoyi-admin/src/main/resources/static/admin/static/js/chunk-66d86650.a4a75928.js
  95. 0 0
      ruoyi-admin/src/main/resources/static/admin/static/js/chunk-6daffd8a.7c901850.js
  96. 9 0
      ruoyi-admin/src/main/resources/static/admin/static/js/chunk-79137a56.a4eec904.js
  97. 0 0
      ruoyi-admin/src/main/resources/static/admin/static/js/chunk-9e5fc220.5692a30f.js
  98. 0 0
      ruoyi-admin/src/main/resources/static/admin/static/js/chunk-a7653e4c.e96f4f86.js
  99. 1 0
      ruoyi-admin/src/main/resources/static/admin/static/js/chunk-c28ad000.e254f1f3.js
  100. 0 0
      ruoyi-admin/src/main/resources/static/admin/static/js/chunk-d19c1a98.27a461e6.js

BIN
.DS_Store


+ 44 - 0
.gitignore

@@ -0,0 +1,44 @@
+######################################################################
+# Build Tools
+
+.gradle
+/build/
+!gradle/wrapper/gradle-wrapper.jar
+
+target/
+!.mvn/wrapper/maven-wrapper.jar
+
+######################################################################
+# IDE
+
+### STS ###
+.apt_generated
+.classpath
+.factorypath
+.project
+.settings
+.springBeans
+
+### IntelliJ IDEA ###
+.idea
+*.iws
+*.iml
+*.ipr
+
+### NetBeans ###
+nbproject/private/
+build/*
+nbbuild/
+dist/
+nbdist/
+.nb-gradle/
+
+######################################################################
+# Others
+*.log
+*.xml.versionsBackup
+*.swp
+
+!*/build/*.java
+!*/build/*.html
+!*/build/*.xml

+ 20 - 0
LICENSE

@@ -0,0 +1,20 @@
+The MIT License (MIT)
+
+Copyright (c) 2018 RuoYi
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+ 82 - 0
README.md

@@ -0,0 +1,82 @@
+## 平台简介
+
+* 前端采用Vue、Element UI。
+* 后端采用Spring Boot、Spring Security、Redis & Jwt。
+* 权限认证使用Jwt,支持多终端认证系统。
+* 支持加载动态权限菜单,多方式轻松权限控制。
+* 高效率开发,使用代码生成器可以一键生成前后端代码。
+* 提供了一个Oracle版本[RuoYi-Vue-Oracle](https://github.com/yangzongzhuan/RuoYi-Vue-Oracle),保持同步更新。
+* 不分离版本,请移步[RuoYi](https://gitee.com/y_project/RuoYi),微服务版本,请移步[RuoYi-Cloud](https://gitee.com/y_project/RuoYi-Cloud)
+* 感谢[Vue-Element-Admin](https://github.com/PanJiaChen/vue-element-admin),[eladmin-web](https://gitee.com/elunez/eladmin-web?_from=gitee_search)。
+* 阿里云折扣场:[点我进入](http://aly.ruoyi.vip),腾讯云秒杀场:[点我进入](http://txy.ruoyi.vip)  
+* 阿里云优惠券:[点我领取](https://www.aliyun.com/minisite/goods?userCode=brki8iof&share_source=copy_link),腾讯云优惠券:[点我领取](https://cloud.tencent.com/redirect.php?redirect=1025&cps_key=198c8df2ed259157187173bc7f4f32fd&from=console)  
+
+## 内置功能
+
+1.  用户管理:用户是系统操作者,该功能主要完成系统用户配置。
+2.  部门管理:配置系统组织机构(公司、部门、小组),树结构展现支持数据权限。
+3.  岗位管理:配置系统用户所属担任职务。
+4.  菜单管理:配置系统菜单,操作权限,按钮权限标识等。
+5.  角色管理:角色菜单权限分配、设置角色按机构进行数据范围权限划分。
+6.  字典管理:对系统中经常使用的一些较为固定的数据进行维护。
+7.  参数管理:对系统动态配置常用参数。
+8.  通知公告:系统通知公告信息发布维护。
+9.  操作日志:系统正常操作日志记录和查询;系统异常信息日志记录和查询。
+10. 登录日志:系统登录日志记录查询包含登录异常。
+11. 在线用户:当前系统中活跃用户状态监控。
+12. 定时任务:在线(添加、修改、删除)任务调度包含执行结果日志。
+13. 代码生成:前后端代码的生成(java、html、xml、sql)支持CRUD下载 。
+14. 系统接口:根据业务代码自动生成相关的api接口文档。
+15. 服务监控:监视当前系统CPU、内存、磁盘、堆栈等相关信息。
+16. 在线构建器:拖动表单元素生成相应的HTML代码。
+17. 连接池监视:监视当前系统数据库连接池状态,可进行分析SQL找出系统性能瓶颈。
+
+## 在线体验
+
+- admin/admin123  
+- 陆陆续续收到一些打赏,为了更好的体验已用于演示服务器升级。谢谢各位小伙伴。
+
+演示地址:http://vue.ruoyi.vip  
+文档地址:http://doc.ruoyi.vip
+
+## 演示图
+
+<table>
+    <tr>
+        <td><img src="https://oscimg.oschina.net/oscnet/cd1f90be5f2684f4560c9519c0f2a232ee8.jpg"/></td>
+        <td><img src="https://oscimg.oschina.net/oscnet/1cbcf0e6f257c7d3a063c0e3f2ff989e4b3.jpg"/></td>
+    </tr>
+    <tr>
+        <td><img src="https://oscimg.oschina.net/oscnet/up-8074972883b5ba0622e13246738ebba237a.png"/></td>
+        <td><img src="https://oscimg.oschina.net/oscnet/up-9f88719cdfca9af2e58b352a20e23d43b12.png"/></td>
+    </tr>
+    <tr>
+        <td><img src="https://oscimg.oschina.net/oscnet/up-39bf2584ec3a529b0d5a3b70d15c9b37646.png"/></td>
+        <td><img src="https://oscimg.oschina.net/oscnet/up-936ec82d1f4872e1bc980927654b6007307.png"/></td>
+    </tr>
+	<tr>
+        <td><img src="https://oscimg.oschina.net/oscnet/up-b2d62ceb95d2dd9b3fbe157bb70d26001e9.png"/></td>
+        <td><img src="https://oscimg.oschina.net/oscnet/up-d67451d308b7a79ad6819723396f7c3d77a.png"/></td>
+    </tr>	 
+    <tr>
+        <td><img src="https://oscimg.oschina.net/oscnet/5e8c387724954459291aafd5eb52b456f53.jpg"/></td>
+        <td><img src="https://oscimg.oschina.net/oscnet/644e78da53c2e92a95dfda4f76e6d117c4b.jpg"/></td>
+    </tr>
+	<tr>
+        <td><img src="https://oscimg.oschina.net/oscnet/up-8370a0d02977eebf6dbf854c8450293c937.png"/></td>
+        <td><img src="https://oscimg.oschina.net/oscnet/up-49003ed83f60f633e7153609a53a2b644f7.png"/></td>
+    </tr>
+	<tr>
+        <td><img src="https://oscimg.oschina.net/oscnet/up-d4fe726319ece268d4746602c39cffc0621.png"/></td>
+        <td><img src="https://oscimg.oschina.net/oscnet/up-c195234bbcd30be6927f037a6755e6ab69c.png"/></td>
+    </tr>
+    <tr>
+        <td><img src="https://oscimg.oschina.net/oscnet/b6115bc8c31de52951982e509930b20684a.jpg"/></td>
+        <td><img src="https://oscimg.oschina.net/oscnet/up-6d73c2140ce694e3de4c05035fdc1868d4c.png"/></td>
+    </tr>
+</table>
+
+
+## 若依前后端分离交流群
+
+QQ群: [![加入QQ群](https://img.shields.io/badge/已满-937441-blue.svg)](https://jq.qq.com/?_wv=1027&k=5bVB1og) [![加入QQ群](https://img.shields.io/badge/已满-887144332-blue.svg)](https://jq.qq.com/?_wv=1027&k=5eiA4DH) [![加入QQ群](https://img.shields.io/badge/已满-180251782-blue.svg)](https://jq.qq.com/?_wv=1027&k=5AxMKlC) [![加入QQ群](https://img.shields.io/badge/104180207-blue.svg)](https://jq.qq.com/?_wv=1027&k=51G72yr) 点击按钮入群。

+ 12 - 0
bin/clean.bat

@@ -0,0 +1,12 @@
+@echo off
+echo.
+echo [ÐÅÏ¢] ÇåÀíÉú³É·¾¶¡£
+echo.
+
+%~d0
+cd %~dp0
+
+cd ..
+call mvn clean
+
+pause

+ 12 - 0
bin/package.bat

@@ -0,0 +1,12 @@
+@echo off
+echo.
+echo [信息] 打包Web工程,生成war/jar包文件。
+echo.
+
+%~d0
+cd %~dp0
+
+cd ..
+call mvn clean package -Dmaven.test.skip=true
+
+pause

+ 14 - 0
bin/run.bat

@@ -0,0 +1,14 @@
+@echo off
+echo.
+echo [ÐÅÏ¢] ÔËÐÐWeb¹¤³Ì¡£
+echo.
+
+cd %~dp0
+cd ../ruoyi-admin/target
+
+set JAVA_OPTS=-Xms256m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m
+
+java -jar %JAVA_OPTS% ruoyi-admin.jar
+
+cd bin
+pause

BIN
doc/若依环境使用手册.docx


+ 285 - 0
pom.xml

@@ -0,0 +1,285 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <groupId>com.ruoyi</groupId>
+    <artifactId>ruoyi</artifactId>
+    <version>3.2.0</version>
+
+    <name>ruoyi</name>
+
+    <properties>
+        <ruoyi.version>3.2.0</ruoyi.version>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+        <java.version>1.8</java.version>
+        <maven-jar-plugin.version>3.1.1</maven-jar-plugin.version>
+        <druid.version>1.2.2</druid.version>
+        <bitwalker.version>1.19</bitwalker.version>
+        <swagger.version>2.9.2</swagger.version>
+        <kaptcha.version>2.3.2</kaptcha.version>
+        <pagehelper.boot.version>1.3.0</pagehelper.boot.version>
+        <fastjson.version>1.2.74</fastjson.version>
+        <oshi.version>5.2.5</oshi.version>
+        <jna.version>5.5.0</jna.version>
+        <commons.io.version>2.5</commons.io.version>
+        <commons.fileupload.version>1.3.3</commons.fileupload.version>
+        <poi.version>3.17</poi.version>
+        <velocity.version>1.7</velocity.version>
+        <jwt.version>0.9.1</jwt.version>
+        <mybatis.plus.version>3.4.1</mybatis.plus.version>
+        <spring.boot.version>2.1.17.RELEASE</spring.boot.version>
+        <hutool.version>5.4.7</hutool.version>
+    </properties>
+
+    <!-- 依赖声明 -->
+    <dependencyManagement>
+        <dependencies>
+
+            <!-- SpringBoot的依赖配置-->
+            <dependency>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-dependencies</artifactId>
+                <version>${spring.boot.version}</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+            <!--反射框架-->
+            <dependency>
+                <groupId>org.reflections</groupId>
+                <artifactId>reflections</artifactId>
+                <version>0.9.12</version>
+            </dependency>
+
+            <!--阿里数据库连接池 -->
+            <dependency>
+                <groupId>com.alibaba</groupId>
+                <artifactId>druid-spring-boot-starter</artifactId>
+                <version>${druid.version}</version>
+            </dependency>
+
+            <!-- 解析客户端操作系统、浏览器等 -->
+            <dependency>
+                <groupId>eu.bitwalker</groupId>
+                <artifactId>UserAgentUtils</artifactId>
+                <version>${bitwalker.version}</version>
+            </dependency>
+
+            <dependency>
+                <groupId>com.google.guava</groupId>
+                <artifactId>guava</artifactId>
+                <version>30.0-jre</version>
+            </dependency>
+
+            <dependency>
+                <groupId>cn.hutool</groupId>
+                <artifactId>hutool-cache</artifactId>
+                <version>${hutool.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>cn.hutool</groupId>
+                <artifactId>hutool-http</artifactId>
+                <version>${hutool.version}</version>
+            </dependency>
+
+            <!-- pagehelper 分页插件 -->
+            <dependency>
+                <groupId>com.baomidou</groupId>
+                <artifactId>mybatis-plus-boot-starter</artifactId>
+                <version>${mybatis.plus.version}</version>
+            </dependency>
+
+            <!-- 获取系统信息 -->
+            <dependency>
+                <groupId>com.github.oshi</groupId>
+                <artifactId>oshi-core</artifactId>
+                <version>${oshi.version}</version>
+            </dependency>
+
+            <dependency>
+                <groupId>net.java.dev.jna</groupId>
+                <artifactId>jna</artifactId>
+                <version>${jna.version}</version>
+            </dependency>
+
+            <dependency>
+                <groupId>net.java.dev.jna</groupId>
+                <artifactId>jna-platform</artifactId>
+                <version>${jna.version}</version>
+            </dependency>
+
+            <!-- swagger2-->
+            <dependency>
+                <groupId>io.springfox</groupId>
+                <artifactId>springfox-swagger2</artifactId>
+                <version>${swagger.version}</version>
+                <exclusions>
+                    <exclusion>
+                        <groupId>io.swagger</groupId>
+                        <artifactId>swagger-annotations</artifactId>
+                    </exclusion>
+                    <exclusion>
+                        <groupId>io.swagger</groupId>
+                        <artifactId>swagger-models</artifactId>
+                    </exclusion>
+                </exclusions>
+            </dependency>
+
+            <!-- swagger2-UI-->
+            <dependency>
+                <groupId>io.springfox</groupId>
+                <artifactId>springfox-swagger-ui</artifactId>
+                <version>${swagger.version}</version>
+            </dependency>
+
+            <!--io常用工具类 -->
+            <dependency>
+                <groupId>commons-io</groupId>
+                <artifactId>commons-io</artifactId>
+                <version>${commons.io.version}</version>
+            </dependency>
+
+            <!--文件上传工具类 -->
+            <dependency>
+                <groupId>commons-fileupload</groupId>
+                <artifactId>commons-fileupload</artifactId>
+                <version>${commons.fileupload.version}</version>
+            </dependency>
+
+            <!-- excel工具 -->
+            <dependency>
+                <groupId>org.apache.poi</groupId>
+                <artifactId>poi-ooxml</artifactId>
+                <version>${poi.version}</version>
+            </dependency>
+
+            <!--velocity代码生成使用模板 -->
+            <dependency>
+                <groupId>org.apache.velocity</groupId>
+                <artifactId>velocity</artifactId>
+                <version>${velocity.version}</version>
+            </dependency>
+
+            <!-- 阿里JSON解析器 -->
+            <dependency>
+                <groupId>com.alibaba</groupId>
+                <artifactId>fastjson</artifactId>
+                <version>${fastjson.version}</version>
+            </dependency>
+
+            <!--Token生成与解析-->
+            <dependency>
+                <groupId>io.jsonwebtoken</groupId>
+                <artifactId>jjwt</artifactId>
+                <version>${jwt.version}</version>
+            </dependency>
+
+            <!--验证码 -->
+            <dependency>
+                <groupId>com.github.penggle</groupId>
+                <artifactId>kaptcha</artifactId>
+                <version>${kaptcha.version}</version>
+            </dependency>
+
+            <!-- 定时任务-->
+            <dependency>
+                <groupId>com.ruoyi</groupId>
+                <artifactId>ruoyi-quartz</artifactId>
+                <version>${ruoyi.version}</version>
+            </dependency>
+
+            <!-- 代码生成-->
+            <dependency>
+                <groupId>com.ruoyi</groupId>
+                <artifactId>ruoyi-generator</artifactId>
+                <version>${ruoyi.version}</version>
+            </dependency>
+
+            <!-- 核心模块-->
+            <dependency>
+                <groupId>com.ruoyi</groupId>
+                <artifactId>ruoyi-framework</artifactId>
+                <version>${ruoyi.version}</version>
+            </dependency>
+
+            <!-- 系统模块-->
+            <dependency>
+                <groupId>com.ruoyi</groupId>
+                <artifactId>ruoyi-system</artifactId>
+                <version>${ruoyi.version}</version>
+            </dependency>
+
+            <!-- 通用工具-->
+            <dependency>
+                <groupId>com.ruoyi</groupId>
+                <artifactId>ruoyi-common</artifactId>
+                <version>${ruoyi.version}</version>
+            </dependency>
+
+            <dependency>
+                <groupId>com.drewnoakes</groupId>
+                <artifactId>metadata-extractor</artifactId>
+                <version>2.6.2</version>
+            </dependency>
+
+        </dependencies>
+    </dependencyManagement>
+
+    <modules>
+        <module>ruoyi-admin</module>
+        <module>ruoyi-framework</module>
+        <module>ruoyi-system</module>
+        <module>ruoyi-quartz</module>
+        <module>ruoyi-generator</module>
+        <module>ruoyi-common</module>
+    </modules>
+    <packaging>pom</packaging>
+
+
+    <dependencies>
+
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <version>3.1</version>
+                <configuration>
+                    <source>${java.version}</source>
+                    <target>${java.version}</target>
+                    <encoding>${project.build.sourceEncoding}</encoding>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
+    <repositories>
+        <repository>
+            <id>public</id>
+            <name>aliyun nexus</name>
+            <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
+            <releases>
+                <enabled>true</enabled>
+            </releases>
+        </repository>
+    </repositories>
+
+    <pluginRepositories>
+        <pluginRepository>
+            <id>public</id>
+            <name>aliyun nexus</name>
+            <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
+            <releases>
+                <enabled>true</enabled>
+            </releases>
+            <snapshots>
+                <enabled>false</enabled>
+            </snapshots>
+        </pluginRepository>
+    </pluginRepositories>
+
+</project>

BIN
ruoyi-admin/.DS_Store


+ 108 - 0
ruoyi-admin/pom.xml

@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>ruoyi</artifactId>
+        <groupId>com.ruoyi</groupId>
+        <version>3.2.0</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+    <packaging>jar</packaging>
+    <artifactId>ruoyi-admin</artifactId>
+
+    <description>
+        web服务入口
+    </description>
+
+    <dependencies>
+
+        <!-- spring-boot-devtools -->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-devtools</artifactId>
+            <optional>true</optional> <!-- 表示依赖不会传递 -->
+        </dependency>
+
+        <!-- swagger2-->
+        <dependency>
+            <groupId>io.springfox</groupId>
+            <artifactId>springfox-swagger2</artifactId>
+        </dependency>
+
+        <!--防止进入swagger页面报类型转换错误,排除2.9.2中的引用,手动增加1.5.21版本-->
+        <dependency>
+            <groupId>io.swagger</groupId>
+            <artifactId>swagger-annotations</artifactId>
+            <version>1.5.21</version>
+        </dependency>
+
+        <dependency>
+            <groupId>io.swagger</groupId>
+            <artifactId>swagger-models</artifactId>
+            <version>1.5.21</version>
+        </dependency>
+
+        <!-- swagger2-UI-->
+        <dependency>
+            <groupId>io.springfox</groupId>
+            <artifactId>springfox-swagger-ui</artifactId>
+        </dependency>
+
+         <!-- Mysql驱动包 -->
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+        </dependency>
+
+        <!-- 核心模块-->
+        <dependency>
+            <groupId>com.ruoyi</groupId>
+            <artifactId>ruoyi-framework</artifactId>
+        </dependency>
+
+        <!-- 定时任务-->
+        <dependency>
+            <groupId>com.ruoyi</groupId>
+            <artifactId>ruoyi-quartz</artifactId>
+        </dependency>
+
+        <!-- 代码生成-->
+        <dependency>
+            <groupId>com.ruoyi</groupId>
+            <artifactId>ruoyi-generator</artifactId>
+        </dependency>
+
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+                <version>2.1.1.RELEASE</version>
+                <configuration>
+                    <fork>true</fork> <!-- 如果没有该配置,devtools不会生效 -->
+                </configuration>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>repackage</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>   
+                <groupId>org.apache.maven.plugins</groupId>   
+                <artifactId>maven-war-plugin</artifactId>   
+                <version>3.1.0</version>   
+                <configuration>
+                    <failOnMissingWebXml>false</failOnMissingWebXml>
+                    <warName>${project.artifactId}</warName>
+                </configuration>   
+           </plugin>   
+        </plugins>
+        <finalName>${project.artifactId}</finalName>
+    </build>
+
+</project>

BIN
ruoyi-admin/src/.DS_Store


+ 31 - 0
ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java

@@ -0,0 +1,31 @@
+package com.ruoyi;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
+import org.springframework.context.annotation.EnableAspectJAutoProxy;
+import org.springframework.scheduling.annotation.EnableScheduling;
+
+/**
+ * 启动程序
+ *
+ * @author ruoyi
+ */
+@EnableAspectJAutoProxy
+@EnableScheduling
+@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
+public class RuoYiApplication {
+    public static void main(String[] args) {
+        SpringApplication.run(RuoYiApplication.class, args);
+        System.out.println("(♥◠‿◠)ノ゙  若依启动成功   ლ(´ڡ`ლ)゙  \n" +
+                " .-------.       ____     __        \n" +
+                " |  _ _   \\      \\   \\   /  /    \n" +
+                " | ( ' )  |       \\  _. /  '       \n" +
+                " |(_ o _) /        _( )_ .'         \n" +
+                " | (_,_).' __  ___(_ o _)'          \n" +
+                " |  |\\ \\  |  ||   |(_,_)'         \n" +
+                " |  | \\ `'   /|   `-'  /           \n" +
+                " |  |  \\    /  \\      /           \n" +
+                " ''-'   `'-'    `-..-'              ");
+    }
+}

+ 16 - 0
ruoyi-admin/src/main/java/com/ruoyi/RuoYiServletInitializer.java

@@ -0,0 +1,16 @@
+package com.ruoyi;
+
+import org.springframework.boot.builder.SpringApplicationBuilder;
+import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
+
+/**
+ * web容器中进行部署
+ *
+ * @author ruoyi
+ */
+public class RuoYiServletInitializer extends SpringBootServletInitializer {
+    @Override
+    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
+        return application.sources(RuoYiApplication.class);
+    }
+}

+ 79 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CaptchaController.java

@@ -0,0 +1,79 @@
+//package com.ruoyi.web.controller.common;
+//
+//import java.awt.image.BufferedImage;
+//import java.io.IOException;
+//import java.util.concurrent.TimeUnit;
+//import javax.annotation.Resource;
+//import javax.imageio.ImageIO;
+//import javax.servlet.http.HttpServletResponse;
+//
+//import org.springframework.beans.factory.annotation.Autowired;
+//import org.springframework.beans.factory.annotation.Value;
+//import org.springframework.util.FastByteArrayOutputStream;
+//import org.springframework.web.bind.annotation.GetMapping;
+//import org.springframework.web.bind.annotation.RestController;
+//import com.google.code.kaptcha.Producer;
+//import com.ruoyi.common.constant.Constants;
+//import com.ruoyi.common.core.domain.AjaxResult;
+////import com.ruoyi.common.core.redis.RedisCache;
+//import com.ruoyi.common.utils.sign.Base64;
+//import com.ruoyi.common.utils.uuid.IdUtils;
+//
+///**
+// * 验证码操作处理
+// *
+// * @author ruoyi
+// */
+//@RestController
+//public class CaptchaController {
+//    @Resource(name = "captchaProducer")
+//    private Producer captchaProducer;
+//
+//    @Resource(name = "captchaProducerMath")
+//    private Producer captchaProducerMath;
+//
+////    @Autowired
+////    private RedisCache redisCache;
+//
+//    // 验证码类型
+//    @Value("${ruoyi.captchaType}")
+//    private String captchaType;
+//
+//    /**
+//     * 生成验证码
+//     */
+//    @GetMapping("/captchaImage")
+//    public AjaxResult getCode(HttpServletResponse response) throws IOException {
+//        // 保存验证码信息
+//        String uuid = IdUtils.simpleUUID();
+//        String verifyKey = Constants.CAPTCHA_CODE_KEY + uuid;
+//
+//        String capStr = null, code = null;
+//        BufferedImage image = null;
+//
+//        // 生成验证码
+//        if ("math".equals(captchaType)) {
+//            String capText = captchaProducerMath.createText();
+//            capStr = capText.substring(0, capText.lastIndexOf("@"));
+//            code = capText.substring(capText.lastIndexOf("@") + 1);
+//            image = captchaProducerMath.createImage(capStr);
+//        } else if ("char".equals(captchaType)) {
+//            capStr = code = captchaProducer.createText();
+//            image = captchaProducer.createImage(capStr);
+//        }
+//
+////        redisCache.setCacheObject(verifyKey, code, Constants.CAPTCHA_EXPIRATION, TimeUnit.MINUTES);
+//        // 转换流信息写出
+//        FastByteArrayOutputStream os = new FastByteArrayOutputStream();
+//        try {
+//            ImageIO.write(image, "jpg", os);
+//        } catch (IOException e) {
+//            return AjaxResult.error(e.getMessage());
+//        }
+//
+//        AjaxResult ajax = AjaxResult.success();
+//        ajax.put("uuid", uuid);
+//        ajax.put("img", Base64.encode(os.toByteArray()));
+//        return ajax;
+//    }
+//}

+ 100 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java

@@ -0,0 +1,100 @@
+package com.ruoyi.web.controller.common;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import com.ruoyi.framework.security.anno.IgnoreAuth;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.multipart.MultipartFile;
+import com.ruoyi.common.config.RuoYiConfig;
+import com.ruoyi.common.constant.Constants;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.common.utils.file.FileUploadUtils;
+import com.ruoyi.common.utils.file.FileUtils;
+import com.ruoyi.framework.config.ServerConfig;
+
+/**
+ * 通用请求处理
+ *
+ * @author ruoyi
+ */
+@RestController
+public class CommonController {
+    private static final Logger log = LoggerFactory.getLogger(CommonController.class);
+
+    @Autowired
+    private ServerConfig serverConfig;
+
+    /**
+     * 通用下载请求
+     *
+     * @param fileName 文件名称
+     * @param delete   是否删除
+     */
+    @IgnoreAuth
+    @GetMapping("common/download")
+    public void fileDownload(String fileName, Boolean delete, HttpServletResponse response, HttpServletRequest request) {
+        try {
+            if (!FileUtils.isValidFilename(fileName)) {
+                throw new Exception(StringUtils.format("文件名称({})非法,不允许下载。 ", fileName));
+            }
+            String realFileName = System.currentTimeMillis() + fileName.substring(fileName.indexOf("_") + 1);
+            String filePath = RuoYiConfig.getDownloadPath() + fileName;
+
+            response.setCharacterEncoding("utf-8");
+            response.setContentType("multipart/form-data");
+            response.setHeader("Content-Disposition",
+                    "attachment;fileName=" + FileUtils.setFileDownloadHeader(request, realFileName));
+            FileUtils.writeBytes(filePath, response.getOutputStream());
+            if (delete) {
+                FileUtils.deleteFile(filePath);
+            }
+        } catch (Exception e) {
+            log.error("下载文件失败", e);
+        }
+    }
+
+    /**
+     * 通用上传请求
+     */
+    @PostMapping("/common/upload")
+    public AjaxResult uploadFile(MultipartFile file) throws Exception {
+        try {
+            // 上传文件路径
+            String filePath = RuoYiConfig.getUploadPath();
+            // 上传并返回新文件名称
+            String fileName = FileUploadUtils.upload(filePath, file);
+            String url = serverConfig.getUrl() + fileName;
+            AjaxResult ajax = AjaxResult.success();
+            ajax.put("fileName", fileName);
+            ajax.put("url", url);
+            return ajax;
+        } catch (Exception e) {
+            return AjaxResult.error(e.getMessage());
+        }
+    }
+
+    /**
+     * 本地资源通用下载
+     */
+    @GetMapping("/common/download/resource")
+    public void resourceDownload(String name, HttpServletRequest request, HttpServletResponse response) throws Exception {
+        // 本地资源路径
+        String localPath = RuoYiConfig.getProfile();
+        // 数据库资源地址
+        String downloadPath = localPath + StringUtils.substringAfter(name, Constants.RESOURCE_PREFIX);
+        // 下载名称
+        String downloadName = StringUtils.substringAfterLast(downloadPath, "/");
+        response.setCharacterEncoding("utf-8");
+        response.setContentType("multipart/form-data");
+        response.setHeader("Content-Disposition",
+                "attachment;fileName=" + FileUtils.setFileDownloadHeader(request, downloadName));
+        FileUtils.writeBytes(downloadPath, response.getOutputStream());
+    }
+}

+ 217 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/ZbFileController.java

@@ -0,0 +1,217 @@
+package com.ruoyi.web.controller.common;
+
+import cn.hutool.core.util.ObjectUtil;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.config.RuoYiConfig;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.framework.security.anno.IgnoreAuth;
+import com.ruoyi.system.domain.ZbFile;
+import com.ruoyi.system.dto.UploadResult;
+import com.ruoyi.system.service.IFileService;
+import com.ruoyi.system.service.IZbFileService;
+import io.swagger.annotations.ApiOperation;
+import lombok.RequiredArgsConstructor;
+import org.springframework.core.io.FileSystemResource;
+import org.springframework.core.io.InputStreamSource;
+import org.springframework.http.CacheControl;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.context.request.WebRequest;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletRequest;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * 系统附件Controller
+ *
+ * @author ruoyi
+ * @date 2020-11-19
+ */
+@RestController
+@RequestMapping("/file")
+@RequiredArgsConstructor
+public class ZbFileController extends BaseController {
+    private final IZbFileService zbFileService;
+    private final IFileService fileService;
+
+    private static final Map<String, String> mediaTypes;
+
+    static {
+        mediaTypes = new HashMap<>();
+        mediaTypes.put("mp4", "video/mp4");
+        mediaTypes.put("jpeg", "image/jpeg");
+        mediaTypes.put("jpg", "image/jpg");
+        mediaTypes.put("png", "image/png");
+    }
+
+    /**
+     * @return
+     */
+    @IgnoreAuth
+    @ApiOperation("图片上传")
+    @PostMapping("/upload")
+    public AjaxResult upload(
+            @RequestParam("files") MultipartFile[] file,
+            @RequestParam(value = "parse", required = false, defaultValue = "false") boolean parse
+    ) {
+        if (file.length <= 0) {
+            return AjaxResult.error("文件内容不能为空");
+        }
+        List<UploadResult> path = fileService.upload(file, parse);
+        return AjaxResult.success("上传成功", path);
+    }
+//    /**
+//     * @return
+//     */
+//    @IgnoreAuth
+//    @PostMapping("/upload/detail")
+//    public AjaxResult uploadWithDetail(@RequestParam("files") MultipartFile[] file) {
+//        List<UploadResult> path = fileService.uploadWithDetail(file);
+//        return AjaxResult.success("上传成功", path);
+//    }
+
+    @IgnoreAuth
+    @GetMapping(value = "/preview")
+    @ApiOperation("图片预览")
+    public ResponseEntity preview(String path, WebRequest request) {
+        File target = new File(RuoYiConfig.getProfile() + File.separator + path);
+
+        String fileName = target.getName();
+        // 构建响应体
+        if (target.exists()) {
+            // 获取文件的最后修改时间
+            long lastModified = target.lastModified();
+            if (request.checkNotModified(lastModified)) {
+                return ResponseEntity.status(HttpStatus.NOT_MODIFIED).build();
+            }
+            // 获取文件扩展名
+            String ext = fileName.substring(fileName.lastIndexOf(".") + 1);
+            // 根据文件扩展名获取mediaType
+            String mediaType = mediaTypes.get(ext);
+            // 如果没有找到对应的扩展名,使用默认的mediaType
+            if (ObjectUtil.isNull(mediaType)) {
+                mediaType = MediaType.APPLICATION_OCTET_STREAM_VALUE;
+            }
+            InputStreamSource resource = new FileSystemResource(target);
+            try {
+                return ResponseEntity.ok()
+                        // 指定文件的缓存时间,这里指定30分钟,高速浏览器在30分钟之内不用重新请求
+                        .cacheControl(CacheControl.maxAge(60 * 30, TimeUnit.SECONDS))
+                        // 返回文件的最后修改时间
+                        .lastModified(lastModified)
+                        // 指定文件的contentType
+                        // contentType方法只能支持Spring内置的一些mediaType类型
+                        // 但我们会由一些其它的MediaType类型,比如video/mp4等,这时我们需要直接通过字符串设置响应头
+                        // .contentType(MediaType.APPLICATION_OCTET_STREAM)
+                        .header("Content-Type", mediaType)
+                        .header("content-disposition", "attachment;filename="
+                                + URLEncoder.encode(target.getName(), "UTF-8"))
+                        .body(resource);
+            } catch (UnsupportedEncodingException e) {
+                e.printStackTrace();
+                return ResponseEntity.notFound().build();
+            }
+        } else {
+            // 如果文件不存在,返回404响应
+            return ResponseEntity.notFound().build();
+        }
+
+
+//        if (!file.exists()) {
+//            return AjaxResult.error("图片不存在");
+//        }
+//        byte[] bytes = null;
+//        try {
+//            FileInputStream inputStream = new FileInputStream(file);
+//            bytes = new byte[inputStream.available()];
+//            inputStream.read(bytes, 0, inputStream.available());
+//        } catch (Exception e) {
+//            e.printStackTrace();
+//        }
+//        return bytes;
+    }
+
+
+    /**
+     * 查询系统附件列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:file:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(ZbFile zbFile) {
+        Page<ZbFile> page = startPage(ZbFile.class);
+        List<ZbFile> list = zbFileService.selectZbFileList(zbFile, page);
+        return getDataTable(list, page);
+    }
+
+    /**
+     * 导出系统附件列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:file:export')")
+    @Log(title = "系统附件", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(ZbFile zbFile) {
+        Page<ZbFile> page = startPage(ZbFile.class);
+        List<ZbFile> list = zbFileService.selectZbFileList(zbFile, page);
+        ExcelUtil<ZbFile> util = new ExcelUtil<ZbFile>(ZbFile.class);
+        return util.exportExcel(list, "file");
+    }
+
+    /**
+     * 获取系统附件详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('system:file:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id) {
+        return AjaxResult.success(zbFileService.getById(id));
+    }
+
+    /**
+     * 新增系统附件
+     */
+    @PreAuthorize("@ss.hasPermi('system:file:add')")
+    @Log(title = "系统附件", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody ZbFile zbFile) {
+        return toAjax(zbFileService.insertZbFile(zbFile));
+    }
+
+    /**
+     * 修改系统附件
+     */
+    @PreAuthorize("@ss.hasPermi('system:file:edit')")
+    @Log(title = "系统附件", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody ZbFile zbFile) {
+        return toAjax(zbFileService.updateZbFile(zbFile));
+    }
+
+    /**
+     * 删除系统附件
+     */
+    @PreAuthorize("@ss.hasPermi('system:file:remove')")
+    @Log(title = "系统附件", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids) {
+        if (ids == null || ids.length == 0) {
+            return AjaxResult.error("参数不正确");
+        }
+        return toAjax(zbFileService.removeByIds(Arrays.asList(ids)));
+    }
+}

+ 34 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/front/BannerController.java

@@ -0,0 +1,34 @@
+package com.ruoyi.web.controller.front;
+
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.framework.security.anno.IgnoreAuth;
+import com.ruoyi.system.domain.ZbBanner;
+import com.ruoyi.system.service.IZbBannerService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.RequiredArgsConstructor;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+/**
+ * @author Admin
+ * @date 2020/11/30
+ */
+@IgnoreAuth
+@RestController
+@RequestMapping("/front/banner")
+@RequiredArgsConstructor
+@Api("首页轮播图")
+public class BannerController {
+    private final IZbBannerService bannerService;
+
+    @ApiOperation(value = "获取轮播图", response = ZbBanner.class)
+    @GetMapping("/list")
+    public AjaxResult list() {
+        List<ZbBanner> zbBanners = bannerService.selectZbBannerList(null, null);
+        return AjaxResult.success(zbBanners);
+    }
+}

+ 91 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/front/CommentController.java

@@ -0,0 +1,91 @@
+package com.ruoyi.web.controller.front;
+
+import cn.hutool.core.util.RandomUtil;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.enums.ApprovalStatus;
+import com.ruoyi.common.enums.CommentType;
+import com.ruoyi.common.utils.ip.IpUtils;
+import com.ruoyi.framework.security.anno.IgnoreAuth;
+import com.ruoyi.system.domain.ZbComment;
+import com.ruoyi.system.service.IZbCommentService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import lombok.RequiredArgsConstructor;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @author Admin
+ * @date 2020/12/2
+ */
+@IgnoreAuth
+@RestController
+@RequestMapping("/front/comment")
+@RequiredArgsConstructor
+@Api("评论相关接口")
+public class CommentController {
+    private final IZbCommentService commentService;
+
+    @GetMapping
+    @ApiOperation("获取图库或者图片故事的评论信息")
+    @ApiImplicitParams({
+            @ApiImplicitParam(value = "图库或者图片故事的id", name = "id", required = true),
+            @ApiImplicitParam(
+                    value = "类型:图库还是图片故事,GALLERY:图库,PICTURE:图片故事",
+                    name = "type", required = true
+            )
+    })
+    public AjaxResult comment(
+            @RequestParam("id") Long id,
+            @RequestParam("type") CommentType commentType,
+            @RequestParam(value = "page", defaultValue = "1") Integer page,
+            @RequestParam(value = "size", defaultValue = "10") Integer size
+    ) {
+        ZbComment zbComment = new ZbComment();
+        zbComment.setStatus(ApprovalStatus.PASS.name());
+        zbComment.setType(commentType.name());
+        zbComment.setFkId(id);
+        Page<ZbComment> pageInfo = new Page<>(page, size);
+        List<ZbComment> zbComments = commentService.selectZbCommentList(zbComment, pageInfo);
+        pageInfo.setRecords(zbComments);
+        return AjaxResult.success(pageInfo);
+    }
+
+
+    @PutMapping
+    @ApiOperation("发表评论")
+    @ApiImplicitParams({
+            @ApiImplicitParam(value = "图库或者图片故事的id", name = "id", required = true),
+            @ApiImplicitParam(value = "评论内容", name = "content", required = true),
+            @ApiImplicitParam(value = "联系方式", name = "concat", required = true),
+            @ApiImplicitParam(
+                    value = "类型:图库还是图片故事,GALLERY:图库,PICTURE:图片故事",
+                    name = "commentType", required = true
+            )
+    })
+    public AjaxResult comment(
+            @RequestParam("id") Long id,
+            @RequestParam("type") CommentType commentType,
+            @RequestParam("content") String content,
+            @RequestParam("concat") String concat,
+            HttpServletRequest request
+    ) {
+        ZbComment comment = new ZbComment();
+        comment.setFkId(id);
+        comment.setType(commentType.name());
+        comment.setStatus(ApprovalStatus.SUBMIT.name());
+        comment.setConcat(concat);
+        comment.setContent(content);
+        comment.setIp(IpUtils.getIpAddr(request));
+        comment.setName("访客" + RandomUtil.randomNumbers(8));
+        comment.setCreateTime(new Date());
+        commentService.save(comment);
+        return AjaxResult.success("发布成功,请等待管理员审核");
+    }
+}

+ 80 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/front/GalleryController.java

@@ -0,0 +1,80 @@
+package com.ruoyi.web.controller.front;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.framework.security.anno.IgnoreAuth;
+import com.ruoyi.system.domain.grallery.ZbGalleryCategory;
+import com.ruoyi.system.dto.GalleryCategoryDto;
+import com.ruoyi.system.dto.GalleryDto;
+import com.ruoyi.system.service.IZbGalleryCategoryService;
+import com.ruoyi.system.service.IZbGalleryService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.RequiredArgsConstructor;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * @author Admin
+ * @date 2020/11/30
+ */
+@IgnoreAuth
+@RestController
+@RequestMapping("/front/gallery")
+@RequiredArgsConstructor
+@Api("图库相关接口")
+public class GalleryController {
+    private final IZbGalleryCategoryService galleryCategoryService;
+    private final IZbGalleryService galleryService;
+
+    @ApiOperation("获取首页分类接口")
+    @GetMapping("/category/home")
+    public AjaxResult homeCategory() {
+        ZbGalleryCategory category = new ZbGalleryCategory();
+        category.setParentId(0L);
+        category.setShow(1);
+        List<GalleryCategoryDto> galleryCategoryDtos = galleryCategoryService.selectZbGalleryCategoryList(category, null);
+        return AjaxResult.success(galleryCategoryDtos);
+    }
+
+    @ApiOperation("获取分类接口")
+    @GetMapping("/categories")
+    public AjaxResult categories(
+            @RequestParam("categoryCode") String categoryCode,
+            @RequestParam(value = "page", defaultValue = "1") Integer page,
+            @RequestParam(value = "size", defaultValue = "10") Integer size
+    ) {
+        Page<GalleryCategoryDto> pageInfo = new Page<>(page, size);
+        Page<GalleryCategoryDto> result = galleryCategoryService.selectGalleryCategoryByParentCode(categoryCode, pageInfo);
+        return AjaxResult.success(result);
+    }
+
+    @ApiOperation("根据上级获取下级分类接口")
+    @GetMapping("/child/categories")
+    public AjaxResult childCategories(@RequestParam("parentId") Long parentId) {
+        List<GalleryCategoryDto> result = galleryCategoryService.getChildList(parentId);
+        return AjaxResult.success(result);
+    }
+
+
+    @ApiOperation("根据分类id获取图库信息")
+    @GetMapping("/galleries")
+    public AjaxResult galleries(
+            @RequestParam(value = "categoryCode", required = false) String categoryCode,
+            @RequestParam(value = "categoryId", required = false) Long categoryId,
+            @RequestParam(value = "page", defaultValue = "1") Integer page,
+            @RequestParam(value = "size", defaultValue = "10") Integer size
+    ) {
+        Page<GalleryDto> pageInfo = new Page<>(page, size);
+        Page<GalleryDto> result = galleryService.selectGalleryDto(categoryCode, categoryId, pageInfo);
+        return AjaxResult.success(result);
+    }
+
+    @GetMapping("/{id}")
+    @ApiOperation("获取图库详情")
+    public AjaxResult detail(@PathVariable("id") Long id) {
+        GalleryDto galleryDto = galleryService.getByGalleryId(id);
+        return AjaxResult.success(galleryDto);
+    }
+}

+ 66 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/front/NoticeController.java

@@ -0,0 +1,66 @@
+package com.ruoyi.web.controller.front;
+
+import com.alibaba.fastjson.JSONObject;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.enums.NoticeType;
+import com.ruoyi.framework.security.anno.IgnoreAuth;
+import com.ruoyi.system.domain.SysNotice;
+import com.ruoyi.system.service.ISysNoticeService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.RequiredArgsConstructor;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @author Admin
+ * @date 2020/11/25
+ */
+@IgnoreAuth
+@RestController
+@RequestMapping("/front/notice")
+@RequiredArgsConstructor
+@Api("前端获取通知或公告信息")
+public class NoticeController {
+    private final ISysNoticeService noticeService;
+
+    /**
+     * 获取鸣谢数据
+     */
+    @GetMapping("/thanks")
+    @ApiOperation(value = "获取鸣谢信息")
+    public AjaxResult thanks() {
+        SysNotice byNoticeType = noticeService.getByNoticeType(NoticeType.THANKS);
+        if (byNoticeType == null) {
+            return AjaxResult.success(new JSONObject());
+        }
+        return AjaxResult.success(byNoticeType);
+    }
+
+    /**
+     * 获取合作公告
+     */
+    @GetMapping("/cooperation")
+    @ApiOperation(value = "获取合作公告")
+    public AjaxResult cooperation() {
+        SysNotice byNoticeType = noticeService.getByNoticeType(NoticeType.COOPERATION_NOTICE);
+        if (byNoticeType == null) {
+            return AjaxResult.success(new JSONObject());
+        }
+        return AjaxResult.success(byNoticeType);
+    }
+
+    /**
+     * 获取版本公告
+     */
+    @GetMapping("/copyright")
+    @ApiOperation(value = "获取版本公告")
+    public AjaxResult copyright() {
+        SysNotice byNoticeType = noticeService.getByNoticeType(NoticeType.COPYRIGHT_NOTICE);
+        if (byNoticeType == null) {
+            return AjaxResult.success(new JSONObject());
+        }
+        return AjaxResult.success(byNoticeType);
+    }
+}

+ 53 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/front/PicToPicController.java

@@ -0,0 +1,53 @@
+package com.ruoyi.web.controller.front;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.framework.security.anno.IgnoreAuth;
+import com.ruoyi.system.domain.grallery.ZbPicToPic;
+import com.ruoyi.system.dto.PicToPicDto;
+import com.ruoyi.system.service.IZbPicToPicService;
+import io.swagger.annotations.ApiOperation;
+import lombok.RequiredArgsConstructor;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * 图来图往Controller
+ *
+ * @author ruoyi
+ * @date 2020-12-02
+ */
+
+@RestController
+@RequestMapping("/front/gallery/pic")
+@RequiredArgsConstructor
+public class PicToPicController  {
+    private final IZbPicToPicService zbPicToPicService;
+
+    /**
+     * 新增图来图往
+     */
+    @IgnoreAuth
+    @ApiOperation("提交图来图往")
+    @Log(title = "图来图往", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody ZbPicToPic zbPicToPic) {
+        return AjaxResult.success(zbPicToPicService.insertZbPicToPic(zbPicToPic));
+    }
+
+
+    @ApiOperation("上传图来图往图片")
+    @PostMapping("/upload")
+    @IgnoreAuth
+    public AjaxResult upload(@RequestParam("files") MultipartFile[] file) {
+        return AjaxResult.success(zbPicToPicService.uploadToZip(file));
+    }
+}

+ 42 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/front/PictureStoreController.java

@@ -0,0 +1,42 @@
+package com.ruoyi.web.controller.front;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.framework.security.anno.IgnoreAuth;
+import com.ruoyi.system.dto.PictureStoryDto;
+import com.ruoyi.system.service.IZbPictureStoryService;
+import io.swagger.annotations.ApiOperation;
+import lombok.RequiredArgsConstructor;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * @author Admin
+ * @date 2020/11/30
+ */
+@IgnoreAuth
+@RestController
+@RequestMapping("/front/picture/store")
+@RequiredArgsConstructor
+@ApiOperation("前端图片故事信息")
+public class PictureStoreController {
+    private final IZbPictureStoryService pictureStoryService;
+
+
+    @ApiOperation("获取图片故事,分页;根据创建时间倒序")
+    @PostMapping("/list")
+    public AjaxResult list(
+            @RequestParam("page") Integer page,
+            @RequestParam("size") Integer size
+    ) {
+        Page<PictureStoryDto> dtoPage = new Page<>(page, size);
+        Page<PictureStoryDto> pictureStoryDtos = pictureStoryService.selectZbPictureStoryListDto(null, dtoPage);
+        return AjaxResult.success(pictureStoryDtos);
+    }
+
+    @GetMapping("/{id}")
+    @ApiOperation("获取图片故事详情")
+    public AjaxResult detail(@PathVariable("id") Long id) {
+        PictureStoryDto storyDto = pictureStoryService.getByStoryId(id);
+        return AjaxResult.success(storyDto);
+    }
+}

+ 113 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/gallery/ZbCommentController.java

@@ -0,0 +1,113 @@
+package com.ruoyi.web.controller.gallery;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.enums.ApprovalStatus;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.system.domain.ZbComment;
+import com.ruoyi.system.service.IZbCommentService;
+import lombok.RequiredArgsConstructor;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * 【请填写功能名称】Controller
+ *
+ * @author ruoyi
+ * @date 2020-11-25
+ */
+@RestController
+@RequestMapping("/system/comment")
+@RequiredArgsConstructor
+public class ZbCommentController extends BaseController {
+    private final IZbCommentService zbCommentService;
+
+    /**
+     * 查询【请填写功能名称】列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:comment:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(ZbComment zbComment) {
+        Page<ZbComment> page = startPage(ZbComment.class);
+        List<ZbComment> list = zbCommentService.selectZbCommentList(zbComment, page);
+        return getDataTable(list, page);
+    }
+
+    /**
+     * 导出【请填写功能名称】列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:comment:export')")
+    @Log(title = "【请填写功能名称】", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(ZbComment zbComment) {
+        Page<ZbComment> page = startPage(ZbComment.class);
+        List<ZbComment> list = zbCommentService.selectZbCommentList(zbComment, page);
+        ExcelUtil<ZbComment> util = new ExcelUtil<ZbComment>(ZbComment.class);
+        return util.exportExcel(list, "comment");
+    }
+
+    @PostMapping("/approval")
+    public AjaxResult approvalComment(@RequestParam("id") Long commentId, ApprovalStatus status) {
+        return AjaxResult.success(zbCommentService.approval(commentId, status));
+    }
+
+    /**
+     * 获取【请填写功能名称】详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('system:comment:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id) {
+        return AjaxResult.success(zbCommentService.getDetailById(id));
+    }
+
+    /**
+     * 新增【请填写功能名称】
+     */
+    @PreAuthorize("@ss.hasPermi('system:comment:add')")
+    @Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody ZbComment zbComment) {
+        return toAjax(zbCommentService.insertZbComment(zbComment));
+    }
+
+    /**
+     * 修改【请填写功能名称】
+     */
+    @PreAuthorize("@ss.hasPermi('system:comment:edit')")
+    @Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody ZbComment zbComment) {
+        return toAjax(zbCommentService.updateZbComment(zbComment));
+    }
+
+    /**
+     * 删除【请填写功能名称】
+     */
+    @PreAuthorize("@ss.hasPermi('system:comment:remove')")
+    @Log(title = "【请填写功能名称】", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids) {
+        if (ids == null || ids.length == 0) {
+            return AjaxResult.error("参数不正确");
+        }
+        return toAjax(zbCommentService.removeByIds(Arrays.asList(ids)));
+    }
+
+
+    /**
+     * 获取待审核的评论信息
+     *
+     * @return
+     */
+    @GetMapping("/nums")
+    public AjaxResult nums() {
+        return AjaxResult.success(zbCommentService.getApprovalNums());
+    }
+}

+ 117 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/gallery/ZbGalleryCategoryController.java

@@ -0,0 +1,117 @@
+package com.ruoyi.web.controller.gallery;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.system.domain.grallery.ZbGalleryCategory;
+import com.ruoyi.system.dto.GalleryCategoryDto;
+import com.ruoyi.system.service.IZbGalleryCategoryService;
+import lombok.RequiredArgsConstructor;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * 图库分类Controller
+ *
+ * @author ruoyi
+ * @date 2020-11-19
+ */
+@RestController
+@RequestMapping("/system/category")
+@RequiredArgsConstructor
+public class ZbGalleryCategoryController extends BaseController {
+    private final IZbGalleryCategoryService zbGalleryCategoryService;
+
+    /**
+     * 查询图库分类列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:category:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(ZbGalleryCategory zbGalleryCategory) {
+        Page<ZbGalleryCategory> page = startPage(ZbGalleryCategory.class);
+        List<GalleryCategoryDto> list = zbGalleryCategoryService.selectZbGalleryCategoryList(zbGalleryCategory, page);
+        return getDataTable(list, page);
+    }
+
+    /**
+     * 查询最下级分类;
+     *
+     * @return
+     */
+    @GetMapping("/queryLastLevel")
+    public AjaxResult queryLastLevel() {
+        List<ZbGalleryCategory> list = zbGalleryCategoryService.queryLastLevel();
+        return AjaxResult.success(list);
+    }
+
+    /**
+     * 导出图库分类列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:category:export')")
+    @Log(title = "图库分类", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(ZbGalleryCategory zbGalleryCategory) {
+        Page<ZbGalleryCategory> page = startPage(ZbGalleryCategory.class);
+        List<GalleryCategoryDto> list = zbGalleryCategoryService.selectZbGalleryCategoryList(zbGalleryCategory, page);
+        ExcelUtil<GalleryCategoryDto> util = new ExcelUtil<GalleryCategoryDto>(GalleryCategoryDto.class);
+        return util.exportExcel(list, "category");
+    }
+
+    /**
+     * 获取图库分类详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('system:category:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id) {
+        return AjaxResult.success(zbGalleryCategoryService.getDetailById(id));
+    }
+
+
+    /**
+     * 获取图库分类详细信息
+     */
+    @GetMapping(value = "change/{id}")
+    public AjaxResult changeShow(@PathVariable("id") Long id) {
+        return AjaxResult.success(zbGalleryCategoryService.changeShow(id));
+    }
+
+    /**
+     * 新增图库分类
+     */
+    @PreAuthorize("@ss.hasPermi('system:category:add')")
+    @Log(title = "图库分类", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody ZbGalleryCategory zbGalleryCategory) {
+        return toAjax(zbGalleryCategoryService.insertZbGalleryCategory(zbGalleryCategory));
+    }
+
+    /**
+     * 修改图库分类
+     */
+    @PreAuthorize("@ss.hasPermi('system:category:edit')")
+    @Log(title = "图库分类", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody ZbGalleryCategory zbGalleryCategory) {
+        return toAjax(zbGalleryCategoryService.updateZbGalleryCategory(zbGalleryCategory));
+    }
+
+    /**
+     * 删除图库分类
+     */
+    @PreAuthorize("@ss.hasPermi('system:category:remove')")
+    @Log(title = "图库分类", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{id}")
+    public AjaxResult remove(@PathVariable Long id) {
+        if (id == null) {
+            return AjaxResult.error("参数不正确");
+        }
+        return toAjax(zbGalleryCategoryService.removeByCategoryId(id));
+    }
+}

+ 100 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/gallery/ZbGalleryController.java

@@ -0,0 +1,100 @@
+package com.ruoyi.web.controller.gallery;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.system.domain.grallery.ZbGallery;
+import com.ruoyi.system.dto.GalleryDto;
+import com.ruoyi.system.service.IZbGalleryService;
+import lombok.RequiredArgsConstructor;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * 图库Controller
+ *
+ * @author ruoyi
+ * @date 2020-11-20
+ */
+@RestController
+@RequestMapping("/gallery")
+@RequiredArgsConstructor
+public class ZbGalleryController extends BaseController {
+    private final IZbGalleryService zbGalleryService;
+
+    /**
+     * 查询图库列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:gallery:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(ZbGallery zbGallery) {
+        Page<ZbGallery> page = startPage(ZbGallery.class);
+        List<GalleryDto> list = zbGalleryService.selectZbGalleryList(zbGallery, page);
+        return getDataTable(list, page);
+    }
+
+//    /**
+//     * 导出图库列表
+//     */
+//    @PreAuthorize("@ss.hasPermi('system:gallery:export')")
+//    @Log(title = "图库", businessType = BusinessType.EXPORT)
+//    @GetMapping("/export")
+//    public AjaxResult export(ZbGallery zbGallery) {
+//        Page<ZbGallery> page = startPage(ZbGallery.class);
+//        List<GalleryDto> list = zbGalleryService.selectZbGalleryList(zbGallery, page);
+//        ExcelUtil<ZbGallery> util = new ExcelUtil<ZbGallery>(ZbGallery.class);
+//        return util.exportExcel(list, "gallery");
+//    }
+
+    /**
+     * 获取图库详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('system:gallery:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id) {
+        return AjaxResult.success(zbGalleryService.getByGalleryId(id));
+    }
+
+    /**
+     * 新增图库
+     */
+    @PreAuthorize("@ss.hasPermi('system:gallery:add')")
+    @Log(title = "图库", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody @Validated GalleryDto zbGallery) {
+        zbGallery.setName(zbGallery.getCnName());
+        return toAjax(zbGalleryService.insertZbGallery(zbGallery));
+    }
+
+    /**
+     * 修改图库
+     */
+    @PreAuthorize("@ss.hasPermi('system:gallery:edit')")
+    @Log(title = "图库", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody @Validated GalleryDto zbGallery) {
+        zbGallery.setName(zbGallery.getCnName());
+        return toAjax(zbGalleryService.updateZbGallery(zbGallery));
+    }
+
+    /**
+     * 删除图库
+     */
+    @PreAuthorize("@ss.hasPermi('system:gallery:remove')")
+    @Log(title = "图库", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids) {
+        if (ids == null || ids.length == 0) {
+            return AjaxResult.error("参数不正确");
+        }
+        return toAjax(zbGalleryService.delGallery(Arrays.asList(ids)));
+    }
+}

+ 104 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/gallery/ZbGalleryImgController.java

@@ -0,0 +1,104 @@
+package com.ruoyi.web.controller.gallery;
+
+import java.util.Arrays;
+import java.util.List;
+
+import com.ruoyi.system.domain.grallery.ZbGalleryImg;
+import lombok.RequiredArgsConstructor;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.system.service.IZbGalleryImgService;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ruoyi.common.core.page.TableDataInfo;
+
+/**
+ * 【请填写功能名称】Controller
+ *
+ * @author ruoyi
+ * @date 2020-11-20
+ */
+@RestController
+@RequestMapping("/gallery/img")
+@RequiredArgsConstructor
+public class ZbGalleryImgController extends BaseController {
+    private final IZbGalleryImgService zbGalleryImgService;
+
+    /**
+     * 查询【请填写功能名称】列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:img:list')")
+    @GetMapping("/list")
+        public TableDataInfo list(ZbGalleryImg zbGalleryImg) {
+        Page<ZbGalleryImg> page = startPage(ZbGalleryImg.class);
+        List<ZbGalleryImg> list = zbGalleryImgService.selectZbGalleryImgList(zbGalleryImg, page);
+        return getDataTable(list, page);
+    }
+    
+    /**
+     * 导出【请填写功能名称】列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:img:export')")
+    @Log(title = "【请填写功能名称】", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(ZbGalleryImg zbGalleryImg) {
+        Page<ZbGalleryImg> page = startPage(ZbGalleryImg.class);
+        List<ZbGalleryImg> list = zbGalleryImgService.selectZbGalleryImgList(zbGalleryImg, page);
+        ExcelUtil<ZbGalleryImg> util = new ExcelUtil<ZbGalleryImg>(ZbGalleryImg. class);
+        return util.exportExcel(list, "img");
+    }
+
+    /**
+     * 获取【请填写功能名称】详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('system:img:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id) {
+        return AjaxResult.success(zbGalleryImgService.getById(id));
+    }
+
+    /**
+     * 新增【请填写功能名称】
+     */
+    @PreAuthorize("@ss.hasPermi('system:img:add')")
+    @Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody ZbGalleryImg zbGalleryImg) {
+        return toAjax(zbGalleryImgService.insertZbGalleryImg(zbGalleryImg));
+    }
+
+    /**
+     * 修改【请填写功能名称】
+     */
+    @PreAuthorize("@ss.hasPermi('system:img:edit')")
+    @Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody ZbGalleryImg zbGalleryImg) {
+        return toAjax(zbGalleryImgService.updateZbGalleryImg(zbGalleryImg));
+    }
+
+    /**
+     * 删除【请填写功能名称】
+     */
+    @PreAuthorize("@ss.hasPermi('system:img:remove')")
+    @Log(title = "【请填写功能名称】", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids) {
+        if (ids == null || ids.length == 0) {
+            return AjaxResult.error("参数不正确");
+        }
+        return toAjax(zbGalleryImgService.removeByIds(Arrays.asList(ids)));
+    }
+}

+ 84 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/gallery/ZbPicToPicController.java

@@ -0,0 +1,84 @@
+package com.ruoyi.web.controller.gallery;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.framework.security.anno.IgnoreAuth;
+import com.ruoyi.system.domain.grallery.ZbGallery;
+import com.ruoyi.system.domain.grallery.ZbPicToPic;
+import com.ruoyi.system.dto.GalleryDto;
+import com.ruoyi.system.dto.PicToPicDto;
+import com.ruoyi.system.limit.DayLimit;
+import com.ruoyi.system.service.IZbPicToPicService;
+
+import lombok.RequiredArgsConstructor;
+
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * 图来图往Controller
+ *
+ * @author ruoyi
+ * @date 2020-12-02
+ */
+@RestController
+@RequestMapping("/gallery/pic")
+@RequiredArgsConstructor
+public class ZbPicToPicController extends BaseController {
+    private final IZbPicToPicService zbPicToPicService;
+
+    /**
+     * 获取图来图往详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('system:pic:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id) {
+        PicToPicDto data = zbPicToPicService.getDetailById(id);
+        return AjaxResult.success(data);
+    }
+
+    @PreAuthorize("@ss.hasPermi('system:pic:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(ZbPicToPic zbPicToPic) {
+        Page<PicToPicDto> page = startPage(PicToPicDto.class);
+        List<PicToPicDto> list = zbPicToPicService.selectZbPicToPicList(zbPicToPic, page);
+        return getDataTable(list, page);
+    }
+
+    /**
+     * 新增图来图往
+     */
+    @IgnoreAuth
+    @Log(title = "图来图往", businessType = BusinessType.INSERT)
+    @PostMapping
+    @DayLimit("您今日提交已达到上限")
+    public AjaxResult add(@RequestBody ZbPicToPic zbPicToPic) {
+        return toAjax(zbPicToPicService.insertZbPicToPic(zbPicToPic));
+    }
+
+    @IgnoreAuth
+    @PostMapping("/upload")
+    @DayLimit("您今日提交已达到上限")
+    public AjaxResult upload(@RequestParam("files") MultipartFile[] file) {
+        return AjaxResult.success(zbPicToPicService.uploadToZip(file));
+    }
+
+    /**
+     * 删除图来图往
+     */
+    @DeleteMapping("/{id}")
+    public AjaxResult remove(@PathVariable Long id) {
+        if (id == null || id == 0) {
+            return AjaxResult.error("参数不正确");
+        }
+        return toAjax(zbPicToPicService.removeById(id));
+    }
+}

+ 99 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/gallery/ZbPictureStoryController.java

@@ -0,0 +1,99 @@
+package com.ruoyi.web.controller.gallery;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.system.domain.ZbPictureStory;
+import com.ruoyi.system.service.IZbPictureStoryService;
+import lombok.RequiredArgsConstructor;
+import org.apache.commons.lang.StringEscapeUtils;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * 图片故事Controller
+ *
+ * @author ruoyi
+ * @date 2020-11-20
+ */
+@RestController
+@RequestMapping("/system/story")
+@RequiredArgsConstructor
+public class ZbPictureStoryController extends BaseController {
+    private final IZbPictureStoryService zbPictureStoryService;
+
+    /**
+     * 查询图片故事列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:story:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(ZbPictureStory zbPictureStory) {
+        Page<ZbPictureStory> page = startPage(ZbPictureStory.class);
+        List<ZbPictureStory> list = zbPictureStoryService.selectZbPictureStoryList(zbPictureStory, page);
+        return getDataTable(list, page);
+    }
+
+    /**
+     * 导出图片故事列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:story:export')")
+    @Log(title = "图片故事", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(ZbPictureStory zbPictureStory) {
+        Page<ZbPictureStory> page = startPage(ZbPictureStory.class);
+        List<ZbPictureStory> list = zbPictureStoryService.selectZbPictureStoryList(zbPictureStory, page);
+        ExcelUtil<ZbPictureStory> util = new ExcelUtil<ZbPictureStory>(ZbPictureStory.class);
+        return util.exportExcel(list, "story");
+    }
+
+    /**
+     * 获取图片故事详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('system:story:query')")
+    @GetMapping(value = "/{storyId}")
+    public AjaxResult getInfo(@PathVariable("storyId") Long storyId) {
+        return AjaxResult.success(zbPictureStoryService.getByStoryId(storyId));
+    }
+
+    /**
+     * 新增图片故事
+     */
+    @PreAuthorize("@ss.hasPermi('system:story:add')")
+    @Log(title = "图片故事", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody ZbPictureStory zbPictureStory) {
+        zbPictureStory.setContent(StringEscapeUtils.unescapeHtml(zbPictureStory.getContent()));
+        return toAjax(zbPictureStoryService.insertZbPictureStory(zbPictureStory));
+    }
+
+    /**
+     * 修改图片故事
+     */
+    @PreAuthorize("@ss.hasPermi('system:story:edit')")
+    @Log(title = "图片故事", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody ZbPictureStory zbPictureStory) {
+        zbPictureStory.setContent(StringEscapeUtils.unescapeHtml(zbPictureStory.getContent()));
+        return toAjax(zbPictureStoryService.updateZbPictureStory(zbPictureStory));
+    }
+
+    /**
+     * 删除图片故事
+     */
+    @PreAuthorize("@ss.hasPermi('system:story:remove')")
+    @Log(title = "图片故事", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{storyIds}")
+    public AjaxResult remove(@PathVariable Long[] storyIds) {
+        if (storyIds == null || storyIds.length == 0) {
+            return AjaxResult.error("参数不正确");
+        }
+        return toAjax(zbPictureStoryService.delPictureStore(Arrays.asList(storyIds)));
+    }
+}

+ 28 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/ServerController.java

@@ -0,0 +1,28 @@
+package com.ruoyi.web.controller.monitor;
+
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.framework.web.domain.Server;
+
+/**
+ * 服务器监控
+ * 
+ * @author ruoyi
+ */
+@RestController
+@RequestMapping("/monitor/server")
+public class ServerController extends BaseController
+{
+    @PreAuthorize("@ss.hasPermi('monitor:server:list')")
+    @GetMapping()
+    public AjaxResult getInfo() throws Exception
+    {
+        Server server = new Server();
+        server.copyTo();
+        return AjaxResult.success(server);
+    }
+}

+ 65 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysLogininforController.java

@@ -0,0 +1,65 @@
+package com.ruoyi.web.controller.monitor;
+
+import java.util.List;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.system.domain.SysLogininfor;
+import com.ruoyi.system.service.ISysLogininforService;
+
+/**
+ * 系统访问记录
+ *
+ * @author ruoyi
+ */
+@RestController
+@RequestMapping("/monitor/logininfor")
+public class SysLogininforController extends BaseController {
+    @Autowired
+    private ISysLogininforService logininforService;
+
+    @PreAuthorize("@ss.hasPermi('monitor:logininfor:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(SysLogininfor logininfor) {
+        Page<SysLogininfor> page = startPage(SysLogininfor.class);
+        List<SysLogininfor> list = logininforService.selectLogininforList(logininfor, page);
+        return getDataTable(list, page);
+    }
+
+    @Log(title = "登录日志", businessType = BusinessType.EXPORT)
+    @PreAuthorize("@ss.hasPermi('monitor:logininfor:export')")
+    @GetMapping("/export")
+    public AjaxResult export(SysLogininfor logininfor) {
+        Page<SysLogininfor> page = startPage(SysLogininfor.class);
+        List<SysLogininfor> list = logininforService.selectLogininforList(logininfor, page);
+        ExcelUtil<SysLogininfor> util = new ExcelUtil<SysLogininfor>(SysLogininfor.class);
+        return util.exportExcel(list, "登录日志");
+    }
+
+    @PreAuthorize("@ss.hasPermi('monitor:logininfor:remove')")
+    @Log(title = "登录日志", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{infoIds}")
+    public AjaxResult remove(@PathVariable Long[] infoIds) {
+        return toAjax(logininforService.deleteLogininforByIds(infoIds));
+    }
+
+    @PreAuthorize("@ss.hasPermi('monitor:logininfor:remove')")
+    @Log(title = "登录日志", businessType = BusinessType.CLEAN)
+    @DeleteMapping("/clean")
+    public AjaxResult clean() {
+        logininforService.cleanLogininfor();
+        return AjaxResult.success();
+    }
+}

+ 64 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysOperlogController.java

@@ -0,0 +1,64 @@
+package com.ruoyi.web.controller.monitor;
+
+import java.util.List;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.system.domain.SysOperLog;
+import com.ruoyi.system.service.ISysOperLogService;
+
+/**
+ * 操作日志记录
+ *
+ * @author ruoyi
+ */
+@RestController
+@RequestMapping("/monitor/operlog")
+public class SysOperlogController extends BaseController {
+    @Autowired
+    private ISysOperLogService operLogService;
+
+    @PreAuthorize("@ss.hasPermi('monitor:operlog:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(SysOperLog operLog) {
+        Page<SysOperLog> page = startPage(SysOperLog.class);
+        List<SysOperLog> list = operLogService.selectOperLogList(operLog, page);
+        return getDataTable(list, page);
+    }
+
+    @Log(title = "操作日志", businessType = BusinessType.EXPORT)
+    @PreAuthorize("@ss.hasPermi('monitor:operlog:export')")
+    @GetMapping("/export")
+    public AjaxResult export(SysOperLog operLog) {
+        Page<SysOperLog> page = startPage(SysOperLog.class);
+        List<SysOperLog> list = operLogService.selectOperLogList(operLog, page);
+        ExcelUtil<SysOperLog> util = new ExcelUtil<SysOperLog>(SysOperLog.class);
+        return util.exportExcel(list, "操作日志");
+    }
+
+    @PreAuthorize("@ss.hasPermi('monitor:operlog:remove')")
+    @DeleteMapping("/{operIds}")
+    public AjaxResult remove(@PathVariable Long[] operIds) {
+        return toAjax(operLogService.deleteOperLogByIds(operIds));
+    }
+
+    @Log(title = "操作日志", businessType = BusinessType.CLEAN)
+    @PreAuthorize("@ss.hasPermi('monitor:operlog:remove')")
+    @DeleteMapping("/clean")
+    public AjaxResult clean() {
+        operLogService.cleanOperLog();
+        return AjaxResult.success();
+    }
+}

+ 82 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysUserOnlineController.java

@@ -0,0 +1,82 @@
+package com.ruoyi.web.controller.monitor;
+
+import java.util.*;
+
+import com.ruoyi.framework.web.service.TokenService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.constant.Constants;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.domain.model.LoginUser;
+import com.ruoyi.common.core.page.TableDataInfo;
+//import com.ruoyi.common.core.redis.RedisCache;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.system.domain.SysUserOnline;
+import com.ruoyi.system.service.ISysUserOnlineService;
+
+/**
+ * 在线用户监控
+ *
+ * @author ruoyi
+ */
+@RestController
+@RequestMapping("/monitor/online")
+public class SysUserOnlineController extends BaseController {
+    @Autowired
+    private ISysUserOnlineService userOnlineService;
+    @Autowired
+    private TokenService tokenService;
+
+//    @Autowired
+//    private RedisCache redisCache;
+
+    @PreAuthorize("@ss.hasPermi('monitor:online:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(String ipaddr, String userName) {
+//        Collection<String> keys = redisCache.keys(Constants.LOGIN_TOKEN_KEY + "*");
+        Map<String, Object> keys = tokenService.getLoginUsers();
+        List<SysUserOnline> userOnlineList = new ArrayList<SysUserOnline>();
+        for (String key : keys.keySet()) {
+            LoginUser user = (LoginUser) keys.get(key);
+//            LoginUser user = redisCache.getCacheObject(key);
+            if (StringUtils.isNotEmpty(ipaddr) && StringUtils.isNotEmpty(userName)) {
+                if (StringUtils.equals(ipaddr, user.getIpaddr()) && StringUtils.equals(userName, user.getUsername())) {
+                    userOnlineList.add(userOnlineService.selectOnlineByInfo(ipaddr, userName, user));
+                }
+            } else if (StringUtils.isNotEmpty(ipaddr)) {
+                if (StringUtils.equals(ipaddr, user.getIpaddr())) {
+                    userOnlineList.add(userOnlineService.selectOnlineByIpaddr(ipaddr, user));
+                }
+            } else if (StringUtils.isNotEmpty(userName) && StringUtils.isNotNull(user.getUser())) {
+                if (StringUtils.equals(userName, user.getUsername())) {
+                    userOnlineList.add(userOnlineService.selectOnlineByUserName(userName, user));
+                }
+            } else {
+                userOnlineList.add(userOnlineService.loginUserToUserOnline(user));
+            }
+        }
+        Collections.reverse(userOnlineList);
+        userOnlineList.removeAll(Collections.singleton(null));
+        return getDataTable(userOnlineList,null);
+    }
+
+    /**
+     * 强退用户
+     */
+    @PreAuthorize("@ss.hasPermi('monitor:online:forceLogout')")
+    @Log(title = "在线用户", businessType = BusinessType.FORCE)
+    @DeleteMapping("/{tokenId}")
+    public AjaxResult forceLogout(@PathVariable String tokenId) {
+        tokenService.removeToken(Constants.LOGIN_TOKEN_KEY + tokenId);
+//        redisCache.deleteObject(Constants.LOGIN_TOKEN_KEY + tokenId);
+        return AjaxResult.success();
+    }
+}

+ 120 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysConfigController.java

@@ -0,0 +1,120 @@
+package com.ruoyi.web.controller.system;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.annotation.RepeatSubmit;
+import com.ruoyi.common.constant.UserConstants;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.utils.SecurityUtils;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.system.domain.SysConfig;
+import com.ruoyi.system.service.ISysConfigService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 参数配置 信息操作处理
+ *
+ * @author ruoyi
+ */
+@RestController
+@RequestMapping("/system/config")
+public class SysConfigController extends BaseController {
+    @Autowired
+    private ISysConfigService configService;
+
+    /**
+     * 获取参数配置列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:config:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(SysConfig config) {
+        Page<SysConfig> page = startPage(SysConfig.class);
+        List<SysConfig> list = configService.selectConfigList(config, page);
+        return getDataTable(list, page);
+    }
+
+    @Log(title = "参数管理", businessType = BusinessType.EXPORT)
+    @PreAuthorize("@ss.hasPermi('system:config:export')")
+    @GetMapping("/export")
+    public AjaxResult export(SysConfig config) {
+        Page<SysConfig> page = startPage(SysConfig.class);
+        List<SysConfig> list = configService.selectConfigList(config, page);
+        ExcelUtil<SysConfig> util = new ExcelUtil<SysConfig>(SysConfig.class);
+        return util.exportExcel(list, "参数数据");
+    }
+
+    /**
+     * 根据参数编号获取详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('system:config:query')")
+    @GetMapping(value = "/{configId}")
+    public AjaxResult getInfo(@PathVariable Long configId) {
+        return AjaxResult.success(configService.selectConfigById(configId));
+    }
+
+    /**
+     * 根据参数键名查询参数值
+     */
+    @GetMapping(value = "/configKey/{configKey}")
+    public AjaxResult getConfigKey(@PathVariable String configKey) {
+        return AjaxResult.success(configService.selectConfigByKey(configKey));
+    }
+
+    /**
+     * 新增参数配置
+     */
+    @PreAuthorize("@ss.hasPermi('system:config:add')")
+    @Log(title = "参数管理", businessType = BusinessType.INSERT)
+    @PostMapping
+    @RepeatSubmit
+    public AjaxResult add(@Validated @RequestBody SysConfig config) {
+        if (UserConstants.NOT_UNIQUE.equals(configService.checkConfigKeyUnique(config))) {
+            return AjaxResult.error("新增参数'" + config.getConfigName() + "'失败,参数键名已存在");
+        }
+        config.setCreateBy(SecurityUtils.getUsername());
+        return toAjax(configService.insertConfig(config));
+    }
+
+    /**
+     * 修改参数配置
+     */
+    @PreAuthorize("@ss.hasPermi('system:config:edit')")
+    @Log(title = "参数管理", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@Validated @RequestBody SysConfig config) {
+        if (UserConstants.NOT_UNIQUE.equals(configService.checkConfigKeyUnique(config))) {
+            return AjaxResult.error("修改参数'" + config.getConfigName() + "'失败,参数键名已存在");
+        }
+        config.setUpdateBy(SecurityUtils.getUsername());
+        return toAjax(configService.updateConfig(config));
+    }
+
+    /**
+     * 删除参数配置
+     */
+    @PreAuthorize("@ss.hasPermi('system:config:remove')")
+    @Log(title = "参数管理", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{configIds}")
+    public AjaxResult remove(@PathVariable Long[] configIds) {
+        return toAjax(configService.deleteConfigByIds(configIds));
+    }
+
+    /**
+     * 清空缓存
+     */
+    @PreAuthorize("@ss.hasPermi('system:config:remove')")
+    @Log(title = "参数管理", businessType = BusinessType.CLEAN)
+    @DeleteMapping("/clearCache")
+    public AjaxResult clearCache() {
+        configService.clearCache();
+        return AjaxResult.success();
+    }
+}

+ 133 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java

@@ -0,0 +1,133 @@
+package com.ruoyi.web.controller.system;
+
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.constant.UserConstants;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.domain.entity.SysDept;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.utils.SecurityUtils;
+import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.system.service.ISysDeptService;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.ArrayUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 部门信息
+ *
+ * @author ruoyi
+ */
+@RestController
+@RequestMapping("/system/dept")
+@Slf4j
+public class SysDeptController extends BaseController {
+    @Autowired
+    private ISysDeptService deptService;
+
+    /**
+     * 获取部门列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:dept:list')")
+    @GetMapping("/list")
+    public AjaxResult list(SysDept dept) {
+        List<SysDept> depts = deptService.selectDeptList(dept);
+        return AjaxResult.success(depts);
+    }
+
+    /**
+     * 查询部门列表(排除节点)
+     */
+    @PreAuthorize("@ss.hasPermi('system:dept:list')")
+    @GetMapping("/list/exclude/{deptId}")
+    public AjaxResult excludeChild(@PathVariable(value = "deptId", required = false) Long deptId) {
+        List<SysDept> depts = deptService.selectDeptList(new SysDept());
+        depts.removeIf(d -> d.getDeptId().intValue() == deptId
+                || ArrayUtils.contains(StringUtils.split(d.getAncestors(), ","), deptId + ""));
+        return AjaxResult.success(depts);
+    }
+
+    /**
+     * 根据部门编号获取详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('system:dept:query')")
+    @GetMapping(value = "/{deptId}")
+    public AjaxResult getInfo(@PathVariable Long deptId) {
+        return AjaxResult.success(deptService.selectDeptById(deptId));
+    }
+
+    /**
+     * 获取部门下拉树列表
+     */
+    @GetMapping("/treeselect")
+    public AjaxResult treeselect(SysDept dept) {
+        List<SysDept> depts = deptService.selectDeptList(dept);
+        return AjaxResult.success(deptService.buildDeptTreeSelect(depts));
+    }
+
+    /**
+     * 加载对应角色部门列表树
+     */
+    @GetMapping(value = "/roleDeptTreeselect/{roleId}")
+    public AjaxResult roleDeptTreeselect(@PathVariable("roleId") Long roleId) {
+        List<SysDept> depts = deptService.selectDeptList(new SysDept());
+        AjaxResult ajax = AjaxResult.success();
+        ajax.put("checkedKeys", deptService.selectDeptListByRoleId(roleId));
+        ajax.put("depts", deptService.buildDeptTreeSelect(depts));
+        return ajax;
+    }
+
+    /**
+     * 新增部门
+     */
+    @PreAuthorize("@ss.hasPermi('system:dept:add')")
+    @Log(title = "部门管理", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@Validated @RequestBody SysDept dept) {
+        if (UserConstants.NOT_UNIQUE.equals(deptService.checkDeptNameUnique(dept))) {
+            return AjaxResult.error("新增部门'" + dept.getDeptName() + "'失败,部门名称已存在");
+        }
+        dept.setCreateBy(SecurityUtils.getUsername());
+        return toAjax(deptService.insertDept(dept));
+    }
+
+    /**
+     * 修改部门
+     */
+    @PreAuthorize("@ss.hasPermi('system:dept:edit')")
+    @Log(title = "部门管理", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@Validated @RequestBody SysDept dept) {
+        if (UserConstants.NOT_UNIQUE.equals(deptService.checkDeptNameUnique(dept))) {
+            return AjaxResult.error("修改部门'" + dept.getDeptName() + "'失败,部门名称已存在");
+        } else if (dept.getParentId().equals(dept.getDeptId())) {
+            return AjaxResult.error("修改部门'" + dept.getDeptName() + "'失败,上级部门不能是自己");
+        } else if (StringUtils.equals(UserConstants.DEPT_DISABLE, dept.getStatus())
+                && deptService.selectNormalChildrenDeptById(dept.getDeptId()) > 0) {
+            return AjaxResult.error("该部门包含未停用的子部门!");
+        }
+        dept.setUpdateBy(SecurityUtils.getUsername());
+        return toAjax(deptService.updateDept(dept));
+    }
+
+    /**
+     * 删除部门
+     */
+    @PreAuthorize("@ss.hasPermi('system:dept:remove')")
+    @Log(title = "部门管理", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{deptId}")
+    public AjaxResult remove(@PathVariable Long deptId) {
+        if (deptService.hasChildByDeptId(deptId)) {
+            return AjaxResult.error("存在下级部门,不允许删除");
+        }
+        if (deptService.checkDeptExistUser(deptId)) {
+            return AjaxResult.error("部门存在用户,不允许删除");
+        }
+        return toAjax(deptService.deleteDeptById(deptId));
+    }
+}

+ 101 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictDataController.java

@@ -0,0 +1,101 @@
+package com.ruoyi.web.controller.system;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.domain.entity.SysDictData;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.utils.SecurityUtils;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.system.service.ISysDictDataService;
+import com.ruoyi.system.service.ISysDictTypeService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 数据字典信息
+ *
+ * @author ruoyi
+ */
+@RestController
+@RequestMapping("/system/dict/data")
+public class SysDictDataController extends BaseController {
+    @Autowired
+    private ISysDictDataService dictDataService;
+
+    @Autowired
+    private ISysDictTypeService dictTypeService;
+
+    @PreAuthorize("@ss.hasPermi('system:dict:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(SysDictData dictData) {
+        Page<SysDictData> page = startPage(SysDictData.class);
+        List<SysDictData> list = dictDataService.selectDictDataList(dictData, page);
+        return getDataTable(list, page);
+    }
+
+    @Log(title = "字典数据", businessType = BusinessType.EXPORT)
+    @PreAuthorize("@ss.hasPermi('system:dict:export')")
+    @GetMapping("/export")
+    public AjaxResult export(SysDictData dictData) {
+        Page<SysDictData> page = startPage(SysDictData.class);
+        List<SysDictData> list = dictDataService.selectDictDataList(dictData, page);
+        ExcelUtil<SysDictData> util = new ExcelUtil<SysDictData>(SysDictData.class);
+        return util.exportExcel(list, "字典数据");
+    }
+
+    /**
+     * 查询字典数据详细
+     */
+    @PreAuthorize("@ss.hasPermi('system:dict:query')")
+    @GetMapping(value = "/{dictCode}")
+    public AjaxResult getInfo(@PathVariable Long dictCode) {
+        return AjaxResult.success(dictDataService.selectDictDataById(dictCode));
+    }
+
+    /**
+     * 根据字典类型查询字典数据信息
+     */
+    @GetMapping(value = "/type/{dictType}")
+    public AjaxResult dictType(@PathVariable String dictType) {
+        return AjaxResult.success(dictTypeService.selectDictDataByType(dictType));
+    }
+
+    /**
+     * 新增字典类型
+     */
+    @PreAuthorize("@ss.hasPermi('system:dict:add')")
+    @Log(title = "字典数据", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@Validated @RequestBody SysDictData dict) {
+        dict.setCreateBy(SecurityUtils.getUsername());
+        return toAjax(dictDataService.insertDictData(dict));
+    }
+
+    /**
+     * 修改保存字典类型
+     */
+    @PreAuthorize("@ss.hasPermi('system:dict:edit')")
+    @Log(title = "字典数据", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@Validated @RequestBody SysDictData dict) {
+        dict.setUpdateBy(SecurityUtils.getUsername());
+        return toAjax(dictDataService.updateDictData(dict));
+    }
+
+    /**
+     * 删除字典类型
+     */
+    @PreAuthorize("@ss.hasPermi('system:dict:remove')")
+    @Log(title = "字典类型", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{dictCodes}")
+    public AjaxResult remove(@PathVariable Long[] dictCodes) {
+        return toAjax(dictDataService.deleteDictDataByIds(dictCodes));
+    }
+}

+ 116 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictTypeController.java

@@ -0,0 +1,116 @@
+package com.ruoyi.web.controller.system;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.constant.UserConstants;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.domain.entity.SysDictType;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.utils.SecurityUtils;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.system.service.ISysDictTypeService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 数据字典信息
+ *
+ * @author ruoyi
+ */
+@RestController
+@RequestMapping("/system/dict/type")
+public class SysDictTypeController extends BaseController {
+    @Autowired
+    private ISysDictTypeService dictTypeService;
+
+    @PreAuthorize("@ss.hasPermi('system:dict:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(SysDictType dictType) {
+        Page<SysDictType> typePage = startPage(SysDictType.class);
+        List<SysDictType> list = dictTypeService.selectDictTypeList(dictType, typePage);
+        return getDataTable(list, typePage);
+    }
+
+    @Log(title = "字典类型", businessType = BusinessType.EXPORT)
+    @PreAuthorize("@ss.hasPermi('system:dict:export')")
+    @GetMapping("/export")
+    public AjaxResult export(SysDictType dictType) {
+        Page<SysDictType> typePage = startPage(SysDictType.class);
+        List<SysDictType> list = dictTypeService.selectDictTypeList(dictType, typePage);
+        ExcelUtil<SysDictType> util = new ExcelUtil<SysDictType>(SysDictType.class);
+        return util.exportExcel(list, "字典类型");
+    }
+
+    /**
+     * 查询字典类型详细
+     */
+    @PreAuthorize("@ss.hasPermi('system:dict:query')")
+    @GetMapping(value = "/{dictId}")
+    public AjaxResult getInfo(@PathVariable Long dictId) {
+        return AjaxResult.success(dictTypeService.selectDictTypeById(dictId));
+    }
+
+    /**
+     * 新增字典类型
+     */
+    @PreAuthorize("@ss.hasPermi('system:dict:add')")
+    @Log(title = "字典类型", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@Validated @RequestBody SysDictType dict) {
+        if (UserConstants.NOT_UNIQUE.equals(dictTypeService.checkDictTypeUnique(dict))) {
+            return AjaxResult.error("新增字典'" + dict.getDictName() + "'失败,字典类型已存在");
+        }
+        dict.setCreateBy(SecurityUtils.getUsername());
+        return toAjax(dictTypeService.insertDictType(dict));
+    }
+
+    /**
+     * 修改字典类型
+     */
+    @PreAuthorize("@ss.hasPermi('system:dict:edit')")
+    @Log(title = "字典类型", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@Validated @RequestBody SysDictType dict) {
+        if (UserConstants.NOT_UNIQUE.equals(dictTypeService.checkDictTypeUnique(dict))) {
+            return AjaxResult.error("修改字典'" + dict.getDictName() + "'失败,字典类型已存在");
+        }
+        dict.setUpdateBy(SecurityUtils.getUsername());
+        return toAjax(dictTypeService.updateDictType(dict));
+    }
+
+    /**
+     * 删除字典类型
+     */
+    @PreAuthorize("@ss.hasPermi('system:dict:remove')")
+    @Log(title = "字典类型", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{dictIds}")
+    public AjaxResult remove(@PathVariable Long[] dictIds) {
+        return toAjax(dictTypeService.deleteDictTypeByIds(dictIds));
+    }
+
+    /**
+     * 清空缓存
+     */
+    @PreAuthorize("@ss.hasPermi('system:dict:remove')")
+    @Log(title = "字典类型", businessType = BusinessType.CLEAN)
+    @DeleteMapping("/clearCache")
+    public AjaxResult clearCache() {
+        dictTypeService.clearCache();
+        return AjaxResult.success();
+    }
+
+    /**
+     * 获取字典选择框列表
+     */
+    @GetMapping("/optionselect")
+    public AjaxResult optionselect() {
+        List<SysDictType> dictTypes = dictTypeService.selectDictTypeAll();
+        return AjaxResult.success(dictTypes);
+    }
+}

+ 95 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java

@@ -0,0 +1,95 @@
+package com.ruoyi.web.controller.system;
+
+import java.util.List;
+import java.util.Set;
+
+import com.ruoyi.common.utils.SecurityUtils;
+import com.ruoyi.framework.security.anno.IgnoreAuth;
+import com.ruoyi.system.limit.DayLimit;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.common.constant.Constants;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.domain.entity.SysMenu;
+import com.ruoyi.common.core.domain.entity.SysUser;
+import com.ruoyi.common.core.domain.model.LoginBody;
+import com.ruoyi.common.core.domain.model.LoginUser;
+import com.ruoyi.common.utils.ServletUtils;
+import com.ruoyi.framework.web.service.SysLoginService;
+import com.ruoyi.framework.web.service.SysPermissionService;
+import com.ruoyi.framework.web.service.TokenService;
+import com.ruoyi.system.service.ISysMenuService;
+
+/**
+ * 登录验证
+ *
+ * @author ruoyi
+ */
+@RestController
+public class SysLoginController {
+    @Autowired
+    private SysLoginService loginService;
+
+    @Autowired
+    private ISysMenuService menuService;
+
+    @Autowired
+    private SysPermissionService permissionService;
+
+    @Autowired
+    private TokenService tokenService;
+
+    /**
+     * 登录方法
+     *
+     * @param loginBody 登录信息
+     * @return 结果
+     */
+    @PostMapping("/login")
+    @IgnoreAuth
+    public AjaxResult login(@RequestBody LoginBody loginBody) {
+        AjaxResult ajax = AjaxResult.success();
+        // 生成令牌
+        String token = loginService.login(loginBody.getUsername(), loginBody.getPassword(), loginBody.getCode(),
+                loginBody.getUuid());
+        ajax.put(Constants.TOKEN, token);
+        return ajax;
+    }
+
+    /**
+     * 获取用户信息
+     *
+     * @return 用户信息
+     */
+    @GetMapping("getInfo")
+    public AjaxResult getInfo() {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        SysUser user = loginUser.getUser();
+        // 角色集合
+        Set<String> roles = permissionService.getRolePermission(user);
+        // 权限集合
+        Set<String> permissions = permissionService.getMenuPermission(user);
+        AjaxResult ajax = AjaxResult.success();
+        ajax.put("user", user);
+        ajax.put("roles", roles);
+        ajax.put("permissions", permissions);
+        return ajax;
+    }
+
+    /**
+     * 获取路由信息
+     *
+     * @return 路由信息
+     */
+    @GetMapping("getRouters")
+    public AjaxResult getRouters() {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        // 用户信息
+        SysUser user = loginUser.getUser();
+        List<SysMenu> menus = menuService.selectMenuTreeByUserId(user.getUserId());
+        return AjaxResult.success(menuService.buildMenus(menus));
+    }
+}

+ 133 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysMenuController.java

@@ -0,0 +1,133 @@
+package com.ruoyi.web.controller.system;
+
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.constant.Constants;
+import com.ruoyi.common.constant.UserConstants;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.domain.entity.SysMenu;
+import com.ruoyi.common.core.domain.model.LoginUser;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.utils.SecurityUtils;
+import com.ruoyi.common.utils.ServletUtils;
+import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.framework.web.service.TokenService;
+import com.ruoyi.system.service.ISysMenuService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 菜单信息
+ *
+ * @author ruoyi
+ */
+@RestController
+@RequestMapping("/system/menu")
+public class SysMenuController extends BaseController {
+    @Autowired
+    private ISysMenuService menuService;
+
+    @Autowired
+    private TokenService tokenService;
+
+    /**
+     * 获取菜单列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:menu:list')")
+    @GetMapping("/list")
+    public AjaxResult list(SysMenu menu) {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        Long userId = loginUser.getUser().getUserId();
+        List<SysMenu> menus = menuService.selectMenuList(menu, userId);
+        return AjaxResult.success(menus);
+    }
+
+    /**
+     * 根据菜单编号获取详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('system:menu:query')")
+    @GetMapping(value = "/{menuId}")
+    public AjaxResult getInfo(@PathVariable Long menuId) {
+        return AjaxResult.success(menuService.selectMenuById(menuId));
+    }
+
+    /**
+     * 获取菜单下拉树列表
+     */
+    @GetMapping("/treeselect")
+    public AjaxResult treeselect(SysMenu menu) {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        Long userId = loginUser.getUser().getUserId();
+        List<SysMenu> menus = menuService.selectMenuList(menu, userId);
+        return AjaxResult.success(menuService.buildMenuTreeSelect(menus));
+    }
+
+    /**
+     * 加载对应角色菜单列表树
+     */
+    @GetMapping(value = "/roleMenuTreeselect/{roleId}")
+    public AjaxResult roleMenuTreeselect(@PathVariable("roleId") Long roleId) {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        List<SysMenu> menus = menuService.selectMenuList(loginUser.getUser().getUserId());
+        AjaxResult ajax = AjaxResult.success();
+        ajax.put("checkedKeys", menuService.selectMenuListByRoleId(roleId));
+        ajax.put("menus", menuService.buildMenuTreeSelect(menus));
+        return ajax;
+    }
+
+    /**
+     * 新增菜单
+     */
+    @PreAuthorize("@ss.hasPermi('system:menu:add')")
+    @Log(title = "菜单管理", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@Validated @RequestBody SysMenu menu) {
+        if (UserConstants.NOT_UNIQUE.equals(menuService.checkMenuNameUnique(menu))) {
+            return AjaxResult.error("新增菜单'" + menu.getMenuName() + "'失败,菜单名称已存在");
+        } else if (UserConstants.YES_FRAME.equals(menu.getIsFrame())
+                && !StringUtils.startsWithAny(menu.getPath(), Constants.HTTP, Constants.HTTPS)) {
+            return AjaxResult.error("新增菜单'" + menu.getMenuName() + "'失败,地址必须以http(s)://开头");
+        }
+        menu.setCreateBy(SecurityUtils.getUsername());
+        return toAjax(menuService.insertMenu(menu));
+    }
+
+    /**
+     * 修改菜单
+     */
+    @PreAuthorize("@ss.hasPermi('system:menu:edit')")
+    @Log(title = "菜单管理", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@Validated @RequestBody SysMenu menu) {
+        if (UserConstants.NOT_UNIQUE.equals(menuService.checkMenuNameUnique(menu))) {
+            return AjaxResult.error("修改菜单'" + menu.getMenuName() + "'失败,菜单名称已存在");
+        } else if (UserConstants.YES_FRAME.equals(menu.getIsFrame())
+                && !StringUtils.startsWithAny(menu.getPath(), Constants.HTTP, Constants.HTTPS)) {
+            return AjaxResult.error("修改菜单'" + menu.getMenuName() + "'失败,地址必须以http(s)://开头");
+        } else if (menu.getMenuId().equals(menu.getParentId())) {
+            return AjaxResult.error("修改菜单'" + menu.getMenuName() + "'失败,上级菜单不能选择自己");
+        }
+        menu.setUpdateBy(SecurityUtils.getUsername());
+        return toAjax(menuService.updateMenu(menu));
+    }
+
+    /**
+     * 删除菜单
+     */
+    @PreAuthorize("@ss.hasPermi('system:menu:remove')")
+    @Log(title = "菜单管理", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{menuId}")
+    public AjaxResult remove(@PathVariable("menuId") Long menuId) {
+        if (menuService.hasChildByMenuId(menuId)) {
+            return AjaxResult.error("存在子菜单,不允许删除");
+        }
+        if (menuService.checkMenuExistRole(menuId)) {
+            return AjaxResult.error("菜单已分配,不允许删除");
+        }
+        return toAjax(menuService.deleteMenuById(menuId));
+    }
+}

+ 85 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysNoticeController.java

@@ -0,0 +1,85 @@
+package com.ruoyi.web.controller.system;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.google.common.primitives.Ints;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.enums.NoticeType;
+import com.ruoyi.common.utils.SecurityUtils;
+import com.ruoyi.system.domain.SysNotice;
+import com.ruoyi.system.service.ISysNoticeService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 公告 信息操作处理
+ *
+ * @author ruoyi
+ */
+@RestController
+@RequestMapping("/system/notice")
+public class SysNoticeController extends BaseController {
+    @Autowired
+    private ISysNoticeService noticeService;
+
+    /**
+     * 获取通知公告列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:notice:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(SysNotice notice) {
+        Page<SysNotice> page = startPage(SysNotice.class);
+        List<SysNotice> list = noticeService.selectNoticeList(notice, page);
+        return getDataTable(list, page);
+    }
+
+    /**
+     * 根据通知公告编号获取详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('system:notice:query')")
+    @GetMapping(value = "/{noticeId}")
+    public AjaxResult getInfo(@PathVariable Long noticeId) {
+        return AjaxResult.success(noticeService.selectNoticeById(noticeId));
+    }
+
+    /**
+     * 新增通知公告
+     */
+    @PreAuthorize("@ss.hasPermi('system:notice:add')")
+    @Log(title = "通知公告", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@Validated @RequestBody SysNotice notice) {
+        notice.setCreateBy(SecurityUtils.getUsername());
+        notice.setNoticeTitle(NoticeType.getByCode(Ints.tryParse(notice.getNoticeType())).getTitle());
+        return toAjax(noticeService.insertNotice(notice));
+    }
+
+    /**
+     * 修改通知公告
+     */
+    @PreAuthorize("@ss.hasPermi('system:notice:edit')")
+    @Log(title = "通知公告", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@Validated @RequestBody SysNotice notice) {
+        notice.setUpdateBy(SecurityUtils.getUsername());
+        notice.setNoticeTitle(NoticeType.getByCode(Ints.tryParse(notice.getNoticeType())).getTitle());
+        return toAjax(noticeService.updateNotice(notice));
+    }
+
+    /**
+     * 删除通知公告
+     */
+    @PreAuthorize("@ss.hasPermi('system:notice:remove')")
+    @Log(title = "通知公告", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{noticeIds}")
+    public AjaxResult remove(@PathVariable Long[] noticeIds) {
+        return toAjax(noticeService.deleteNoticeByIds(noticeIds));
+    }
+}

+ 119 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysPostController.java

@@ -0,0 +1,119 @@
+package com.ruoyi.web.controller.system;
+
+import java.util.List;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.constant.UserConstants;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.utils.SecurityUtils;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.system.domain.SysPost;
+import com.ruoyi.system.service.ISysPostService;
+
+/**
+ * 岗位信息操作处理
+ *
+ * @author ruoyi
+ */
+@RestController
+@RequestMapping("/system/post")
+public class SysPostController extends BaseController {
+    @Autowired
+    private ISysPostService postService;
+
+    /**
+     * 获取岗位列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:post:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(SysPost post) {
+        Page<SysPost> page = startPage(SysPost.class);
+        List<SysPost> list = postService.selectPostList(post, page);
+        return getDataTable(list, page);
+    }
+
+    @Log(title = "岗位管理", businessType = BusinessType.EXPORT)
+    @PreAuthorize("@ss.hasPermi('system:post:export')")
+    @GetMapping("/export")
+    public AjaxResult export(SysPost post) {
+        Page<SysPost> page = startPage(SysPost.class);
+        List<SysPost> list = postService.selectPostList(post, page);
+        ExcelUtil<SysPost> util = new ExcelUtil<SysPost>(SysPost.class);
+        return util.exportExcel(list, "岗位数据");
+    }
+
+    /**
+     * 根据岗位编号获取详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('system:post:query')")
+    @GetMapping(value = "/{postId}")
+    public AjaxResult getInfo(@PathVariable Long postId) {
+        return AjaxResult.success(postService.selectPostById(postId));
+    }
+
+    /**
+     * 新增岗位
+     */
+    @PreAuthorize("@ss.hasPermi('system:post:add')")
+    @Log(title = "岗位管理", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@Validated @RequestBody SysPost post) {
+        if (UserConstants.NOT_UNIQUE.equals(postService.checkPostNameUnique(post))) {
+            return AjaxResult.error("新增岗位'" + post.getPostName() + "'失败,岗位名称已存在");
+        } else if (UserConstants.NOT_UNIQUE.equals(postService.checkPostCodeUnique(post))) {
+            return AjaxResult.error("新增岗位'" + post.getPostName() + "'失败,岗位编码已存在");
+        }
+        post.setCreateBy(SecurityUtils.getUsername());
+        return toAjax(postService.insertPost(post));
+    }
+
+    /**
+     * 修改岗位
+     */
+    @PreAuthorize("@ss.hasPermi('system:post:edit')")
+    @Log(title = "岗位管理", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@Validated @RequestBody SysPost post) {
+        if (UserConstants.NOT_UNIQUE.equals(postService.checkPostNameUnique(post))) {
+            return AjaxResult.error("修改岗位'" + post.getPostName() + "'失败,岗位名称已存在");
+        } else if (UserConstants.NOT_UNIQUE.equals(postService.checkPostCodeUnique(post))) {
+            return AjaxResult.error("修改岗位'" + post.getPostName() + "'失败,岗位编码已存在");
+        }
+        post.setUpdateBy(SecurityUtils.getUsername());
+        return toAjax(postService.updatePost(post));
+    }
+
+    /**
+     * 删除岗位
+     */
+    @PreAuthorize("@ss.hasPermi('system:post:remove')")
+    @Log(title = "岗位管理", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{postIds}")
+    public AjaxResult remove(@PathVariable Long[] postIds) {
+        return toAjax(postService.deletePostByIds(postIds));
+    }
+
+    /**
+     * 获取岗位选择框列表
+     */
+    @GetMapping("/optionselect")
+    public AjaxResult optionselect() {
+        List<SysPost> posts = postService.selectPostAll();
+        return AjaxResult.success(posts);
+    }
+}

+ 111 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java

@@ -0,0 +1,111 @@
+package com.ruoyi.web.controller.system;
+
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.config.RuoYiConfig;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.domain.entity.SysUser;
+import com.ruoyi.common.core.domain.model.LoginUser;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.utils.SecurityUtils;
+import com.ruoyi.common.utils.ServletUtils;
+import com.ruoyi.common.utils.file.FileUploadUtils;
+import com.ruoyi.framework.web.service.TokenService;
+import com.ruoyi.system.service.ISysUserService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.io.IOException;
+
+/**
+ * 个人信息 业务处理
+ *
+ * @author ruoyi
+ */
+@RestController
+@RequestMapping("/system/user/profile")
+public class SysProfileController extends BaseController {
+    @Autowired
+    private ISysUserService userService;
+
+    @Autowired
+    private TokenService tokenService;
+
+    /**
+     * 个人信息
+     */
+    @GetMapping
+    public AjaxResult profile() {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        SysUser user = loginUser.getUser();
+        AjaxResult ajax = AjaxResult.success(user);
+        ajax.put("roleGroup", userService.selectUserRoleGroup(loginUser.getUsername()));
+        ajax.put("postGroup", userService.selectUserPostGroup(loginUser.getUsername()));
+        return ajax;
+    }
+
+    /**
+     * 修改用户
+     */
+    @Log(title = "个人信息", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult updateProfile(@RequestBody SysUser user) {
+        if (userService.updateUserProfile(user) > 0) {
+            LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+            // 更新缓存用户信息
+            loginUser.getUser().setNickName(user.getNickName());
+            loginUser.getUser().setPhonenumber(user.getPhonenumber());
+            loginUser.getUser().setEmail(user.getEmail());
+            loginUser.getUser().setSex(user.getSex());
+            tokenService.setLoginUser(loginUser);
+            return AjaxResult.success();
+        }
+        return AjaxResult.error("修改个人信息异常,请联系管理员");
+    }
+
+    /**
+     * 重置密码
+     */
+    @Log(title = "个人信息", businessType = BusinessType.UPDATE)
+    @PutMapping("/updatePwd")
+    public AjaxResult updatePwd(String oldPassword, String newPassword) {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        String userName = loginUser.getUsername();
+        String password = loginUser.getPassword();
+        if (!SecurityUtils.matchesPassword(oldPassword, password)) {
+            return AjaxResult.error("修改密码失败,旧密码错误");
+        }
+        if (SecurityUtils.matchesPassword(newPassword, password)) {
+            return AjaxResult.error("新密码不能与旧密码相同");
+        }
+        if (userService.resetUserPwd(userName, SecurityUtils.encryptPassword(newPassword)) > 0) {
+            // 更新缓存用户密码
+            loginUser.getUser().setPassword(SecurityUtils.encryptPassword(newPassword));
+            tokenService.setLoginUser(loginUser);
+            return AjaxResult.success();
+        }
+        return AjaxResult.error("修改密码异常,请联系管理员");
+    }
+
+    /**
+     * 头像上传
+     */
+    @Log(title = "用户头像", businessType = BusinessType.UPDATE)
+    @PostMapping("/avatar")
+    public AjaxResult avatar(@RequestParam("avatarfile") MultipartFile file) throws IOException {
+        if (!file.isEmpty()) {
+            LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+            String avatar = FileUploadUtils.upload(RuoYiConfig.getAvatarPath(), file);
+            if (userService.updateUserAvatar(loginUser.getUsername(), avatar)) {
+                AjaxResult ajax = AjaxResult.success();
+                ajax.put("imgUrl", avatar);
+                // 更新缓存用户头像
+                loginUser.getUser().setAvatar(avatar);
+                tokenService.setLoginUser(loginUser);
+                return ajax;
+            }
+        }
+        return AjaxResult.error("上传图片异常,请联系管理员");
+    }
+}

+ 160 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java

@@ -0,0 +1,160 @@
+package com.ruoyi.web.controller.system;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.constant.UserConstants;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.domain.entity.SysRole;
+import com.ruoyi.common.core.domain.model.LoginUser;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.utils.SecurityUtils;
+import com.ruoyi.common.utils.ServletUtils;
+import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.framework.web.service.SysPermissionService;
+import com.ruoyi.framework.web.service.TokenService;
+import com.ruoyi.system.service.ISysRoleService;
+import com.ruoyi.system.service.ISysUserService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 角色信息
+ *
+ * @author ruoyi
+ */
+@RestController
+@RequestMapping("/system/role")
+public class SysRoleController extends BaseController {
+    @Autowired
+    private ISysRoleService roleService;
+
+    @Autowired
+    private TokenService tokenService;
+
+    @Autowired
+    private SysPermissionService permissionService;
+
+    @Autowired
+    private ISysUserService userService;
+
+    @PreAuthorize("@ss.hasPermi('system:role:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(SysRole role) {
+        Page<SysRole> page = startPage(SysRole.class);
+        List<SysRole> list = roleService.selectRoleList(role, page);
+        return getDataTable(list, page);
+    }
+
+    @Log(title = "角色管理", businessType = BusinessType.EXPORT)
+    @PreAuthorize("@ss.hasPermi('system:role:export')")
+    @GetMapping("/export")
+    public AjaxResult export(SysRole role) {
+        Page<SysRole> page = startPage(SysRole.class);
+        List<SysRole> list = roleService.selectRoleList(role, page);
+        ExcelUtil<SysRole> util = new ExcelUtil<SysRole>(SysRole.class);
+        return util.exportExcel(list, "角色数据");
+    }
+
+    /**
+     * 根据角色编号获取详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('system:role:query')")
+    @GetMapping(value = "/{roleId}")
+    public AjaxResult getInfo(@PathVariable Long roleId) {
+        return AjaxResult.success(roleService.selectRoleById(roleId));
+    }
+
+    /**
+     * 新增角色
+     */
+    @PreAuthorize("@ss.hasPermi('system:role:add')")
+    @Log(title = "角色管理", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@Validated @RequestBody SysRole role) {
+        if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleNameUnique(role))) {
+            return AjaxResult.error("新增角色'" + role.getRoleName() + "'失败,角色名称已存在");
+        } else if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleKeyUnique(role))) {
+            return AjaxResult.error("新增角色'" + role.getRoleName() + "'失败,角色权限已存在");
+        }
+        role.setCreateBy(SecurityUtils.getUsername());
+        return toAjax(roleService.insertRole(role));
+
+    }
+
+    /**
+     * 修改保存角色
+     */
+    @PreAuthorize("@ss.hasPermi('system:role:edit')")
+    @Log(title = "角色管理", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@Validated @RequestBody SysRole role) {
+        roleService.checkRoleAllowed(role);
+        if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleNameUnique(role))) {
+            return AjaxResult.error("修改角色'" + role.getRoleName() + "'失败,角色名称已存在");
+        } else if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleKeyUnique(role))) {
+            return AjaxResult.error("修改角色'" + role.getRoleName() + "'失败,角色权限已存在");
+        }
+        role.setUpdateBy(SecurityUtils.getUsername());
+
+        if (roleService.updateRole(role) > 0) {
+            // 更新缓存用户权限
+            LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+            if (StringUtils.isNotNull(loginUser.getUser()) && !loginUser.getUser().isAdmin()) {
+                loginUser.setPermissions(permissionService.getMenuPermission(loginUser.getUser()));
+                loginUser.setUser(userService.selectUserByUserName(loginUser.getUser().getUserName()));
+                tokenService.setLoginUser(loginUser);
+            }
+            return AjaxResult.success();
+        }
+        return AjaxResult.error("修改角色'" + role.getRoleName() + "'失败,请联系管理员");
+    }
+
+    /**
+     * 修改保存数据权限
+     */
+    @PreAuthorize("@ss.hasPermi('system:role:edit')")
+    @Log(title = "角色管理", businessType = BusinessType.UPDATE)
+    @PutMapping("/dataScope")
+    public AjaxResult dataScope(@RequestBody SysRole role) {
+        roleService.checkRoleAllowed(role);
+        return toAjax(roleService.authDataScope(role));
+    }
+
+    /**
+     * 状态修改
+     */
+    @PreAuthorize("@ss.hasPermi('system:role:edit')")
+    @Log(title = "角色管理", businessType = BusinessType.UPDATE)
+    @PutMapping("/changeStatus")
+    public AjaxResult changeStatus(@RequestBody SysRole role) {
+        roleService.checkRoleAllowed(role);
+        role.setUpdateBy(SecurityUtils.getUsername());
+        return toAjax(roleService.updateRoleStatus(role));
+    }
+
+    /**
+     * 删除角色
+     */
+    @PreAuthorize("@ss.hasPermi('system:role:remove')")
+    @Log(title = "角色管理", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{roleIds}")
+    public AjaxResult remove(@PathVariable Long[] roleIds) {
+        return toAjax(roleService.deleteRoleByIds(roleIds));
+    }
+
+    /**
+     * 获取角色选择框列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:role:query')")
+    @GetMapping("/optionselect")
+    public AjaxResult optionselect() {
+        return AjaxResult.success(roleService.selectRoleAll());
+    }
+}

+ 186 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java

@@ -0,0 +1,186 @@
+package com.ruoyi.web.controller.system;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.multipart.MultipartFile;
+
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.constant.UserConstants;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.domain.entity.SysRole;
+import com.ruoyi.common.core.domain.entity.SysUser;
+import com.ruoyi.common.core.domain.model.LoginUser;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.utils.SecurityUtils;
+import com.ruoyi.common.utils.ServletUtils;
+import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.framework.web.service.TokenService;
+import com.ruoyi.system.service.ISysPostService;
+import com.ruoyi.system.service.ISysRoleService;
+import com.ruoyi.system.service.ISysUserService;
+
+/**
+ * 用户信息
+ *
+ * @author ruoyi
+ */
+@RestController
+@RequestMapping("/system/user")
+public class SysUserController extends BaseController {
+    @Autowired
+    private ISysUserService userService;
+
+    @Autowired
+    private ISysRoleService roleService;
+
+    @Autowired
+    private ISysPostService postService;
+
+    @Autowired
+    private TokenService tokenService;
+
+    /**
+     * 获取用户列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:user:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(SysUser user) {
+        Page<SysUser> page = startPage(SysUser.class);
+        List<SysUser> list = userService.selectUserList(user, page);
+        return getDataTable(list, page);
+    }
+
+    @Log(title = "用户管理", businessType = BusinessType.EXPORT)
+    @PreAuthorize("@ss.hasPermi('system:user:export')")
+    @GetMapping("/export")
+    public AjaxResult export(SysUser user) {
+        Page<SysUser> page = startPage(SysUser.class);
+        List<SysUser> list = userService.selectUserList(user, page);
+        ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
+        return util.exportExcel(list, "用户数据");
+    }
+
+    @Log(title = "用户管理", businessType = BusinessType.IMPORT)
+    @PreAuthorize("@ss.hasPermi('system:user:import')")
+    @PostMapping("/importData")
+    public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception {
+        ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
+        List<SysUser> userList = util.importExcel(file.getInputStream());
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        String operName = loginUser.getUsername();
+        String message = userService.importUser(userList, updateSupport, operName);
+        return AjaxResult.success(message);
+    }
+
+    @GetMapping("/importTemplate")
+    public AjaxResult importTemplate() {
+        ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
+        return util.importTemplateExcel("用户数据");
+    }
+
+    /**
+     * 根据用户编号获取详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('system:user:query')")
+    @GetMapping(value = {"/", "/{userId}"})
+    public AjaxResult getInfo(@PathVariable(value = "userId", required = false) Long userId) {
+        AjaxResult ajax = AjaxResult.success();
+        List<SysRole> roles = roleService.selectRoleAll();
+        ajax.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList()));
+        ajax.put("posts", postService.selectPostAll());
+        if (StringUtils.isNotNull(userId)) {
+            ajax.put(AjaxResult.DATA_TAG, userService.selectUserById(userId));
+            ajax.put("postIds", postService.selectPostListByUserId(userId));
+            ajax.put("roleIds", roleService.selectRoleListByUserId(userId));
+        }
+        return ajax;
+    }
+
+    /**
+     * 新增用户
+     */
+    @PreAuthorize("@ss.hasPermi('system:user:add')")
+    @Log(title = "用户管理", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@Validated @RequestBody SysUser user) {
+        if (UserConstants.NOT_UNIQUE.equals(userService.checkUserNameUnique(user.getUserName()))) {
+            return AjaxResult.error("新增用户'" + user.getUserName() + "'失败,登录账号已存在");
+        } else if (UserConstants.NOT_UNIQUE.equals(userService.checkPhoneUnique(user))) {
+            return AjaxResult.error("新增用户'" + user.getUserName() + "'失败,手机号码已存在");
+        } else if (UserConstants.NOT_UNIQUE.equals(userService.checkEmailUnique(user))) {
+            return AjaxResult.error("新增用户'" + user.getUserName() + "'失败,邮箱账号已存在");
+        }
+        user.setCreateBy(SecurityUtils.getUsername());
+        user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
+        return toAjax(userService.insertUser(user));
+    }
+
+    /**
+     * 修改用户
+     */
+    @PreAuthorize("@ss.hasPermi('system:user:edit')")
+    @Log(title = "用户管理", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@Validated @RequestBody SysUser user) {
+        userService.checkUserAllowed(user);
+        if (UserConstants.NOT_UNIQUE.equals(userService.checkPhoneUnique(user))) {
+            return AjaxResult.error("修改用户'" + user.getUserName() + "'失败,手机号码已存在");
+        } else if (UserConstants.NOT_UNIQUE.equals(userService.checkEmailUnique(user))) {
+            return AjaxResult.error("修改用户'" + user.getUserName() + "'失败,邮箱账号已存在");
+        }
+        user.setUpdateBy(SecurityUtils.getUsername());
+        return toAjax(userService.updateUser(user));
+    }
+
+    /**
+     * 删除用户
+     */
+    @PreAuthorize("@ss.hasPermi('system:user:remove')")
+    @Log(title = "用户管理", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{userIds}")
+    public AjaxResult remove(@PathVariable Long[] userIds) {
+        return toAjax(userService.deleteUserByIds(userIds));
+    }
+
+    /**
+     * 重置密码
+     */
+    @PreAuthorize("@ss.hasPermi('system:user:resetPwd')")
+    @Log(title = "用户管理", businessType = BusinessType.UPDATE)
+    @PutMapping("/resetPwd")
+    public AjaxResult resetPwd(@RequestBody SysUser user) {
+        userService.checkUserAllowed(user);
+        user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
+        user.setUpdateBy(SecurityUtils.getUsername());
+        return toAjax(userService.resetPwd(user));
+    }
+
+    /**
+     * 状态修改
+     */
+    @PreAuthorize("@ss.hasPermi('system:user:edit')")
+    @Log(title = "用户管理", businessType = BusinessType.UPDATE)
+    @PutMapping("/changeStatus")
+    public AjaxResult changeStatus(@RequestBody SysUser user) {
+        userService.checkUserAllowed(user);
+        user.setUpdateBy(SecurityUtils.getUsername());
+        return toAjax(userService.updateUserStatus(user));
+    }
+}

+ 116 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/ZbAccessInfoController.java

@@ -0,0 +1,116 @@
+package com.ruoyi.web.controller.system;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.system.domain.ZbAccessInfo;
+import com.ruoyi.system.service.IZbAccessInfoService;
+import com.ruoyi.web.core.inteceptors.AccessInterceptor;
+import lombok.RequiredArgsConstructor;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 【请填写功能名称】Controller
+ *
+ * @author ruoyi
+ * @date 2020-11-30
+ */
+@RestController
+@RequestMapping("/system/info")
+@RequiredArgsConstructor
+public class ZbAccessInfoController extends BaseController {
+    private final IZbAccessInfoService zbAccessInfoService;
+
+
+    @GetMapping("/access")
+    public AjaxResult accessInfo() {
+        int total = zbAccessInfoService.count();
+        Map<String, Integer> resultMap = new HashMap<>();
+        resultMap.put("today", AccessInterceptor.getACCESS_LIST().size());
+        resultMap.put("total", total);
+        return AjaxResult.success(resultMap);
+    }
+
+
+    @GetMapping("/statistics")
+    public AjaxResult statistics() {
+        Map<String, Integer> result = zbAccessInfoService.statistics();
+        return AjaxResult.success(result);
+    }
+
+    /**
+     * 查询【请填写功能名称】列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:info:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(ZbAccessInfo zbAccessInfo) {
+        Page<ZbAccessInfo> page = startPage(ZbAccessInfo.class);
+        List<ZbAccessInfo> list = zbAccessInfoService.selectZbAccessInfoList(zbAccessInfo, page);
+        return getDataTable(list, page);
+    }
+
+    /**
+     * 导出【请填写功能名称】列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:info:export')")
+    @Log(title = "【请填写功能名称】", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(ZbAccessInfo zbAccessInfo) {
+        Page<ZbAccessInfo> page = startPage(ZbAccessInfo.class);
+        List<ZbAccessInfo> list = zbAccessInfoService.selectZbAccessInfoList(zbAccessInfo, page);
+        ExcelUtil<ZbAccessInfo> util = new ExcelUtil<ZbAccessInfo>(ZbAccessInfo.class);
+        return util.exportExcel(list, "info");
+    }
+
+    /**
+     * 获取【请填写功能名称】详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('system:info:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id) {
+        return AjaxResult.success(zbAccessInfoService.getById(id));
+    }
+
+    /**
+     * 新增【请填写功能名称】
+     */
+    @PreAuthorize("@ss.hasPermi('system:info:add')")
+    @Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody ZbAccessInfo zbAccessInfo) {
+        return toAjax(zbAccessInfoService.insertZbAccessInfo(zbAccessInfo));
+    }
+
+    /**
+     * 修改【请填写功能名称】
+     */
+    @PreAuthorize("@ss.hasPermi('system:info:edit')")
+    @Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody ZbAccessInfo zbAccessInfo) {
+        return toAjax(zbAccessInfoService.updateZbAccessInfo(zbAccessInfo));
+    }
+
+    /**
+     * 删除【请填写功能名称】
+     */
+    @PreAuthorize("@ss.hasPermi('system:info:remove')")
+    @Log(title = "【请填写功能名称】", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids) {
+        if (ids == null || ids.length == 0) {
+            return AjaxResult.error("参数不正确");
+        }
+        return toAjax(zbAccessInfoService.removeByIds(Arrays.asList(ids)));
+    }
+}

+ 104 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/ZbBannerController.java

@@ -0,0 +1,104 @@
+package com.ruoyi.web.controller.system;
+
+import java.util.Arrays;
+import java.util.List;
+
+import lombok.RequiredArgsConstructor;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.system.domain.ZbBanner;
+import com.ruoyi.system.service.IZbBannerService;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ruoyi.common.core.page.TableDataInfo;
+
+/**
+ * 轮播图Controller
+ *
+ * @author ruoyi
+ * @date 2020-11-26
+ */
+@RestController
+@RequestMapping("/system/banner")
+@RequiredArgsConstructor
+public class ZbBannerController extends BaseController {
+    private final IZbBannerService zbBannerService;
+
+    /**
+     * 查询轮播图列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:banner:list')")
+    @GetMapping("/list")
+        public TableDataInfo list(ZbBanner zbBanner) {
+        Page<ZbBanner> page = startPage(ZbBanner.class);
+        List<ZbBanner> list = zbBannerService.selectZbBannerList(zbBanner, page);
+        return getDataTable(list, page);
+    }
+    
+    /**
+     * 导出轮播图列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:banner:export')")
+    @Log(title = "轮播图", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(ZbBanner zbBanner) {
+        Page<ZbBanner> page = startPage(ZbBanner.class);
+        List<ZbBanner> list = zbBannerService.selectZbBannerList(zbBanner, page);
+        ExcelUtil<ZbBanner> util = new ExcelUtil<ZbBanner>(ZbBanner. class);
+        return util.exportExcel(list, "banner");
+    }
+
+    /**
+     * 获取轮播图详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('system:banner:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id) {
+        return AjaxResult.success(zbBannerService.getByBannerId(id));
+    }
+
+    /**
+     * 新增轮播图
+     */
+    @PreAuthorize("@ss.hasPermi('system:banner:add')")
+    @Log(title = "轮播图", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody ZbBanner zbBanner) {
+        return toAjax(zbBannerService.insertZbBanner(zbBanner));
+    }
+
+    /**
+     * 修改轮播图
+     */
+    @PreAuthorize("@ss.hasPermi('system:banner:edit')")
+    @Log(title = "轮播图", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody ZbBanner zbBanner) {
+        return toAjax(zbBannerService.updateZbBanner(zbBanner));
+    }
+
+    /**
+     * 删除轮播图
+     */
+    @PreAuthorize("@ss.hasPermi('system:banner:remove')")
+    @Log(title = "轮播图", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids) {
+        if (ids == null || ids.length == 0) {
+            return AjaxResult.error("参数不正确");
+        }
+        return toAjax(zbBannerService.removeByIds(Arrays.asList(ids)));
+    }
+}

+ 24 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/SwaggerController.java

@@ -0,0 +1,24 @@
+package com.ruoyi.web.controller.tool;
+
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import com.ruoyi.common.core.controller.BaseController;
+
+/**
+ * swagger 接口
+ * 
+ * @author ruoyi
+ */
+@Controller
+@RequestMapping("/tool/swagger")
+public class SwaggerController extends BaseController
+{
+    @PreAuthorize("@ss.hasPermi('tool:swagger:view')")
+    @GetMapping()
+    public String index()
+    {
+        return redirect("/swagger-ui.html");
+    }
+}

+ 175 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/TestController.java

@@ -0,0 +1,175 @@
+package com.ruoyi.web.controller.tool;
+
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.utils.StringUtils;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import io.swagger.annotations.ApiOperation;
+
+/**
+ * swagger 用户测试方法
+ * 
+ * @author ruoyi
+ */
+@Api("用户信息管理")
+@RestController
+@RequestMapping("/test/user")
+public class TestController extends BaseController
+{
+    private final static Map<Integer, UserEntity> users = new LinkedHashMap<Integer, UserEntity>();
+    {
+        users.put(1, new UserEntity(1, "admin", "admin123", "15888888888"));
+        users.put(2, new UserEntity(2, "ry", "admin123", "15666666666"));
+    }
+
+    @ApiOperation("获取用户列表")
+    @GetMapping("/list")
+    public AjaxResult userList()
+    {
+        List<UserEntity> userList = new ArrayList<UserEntity>(users.values());
+        return AjaxResult.success(userList);
+    }
+
+    @ApiOperation("获取用户详细")
+    @ApiImplicitParam(name = "userId", value = "用户ID", required = true, dataType = "int", paramType = "path")
+    @GetMapping("/{userId}")
+    public AjaxResult getUser(@PathVariable Integer userId)
+    {
+        if (!users.isEmpty() && users.containsKey(userId))
+        {
+            return AjaxResult.success(users.get(userId));
+        }
+        else
+        {
+            return AjaxResult.error("用户不存在");
+        }
+    }
+
+    @ApiOperation("新增用户")
+    @ApiImplicitParam(name = "userEntity", value = "新增用户信息", dataType = "UserEntity")
+    @PostMapping("/save")
+    public AjaxResult save(UserEntity user)
+    {
+        if (StringUtils.isNull(user) || StringUtils.isNull(user.getUserId()))
+        {
+            return AjaxResult.error("用户ID不能为空");
+        }
+        return AjaxResult.success(users.put(user.getUserId(), user));
+    }
+
+    @ApiOperation("更新用户")
+    @ApiImplicitParam(name = "userEntity", value = "新增用户信息", dataType = "UserEntity")
+    @PutMapping("/update")
+    public AjaxResult update(UserEntity user)
+    {
+        if (StringUtils.isNull(user) || StringUtils.isNull(user.getUserId()))
+        {
+            return AjaxResult.error("用户ID不能为空");
+        }
+        if (users.isEmpty() || !users.containsKey(user.getUserId()))
+        {
+            return AjaxResult.error("用户不存在");
+        }
+        users.remove(user.getUserId());
+        return AjaxResult.success(users.put(user.getUserId(), user));
+    }
+
+    @ApiOperation("删除用户信息")
+    @ApiImplicitParam(name = "userId", value = "用户ID", required = true, dataType = "int", paramType = "path")
+    @DeleteMapping("/{userId}")
+    public AjaxResult delete(@PathVariable Integer userId)
+    {
+        if (!users.isEmpty() && users.containsKey(userId))
+        {
+            users.remove(userId);
+            return AjaxResult.success();
+        }
+        else
+        {
+            return AjaxResult.error("用户不存在");
+        }
+    }
+}
+
+@ApiModel("用户实体")
+class UserEntity
+{
+    @ApiModelProperty("用户ID")
+    private Integer userId;
+
+    @ApiModelProperty("用户名称")
+    private String username;
+
+    @ApiModelProperty("用户密码")
+    private String password;
+
+    @ApiModelProperty("用户手机")
+    private String mobile;
+
+    public UserEntity()
+    {
+
+    }
+
+    public UserEntity(Integer userId, String username, String password, String mobile)
+    {
+        this.userId = userId;
+        this.username = username;
+        this.password = password;
+        this.mobile = mobile;
+    }
+
+    public Integer getUserId()
+    {
+        return userId;
+    }
+
+    public void setUserId(Integer userId)
+    {
+        this.userId = userId;
+    }
+
+    public String getUsername()
+    {
+        return username;
+    }
+
+    public void setUsername(String username)
+    {
+        this.username = username;
+    }
+
+    public String getPassword()
+    {
+        return password;
+    }
+
+    public void setPassword(String password)
+    {
+        this.password = password;
+    }
+
+    public String getMobile()
+    {
+        return mobile;
+    }
+
+    public void setMobile(String mobile)
+    {
+        this.mobile = mobile;
+    }
+}

+ 128 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/core/config/SwaggerConfig.java

@@ -0,0 +1,128 @@
+package com.ruoyi.web.core.config;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import com.ruoyi.common.config.RuoYiConfig;
+import io.swagger.annotations.ApiOperation;
+import springfox.documentation.builders.ApiInfoBuilder;
+import springfox.documentation.builders.PathSelectors;
+import springfox.documentation.builders.RequestHandlerSelectors;
+import springfox.documentation.service.ApiInfo;
+import springfox.documentation.service.ApiKey;
+import springfox.documentation.service.AuthorizationScope;
+import springfox.documentation.service.Contact;
+import springfox.documentation.service.SecurityReference;
+import springfox.documentation.spi.DocumentationType;
+import springfox.documentation.spi.service.contexts.SecurityContext;
+import springfox.documentation.spring.web.plugins.Docket;
+import springfox.documentation.swagger2.annotations.EnableSwagger2;
+
+/**
+ * Swagger2的接口配置
+ *
+ * @author ruoyi
+ */
+@Configuration
+@EnableSwagger2
+@ConditionalOnProperty(value = "swagger.enable", havingValue = "true", matchIfMissing = true)
+public class SwaggerConfig {
+    /**
+     * 系统基础配置
+     */
+    @Autowired
+    private RuoYiConfig ruoyiConfig;
+
+    /**
+     * 是否开启swagger
+     */
+    @Value("${swagger.enabled}")
+    private boolean enabled;
+
+    /**
+     * 设置请求的统一前缀
+     */
+    @Value("${swagger.pathMapping}")
+    private String pathMapping;
+
+    /**
+     * 创建API
+     */
+    @Bean
+    public Docket createRestApi() {
+        return new Docket(DocumentationType.SWAGGER_2)
+                // 是否启用Swagger
+                .enable(enabled)
+                // 用来创建该API的基本信息,展示在文档的页面中(自定义展示的信息)
+                .apiInfo(apiInfo())
+                // 设置哪些接口暴露给Swagger展示
+                .select()
+                // 扫描所有有注解的api,用这种方式更灵活
+                .apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class))
+                // 扫描指定包中的swagger注解
+                // .apis(RequestHandlerSelectors.basePackage("com.ruoyi.project.tool.swagger"))
+                // 扫描所有 .apis(RequestHandlerSelectors.any())
+                .paths(PathSelectors.any())
+                .build()
+                /* 设置安全模式,swagger可以设置访问token */
+                .securitySchemes(securitySchemes())
+                .securityContexts(securityContexts())
+                .pathMapping(pathMapping);
+    }
+
+    /**
+     * 安全模式,这里指定token通过Authorization头请求头传递
+     */
+    private List<ApiKey> securitySchemes() {
+        List<ApiKey> apiKeyList = new ArrayList<ApiKey>();
+        apiKeyList.add(new ApiKey("Authorization", "Authorization", "header"));
+        return apiKeyList;
+    }
+
+    /**
+     * 安全上下文
+     */
+    private List<SecurityContext> securityContexts() {
+        List<SecurityContext> securityContexts = new ArrayList<>();
+        securityContexts.add(
+                SecurityContext.builder()
+                        .securityReferences(defaultAuth())
+                        .forPaths(PathSelectors.regex("^(?!auth).*$"))
+                        .build());
+        return securityContexts;
+    }
+
+    /**
+     * 默认的安全上引用
+     */
+    private List<SecurityReference> defaultAuth() {
+        AuthorizationScope authorizationScope = new AuthorizationScope("global", "accessEverything");
+        AuthorizationScope[] authorizationScopes = new AuthorizationScope[1];
+        authorizationScopes[0] = authorizationScope;
+        List<SecurityReference> securityReferences = new ArrayList<>();
+        securityReferences.add(new SecurityReference("Authorization", authorizationScopes));
+        return securityReferences;
+    }
+
+    /**
+     * 添加摘要信息
+     */
+    private ApiInfo apiInfo() {
+        // 用ApiInfoBuilder进行定制
+        return new ApiInfoBuilder()
+                // 设置标题
+                .title("标题:植保图像平台_接口文档")
+                // 描述
+                .description("描述:植保图像平台_接口文档...")
+                // 作者信息
+                .contact(new Contact(ruoyiConfig.getName(), null, null))
+                // 版本
+                .version("版本号:" + ruoyiConfig.getVersion())
+                .build();
+    }
+}

+ 22 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/core/config/WebConfig.java

@@ -0,0 +1,22 @@
+package com.ruoyi.web.core.config;
+
+import com.ruoyi.web.core.inteceptors.AccessInterceptor;
+import lombok.RequiredArgsConstructor;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
+
+/**
+ * @author Admin
+ * @date 2020/11/30
+ */
+@Configuration
+@RequiredArgsConstructor
+public class WebConfig implements WebMvcConfigurer {
+    private final AccessInterceptor accessInterceptor;
+
+    @Override
+    public void addInterceptors(InterceptorRegistry registry) {
+        registry.addInterceptor(accessInterceptor).addPathPatterns("/front/**");
+    }
+}

+ 78 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/core/inteceptors/AccessInterceptor.java

@@ -0,0 +1,78 @@
+package com.ruoyi.web.core.inteceptors;
+
+import cn.hutool.core.date.DatePattern;
+import cn.hutool.core.date.DateTime;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.common.utils.ServletUtils;
+import com.ruoyi.common.utils.ip.AddressUtils;
+import com.ruoyi.common.utils.ip.IpUtils;
+import com.ruoyi.framework.manager.AsyncManager;
+import com.ruoyi.system.domain.ZbAccessInfo;
+import com.ruoyi.system.service.IZbAccessInfoService;
+import eu.bitwalker.useragentutils.UserAgent;
+import lombok.Getter;
+import lombok.RequiredArgsConstructor;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Component;
+import org.springframework.web.servlet.HandlerInterceptor;
+
+import javax.annotation.PostConstruct;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.TimerTask;
+import java.util.stream.Collectors;
+
+/**
+ * @author Admin
+ * @date 2020/11/30
+ */
+@Component
+@RequiredArgsConstructor
+public class AccessInterceptor implements HandlerInterceptor {
+    private final IZbAccessInfoService accessInfoService;
+    @Getter
+    private static final List<String> ACCESS_LIST = Collections.synchronizedList(new ArrayList<>());
+
+
+    @PostConstruct
+    public void loadAccessInfo() {
+        String date = DateTime.now().toString(DatePattern.NORM_DATE_FORMAT);
+        LambdaQueryWrapper<ZbAccessInfo> queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper.eq(ZbAccessInfo::getAccessTime, date);
+        List<String> ipList = accessInfoService.list(queryWrapper).stream().map(ZbAccessInfo::getIp).distinct().collect(Collectors.toList());
+        ACCESS_LIST.addAll(ipList);
+    }
+
+    @Scheduled(cron = "0 0 0 * * ? ")
+    public void dayClear() {
+        ACCESS_LIST.clear();
+    }
+
+    @Override
+    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
+        String ipAddr = IpUtils.getIpAddr(request);
+        if (ACCESS_LIST.contains(ipAddr)) {
+            return true;
+        }
+        ACCESS_LIST.add(ipAddr);
+        UserAgent userAgent = UserAgent.parseUserAgentString(ServletUtils.getRequest().getHeader("User-Agent"));
+        AsyncManager.me().execute(new TimerTask() {
+            @Override
+            public void run() {
+                ZbAccessInfo accessInfo = new ZbAccessInfo();
+                accessInfo.setAccessTime(DateUtils.getNowDate());
+                accessInfo.setIp(ipAddr);
+                accessInfo.setLocation(AddressUtils.getRealAddressByIP(ipAddr));
+                accessInfo.setBrowser(userAgent.getBrowser().getName());
+                accessInfo.setOs(userAgent.getOperatingSystem().getName());
+                accessInfo.setCreateTime(DateUtils.getNowDate());
+                accessInfoService.save(accessInfo);
+            }
+        });
+        return true;
+    }
+}

+ 1 - 0
ruoyi-admin/src/main/resources/META-INF/spring-devtools.properties

@@ -0,0 +1 @@
+restart.include.json=/com.alibaba.fastjson.*.jar

+ 57 - 0
ruoyi-admin/src/main/resources/application-druid.yml

@@ -0,0 +1,57 @@
+# 数据源配置
+spring:
+    datasource:
+        type: com.alibaba.druid.pool.DruidDataSource
+        driverClassName: com.mysql.cj.jdbc.Driver
+        druid:
+            # 主库数据源
+            master:
+                url: jdbc:mysql://192.168.101.226:3306/bm_project?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+                username: root
+                password: 123456
+#            # 从库数据源
+#            slave:
+#                # 从数据源开关/默认关闭
+#                enabled: false
+#                url:
+#                username:
+#                password:
+            # 初始连接数
+            initialSize: 5
+            # 最小连接池数量
+            minIdle: 10
+            # 最大连接池数量
+            maxActive: 20
+            # 配置获取连接等待超时的时间
+            maxWait: 60000
+            # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
+            timeBetweenEvictionRunsMillis: 60000
+            # 配置一个连接在池中最小生存的时间,单位是毫秒
+            minEvictableIdleTimeMillis: 300000
+            # 配置一个连接在池中最大生存的时间,单位是毫秒
+            maxEvictableIdleTimeMillis: 900000
+            # 配置检测连接是否有效
+            validationQuery: SELECT 1 FROM DUAL
+            testWhileIdle: true
+            testOnBorrow: false
+            testOnReturn: false
+            webStatFilter: 
+                enabled: true
+            statViewServlet:
+                enabled: true
+                # 设置白名单,不填则允许所有访问
+                allow:
+                url-pattern: /druid/*
+                # 控制台管理用户名和密码
+                login-username: 
+                login-password: 
+            filter:
+                stat:
+                    enabled: true
+                    # 慢SQL记录
+                    log-slow-sql: true
+                    slow-sql-millis: 1000
+                    merge-sql: true
+                wall:
+                    config:
+                        multi-statement-allow: true

+ 191 - 0
ruoyi-admin/src/main/resources/application-prod.yml

@@ -0,0 +1,191 @@
+# 项目相关配置
+ruoyi:
+  # 名称
+  name: 植保图像库
+  # 版本
+  version: 1.0.0
+  # 版权年份
+  copyrightYear: 2020
+  # 实例演示开关
+  demoEnabled: true
+  # 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath)
+  profile: D:\file
+  # 获取ip地址开关
+  addressEnabled: false
+  # 验证码类型 math 数组计算 char 字符验证
+  captchaType: math
+  # 图片预览路径
+  url: http://172.17.254.46:8080/file/preview
+
+  amap-key: 2ea6ef6a023498f33b4e688c9e3f5195
+  amap-decode-url: https://restapi.amap.com/v3/geocode/regeo?output=json&location={{LOCATION-KEY}}&key=${ruoyi.amap-key}&radius=1000&extensions=all
+  #  每天允许提交的次数
+  day-limit: 10
+# 开发环境配置
+server:
+  # 服务器的HTTP端口,默认为8080
+  port: 8080
+  servlet:
+    # 应用的访问路径
+    context-path: /
+  tomcat:
+    # tomcat的URI编码
+    uri-encoding: UTF-8
+    # tomcat最大线程数,默认为200
+    max-threads: 800
+    # Tomcat启动初始化的线程数,默认值25
+    min-spare-threads: 30
+
+# 日志配置
+logging:
+  level:
+    com.ruoyi.system.mapper: debug
+    org.springframework: warn
+
+# Spring配置
+spring:
+  # 资源信息
+  messages:
+    # 国际化资源文件路径
+    basename: i18n/messages
+  profiles:
+    active: druid
+  # 文件上传
+  servlet:
+    multipart:
+      # 单个文件大小
+      max-file-size: 10MB
+      # 设置总上传的文件大小
+      max-request-size: 200MB
+  # 服务模块
+  devtools:
+    restart:
+      # 热部署开关
+      enabled: true
+  datasource:
+    type: com.alibaba.druid.pool.DruidDataSource
+    driverClassName: com.mysql.cj.jdbc.Driver
+    druid:
+      # 主库数据源
+      master:
+        url: jdbc:mysql://192.168.101.226:3306/bm_project?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+        username: root
+        password: 123456
+      #            # 从库数据源
+      #            slave:
+      #                # 从数据源开关/默认关闭
+      #                enabled: false
+      #                url:
+      #                username:
+      #                password:
+      # 初始连接数
+      initialSize: 5
+      # 最小连接池数量
+      minIdle: 10
+      # 最大连接池数量
+      maxActive: 20
+      # 配置获取连接等待超时的时间
+      maxWait: 60000
+      # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
+      timeBetweenEvictionRunsMillis: 60000
+      # 配置一个连接在池中最小生存的时间,单位是毫秒
+      minEvictableIdleTimeMillis: 300000
+      # 配置一个连接在池中最大生存的时间,单位是毫秒
+      maxEvictableIdleTimeMillis: 900000
+      # 配置检测连接是否有效
+      validationQuery: SELECT 1 FROM DUAL
+      testWhileIdle: true
+      testOnBorrow: false
+      testOnReturn: false
+      webStatFilter:
+        enabled: true
+      statViewServlet:
+        enabled: true
+        # 设置白名单,不填则允许所有访问
+        allow:
+        url-pattern: /druid/*
+        # 控制台管理用户名和密码
+        login-username:
+        login-password:
+      filter:
+        stat:
+          enabled: true
+          # 慢SQL记录
+          log-slow-sql: true
+          slow-sql-millis: 1000
+          merge-sql: true
+        wall:
+          config:
+            multi-statement-allow: true
+  # redis 配置
+#  redis:
+#    # 地址
+#    host: localhost
+#    # 端口,默认为6379
+#    port: 6379
+#    # 密码
+#    password:
+#    # 连接超时时间
+#    timeout: 10s
+#    lettuce:
+#      pool:
+#        # 连接池中的最小空闲连接
+#        min-idle: 0
+#        # 连接池中的最大空闲连接
+#        max-idle: 8
+#        # 连接池的最大数据库连接数
+#        max-active: 8
+#        # #连接池最大阻塞等待时间(使用负值表示没有限制)
+#        max-wait: -1ms
+
+# token配置
+token:
+  # 令牌自定义标识
+  header: Authorization
+  # 令牌密钥
+  secret: www.bomankeji.com&&888
+  # 令牌有效期(默认30分钟)
+  expireTime: 30
+
+# MyBatis配置
+mybatis-plus:
+  # 搜索指定包别名
+  typeAliasesPackage: com.ruoyi.**.domain
+  # 配置mapper的扫描,找到所有的mapper.xml映射文件
+  mapperLocations: classpath*:mapper/**/*Mapper.xml
+  # 加载全局的配置文件
+  #  configLocation: classpath:mybatis/mybatis-config.xml
+  #  configuration:
+  #    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
+  global-config:
+    db-config:
+      logic-delete-field: del_flag
+      logic-delete-value: 2
+      logic-not-delete-value: 0
+      id-type: auto
+
+# PageHelper分页插件
+#pagehelper:
+#  helperDialect: mysql
+#  reasonable: true
+#  supportMethodsArguments: true
+#  params: count=countSql
+
+# Swagger配置
+swagger:
+  # 是否开启swagger
+  enabled: true
+  # 请求前缀
+  pathMapping:
+
+# 防止XSS攻击
+xss:
+  # 过滤开关
+  enabled: true
+  # 排除链接(多个用逗号分隔)
+  excludes: /system/notice/*
+  # 匹配链接
+  urlPatterns: /system/*,/monitor/*,/tool/*
+#file:
+#  path: D:\file
+#  url: http://127.0.0.1:8080/file/preview

+ 191 - 0
ruoyi-admin/src/main/resources/application.yml

@@ -0,0 +1,191 @@
+# 项目相关配置
+ruoyi:
+  # 名称
+  name: RuoYi
+  # 版本
+  version: 3.2.0
+  # 版权年份
+  copyrightYear: 2020
+  # 实例演示开关
+  demoEnabled: true
+  # 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath)
+  profile: /home/ruoyi/uploadPath
+  # 获取ip地址开关
+  addressEnabled: false
+  # 验证码类型 math 数组计算 char 字符验证
+  captchaType: math
+  # 图片预览路径
+  url: http://127.0.0.1:8080/file/preview
+
+  amap-key: 2ea6ef6a023498f33b4e688c9e3f5195
+  amap-decode-url: https://restapi.amap.com/v3/geocode/regeo?output=json&location={{LOCATION-KEY}}&key=${ruoyi.amap-key}&radius=1000&extensions=all
+  #  每天允许提交的次数
+  day-limit: 10
+# 开发环境配置
+server:
+  # 服务器的HTTP端口,默认为8080
+  port: 8080
+  servlet:
+    # 应用的访问路径
+    context-path: /
+  tomcat:
+    # tomcat的URI编码
+    uri-encoding: UTF-8
+    # tomcat最大线程数,默认为200
+    max-threads: 800
+    # Tomcat启动初始化的线程数,默认值25
+    min-spare-threads: 30
+
+# 日志配置
+logging:
+  level:
+    com.ruoyi.system.mapper: debug
+    org.springframework: warn
+
+# Spring配置
+spring:
+  # 资源信息
+  messages:
+    # 国际化资源文件路径
+    basename: i18n/messages
+#  profiles:
+#    active: druid
+  # 文件上传
+  servlet:
+    multipart:
+      # 单个文件大小
+      max-file-size: 20MB
+      # 设置总上传的文件大小
+      max-request-size: 200MB
+  # 服务模块
+  devtools:
+    restart:
+      # 热部署开关
+      enabled: true
+  datasource:
+    type: com.alibaba.druid.pool.DruidDataSource
+    driverClassName: com.mysql.cj.jdbc.Driver
+    druid:
+      # 主库数据源
+      master:
+        url: jdbc:mysql://arenen.cn:3306/bm_project?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+        username: root
+        password: abc123+
+      #            # 从库数据源
+      #            slave:
+      #                # 从数据源开关/默认关闭
+      #                enabled: false
+      #                url:
+      #                username:
+      #                password:
+      # 初始连接数
+      initialSize: 5
+      # 最小连接池数量
+      minIdle: 10
+      # 最大连接池数量
+      maxActive: 20
+      # 配置获取连接等待超时的时间
+      maxWait: 60000
+      # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
+      timeBetweenEvictionRunsMillis: 60000
+      # 配置一个连接在池中最小生存的时间,单位是毫秒
+      minEvictableIdleTimeMillis: 300000
+      # 配置一个连接在池中最大生存的时间,单位是毫秒
+      maxEvictableIdleTimeMillis: 900000
+      # 配置检测连接是否有效
+      validationQuery: SELECT 1 FROM DUAL
+      testWhileIdle: true
+      testOnBorrow: false
+      testOnReturn: false
+      webStatFilter:
+        enabled: true
+      statViewServlet:
+        enabled: true
+        # 设置白名单,不填则允许所有访问
+        allow:
+        url-pattern: /druid/*
+        # 控制台管理用户名和密码
+        login-username:
+        login-password:
+      filter:
+        stat:
+          enabled: true
+          # 慢SQL记录
+          log-slow-sql: true
+          slow-sql-millis: 1000
+          merge-sql: true
+        wall:
+          config:
+            multi-statement-allow: true
+  # redis 配置
+#  redis:
+#    # 地址
+#    host: localhost
+#    # 端口,默认为6379
+#    port: 6379
+#    # 密码
+#    password:
+#    # 连接超时时间
+#    timeout: 10s
+#    lettuce:
+#      pool:
+#        # 连接池中的最小空闲连接
+#        min-idle: 0
+#        # 连接池中的最大空闲连接
+#        max-idle: 8
+#        # 连接池的最大数据库连接数
+#        max-active: 8
+#        # #连接池最大阻塞等待时间(使用负值表示没有限制)
+#        max-wait: -1ms
+
+# token配置
+token:
+  # 令牌自定义标识
+  header: Authorization
+  # 令牌密钥
+  secret: www.bomankeji.com&&888
+  # 令牌有效期(默认30分钟)
+  expireTime: 30
+
+# MyBatis配置
+mybatis-plus:
+  # 搜索指定包别名
+  typeAliasesPackage: com.ruoyi.**.domain
+  # 配置mapper的扫描,找到所有的mapper.xml映射文件
+  mapperLocations: classpath*:mapper/**/*Mapper.xml
+  # 加载全局的配置文件
+  #  configLocation: classpath:mybatis/mybatis-config.xml
+  #  configuration:
+  #    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
+  global-config:
+    db-config:
+      logic-delete-field: del_flag
+      logic-delete-value: 2
+      logic-not-delete-value: 0
+      id-type: auto
+
+# PageHelper分页插件
+#pagehelper:
+#  helperDialect: mysql
+#  reasonable: true
+#  supportMethodsArguments: true
+#  params: count=countSql
+
+# Swagger配置
+swagger:
+  # 是否开启swagger
+  enabled: true
+  # 请求前缀
+  pathMapping:
+
+# 防止XSS攻击
+xss:
+  # 过滤开关
+  enabled: true
+  # 排除链接(多个用逗号分隔)
+  excludes: /system/notice/*
+  # 匹配链接
+  urlPatterns: /system/*,/monitor/*,/tool/*
+#file:
+#  path: D:\file
+#  url: http://127.0.0.1:8080/file/preview

+ 36 - 0
ruoyi-admin/src/main/resources/i18n/messages.properties

@@ -0,0 +1,36 @@
+#错误消息
+not.null=* 必须填写
+user.jcaptcha.error=验证码错误
+user.jcaptcha.expire=验证码已失效
+user.not.exists=用户不存在/密码错误
+user.password.not.match=用户不存在/密码错误
+user.password.retry.limit.count=密码输入错误{0}次
+user.password.retry.limit.exceed=密码输入错误{0}次,帐户锁定10分钟
+user.password.delete=对不起,您的账号已被删除
+user.blocked=用户已封禁,请联系管理员
+role.blocked=角色已封禁,请联系管理员
+user.logout.success=退出成功
+
+length.not.valid=长度必须在{min}到{max}个字符之间
+
+user.username.not.valid=* 2到20个汉字、字母、数字或下划线组成,且必须以非数字开头
+user.password.not.valid=* 5-50个字符
+ 
+user.email.not.valid=邮箱格式错误
+user.mobile.phone.number.not.valid=手机号格式错误
+user.login.success=登录成功
+user.notfound=请重新登录
+user.forcelogout=管理员强制退出,请重新登录
+user.unknown.error=未知错误,请重新登录
+
+##文件上传消息
+upload.exceed.maxSize=上传的文件大小超出限制的文件大小!<br/>允许的文件最大大小是:{0}MB!
+upload.filename.exceed.length=上传的文件名最长{0}个字符
+
+##权限
+no.permission=您没有数据的权限,请联系管理员添加权限 [{0}]
+no.create.permission=您没有创建数据的权限,请联系管理员添加权限 [{0}]
+no.update.permission=您没有修改数据的权限,请联系管理员添加权限 [{0}]
+no.delete.permission=您没有删除数据的权限,请联系管理员添加权限 [{0}]
+no.export.permission=您没有导出数据的权限,请联系管理员添加权限 [{0}]
+no.view.permission=您没有查看数据的权限,请联系管理员添加权限 [{0}]

+ 93 - 0
ruoyi-admin/src/main/resources/logback.xml

@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration>
+    <!-- 日志存放路径 -->
+	<property name="log.path" value="/home/omnisky/tuku/logs" />
+    <!-- 日志输出格式 -->
+	<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
+
+	<!-- 控制台输出 -->
+	<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
+		<encoder>
+			<pattern>${log.pattern}</pattern>
+		</encoder>
+	</appender>
+	
+	<!-- 系统日志输出 -->
+	<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
+	    <file>${log.path}/sys-info.log</file>
+        <!-- 循环政策:基于时间创建日志文件 -->
+		<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+            <!-- 日志文件名格式 -->
+			<fileNamePattern>${log.path}/sys-info.%d{yyyy-MM-dd}.log</fileNamePattern>
+			<!-- 日志最大的历史 60天 -->
+			<maxHistory>60</maxHistory>
+		</rollingPolicy>
+		<encoder>
+			<pattern>${log.pattern}</pattern>
+		</encoder>
+		<filter class="ch.qos.logback.classic.filter.LevelFilter">
+            <!-- 过滤的级别 -->
+            <level>INFO</level>
+            <!-- 匹配时的操作:接收(记录) -->
+            <onMatch>ACCEPT</onMatch>
+            <!-- 不匹配时的操作:拒绝(不记录) -->
+            <onMismatch>DENY</onMismatch>
+        </filter>
+	</appender>
+	
+	<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
+	    <file>${log.path}/sys-error.log</file>
+        <!-- 循环政策:基于时间创建日志文件 -->
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+            <!-- 日志文件名格式 -->
+            <fileNamePattern>${log.path}/sys-error.%d{yyyy-MM-dd}.log</fileNamePattern>
+			<!-- 日志最大的历史 60天 -->
+			<maxHistory>60</maxHistory>
+        </rollingPolicy>
+        <encoder>
+            <pattern>${log.pattern}</pattern>
+        </encoder>
+        <filter class="ch.qos.logback.classic.filter.LevelFilter">
+            <!-- 过滤的级别 -->
+            <level>ERROR</level>
+			<!-- 匹配时的操作:接收(记录) -->
+            <onMatch>ACCEPT</onMatch>
+			<!-- 不匹配时的操作:拒绝(不记录) -->
+            <onMismatch>DENY</onMismatch>
+        </filter>
+    </appender>
+	
+	<!-- 用户访问日志输出  -->
+    <appender name="sys-user" class="ch.qos.logback.core.rolling.RollingFileAppender">
+		<file>${log.path}/sys-user.log</file>
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+            <!-- 按天回滚 daily -->
+            <fileNamePattern>${log.path}/sys-user.%d{yyyy-MM-dd}.log</fileNamePattern>
+            <!-- 日志最大的历史 60天 -->
+            <maxHistory>60</maxHistory>
+        </rollingPolicy>
+        <encoder>
+            <pattern>${log.pattern}</pattern>
+        </encoder>
+    </appender>
+	
+	<!-- 系统模块日志级别控制  -->
+	<logger name="com.ruoyi" level="info" />
+	<!-- Spring日志级别控制  -->
+	<logger name="org.springframework" level="warn" />
+
+	<root level="info">
+		<appender-ref ref="console" />
+	</root>
+	
+	<!--系统操作日志-->
+    <root level="info">
+        <appender-ref ref="file_info" />
+        <appender-ref ref="file_error" />
+    </root>
+	
+	<!--系统用户操作日志-->
+    <logger name="sys-user" level="info">
+        <appender-ref ref="sys-user"/>
+    </logger>
+</configuration> 

BIN
ruoyi-admin/src/main/resources/static/admin/favicon.ico


Dosya farkı çok büyük olduğundan ihmal edildi
+ 183 - 0
ruoyi-admin/src/main/resources/static/admin/index.html


+ 2 - 0
ruoyi-admin/src/main/resources/static/admin/robots.txt

@@ -0,0 +1,2 @@
+User-agent: *
+Disallow: /

Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
ruoyi-admin/src/main/resources/static/admin/static/css/app.28bc501d.css


+ 1 - 0
ruoyi-admin/src/main/resources/static/admin/static/css/chunk-07e0cbc6.ab1588c9.css

@@ -0,0 +1 @@
+.login{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;height:100%;background-image:url(../../static/img/login-background.f9f49138.jpg);background-size:cover}.title{margin:0 auto 30px auto;text-align:center;color:#707070}.login-form{border-radius:6px;background:#fff;width:400px;padding:25px 25px 5px 25px}.login-form .el-input,.login-form .el-input input{height:38px}.login-form .input-icon{height:39px;width:14px;margin-left:2px}.login-tip{font-size:13px;text-align:center;color:#bfbfbf}.login-code{width:33%;height:38px;float:right}.login-code img{cursor:pointer;vertical-align:middle}.el-login-footer{height:40px;line-height:40px;position:fixed;bottom:0;width:100%;text-align:center;color:#fff;font-family:Arial;font-size:12px;letter-spacing:1px}.login-code-img{height:38px}

Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
ruoyi-admin/src/main/resources/static/admin/static/css/chunk-2e6501c0.6c0ee1bf.css


+ 1 - 0
ruoyi-admin/src/main/resources/static/admin/static/css/chunk-345dd7f2.9183fc08.css

@@ -0,0 +1 @@
+.errPage-container[data-v-f2e02586]{width:800px;max-width:100%;margin:100px auto}.errPage-container .pan-back-btn[data-v-f2e02586]{background:#008489;color:#fff;border:none!important}.errPage-container .pan-gif[data-v-f2e02586]{margin:0 auto;display:block}.errPage-container .pan-img[data-v-f2e02586]{display:block;margin:0 auto;width:100%}.errPage-container .text-jumbo[data-v-f2e02586]{font-size:60px;font-weight:700;color:#484848}.errPage-container .list-unstyled[data-v-f2e02586]{font-size:14px}.errPage-container .list-unstyled li[data-v-f2e02586]{padding-bottom:5px}.errPage-container .list-unstyled a[data-v-f2e02586]{color:#008489;text-decoration:none}.errPage-container .list-unstyled a[data-v-f2e02586]:hover{text-decoration:underline}

Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
ruoyi-admin/src/main/resources/static/admin/static/css/chunk-3e4360fd.d328a3ec.css


+ 1 - 0
ruoyi-admin/src/main/resources/static/admin/static/css/chunk-4b9a8bde.1196dae5.css

@@ -0,0 +1 @@
+.gallery_category .avatar-uploader .el-upload{border:1px dashed #d9d9d9;border-radius:6px;cursor:pointer;position:relative;overflow:hidden}.gallery_category .avatar-uploader .el-upload:hover{border-color:#409eff}.gallery_category .avatar-uploader-icon{font-size:28px;color:#8c939d;width:178px;height:178px;line-height:178px;text-align:center}.gallery_category .avatar{width:178px;height:178px;display:block}

+ 1 - 0
ruoyi-admin/src/main/resources/static/admin/static/css/chunk-6daffd8a.03d4965d.css

@@ -0,0 +1 @@
+.gallery .avatar-uploader{text-align:center;margin:auto}.gallery .avatar-uploader .el-upload{border:1px dashed #d9d9d9;border-radius:6px;cursor:pointer;position:relative;overflow:hidden}.gallery .avatar-uploader .el-upload:hover{border-color:#409eff}.gallery .avatar-uploader-icon{font-size:28px;color:#8c939d;width:120px;height:120px;line-height:120px;text-align:center}.gallery .avatar{width:120px;height:120px;display:block}.latin-name input{font-style:italic}

Dosya farkı çok büyük olduğundan ihmal edildi
+ 12 - 0
ruoyi-admin/src/main/resources/static/admin/static/css/chunk-79137a56.1f0a25b2.css


Dosya farkı çok büyük olduğundan ihmal edildi
+ 4 - 0
ruoyi-admin/src/main/resources/static/admin/static/css/chunk-9e5fc220.84f98409.css


Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
ruoyi-admin/src/main/resources/static/admin/static/css/chunk-a7653e4c.0f159fef.css


Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
ruoyi-admin/src/main/resources/static/admin/static/css/chunk-c28ad000.cf54ef51.css


Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
ruoyi-admin/src/main/resources/static/admin/static/css/chunk-libs.3dfb7769.css


BIN
ruoyi-admin/src/main/resources/static/admin/static/fonts/element-icons.535877f5.woff


BIN
ruoyi-admin/src/main/resources/static/admin/static/fonts/element-icons.732389de.ttf


BIN
ruoyi-admin/src/main/resources/static/admin/static/img/401.089007e7.gif


BIN
ruoyi-admin/src/main/resources/static/admin/static/img/404.a57b6f31.png


BIN
ruoyi-admin/src/main/resources/static/admin/static/img/404_cloud.0f4bc32b.png


BIN
ruoyi-admin/src/main/resources/static/admin/static/img/login-background.f9f49138.jpg


BIN
ruoyi-admin/src/main/resources/static/admin/static/img/logo.4eeb8a8e.png


BIN
ruoyi-admin/src/main/resources/static/admin/static/img/profile.473f5971.jpg


Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
ruoyi-admin/src/main/resources/static/admin/static/js/app.fcefae5b.js


Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
ruoyi-admin/src/main/resources/static/admin/static/js/chunk-07e0cbc6.dd198dae.js


Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
ruoyi-admin/src/main/resources/static/admin/static/js/chunk-08486bce.d4e31f2d.js


Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
ruoyi-admin/src/main/resources/static/admin/static/js/chunk-2d0a2db2.e8344dfd.js


Dosya farkı çok büyük olduğundan ihmal edildi
+ 14 - 0
ruoyi-admin/src/main/resources/static/admin/static/js/chunk-2d0d6345.6ed54a0c.js


Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
ruoyi-admin/src/main/resources/static/admin/static/js/chunk-2d0e2366.64c0e5da.js


+ 1 - 0
ruoyi-admin/src/main/resources/static/admin/static/js/chunk-2d0f012d.cc12ba57.js

@@ -0,0 +1 @@
+(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0f012d"],{"9b8f":function(e,r,n){"use strict";n.r(r);n("ac1f"),n("5319");var t,u,a={created:function(){var e=this.$route,r=e.params,n=e.query,t=r.path;this.$router.replace({path:"/"+t,query:n})},render:function(e){return e()}},c=a,o=n("2877"),p=Object(o["a"])(c,t,u,!1,null,null,null);r["default"]=p.exports}}]);

Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
ruoyi-admin/src/main/resources/static/admin/static/js/chunk-2e6501c0.c3c40ac0.js


+ 1 - 0
ruoyi-admin/src/main/resources/static/admin/static/js/chunk-345dd7f2.de04953a.js

@@ -0,0 +1 @@
+(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-345dd7f2"],{c0ed:function(t,e,c){},cc6c:function(t,e,c){t.exports=c.p+"static/img/401.089007e7.gif"},ec55:function(t,e,c){"use strict";c.r(e);var s=function(){var t=this,e=t.$createElement,c=t._self._c||e;return c("div",{staticClass:"errPage-container"},[c("el-button",{staticClass:"pan-back-btn",attrs:{icon:"arrow-left"},on:{click:t.back}},[t._v(" 返回 ")]),c("el-row",[c("el-col",{attrs:{span:12}},[c("h1",{staticClass:"text-jumbo text-ginormous"},[t._v(" 401错误! ")]),c("h2",[t._v("您没有访问权限!")]),c("h6",[t._v("对不起,您没有访问权限,请不要进行非法操作!您可以返回主页面")]),c("ul",{staticClass:"list-unstyled"},[c("li",{staticClass:"link-type"},[c("router-link",{attrs:{to:"/"}},[t._v(" 回首页 ")])],1)])]),c("el-col",{attrs:{span:12}},[c("img",{attrs:{src:t.errGif,width:"313",height:"428",alt:"Girl has dropped her ice cream."}})])],1)],1)},a=[],n=c("cc6c"),r=c.n(n),i={name:"Page401",data:function(){return{errGif:r.a+"?"+ +new Date}},methods:{back:function(){this.$route.query.noGoBack?this.$router.push({path:"/"}):this.$router.go(-1)}}},o=i,l=(c("ecf6"),c("2877")),u=Object(l["a"])(o,s,a,!1,null,"f2e02586",null);e["default"]=u.exports},ecf6:function(t,e,c){"use strict";c("c0ed")}}]);

Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
ruoyi-admin/src/main/resources/static/admin/static/js/chunk-3e4360fd.c161f5c1.js


Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
ruoyi-admin/src/main/resources/static/admin/static/js/chunk-3f93175c.04b38f89.js


Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
ruoyi-admin/src/main/resources/static/admin/static/js/chunk-4b9a8bde.2b9c2dd9.js


Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
ruoyi-admin/src/main/resources/static/admin/static/js/chunk-582bd6c0.290ee44f.js


Dosya farkı çok büyük olduğundan ihmal edildi
+ 6 - 0
ruoyi-admin/src/main/resources/static/admin/static/js/chunk-66d86650.a4a75928.js


Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
ruoyi-admin/src/main/resources/static/admin/static/js/chunk-6daffd8a.7c901850.js


Dosya farkı çok büyük olduğundan ihmal edildi
+ 9 - 0
ruoyi-admin/src/main/resources/static/admin/static/js/chunk-79137a56.a4eec904.js


Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
ruoyi-admin/src/main/resources/static/admin/static/js/chunk-9e5fc220.5692a30f.js


Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
ruoyi-admin/src/main/resources/static/admin/static/js/chunk-a7653e4c.e96f4f86.js


+ 1 - 0
ruoyi-admin/src/main/resources/static/admin/static/js/chunk-c28ad000.e254f1f3.js

@@ -0,0 +1 @@
+(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-c28ad000"],{"0986":function(t,s,i){},"26fc":function(t,s,i){t.exports=i.p+"static/img/404_cloud.0f4bc32b.png"},2754:function(t,s,i){"use strict";i.r(s);var a=function(){var t=this,s=t.$createElement,i=t._self._c||s;return i("div",{staticClass:"wscn-http404-container"},[i("div",{staticClass:"wscn-http404"},[t._m(0),i("div",{staticClass:"bullshit"},[i("div",{staticClass:"bullshit__oops"},[t._v(" 404错误! ")]),i("div",{staticClass:"bullshit__headline"},[t._v(" "+t._s(t.message)+" ")]),i("div",{staticClass:"bullshit__info"},[t._v(" 对不起,您正在寻找的页面不存在。尝试检查URL的错误,然后按浏览器上的刷新按钮或尝试在我们的应用程序中找到其他内容。 ")]),i("router-link",{staticClass:"bullshit__return-home",attrs:{to:"/"}},[t._v(" 返回首页 ")])],1)])])},c=[function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"pic-404"},[a("img",{staticClass:"pic-404__parent",attrs:{src:i("a36b"),alt:"404"}}),a("img",{staticClass:"pic-404__child left",attrs:{src:i("26fc"),alt:"404"}}),a("img",{staticClass:"pic-404__child mid",attrs:{src:i("26fc"),alt:"404"}}),a("img",{staticClass:"pic-404__child right",attrs:{src:i("26fc"),alt:"404"}})])}],l={name:"Page404",computed:{message:function(){return"找不到网页!"}}},n=l,e=(i("61b6"),i("2877")),r=Object(e["a"])(n,a,c,!1,null,"279ea4b2",null);s["default"]=r.exports},"61b6":function(t,s,i){"use strict";i("0986")},a36b:function(t,s,i){t.exports=i.p+"static/img/404.a57b6f31.png"}}]);

Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
ruoyi-admin/src/main/resources/static/admin/static/js/chunk-d19c1a98.27a461e6.js


Bu fark içinde çok fazla dosya değişikliği olduğu için bazı dosyalar gösterilmiyor