Parcourir la source

:tada: Initial commit.

smallchill il y a 7 ans
Parent
commit
95139ffd12
100 fichiers modifiés avec 6567 ajouts et 2 suppressions
  1. 21 0
      .editorconfig
  2. 27 0
      .gitignore
  3. 15 0
      Dockerfile
  4. 164 2
      README.md
  5. 1 0
      doc/script/service.cmd
  6. 73 0
      doc/script/service.sh
  7. 140 0
      doc/sql/bladex-mysql.sql
  8. 189 0
      pom.xml
  9. 37 0
      src/main/java/org/springblade/Application.java
  10. 30 0
      src/main/java/org/springblade/common/cache/CacheNames.java
  11. 54 0
      src/main/java/org/springblade/common/config/BladeConfiguration.java
  12. 42 0
      src/main/java/org/springblade/common/constant/CommonConstant.java
  13. 40 0
      src/main/java/org/springblade/common/launch/LauncherServiceImpl.java
  14. 25 0
      src/main/java/org/springblade/common/tool/CommonUtil.java
  15. 71 0
      src/main/java/org/springblade/core/log/config/BladeLogToolAutoConfiguration.java
  16. 75 0
      src/main/java/org/springblade/core/log/event/ApiLogListener.java
  17. 70 0
      src/main/java/org/springblade/core/log/event/ErrorLogListener.java
  18. 72 0
      src/main/java/org/springblade/core/log/event/UsualLogListener.java
  19. 46 0
      src/main/java/org/springblade/core/secure/AuthInfo.java
  20. 246 0
      src/main/java/org/springblade/core/secure/utils/SecureUtil.java
  21. 97 0
      src/main/java/org/springblade/modules/auth/AuthController.java
  22. 60 0
      src/main/java/org/springblade/modules/desk/controller/DashBoardController.java
  23. 240 0
      src/main/java/org/springblade/modules/desk/controller/NoticeController.java
  24. 63 0
      src/main/java/org/springblade/modules/desk/entity/Notice.java
  25. 47 0
      src/main/java/org/springblade/modules/desk/mapper/NoticeMapper.java
  26. 38 0
      src/main/java/org/springblade/modules/desk/mapper/NoticeMapper.xml
  27. 38 0
      src/main/java/org/springblade/modules/desk/service/INoticeService.java
  28. 39 0
      src/main/java/org/springblade/modules/desk/service/impl/NoticeServiceImpl.java
  29. 20 0
      src/main/java/org/springblade/modules/desk/vo/NoticeVO.java
  30. 43 0
      src/main/java/org/springblade/modules/desk/wrapper/NoticeWrapper.java
  31. 117 0
      src/main/java/org/springblade/modules/develop/controller/CodeController.java
  32. 104 0
      src/main/java/org/springblade/modules/develop/entity/Code.java
  33. 29 0
      src/main/java/org/springblade/modules/develop/mapper/CodeMapper.java
  34. 25 0
      src/main/java/org/springblade/modules/develop/mapper/CodeMapper.xml
  35. 30 0
      src/main/java/org/springblade/modules/develop/service/ICodeService.java
  36. 33 0
      src/main/java/org/springblade/modules/develop/service/impl/CodeServiceImpl.java
  37. 292 0
      src/main/java/org/springblade/modules/develop/support/BladeGenerator.java
  38. 109 0
      src/main/java/org/springblade/modules/system/controller/DeptController.java
  39. 122 0
      src/main/java/org/springblade/modules/system/controller/DictController.java
  40. 78 0
      src/main/java/org/springblade/modules/system/controller/LogApiController.java
  41. 78 0
      src/main/java/org/springblade/modules/system/controller/LogErrorController.java
  42. 78 0
      src/main/java/org/springblade/modules/system/controller/LogUsualController.java
  43. 164 0
      src/main/java/org/springblade/modules/system/controller/MenuController.java
  44. 101 0
      src/main/java/org/springblade/modules/system/controller/ParamController.java
  45. 121 0
      src/main/java/org/springblade/modules/system/controller/RoleController.java
  46. 126 0
      src/main/java/org/springblade/modules/system/controller/UserController.java
  47. 33 0
      src/main/java/org/springblade/modules/system/dto/DeptDTO.java
  48. 33 0
      src/main/java/org/springblade/modules/system/dto/DictDTO.java
  49. 33 0
      src/main/java/org/springblade/modules/system/dto/MenuDTO.java
  50. 33 0
      src/main/java/org/springblade/modules/system/dto/ParamDTO.java
  51. 33 0
      src/main/java/org/springblade/modules/system/dto/RoleDTO.java
  52. 33 0
      src/main/java/org/springblade/modules/system/dto/RoleMenuDTO.java
  53. 86 0
      src/main/java/org/springblade/modules/system/entity/Dept.java
  54. 92 0
      src/main/java/org/springblade/modules/system/entity/Dict.java
  55. 138 0
      src/main/java/org/springblade/modules/system/entity/Menu.java
  56. 64 0
      src/main/java/org/springblade/modules/system/entity/Param.java
  57. 80 0
      src/main/java/org/springblade/modules/system/entity/Role.java
  58. 60 0
      src/main/java/org/springblade/modules/system/entity/RoleMenu.java
  59. 79 0
      src/main/java/org/springblade/modules/system/entity/User.java
  60. 54 0
      src/main/java/org/springblade/modules/system/entity/UserInfo.java
  61. 49 0
      src/main/java/org/springblade/modules/system/mapper/DeptMapper.java
  62. 38 0
      src/main/java/org/springblade/modules/system/mapper/DeptMapper.xml
  63. 66 0
      src/main/java/org/springblade/modules/system/mapper/DictMapper.java
  64. 49 0
      src/main/java/org/springblade/modules/system/mapper/DictMapper.xml
  65. 29 0
      src/main/java/org/springblade/modules/system/mapper/LogApiMapper.java
  66. 33 0
      src/main/java/org/springblade/modules/system/mapper/LogApiMapper.xml
  67. 29 0
      src/main/java/org/springblade/modules/system/mapper/LogErrorMapper.java
  68. 34 0
      src/main/java/org/springblade/modules/system/mapper/LogErrorMapper.xml
  69. 29 0
      src/main/java/org/springblade/modules/system/mapper/LogUsualMapper.java
  70. 29 0
      src/main/java/org/springblade/modules/system/mapper/LogUsualMapper.xml
  71. 94 0
      src/main/java/org/springblade/modules/system/mapper/MenuMapper.java
  72. 132 0
      src/main/java/org/springblade/modules/system/mapper/MenuMapper.xml
  73. 42 0
      src/main/java/org/springblade/modules/system/mapper/ParamMapper.java
  74. 37 0
      src/main/java/org/springblade/modules/system/mapper/ParamMapper.xml
  75. 49 0
      src/main/java/org/springblade/modules/system/mapper/RoleMapper.java
  76. 37 0
      src/main/java/org/springblade/modules/system/mapper/RoleMapper.xml
  77. 41 0
      src/main/java/org/springblade/modules/system/mapper/RoleMenuMapper.java
  78. 22 0
      src/main/java/org/springblade/modules/system/mapper/RoleMenuMapper.xml
  79. 73 0
      src/main/java/org/springblade/modules/system/mapper/UserMapper.java
  80. 87 0
      src/main/java/org/springblade/modules/system/mapper/UserMapper.xml
  81. 49 0
      src/main/java/org/springblade/modules/system/service/IDeptService.java
  82. 66 0
      src/main/java/org/springblade/modules/system/service/IDictService.java
  83. 29 0
      src/main/java/org/springblade/modules/system/service/ILogApiService.java
  84. 29 0
      src/main/java/org/springblade/modules/system/service/ILogErrorService.java
  85. 54 0
      src/main/java/org/springblade/modules/system/service/ILogService.java
  86. 29 0
      src/main/java/org/springblade/modules/system/service/ILogUsualService.java
  87. 88 0
      src/main/java/org/springblade/modules/system/service/IMenuService.java
  88. 39 0
      src/main/java/org/springblade/modules/system/service/IParamService.java
  89. 29 0
      src/main/java/org/springblade/modules/system/service/IRoleMenuService.java
  90. 59 0
      src/main/java/org/springblade/modules/system/service/IRoleService.java
  91. 83 0
      src/main/java/org/springblade/modules/system/service/IUserService.java
  92. 48 0
      src/main/java/org/springblade/modules/system/service/impl/DeptServiceImpl.java
  93. 67 0
      src/main/java/org/springblade/modules/system/service/impl/DictServiceImpl.java
  94. 33 0
      src/main/java/org/springblade/modules/system/service/impl/LogApiServiceImpl.java
  95. 33 0
      src/main/java/org/springblade/modules/system/service/impl/LogErrorServiceImpl.java
  96. 41 0
      src/main/java/org/springblade/modules/system/service/impl/LogServiceImpl.java
  97. 33 0
      src/main/java/org/springblade/modules/system/service/impl/LogUsualServiceImpl.java
  98. 105 0
      src/main/java/org/springblade/modules/system/service/impl/MenuServiceImpl.java
  99. 40 0
      src/main/java/org/springblade/modules/system/service/impl/ParamServiceImpl.java
  100. 33 0
      src/main/java/org/springblade/modules/system/service/impl/RoleMenuServiceImpl.java

+ 21 - 0
.editorconfig

@@ -0,0 +1,21 @@
+# http://editorconfig.org
+root = true
+
+# 空格替代Tab缩进在各种编辑工具下效果一致
+[*]
+indent_style = space
+indent_size = 4
+charset = utf-8
+end_of_line = lf
+trim_trailing_whitespace = true
+insert_final_newline = true
+
+[*.java]
+indent_style = tab
+
+[*.{json,yml}]
+indent_size = 2
+
+[*.md]
+insert_final_newline = false
+trim_trailing_whitespace = false

+ 27 - 0
.gitignore

@@ -0,0 +1,27 @@
+# maven #
+target
+
+logs
+
+# windows #
+Thumbs.db
+
+# Mac #
+.DS_Store
+
+# eclipse #
+.settings
+.project
+.classpath
+.log
+*.class
+
+# idea #
+.idea
+*.iml
+
+# Package Files #
+*.jar
+*.war
+*.ear
+/target

+ 15 - 0
Dockerfile

@@ -0,0 +1,15 @@
+FROM anapsix/alpine-java:8_server-jre_unlimited
+
+MAINTAINER smallchill@163.com
+
+RUN mkdir -p /blade
+
+WORKDIR /blade
+
+EXPOSE 8800
+
+ADD ./target/blade.jar ./app.jar
+
+ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom", "-jar", "app.jar"]
+
+CMD ["--spring.profiles.active=test"]

+ 164 - 2
README.md

@@ -1,3 +1,165 @@
-# BladeX-Boot
+## 简介
+* SpringBlade 2.0 是如梦技术团队作品,是一个基于 Spring Boot 2 & Spring Cloud Finchley & Mybatis 等核心技术,用于快速构建中大型系统的基础框架。
+* SpringBlade 致力于创造新颖的开发模式,将开发中遇到的痛点、生产中所踩的坑整理归纳,并将解决方案都融合到框架中。
 
-BladeX的SpringBoot版本,助航中小型系统
+## 官网
+* 官网地址:[https://bladex.vip](https://bladex.vip)
+
+## 在线演示
+* Sword演示地址:[https://sword.bladex.vip](https://sword.bladex.vip)
+* Saber演示地址:[https://saber.avue.top](https://saber.avue.top)
+
+## 后端项目地址
+* [Gitee地址](https://gitee.com/smallc/SpringBlade)
+* [Github地址](https://github.com/chillzhuang/SpringBlade)
+
+## 前端项目地址
+* [Sword--基于React](https://gitee.com/smallc/Sword)
+* [Saber--基于Vue](https://gitee.com/smallc/Saber)
+
+## 主要特性&&变化
+* 采用前后端分离的模式,前端开源出一个基于React的框架:[Sword](https://gitee.com/smallc/Sword),主要选型技术为React、Ant Design、Umi、Dva
+* 采用前后端分离的模式,前端开源出一个基于Vue的框架:[Saber](https://gitee.com/smallc/Saber),主要选型技术为Vue、VueX、Avue、Element-UI
+* 后端采用SpringCloud全家桶,并同时对其基础组件做了高度的封装,单独开源出一个框架:[BladeTool](https://github.com/chillzhuang/blade-tool)
+* [BladeTool](https://github.com/chillzhuang/blade-tool)已推送至Maven中央库,直接引入即可,减少了工程的臃肿,也可更注重于业务开发
+* 集成Sentinel从流量控制、熔断降级、系统负载等多个维度保护服务的稳定性。
+* 注册中心、配置中心选型Nacos,为工程瘦身的同时加强各模块之间的联动。
+* 使用Traefik进行反向代理,监听后台变化自动化应用新的配置文件。
+* 部署使用Docker或K8s + Jenkins
+* 踩了踩Kong的坑,有个基本的使用方案,但不深入,因为涉及到OpenResty。
+* 封装了简单的Secure模块,采用JWT做Token认证,可拓展集成Redis等细颗粒度控制方案
+* 在2.0诞生之前,已经稳定生产了近一年,经历了从Camden -> Finchley的技术架构,也经历了从fat jar -> docker -> k8s + jenkins的部署架构
+* 项目分包明确,规范微服务的开发模式,使包与包之间的分工清晰。
+
+## 会员计划及交流群
+* [会员计划及交流群](https://gitee.com/smallc/SpringBlade/wikis/SpringBlade会员计划)
+
+## 技术文档
+* [SpringBlade开发手册](https://gitee.com/smallc/SpringBlade/wikis/SpringBlade开发手册)
+
+## 单工程SpringBoot版
+* [SpringBoot版](https://gitee.com/smallc/SpringBlade/tree/2.0-boot/)
+
+## 工程结构
+``` 
+SpringBlade
+├── blade-auth -- 授权服务提供
+├── blade-common -- 常用工具封装包
+├── blade-gateway -- Spring Cloud 网关
+├── blade-ops -- 运维中心
+├    ├── blade-admin -- spring-cloud后台管理
+├    ├── blade-develop -- 代码生成
+├── blade-service -- 业务模块
+├    ├── blade-desk -- 工作台模块 
+├    ├── blade-log -- 日志模块 
+├    ├── blade-system -- 系统模块 
+├    └── blade-user -- 用户模块 
+├── blade-service-api -- 业务模块api封装
+├    ├── blade-desk-api -- 工作台api 
+├    ├── blade-dict-api -- 字典api 
+├    ├── blade-system-api -- 系统api 
+└──  └── blade-user-api -- 用户api 
+```
+
+# 开源协议
+Apache Licence 2.0 ([英文原文](http://www.apache.org/licenses/LICENSE-2.0.html))
+
+Apache Licence是著名的非盈利开源组织Apache采用的协议。该协议和BSD类似,同样鼓励代码共享和尊重原作者的著作权,同样允许代码修改,再发布(作为开源或商业软件)。
+
+需要满足的条件如下:
+
+* 需要给代码的用户一份Apache Licence
+
+* 如果你修改了代码,需要在被修改的文件中说明。
+
+* 在延伸的代码中(修改和有源代码衍生的代码中)需要带有原来代码中的协议,商标,专利声明和其他原来作者规定需要包含的说明。
+
+* 如果再发布的产品中包含一个Notice文件,则在Notice文件中需要带有Apache Licence。你可以在Notice中增加自己的许可,但不可以表现为对Apache Licence构成更改。
+
+Apache Licence也是对商业应用友好的许可。使用者也可以在需要的时候修改代码来满足需要并作为开源或商业产品发布/销售。
+
+## 用户权益
+* 允许免费用于学习、毕设、公司项目、私活等。
+* 代码文件需保留相关license信息。
+
+## 禁止事项
+* 直接将本项目挂淘宝等商业平台出售。
+* 非界面代码50%以上相似度的二次开源,二次开源需先联系作者。
+
+注意:若禁止条款被发现有权追讨19999的授权费。
+
+## 注
+* 前端UI项目地址(基于React):[Sword](https://gitee.com/smallc/Sword)
+* 前端UI项目地址(基于Vue):[Saber](https://gitee.com/smallc/Saber)
+* 核心框架项目地址:[BladeTool](https://github.com/chillzhuang/blade-tool.git)
+* 交流群:`477853168`
+
+
+# 界面
+## 监控界面一览
+<table>
+    <tr>
+        <td><img src="https://gitee.com/smallc/SpringBlade/raw/master/pic/springblade-k8s1.png"/></td>
+        <td><img src="https://gitee.com/smallc/SpringBlade/raw/master/pic/springblade-k8s2.png"/></td>
+    </tr>
+    <tr>
+        <td><img src="https://gitee.com/smallc/SpringBlade/raw/master/pic/springblade-grafana.png"/></td>
+        <td><img src="https://gitee.com/smallc/SpringBlade/raw/master/pic/springblade-harbor.png"/></td>
+    </tr>
+    <tr>
+        <td><img src="https://gitee.com/smallc/SpringBlade/raw/master/pic/springblade-traefik.png"/></td>
+        <td><img src="https://gitee.com/smallc/SpringBlade/raw/master/pic/springblade-traefik-health.png"/></td>
+    </tr>
+    <tr>
+        <td><img src="https://gitee.com/smallc/SpringBlade/raw/master/pic/springblade-nacos.png"/></td>
+        <td><img src="https://gitee.com/smallc/SpringBlade/raw/master/pic/springblade-sentinel.png"/></td>
+    </tr>
+    <tr>
+        <td><img src="https://gitee.com/smallc/SpringBlade/raw/master/pic/springblade-admin1.png"/></td>
+        <td><img src="https://gitee.com/smallc/SpringBlade/raw/master/pic/springblade-admin2.png"/></td>
+    </tr>
+    <tr>
+        <td><img src="https://gitee.com/smallc/SpringBlade/raw/master/pic/springblade-swagger1.png"/></td>
+        <td><img src="https://gitee.com/smallc/SpringBlade/raw/master/pic/springblade-swagger2.png"/></td>
+    </tr>
+</table>
+
+## Sword界面一览
+<table>
+    <tr>
+        <td><img src="https://gitee.com/smallc/SpringBlade/raw/master/pic/sword-main.png"/></td>
+        <td><img src="https://gitee.com/smallc/SpringBlade/raw/master/pic/sword-menu.png"/></td>
+    </tr>
+    <tr>
+        <td><img src="https://gitee.com/smallc/SpringBlade/raw/master/pic/sword-menu-edit.png"/></td>
+        <td><img src="https://gitee.com/smallc/SpringBlade/raw/master/pic/sword-menu-icon.png"/></td>
+    </tr>
+    <tr>
+        <td><img src="https://gitee.com/smallc/SpringBlade/raw/master/pic/sword-role.png"/></td>
+        <td><img src="https://gitee.com/smallc/SpringBlade/raw/master/pic/sword-user.png"/></td>
+    </tr>
+    <tr>
+        <td><img src="https://gitee.com/smallc/SpringBlade/raw/master/pic/sword-dict.png "/></td>
+        <td><img src="https://gitee.com/smallc/SpringBlade/raw/master/pic/sword-log.png"/></td>
+    </tr>
+    <tr>
+        <td><img src="https://gitee.com/smallc/SpringBlade/raw/master/pic/sword-locale-cn.png"/></td>
+        <td><img src="https://gitee.com/smallc/SpringBlade/raw/master/pic/sword-locale-us.png"/></td>
+    </tr>
+</table>
+
+## Saber界面一览
+<table>
+    <tr>
+        <td><img src="https://gitee.com/smallc/SpringBlade/raw/master/pic/saber-user.png"/></td>
+        <td><img src="https://gitee.com/smallc/SpringBlade/raw/master/pic/saber-role.png"/></td>
+    </tr>
+    <tr>
+        <td><img src="https://gitee.com/smallc/SpringBlade/raw/master/pic/saber-dict.png"/></td>
+        <td><img src="https://gitee.com/smallc/SpringBlade/raw/master/pic/saber-dict-select.png"/></td>
+    </tr>
+    <tr>
+        <td><img src="https://gitee.com/smallc/SpringBlade/raw/master/pic/saber-log.png"/></td>
+        <td><img src="https://gitee.com/smallc/SpringBlade/raw/master/pic/saber-code.png"/></td>
+    </tr>
+</table>

+ 1 - 0
doc/script/service.cmd

@@ -0,0 +1 @@
+java -jar app.jar

+ 73 - 0
doc/script/service.sh

@@ -0,0 +1,73 @@
+APP_NAME=app.jar
+
+#使用说明,用来提示输入参数
+usage() {
+echo "Usage: sh 执行脚本.sh [start|stop|restart|status]"
+exit 1
+}
+
+#检查程序是否在运行
+is_exist(){
+pid=`ps -ef|grep $APP_NAME|grep -v grep|awk '{print $2}' `
+#如果不存在返回1,存在返回0
+if [ -z "${pid}" ]; then
+return 1
+else
+return 0
+fi
+}
+
+#启动方法
+start(){
+is_exist
+if [ $? -eq "0" ]; then
+echo "${APP_NAME} is already running. pid=${pid} ."
+else
+nohup java -jar $APP_NAME > /dev/null 2>&1 &
+fi
+}
+
+#停止方法
+stop(){
+is_exist
+if [ $? -eq "0" ]; then
+kill -9 $pid
+else
+echo "${APP_NAME} is not running"
+fi
+}
+
+#输出运行状态
+status(){
+is_exist
+if [ $? -eq "0" ]; then
+echo "${APP_NAME} is running. Pid is ${pid}"
+else
+echo "${APP_NAME} is NOT running."
+fi
+}
+
+#重启
+restart(){
+stop
+start
+}
+
+#根据输入参数,选择执行对应方法,不输入则执行使用说明
+case "$1" in
+"start")
+start
+;;
+"stop")
+stop
+;;
+"status")
+status
+;;
+"restart")
+restart
+;;
+*)
+usage
+;;
+esac

Fichier diff supprimé car celui-ci est trop grand
+ 140 - 0
doc/sql/bladex-mysql.sql


+ 189 - 0
pom.xml

@@ -0,0 +1,189 @@
+<?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>org.springblade</groupId>
+    <artifactId>BladeX-Boot</artifactId>
+    <packaging>jar</packaging>
+    <version>2.0.0.RC1</version>
+
+    <properties>
+        <bladex.tool.version>2.0.0.RC1</bladex.tool.version>
+        <bladex.project.version>2.0.0.RC1</bladex.project.version>
+
+        <java.version>1.8</java.version>
+        <swagger.version>2.9.2</swagger.version>
+        <swagger.models.version>1.5.21</swagger.models.version>
+        <swagger.bootstrapui.version>1.8.8</swagger.bootstrapui.version>
+        <mybatis.plus.version>3.0.7.1</mybatis.plus.version>
+        <protostuff.version>1.6.0</protostuff.version>
+
+        <spring.boot.version>2.1.2.RELEASE</spring.boot.version>
+        <spring.platform.version>Cairo-RELEASE</spring.platform.version>
+
+        <!-- 推荐使用Harbor -->
+        <docker.registry.url>192.168.186.129</docker.registry.url>
+        <docker.registry.host>http://${docker.registry.url}:2375</docker.registry.host>
+        <docker.plugin.version>1.2.0</docker.plugin.version>
+    </properties>
+
+    <dependencyManagement>
+        <dependencies>
+            <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>io.spring.platform</groupId>
+                <artifactId>platform-bom</artifactId>
+                <version>${spring.platform.version}</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.springblade</groupId>
+            <artifactId>blade-core-boot</artifactId>
+            <version>${bladex.tool.version}</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.springblade</groupId>
+                    <artifactId>blade-core-cloud</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.springblade</groupId>
+            <artifactId>blade-starter-swagger</artifactId>
+            <version>${bladex.tool.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springblade</groupId>
+            <artifactId>blade-core-auto</artifactId>
+            <version>${bladex.tool.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-generator</artifactId>
+            <version>${mybatis.plus.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.velocity</groupId>
+            <artifactId>velocity</artifactId>
+            <version>1.7</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-devtools</artifactId>
+            <optional>true</optional>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <finalName>${project.name}</finalName>
+        <resources>
+            <resource>
+                <directory>src/main/resources</directory>
+            </resource>
+            <resource>
+                <directory>src/main/java</directory>
+                <includes>
+                    <include>**/*.xml</include>
+                </includes>
+            </resource>
+        </resources>
+        <pluginManagement>
+            <plugins>
+                <plugin>
+                    <groupId>org.springframework.boot</groupId>
+                    <artifactId>spring-boot-maven-plugin</artifactId>
+                    <version>${spring.boot.version}</version>
+                    <configuration>
+                        <finalName>${project.build.finalName}</finalName>
+                    </configuration>
+                    <executions>
+                        <execution>
+                            <goals>
+                                <goal>repackage</goal>
+                            </goals>
+                        </execution>
+                    </executions>
+                </plugin>
+                <plugin>
+                    <groupId>com.spotify</groupId>
+                    <artifactId>docker-maven-plugin</artifactId>
+                    <version>${docker.plugin.version}</version>
+                    <configuration>
+                        <imageName>${docker.registry.url}/blade/${project.artifactId}:${project.version}</imageName>
+                        <dockerDirectory>${project.basedir}</dockerDirectory>
+                        <dockerHost>${docker.registry.host}</dockerHost>
+                        <resources>
+                            <resource>
+                                <targetPath>/</targetPath>
+                                <directory>${project.build.directory}</directory>
+                                <include>${project.build.finalName}.jar</include>
+                            </resource>
+                        </resources>
+                        <registryUrl>${docker.registry.url}</registryUrl>
+                        <serverId>${docker.registry.url}</serverId>
+                        <pushImage>true</pushImage>
+                    </configuration>
+                </plugin>
+            </plugins>
+        </pluginManagement>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+            </plugin>
+            <plugin>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <source>${java.version}</source>
+                    <target>${java.version}</target>
+                    <encoding>UTF-8</encoding>
+                    <compilerArgs>
+                        <arg>-parameters</arg>
+                    </compilerArgs>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
+    <repositories>
+        <repository>
+            <id>aliyun-repos</id>
+            <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
+            <snapshots>
+                <enabled>false</enabled>
+            </snapshots>
+        </repository>
+    </repositories>
+
+    <pluginRepositories>
+        <pluginRepository>
+            <id>aliyun-plugin</id>
+            <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
+            <snapshots>
+                <enabled>false</enabled>
+            </snapshots>
+        </pluginRepository>
+    </pluginRepositories>
+
+</project>

+ 37 - 0
src/main/java/org/springblade/Application.java

@@ -0,0 +1,37 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springblade;
+
+import org.springblade.common.constant.CommonConstant;
+import org.springblade.core.launch.BladeApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.scheduling.annotation.EnableScheduling;
+
+/**
+ * 启动器
+ *
+ * @author Chill
+ */
+@EnableScheduling
+@SpringBootApplication
+public class Application {
+
+	public static void main(String[] args) {
+		BladeApplication.run(CommonConstant.APPLICATION_NAME, Application.class, args);
+	}
+
+}
+

+ 30 - 0
src/main/java/org/springblade/common/cache/CacheNames.java

@@ -0,0 +1,30 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springblade.common.cache;
+
+/**
+ * 缓存名
+ *
+ * @author Chill
+ */
+public interface CacheNames {
+
+	String NOTICE_ONE = "NOTICE_ONE";
+
+	String DICT_VALUE = "DICT_VALUE";
+	String DICT_LIST = "DICT_LIST";
+
+}

+ 54 - 0
src/main/java/org/springblade/common/config/BladeConfiguration.java

@@ -0,0 +1,54 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springblade.common.config;
+
+
+import org.springblade.core.secure.registry.SecureRegistry;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
+
+/**
+ * Blade配置
+ *
+ * @author Chill
+ */
+@Configuration
+public class BladeConfiguration implements WebMvcConfigurer {
+
+	@Bean
+	public SecureRegistry secureRegistry() {
+		SecureRegistry secureRegistry = new SecureRegistry();
+		secureRegistry.excludePathPatterns("/blade-auth/**");
+		secureRegistry.excludePathPatterns("/blade-log/**");
+		secureRegistry.excludePathPatterns("/doc.html");
+		secureRegistry.excludePathPatterns("/js/**");
+		secureRegistry.excludePathPatterns("/webjars/**");
+		secureRegistry.excludePathPatterns("/swagger-resources/**");
+		return secureRegistry;
+	}
+
+	@Override
+	public void addResourceHandlers(ResourceHandlerRegistry registry) {
+		registry.addResourceHandler("/js/**").addResourceLocations("classpath:/js/");
+		registry.addResourceHandler("doc.html")
+			.addResourceLocations("classpath:/META-INF/resources/");
+		registry.addResourceHandler("/webjars/**")
+			.addResourceLocations("classpath:/META-INF/resources/webjars/");
+	}
+
+}

+ 42 - 0
src/main/java/org/springblade/common/constant/CommonConstant.java

@@ -0,0 +1,42 @@
+package org.springblade.common.constant;
+
+import org.springblade.core.launch.constant.AppConstant;
+
+/**
+ * 通用常量
+ *
+ * @author Chill
+ */
+public interface CommonConstant {
+
+	/**
+	 * app name
+	 */
+	String APPLICATION_NAME = AppConstant.APPLICATION_NAME_PREFIX + "api";
+
+	/**
+	 * sentinel dev 地址
+	 */
+	String SENTINEL_DEV_ADDR = "127.0.0.1:8858";
+
+	/**
+	 * sentinel prod 地址
+	 */
+	String SENTINEL_PROD_ADDR = "192.168.186.129:8858";
+
+	/**
+	 * 顶级父节点id
+	 */
+	Integer TOP_PARENT_ID = 0;
+
+	/**
+	 * 顶级父节点名称
+	 */
+	String TOP_PARENT_NAME = "顶级";
+
+	/**
+	 * 默认密码
+	 */
+	String DEFAULT_PASSWORD = "123456";
+
+}

+ 40 - 0
src/main/java/org/springblade/common/launch/LauncherServiceImpl.java

@@ -0,0 +1,40 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springblade.common.launch;
+
+import org.springblade.common.constant.CommonConstant;
+import org.springblade.core.auto.service.AutoService;
+import org.springblade.core.launch.constant.AppConstant;
+import org.springblade.core.launch.service.LauncherService;
+import org.springframework.boot.builder.SpringApplicationBuilder;
+
+import java.util.Properties;
+
+/**
+ * 启动参数拓展
+ *
+ * @author smallchil
+ */
+@AutoService(LauncherService.class)
+public class LauncherServiceImpl implements LauncherService {
+
+	@Override
+	public void launcher(SpringApplicationBuilder builder, String appName, String profile, boolean isLocalDev) {
+		Properties props = System.getProperties();
+		props.setProperty("spring.cloud.sentinel.transport.dashboard", profile.equals(AppConstant.DEV_CDOE) ? CommonConstant.SENTINEL_DEV_ADDR : CommonConstant.SENTINEL_PROD_ADDR);
+	}
+
+}

+ 25 - 0
src/main/java/org/springblade/common/tool/CommonUtil.java

@@ -0,0 +1,25 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springblade.common.tool;
+
+/**
+ * 通用工具类
+ *
+ * @author Chill
+ */
+public class CommonUtil {
+
+}

+ 71 - 0
src/main/java/org/springblade/core/log/config/BladeLogToolAutoConfiguration.java

@@ -0,0 +1,71 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE 3.0;
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p>
+ * http://www.gnu.org/licenses/lgpl.html
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.springblade.core.log.config;
+
+import lombok.AllArgsConstructor;
+import org.springblade.core.launch.props.BladeProperties;
+import org.springblade.core.launch.server.ServerInfo;
+import org.springblade.core.log.aspect.ApiLogAspect;
+import org.springblade.core.log.event.ApiLogListener;
+import org.springblade.core.log.event.ErrorLogListener;
+import org.springblade.core.log.event.UsualLogListener;
+import org.springblade.core.log.logger.BladeLogger;
+import org.springblade.modules.system.service.ILogService;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+/**
+ * 日志工具自动配置
+ *
+ * @author Chill
+ */
+@Configuration
+@AllArgsConstructor
+@ConditionalOnWebApplication
+public class BladeLogToolAutoConfiguration {
+
+	private final ILogService logService;
+	private final ServerInfo serverInfo;
+	private final BladeProperties bladeProperties;
+
+	@Bean
+	public ApiLogAspect apiLogAspect() {
+		return new ApiLogAspect();
+	}
+
+	@Bean
+	public BladeLogger bladeLogger() {
+		return new BladeLogger();
+	}
+
+	@Bean
+	public ApiLogListener apiLogListener() {
+		return new ApiLogListener(logService, serverInfo, bladeProperties);
+	}
+
+	@Bean
+	public ErrorLogListener errorEventListener() {
+		return new ErrorLogListener(logService, serverInfo, bladeProperties);
+	}
+
+	@Bean
+	public UsualLogListener bladeEventListener() {
+		return new UsualLogListener(logService, serverInfo, bladeProperties);
+	}
+
+}

+ 75 - 0
src/main/java/org/springblade/core/log/event/ApiLogListener.java

@@ -0,0 +1,75 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE 3.0;
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p>
+ * http://www.gnu.org/licenses/lgpl.html
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.springblade.core.log.event;
+
+import lombok.AllArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springblade.core.launch.props.BladeProperties;
+import org.springblade.core.launch.server.ServerInfo;
+import org.springblade.core.log.constant.EventConstant;
+import org.springblade.core.log.model.LogApi;
+import org.springblade.core.secure.utils.SecureUtil;
+import org.springblade.core.tool.utils.UrlUtil;
+import org.springblade.core.tool.utils.WebUtil;
+import org.springblade.modules.system.service.ILogService;
+import org.springframework.context.event.EventListener;
+import org.springframework.core.annotation.Order;
+import org.springframework.scheduling.annotation.Async;
+import org.springframework.stereotype.Component;
+
+import javax.servlet.http.HttpServletRequest;
+import java.time.LocalDateTime;
+import java.util.Map;
+
+
+/**
+ * 异步监听日志事件
+ *
+ * @author Chill
+ */
+@Slf4j
+@Component
+@AllArgsConstructor
+public class ApiLogListener {
+
+	private final ILogService logService;
+	private final ServerInfo serverInfo;
+	private final BladeProperties bladeProperties;
+
+
+	@Async
+	@Order
+	@EventListener(ApiLogEvent.class)
+	public void saveApiLog(ApiLogEvent event) {
+		Map<String, Object> source = (Map<String, Object>) event.getSource();
+		LogApi logApi = (LogApi) source.get(EventConstant.EVENT_LOG);
+		HttpServletRequest request = (HttpServletRequest) source.get(EventConstant.EVENT_REQUEST);
+		logApi.setServiceId(bladeProperties.getName());
+		logApi.setServerHost(serverInfo.getHostName());
+		logApi.setServerIp(serverInfo.getIpWithPort());
+		logApi.setEnv(bladeProperties.getEnv());
+		logApi.setRemoteIp(WebUtil.getIP(request));
+		logApi.setUserAgent(request.getHeader(WebUtil.USER_AGENT_HEADER));
+		logApi.setRequestUri(UrlUtil.getPath(request.getRequestURI()));
+		logApi.setMethod(request.getMethod());
+		logApi.setParams(WebUtil.getRequestParamString(request));
+		logApi.setCreateBy(SecureUtil.getUserAccount(request));
+		logApi.setCreateTime(LocalDateTime.now());
+		logService.saveApiLog(logApi);
+	}
+
+}

+ 70 - 0
src/main/java/org/springblade/core/log/event/ErrorLogListener.java

@@ -0,0 +1,70 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE 3.0;
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p>
+ * http://www.gnu.org/licenses/lgpl.html
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springblade.core.log.event;
+
+
+import lombok.AllArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springblade.core.launch.props.BladeProperties;
+import org.springblade.core.launch.server.ServerInfo;
+import org.springblade.core.log.constant.EventConstant;
+import org.springblade.core.log.model.LogError;
+import org.springblade.core.secure.utils.SecureUtil;
+import org.springblade.core.tool.utils.WebUtil;
+import org.springblade.modules.system.service.ILogService;
+import org.springframework.context.event.EventListener;
+import org.springframework.core.annotation.Order;
+import org.springframework.scheduling.annotation.Async;
+import org.springframework.stereotype.Component;
+
+import javax.servlet.http.HttpServletRequest;
+import java.time.LocalDateTime;
+import java.util.Map;
+
+/**
+ * 异步监听错误日志事件
+ *
+ * @author Chill
+ */
+@Slf4j
+@Component
+@AllArgsConstructor
+public class ErrorLogListener {
+
+	private final ILogService logService;
+	private final ServerInfo serverInfo;
+	private final BladeProperties bladeProperties;
+
+	@Async
+	@Order
+	@EventListener(ErrorLogEvent.class)
+	public void saveErrorLog(ErrorLogEvent event) {
+		Map<String, Object> source = (Map<String, Object>) event.getSource();
+		LogError logError = (LogError) source.get(EventConstant.EVENT_LOG);
+		HttpServletRequest request = (HttpServletRequest) source.get(EventConstant.EVENT_REQUEST);
+		logError.setUserAgent(request.getHeader(WebUtil.USER_AGENT_HEADER));
+		logError.setMethod(request.getMethod());
+		logError.setParams(WebUtil.getRequestParamString(request));
+		logError.setServiceId(bladeProperties.getName());
+		logError.setServerHost(serverInfo.getHostName());
+		logError.setServerIp(serverInfo.getIpWithPort());
+		logError.setEnv(bladeProperties.getEnv());
+		logError.setCreateBy(SecureUtil.getUserAccount(request));
+		logError.setCreateTime(LocalDateTime.now());
+		logService.saveErrorLog(logError);
+	}
+
+}

+ 72 - 0
src/main/java/org/springblade/core/log/event/UsualLogListener.java

@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE 3.0;
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p>
+ * http://www.gnu.org/licenses/lgpl.html
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springblade.core.log.event;
+
+
+import lombok.AllArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springblade.core.launch.props.BladeProperties;
+import org.springblade.core.launch.server.ServerInfo;
+import org.springblade.core.log.constant.EventConstant;
+import org.springblade.core.log.model.LogUsual;
+import org.springblade.core.secure.utils.SecureUtil;
+import org.springblade.core.tool.utils.UrlUtil;
+import org.springblade.core.tool.utils.WebUtil;
+import org.springblade.modules.system.service.ILogService;
+import org.springframework.context.event.EventListener;
+import org.springframework.core.annotation.Order;
+import org.springframework.scheduling.annotation.Async;
+import org.springframework.stereotype.Component;
+
+import javax.servlet.http.HttpServletRequest;
+import java.time.LocalDateTime;
+import java.util.Map;
+
+/**
+ * 异步监听日志事件
+ *
+ * @author Chill
+ */
+@Slf4j
+@Component
+@AllArgsConstructor
+public class UsualLogListener {
+
+	private final ILogService logService;
+	private final ServerInfo serverInfo;
+	private final BladeProperties bladeProperties;
+
+	@Async
+	@Order
+	@EventListener(UsualLogEvent.class)
+	public void saveUsualLog(UsualLogEvent event) {
+		Map<String, Object> source = (Map<String, Object>) event.getSource();
+		LogUsual logUsual = (LogUsual) source.get(EventConstant.EVENT_LOG);
+		HttpServletRequest request = (HttpServletRequest) source.get(EventConstant.EVENT_REQUEST);
+		logUsual.setRequestUri(UrlUtil.getPath(request.getRequestURI()));
+		logUsual.setUserAgent(request.getHeader(WebUtil.USER_AGENT_HEADER));
+		logUsual.setMethod(request.getMethod());
+		logUsual.setParams(WebUtil.getRequestParamString(request));
+		logUsual.setServerHost(serverInfo.getHostName());
+		logUsual.setServiceId(bladeProperties.getName());
+		logUsual.setEnv(bladeProperties.getEnv());
+		logUsual.setServerIp(serverInfo.getIpWithPort());
+		logUsual.setCreateBy(SecureUtil.getUserAccount(request));
+		logUsual.setCreateTime(LocalDateTime.now());
+		logService.saveUsualLog(logUsual);
+	}
+
+}

+ 46 - 0
src/main/java/org/springblade/core/secure/AuthInfo.java

@@ -0,0 +1,46 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE 3.0;
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p>
+ * http://www.gnu.org/licenses/lgpl.html
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springblade.core.secure;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * AuthInfo
+ *
+ * @author Chill
+ */
+@Data
+@ApiModel(description = "认证信息")
+public class AuthInfo {
+	@ApiModelProperty(value = "令牌")
+	private String accessToken;
+	@ApiModelProperty(value = "令牌类型")
+	private String tokenType;
+	@ApiModelProperty(value = "头像")
+	private String avatar = "https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png";
+	@ApiModelProperty(value = "角色名")
+	private String authority;
+	@ApiModelProperty(value = "用户名")
+	private String userName;
+	@ApiModelProperty(value = "账号名")
+	private String account;
+	@ApiModelProperty(value = "过期时间")
+	private long expiresIn;
+	@ApiModelProperty(value = "许可证")
+	private String license = "made by blade";
+}

+ 246 - 0
src/main/java/org/springblade/core/secure/utils/SecureUtil.java

@@ -0,0 +1,246 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE 3.0;
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p>
+ * http://www.gnu.org/licenses/lgpl.html
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springblade.core.secure.utils;
+
+import io.jsonwebtoken.Claims;
+import io.jsonwebtoken.JwtBuilder;
+import io.jsonwebtoken.Jwts;
+import io.jsonwebtoken.SignatureAlgorithm;
+import org.springblade.core.secure.BladeUser;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.core.tool.utils.StringPool;
+import org.springblade.core.tool.utils.WebUtil;
+
+import javax.crypto.spec.SecretKeySpec;
+import javax.servlet.http.HttpServletRequest;
+import javax.xml.bind.DatatypeConverter;
+import java.security.Key;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.Map;
+
+/**
+ * Secure工具类
+ *
+ * @author Chill
+ */
+public class SecureUtil {
+	public static final String BLADE_USER_REQUEST_ATTR = "_BLADE_USER_REQUEST_ATTR_";
+
+	public final static String HEADER = "blade-auth";
+	public final static String BEARER = "bearer";
+	public final static String ACCOUNT = "account";
+	public final static String USER_ID = "userId";
+	public final static String ROLE_ID = "roleId";
+	public final static String USER_NAME = "userName";
+	public final static String ROLE_NAME = "roleName";
+	public final static Integer AUTH_LENGTH = 7;
+	private static String BASE64_SECURITY = DatatypeConverter.printBase64Binary("SpringBlade".getBytes());
+
+	/**
+	 * 获取用户信息
+	 *
+	 * @return BladeUser
+	 */
+	public static BladeUser getUser() {
+		HttpServletRequest request = WebUtil.getRequest();
+		// 优先从 request 中获取
+		BladeUser bladeUser = (BladeUser) request.getAttribute(BLADE_USER_REQUEST_ATTR);
+		if (bladeUser == null) {
+			bladeUser = getUser(request);
+			if (bladeUser != null) {
+				// 设置到 request 中
+				request.setAttribute(BLADE_USER_REQUEST_ATTR, bladeUser);
+			}
+		}
+		return bladeUser;
+	}
+
+	/**
+	 * 获取用户信息
+	 *
+	 * @param request request
+	 * @return BladeUser
+	 */
+	public static BladeUser getUser(HttpServletRequest request) {
+		Claims claims = getClaims(request);
+		if (claims == null) {
+			return null;
+		}
+		Integer userId = Func.toInt(claims.get(SecureUtil.USER_ID));
+		String roleId = Func.toStr(claims.get(SecureUtil.ROLE_ID));
+		String account = Func.toStr(claims.get(SecureUtil.ACCOUNT));
+		String roleName = Func.toStr(claims.get(SecureUtil.ROLE_NAME));
+		BladeUser bladeUser = new BladeUser();
+		bladeUser.setAccount(account);
+		bladeUser.setUserId(userId);
+		bladeUser.setRoleId(roleId);
+		bladeUser.setRoleName(roleName);
+		return bladeUser;
+	}
+
+
+	/**
+	 * 获取用户id
+	 *
+	 * @return userId
+	 */
+	public static Integer getUserId() {
+		BladeUser user = getUser();
+		return (null == user) ? -1 : user.getUserId();
+	}
+
+	/**
+	 * 获取用户id
+	 *
+	 * @param request request
+	 * @return userId
+	 */
+	public static Integer getUserId(HttpServletRequest request) {
+		BladeUser user = getUser(request);
+		return (null == user) ? -1 : user.getUserId();
+	}
+
+	/**
+	 * 获取用户账号
+	 *
+	 * @return userAccount
+	 */
+	public static String getUserAccount() {
+		BladeUser user = getUser();
+		return (null == user) ? StringPool.EMPTY : user.getAccount();
+	}
+
+	/**
+	 * 获取用户账号
+	 *
+	 * @param request request
+	 * @return userAccount
+	 */
+	public static String getUserAccount(HttpServletRequest request) {
+		BladeUser user = getUser(request);
+		return (null == user) ? StringPool.EMPTY : user.getAccount();
+	}
+
+	/**
+	 * 获取Claims
+	 *
+	 * @param request request
+	 * @return Claims
+	 */
+	public static Claims getClaims(HttpServletRequest request) {
+		String auth = request.getHeader(SecureUtil.HEADER);
+		if ((auth != null) && (auth.length() > AUTH_LENGTH)) {
+			String headStr = auth.substring(0, 6).toLowerCase();
+			if (headStr.compareTo(SecureUtil.BEARER) == 0) {
+				auth = auth.substring(7);
+				return SecureUtil.parseJWT(auth);
+			}
+		}
+		return null;
+	}
+
+	/**
+	 * 获取请求头
+	 *
+	 * @return header
+	 */
+	public static String getHeader() {
+		return getHeader(WebUtil.getRequest());
+	}
+
+	/**
+	 * 获取请求头
+	 *
+	 * @param request request
+	 * @return header
+	 */
+	public static String getHeader(HttpServletRequest request) {
+		return request.getHeader(HEADER);
+	}
+
+	/**
+	 * 解析jsonWebToken
+	 *
+	 * @param jsonWebToken jsonWebToken
+	 * @return Claims
+	 */
+	public static Claims parseJWT(String jsonWebToken) {
+		try {
+			Claims claims = Jwts.parser()
+				.setSigningKey(DatatypeConverter.parseBase64Binary(BASE64_SECURITY))
+				.parseClaimsJws(jsonWebToken).getBody();
+			return claims;
+		} catch (Exception ex) {
+			return null;
+		}
+	}
+
+	/**
+	 * 创建jwt
+	 *
+	 * @param user     user
+	 * @param audience audience
+	 * @param issuer   issuer
+	 * @param isExpire isExpire
+	 * @return jwt
+	 */
+	public static String createJWT(Map<String, String> user, String audience, String issuer, boolean isExpire) {
+		SignatureAlgorithm signatureAlgorithm = SignatureAlgorithm.HS256;
+
+		long nowMillis = System.currentTimeMillis();
+		Date now = new Date(nowMillis);
+
+		//生成签名密钥
+		byte[] apiKeySecretBytes = DatatypeConverter.parseBase64Binary(BASE64_SECURITY);
+		Key signingKey = new SecretKeySpec(apiKeySecretBytes, signatureAlgorithm.getJcaName());
+
+		//添加构成JWT的类
+		JwtBuilder builder = Jwts.builder().setHeaderParam("typ", "JsonWebToken")
+			.setIssuer(issuer)
+			.setAudience(audience)
+			.signWith(signatureAlgorithm, signingKey);
+
+		//设置JWT参数
+		user.forEach(builder::claim);
+
+		//添加Token过期时间
+		if (isExpire) {
+			long expMillis = nowMillis + getExpire();
+			Date exp = new Date(expMillis);
+			builder.setExpiration(exp).setNotBefore(now);
+		}
+
+		//生成JWT
+		return builder.compact();
+	}
+
+	/**
+	 * 获取过期时间(次日凌晨3点)
+	 *
+	 * @return expire
+	 */
+	public static long getExpire() {
+		Calendar cal = Calendar.getInstance();
+		cal.add(Calendar.DAY_OF_YEAR, 1);
+		cal.set(Calendar.HOUR_OF_DAY, 3);
+		cal.set(Calendar.SECOND, 0);
+		cal.set(Calendar.MINUTE, 0);
+		cal.set(Calendar.MILLISECOND, 0);
+		return cal.getTimeInMillis() - System.currentTimeMillis();
+	}
+
+}

+ 97 - 0
src/main/java/org/springblade/modules/auth/AuthController.java

@@ -0,0 +1,97 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springblade.modules.auth;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import io.swagger.annotations.ApiSort;
+import lombok.AllArgsConstructor;
+import org.springblade.core.log.annotation.ApiLog;
+import org.springblade.core.secure.AuthInfo;
+import org.springblade.core.secure.utils.SecureUtil;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.DigestUtil;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.modules.system.entity.User;
+import org.springblade.modules.system.entity.UserInfo;
+import org.springblade.modules.system.service.IUserService;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * 认证模块
+ *
+ * @author Chill
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("blade-auth")
+@ApiSort(1)
+@Api(value = "用户授权认证", tags = "授权接口")
+public class AuthController {
+
+	IUserService service;
+
+	@ApiLog("登录用户验证")
+	@PostMapping("token")
+	@ApiOperation(value = "获取认证token", notes = "传入账号:account,密码:password")
+	public R<AuthInfo> token(@ApiParam(value = "账号", required = true) @RequestParam String account,
+							 @ApiParam(value = "密码", required = true) @RequestParam String password) {
+
+		if (Func.hasEmpty(account, password)) {
+			return R.fail("接口调用不合法");
+		}
+
+		UserInfo userInfo = service.userInfo(account, DigestUtil.encrypt(password));
+
+		User user = userInfo.getUser();
+
+		//验证用户
+		if (user == null) {
+			return R.fail("用户名或密码不正确");
+		}
+
+		//设置jwt参数
+		Map<String, String> param = new HashMap<>(16);
+		param.put(SecureUtil.USER_ID, Func.toStr(user.getId()));
+		param.put(SecureUtil.ROLE_ID, user.getRoleId());
+		param.put(SecureUtil.ACCOUNT, user.getAccount());
+		param.put(SecureUtil.USER_NAME, user.getRealName());
+		param.put(SecureUtil.ROLE_NAME, Func.join(userInfo.getRoles()));
+
+		//拼装accessToken
+		String accessToken = SecureUtil.createJWT(param, "audience", "issuser", true);
+
+		//返回accessToken
+		AuthInfo authInfo = new AuthInfo();
+		authInfo.setAccount(user.getAccount());
+		authInfo.setUserName(user.getRealName());
+		authInfo.setAuthority(Func.join(userInfo.getRoles()));
+		authInfo.setAccessToken(accessToken);
+		authInfo.setTokenType(SecureUtil.BEARER);
+		//设置token过期时间
+		authInfo.setExpiresIn(SecureUtil.getExpire());
+		return R.data(authInfo);
+
+	}
+
+}

+ 60 - 0
src/main/java/org/springblade/modules/desk/controller/DashBoardController.java

@@ -0,0 +1,60 @@
+package org.springblade.modules.desk.controller;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.AllArgsConstructor;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.support.Kv;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import springfox.documentation.annotations.ApiIgnore;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 首页
+ *
+ * @author zhuangqian
+ */
+@ApiIgnore
+@RestController
+@RequestMapping("/blade-desk/dashboard")
+@AllArgsConstructor
+@Api(value = "首页", tags = "首页")
+public class DashBoardController {
+
+	/**
+	 * 活跃用户
+	 *
+	 * @return
+	 */
+	@GetMapping("/activities")
+	@ApiOperation(value = "活跃用户", notes = "活跃用户", position = 1)
+	public R activities() {
+
+		List<Map<String, Object>> list = new ArrayList<>();
+		Map<String, Object> map1 = new HashMap<>(16);
+		map1.put("id", "trend-1");
+		map1.put("updatedAt", "2019-01-01");
+		map1.put("user", Kv.create().set("name", "曲丽丽").set("avatar", "https://gw.alipayobjects.com/zos/rmsportal/ThXAXghbEsBCCSDihZxY.png"));
+		map1.put("group", Kv.create().set("name", "高逼格设计天团").set("link", "http://github.com/"));
+		map1.put("project", Kv.create().set("name", "六月迭代").set("link", "http://github.com/"));
+		map1.put("template", "在 @{group} 新建项目 @{project}");
+		list.add(map1);
+
+		Map<String, Object> map2 = new HashMap<>(16);
+		map2.put("id", "trend-2");
+		map2.put("updatedAt", "2019-01-01");
+		map2.put("user", Kv.create().set("name", "付小小").set("avatar", "https://gw.alipayobjects.com/zos/rmsportal/ThXAXghbEsBCCSDihZxY.png"));
+		map2.put("group", Kv.create().set("name", "高逼格设计天团").set("link", "http://github.com/"));
+		map2.put("project", Kv.create().set("name", "七月月迭代").set("link", "http://github.com/"));
+		map2.put("template", "在  @{group} 新建项目 @{project}");
+		list.add(map2);
+
+		return R.data(list);
+	}
+}

+ 240 - 0
src/main/java/org/springblade/modules/desk/controller/NoticeController.java

@@ -0,0 +1,240 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springblade.modules.desk.controller;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import io.swagger.annotations.*;
+import lombok.AllArgsConstructor;
+import org.springblade.common.cache.CacheNames;
+import org.springblade.core.boot.ctrl.BladeController;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.modules.desk.entity.Notice;
+import org.springblade.modules.desk.service.INoticeService;
+import org.springblade.modules.desk.vo.NoticeVO;
+import org.springblade.modules.desk.wrapper.NoticeWrapper;
+import org.springblade.modules.system.service.IDictService;
+import org.springframework.web.bind.annotation.*;
+import springfox.documentation.annotations.ApiIgnore;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 控制器
+ *
+ * @author Chill
+ * @since 2018-09-29
+ */
+@RestController
+@RequestMapping("/blade-desk/notice")
+@AllArgsConstructor
+@ApiSort(2)
+@Api(value = "用户博客", tags = "博客接口")
+public class NoticeController extends BladeController implements CacheNames {
+
+	private INoticeService noticeService;
+
+	private IDictService dictService;
+
+	/**
+	 * 详情
+	 */
+	@GetMapping("/detail")
+	@ApiOperation(value = "详情", notes = "传入notice", position = 2)
+	public R<NoticeVO> detail(Notice notice) {
+		Notice detail = noticeService.getOne(Condition.getQueryWrapper(notice));
+		NoticeWrapper noticeWrapper = new NoticeWrapper(dictService);
+		return R.data(noticeWrapper.entityVO(detail));
+	}
+
+	/**
+	 * 分页
+	 */
+	@GetMapping("/list")
+	@ApiImplicitParams({
+		@ApiImplicitParam(name = "category", value = "公告类型", paramType = "query", dataType = "integer"),
+		@ApiImplicitParam(name = "title", value = "公告标题", paramType = "query", dataType = "string")
+	})
+	@ApiOperation(value = "分页", notes = "传入notice", position = 3)
+	public R<IPage<NoticeVO>> list(@ApiIgnore @RequestParam Map<String, Object> notice, Query query) {
+		IPage<Notice> pages = noticeService.page(Condition.getPage(query), Condition.getQueryWrapper(notice, Notice.class));
+		NoticeWrapper noticeWrapper = new NoticeWrapper(dictService);
+		return R.data(noticeWrapper.pageVO(pages));
+	}
+
+	/**
+	 * 新增
+	 */
+	@PostMapping("/save")
+	@ApiOperation(value = "新增", notes = "传入notice", position = 4)
+	public R save(@RequestBody Notice notice) {
+		return R.status(noticeService.save(notice));
+	}
+
+	/**
+	 * 修改
+	 */
+	@PostMapping("/update")
+	@ApiOperation(value = "修改", notes = "传入notice", position = 5)
+	public R update(@RequestBody Notice notice) {
+		return R.status(noticeService.updateById(notice));
+	}
+
+	/**
+	 * 新增或修改
+	 */
+	@PostMapping("/submit")
+	@ApiOperation(value = "新增或修改", notes = "传入notice", position = 6)
+	public R submit(@RequestBody Notice notice) {
+		return R.status(noticeService.saveOrUpdate(notice));
+	}
+
+	/**
+	 * 删除
+	 */
+	@PostMapping("/remove")
+	@ApiOperation(value = "逻辑删除", notes = "传入notice", position = 7)
+	public R remove(@ApiParam(value = "主键集合") @RequestParam String ids) {
+		boolean temp = noticeService.deleteLogic(Func.toIntList(ids));
+		return R.status(temp);
+	}
+
+	/**
+	 * 获取消息
+	 *
+	 * @return
+	 */
+	@GetMapping("/notices")
+	@ApiOperation(value = "消息", notes = "消息", position = 8)
+	public R notices() {
+		List<Map<String, String>> list = new ArrayList<>();
+		Map<String, String> map1 = new HashMap<>(16);
+		map1.put("logo", "https://spring.io/img/homepage/icon-spring-framework.svg");
+		map1.put("title", "SpringBoot");
+		map1.put("description", "现在的web项目几乎都会用到spring框架,而要使用spring难免需要配置大量的xml配置文件,而 springboot的出现解   决了这一问题,一个项目甚至不用部署到服务器上直接开跑,真像springboot所说:“just run”。");
+		map1.put("member", "Chill");
+		map1.put("href", "http://spring.io/projects/spring-boot");
+		list.add(map1);
+
+		Map<String, String> map2 = new HashMap<>(16);
+		map2.put("logo", "https://spring.io/img/homepage/icon-spring-cloud.svg");
+		map2.put("title", "SpringCloud");
+		map2.put("description", "SpringCloud是基于SpringBoot的一整套实现微服务的框架。他提供了微服务开发所需的配置管理、服务发现、断路器、智能路由、微代理、控制总线、全局锁、决策竞选、分布式会话和集群状态管理等组件。");
+		map2.put("member", "Chill");
+		map2.put("href", "http://spring.io/projects/spring-cloud");
+		list.add(map2);
+
+		Map<String, String> map3 = new HashMap<>(16);
+		map3.put("logo", "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1546359961068&di=05ff9406e6675ca9a58a525a7e7950b9&imgtype=jpg&src=http%3A%2F%2Fimg0.imgtn.bdimg.com%2Fit%2Fu%3D575314515%2C4268715674%26fm%3D214%26gp%3D0.jpg");
+		map3.put("title", "Mybatis");
+		map3.put("description", "MyBatis 是一款优秀的持久层框架,它支持定制化 SQL、存储过程以及高级映射。MyBatis 避免了几乎所有的 JDBC 代码和手动设置参数以及获取结果集。MyBatis 可以使用简单的 XML 或注解来配置和映射原生信息,将接口和 Java 的 POJOs(Plain Old Java Objects,普通的 Java对象)映射成数据库中的记录。");
+		map3.put("member", "Chill");
+		map3.put("href", "http://www.mybatis.org/mybatis-3/getting-started.html");
+		list.add(map3);
+
+		Map<String, String> map4 = new HashMap<>(16);
+		map4.put("logo", "https://gw.alipayobjects.com/zos/rmsportal/kZzEzemZyKLKFsojXItE.png");
+		map4.put("title", "React");
+		map4.put("description", "React 起源于 Facebook 的内部项目,因为该公司对市场上所有 JavaScript MVC 框架,都不满意,就决定自己写一套,用来架设Instagram 的网站。做出来以后,发现这套东西很好用,就在2013年5月开源了。");
+		map4.put("member", "Chill");
+		map4.put("href", "https://reactjs.org/");
+		list.add(map4);
+
+		Map<String, String> map5 = new HashMap<>(16);
+		map5.put("logo", "https://gw.alipayobjects.com/zos/rmsportal/dURIMkkrRFpPgTuzkwnB.png");
+		map5.put("title", "Ant Design");
+		map5.put("description", "蚂蚁金服体验技术部经过大量的项目实践和总结,沉淀出设计语言 Ant Design,这可不单纯只是设计原则、控件规范和视觉尺寸,还配套有前端代码实现方案。也就是说采用Ant Design后,UI设计和前端界面研发可同步完成,效率大大提升。");
+		map5.put("member", "Chill");
+		map5.put("href", "https://ant.design/docs/spec/introduce-cn");
+		list.add(map5);
+
+		Map<String, String> map6 = new HashMap<>(16);
+		map6.put("logo", "https://gw.alipayobjects.com/zos/rmsportal/sfjbOqnsXXJgNCjCzDBL.png");
+		map6.put("title", "Ant Design Pro");
+		map6.put("description", "Ant Design Pro 是一个企业级开箱即用的中后台前端/设计解决方案。符合阿里追求的'敏捷的前端+强大的中台'的思想。");
+		map6.put("member", "Chill");
+		map6.put("href", "https://pro.ant.design");
+		list.add(map6);
+
+		return R.data(list);
+	}
+
+	/**
+	 * 获取我的消息
+	 *
+	 * @return
+	 */
+	@GetMapping("/my-notices")
+	@ApiOperation(value = "消息", notes = "消息", position = 9)
+	public R myNotices() {
+		List<Map<String, String>> list = new ArrayList<>();
+		Map<String, String> map1 = new HashMap<>(16);
+		map1.put("id", "000000001");
+		map1.put("avatar", "https://gw.alipayobjects.com/zos/rmsportal/ThXAXghbEsBCCSDihZxY.png");
+		map1.put("title", "你收到了 14 份新周报");
+		map1.put("datetime", "2018-08-09");
+		map1.put("type", "notification");
+		list.add(map1);
+
+		Map<String, String> map2 = new HashMap<>(16);
+		map2.put("id", "000000002");
+		map2.put("avatar", "https://gw.alipayobjects.com/zos/rmsportal/OKJXDXrmkNshAMvwtvhu.png");
+		map2.put("title", "你推荐的 曲妮妮 已通过第三轮面试");
+		map2.put("datetime", "2018-08-08");
+		map2.put("type", "notification");
+		list.add(map2);
+
+
+		Map<String, String> map3 = new HashMap<>(16);
+		map3.put("id", "000000003");
+		map3.put("avatar", "https://gw.alipayobjects.com/zos/rmsportal/fcHMVNCjPOsbUGdEduuv.jpeg");
+		map3.put("title", "曲丽丽 评论了你");
+		map3.put("description", "描述信息描述信息描述信息");
+		map3.put("datetime", "2018-08-07");
+		map3.put("type", "message");
+		map3.put("clickClose", "true");
+		list.add(map3);
+
+
+		Map<String, String> map4 = new HashMap<>(16);
+		map4.put("id", "000000004");
+		map4.put("avatar", "https://gw.alipayobjects.com/zos/rmsportal/fcHMVNCjPOsbUGdEduuv.jpeg");
+		map4.put("title", "朱偏右 回复了你");
+		map4.put("description", "这种模板用于提醒谁与你发生了互动,左侧放『谁』的头像");
+		map4.put("type", "message");
+		map4.put("datetime", "2018-08-07");
+		map4.put("clickClose", "true");
+		list.add(map4);
+
+
+		Map<String, String> map5 = new HashMap<>(16);
+		map5.put("id", "000000005");
+		map5.put("title", "任务名称");
+		map5.put("description", "任务需要在 2018-01-12 20:00 前启动");
+		map5.put("extra", "未开始");
+		map5.put("status", "todo");
+		map5.put("type", "event");
+		list.add(map5);
+
+		return R.data(list);
+	}
+
+}

+ 63 - 0
src/main/java/org/springblade/modules/desk/entity/Notice.java

@@ -0,0 +1,63 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springblade.modules.desk.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.core.mp.base.BaseEntity;
+
+import java.util.Date;
+
+/**
+ * 实体类
+ *
+ * @author Chill
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@TableName("blade_notice")
+public class Notice extends BaseEntity {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * 标题
+	 */
+	@ApiModelProperty(value = "标题")
+	private String title;
+
+	/**
+	 * 通知类型
+	 */
+	@ApiModelProperty(value = "通知类型")
+	private Integer category;
+
+	/**
+	 * 发布日期
+	 */
+	@ApiModelProperty(value = "发布日期")
+	private Date date;
+
+	/**
+	 * 内容
+	 */
+	@ApiModelProperty(value = "内容")
+	private String content;
+
+
+}

+ 47 - 0
src/main/java/org/springblade/modules/desk/mapper/NoticeMapper.java

@@ -0,0 +1,47 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springblade.modules.desk.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.modules.desk.entity.Notice;
+
+import java.util.List;
+
+/**
+ * Mapper 接口
+ *
+ * @author Chill
+ * @since 2018-09-29
+ */
+public interface NoticeMapper extends BaseMapper<Notice> {
+
+	/**
+	 * 前N条数据
+	 * @param number
+	 * @return
+	 */
+	List<Notice> topList(Integer number);
+
+	/**
+	 * 自定义分页
+	 * @param page
+	 * @param notice
+	 * @return
+	 */
+	List<Notice> selectNoticePage(IPage page, Notice notice);
+
+}

+ 38 - 0
src/main/java/org/springblade/modules/desk/mapper/NoticeMapper.xml

@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.springblade.modules.desk.mapper.NoticeMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="noticeResultMap" type="org.springblade.modules.desk.entity.Notice">
+        <result column="id" property="id"/>
+        <result column="create_user" property="createUser"/>
+        <result column="create_time" property="createTime"/>
+        <result column="update_user" property="updateUser"/>
+        <result column="update_time" property="updateTime"/>
+        <result column="status" property="status"/>
+        <result column="is_deleted" property="isDeleted"/>
+        <result column="title" property="title"/>
+        <result column="content" property="content"/>
+    </resultMap>
+
+    <!-- 通用查询结果列 -->
+    <sql id="baseColumnList">
+        select id,
+        create_user AS createUser,
+        create_time AS createTime,
+        update_user AS updateUser,
+        update_time AS updateTime,
+        status,
+        is_deleted AS isDeleted,
+        title, content
+    </sql>
+
+    <select id="topList" resultMap="noticeResultMap">
+        select * from blade_notice limit #{number}
+    </select>
+
+    <select id="selectNoticePage" resultMap="noticeResultMap">
+        select * from blade_notice where title like concat('%', #{notice.title}, '%') and is_deleted = 0
+    </select>
+
+</mapper>

+ 38 - 0
src/main/java/org/springblade/modules/desk/service/INoticeService.java

@@ -0,0 +1,38 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springblade.modules.desk.service;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.core.mp.base.BaseService;
+import org.springblade.modules.desk.entity.Notice;
+
+/**
+ * 服务类
+ *
+ * @author Chill
+ * @since 2018-09-29
+ */
+public interface INoticeService extends BaseService<Notice> {
+
+	/**
+	 * 自定义分页
+	 * @param page
+	 * @param notice
+	 * @return
+	 */
+	IPage<Notice> selectNoticePage(IPage<Notice> page, Notice notice);
+
+}

+ 39 - 0
src/main/java/org/springblade/modules/desk/service/impl/NoticeServiceImpl.java

@@ -0,0 +1,39 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springblade.modules.desk.service.impl;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springblade.modules.desk.entity.Notice;
+import org.springblade.modules.desk.mapper.NoticeMapper;
+import org.springblade.modules.desk.service.INoticeService;
+import org.springframework.stereotype.Service;
+
+/**
+ * 服务实现类
+ *
+ * @author Chill
+ * @since 2018-09-29
+ */
+@Service
+public class NoticeServiceImpl extends BaseServiceImpl<NoticeMapper, Notice> implements INoticeService {
+
+	@Override
+	public IPage<Notice> selectNoticePage(IPage<Notice> page, Notice notice) {
+		return page.setRecords(baseMapper.selectNoticePage(page, notice));
+	}
+
+}

+ 20 - 0
src/main/java/org/springblade/modules/desk/vo/NoticeVO.java

@@ -0,0 +1,20 @@
+package org.springblade.modules.desk.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.modules.desk.entity.Notice;
+
+/**
+ * 通知公告视图类
+ *
+ * @author Chill
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class NoticeVO extends Notice {
+
+	@ApiModelProperty(value = "通知类型名")
+	private String categoryName;
+
+}

+ 43 - 0
src/main/java/org/springblade/modules/desk/wrapper/NoticeWrapper.java

@@ -0,0 +1,43 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springblade.modules.desk.wrapper;
+
+import lombok.AllArgsConstructor;
+import org.springblade.core.mp.support.BaseEntityWrapper;
+import org.springblade.core.tool.utils.BeanUtil;
+import org.springblade.modules.desk.entity.Notice;
+import org.springblade.modules.desk.vo.NoticeVO;
+import org.springblade.modules.system.service.IDictService;
+
+/**
+ * Notice包装类,返回视图层所需的字段
+ *
+ * @author Chill
+ */
+@AllArgsConstructor
+public class NoticeWrapper extends BaseEntityWrapper<Notice, NoticeVO> {
+
+	private IDictService dictService;
+
+	@Override
+	public NoticeVO entityVO(Notice notice) {
+		NoticeVO noticeVO = BeanUtil.copy(notice, NoticeVO.class);
+		String categoryName = dictService.getValue("notice", noticeVO.getCategory());
+		noticeVO.setCategoryName(categoryName);
+		return noticeVO;
+	}
+
+}

+ 117 - 0
src/main/java/org/springblade/modules/develop/controller/CodeController.java

@@ -0,0 +1,117 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springblade.modules.develop.controller;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import io.swagger.annotations.*;
+import lombok.AllArgsConstructor;
+import org.springblade.core.boot.ctrl.BladeController;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.modules.develop.entity.Code;
+import org.springblade.modules.develop.service.ICodeService;
+import org.springblade.modules.develop.support.BladeGenerator;
+import org.springframework.web.bind.annotation.*;
+import springfox.documentation.annotations.ApiIgnore;
+
+import javax.validation.Valid;
+import java.util.Collection;
+import java.util.Map;
+
+/**
+ * 控制器
+ *
+ * @author Chill
+ * @since 2018-12-24
+ */
+@ApiIgnore
+@RestController
+@AllArgsConstructor
+@RequestMapping("/blade-develop/code")
+@Api(value = "代码生成", tags = "代码生成")
+public class CodeController extends BladeController {
+
+	private ICodeService codeService;
+
+	/**
+	 * 详情
+	 */
+	@GetMapping("/detail")
+	@ApiOperation(value = "详情", notes = "传入code", position = 1)
+	public R<Code> detail(Code code) {
+		Code detail = codeService.getOne(Condition.getQueryWrapper(code));
+		return R.data(detail);
+	}
+
+	/**
+	 * 分页
+	 */
+	@GetMapping("/list")
+	@ApiImplicitParams({
+		@ApiImplicitParam(name = "codeName", value = "模块名", paramType = "query", dataType = "string"),
+		@ApiImplicitParam(name = "tableName", value = "表名", paramType = "query", dataType = "string"),
+		@ApiImplicitParam(name = "modelName", value = "实体名", paramType = "query", dataType = "string")
+	})
+	@ApiOperation(value = "分页", notes = "传入code", position = 2)
+	public R<IPage<Code>> list(@ApiIgnore @RequestParam Map<String, Object> code, Query query) {
+		IPage<Code> pages = codeService.page(Condition.getPage(query), Condition.getQueryWrapper(code, Code.class));
+		return R.data(pages);
+	}
+
+	/**
+	 * 新增或修改
+	 */
+	@PostMapping("/submit")
+	@ApiOperation(value = "新增或修改", notes = "传入code", position = 6)
+	public R submit(@Valid @RequestBody Code code) {
+		return R.status(codeService.saveOrUpdate(code));
+	}
+
+
+	/**
+	 * 删除
+	 */
+	@PostMapping("/remove")
+	@ApiOperation(value = "物理删除", notes = "传入ids", position = 7)
+	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+		return R.status(codeService.removeByIds(Func.toIntList(ids)));
+	}
+
+	/**
+	 * 代码生成
+	 */
+	@PostMapping("/gen-code")
+	@ApiOperation(value = "代码生成", notes = "传入ids", position = 8)
+	public R genCode(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+		Collection<Code> codes = codeService.listByIds(Func.toIntList(ids));
+		codes.forEach(code -> {
+			BladeGenerator generator = new BladeGenerator();
+			generator.setServiceName(code.getServiceName());
+			generator.setPackageName(code.getPackageName());
+			generator.setPackageDir(code.getApiPath());
+			generator.setPackageWebDir(code.getWebPath());
+			generator.setTablePrefix(Func.toStrArray(code.getTablePrefix()));
+			generator.setIncludeTables(Func.toStrArray(code.getTableName()));
+			// 设置是否继承基础业务字段
+			generator.setHasSuperEntity(false);
+			generator.run();
+		});
+		return R.success("代码生成成功");
+	}
+
+}

+ 104 - 0
src/main/java/org/springblade/modules/develop/entity/Code.java

@@ -0,0 +1,104 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springblade.modules.develop.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 实体类
+ *
+ * @author Chill
+ * @since 2018-12-24
+ */
+@Data
+@TableName("blade_code")
+@ApiModel(value = "Code对象", description = "Code对象")
+public class Code implements Serializable {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * 主键
+	 */
+	@ApiModelProperty(value = "主键")
+	@TableId(value = "id", type = IdType.AUTO)
+	private Integer id;
+
+	/**
+	 * 模块名称
+	 */
+	@ApiModelProperty(value = "服务名称")
+	private String serviceName;
+
+	/**
+	 * 模块名称
+	 */
+	@ApiModelProperty(value = "模块名称")
+	private String codeName;
+
+	/**
+	 * 表名
+	 */
+	@ApiModelProperty(value = "表名")
+	private String tableName;
+
+	/**
+	 * 实体名
+	 */
+	@ApiModelProperty(value = "表前缀")
+	private String tablePrefix;
+
+	/**
+	 * 主键名
+	 */
+	@ApiModelProperty(value = "主键名")
+	private String pkName;
+
+	/**
+	 * 后端包名
+	 */
+	@ApiModelProperty(value = "后端包名")
+	private String packageName;
+
+	/**
+	 * 后端路径
+	 */
+	@ApiModelProperty(value = "后端路径")
+	private String apiPath;
+
+	/**
+	 * 前端路径
+	 */
+	@ApiModelProperty(value = "前端路径")
+	private String webPath;
+
+	/**
+	 * 是否已删除
+	 */
+	@TableLogic
+	@ApiModelProperty(value = "是否已删除")
+	private Integer isDeleted;
+
+
+}

+ 29 - 0
src/main/java/org/springblade/modules/develop/mapper/CodeMapper.java

@@ -0,0 +1,29 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springblade.modules.develop.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.springblade.modules.develop.entity.Code;
+
+/**
+ * Mapper 接口
+ *
+ * @author Chill
+ * @since 2018-12-24
+ */
+public interface CodeMapper extends BaseMapper<Code> {
+
+}

+ 25 - 0
src/main/java/org/springblade/modules/develop/mapper/CodeMapper.xml

@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.springblade.modules.develop.mapper.CodeMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="codeResultMap" type="org.springblade.modules.develop.entity.Code">
+        <id column="id" property="id"/>
+        <result column="service_name" property="serviceName"/>
+        <result column="code_name" property="codeName"/>
+        <result column="table_name" property="tableName"/>
+        <result column="pk_name" property="pkName"/>
+        <result column="table_prefix" property="tablePrefix"/>
+        <result column="package_name" property="packageName"/>
+        <result column="api_path" property="apiPath"/>
+        <result column="web_path" property="webPath"/>
+        <result column="is_deleted" property="isDeleted"/>
+    </resultMap>
+
+    <!-- 通用查询结果列 -->
+    <sql id="baseColumnList">
+        select
+        id, service_name, code_name, table_name, pk_name, model_name, package_name, api_path, web_path, is_deleted
+    </sql>
+
+</mapper>

+ 30 - 0
src/main/java/org/springblade/modules/develop/service/ICodeService.java

@@ -0,0 +1,30 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springblade.modules.develop.service;
+
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import org.springblade.modules.develop.entity.Code;
+
+/**
+ * 服务类
+ *
+ * @author Chill
+ * @since 2018-12-24
+ */
+public interface ICodeService extends IService<Code> {
+
+}

+ 33 - 0
src/main/java/org/springblade/modules/develop/service/impl/CodeServiceImpl.java

@@ -0,0 +1,33 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springblade.modules.develop.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springblade.modules.develop.entity.Code;
+import org.springblade.modules.develop.mapper.CodeMapper;
+import org.springblade.modules.develop.service.ICodeService;
+import org.springframework.stereotype.Service;
+
+/**
+ * 服务实现类
+ *
+ * @author Chill
+ * @since 2018-12-24
+ */
+@Service
+public class CodeServiceImpl extends ServiceImpl<CodeMapper, Code> implements ICodeService {
+
+}

+ 292 - 0
src/main/java/org/springblade/modules/develop/support/BladeGenerator.java

@@ -0,0 +1,292 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springblade.modules.develop.support;
+
+import com.baomidou.mybatisplus.annotation.DbType;
+import com.baomidou.mybatisplus.core.toolkit.StringPool;
+import com.baomidou.mybatisplus.core.toolkit.StringUtils;
+import com.baomidou.mybatisplus.generator.AutoGenerator;
+import com.baomidou.mybatisplus.generator.InjectionConfig;
+import com.baomidou.mybatisplus.generator.config.*;
+import com.baomidou.mybatisplus.generator.config.converts.MySqlTypeConvert;
+import com.baomidou.mybatisplus.generator.config.converts.PostgreSqlTypeConvert;
+import com.baomidou.mybatisplus.generator.config.po.TableInfo;
+import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
+import lombok.Data;
+import lombok.extern.slf4j.Slf4j;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.core.tool.utils.StringUtil;
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.core.io.Resource;
+import org.springframework.core.io.support.PropertiesLoaderUtils;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.*;
+
+/**
+ * 代码生成器配置类
+ *
+ * @author Chill
+ */
+@Data
+@Slf4j
+public class BladeGenerator {
+	/**
+	 * 代码所在服务名
+	 */
+	private String serviceName = "blade-service";
+	/**
+	 * 代码生成的包名
+	 */
+	private String packageName = "org.springblade.test";
+	/**
+	 * 代码后端生成的地址
+	 */
+	private String packageDir;
+	/**
+	 * 代码前端生成的地址
+	 */
+	private String packageWebDir;
+	/**
+	 * 需要去掉的表前缀
+	 */
+	private String[] tablePrefix = {"blade_"};
+	/**
+	 * 需要生成的表名(两者只能取其一)
+	 */
+	private String[] includeTables = {"blade_test"};
+	/**
+	 * 需要排除的表名(两者只能取其一)
+	 */
+	private String[] excludeTables = {};
+	/**
+	 * 是否包含基础业务字段
+	 */
+	private Boolean hasSuperEntity = Boolean.FALSE;
+	/**
+	 * 基础业务字段
+	 */
+	private String[] superEntityColumns = {"id", "create_time", "create_user", "update_time", "update_user", "status", "is_deleted"};
+	/**
+	 * 是否启用swagger
+	 */
+	private Boolean isSwagger2 = Boolean.TRUE;
+
+	public void run() {
+		Properties props = getProperties();
+		AutoGenerator mpg = new AutoGenerator();
+		GlobalConfig gc = new GlobalConfig();
+		String outputDir = getOutputDir();
+		String author = props.getProperty("author");
+		gc.setOutputDir(outputDir);
+		gc.setAuthor(author);
+		gc.setFileOverride(true);
+		gc.setOpen(false);
+		gc.setActiveRecord(false);
+		gc.setEnableCache(false);
+		gc.setBaseResultMap(true);
+		gc.setBaseColumnList(true);
+		gc.setMapperName("%sMapper");
+		gc.setXmlName("%sMapper");
+		gc.setServiceName("I%sService");
+		gc.setServiceImplName("%sServiceImpl");
+		gc.setControllerName("%sController");
+		gc.setSwagger2(isSwagger2);
+		mpg.setGlobalConfig(gc);
+		DataSourceConfig dsc = new DataSourceConfig();
+		String driverName = props.getProperty("spring.datasource.driver-class-name");
+		if (StringUtil.containsAny(driverName, DbType.MYSQL.getDb())) {
+			dsc.setDbType(DbType.MYSQL);
+			dsc.setTypeConvert(new MySqlTypeConvert());
+		} else {
+			dsc.setDbType(DbType.POSTGRE_SQL);
+			dsc.setTypeConvert(new PostgreSqlTypeConvert());
+		}
+		dsc.setUrl(props.getProperty("spring.datasource.url"));
+		dsc.setDriverName(driverName);
+		dsc.setUsername(props.getProperty("spring.datasource.username"));
+		dsc.setPassword(props.getProperty("spring.datasource.password"));
+		mpg.setDataSource(dsc);
+		// 策略配置
+		StrategyConfig strategy = new StrategyConfig();
+		// strategy.setCapitalMode(true);// 全局大写命名
+		// strategy.setDbColumnUnderline(true);//全局下划线命名
+		strategy.setNaming(NamingStrategy.underline_to_camel);
+		strategy.setColumnNaming(NamingStrategy.underline_to_camel);
+		strategy.setTablePrefix(tablePrefix);
+		if (includeTables.length > 0) {
+			strategy.setInclude(includeTables);
+		}
+		if (excludeTables.length > 0) {
+			strategy.setExclude(excludeTables);
+		}
+		if (hasSuperEntity) {
+			strategy.setSuperEntityClass("org.springblade.core.mp.base.BaseEntity");
+			strategy.setSuperEntityColumns(superEntityColumns);
+			strategy.setSuperServiceClass("org.springblade.core.mp.base.BaseService");
+			strategy.setSuperServiceImplClass("org.springblade.core.mp.base.BaseServiceImpl");
+		} else {
+			strategy.setSuperServiceClass("com.baomidou.mybatisplus.extension.service.IService");
+			strategy.setSuperServiceImplClass("com.baomidou.mybatisplus.extension.service.impl.ServiceImpl");
+		}
+		// 自定义 controller 父类
+		strategy.setSuperControllerClass("org.springblade.core.boot.ctrl.BladeController");
+		strategy.setEntityBuilderModel(false);
+		strategy.setEntityLombokModel(true);
+		strategy.setControllerMappingHyphenStyle(true);
+		mpg.setStrategy(strategy);
+		// 包配置
+		PackageConfig pc = new PackageConfig();
+		// 控制台扫描
+		pc.setModuleName(null);
+		pc.setParent(packageName);
+		pc.setController("controller");
+		pc.setEntity("entity");
+		pc.setXml("mapper");
+		mpg.setPackageInfo(pc);
+		mpg.setCfg(getInjectionConfig());
+		mpg.execute();
+	}
+
+	private InjectionConfig getInjectionConfig() {
+		String servicePackage = serviceName.split("-").length > 1 ? serviceName.split("-")[1] : serviceName;
+		// 自定义配置
+		InjectionConfig cfg = new InjectionConfig() {
+			@Override
+			public void initMap() {
+				Map<String, Object> map = new HashMap<>(16);
+				map.put("serviceName", serviceName);
+				map.put("servicePackage", servicePackage);
+				this.setMap(map);
+			}
+		};
+		List<FileOutConfig> focList = new ArrayList<>();
+		focList.add(new FileOutConfig("/templates/entityVO.java.vm") {
+			@Override
+			public String outputFile(TableInfo tableInfo) {
+				return getOutputDir() + "/" + packageName.replace(".", "/") + "/" + "vo" + "/" + tableInfo.getEntityName() + "VO" + StringPool.DOT_JAVA;
+			}
+		});
+		focList.add(new FileOutConfig("/templates/entityDTO.java.vm") {
+			@Override
+			public String outputFile(TableInfo tableInfo) {
+				return getOutputDir() + "/" + packageName.replace(".", "/") + "/" + "dto" + "/" + tableInfo.getEntityName() + "DTO" + StringPool.DOT_JAVA;
+			}
+		});
+		focList.add(new FileOutConfig("/templates/wrapper.java.vm") {
+			@Override
+			public String outputFile(TableInfo tableInfo) {
+				return getOutputDir() + "/" + packageName.replace(".", "/") + "/" + "wrapper" + "/" + tableInfo.getEntityName() + "Wrapper" + StringPool.DOT_JAVA;
+			}
+		});
+		if (Func.isNotBlank(packageWebDir)) {
+			focList.add(new FileOutConfig("/templates/sword/action.js.vm") {
+				@Override
+				public String outputFile(TableInfo tableInfo) {
+					return getOutputWebDir() + "/actions" + "/" + tableInfo.getEntityName().toLowerCase() + ".js";
+				}
+			});
+			focList.add(new FileOutConfig("/templates/sword/model.js.vm") {
+				@Override
+				public String outputFile(TableInfo tableInfo) {
+					return getOutputWebDir() + "/models" + "/" + tableInfo.getEntityName().toLowerCase() + ".js";
+				}
+			});
+			focList.add(new FileOutConfig("/templates/sword/service.js.vm") {
+				@Override
+				public String outputFile(TableInfo tableInfo) {
+					return getOutputWebDir() + "/services" + "/" + tableInfo.getEntityName().toLowerCase() + ".js";
+				}
+			});
+			focList.add(new FileOutConfig("/templates/sword/list.js.vm") {
+				@Override
+				public String outputFile(TableInfo tableInfo) {
+					return getOutputWebDir() + "/pages" + "/" + StringUtil.firstCharToUpper(servicePackage) + "/" + tableInfo.getEntityName() + "/" + tableInfo.getEntityName() + ".js";
+				}
+			});
+			focList.add(new FileOutConfig("/templates/sword/add.js.vm") {
+				@Override
+				public String outputFile(TableInfo tableInfo) {
+					return getOutputWebDir() + "/pages" + "/" + StringUtil.firstCharToUpper(servicePackage) + "/" + tableInfo.getEntityName() + "/" + tableInfo.getEntityName() + "Add.js";
+				}
+			});
+			focList.add(new FileOutConfig("/templates/sword/edit.js.vm") {
+				@Override
+				public String outputFile(TableInfo tableInfo) {
+					return getOutputWebDir() + "/pages" + "/" + StringUtil.firstCharToUpper(servicePackage) + "/" + tableInfo.getEntityName() + "/" + tableInfo.getEntityName() + "Edit.js";
+				}
+			});
+			focList.add(new FileOutConfig("/templates/sword/view.js.vm") {
+				@Override
+				public String outputFile(TableInfo tableInfo) {
+					return getOutputWebDir() + "/pages" + "/" + StringUtil.firstCharToUpper(servicePackage) + "/" + tableInfo.getEntityName() + "/" + tableInfo.getEntityName() + "View.js";
+				}
+			});
+		}
+		cfg.setFileOutConfigList(focList);
+		return cfg;
+	}
+
+	/**
+	 * 获取配置文件
+	 *
+	 * @return 配置Props
+	 */
+	private Properties getProperties() {
+		// 读取配置文件
+		Resource resource = new ClassPathResource("/templates/props/generator.properties");
+		Properties props = new Properties();
+		try {
+			props = PropertiesLoaderUtils.loadProperties(resource);
+		} catch (IOException e) {
+			e.printStackTrace();
+		}
+		return props;
+	}
+
+	/**
+	 * 生成到项目中
+	 *
+	 * @return outputDir
+	 */
+	public String getOutputDir() {
+		return (Func.isBlank(packageDir) ? System.getProperty("user.dir") : packageDir) + "/src/main/java";
+	}
+
+	/**
+	 * 生成到Web项目中
+	 *
+	 * @return outputDir
+	 */
+	public String getOutputWebDir() {
+		return (Func.isBlank(packageWebDir) ? System.getProperty("user.dir") : packageWebDir) + "/src";
+	}
+
+	/**
+	 * 页面生成的文件名
+	 */
+	private String getGeneratorViewPath(String viewOutputDir, TableInfo tableInfo, String suffixPath) {
+		String name = StringUtils.firstToLowerCase(tableInfo.getEntityName());
+		String path = viewOutputDir + "/" + name + "/" + name + suffixPath;
+		File viewDir = new File(path).getParentFile();
+		if (!viewDir.exists()) {
+			viewDir.mkdirs();
+		}
+		return path;
+	}
+
+}

+ 109 - 0
src/main/java/org/springblade/modules/system/controller/DeptController.java

@@ -0,0 +1,109 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springblade.modules.system.controller;
+
+import io.swagger.annotations.*;
+import lombok.AllArgsConstructor;
+import org.springblade.core.boot.ctrl.BladeController;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.node.INode;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.modules.system.entity.Dept;
+import org.springblade.modules.system.service.IDeptService;
+import org.springblade.modules.system.vo.DeptVO;
+import org.springblade.modules.system.wrapper.DeptWrapper;
+import org.springframework.web.bind.annotation.*;
+import springfox.documentation.annotations.ApiIgnore;
+
+import javax.validation.Valid;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 控制器
+ *
+ * @author Chill
+ * @since 2018-12-24
+ */
+@ApiIgnore
+@RestController
+@AllArgsConstructor
+@RequestMapping("/blade-system/dept")
+@Api(value = "部门", tags = "部门")
+public class DeptController extends BladeController {
+
+	private IDeptService deptService;
+
+	/**
+	 * 详情
+	 */
+	@GetMapping("/detail")
+	@ApiOperation(value = "详情", notes = "传入dept", position = 1)
+	public R<DeptVO> detail(Dept dept) {
+		Dept detail = deptService.getOne(Condition.getQueryWrapper(dept));
+		DeptWrapper deptWrapper = new DeptWrapper(deptService);
+		return R.data(deptWrapper.entityVO(detail));
+	}
+
+	/**
+	 * 列表
+	 */
+	@GetMapping("/list")
+	@ApiImplicitParams({
+		@ApiImplicitParam(name = "deptName", value = "部门名称", paramType = "query", dataType = "string"),
+		@ApiImplicitParam(name = "fullName", value = "部门全称", paramType = "query", dataType = "string")
+	})
+	@ApiOperation(value = "列表", notes = "传入dept", position = 2)
+	public R<List<INode>> list(@ApiIgnore @RequestParam Map<String, Object> dept) {
+		List<Dept> list = deptService.list(Condition.getQueryWrapper(dept, Dept.class));
+		DeptWrapper deptWrapper = new DeptWrapper();
+		return R.data(deptWrapper.listNodeVO(list));
+	}
+
+	/**
+	 * 获取部门树形结构
+	 *
+	 * @return
+	 */
+	@GetMapping("/tree")
+	@ApiOperation(value = "树形结构", notes = "树形结构", position = 3)
+	public R<List<DeptVO>> tree() {
+		List<DeptVO> tree = deptService.tree();
+		return R.data(tree);
+	}
+
+	/**
+	 * 新增或修改
+	 */
+	@PostMapping("/submit")
+	@ApiOperation(value = "新增或修改", notes = "传入dept", position = 6)
+	public R submit(@Valid @RequestBody Dept dept) {
+		return R.status(deptService.saveOrUpdate(dept));
+	}
+
+
+	/**
+	 * 删除
+	 */
+	@PostMapping("/remove")
+	@ApiOperation(value = "物理删除", notes = "传入ids", position = 7)
+	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+		return R.status(deptService.removeByIds(Func.toIntList(ids)));
+	}
+
+
+}

+ 122 - 0
src/main/java/org/springblade/modules/system/controller/DictController.java

@@ -0,0 +1,122 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springblade.modules.system.controller;
+
+import io.swagger.annotations.*;
+import lombok.AllArgsConstructor;
+import org.springblade.core.boot.ctrl.BladeController;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.node.INode;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.modules.system.entity.Dict;
+import org.springblade.modules.system.service.IDictService;
+import org.springblade.modules.system.vo.DictVO;
+import org.springblade.modules.system.wrapper.DictWrapper;
+import org.springframework.web.bind.annotation.*;
+import springfox.documentation.annotations.ApiIgnore;
+
+import javax.validation.Valid;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 控制器
+ *
+ * @author Chill
+ * @since 2018-12-24
+ */
+@ApiIgnore
+@RestController
+@AllArgsConstructor
+@RequestMapping("/blade-system/dict")
+@Api(value = "字典", tags = "字典")
+public class DictController extends BladeController {
+
+	private IDictService dictService;
+
+	/**
+	 * 详情
+	 */
+	@GetMapping("/detail")
+	@ApiOperation(value = "详情", notes = "传入dict", position = 1)
+	public R<DictVO> detail(Dict dict) {
+		Dict detail = dictService.getOne(Condition.getQueryWrapper(dict));
+		DictWrapper dictWrapper = new DictWrapper(dictService);
+		return R.data(dictWrapper.entityVO(detail));
+	}
+
+	/**
+	 * 列表
+	 */
+	@GetMapping("/list")
+	@ApiImplicitParams({
+		@ApiImplicitParam(name = "code", value = "字典编号", paramType = "query", dataType = "string"),
+		@ApiImplicitParam(name = "dictValue", value = "字典名称", paramType = "query", dataType = "string")
+	})
+	@ApiOperation(value = "列表", notes = "传入dict", position = 2)
+	public R<List<INode>> list(@ApiIgnore @RequestParam Map<String, Object> dict) {
+		@SuppressWarnings("unchecked")
+		List<Dict> list = dictService.list(Condition.getQueryWrapper(dict, Dict.class).lambda().orderByAsc(Dict::getSort));
+		DictWrapper dictWrapper = new DictWrapper();
+		return R.data(dictWrapper.listNodeVO(list));
+	}
+
+	/**
+	 * 获取字典树形结构
+	 *
+	 * @return
+	 */
+	@GetMapping("/tree")
+	@ApiOperation(value = "树形结构", notes = "树形结构", position = 3)
+	public R<List<DictVO>> tree() {
+		List<DictVO> tree = dictService.tree();
+		return R.data(tree);
+	}
+
+	/**
+	 * 新增或修改
+	 */
+	@PostMapping("/submit")
+	@ApiOperation(value = "新增或修改", notes = "传入dict", position = 6)
+	public R submit(@Valid @RequestBody Dict dict) {
+		return R.status(dictService.saveOrUpdate(dict));
+	}
+
+
+	/**
+	 * 删除
+	 */
+	@PostMapping("/remove")
+	@ApiOperation(value = "物理删除", notes = "传入ids", position = 7)
+	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+		return R.status(dictService.removeByIds(Func.toIntList(ids)));
+	}
+
+	/**
+	 * 获取字典
+	 *
+	 * @return
+	 */
+	@GetMapping("/dictionary")
+	@ApiOperation(value = "获取字典", notes = "获取字典", position = 8)
+	public R<List<Dict>> dictionary(String code) {
+		List<Dict> tree = dictService.getList(code);
+		return R.data(tree);
+	}
+
+
+}

+ 78 - 0
src/main/java/org/springblade/modules/system/controller/LogApiController.java

@@ -0,0 +1,78 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springblade.modules.system.controller;
+
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import lombok.AllArgsConstructor;
+import org.springblade.core.log.model.LogApi;
+import org.springblade.core.log.model.LogApiVo;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.BeanUtil;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.modules.system.service.ILogApiService;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+import springfox.documentation.annotations.ApiIgnore;
+
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * 控制器
+ *
+ * @author Chill
+ * @since 2018-09-26
+ */
+@ApiIgnore
+@RestController
+@AllArgsConstructor
+@RequestMapping("/blade-log/api")
+public class LogApiController {
+
+	private ILogApiService logService;
+
+	/**
+	 * 查询单条
+	 */
+	@GetMapping("/detail")
+	public R<LogApi> detail(LogApi log) {
+		return R.data(logService.getOne(Condition.getQueryWrapper(log)));
+	}
+
+	/**
+	 * 查询多条(分页)
+	 */
+	@GetMapping("/list")
+	public R<IPage<LogApiVo>> list(@ApiIgnore @RequestParam Map<String, Object> log, Query query) {
+		IPage<LogApi> pages = logService.page(Condition.getPage(query.setDescs("create_time")), Condition.getQueryWrapper(log, LogApi.class));
+		List<LogApiVo> records = pages.getRecords().stream().map(logApi -> {
+			LogApiVo vo = BeanUtil.copy(logApi, LogApiVo.class);
+			vo.setStrId(Func.toStr(logApi.getId()));
+			return vo;
+		}).collect(Collectors.toList());
+		IPage<LogApiVo> pageVo = new Page<>(pages.getCurrent(), pages.getSize(), pages.getTotal());
+		pageVo.setRecords(records);
+		return R.data(pageVo);
+	}
+
+}

+ 78 - 0
src/main/java/org/springblade/modules/system/controller/LogErrorController.java

@@ -0,0 +1,78 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springblade.modules.system.controller;
+
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import lombok.AllArgsConstructor;
+import org.springblade.core.log.model.LogError;
+import org.springblade.core.log.model.LogErrorVo;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.BeanUtil;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.modules.system.service.ILogErrorService;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+import springfox.documentation.annotations.ApiIgnore;
+
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * 控制器
+ *
+ * @author Chill
+ * @since 2018-09-26
+ */
+@ApiIgnore
+@RestController
+@AllArgsConstructor
+@RequestMapping("/blade-log/error")
+public class LogErrorController {
+
+	private ILogErrorService errorLogService;
+
+	/**
+	 * 查询单条
+	 */
+	@GetMapping("/detail")
+	public R<LogError> detail(LogError logError) {
+		return R.data(errorLogService.getOne(Condition.getQueryWrapper(logError)));
+	}
+
+	/**
+	 * 查询多条(分页)
+	 */
+	@GetMapping("/list")
+	public R<IPage<LogErrorVo>> list(@ApiIgnore @RequestParam Map<String, Object> logError, Query query) {
+		IPage<LogError> pages = errorLogService.page(Condition.getPage(query.setDescs("create_time")), Condition.getQueryWrapper(logError, LogError.class));
+		List<LogErrorVo> records = pages.getRecords().stream().map(logApi -> {
+			LogErrorVo vo = BeanUtil.copy(logApi, LogErrorVo.class);
+			vo.setStrId(Func.toStr(logApi.getId()));
+			return vo;
+		}).collect(Collectors.toList());
+		IPage<LogErrorVo> pageVo = new Page<>(pages.getCurrent(), pages.getSize(), pages.getTotal());
+		pageVo.setRecords(records);
+		return R.data(pageVo);
+	}
+
+}

+ 78 - 0
src/main/java/org/springblade/modules/system/controller/LogUsualController.java

@@ -0,0 +1,78 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springblade.modules.system.controller;
+
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import lombok.AllArgsConstructor;
+import org.springblade.core.log.model.LogUsual;
+import org.springblade.core.log.model.LogUsualVo;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.BeanUtil;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.modules.system.service.ILogUsualService;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+import springfox.documentation.annotations.ApiIgnore;
+
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * 控制器
+ *
+ * @author Chill
+ * @since 2018-10-12
+ */
+@ApiIgnore
+@RestController
+@AllArgsConstructor
+@RequestMapping("/blade-log/usual")
+public class LogUsualController {
+
+	private ILogUsualService logService;
+
+	/**
+	 * 查询单条
+	 */
+	@GetMapping("/detail")
+	public R<LogUsual> detail(LogUsual log) {
+		return R.data(logService.getOne(Condition.getQueryWrapper(log)));
+	}
+
+	/**
+	 * 查询多条(分页)
+	 */
+	@GetMapping("/list")
+	public R<IPage<LogUsualVo>> list(@ApiIgnore @RequestParam Map<String, Object> log, Query query) {
+		IPage<LogUsual> pages = logService.page(Condition.getPage(query), Condition.getQueryWrapper(log, LogUsual.class));
+		List<LogUsualVo> records = pages.getRecords().stream().map(logApi -> {
+			LogUsualVo vo = BeanUtil.copy(logApi, LogUsualVo.class);
+			vo.setStrId(Func.toStr(logApi.getId()));
+			return vo;
+		}).collect(Collectors.toList());
+		IPage<LogUsualVo> pageVo = new Page<>(pages.getCurrent(), pages.getSize(), pages.getTotal());
+		pageVo.setRecords(records);
+		return R.data(pageVo);
+	}
+
+}

+ 164 - 0
src/main/java/org/springblade/modules/system/controller/MenuController.java

@@ -0,0 +1,164 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springblade.modules.system.controller;
+
+import io.swagger.annotations.*;
+import lombok.AllArgsConstructor;
+import org.springblade.core.boot.ctrl.BladeController;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.secure.BladeUser;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.support.Kv;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.modules.system.dto.MenuDTO;
+import org.springblade.modules.system.entity.Menu;
+import org.springblade.modules.system.service.IDictService;
+import org.springblade.modules.system.service.IMenuService;
+import org.springblade.modules.system.vo.MenuVO;
+import org.springblade.modules.system.wrapper.MenuWrapper;
+import org.springframework.web.bind.annotation.*;
+import springfox.documentation.annotations.ApiIgnore;
+
+import javax.validation.Valid;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 控制器
+ *
+ * @author Chill
+ * @since 2018-12-24
+ */
+@ApiIgnore
+@RestController
+@AllArgsConstructor
+@RequestMapping("/blade-system/menu")
+@Api(value = "菜单", tags = "菜单")
+public class MenuController extends BladeController {
+
+	private IMenuService menuService;
+
+	private IDictService dictService;
+
+	/**
+	 * 详情
+	 */
+	@GetMapping("/detail")
+	@ApiOperation(value = "详情", notes = "传入menu", position = 1)
+	public R<MenuVO> detail(Menu menu) {
+		Menu detail = menuService.getOne(Condition.getQueryWrapper(menu));
+		MenuWrapper menuWrapper = new MenuWrapper(menuService, dictService);
+		return R.data(menuWrapper.entityVO(detail));
+	}
+
+	/**
+	 * 列表
+	 */
+	@GetMapping("/list")
+	@ApiImplicitParams({
+		@ApiImplicitParam(name = "code", value = "菜单编号", paramType = "query", dataType = "string"),
+		@ApiImplicitParam(name = "name", value = "菜单名称", paramType = "query", dataType = "string")
+	})
+	@ApiOperation(value = "列表", notes = "传入menu", position = 2)
+	public R<List<MenuVO>> list(@ApiIgnore @RequestParam Map<String, Object> menu) {
+		@SuppressWarnings("unchecked")
+		List<Menu> list = menuService.list(Condition.getQueryWrapper(menu, Menu.class).lambda().orderByAsc(Menu::getSort));
+		MenuWrapper menuWrapper = new MenuWrapper(menuService, dictService);
+		return R.data(menuWrapper.listNodeVO(list));
+	}
+
+	/**
+	 * 前端菜单数据
+	 */
+	@GetMapping("/routes")
+	@ApiOperation(value = "前端菜单数据", notes = "前端菜单数据", position = 3)
+	public R<List<MenuVO>> routes(BladeUser user) {
+		List<MenuVO> list = menuService.routes(user.getRoleId());
+		return R.data(list);
+	}
+
+	/**
+	 * 前端按钮数据
+	 */
+	@GetMapping("/buttons")
+	@ApiOperation(value = "前端按钮数据", notes = "前端按钮数据", position = 4)
+	public R<List<MenuVO>> buttons(BladeUser user) {
+		List<MenuVO> list = menuService.buttons(user.getRoleId());
+		return R.data(list);
+	}
+
+	/**
+	 * 获取菜单树形结构
+	 */
+	@GetMapping("/tree")
+	@ApiOperation(value = "树形结构", notes = "树形结构", position = 5)
+	public R<List<MenuVO>> tree() {
+		List<MenuVO> tree = menuService.tree();
+		return R.data(tree);
+	}
+
+	/**
+	 * 获取权限分配树形结构
+	 */
+	@GetMapping("/grant-tree")
+	@ApiOperation(value = "权限分配树形结构", notes = "权限分配树形结构", position = 6)
+	public R<List<MenuVO>> grantTree() {
+		return R.data(menuService.grantTree());
+	}
+
+	/**
+	 * 获取权限分配树形结构
+	 */
+	@GetMapping("/role-tree-keys")
+	@ApiOperation(value = "角色所分配的树", notes = "角色所分配的树", position = 7)
+	public R<List<String>> roleTreeKeys(String roleIds) {
+		return R.data(menuService.roleTreeKeys(roleIds));
+	}
+
+	/**
+	 * 新增或修改
+	 */
+	@PostMapping("/submit")
+	@ApiOperation(value = "新增或修改", notes = "传入menu", position = 8)
+	public R submit(@Valid @RequestBody Menu menu) {
+		return R.status(menuService.saveOrUpdate(menu));
+	}
+
+
+	/**
+	 * 删除
+	 */
+	@PostMapping("/remove")
+	@ApiOperation(value = "物理删除", notes = "传入ids", position = 9)
+	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+		return R.status(menuService.removeByIds(Func.toIntList(ids)));
+	}
+
+	/**
+	 * 获取配置的角色权限
+	 * @return
+	 */
+	@GetMapping("auth-routes")
+	@ApiOperation(value = "菜单的角色权限", position = 8)
+	public R<List<Kv>> authRoutes(BladeUser user) {
+		List<Kv> list = new ArrayList<>();
+		List<MenuDTO> routes = menuService.authRoutes(Func.toIntList(user.getRoleId()));
+		routes.forEach(route -> list.add(Kv.create().set(route.getPath(), Kv.create().set("authority", Func.toStrArray(route.getAlias())))));
+		return R.data(list);
+	}
+
+}

+ 101 - 0
src/main/java/org/springblade/modules/system/controller/ParamController.java

@@ -0,0 +1,101 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springblade.modules.system.controller;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import io.swagger.annotations.*;
+import lombok.AllArgsConstructor;
+import org.springblade.core.boot.ctrl.BladeController;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.modules.system.entity.Param;
+import org.springblade.modules.system.service.IDictService;
+import org.springblade.modules.system.service.IParamService;
+import org.springblade.modules.system.vo.ParamVO;
+import org.springblade.modules.system.wrapper.ParamWrapper;
+import org.springframework.web.bind.annotation.*;
+import springfox.documentation.annotations.ApiIgnore;
+
+import javax.validation.Valid;
+import java.util.Map;
+
+/**
+ * 控制器
+ *
+ * @author Chill
+ * @since 2018-12-28
+ */
+@ApiIgnore
+@RestController
+@AllArgsConstructor
+@RequestMapping("/blade-system/param")
+@Api(value = "参数管理", tags = "接口")
+public class ParamController extends BladeController {
+
+	private IParamService paramService;
+
+	private IDictService dictService;
+
+	/**
+	 * 详情
+	 */
+	@GetMapping("/detail")
+	@ApiOperation(value = "详情", notes = "传入param", position = 1)
+	public R<ParamVO> detail(Param param) {
+		Param detail = paramService.getOne(Condition.getQueryWrapper(param));
+		ParamWrapper paramWrapper = new ParamWrapper(dictService);
+		return R.data(paramWrapper.entityVO(detail));
+	}
+
+	/**
+	 * 分页
+	 */
+	@GetMapping("/list")
+	@ApiImplicitParams({
+		@ApiImplicitParam(name = "paramName", value = "参数名称", paramType = "query", dataType = "string"),
+		@ApiImplicitParam(name = "paramKey", value = "参数键名", paramType = "query", dataType = "string"),
+		@ApiImplicitParam(name = "paramValue", value = "参数键值", paramType = "query", dataType = "string")
+	})
+	@ApiOperation(value = "分页", notes = "传入param", position = 2)
+	public R<IPage<ParamVO>> list(@ApiIgnore @RequestParam Map<String, Object> param, Query query) {
+		IPage<Param> pages = paramService.page(Condition.getPage(query), Condition.getQueryWrapper(param, Param.class));
+		ParamWrapper paramWrapper = new ParamWrapper(dictService);
+		return R.data(paramWrapper.pageVO(pages));
+	}
+
+	/**
+	 * 新增或修改
+	 */
+	@PostMapping("/submit")
+	@ApiOperation(value = "新增或修改", notes = "传入param", position = 6)
+	public R submit(@Valid @RequestBody Param param) {
+		return R.status(paramService.saveOrUpdate(param));
+	}
+
+
+	/**
+	 * 删除
+	 */
+	@PostMapping("/remove")
+	@ApiOperation(value = "逻辑删除", notes = "传入ids", position = 7)
+	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+		return R.status(paramService.deleteLogic(Func.toIntList(ids)));
+	}
+
+
+}

+ 121 - 0
src/main/java/org/springblade/modules/system/controller/RoleController.java

@@ -0,0 +1,121 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springblade.modules.system.controller;
+
+import io.swagger.annotations.*;
+import lombok.AllArgsConstructor;
+import org.springblade.core.boot.ctrl.BladeController;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.node.INode;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.modules.system.entity.Role;
+import org.springblade.modules.system.service.IRoleService;
+import org.springblade.modules.system.vo.RoleVO;
+import org.springblade.modules.system.wrapper.RoleWrapper;
+import org.springframework.web.bind.annotation.*;
+import springfox.documentation.annotations.ApiIgnore;
+
+import javax.validation.Valid;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 控制器
+ *
+ * @author Chill
+ * @since 2018-12-24
+ */
+@ApiIgnore
+@RestController
+@AllArgsConstructor
+@RequestMapping("/blade-system/role")
+@Api(value = "角色", tags = "角色")
+public class RoleController extends BladeController {
+
+	private IRoleService roleService;
+
+	/**
+	 * 详情
+	 */
+	@GetMapping("/detail")
+	@ApiOperation(value = "详情", notes = "传入role", position = 1)
+	public R<RoleVO> detail(Role role) {
+		Role detail = roleService.getOne(Condition.getQueryWrapper(role));
+		RoleWrapper roleWrapper = new RoleWrapper(roleService);
+		return R.data(roleWrapper.entityVO(detail));
+	}
+
+	/**
+	 * 列表
+	 */
+	@GetMapping("/list")
+	@ApiImplicitParams({
+		@ApiImplicitParam(name = "roleName", value = "参数名称", paramType = "query", dataType = "string"),
+		@ApiImplicitParam(name = "roleAlias", value = "角色别名", paramType = "query", dataType = "string")
+	})
+	@ApiOperation(value = "列表", notes = "传入role", position = 2)
+	public R<List<INode>> list(@ApiIgnore @RequestParam Map<String, Object> role) {
+		List<Role> list = roleService.list(Condition.getQueryWrapper(role, Role.class));
+		RoleWrapper roleWrapper = new RoleWrapper(roleService);
+		return R.data(roleWrapper.listNodeVO(list));
+	}
+
+	/**
+	 * 获取角色树形结构
+	 */
+	@GetMapping("/tree")
+	@ApiOperation(value = "树形结构", notes = "树形结构", position = 3)
+	public R<List<RoleVO>> tree() {
+		List<RoleVO> tree = roleService.tree();
+		return R.data(tree);
+	}
+
+	/**
+	 * 新增或修改
+	 */
+	@PostMapping("/submit")
+	@ApiOperation(value = "新增或修改", notes = "传入role", position = 6)
+	public R submit(@Valid @RequestBody Role role) {
+		return R.status(roleService.saveOrUpdate(role));
+	}
+
+
+	/**
+	 * 删除
+	 */
+	@PostMapping("/remove")
+	@ApiOperation(value = "物理删除", notes = "传入ids", position = 7)
+	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+		return R.status(roleService.removeByIds(Func.toIntList(ids)));
+	}
+
+	/**
+	 * 设置菜单权限
+	 *
+	 * @param roleIds
+	 * @param menuIds
+	 * @return
+	 */
+	@PostMapping("/grant")
+	@ApiOperation(value = "权限设置", notes = "传入roleId集合以及menuId集合", position = 7)
+	public R grant(@ApiParam(value = "roleId集合", required = true) @RequestParam String roleIds,
+				   @ApiParam(value = "menuId集合", required = true) @RequestParam String menuIds) {
+		boolean temp = roleService.grant(Func.toIntList(roleIds), Func.toIntList(menuIds));
+		return R.status(temp);
+	}
+
+}

+ 126 - 0
src/main/java/org/springblade/modules/system/controller/UserController.java

@@ -0,0 +1,126 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springblade.modules.system.controller;
+
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import lombok.AllArgsConstructor;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.DigestUtil;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.modules.system.entity.User;
+import org.springblade.modules.system.service.IDictService;
+import org.springblade.modules.system.service.IUserService;
+import org.springblade.modules.system.vo.UserVO;
+import org.springblade.modules.system.wrapper.UserWrapper;
+import org.springframework.web.bind.annotation.*;
+import springfox.documentation.annotations.ApiIgnore;
+
+import javax.validation.Valid;
+import java.util.Map;
+
+/**
+ * 控制器
+ *
+ * @author Chill
+ */
+@ApiIgnore
+@RestController
+@RequestMapping("blade-user")
+@AllArgsConstructor
+public class UserController {
+
+	private IUserService userService;
+
+	private IDictService dictService;
+
+	/**
+	 * 查询单条
+	 */
+	@ApiOperation(value = "查看详情", notes = "传入id", position = 1)
+	@GetMapping("/detail")
+	public R<UserVO> detail(User user) {
+		User detail = userService.getOne(Condition.getQueryWrapper(user));
+		UserWrapper userWrapper = new UserWrapper(userService, dictService);
+		return R.data(userWrapper.entityVO(detail));
+	}
+
+	/**
+	 * 用户列表
+	 */
+	@GetMapping("/list")
+	@ApiImplicitParams({
+		@ApiImplicitParam(name = "account", value = "账号名", paramType = "query", dataType = "string"),
+		@ApiImplicitParam(name = "realName", value = "姓名", paramType = "query", dataType = "string")
+	})
+	@ApiOperation(value = "列表", notes = "传入account和realName", position = 2)
+	public R<IPage<UserVO>> list(@ApiIgnore @RequestParam Map<String, Object> user, Query query) {
+		IPage<User> pages = userService.page(Condition.getPage(query), Condition.getQueryWrapper(user, User.class));
+		UserWrapper userWrapper = new UserWrapper(userService, dictService);
+		return R.data(userWrapper.pageVO(pages));
+	}
+
+	/**
+	 * 新增或修改
+	 */
+	@PostMapping("/submit")
+	@ApiOperation(value = "新增或修改", notes = "传入User", position = 3)
+	public R submit(@Valid @RequestBody User user) {
+		if (Func.isNotEmpty(user.getPassword())) {
+			user.setPassword(DigestUtil.encrypt(user.getPassword()));
+		}
+		return R.status(userService.saveOrUpdate(user));
+	}
+
+	/**
+	 * 删除
+	 */
+	@PostMapping("/remove")
+	@ApiOperation(value = "删除", notes = "传入地基和", position = 4)
+	public R remove(@RequestParam String ids) {
+		return R.status(userService.deleteLogic(Func.toIntList(ids)));
+	}
+
+
+	/**
+	 * 设置菜单权限
+	 *
+	 * @param userIds
+	 * @param roleIds
+	 * @return
+	 */
+	@PostMapping("/grant")
+	@ApiOperation(value = "权限设置", notes = "传入roleId集合以及menuId集合", position = 5)
+	public R grant(@ApiParam(value = "userId集合", required = true) @RequestParam String userIds,
+				   @ApiParam(value = "roleId集合", required = true) @RequestParam String roleIds) {
+		boolean temp = userService.grant(userIds, roleIds);
+		return R.status(temp);
+	}
+
+	@PostMapping("/reset-password")
+	@ApiOperation(value = "初始化密码", notes = "传入userId集合", position = 5)
+	public R resetPassword(@ApiParam(value = "userId集合", required = true) @RequestParam String userIds) {
+		boolean temp = userService.resetPassword(userIds);
+		return R.status(temp);
+	}
+
+}

+ 33 - 0
src/main/java/org/springblade/modules/system/dto/DeptDTO.java

@@ -0,0 +1,33 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springblade.modules.system.dto;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.modules.system.entity.Dept;
+
+/**
+ * 数据传输对象实体类
+ *
+ * @author Chill
+ * @since 2018-12-24
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class DeptDTO extends Dept {
+	private static final long serialVersionUID = 1L;
+
+}

+ 33 - 0
src/main/java/org/springblade/modules/system/dto/DictDTO.java

@@ -0,0 +1,33 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springblade.modules.system.dto;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.modules.system.entity.Dict;
+
+/**
+ * 数据传输对象实体类
+ *
+ * @author Chill
+ * @since 2018-12-24
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class DictDTO extends Dict {
+	private static final long serialVersionUID = 1L;
+
+}

+ 33 - 0
src/main/java/org/springblade/modules/system/dto/MenuDTO.java

@@ -0,0 +1,33 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springblade.modules.system.dto;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 数据传输对象实体类
+ *
+ * @author Chill
+ * @since 2018-12-24
+ */
+@Data
+public class MenuDTO implements Serializable {
+	private static final long serialVersionUID = 1L;
+	private String alias;
+	private String path;
+}

+ 33 - 0
src/main/java/org/springblade/modules/system/dto/ParamDTO.java

@@ -0,0 +1,33 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springblade.modules.system.dto;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.modules.system.entity.Param;
+
+/**
+ * 数据传输对象实体类
+ *
+ * @author Chill
+ * @since 2018-12-28
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class ParamDTO extends Param {
+	private static final long serialVersionUID = 1L;
+
+}

+ 33 - 0
src/main/java/org/springblade/modules/system/dto/RoleDTO.java

@@ -0,0 +1,33 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springblade.modules.system.dto;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.modules.system.entity.Role;
+
+/**
+ * 数据传输对象实体类
+ *
+ * @author Chill
+ * @since 2018-12-24
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class RoleDTO extends Role {
+	private static final long serialVersionUID = 1L;
+
+}

+ 33 - 0
src/main/java/org/springblade/modules/system/dto/RoleMenuDTO.java

@@ -0,0 +1,33 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springblade.modules.system.dto;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.modules.system.entity.RoleMenu;
+
+/**
+ * 数据传输对象实体类
+ *
+ * @author Chill
+ * @since 2018-12-24
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class RoleMenuDTO extends RoleMenu {
+	private static final long serialVersionUID = 1L;
+
+}

+ 86 - 0
src/main/java/org/springblade/modules/system/entity/Dept.java

@@ -0,0 +1,86 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springblade.modules.system.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 实体类
+ *
+ * @author Chill
+ * @since 2018-12-24
+ */
+@Data
+@TableName("blade_dept")
+@ApiModel(value = "Dept对象", description = "Dept对象")
+public class Dept implements Serializable {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * 主键
+	 */
+	@ApiModelProperty(value = "主键")
+	@TableId(value = "id", type = IdType.AUTO)
+	private Integer id;
+
+	/**
+	 * 父主键
+	 */
+	@ApiModelProperty(value = "父主键")
+	private Integer parentId;
+
+	/**
+	 * 部门名
+	 */
+	@ApiModelProperty(value = "部门名")
+	private String deptName;
+
+	/**
+	 * 部门全程
+	 */
+	@ApiModelProperty(value = "部门全程")
+	private String fullName;
+
+	/**
+	 * 排序
+	 */
+	@ApiModelProperty(value = "排序")
+	private Integer sort;
+
+	/**
+	 * 备注
+	 */
+	@ApiModelProperty(value = "备注")
+	private String remark;
+
+	/**
+	 * 是否已删除
+	 */
+	@TableLogic
+	@ApiModelProperty(value = "是否已删除")
+	private Integer isDeleted;
+
+
+}

+ 92 - 0
src/main/java/org/springblade/modules/system/entity/Dict.java

@@ -0,0 +1,92 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springblade.modules.system.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 实体类
+ *
+ * @author Chill
+ * @since 2018-12-24
+ */
+@Data
+@TableName("blade_dict")
+@ApiModel(value = "Dict对象", description = "Dict对象")
+public class Dict implements Serializable {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * 主键
+	 */
+	@ApiModelProperty(value = "主键")
+	@TableId(value = "id", type = IdType.AUTO)
+	private Integer id;
+
+	/**
+	 * 父主键
+	 */
+	@ApiModelProperty(value = "父主键")
+	private Integer parentId;
+
+	/**
+	 * 字典码
+	 */
+	@ApiModelProperty(value = "字典码")
+	private String code;
+
+	/**
+	 * 字典值
+	 */
+	@ApiModelProperty(value = "字典值")
+	private Integer dictKey;
+
+	/**
+	 * 字典名称
+	 */
+	@ApiModelProperty(value = "字典名称")
+	private String dictValue;
+
+	/**
+	 * 排序
+	 */
+	@ApiModelProperty(value = "排序")
+	private Integer sort;
+
+	/**
+	 * 字典备注
+	 */
+	@ApiModelProperty(value = "字典备注")
+	private String remark;
+
+	/**
+	 * 是否已删除
+	 */
+	@TableLogic
+	@ApiModelProperty(value = "是否已删除")
+	private Integer isDeleted;
+
+
+}

+ 138 - 0
src/main/java/org/springblade/modules/system/entity/Menu.java

@@ -0,0 +1,138 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springblade.modules.system.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.springblade.core.tool.utils.Func;
+
+import java.io.Serializable;
+
+/**
+ * 实体类
+ *
+ * @author Chill
+ * @since 2018-12-24
+ */
+@Data
+@TableName("blade_menu")
+@ApiModel(value = "Menu对象", description = "Menu对象")
+public class Menu implements Serializable {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * 主键
+	 */
+	@ApiModelProperty(value = "主键")
+	@TableId(value = "id", type = IdType.AUTO)
+	private Integer id;
+
+	/**
+	 * 菜单父主键
+	 */
+	@ApiModelProperty(value = "菜单父主键")
+	private Integer parentId;
+
+	/**
+	 * 菜单编号
+	 */
+	@ApiModelProperty(value = "菜单编号")
+	private String code;
+
+	/**
+	 * 菜单名称
+	 */
+	@ApiModelProperty(value = "菜单名称")
+	private String name;
+
+	/**
+	 * 菜单别名
+	 */
+	@ApiModelProperty(value = "菜单别名")
+	private String alias;
+
+	/**
+	 * 请求地址
+	 */
+	@ApiModelProperty(value = "请求地址")
+	private String path;
+
+	/**
+	 * 菜单资源
+	 */
+	@ApiModelProperty(value = "菜单资源")
+	private String source;
+
+	/**
+	 * 排序
+	 */
+	@ApiModelProperty(value = "排序")
+	private Integer sort;
+
+	/**
+	 * 菜单类型
+	 */
+	@ApiModelProperty(value = "菜单类型")
+	private Integer category;
+
+	/**
+	 * 操作按钮类型
+	 */
+	@ApiModelProperty(value = "操作按钮类型")
+	private Integer action;
+
+	/**
+	 * 是否打开新页面
+	 */
+	@ApiModelProperty(value = "是否打开新页面")
+	private Integer isOpen;
+
+	/**
+	 * 备注
+	 */
+	@ApiModelProperty(value = "备注")
+	private String remark;
+
+	/**
+	 * 是否已删除
+	 */
+	@TableLogic
+	@ApiModelProperty(value = "是否已删除")
+	private Integer isDeleted;
+
+
+	@Override
+	public boolean equals(Object obj) {
+		if (this == obj) {
+			return true;
+		}
+		if (obj == null) {
+			return false;
+		}
+		Menu other = (Menu) obj;
+		if (Func.equals(this.getId(), other.getId())) {
+			return true;
+		}
+		return false;
+	}
+
+}

+ 64 - 0
src/main/java/org/springblade/modules/system/entity/Param.java

@@ -0,0 +1,64 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springblade.modules.system.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.core.mp.base.BaseEntity;
+
+/**
+ * 实体类
+ *
+ * @author Chill
+ * @since 2018-12-28
+ */
+@Data
+@TableName("blade_param")
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "Param对象", description = "Param对象")
+public class Param extends BaseEntity {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * 参数名
+	 */
+	@ApiModelProperty(value = "参数名")
+	private String paramName;
+
+	/**
+	 * 参数键
+	 */
+	@ApiModelProperty(value = "参数键")
+	private String paramKey;
+
+	/**
+	 * 参数值
+	 */
+	@ApiModelProperty(value = "参数值")
+	private String paramValue;
+
+	/**
+	 * 备注
+	 */
+	@ApiModelProperty(value = "备注")
+	private String remark;
+
+
+}

+ 80 - 0
src/main/java/org/springblade/modules/system/entity/Role.java

@@ -0,0 +1,80 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springblade.modules.system.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 实体类
+ *
+ * @author Chill
+ * @since 2018-12-24
+ */
+@Data
+@TableName("blade_role")
+@ApiModel(value = "Role对象", description = "Role对象")
+public class Role implements Serializable {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * 主键
+	 */
+	@ApiModelProperty(value = "主键")
+	@TableId(value = "id", type = IdType.AUTO)
+	private Integer id;
+
+	/**
+	 * 父主键
+	 */
+	@ApiModelProperty(value = "父主键")
+	private Integer parentId;
+
+	/**
+	 * 角色名
+	 */
+	@ApiModelProperty(value = "角色名")
+	private String roleName;
+
+	/**
+	 * 排序
+	 */
+	@ApiModelProperty(value = "排序")
+	private Integer sort;
+
+	/**
+	 * 角色别名
+	 */
+	@ApiModelProperty(value = "角色别名")
+	private String roleAlias;
+
+	/**
+	 * 是否已删除
+	 */
+	@TableLogic
+	@ApiModelProperty(value = "是否已删除")
+	private Integer isDeleted;
+
+
+}

+ 60 - 0
src/main/java/org/springblade/modules/system/entity/RoleMenu.java

@@ -0,0 +1,60 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springblade.modules.system.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 实体类
+ *
+ * @author Chill
+ * @since 2018-12-24
+ */
+@Data
+@TableName("blade_role_menu")
+@ApiModel(value = "RoleMenu对象", description = "RoleMenu对象")
+public class RoleMenu implements Serializable {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * 主键
+	 */
+	@ApiModelProperty(value = "主键")
+	@TableId(value = "id", type = IdType.AUTO)
+	private Integer id;
+
+	/**
+	 * 菜单id
+	 */
+	@ApiModelProperty(value = "菜单id")
+	private Integer menuId;
+
+	/**
+	 * 角色id
+	 */
+	@ApiModelProperty(value = "角色id")
+	private Integer roleId;
+
+
+}

+ 79 - 0
src/main/java/org/springblade/modules/system/entity/User.java

@@ -0,0 +1,79 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springblade.modules.system.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.core.mp.base.BaseEntity;
+
+import java.time.LocalDateTime;
+
+/**
+ * 实体类
+ *
+ * @author Chill
+ */
+@Data
+@TableName("blade_user")
+@EqualsAndHashCode(callSuper = true)
+public class User extends BaseEntity {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * 账号
+	 */
+	private String account;
+	/**
+	 * 密码
+	 */
+	private String password;
+	/**
+	 * 昵称
+	 */
+	private String name;
+	/**
+	 * 真名
+	 */
+	private String realName;
+	/**
+	 * 邮箱
+	 */
+	private String email;
+	/**
+	 * 手机
+	 */
+	private String phone;
+	/**
+	 * 生日
+	 */
+	private LocalDateTime birthday;
+	/**
+	 * 性别
+	 */
+	private Integer sex;
+	/**
+	 * 角色id
+	 */
+	private String roleId;
+	/**
+	 * 部门id
+	 */
+	private String deptId;
+
+
+}

+ 54 - 0
src/main/java/org/springblade/modules/system/entity/UserInfo.java

@@ -0,0 +1,54 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springblade.modules.system.entity;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * 用户信息
+ *
+ * @author Chill
+ */
+@Data
+@ApiModel(description = "用户信息")
+public class UserInfo implements Serializable {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * 用户基础信息
+	 */
+	@ApiModelProperty(value = "用户")
+	private User user;
+
+	/**
+	 * 权限标识集合
+	 */
+	@ApiModelProperty(value = "权限集合")
+	private List<String> permissions;
+
+	/**
+	 * 角色集合
+	 */
+	@ApiModelProperty(value = "角色集合")
+	private List<String> roles;
+
+}

+ 49 - 0
src/main/java/org/springblade/modules/system/mapper/DeptMapper.java

@@ -0,0 +1,49 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springblade.modules.system.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.modules.system.entity.Dept;
+import org.springblade.modules.system.vo.DeptVO;
+
+import java.util.List;
+
+/**
+ * Mapper 接口
+ *
+ * @author Chill
+ * @since 2018-12-24
+ */
+public interface DeptMapper extends BaseMapper<Dept> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param dept
+	 * @return
+	 */
+	List<DeptVO> selectDeptPage(IPage page, DeptVO dept);
+
+	/**
+	 * 获取树形节点
+	 *
+	 * @return
+	 */
+	List<DeptVO> tree();
+
+}

+ 38 - 0
src/main/java/org/springblade/modules/system/mapper/DeptMapper.xml

@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.springblade.modules.system.mapper.DeptMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="deptResultMap" type="org.springblade.modules.system.entity.Dept">
+        <id column="id" property="id"/>
+        <result column="parent_id" property="parentId"/>
+        <result column="dept_name" property="deptName"/>
+        <result column="full_name" property="fullName"/>
+        <result column="sort" property="sort"/>
+        <result column="remark" property="remark"/>
+        <result column="is_deleted" property="isDeleted"/>
+    </resultMap>
+
+    <resultMap id="treeNodeResultMap" type="org.springblade.core.tool.node.TreeNode">
+        <id column="id" property="id"/>
+        <result column="parent_id" property="parentId"/>
+        <result column="title" property="title"/>
+        <result column="value" property="value"/>
+        <result column="key" property="key"/>
+    </resultMap>
+
+    <!-- 通用查询结果列 -->
+    <sql id="baseColumnList">
+        select
+        id, parent_id, dept_name, full_name, sort, remark, is_deleted
+    </sql>
+
+    <select id="selectDeptPage" resultMap="deptResultMap">
+        select * from blade_dept where is_deleted = 0
+    </select>
+
+    <select id="tree" resultMap="treeNodeResultMap">
+        select id, parent_id, dept_name as title, id as `value`, id as `key` from blade_dept where is_deleted = 0
+    </select>
+
+</mapper>

+ 66 - 0
src/main/java/org/springblade/modules/system/mapper/DictMapper.java

@@ -0,0 +1,66 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springblade.modules.system.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.modules.system.entity.Dict;
+import org.springblade.modules.system.vo.DictVO;
+
+import java.util.List;
+
+/**
+ * Mapper 接口
+ *
+ * @author Chill
+ * @since 2018-12-24
+ */
+public interface DictMapper extends BaseMapper<Dict> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param dict
+	 * @return
+	 */
+	List<DictVO> selectDictPage(IPage page, DictVO dict);
+
+	/**
+	 * 获取字典表对应中文
+	 *
+	 * @param code    字典编号
+	 * @param dictKey 字典序号
+	 * @return
+	 */
+	String getValue(String code, Integer dictKey);
+
+	/**
+	 * 获取字典表
+	 *
+	 * @param code 字典编号
+	 * @return
+	 */
+	List<Dict> getList(String code);
+
+	/**
+	 * 获取树形节点
+	 *
+	 * @return
+	 */
+	List<DictVO> tree();
+
+}

+ 49 - 0
src/main/java/org/springblade/modules/system/mapper/DictMapper.xml

@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.springblade.modules.system.mapper.DictMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="dictResultMap" type="org.springblade.modules.system.entity.Dict">
+        <id column="id" property="id"/>
+        <result column="parent_id" property="parentId"/>
+        <result column="code" property="code"/>
+        <result column="dict_key" property="dictKey"/>
+        <result column="dict_value" property="dictValue"/>
+        <result column="sort" property="sort"/>
+        <result column="remark" property="remark"/>
+        <result column="is_deleted" property="isDeleted"/>
+    </resultMap>
+
+    <resultMap id="treeNodeResultMap" type="org.springblade.core.tool.node.TreeNode">
+        <id column="id" property="id"/>
+        <result column="parent_id" property="parentId"/>
+        <result column="title" property="title"/>
+        <result column="value" property="value"/>
+        <result column="key" property="key"/>
+    </resultMap>
+
+    <!-- 通用查询结果列 -->
+    <sql id="baseColumnList">
+        select
+        id, parent_id, code, dict_key, dict_value, sort, remark, is_deleted
+    </sql>
+
+    <select id="selectDictPage" resultMap="dictResultMap">
+        select * from blade_dict where is_deleted = 0
+    </select>
+
+    <select id="getValue" resultType="java.lang.String">
+        select
+            dict_value
+        from blade_dict where code = #{param1} and dict_key = #{param2} limit 1
+    </select>
+
+    <select id="getList" resultMap="dictResultMap">
+        select code, dict_key, dict_value, sort, remark from blade_dict where code = #{param1}
+    </select>
+
+    <select id="tree" resultMap="treeNodeResultMap">
+        select id, parent_id, dict_value as title, id as `value`, id as `key` from blade_dict where is_deleted = 0
+    </select>
+
+</mapper>

+ 29 - 0
src/main/java/org/springblade/modules/system/mapper/LogApiMapper.java

@@ -0,0 +1,29 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springblade.modules.system.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.springblade.core.log.model.LogApi;
+
+/**
+ * Mapper 接口
+ *
+ * @author Chill
+ * @since 2018-09-26
+ */
+public interface LogApiMapper extends BaseMapper<LogApi> {
+
+}

+ 33 - 0
src/main/java/org/springblade/modules/system/mapper/LogApiMapper.xml

@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.springblade.modules.system.mapper.LogApiMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="logResultMap" type="org.springblade.core.log.model.LogApi">
+        <result column="id" property="id"/>
+        <result column="create_time" property="createTime"/>
+        <result column="service_id" property="serviceId"/>
+        <result column="server_host" property="serverHost"/>
+        <result column="server_ip" property="serverIp"/>
+        <result column="env" property="env"/>
+        <result column="type" property="type"/>
+        <result column="title" property="title"/>
+        <result column="method" property="method"/>
+        <result column="request_uri" property="requestUri"/>
+        <result column="user_agent" property="userAgent"/>
+        <result column="remote_ip" property="remoteIp"/>
+        <result column="method_class" property="methodClass"/>
+        <result column="method_name" property="methodName"/>
+        <result column="params" property="params"/>
+        <result column="time" property="time"/>
+        <result column="create_by" property="createBy"/>
+    </resultMap>
+
+    <!-- 通用查询结果列 -->
+    <sql id="baseColumnList">
+        select id,
+        create_time AS createTime,
+        service_id, server_host, server_ip, env, type, title, method, request_uri, user_agent, remote_ip, method_class, method_name, params, time, create_by
+    </sql>
+
+</mapper>

+ 29 - 0
src/main/java/org/springblade/modules/system/mapper/LogErrorMapper.java

@@ -0,0 +1,29 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springblade.modules.system.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.springblade.core.log.model.LogError;
+
+/**
+ * Mapper 接口
+ *
+ * @author Chill
+ * @since 2018-09-26
+ */
+public interface LogErrorMapper extends BaseMapper<LogError> {
+
+}

+ 34 - 0
src/main/java/org/springblade/modules/system/mapper/LogErrorMapper.xml

@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.springblade.modules.system.mapper.LogErrorMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="errorLogResultMap" type="org.springblade.core.log.model.LogError">
+        <result column="id" property="id"/>
+        <result column="create_time" property="createTime"/>
+        <result column="service_id" property="serviceId"/>
+        <result column="server_host" property="serverHost"/>
+        <result column="server_ip" property="serverIp"/>
+        <result column="env" property="env"/>
+        <result column="method" property="method"/>
+        <result column="request_uri" property="requestUri"/>
+        <result column="user_agent" property="userAgent"/>
+        <result column="stack_trace" property="stackTrace"/>
+        <result column="exception_name" property="exceptionName"/>
+        <result column="message" property="message"/>
+        <result column="line_number" property="lineNumber"/>
+        <result column="method_class" property="methodClass"/>
+        <result column="file_name" property="fileName"/>
+        <result column="method_name" property="methodName"/>
+        <result column="params" property="params"/>
+        <result column="create_by" property="createBy"/>
+    </resultMap>
+
+    <!-- 通用查询结果列 -->
+    <sql id="baseColumnList">
+        select id,
+        create_time AS createTime,
+        service_id, server_host, server_ip, env, method, request_uri, user_agent, stack_trace, exception_name, message, line_number, method_class, file_name, method_name, params, create_by
+    </sql>
+
+</mapper>

+ 29 - 0
src/main/java/org/springblade/modules/system/mapper/LogUsualMapper.java

@@ -0,0 +1,29 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springblade.modules.system.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.springblade.core.log.model.LogUsual;
+
+/**
+ * Mapper 接口
+ *
+ * @author Chill
+ * @since 2018-10-12
+ */
+public interface LogUsualMapper extends BaseMapper<LogUsual> {
+
+}

+ 29 - 0
src/main/java/org/springblade/modules/system/mapper/LogUsualMapper.xml

@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.springblade.modules.system.mapper.LogUsualMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="logResultMap" type="org.springblade.core.log.model.LogUsual">
+        <result column="id" property="id"/>
+        <result column="create_time" property="createTime"/>
+        <result column="service_id" property="serviceId"/>
+        <result column="server_host" property="serverHost"/>
+        <result column="server_ip" property="serverIp"/>
+        <result column="env" property="env"/>
+        <result column="log_level" property="logLevel"/>
+        <result column="log_data" property="logData"/>
+        <result column="method" property="method"/>
+        <result column="request_uri" property="requestUri"/>
+        <result column="user_agent" property="userAgent"/>
+        <result column="params" property="params"/>
+        <result column="create_by" property="createBy"/>
+    </resultMap>
+
+    <!-- 通用查询结果列 -->
+    <sql id="baseColumnList">
+        select id,
+        create_time AS createTime,
+        service_id, server_host, server_ip, env, log_level, log_data, method, request_uri, user_agent, params, create_by
+    </sql>
+
+</mapper>

+ 94 - 0
src/main/java/org/springblade/modules/system/mapper/MenuMapper.java

@@ -0,0 +1,94 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springblade.modules.system.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.modules.system.dto.MenuDTO;
+import org.springblade.modules.system.entity.Menu;
+import org.springblade.modules.system.vo.MenuVO;
+
+import java.util.List;
+
+/**
+ * Mapper 接口
+ *
+ * @author Chill
+ * @since 2018-12-24
+ */
+public interface MenuMapper extends BaseMapper<Menu> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param menu
+	 * @return
+	 */
+	List<MenuVO> selectMenuPage(IPage page, MenuVO menu);
+
+	/**
+	 * 树形结构
+	 *
+	 * @return
+	 */
+	List<MenuVO> tree();
+
+	/**
+	 * 授权树形结构
+	 *
+	 * @return
+	 */
+	List<MenuVO> grantTree();
+
+	/**
+	 * 所有菜单
+	 *
+	 * @return
+	 */
+	List<Menu> allMenu();
+
+	/**
+	 * 权限配置菜单
+	 *
+	 * @param roleId
+	 * @return
+	 */
+	List<Menu> roleMenu(List<Integer> roleId);
+
+	/**
+	 * 菜单树形结构
+	 *
+	 * @param roleId
+	 * @return
+	 */
+	List<Menu> routes(List<Integer> roleId);
+
+	/**
+	 * 按钮树形结构
+	 *
+	 * @param roleId
+	 * @return
+	 */
+	List<Menu> buttons(List<Integer> roleId);
+
+	/**
+	 * 获取配置的角色权限
+	 * @param roleIds
+	 * @return
+	 */
+	List<MenuDTO> authRoutes(List<Integer> roleIds);
+}

+ 132 - 0
src/main/java/org/springblade/modules/system/mapper/MenuMapper.xml

@@ -0,0 +1,132 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.springblade.modules.system.mapper.MenuMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="menuResultMap" type="org.springblade.modules.system.entity.Menu">
+        <id column="id" property="id"/>
+        <result column="code" property="code"/>
+        <result column="parent_id" property="parentId"/>
+        <result column="name" property="name"/>
+        <result column="alias" property="alias"/>
+        <result column="path" property="path"/>
+        <result column="source" property="source"/>
+        <result column="sort" property="sort"/>
+        <result column="category" property="category"/>
+        <result column="action" property="action"/>
+        <result column="is_open" property="isOpen"/>
+        <result column="remark" property="remark"/>
+        <result column="is_deleted" property="isDeleted"/>
+    </resultMap>
+
+    <resultMap id="treeNodeResultMap" type="org.springblade.core.tool.node.TreeNode">
+        <id column="id" property="id"/>
+        <result column="parent_id" property="parentId"/>
+        <result column="title" property="title"/>
+        <result column="value" property="value"/>
+        <result column="key" property="key"/>
+    </resultMap>
+
+    <!-- 通用查询结果列 -->
+    <sql id="baseColumnList">
+        select
+        id, code, parent_code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted
+    </sql>
+
+    <select id="selectMenuPage" resultMap="menuResultMap">
+        select * from blade_menu where is_deleted = 0
+    </select>
+
+    <select id="tree" resultMap="treeNodeResultMap">
+        select id, parent_id, name as title, id as `value`, id as `key` from blade_menu where is_deleted = 0 and category = 1
+    </select>
+
+    <select id="allMenu" resultMap="menuResultMap">
+        select * from blade_menu where is_deleted = 0 and category = 1
+    </select>
+
+    <select id="roleMenu" resultMap="menuResultMap">
+        select * from blade_menu where is_deleted = 0 AND id IN ( SELECT menu_id FROM blade_role_menu WHERE role_id IN
+        <foreach collection="list" index="index" item="item" open="(" separator="," close=")">
+            #{item}
+        </foreach> )
+    </select>
+
+    <select id="routes" resultMap="menuResultMap">
+        SELECT
+            *
+        FROM
+            blade_menu
+        WHERE
+            category = 1
+            AND id IN ( SELECT menu_id FROM blade_role_menu WHERE role_id IN
+                        <foreach collection="list" index="index" item="item" open="(" separator="," close=")">
+                            #{item}
+                        </foreach> )
+    </select>
+
+    <select id="buttons" resultMap="menuResultMap">
+        SELECT
+            id,
+            parent_id,
+            `code`,
+            `name`,
+            alias,
+            path,
+            source,
+            action,
+            sort
+        FROM
+            blade_menu
+        WHERE
+            id IN (
+              SELECT parent_id FROM blade_menu
+              WHERE ( category = 2 AND id IN ( SELECT menu_id FROM blade_role_menu WHERE role_id IN
+                <foreach collection="list" index="index" item="item" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+              ) ) )
+
+        UNION ALL
+
+        SELECT
+            id,
+            parent_id,
+            `code`,
+            `name`,
+            alias,
+            path,
+            source,
+            action,
+            sort
+        FROM
+            blade_menu
+        WHERE
+            ( category = 2 AND id IN ( SELECT menu_id FROM blade_role_menu WHERE role_id IN
+            <foreach collection="list" index="index" item="item" open="(" separator="," close=")">
+                #{item}
+            </foreach>) )
+    </select>
+
+    <select id="grantTree" resultMap="treeNodeResultMap">
+        select id, parent_id, name as title, id as `value`, id as `key` from blade_menu where is_deleted = 0
+    </select>
+
+    <select id="authRoutes" resultType="org.springblade.modules.system.dto.MenuDTO">
+        SELECT
+            GROUP_CONCAT(r.role_alias) as alias,
+            m.path
+        FROM
+            blade_role_menu rm
+            LEFT JOIN blade_menu m ON rm.menu_id = m.id
+            LEFT JOIN blade_role r ON rm.role_id = r.id
+        WHERE
+            rm.role_id IN
+            <foreach collection="list" index="index" item="item" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+            AND m.path IS NOT NULL
+        GROUP BY m.path
+    </select>
+
+</mapper>

+ 42 - 0
src/main/java/org/springblade/modules/system/mapper/ParamMapper.java

@@ -0,0 +1,42 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springblade.modules.system.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.modules.system.entity.Param;
+import org.springblade.modules.system.vo.ParamVO;
+
+import java.util.List;
+
+/**
+ * Mapper 接口
+ *
+ * @author Chill
+ * @since 2018-12-28
+ */
+public interface ParamMapper extends BaseMapper<Param> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param param
+	 * @return
+	 */
+	List<ParamVO> selectParamPage(IPage page, ParamVO param);
+
+}

+ 37 - 0
src/main/java/org/springblade/modules/system/mapper/ParamMapper.xml

@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.springblade.modules.system.mapper.ParamMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="paramResultMap" type="org.springblade.modules.system.entity.Param">
+        <result column="id" property="id"/>
+        <result column="create_user" property="createUser"/>
+        <result column="create_time" property="createTime"/>
+        <result column="update_user" property="updateUser"/>
+        <result column="update_time" property="updateTime"/>
+        <result column="status" property="status"/>
+        <result column="is_deleted" property="isDeleted"/>
+        <result column="param_name" property="paramName"/>
+        <result column="param_key" property="paramKey"/>
+        <result column="param_value" property="paramValue"/>
+        <result column="remark" property="remark"/>
+    </resultMap>
+
+    <!-- 通用查询结果列 -->
+    <sql id="baseColumnList">
+        select
+        id,
+        create_user AS createUser,
+        create_time AS createTime,
+        update_user AS updateUser,
+        update_time AS updateTime,
+        status,
+        is_deleted AS isDeleted,
+        param_name, param_key, param_value, remark
+    </sql>
+
+    <select id="selectParamPage" resultMap="paramResultMap">
+        select * from blade_param where is_deleted = 0
+    </select>
+
+</mapper>

+ 49 - 0
src/main/java/org/springblade/modules/system/mapper/RoleMapper.java

@@ -0,0 +1,49 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springblade.modules.system.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.modules.system.entity.Role;
+import org.springblade.modules.system.vo.RoleVO;
+
+import java.util.List;
+
+/**
+ * Mapper 接口
+ *
+ * @author Chill
+ * @since 2018-12-24
+ */
+public interface RoleMapper extends BaseMapper<Role> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param role
+	 * @return
+	 */
+	List<RoleVO> selectRolePage(IPage page, RoleVO role);
+
+	/**
+	 * 获取树形节点
+	 *
+	 * @return
+	 */
+	List<RoleVO> tree();
+
+}

+ 37 - 0
src/main/java/org/springblade/modules/system/mapper/RoleMapper.xml

@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.springblade.modules.system.mapper.RoleMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="roleResultMap" type="org.springblade.modules.system.entity.Role">
+        <id column="id" property="id"/>
+        <result column="parent_id" property="parentId"/>
+        <result column="role_name" property="roleName"/>
+        <result column="sort" property="sort"/>
+        <result column="role_alias" property="roleAlias"/>
+        <result column="is_deleted" property="isDeleted"/>
+    </resultMap>
+
+    <resultMap id="treeNodeResultMap" type="org.springblade.core.tool.node.TreeNode">
+        <id column="id" property="id"/>
+        <result column="parent_id" property="parentId"/>
+        <result column="title" property="title"/>
+        <result column="value" property="value"/>
+        <result column="key" property="key"/>
+    </resultMap>
+
+    <!-- 通用查询结果列 -->
+    <sql id="baseColumnList">
+        select
+        id, parent_id, role_name, sort, role_alias, is_deleted
+    </sql>
+
+    <select id="selectRolePage" resultMap="roleResultMap">
+        select * from blade_role where is_deleted = 0
+    </select>
+
+    <select id="tree" resultMap="treeNodeResultMap">
+        select id, parent_id, role_name as title, id as `value`, id as `key` from blade_role where is_deleted = 0
+    </select>
+
+</mapper>

+ 41 - 0
src/main/java/org/springblade/modules/system/mapper/RoleMenuMapper.java

@@ -0,0 +1,41 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springblade.modules.system.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.modules.system.entity.RoleMenu;
+import org.springblade.modules.system.vo.RoleMenuVO;
+
+import java.util.List;
+
+/**
+ * Mapper 接口
+ *
+ * @author Chill
+ * @since 2018-12-24
+ */
+public interface RoleMenuMapper extends BaseMapper<RoleMenu> {
+
+	/**
+	 * 自定义分页
+	 * @param page
+	 * @param roleMenu
+	 * @return
+	 */
+	List<RoleMenuVO> selectRoleMenuPage(IPage page, RoleMenuVO roleMenu);
+
+}

+ 22 - 0
src/main/java/org/springblade/modules/system/mapper/RoleMenuMapper.xml

@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.springblade.modules.system.mapper.RoleMenuMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="roleMenuResultMap" type="org.springblade.modules.system.entity.RoleMenu">
+        <id column="id" property="id"/>
+        <result column="menu_id" property="menuId"/>
+        <result column="role_id" property="roleId"/>
+    </resultMap>
+
+    <!-- 通用查询结果列 -->
+    <sql id="baseColumnList">
+        select
+        id, menu_id, role_id, is_deleted
+    </sql>
+
+    <select id="selectRoleMenuPage" resultMap="roleMenuResultMap">
+        select * from blade_role_menu where is_deleted = 0
+    </select>
+
+</mapper>

+ 73 - 0
src/main/java/org/springblade/modules/system/mapper/UserMapper.java

@@ -0,0 +1,73 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springblade.modules.system.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.modules.system.entity.User;
+
+import java.util.List;
+
+/**
+ * Mapper 接口
+ *
+ * @author Chill
+ */
+public interface UserMapper extends BaseMapper<User> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param user
+	 * @return
+	 */
+	List<User> selectUserPage(IPage page, User user);
+
+	/**
+	 * 获取用户
+	 *
+	 * @param account
+	 * @param password
+	 * @return
+	 */
+	User getUser(String account, String password);
+
+	/**
+	 * 获取角色名
+	 *
+	 * @param ids
+	 * @return
+	 */
+	List<String> getRoleName(String[] ids);
+
+	/**
+	 * 获取角色别名
+	 *
+	 * @param ids
+	 * @return
+	 */
+	List<String> getRoleAlias(String[] ids);
+
+	/**
+	 * 获取部门名
+	 *
+	 * @param ids
+	 * @return
+	 */
+	List<String> getDeptName(String[] ids);
+
+}

+ 87 - 0
src/main/java/org/springblade/modules/system/mapper/UserMapper.xml

@@ -0,0 +1,87 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.springblade.modules.system.mapper.UserMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="userResultMap" type="org.springblade.modules.system.entity.User">
+        <result column="id" property="id"/>
+        <result column="create_user" property="createUser"/>
+        <result column="create_time" property="createTime"/>
+        <result column="update_user" property="updateUser"/>
+        <result column="update_time" property="updateTime"/>
+        <result column="status" property="status"/>
+        <result column="is_deleted" property="isDeleted"/>
+        <result column="account" property="account"/>
+        <result column="password" property="password"/>
+        <result column="name" property="name"/>
+        <result column="real_name" property="realName"/>
+        <result column="email" property="email"/>
+        <result column="phone" property="phone"/>
+        <result column="birthday" property="birthday"/>
+        <result column="sex" property="sex"/>
+        <result column="role_id" property="roleId"/>
+        <result column="dept_id" property="deptId"/>
+    </resultMap>
+
+    <!-- 通用查询结果列 -->
+    <sql id="baseColumnList">
+        select id,
+        create_user AS createUser,
+        create_time AS createTime,
+        update_user AS updateUser,
+        update_time AS updateTime,
+        status,
+        is_deleted AS isDeleted,
+        account, password, name, real_name, email, phone, birthday, sex, role_id, dept_id
+    </sql>
+
+    <select id="selectUserPage" resultMap="userResultMap">
+        select * from blade_user where is_deleted = 0
+    </select>
+
+    <select id="getUser" resultMap="userResultMap">
+        SELECT
+            *
+        FROM
+            blade_user
+        WHERE
+            account = #{param1} AND password = #{param2}
+    </select>
+
+    <select id="getRoleName" resultType="java.lang.String">
+        SELECT
+        role_name
+        FROM
+        blade_role
+        WHERE
+        id IN
+        <foreach collection="array" item="ids" index="index" open="(" close=")" separator=",">
+            #{ids}
+        </foreach>
+    </select>
+
+    <select id="getRoleAlias" resultType="java.lang.String">
+        SELECT
+            role_alias
+        FROM
+            blade_role
+        WHERE
+            id IN
+        <foreach collection="array" item="ids" index="index" open="(" close=")" separator=",">
+            #{ids}
+        </foreach>
+    </select>
+
+    <select id="getDeptName" resultType="java.lang.String">
+        SELECT
+            dept_name
+        FROM
+            blade_dept
+        WHERE
+            id IN
+        <foreach collection="array" item="ids" index="index" open="(" close=")" separator=",">
+            #{ids}
+        </foreach>
+    </select>
+
+</mapper>

+ 49 - 0
src/main/java/org/springblade/modules/system/service/IDeptService.java

@@ -0,0 +1,49 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springblade.modules.system.service;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.service.IService;
+import org.springblade.modules.system.entity.Dept;
+import org.springblade.modules.system.vo.DeptVO;
+
+import java.util.List;
+
+/**
+ * 服务类
+ *
+ * @author Chill
+ * @since 2018-12-24
+ */
+public interface IDeptService extends IService<Dept> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param dept
+	 * @return
+	 */
+	IPage<DeptVO> selectDeptPage(IPage<DeptVO> page, DeptVO dept);
+
+	/**
+	 * 树形结构
+	 *
+	 * @return
+	 */
+	List<DeptVO> tree();
+
+}

+ 66 - 0
src/main/java/org/springblade/modules/system/service/IDictService.java

@@ -0,0 +1,66 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springblade.modules.system.service;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.service.IService;
+import org.springblade.modules.system.entity.Dict;
+import org.springblade.modules.system.vo.DictVO;
+
+import java.util.List;
+
+/**
+ * 服务类
+ *
+ * @author Chill
+ * @since 2018-12-24
+ */
+public interface IDictService extends IService<Dict> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param dict
+	 * @return
+	 */
+	IPage<DictVO> selectDictPage(IPage<DictVO> page, DictVO dict);
+
+	/**
+	 * 树形结构
+	 *
+	 * @return
+	 */
+	List<DictVO> tree();
+
+	/**
+	 * 获取字典表对应中文
+	 *
+	 * @param code    字典编号
+	 * @param dictKey 字典序号
+	 * @return
+	 */
+	String getValue(String code, Integer dictKey);
+
+	/**
+	 * 获取字典表
+	 *
+	 * @param code 字典编号
+	 * @return
+	 */
+	List<Dict> getList(String code);
+
+}

+ 29 - 0
src/main/java/org/springblade/modules/system/service/ILogApiService.java

@@ -0,0 +1,29 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springblade.modules.system.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import org.springblade.core.log.model.LogApi;
+
+/**
+ * 服务类
+ *
+ * @author Chill
+ * @since 2018-09-26
+ */
+public interface ILogApiService extends IService<LogApi> {
+
+}

+ 29 - 0
src/main/java/org/springblade/modules/system/service/ILogErrorService.java

@@ -0,0 +1,29 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springblade.modules.system.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import org.springblade.core.log.model.LogError;
+
+/**
+ * 服务类
+ *
+ * @author Chill
+ * @since 2018-09-26
+ */
+public interface ILogErrorService extends IService<LogError> {
+
+}

+ 54 - 0
src/main/java/org/springblade/modules/system/service/ILogService.java

@@ -0,0 +1,54 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springblade.modules.system.service;
+
+import org.springblade.core.log.model.LogApi;
+import org.springblade.core.log.model.LogError;
+import org.springblade.core.log.model.LogUsual;
+
+/**
+ * 服务类
+ *
+ * @author Chill
+ * @since 2018-09-26
+ */
+public interface ILogService {
+
+	/**
+	 * 保存通用日志
+	 *
+	 * @param log
+	 * @return
+	 */
+	Boolean saveUsualLog(LogUsual log);
+
+	/**
+	 * 保存操作日志
+	 *
+	 * @param log
+	 * @return
+	 */
+	Boolean saveApiLog(LogApi log);
+
+	/**
+	 * 保存错误日志
+	 *
+	 * @param log
+	 * @return
+	 */
+	Boolean saveErrorLog(LogError log);
+
+}

+ 29 - 0
src/main/java/org/springblade/modules/system/service/ILogUsualService.java

@@ -0,0 +1,29 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springblade.modules.system.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import org.springblade.core.log.model.LogUsual;
+
+/**
+ * 服务类
+ *
+ * @author Chill
+ * @since 2018-10-12
+ */
+public interface ILogUsualService extends IService<LogUsual> {
+
+}

+ 88 - 0
src/main/java/org/springblade/modules/system/service/IMenuService.java

@@ -0,0 +1,88 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springblade.modules.system.service;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.service.IService;
+import org.springblade.modules.system.dto.MenuDTO;
+import org.springblade.modules.system.entity.Menu;
+import org.springblade.modules.system.vo.MenuVO;
+
+import java.util.List;
+
+/**
+ * 服务类
+ *
+ * @author Chill
+ * @since 2018-12-24
+ */
+public interface IMenuService extends IService<Menu> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param menu
+	 * @return
+	 */
+	IPage<MenuVO> selectMenuPage(IPage<MenuVO> page, MenuVO menu);
+
+	/**
+	 * 菜单树形结构
+	 *
+	 * @param roleId
+	 * @return
+	 */
+	List<MenuVO> routes(String roleId);
+
+	/**
+	 * 按钮树形结构
+	 *
+	 * @param roleId
+	 * @return
+	 */
+	List<MenuVO> buttons(String roleId);
+
+	/**
+	 * 树形结构
+	 *
+	 * @return
+	 */
+	List<MenuVO> tree();
+
+	/**
+	 * 授权树形结构
+	 *
+	 * @return
+	 */
+	List<MenuVO> grantTree();
+
+	/**
+	 * 默认选中节点
+	 *
+	 * @param roleIds
+	 * @return
+	 */
+	List<String> roleTreeKeys(String roleIds);
+
+	/**
+	 * 获取配置的角色权限
+	 * @param roleIds
+	 * @return
+	 */
+	List<MenuDTO> authRoutes(List<Integer> roleIds);
+
+}

+ 39 - 0
src/main/java/org/springblade/modules/system/service/IParamService.java

@@ -0,0 +1,39 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springblade.modules.system.service;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.core.mp.base.BaseService;
+import org.springblade.modules.system.entity.Param;
+import org.springblade.modules.system.vo.ParamVO;
+
+/**
+ * 服务类
+ *
+ * @author Chill
+ * @since 2018-12-28
+ */
+public interface IParamService extends BaseService<Param> {
+
+	/***
+	 * 自定义分页
+	 * @param page
+	 * @param param
+	 * @return
+	 */
+	IPage<ParamVO> selectParamPage(IPage<ParamVO> page, ParamVO param);
+
+}

+ 29 - 0
src/main/java/org/springblade/modules/system/service/IRoleMenuService.java

@@ -0,0 +1,29 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springblade.modules.system.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import org.springblade.modules.system.entity.RoleMenu;
+
+/**
+ * 服务类
+ *
+ * @author Chill
+ * @since 2018-12-24
+ */
+public interface IRoleMenuService extends IService<RoleMenu> {
+
+}

+ 59 - 0
src/main/java/org/springblade/modules/system/service/IRoleService.java

@@ -0,0 +1,59 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springblade.modules.system.service;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.service.IService;
+import org.springblade.modules.system.entity.Role;
+import org.springblade.modules.system.vo.RoleVO;
+
+import javax.validation.constraints.NotEmpty;
+import java.util.List;
+
+/**
+ * 服务类
+ *
+ * @author Chill
+ * @since 2018-12-24
+ */
+public interface IRoleService extends IService<Role> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param role
+	 * @return
+	 */
+	IPage<RoleVO> selectRolePage(IPage<RoleVO> page, RoleVO role);
+
+	/**
+	 * 树形结构
+	 *
+	 * @return
+	 */
+	List<RoleVO> tree();
+
+	/**
+	 * 权限配置
+	 *
+	 * @param roleIds 角色id集合
+	 * @param menuIds 菜单id集合
+	 * @return 是否成功
+	 */
+	boolean grant(@NotEmpty List<Integer> roleIds, @NotEmpty List<Integer> menuIds);
+
+}

+ 83 - 0
src/main/java/org/springblade/modules/system/service/IUserService.java

@@ -0,0 +1,83 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springblade.modules.system.service;
+
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.core.mp.base.BaseService;
+import org.springblade.modules.system.entity.User;
+import org.springblade.modules.system.entity.UserInfo;
+
+import java.util.List;
+
+/**
+ * 服务类
+ *
+ * @author Chill
+ */
+public interface IUserService extends BaseService<User> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param user
+	 * @return
+	 */
+	IPage<User> selectUserPage(IPage<User> page, User user);
+
+	/**
+	 * 用户信息
+	 *
+	 * @param account
+	 * @param password
+	 * @return
+	 */
+	UserInfo userInfo(String account, String password);
+
+	/**
+	 * 给用户设置角色
+	 *
+	 * @param userIds
+	 * @param roleIds
+	 * @return
+	 */
+	boolean grant(String userIds, String roleIds);
+
+	/**
+	 * 初始化密码
+	 *
+	 * @param userIds
+	 * @return
+	 */
+	boolean resetPassword(String userIds);
+
+	/**
+	 * 获取角色名
+	 *
+	 * @param roleIds
+	 * @return
+	 */
+	List<String> getRoleName(String roleIds);
+
+	/**
+	 * 获取部门名
+	 *
+	 * @param deptIds
+	 * @return
+	 */
+	List<String> getDeptName(String deptIds);
+}

+ 48 - 0
src/main/java/org/springblade/modules/system/service/impl/DeptServiceImpl.java

@@ -0,0 +1,48 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springblade.modules.system.service.impl;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springblade.core.tool.node.ForestNodeMerger;
+import org.springblade.modules.system.entity.Dept;
+import org.springblade.modules.system.mapper.DeptMapper;
+import org.springblade.modules.system.service.IDeptService;
+import org.springblade.modules.system.vo.DeptVO;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 服务实现类
+ *
+ * @author Chill
+ * @since 2018-12-24
+ */
+@Service
+public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements IDeptService {
+
+	@Override
+	public IPage<DeptVO> selectDeptPage(IPage<DeptVO> page, DeptVO dept) {
+		return page.setRecords(baseMapper.selectDeptPage(page, dept));
+	}
+
+	@Override
+	public List<DeptVO> tree() {
+		return ForestNodeMerger.merge(baseMapper.tree());
+	}
+
+}

+ 67 - 0
src/main/java/org/springblade/modules/system/service/impl/DictServiceImpl.java

@@ -0,0 +1,67 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springblade.modules.system.service.impl;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springblade.core.tool.node.ForestNodeMerger;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.core.tool.utils.StringPool;
+import org.springblade.modules.system.entity.Dict;
+import org.springblade.modules.system.mapper.DictMapper;
+import org.springblade.modules.system.service.IDictService;
+import org.springblade.modules.system.vo.DictVO;
+import org.springframework.cache.annotation.Cacheable;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+import static org.springblade.common.cache.CacheNames.DICT_LIST;
+import static org.springblade.common.cache.CacheNames.DICT_VALUE;
+
+/**
+ * 服务实现类
+ *
+ * @author Chill
+ * @since 2018-12-24
+ */
+@Service
+public class DictServiceImpl extends ServiceImpl<DictMapper, Dict> implements IDictService {
+
+	@Override
+	public IPage<DictVO> selectDictPage(IPage<DictVO> page, DictVO dict) {
+		return page.setRecords(baseMapper.selectDictPage(page, dict));
+	}
+
+	@Override
+	public List<DictVO> tree() {
+		return ForestNodeMerger.merge(baseMapper.tree());
+	}
+
+	@Override
+	@Cacheable(cacheNames = DICT_VALUE, key = "#code+'_'+#dictKey")
+	public String getValue(String code, Integer dictKey) {
+		String value = Func.toStr(baseMapper.getValue(code, dictKey), StringPool.EMPTY);
+		return value;
+	}
+
+	@Override
+	@Cacheable(cacheNames = DICT_LIST, key = "#code")
+	public List<Dict> getList(String code) {
+		return baseMapper.getList(code);
+	}
+
+}

+ 33 - 0
src/main/java/org/springblade/modules/system/service/impl/LogApiServiceImpl.java

@@ -0,0 +1,33 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springblade.modules.system.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springblade.core.log.model.LogApi;
+import org.springblade.modules.system.mapper.LogApiMapper;
+import org.springblade.modules.system.service.ILogApiService;
+import org.springframework.stereotype.Service;
+
+/**
+ * 服务实现类
+ *
+ * @author Chill
+ */
+@Service
+public class LogApiServiceImpl extends ServiceImpl<LogApiMapper, LogApi> implements ILogApiService {
+
+
+}

+ 33 - 0
src/main/java/org/springblade/modules/system/service/impl/LogErrorServiceImpl.java

@@ -0,0 +1,33 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springblade.modules.system.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springblade.core.log.model.LogError;
+import org.springblade.modules.system.mapper.LogErrorMapper;
+import org.springblade.modules.system.service.ILogErrorService;
+import org.springframework.stereotype.Service;
+
+/**
+ * 服务实现类
+ *
+ * @author Chill
+ * @since 2018-09-26
+ */
+@Service
+public class LogErrorServiceImpl extends ServiceImpl<LogErrorMapper, LogError> implements ILogErrorService {
+
+}

+ 41 - 0
src/main/java/org/springblade/modules/system/service/impl/LogServiceImpl.java

@@ -0,0 +1,41 @@
+package org.springblade.modules.system.service.impl;
+
+import lombok.AllArgsConstructor;
+import org.springblade.core.log.model.LogApi;
+import org.springblade.core.log.model.LogError;
+import org.springblade.core.log.model.LogUsual;
+import org.springblade.modules.system.service.ILogApiService;
+import org.springblade.modules.system.service.ILogErrorService;
+import org.springblade.modules.system.service.ILogService;
+import org.springblade.modules.system.service.ILogUsualService;
+import org.springframework.stereotype.Service;
+
+/**
+ * Created by Blade.
+ *
+ * @author zhuangqian
+ */
+@Service
+@AllArgsConstructor
+public class LogServiceImpl implements ILogService {
+
+	ILogUsualService usualService;
+	ILogApiService apiService;
+	ILogErrorService errorService;
+
+	@Override
+	public Boolean saveUsualLog(LogUsual log) {
+		return usualService.save(log);
+	}
+
+	@Override
+	public Boolean saveApiLog(LogApi log) {
+		return apiService.save(log);
+	}
+
+	@Override
+	public Boolean saveErrorLog(LogError log) {
+		return errorService.save(log);
+	}
+
+}

+ 33 - 0
src/main/java/org/springblade/modules/system/service/impl/LogUsualServiceImpl.java

@@ -0,0 +1,33 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springblade.modules.system.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springblade.core.log.model.LogUsual;
+import org.springblade.modules.system.mapper.LogUsualMapper;
+import org.springblade.modules.system.service.ILogUsualService;
+import org.springframework.stereotype.Service;
+
+/**
+ * 服务实现类
+ *
+ * @author Chill
+ * @since 2018-10-12
+ */
+@Service
+public class LogUsualServiceImpl extends ServiceImpl<LogUsualMapper, LogUsual> implements ILogUsualService {
+
+}

+ 105 - 0
src/main/java/org/springblade/modules/system/service/impl/MenuServiceImpl.java

@@ -0,0 +1,105 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springblade.modules.system.service.impl;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import lombok.AllArgsConstructor;
+import org.springblade.core.tool.node.ForestNodeMerger;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.modules.system.dto.MenuDTO;
+import org.springblade.modules.system.entity.Menu;
+import org.springblade.modules.system.entity.RoleMenu;
+import org.springblade.modules.system.mapper.MenuMapper;
+import org.springblade.modules.system.service.IMenuService;
+import org.springblade.modules.system.service.IRoleMenuService;
+import org.springblade.modules.system.vo.MenuVO;
+import org.springblade.modules.system.wrapper.MenuWrapper;
+import org.springframework.stereotype.Service;
+
+import java.util.Comparator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Optional;
+import java.util.stream.Collectors;
+
+/**
+ * 服务实现类
+ *
+ * @author Chill
+ * @since 2018-12-24
+ */
+@Service
+@AllArgsConstructor
+public class MenuServiceImpl extends ServiceImpl<MenuMapper, Menu> implements IMenuService {
+
+	IRoleMenuService roleMenuService;
+
+	@Override
+	public IPage<MenuVO> selectMenuPage(IPage<MenuVO> page, MenuVO menu) {
+		return page.setRecords(baseMapper.selectMenuPage(page, menu));
+	}
+
+	@Override
+	public List<MenuVO> routes(String roleId) {
+		List<Menu> allMenus = baseMapper.allMenu();
+		List<Menu> roleMenus = baseMapper.roleMenu(Func.toIntList(roleId));
+		List<Menu> routes = new LinkedList<>(roleMenus);
+		roleMenus.forEach(roleMenu -> recursion(allMenus, routes, roleMenu));
+		routes.sort(Comparator.comparing(Menu::getSort));
+		MenuWrapper menuWrapper = new MenuWrapper();
+		List<Menu> collect = routes.stream().filter(x -> Func.equals(x.getCategory(), 1)).collect(Collectors.toList());
+		return menuWrapper.listNodeVO(collect);
+	}
+
+	public void recursion(List<Menu> allMenus, List<Menu> routes, Menu roleMenu) {
+		Optional<Menu> menu = allMenus.stream().filter(x -> Func.equals(x.getId(), roleMenu.getParentId())).findFirst();
+		if (menu.isPresent() && !routes.contains(menu.get())) {
+			routes.add(menu.get());
+			recursion(allMenus, routes, menu.get());
+		}
+	}
+
+	@Override
+	public List<MenuVO> buttons(String roleId) {
+		List<Menu> buttons = baseMapper.buttons(Func.toIntList(roleId));
+		MenuWrapper menuWrapper = new MenuWrapper();
+		return menuWrapper.listNodeVO(buttons);
+	}
+
+	@Override
+	public List<MenuVO> tree() {
+		return ForestNodeMerger.merge(baseMapper.tree());
+	}
+
+	@Override
+	public List<MenuVO> grantTree() {
+		return ForestNodeMerger.merge(baseMapper.grantTree());
+	}
+
+	@Override
+	public List<String> roleTreeKeys(String roleIds) {
+		List<RoleMenu> roleMenus = roleMenuService.list(Wrappers.<RoleMenu>query().lambda().in(RoleMenu::getRoleId, Func.toIntList(roleIds)));
+		return roleMenus.stream().map(roleMenu -> Func.toStr(roleMenu.getMenuId())).collect(Collectors.toList());
+	}
+
+	@Override
+	public List<MenuDTO> authRoutes(List<Integer> roleIds) {
+		return baseMapper.authRoutes(roleIds);
+	}
+
+}

+ 40 - 0
src/main/java/org/springblade/modules/system/service/impl/ParamServiceImpl.java

@@ -0,0 +1,40 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springblade.modules.system.service.impl;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springblade.modules.system.entity.Param;
+import org.springblade.modules.system.mapper.ParamMapper;
+import org.springblade.modules.system.service.IParamService;
+import org.springblade.modules.system.vo.ParamVO;
+import org.springframework.stereotype.Service;
+
+/**
+ * 服务实现类
+ *
+ * @author Chill
+ * @since 2018-12-28
+ */
+@Service
+public class ParamServiceImpl extends BaseServiceImpl<ParamMapper, Param> implements IParamService {
+
+	@Override
+	public IPage<ParamVO> selectParamPage(IPage<ParamVO> page, ParamVO param) {
+		return page.setRecords(baseMapper.selectParamPage(page, param));
+	}
+
+}

+ 33 - 0
src/main/java/org/springblade/modules/system/service/impl/RoleMenuServiceImpl.java

@@ -0,0 +1,33 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springblade.modules.system.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springblade.modules.system.entity.RoleMenu;
+import org.springblade.modules.system.mapper.RoleMenuMapper;
+import org.springblade.modules.system.service.IRoleMenuService;
+import org.springframework.stereotype.Service;
+
+/**
+ * 服务实现类
+ *
+ * @author Chill
+ * @since 2018-12-24
+ */
+@Service
+public class RoleMenuServiceImpl extends ServiceImpl<RoleMenuMapper, RoleMenu> implements IRoleMenuService {
+
+}

Certains fichiers n'ont pas été affichés car il y a eu trop de fichiers modifiés dans ce diff