MrBird il y a 6 ans
Parent
commit
21a649af97
100 fichiers modifiés avec 4279 ajouts et 3360 suppressions
  1. BIN
      .DS_Store
  2. 3 1
      .gitignore
  3. 52 56
      Readme.md
  4. BIN
      febs-apm/.DS_Store
  5. BIN
      febs-apm/febs-admin/.DS_Store
  6. 7 0
      febs-apm/febs-admin/Dockerfile
  7. 8 8
      febs-apm/febs-admin/pom.xml
  8. 4 0
      febs-apm/febs-admin/run.sh
  9. 2 2
      febs-apm/febs-admin/src/main/java/cc/mrbird/febs/monitor/admin/FebsAdminApplication.java
  10. 40 40
      febs-apm/febs-admin/src/main/java/cc/mrbird/febs/monitor/admin/configure/FebsSecurityConfigure.java
  11. 14 14
      febs-apm/febs-admin/src/main/java/cc/mrbird/febs/monitor/admin/runner/StartedUpRunner.java
  12. 8 0
      febs-apm/febs-admin/src/main/resources/banner.txt
  13. 2 2
      febs-apm/febs-admin/src/main/resources/bootstrap.yml
  14. 54 0
      febs-apm/febs-admin/src/main/resources/logback-spring.xml
  15. 6 6
      febs-apm/pom.xml
  16. 21 21
      febs-apm/prometheus-grafana/alertmanager.yml
  17. 53 53
      febs-apm/prometheus-grafana/docker-compose.yml
  18. 10 10
      febs-apm/prometheus-grafana/memory_over.yml
  19. 108 0
      febs-apm/prometheus-grafana/more_rules.yml
  20. 70 56
      febs-apm/prometheus-grafana/prometheus.yml
  21. 10 10
      febs-apm/prometheus-grafana/server_down.yml
  22. 70 70
      febs-apm/skywalking-elk/docker-compose.yml
  23. 6 6
      febs-apm/skywalking-elk/elasticsearch.yml
  24. 110 110
      febs-apm/skywalking-elk/skywalking_application.yml
  25. BIN
      febs-auth/.DS_Store
  26. 2 2
      febs-auth/Dockerfile
  27. 21 17
      febs-auth/pom.xml
  28. 22 27
      febs-auth/src/main/java/cc/mrbird/febs/auth/FebsAuthApplication.java
  29. 114 114
      febs-auth/src/main/java/cc/mrbird/febs/auth/configure/FebsAuthorizationServerConfigure.java
  30. 0 47
      febs-auth/src/main/java/cc/mrbird/febs/auth/configure/FebsResourceServerConfigure.java
  31. 53 53
      febs-auth/src/main/java/cc/mrbird/febs/auth/configure/FebsSecurityConfigure.java
  32. 89 89
      febs-auth/src/main/java/cc/mrbird/febs/auth/controller/OauthClientDetailsController.java
  33. 34 34
      febs-auth/src/main/java/cc/mrbird/febs/auth/controller/SecurityController.java
  34. 149 149
      febs-auth/src/main/java/cc/mrbird/febs/auth/controller/SocialLoginController.java
  35. 20 20
      febs-auth/src/main/java/cc/mrbird/febs/auth/entity/BindUser.java
  36. 67 66
      febs-auth/src/main/java/cc/mrbird/febs/auth/entity/OauthClientDetails.java
  37. 44 44
      febs-auth/src/main/java/cc/mrbird/febs/auth/entity/UserConnection.java
  38. 67 86
      febs-auth/src/main/java/cc/mrbird/febs/auth/filter/ValidateCodeFilter.java
  39. 1 1
      febs-auth/src/main/java/cc/mrbird/febs/auth/handler/GlobalExceptionHandler.java
  40. 86 80
      febs-auth/src/main/java/cc/mrbird/febs/auth/manager/UserManager.java
  41. 19 19
      febs-auth/src/main/java/cc/mrbird/febs/auth/mapper/MenuMapper.java
  42. 10 10
      febs-auth/src/main/java/cc/mrbird/febs/auth/mapper/OauthClientDetailsMapper.java
  43. 12 1
      febs-auth/src/main/java/cc/mrbird/febs/auth/mapper/UserMapper.java
  44. 1 1
      febs-auth/src/main/java/cc/mrbird/febs/auth/mapper/UserRoleMapper.java
  45. 33 38
      febs-auth/src/main/java/cc/mrbird/febs/auth/properties/FebsAuthProperties.java
  46. 1 1
      febs-auth/src/main/java/cc/mrbird/febs/auth/properties/FebsValidateCodeProperties.java
  47. 27 37
      febs-auth/src/main/java/cc/mrbird/febs/auth/runner/StartedUpRunner.java
  48. 52 52
      febs-auth/src/main/java/cc/mrbird/febs/auth/service/OauthClientDetailsService.java
  49. 93 93
      febs-auth/src/main/java/cc/mrbird/febs/auth/service/SocialLoginService.java
  50. 31 29
      febs-auth/src/main/java/cc/mrbird/febs/auth/service/ValidateCodeService.java
  51. 5 5
      febs-auth/src/main/java/cc/mrbird/febs/auth/service/impl/FebsUserDetailServiceImpl.java
  52. 107 107
      febs-auth/src/main/java/cc/mrbird/febs/auth/service/impl/OauthClientDetailsServiceImpl.java
  53. 87 87
      febs-auth/src/main/java/cc/mrbird/febs/auth/service/impl/RedisClientDetailsService.java
  54. 211 211
      febs-auth/src/main/java/cc/mrbird/febs/auth/service/impl/SocialLoginServiceImpl.java
  55. 51 51
      febs-auth/src/main/java/cc/mrbird/febs/auth/service/impl/UserConnectionServiceImpl.java
  56. 85 85
      febs-auth/src/main/java/cc/mrbird/febs/auth/service/impl/ValidateCodeServiceImpl.java
  57. 58 57
      febs-auth/src/main/java/cc/mrbird/febs/auth/translator/FebsWebResponseExceptionTranslator.java
  58. 7 2
      febs-auth/src/main/resources/bootstrap.yml
  59. 0 1
      febs-auth/src/main/resources/febs-auth.properties
  60. 5 5
      febs-auth/src/main/resources/logback-spring.xml
  61. 5 0
      febs-auth/src/main/resources/mapper/UserMapper.xml
  62. BIN
      febs-cloud/.txlcn/FEBS-Server-System-8201.mv.db
  63. 139 105
      febs-cloud/docker compose/febs-cloud/docker-compose.yml
  64. 1 10
      febs-cloud/docker compose/third-part/docker-compose.yml
  65. 36 3
      febs-cloud/pom.xml
  66. 196 0
      febs-cloud/postman/FEBS-Cloud.postman_collection.json
  67. 1 0
      febs-cloud/postman/Readme.md
  68. 675 506
      febs-cloud/sql/febs_cloud_base.sql
  69. 158 0
      febs-cloud/sql/febs_cloud_job.sql
  70. 24 24
      febs-cloud/sql/febs_nacos.sql
  71. BIN
      febs-common/.DS_Store
  72. BIN
      febs-common/febs-common-core/.DS_Store
  73. 104 0
      febs-common/febs-common-core/pom.xml
  74. BIN
      febs-common/febs-common-core/src/main/java/cc/mrbird/febs/common/core/.DS_Store
  75. 1 1
      febs-common/febs-common-core/src/main/java/cc/mrbird/febs/common/core/annotation/Fallback.java
  76. 1 1
      febs-common/febs-common-core/src/main/java/cc/mrbird/febs/common/core/annotation/Helper.java
  77. 3 2
      febs-common/febs-common-core/src/main/java/cc/mrbird/febs/common/core/annotation/IsMobile.java
  78. 2 2
      febs-common/febs-common-core/src/main/java/cc/mrbird/febs/common/core/converter/TimeConverter.java
  79. 46 45
      febs-common/febs-common-core/src/main/java/cc/mrbird/febs/common/core/entity/CurrentUser.java
  80. 15 15
      febs-common/febs-common-core/src/main/java/cc/mrbird/febs/common/core/entity/DeptTree.java
  81. 54 51
      febs-common/febs-common-core/src/main/java/cc/mrbird/febs/common/core/entity/FebsAuthUser.java
  82. 1 1
      febs-common/febs-common-core/src/main/java/cc/mrbird/febs/common/core/entity/FebsResponse.java
  83. 21 20
      febs-common/febs-common-core/src/main/java/cc/mrbird/febs/common/core/entity/MenuTree.java
  84. 32 32
      febs-common/febs-common-core/src/main/java/cc/mrbird/febs/common/core/entity/QueryRequest.java
  85. 32 32
      febs-common/febs-common-core/src/main/java/cc/mrbird/febs/common/core/entity/Tree.java
  86. 85 85
      febs-common/febs-common-core/src/main/java/cc/mrbird/febs/common/core/entity/auth/OauthCliendetails.java
  87. 27 25
      febs-common/febs-common-core/src/main/java/cc/mrbird/febs/common/core/entity/constant/EndpointConstant.java
  88. 67 63
      febs-common/febs-common-core/src/main/java/cc/mrbird/febs/common/core/entity/constant/FebsConstant.java
  89. 24 0
      febs-common/febs-common-core/src/main/java/cc/mrbird/febs/common/core/entity/constant/FebsServerConstant.java
  90. 1 5
      febs-common/febs-common-core/src/main/java/cc/mrbird/febs/common/core/entity/constant/GeneratorConstant.java
  91. 30 30
      febs-common/febs-common-core/src/main/java/cc/mrbird/febs/common/core/entity/constant/GrantTypeConstant.java
  92. 18 18
      febs-common/febs-common-core/src/main/java/cc/mrbird/febs/common/core/entity/constant/ImageTypeConstant.java
  93. 12 12
      febs-common/febs-common-core/src/main/java/cc/mrbird/febs/common/core/entity/constant/PageConstant.java
  94. 27 27
      febs-common/febs-common-core/src/main/java/cc/mrbird/febs/common/core/entity/constant/ParamsConstant.java
  95. 1 1
      febs-common/febs-common-core/src/main/java/cc/mrbird/febs/common/core/entity/constant/RegexpConstant.java
  96. 10 10
      febs-common/febs-common-core/src/main/java/cc/mrbird/febs/common/core/entity/constant/SocialConstant.java
  97. 1 1
      febs-common/febs-common-core/src/main/java/cc/mrbird/febs/common/core/entity/router/RouterMeta.java
  98. 46 46
      febs-common/febs-common-core/src/main/java/cc/mrbird/febs/common/core/entity/router/VueRouter.java
  99. 1 1
      febs-common/febs-common-core/src/main/java/cc/mrbird/febs/common/core/entity/system/Column.java
  100. 60 0
      febs-common/febs-common-core/src/main/java/cc/mrbird/febs/common/core/entity/system/DataPermissionTest.java

BIN
.DS_Store


+ 3 - 1
.gitignore

@@ -2,4 +2,6 @@
 **/**/target/
 **/.idea/
 **/log/
-**/*.iml
+**/*.iml
+**/.txlcn/
+**/spy.log

+ 52 - 56
Readme.md

@@ -7,47 +7,30 @@
 
 FEBS Cloud是一款使用Spring Cloud Hoxton.RELEASE、Spring Cloud OAuth2 & Spring Cloud Alibaba构建的低耦合权限管理系统,前端(FEBS Cloud Web)采用vue element admin构建。FEBS意指:**F**ast,**E**asy use,**B**eautiful和**S**afe。该系统具有如下特点:
 
-1. 前后端分离架构,客户端和服务端纯Token交互;
- 
-2. 认证服务器与资源服务器分离,方便接入自己的微服务系统;
-
-3. 微服务防护,客户端请求资源只能通过微服务网关获取;
-
-4. 集成Prometheus,SpringBootAdmin,多维度监控微服务;
-
-5. 集成Spring Cloud Alibaba Nacos服务治理和集中配置管理;
-
-6. 网关限流,网关黑名单限制,网关日志(WebFlux编程实践);
-
-7. ~~集成Zipkin,方便跟踪Feign调用链~~,集成Skywalking APM;
-
-8. 集成ELK,集中管理日志,便于问题分析;
-
-9. 微服务Docker化,使用Docker Compose一键部署;
-
-10. 支持Kubernetes集群部署;
-
-11. 提供详细的使用文档和搭建教程;
-
-12. 前后端请求参数校验,Excel导入导出,代码生成等。
+序号 | 特点
+---|---
+1 | 前后端分离架构,客户端和服务端纯Token交互; 
+2 | 认证服务器与资源服务器分离,方便接入自己的微服务系统
+3 | 集成Prometheus,SpringBootAdmin,Skywalking APM
+4 | 网关限流,网关黑名单限制,网关日志(WebFlux编程实践)
+5 | 微服务Docker化,使用Docker Compose一键部署,K8S集群
+6 | 社交登录,认证授权,数据权限,前后端参数校验,Starter开箱即用等
+7 | Doc Starter,几行配置自动生成系统api接口文档
+8 | 提供详细的导入教程、使用教程和开发教程,对于想深入了解的用户还提供了搭建教程
 
 ### 文档与教程
 
-项目导入及使用文档:[https://www.kancloud.cn/mrbird/spring-cloud/1263681](https://www.kancloud.cn/mrbird/spring-cloud/1263681)
+> 在这浮躁的社会里,还请您耐心阅读文档,99%的问题在文档中都能找到答案。
 
-项目从零搭建到部署教程:[https://www.kancloud.cn/mrbird/spring-cloud/1263685](https://www.kancloud.cn/mrbird/spring-cloud/1263685)。
+文档 | 地址
+---|---
 
-Kubernetes集群部署脚本:[https://github.com/wuyouzhuguli/FEBS-Cloud-K8S](https://github.com/wuyouzhuguli/FEBS-Cloud-K8S)。
-
-分布式事务方案(RocketMQ、TX-LCN、Seata):[https://www.kancloud.cn/mrbird/spring-cloud/1456142](https://www.kancloud.cn/mrbird/spring-cloud/1456142)。
-
-### 常见问题
-
-[https://mrbird.cc/FEBS-Cloud常见问题汇总.html](https://mrbird.cc/FEBS-Cloud常见问题汇总.html)
-
-### 更新日志
-
-[https://www.kancloud.cn/mrbird/spring-cloud/1292659](https://www.kancloud.cn/mrbird/spring-cloud/1292659)
+项目导入教程 | [https://www.kancloud.cn/mrbird/spring-cloud/1647283](https://www.kancloud.cn/mrbird/spring-cloud/1647283)
+管理页面使用教程 | [https://www.kancloud.cn/mrbird/spring-cloud/1647284](https://www.kancloud.cn/mrbird/spring-cloud/1647284)
+二次开发教程 | [https://www.kancloud.cn/mrbird/spring-cloud/1265030](https://www.kancloud.cn/mrbird/spring-cloud/1265030)
+项目从零搭建教程 | [https://www.kancloud.cn/mrbird/spring-cloud/1263685](https://www.kancloud.cn/mrbird/spring-cloud/1263685)
+系统常见问题解答 | [https://mrbird.cc/FEBS-Cloud常见问题汇总.html](https://mrbird.cc/FEBS-Cloud常见问题汇总.html)
+系统更新日志 | [https://www.kancloud.cn/mrbird/spring-cloud/1292659](https://www.kancloud.cn/mrbird/spring-cloud/1292659)
 
 ### 系统架构
 
@@ -110,6 +93,14 @@ jane | 1234qwer |系统监测员,负责整个系统监控模块
 Jack | 123456 |网关管理模块查看权限
 admin | 123456 |网关管理模块所有权限
 
+APM平台相关账号密码:
+
+平台 | 账号| 密码
+---|---|---
+febs-admin | febs |123456
+febs-tx-manager | 无 | 123456
+Grafana | febs | 123456
+
 ### 服务模块
 
 FEBS模块:
@@ -117,19 +108,20 @@ FEBS模块:
 服务名称 | 端口 | 描述
 ---|---|---
 FEBS-Auth| 8101| 微服务认证服务器 
-FEBS-Server-System| 8201 | 微服务子系统(资源服务器)
-FEBS-Server-Test|8202 | 微服务子系统(资源服务器)
+FEBS-Server-System| 8201 | 微服务子系统,系统核心模块
+FEBS-Server-Test|8202 | 微服务子系统,Demo模块
+FEBS-Server-Generator|8203 | 微服务子系统,代码生成模块
+FEBS-Server-Job|8203 | 微服务子系统,任务调度模块
 FEBS-Gateway|8301|微服务网关
-FEBS-Monitor-Admin|8401|微服务监控子系统
+FEBS-Admin|8401|微服务监控子系统
+FEBS-Tx-Manager|8501|微服务分布式事务控制器
 
 第三方模块:
 
 服务名称 | 端口 | 描述
 ---|---|---
 Nacos| 8001 |注册中心,配置中心 
-Zipkin-Server|8402|Zipkin服务器
 MySQL| 3306 |MySQL 数据库 
-RabbitMQ|5672|RabbitMQ 消息中间件 
 Redis| 6379 | K-V 缓存数据库 
 Elasticsearch|9200 | 日志存储
 Logstash|4560|日志收集
@@ -139,24 +131,30 @@ Skywalking|11800、12800、8080|Skywalking APM
 
 ### 目录结构
 ```
+├─febs-apm                        ------ 微服务APM模块
+│  ├─febs-admin                   ------ 微服务监控中心
+│  ├─prometheus-grafana           ------ prometheus grafana apm相关配置,docker文件
+│  └─skywalking-elk               ------ skywalking elk相关配置,docker文件
 ├─febs-auth                       ------ 微服务认证服务器
 ├─febs-cloud                      ------ 整个项目的父模块
 │  ├─sql                          ------ SQL脚本
-│  ├─config                       ------ 第三方应用配置
-│  └─docker compose               ------ 存放docker compose文件
-│      ├─elk                      ------ ELK docker compose文件
-│      ├─febs-cloud               ------ 聚合所有微服务子项目的docker compose文件
-│      ├─prometheus               ------ Prometheus docker compose文件
-│      ├─skywalking               ------ Skywalking docker compose文件
-│      └─third-part               ------ 第三方服务(MySQL,Redis等)docker compose文件
+│  ├─postman                      ------ postman脚本
+│  └─docker compose               ------ 项目相关docker compose文件
 ├─febs-common                     ------ 通用模块
+│  ├─febs-common-core                   ------ 系统核心依赖包
+│  ├─febs-common-datasource-starter     ------ 系统数据库自动装配starter
+│  ├─febs-common-doc                    ------ 文档模块的核心依赖包
+│  ├─febs-common-doc-gateway-starter    ------ 网关聚合微服务子系统api文档自动装配starter
+│  ├─febs-common-doc-starter            ------ 微服务子系统api文档自动装配starter
+│  ├─febs-common-redis-starter          ------ 系统Redis自动装配starter
+│  └─febs-common-security-starter       ------ 微服务子系统安全配置自动装配starter
 ├─febs-gateway                    ------ 微服务网关
-├─febs-monitor                    ------ 微服务监控父模块
-│  ├─febs-monitor-admin           ------ 微服务监控中心
-│  └─zipkin-server                ------ zipkin 服务
-└─febs-server                     ------ 资源服务器
-   ├─febs-server-system           ------ 资源服务器系统模块
-   └─febs-server-test             ------ 资源服务器demo,演示如何整合自己的微服务系统
+├─febs-server                     ------ 微服务子系统
+│  ├─ebs-server-system            ------ 微服务子系统系统核心模块
+│  ├─febs-server-test             ------ 微服务子系统demo模块
+│  ├─febs-server-generator        ------ 微服务子系统代码生成模块
+│  └─febs-server-job              ------ 微服务子系统任务调度模块
+└─febs-server                     ------ 微服务分布式事务控制器
 ```
 ### 系统截图
 
@@ -182,8 +180,6 @@ Skywalking|11800、12800、8080|Skywalking APM
 
 #### [Prometheus APM](http://cloud.mrbird.cn:8404)
 
-Grafana账号密码:febs,123456
-
 <table>
   <tr>
      <td width="100%" align="center"><b>JVM监控</b></td>

BIN
febs-apm/.DS_Store


BIN
febs-apm/febs-admin/.DS_Store


+ 7 - 0
febs-apm/febs-admin/Dockerfile

@@ -0,0 +1,7 @@
+FROM openjdk:8u212-jre
+MAINTAINER MrBird 852252810@qq.com
+
+COPY ./target/febs-server-generator-2.0-RELEASE.jar /febs/febs-server-generator-2.0-RELEASE.jar
+ADD agent/ /agent
+
+ENTRYPOINT ["java", "-javaagent:/agent/skywalking-agent.jar", "-Dskywalking.agent.service_name=febs-server-generator", "-Dskywalking.collector.backend_service=skywalkingIp:11800", "-jar", "/febs/febs-server-generator-2.0-RELEASE.jar"]

+ 8 - 8
febs-monitor/febs-monitor-admin/pom.xml → febs-apm/febs-admin/pom.xml

@@ -4,15 +4,15 @@
     <modelVersion>4.0.0</modelVersion>
     <parent>
         <groupId>cc.mrbird</groupId>
-        <artifactId>febs-monitor</artifactId>
-        <version>1.6-RELEASE</version>
+        <artifactId>febs-apm</artifactId>
+        <version>2.0-RELEASE</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 
-    <artifactId>febs-monitor-admin</artifactId>
-    <version>1.6-RELEASE</version>
-    <name>Febs-Monitor-Admin</name>
-    <description>Febs-Monitor-Admin基于Spring Boot Admin搭建的监控程序</description>
+    <artifactId>febs-admin</artifactId>
+    <version>2.0-RELEASE</version>
+    <name>FEBS-Admin</name>
+    <description>Febs-Admin基于Spring Boot Admin搭建的监控程序</description>
 
     <dependencies>
         <dependency>
@@ -36,12 +36,12 @@
         <dependency>
             <groupId>de.codecentric</groupId>
             <artifactId>spring-boot-admin-server</artifactId>
-            <version>2.2.0</version>
+            <version>${spring-boot-admin.version}</version>
         </dependency>
         <dependency>
             <groupId>de.codecentric</groupId>
             <artifactId>spring-boot-admin-server-ui</artifactId>
-            <version>2.2.0</version>
+            <version>${spring-boot-admin.version}</version>
         </dependency>
         <dependency>
             <groupId>com.alibaba.cloud</groupId>

+ 4 - 0
febs-apm/febs-admin/run.sh

@@ -0,0 +1,4 @@
+#!/usr/bin/env bash
+mvn package
+
+docker build -t febs-admin .

+ 2 - 2
febs-monitor/febs-monitor-admin/src/main/java/cc/mrbird/febs/monitor/admin/FebsMonitorAdminApplication.java → febs-apm/febs-admin/src/main/java/cc/mrbird/febs/monitor/admin/FebsAdminApplication.java

@@ -9,10 +9,10 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
  */
 @EnableAdminServer
 @SpringBootApplication
-public class FebsMonitorAdminApplication {
+public class FebsAdminApplication {
 
     public static void main(String[] args) {
-        SpringApplication.run(FebsMonitorAdminApplication.class, args);
+        SpringApplication.run(FebsAdminApplication.class, args);
     }
 
 }

+ 40 - 40
febs-monitor/febs-monitor-admin/src/main/java/cc/mrbird/febs/monitor/admin/configure/FebsSecurityConfigure.java → febs-apm/febs-admin/src/main/java/cc/mrbird/febs/monitor/admin/configure/FebsSecurityConfigure.java

@@ -1,40 +1,40 @@
-package cc.mrbird.febs.monitor.admin.configure;
-
-import de.codecentric.boot.admin.server.config.AdminServerProperties;
-import org.springframework.security.config.annotation.web.builders.HttpSecurity;
-import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
-import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
-import org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler;
-
-/**
- * WebSecurity配置
- *
- * @author MrBird
- */
-@EnableWebSecurity
-public class FebsSecurityConfigure extends WebSecurityConfigurerAdapter {
-
-    private final String adminContextPath;
-
-    public FebsSecurityConfigure(AdminServerProperties adminServerProperties) {
-        this.adminContextPath = adminServerProperties.getContextPath();
-    }
-
-    @Override
-    protected void configure(HttpSecurity http) throws Exception {
-        SavedRequestAwareAuthenticationSuccessHandler successHandler = new SavedRequestAwareAuthenticationSuccessHandler();
-        successHandler.setTargetUrlParameter("redirectTo");
-
-        http.headers().frameOptions().disable()
-                .and()
-                .authorizeRequests()
-                .antMatchers(adminContextPath + "/assets/**").permitAll()
-                .antMatchers(adminContextPath + "/login").permitAll()
-                .anyRequest().authenticated()
-                .and()
-                .formLogin().loginPage(adminContextPath + "/login").successHandler(successHandler).and()
-                .logout().logoutUrl(adminContextPath + "/logout").and()
-                .httpBasic().and()
-                .csrf().disable();
-    }
-}
+package cc.mrbird.febs.monitor.admin.configure;
+
+import de.codecentric.boot.admin.server.config.AdminServerProperties;
+import org.springframework.security.config.annotation.web.builders.HttpSecurity;
+import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
+import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
+import org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler;
+
+/**
+ * WebSecurity配置
+ *
+ * @author MrBird
+ */
+@EnableWebSecurity
+public class FebsSecurityConfigure extends WebSecurityConfigurerAdapter {
+
+    private final String adminContextPath;
+
+    public FebsSecurityConfigure(AdminServerProperties adminServerProperties) {
+        this.adminContextPath = adminServerProperties.getContextPath();
+    }
+
+    @Override
+    protected void configure(HttpSecurity http) throws Exception {
+        SavedRequestAwareAuthenticationSuccessHandler successHandler = new SavedRequestAwareAuthenticationSuccessHandler();
+        successHandler.setTargetUrlParameter("redirectTo");
+
+        http.headers().frameOptions().disable()
+                .and()
+                .authorizeRequests()
+                .antMatchers(adminContextPath + "/assets/**").permitAll()
+                .antMatchers(adminContextPath + "/login").permitAll()
+                .anyRequest().authenticated()
+                .and()
+                .formLogin().loginPage(adminContextPath + "/login").successHandler(successHandler).and()
+                .logout().logoutUrl(adminContextPath + "/logout").and()
+                .httpBasic().and()
+                .csrf().disable();
+    }
+}

+ 14 - 14
febs-monitor/febs-monitor-admin/src/main/java/cc/mrbird/febs/monitor/admin/runner/StartedUpRunner.java → febs-apm/febs-admin/src/main/java/cc/mrbird/febs/monitor/admin/runner/StartedUpRunner.java

@@ -1,12 +1,10 @@
 package cc.mrbird.febs.monitor.admin.runner;
 
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
 import org.springframework.boot.ApplicationArguments;
 import org.springframework.boot.ApplicationRunner;
 import org.springframework.context.ConfigurableApplicationContext;
+import org.springframework.core.env.Environment;
 import org.springframework.stereotype.Component;
 
 import java.time.LocalDateTime;
@@ -17,26 +15,28 @@ import java.time.LocalDateTime;
 @Component
 public class StartedUpRunner implements ApplicationRunner {
 
-    private Logger log = LoggerFactory.getLogger(this.getClass());
-
     private final ConfigurableApplicationContext context;
-
-    @Value("${spring.application.name:'FEBS-Monitor-Admin'}")
-    private String applicationName;
+    private final Environment environment;
 
     @Autowired
-    public StartedUpRunner(ConfigurableApplicationContext context) {
+    public StartedUpRunner(ConfigurableApplicationContext context, Environment environment) {
         this.context = context;
+        this.environment = environment;
     }
 
     @Override
     public void run(ApplicationArguments args) {
         if (context.isActive()) {
-            log.info("  _   _   _   _   _   _   _   _");
-            log.info(" / \\ / \\ / \\ / \\ / \\ / \\ / \\ / \\");
-            log.info("( c | o | m | p | l | e | t | e )");
-            log.info(" \\_/ \\_/ \\_/ \\_/ \\_/ \\_/ \\_/ \\_/");
-            log.info("{} 启动完毕,时间:{}", applicationName, LocalDateTime.now());
+            printSystemUpBanner(environment);
         }
     }
+
+    private static void printSystemUpBanner(Environment environment) {
+        String banner = "-----------------------------------------\n" +
+                "服务启动成功,时间:" + LocalDateTime.now() + "\n" +
+                "服务名称:" + environment.getProperty("spring.application.name") + "\n" +
+                "端口号:" + environment.getProperty("server.port") + "\n" +
+                "-----------------------------------------";
+        System.out.println(banner);
+    }
 }

+ 8 - 0
febs-apm/febs-admin/src/main/resources/banner.txt

@@ -0,0 +1,8 @@
+|------------------------------|
+|    ____  ____  ___   __      |
+|   | |_  | |_  | |_) ( (`     |
+|   |_|   |_|__ |_|_) _)_)     |
+|                              |
+|   ${spring.application.name}                 |
+|   Spring-Boot: ${spring-boot.version} |
+|------------------------------|

+ 2 - 2
febs-monitor/febs-monitor-admin/src/main/resources/bootstrap.yml → febs-apm/febs-admin/src/main/resources/bootstrap.yml

@@ -1,12 +1,12 @@
 spring:
   application:
-    name: FEBS-Monitor-Admin
+    name: FEBS-Admin
   cloud:
     nacos:
       config:
         server-addr: ${nacos.url}:8001
         group: DEFAULT_GROUP
-        prefix: febs-monitor-admin
+        prefix: febs-admin
         file-extension: yaml
 
 logging:

+ 54 - 0
febs-apm/febs-admin/src/main/resources/logback-spring.xml

@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration scan="true" scanPeriod="60 seconds" debug="false">
+    <springProperty scope="context" name="springAppName" source="spring.application.name"/>
+    <property name="log.path" value="log/febs-admin"/>
+    <property name="log.maxHistory" value="15"/>
+    <property name="log.colorPattern" value="%magenta(%d{yyyy-MM-dd HH:mm:ss}) %highlight(%-5level) %boldCyan(${springAppName:-}) %yellow(%thread) %green(%logger) %msg%n"/>
+    <property name="log.pattern" value="%d{yyyy-MM-dd HH:mm:ss} %-5level ${springAppName:-} %thread %logger %msg%n"/>
+
+    <!--输出到控制台-->
+    <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
+        <encoder>
+            <pattern>${log.colorPattern}</pattern>
+        </encoder>
+    </appender>
+
+    <!--输出到文件-->
+    <appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+            <fileNamePattern>${log.path}/info/info.%d{yyyy-MM-dd}.log</fileNamePattern>
+            <MaxHistory>${log.maxHistory}</MaxHistory>
+        </rollingPolicy>
+        <encoder>
+            <pattern>${log.pattern}</pattern>
+        </encoder>
+        <filter class="ch.qos.logback.classic.filter.LevelFilter">
+            <level>INFO</level>
+            <onMatch>ACCEPT</onMatch>
+            <onMismatch>DENY</onMismatch>
+        </filter>
+    </appender>
+
+    <appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+            <fileNamePattern>${log.path}/error/error.%d{yyyy-MM-dd}.log</fileNamePattern>
+        </rollingPolicy>
+        <encoder>
+            <pattern>${log.pattern}</pattern>
+        </encoder>
+        <filter class="ch.qos.logback.classic.filter.LevelFilter">
+            <level>ERROR</level>
+            <onMatch>ACCEPT</onMatch>
+            <onMismatch>DENY</onMismatch>
+        </filter>
+    </appender>
+
+    <root level="debug">
+        <appender-ref ref="console" />
+    </root>
+
+    <root level="info">
+        <appender-ref ref="file_info" />
+        <appender-ref ref="file_error" />
+    </root>
+</configuration>

+ 6 - 6
febs-monitor/pom.xml → febs-apm/pom.xml

@@ -5,18 +5,18 @@
     <parent>
         <artifactId>febs-cloud</artifactId>
         <groupId>cc.mrbird</groupId>
-        <version>1.6-RELEASE</version>
+        <version>2.0-RELEASE</version>
         <relativePath>../febs-cloud/pom.xml</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>
 
-    <artifactId>febs-monitor</artifactId>
-    <version>1.6-RELEASE</version>
+    <artifactId>febs-apm</artifactId>
+    <version>2.0-RELEASE</version>
     <packaging>pom</packaging>
-    <name>FEBS-Monitor</name>
-    <description>FEBS-Monitor监控模块</description>
+    <name>FEBS-APM</name>
+    <description>FEBS-APM(Application Performance Monitor)</description>
 
     <modules>
-        <module>febs-monitor-admin</module>
+        <module>febs-admin</module>
     </modules>
 </project>

+ 21 - 21
febs-cloud/config/alertmanager.yml → febs-apm/prometheus-grafana/alertmanager.yml

@@ -1,22 +1,22 @@
-global:
-  smtp_smarthost: 'smtp.126.com:465'
-  smtp_from: 'wuyouzhuguli@126.com'
-  smtp_auth_username: 'wuyouzhuguli'
-  smtp_auth_password: '123456'
-  smtp_require_tls: false
-
-#templates:
-#  - '/alertmanager/template/*.tmpl'
-
-route:
-  group_by: ['alertname']
-  group_wait: 10s
-  group_interval: 5m
-  repeat_interval: 5m
-  receiver: 'default-receiver'
-
-receivers:
-  - name: 'default-receiver'
-    email_configs:
-      - to: '852252810@qq.com'
+global:
+  smtp_smarthost: 'smtp.126.com:465'
+  smtp_from: 'wuyouzhuguli@126.com'
+  smtp_auth_username: 'wuyouzhuguli'
+  smtp_auth_password: 'xxxxx'
+  smtp_require_tls: false
+
+#templates:
+#  - '/alertmanager/template/*.tmpl'
+
+route:
+  group_by: ['alertname']
+  group_wait: 10s
+  group_interval: 5m
+  repeat_interval: 5m
+  receiver: 'default-receiver'
+
+receivers:
+  - name: 'default-receiver'
+    email_configs:
+      - to: '852252810@qq.com'
         send_resolved: true

+ 53 - 53
febs-cloud/docker compose/prometheus/docker-compose.yml → febs-apm/prometheus-grafana/docker-compose.yml

@@ -1,54 +1,54 @@
-version: '3'
-
-services:
-  prometheus:
-    image: prom/prometheus
-    container_name: prometheus
-    volumes:
-      - /febs/prometheus/:/etc/prometheus/
-    ports:
-      - 8403:9090
-    restart: on-failure
-  node_exporter:
-    image: prom/node-exporter
-    container_name: node_exporter
-    ports:
-      - 8405:9100
-  redis_exporter:
-    image: oliver006/redis_exporter
-    container_name: redis_exporter
-    command:
-      - '--redis.addr=redis://ip:port'
-      - '--redis.password=password'
-    ports:
-      - 8408:9121
-    restart: on-failure
-  mysql_exporter:
-    image: prom/mysqld-exporter
-    container_name: mysql_exporter
-    environment:
-      - DATA_SOURCE_NAME=username:password@(ip:port)/
-    ports:
-      - 8409:9104
-  cadvisor:
-    image: google/cadvisor
-    container_name: cadvisor
-    volumes:
-      - /:/rootfs:ro
-      - /var/run:/var/run:rw
-      - /sys:/sys:ro
-      - /var/lib/docker/:/var/lib/docker:ro
-    ports:
-      - 8407:8080
-  alertmanager:
-    image: prom/alertmanager
-    container_name: alertmanager
-    volumes:
-      - /febs/alertmanager/alertmanager.yml:/etc/alertmanager/alertmanager.yml
-    ports:
-      - 8406:9093
-  grafana:
-    image: grafana/grafana
-    container_name: grafana
-    ports:
+version: '3'
+
+services:
+  prometheus:
+    image: prom/prometheus
+    container_name: prometheus
+    volumes:
+      - /febs/prometheus/:/etc/prometheus/
+    ports:
+      - 8403:9090
+    restart: on-failure
+  node_exporter:
+    image: prom/node-exporter
+    container_name: node_exporter
+    ports:
+      - 8405:9100
+  redis_exporter:
+    image: oliver006/redis_exporter
+    container_name: redis_exporter
+    command:
+      - '--redis.addr=redis://ip:port'
+      - '--redis.password=password'
+    ports:
+      - 8408:9121
+    restart: on-failure
+  mysql_exporter:
+    image: prom/mysqld-exporter
+    container_name: mysql_exporter
+    environment:
+      - DATA_SOURCE_NAME=username:password@(ip:port)/
+    ports:
+      - 8409:9104
+  cadvisor:
+    image: google/cadvisor
+    container_name: cadvisor
+    volumes:
+      - /:/rootfs:ro
+      - /var/run:/var/run:rw
+      - /sys:/sys:ro
+      - /var/lib/docker/:/var/lib/docker:ro
+    ports:
+      - 8407:8080
+  alertmanager:
+    image: prom/alertmanager
+    container_name: alertmanager
+    volumes:
+      - /febs/alertmanager/alertmanager.yml:/etc/alertmanager/alertmanager.yml
+    ports:
+      - 8406:9093
+  grafana:
+    image: grafana/grafana
+    container_name: grafana
+    ports:
       - 8404:3000

+ 10 - 10
febs-cloud/config/memory_over.yml → febs-apm/prometheus-grafana/memory_over.yml

@@ -1,11 +1,11 @@
-groups:
-  - name: memory_over
-    rules:
-      - alert: NodeMemoryUsage
-        expr: (node_memory_MemTotal_bytes - (node_memory_MemFree_bytes+node_memory_Buffers_bytes+node_memory_Cached_bytes )) / node_memory_MemTotal_bytes * 100 > 80
-        for: 20s
-        labels:
-          user: MrBird
-        annotations:
-          summary: "{{$labels.instance}}: High Memory usage detected"
+groups:
+  - name: memory_over
+    rules:
+      - alert: NodeMemoryUsage
+        expr: (node_memory_MemTotal_bytes - (node_memory_MemFree_bytes+node_memory_Buffers_bytes+node_memory_Cached_bytes )) / node_memory_MemTotal_bytes * 100 > 80
+        for: 20s
+        labels:
+          user: MrBird
+        annotations:
+          summary: "{{$labels.instance}}: High Memory usage detected"
           description: "{{$labels.instance}}: Memory usage is above 80% (current value is:{{ $value }})"

+ 108 - 0
febs-apm/prometheus-grafana/more_rules.yml

@@ -0,0 +1,108 @@
+groups:
+  - name: example #定义规则组
+    rules:
+      - alert: InstanceDown  #定义报警名称
+        expr: up == 0   #Promql语句,触发规则
+        for: 1m            # 一分钟
+        labels:       #标签定义报警的级别和主机
+          name: instance
+          severity: Critical
+        annotations:  #注解
+          summary: " {{ $labels.appname }}" #报警摘要,取报警信息的appname名称
+          description: " 服务停止运行 "   #报警信息
+          value: "{{ $value }}%"  # 当前报警状态值
+  - name: Host
+    rules:
+      - alert: HostMemory Usage
+        expr: (node_memory_MemTotal_bytes - (node_memory_MemFree_bytes + node_memory_Buffers_bytes + node_memory_Cached_bytes)) / node_memory_MemTotal_bytes * 100 >  80
+        for: 1m
+        labels:
+          name: Memory
+          severity: Warning
+        annotations:
+          summary: " {{ $labels.appname }} "
+          description: "宿主机内存使用率超过80%."
+          value: "{{ $value }}"
+      - alert: HostCPU Usage
+        expr: sum(avg without (cpu)(irate(node_cpu_seconds_total{mode!='idle'}[5m]))) by (instance,appname) > 0.65
+        for: 1m
+        labels:
+          name: CPU
+          severity: Warning
+        annotations:
+          summary: " {{ $labels.appname }} "
+          description: "宿主机CPU使用率超过65%."
+          value: "{{ $value }}"
+      - alert: HostLoad
+        expr: node_load5 > 4
+        for: 1m
+        labels:
+          name: Load
+          severity: Warning
+        annotations:
+          summary: "{{ $labels.appname }} "
+          description: " 主机负载5分钟超过4."
+          value: "{{ $value }}"
+      - alert: HostFilesystem Usage
+        expr: 1-(node_filesystem_free_bytes / node_filesystem_size_bytes) >  0.8
+        for: 1m
+        labels:
+          name: Disk
+          severity: Warning
+        annotations:
+          summary: " {{ $labels.appname }} "
+          description: " 宿主机 [ {{ $labels.mountpoint }} ]分区使用超过80%."
+          value: "{{ $value }}%"
+      - alert: HostDiskio
+        expr: irate(node_disk_writes_completed_total{job=~"Host"}[1m]) > 10
+        for: 1m
+        labels:
+          name: Diskio
+          severity: Warning
+        annotations:
+          summary: " {{ $labels.appname }} "
+          description: " 宿主机 [{{ $labels.device }}]磁盘1分钟平均写入IO负载较高."
+          value: "{{ $value }}iops"
+      - alert: Network_receive
+        expr: irate(node_network_receive_bytes_total{device!~"lo|bond[0-9]|cbr[0-9]|veth.*|virbr.*|ovs-system"}[5m]) / 1048576  > 3
+        for: 1m
+        labels:
+          name: Network_receive
+          severity: Warning
+        annotations:
+          summary: " {{ $labels.appname }} "
+          description: " 宿主机 [{{ $labels.device }}] 网卡5分钟平均接收流量超过3Mbps."
+          value: "{{ $value }}3Mbps"
+      - alert: Network_transmit
+        expr: irate(node_network_transmit_bytes_total{device!~"lo|bond[0-9]|cbr[0-9]|veth.*|virbr.*|ovs-system"}[5m]) / 1048576  > 3
+        for: 1m
+        labels:
+          name: Network_transmit
+          severity: Warning
+        annotations:
+          summary: " {{ $labels.appname }} "
+          description: " 宿主机 [{{ $labels.device }}] 网卡5分钟内平均发送流量超过3Mbps."
+          value: "{{ $value }}3Mbps"
+  - name: Container
+    rules:
+      - alert: ContainerCPU Usage
+        expr: (sum by(name,instance) (rate(container_cpu_usage_seconds_total{image!=""}[5m]))*100) > 60
+        for: 1m
+        labels:
+          name: CPU
+          severity: Warning
+        annotations:
+          summary: "{{ $labels.name }} "
+          description: " 容器CPU使用超过60%."
+          value: "{{ $value }}%"
+      - alert: ContainerMem Usage
+        #    expr: (container_memory_usage_bytes - container_memory_cache)  / container_spec_memory_limit_bytes   * 100 > 10
+        expr:  container_memory_usage_bytes{name=~".+"}  / 1048576 > 1024
+        for: 1m
+        labels:
+          name: Memory
+          severity: Warning
+        annotations:
+          summary: "{{ $labels.name }} "
+          description: " 容器内存使用超过1GB."
+          value: "{{ $value }}G"

+ 70 - 56
febs-cloud/config/prometheus.yml → febs-apm/prometheus-grafana/prometheus.yml

@@ -1,57 +1,71 @@
-global:
-  scrape_interval:     15s
-  evaluation_interval: 15s
-
-scrape_configs:
-  - job_name: 'prometheus'
-    static_configs:
-      - targets: ['YOUR-IP:8403']
-  - job_name: 'node_exporter'
-    static_configs:
-      - targets: ['YOUR-IP:8405']
-        labels:
-          instance: 'node_exporter'
-  - job_name: 'redis_exporter'
-    static_configs:
-      - targets: ['YOUR-IP:8408']
-        labels:
-          instance: 'redis_exporter'
-  - job_name: 'mysql_exporter'
-    static_configs:
-      - targets: ['YOUR-IP:8409']
-        labels:
-          instance: 'mysql_exporter'
-  - job_name: 'cadvisor'
-    static_configs:
-      - targets: ['YOUR-IP:8407']
-        labels:
-          instance: 'cadvisor'
-
-  - job_name: 'febs-server-system-actuator'
-    metrics_path: '/actuator/prometheus'
-    scrape_interval: 5s
-    static_configs:
-      - targets: ['YOUR-IP:8201']
-        labels:
-          instance: 'febs-server-system'
-  - job_name: 'febs-server-auth-actuator'
-    metrics_path: '/actuator/prometheus'
-    scrape_interval: 5s
-    static_configs:
-      - targets: ['YOUR-IP:8101']
-        labels:
-          instance: 'febs-auth'
-  - job_name: 'febs-server-test-actuator'
-    metrics_path: '/actuator/prometheus'
-    scrape_interval: 5s
-    static_configs:
-      - targets: ['YOUR-IP:8202']
-        labels:
-          instance: 'febs-server-test'
-rule_files:
-  - 'memory_over.yml'
-  - 'server_down.yml'
-alerting:
-  alertmanagers:
-    - static_configs:
+global:
+  scrape_interval:     15s
+  evaluation_interval: 15s
+
+scrape_configs:
+  - job_name: 'prometheus'
+    static_configs:
+      - targets: ['YOUR-IP:8403']
+  - job_name: 'node_exporter'
+    static_configs:
+      - targets: ['YOUR-IP:8405']
+        labels:
+          instance: 'node_exporter'
+  - job_name: 'redis_exporter'
+    static_configs:
+      - targets: ['YOUR-IP:8408']
+        labels:
+          instance: 'redis_exporter'
+  - job_name: 'mysql_exporter'
+    static_configs:
+      - targets: ['YOUR-IP:8409']
+        labels:
+          instance: 'mysql_exporter'
+  - job_name: 'cadvisor'
+    static_configs:
+      - targets: ['YOUR-IP:8407']
+        labels:
+          instance: 'cadvisor'
+
+  - job_name: 'febs-server-system-actuator'
+    metrics_path: '/actuator/prometheus'
+    scrape_interval: 5s
+    static_configs:
+      - targets: ['YOUR-IP:8201']
+        labels:
+          instance: 'febs-server-system'
+  - job_name: 'febs-server-auth-actuator'
+    metrics_path: '/actuator/prometheus'
+    scrape_interval: 5s
+    static_configs:
+      - targets: ['YOUR-IP:8101']
+        labels:
+          instance: 'febs-auth'
+  - job_name: 'febs-server-test-actuator'
+    metrics_path: '/actuator/prometheus'
+    scrape_interval: 5s
+    static_configs:
+      - targets: ['YOUR-IP:8202']
+        labels:
+          instance: 'febs-server-test'
+  - job_name: 'febs-server-job-actuator'
+    metrics_path: '/actuator/prometheus'
+    scrape_interval: 5s
+    static_configs:
+      - targets: ['YOUR-IP:8204']
+        labels:
+          instance: 'febs-server-job'
+  - job_name: 'febs-tx-manager-actuator'
+    metrics_path: '/actuator/prometheus'
+    scrape_interval: 5s
+    static_configs:
+      - targets: ['YOUR-IP:8501']
+        labels:
+          instance: 'febs-tx-manager'
+rule_files:
+  - 'memory_over.yml'
+  - 'server_down.yml'
+alerting:
+  alertmanagers:
+    - static_configs:
         - targets: ["YOUR-IP:8406"]

+ 10 - 10
febs-cloud/config/server_down.yml → febs-apm/prometheus-grafana/server_down.yml

@@ -1,11 +1,11 @@
-groups:
-  - name: server_down
-    rules:
-      - alert: InstanceDown
-        expr: up == 0
-        for: 20s
-        labels:
-          user: MrBird
-        annotations:
-          summary: "Instance {{ $labels.instance }} down"
+groups:
+  - name: server_down
+    rules:
+      - alert: InstanceDown
+        expr: up == 0
+        for: 20s
+        labels:
+          user: MrBird
+        annotations:
+          summary: "Instance {{ $labels.instance }} down"
           description: "{{ $labels.instance }} of job {{ $labels.job }} has been down for more than 20 s."

+ 70 - 70
febs-cloud/docker compose/elk-skywalking/docker-compose.yml → febs-apm/skywalking-elk/docker-compose.yml

@@ -1,71 +1,71 @@
-version: '3'
-
-services:
-  elasticsearch:
-    image: elasticsearch:6.4.1
-    container_name: elasticsearch
-    restart: always
-    environment:
-      - cluster.name=elasticsearch
-      - xpack.security.enabled=false
-      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
-      - node.name=elasticsearch_node_1
-      - "TZ=Asia/Shanghai"
-    volumes:
-      - /febs/elasticsearch/data:/usr/share/elasticsearch/data
-      - /febs/elasticsearch/logs:/usr/share/elasticsearch/logs
-      - /febs/elasticsearch/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml
-    ports:
-      - 9200:9200
-      - 9300:9300
-  kibana:
-    image: kibana:6.4.1
-    container_name: kibana
-    links:
-      - elasticsearch:es #配置elasticsearch域名为 es
-    depends_on:
-      - elasticsearch
-    environment:
-      - "elasticsearch.hosts=http://es:9200" #因为上面配置了域名,所以这里可以简写为 http://es:9200
-    ports:
-      - 5601:5601
-  logstash:
-    image: logstash:6.4.1
-    container_name: logstash
-    volumes:
-      - /febs/logstash/logstash-febs.conf:/usr/share/logstash/pipeline/logstash.conf
-    depends_on:
-      - elasticsearch
-    links:
-      - elasticsearch:es
-    ports:
-      - 4560:4560
-  skywalking-oap:
-    image: apache/skywalking-oap-server:6.4.0
-    container_name: skywalking-oap
-    depends_on:
-      - elasticsearch
-    links:
-      - elasticsearch
-    restart: always
-    ports:
-      - 11800:11800
-      - 12800:12800
-    environment:
-      - "TZ=Asia/Shanghai"
-    volumes:
-      - /febs/skywalking/config:/apache-skywalking-apm-bin/config:ro
-
-  skywalking-ui:
-    image: apache/skywalking-ui:6.4.0
-    container_name: skywalking-ui
-    depends_on:
-      - skywalking-oap
-    links:
-      - skywalking-oap
-    restart: always
-    ports:
-      - 8080:8080
-    environment:
-      - "collector.ribbon.listOfServers=skywalking-oap:12800"
+version: '3'
+
+services:
+  elasticsearch:
+    image: elasticsearch:6.4.1
+    container_name: elasticsearch
+    restart: always
+    environment:
+      - cluster.name=elasticsearch
+      - xpack.security.enabled=false
+      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
+      - node.name=elasticsearch_node_1
+      - "TZ=Asia/Shanghai"
+    volumes:
+      - /febs/elasticsearch/data:/usr/share/elasticsearch/data
+      - /febs/elasticsearch/logs:/usr/share/elasticsearch/logs
+      - /febs/elasticsearch/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml
+    ports:
+      - 9200:9200
+      - 9300:9300
+  kibana:
+    image: kibana:6.4.1
+    container_name: kibana
+    links:
+      - elasticsearch:es #配置elasticsearch域名为 es
+    depends_on:
+      - elasticsearch
+    environment:
+      - "elasticsearch.hosts=http://es:9200" #因为上面配置了域名,所以这里可以简写为 http://es:9200
+    ports:
+      - 5601:5601
+  logstash:
+    image: logstash:6.4.1
+    container_name: logstash
+    volumes:
+      - /febs/logstash/logstash-febs.conf:/usr/share/logstash/pipeline/logstash.conf
+    depends_on:
+      - elasticsearch
+    links:
+      - elasticsearch:es
+    ports:
+      - 4560:4560
+  skywalking-oap:
+    image: apache/skywalking-oap-server:6.4.0
+    container_name: skywalking-oap
+    depends_on:
+      - elasticsearch
+    links:
+      - elasticsearch
+    restart: always
+    ports:
+      - 11800:11800
+      - 12800:12800
+    environment:
+      - "TZ=Asia/Shanghai"
+    volumes:
+      - /febs/skywalking/config:/apache-skywalking-apm-bin/config:ro
+
+  skywalking-ui:
+    image: apache/skywalking-ui:6.4.0
+    container_name: skywalking-ui
+    depends_on:
+      - skywalking-oap
+    links:
+      - skywalking-oap
+    restart: always
+    ports:
+      - 8080:8080
+    environment:
+      - "collector.ribbon.listOfServers=skywalking-oap:12800"
       - "TZ=Asia/Shanghai"

+ 6 - 6
febs-cloud/config/elasticsearch.yml → febs-apm/skywalking-elk/elasticsearch.yml

@@ -1,7 +1,7 @@
-http.host: 0.0.0.0
-http.cors.enabled: true
-http.cors.allow-origin: "*"
-# Uncomment the following lines for a production cluster deployment
-#transport.host: 0.0.0.0
-#discovery.zen.minimum_master_nodes: 1
+http.host: 0.0.0.0
+http.cors.enabled: true
+http.cors.allow-origin: "*"
+# Uncomment the following lines for a production cluster deployment
+#transport.host: 0.0.0.0
+#discovery.zen.minimum_master_nodes: 1
 transport.host: 0.0.0.0

+ 110 - 110
febs-cloud/config/skywalking_application.yml → febs-apm/skywalking-elk/skywalking_application.yml

@@ -1,111 +1,111 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-cluster:
-  standalone:
-  # Please check your ZooKeeper is 3.5+, However, it is also compatible with ZooKeeper 3.4.x. Replace the ZooKeeper 3.5+
-  # library the oap-libs folder with your ZooKeeper 3.4.x library.
-#  zookeeper:
-#    nameSpace: ${SW_NAMESPACE:""}
-#    hostPort: ${SW_CLUSTER_ZK_HOST_PORT:localhost:2181}
-#    #Retry Policy
-#    baseSleepTimeMs: ${SW_CLUSTER_ZK_SLEEP_TIME:1000} # initial amount of time to wait between retries
-#    maxRetries: ${SW_CLUSTER_ZK_MAX_RETRIES:3} # max number of times to retry
-#  kubernetes:
-#    watchTimeoutSeconds: ${SW_CLUSTER_K8S_WATCH_TIMEOUT:60}
-#    namespace: ${SW_CLUSTER_K8S_NAMESPACE:default}
-#    labelSelector: ${SW_CLUSTER_K8S_LABEL:app=collector,release=skywalking}
-#    uidEnvName: ${SW_CLUSTER_K8S_UID:SKYWALKING_COLLECTOR_UID}
-#  consul:
-#    serviceName: ${SW_SERVICE_NAME:"SkyWalking_OAP_Cluster"}
-#     Consul cluster nodes, example: 10.0.0.1:8500,10.0.0.2:8500,10.0.0.3:8500
-#    hostPort: ${SW_CLUSTER_CONSUL_HOST_PORT:localhost:8500}
-core:
-  default:
-    # Mixed: Receive agent data, Level 1 aggregate, Level 2 aggregate
-    # Aggregator: Level 2 aggregate
-    role: ${SW_CORE_ROLE:Mixed} # Mixed/Receiver/Aggregator
-    restHost: ${SW_CORE_REST_HOST:0.0.0.0}
-    restPort: ${SW_CORE_REST_PORT:12800}
-    restContextPath: ${SW_CORE_REST_CONTEXT_PATH:/}
-    gRPCHost: ${SW_CORE_GRPC_HOST:0.0.0.0}
-    gRPCPort: ${SW_CORE_GRPC_PORT:11800}
-    downsampling:
-      - Hour
-      - Day
-      - Month
-    # Set a timeout on metric data. After the timeout has expired, the metric data will automatically be deleted.
-    recordDataTTL: ${SW_CORE_RECORD_DATA_TTL:90} # Unit is minute
-    minuteMetricsDataTTL: ${SW_CORE_MINUTE_METRIC_DATA_TTL:90} # Unit is minute
-    hourMetricsDataTTL: ${SW_CORE_HOUR_METRIC_DATA_TTL:36} # Unit is hour
-    dayMetricsDataTTL: ${SW_CORE_DAY_METRIC_DATA_TTL:45} # Unit is day
-    monthMetricsDataTTL: ${SW_CORE_MONTH_METRIC_DATA_TTL:18} # Unit is month
-storage:
-  elasticsearch:
-    # set the namespace in elasticsearch
-    clusterNodes: ${SW_STORAGE_ES_CLUSTER_NODES:elasticsearch:9200}
-    indexShardsNumber: ${SW_STORAGE_ES_INDEX_SHARDS_NUMBER:2}
-    indexReplicasNumber: ${SW_STORAGE_ES_INDEX_REPLICAS_NUMBER:0}
-    # Batch process setting, refer to https://www.elastic.co/guide/en/elasticsearch/client/java-api/5.5/java-docs-bulk-processor.html
-    bulkActions: ${SW_STORAGE_ES_BULK_ACTIONS:2000} # Execute the bulk every 2000 requests
-    bulkSize: ${SW_STORAGE_ES_BULK_SIZE:20} # flush the bulk every 20mb
-    flushInterval: ${SW_STORAGE_ES_FLUSH_INTERVAL:10} # flush the bulk every 10 seconds whatever the number of requests
-    concurrentRequests: ${SW_STORAGE_ES_CONCURRENT_REQUESTS:2} # the number of concurrent requests
-    metadataQueryMaxSize: ${SW_STORAGE_ES_QUERY_MAX_SIZE:5000}
-    segmentQueryMaxSize: ${SW_STORAGE_ES_QUERY_SEGMENT_SIZE:200}
-#  h2:
-#    driver: ${SW_STORAGE_H2_DRIVER:org.h2.jdbcx.JdbcDataSource}
-#    url: ${SW_STORAGE_H2_URL:jdbc:h2:mem:skywalking-oap-db}
-#    user: ${SW_STORAGE_H2_USER:sa}
-#    metadataQueryMaxSize: ${SW_STORAGE_H2_QUERY_MAX_SIZE:5000}
-#  mysql:
-#    metadataQueryMaxSize: ${SW_STORAGE_H2_QUERY_MAX_SIZE:5000}
-receiver-sharing-server:
-  default:
-receiver-register:
-  default:
-receiver-trace:
-  default:
-    bufferPath: ${SW_RECEIVER_BUFFER_PATH:../trace-buffer/}  # Path to trace buffer files, suggest to use absolute path
-    bufferOffsetMaxFileSize: ${SW_RECEIVER_BUFFER_OFFSET_MAX_FILE_SIZE:100} # Unit is MB
-    bufferDataMaxFileSize: ${SW_RECEIVER_BUFFER_DATA_MAX_FILE_SIZE:500} # Unit is MB
-    bufferFileCleanWhenRestart: ${SW_RECEIVER_BUFFER_FILE_CLEAN_WHEN_RESTART:false}
-    sampleRate: ${SW_TRACE_SAMPLE_RATE:10000} # The sample rate precision is 1/10000. 10000 means 100% sample in default.
-    slowDBAccessThreshold: ${SW_SLOW_DB_THRESHOLD:default:200,mongodb:100} # The slow database access thresholds. Unit ms.
-receiver-jvm:
-  default:
-service-mesh:
-  default:
-    bufferPath: ${SW_SERVICE_MESH_BUFFER_PATH:../mesh-buffer/}  # Path to trace buffer files, suggest to use absolute path
-    bufferOffsetMaxFileSize: ${SW_SERVICE_MESH_OFFSET_MAX_FILE_SIZE:100} # Unit is MB
-    bufferDataMaxFileSize: ${SW_SERVICE_MESH_BUFFER_DATA_MAX_FILE_SIZE:500} # Unit is MB
-    bufferFileCleanWhenRestart: ${SW_SERVICE_MESH_BUFFER_FILE_CLEAN_WHEN_RESTART:false}
-istio-telemetry:
-  default:
-envoy-metric:
-  default:
-# receiver_zipkin:
-#   default:
-#     host: ${SW_RECEIVER_ZIPKIN_HOST:0.0.0.0}
-#     port: ${SW_RECEIVER_ZIPKIN_PORT:9411}
-#     contextPath: ${SW_RECEIVER_ZIPKIN_CONTEXT_PATH:/}
-query:
-  graphql:
-    path: ${SW_QUERY_GRAPHQL_PATH:/graphql}
-alarm:
-  default:
-telemetry:
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+cluster:
+  standalone:
+  # Please check your ZooKeeper is 3.5+, However, it is also compatible with ZooKeeper 3.4.x. Replace the ZooKeeper 3.5+
+  # library the oap-libs folder with your ZooKeeper 3.4.x library.
+#  zookeeper:
+#    nameSpace: ${SW_NAMESPACE:""}
+#    hostPort: ${SW_CLUSTER_ZK_HOST_PORT:localhost:2181}
+#    #Retry Policy
+#    baseSleepTimeMs: ${SW_CLUSTER_ZK_SLEEP_TIME:1000} # initial amount of time to wait between retries
+#    maxRetries: ${SW_CLUSTER_ZK_MAX_RETRIES:3} # max number of times to retry
+#  kubernetes:
+#    watchTimeoutSeconds: ${SW_CLUSTER_K8S_WATCH_TIMEOUT:60}
+#    namespace: ${SW_CLUSTER_K8S_NAMESPACE:default}
+#    labelSelector: ${SW_CLUSTER_K8S_LABEL:app=collector,release=skywalking}
+#    uidEnvName: ${SW_CLUSTER_K8S_UID:SKYWALKING_COLLECTOR_UID}
+#  consul:
+#    serviceName: ${SW_SERVICE_NAME:"SkyWalking_OAP_Cluster"}
+#     Consul cluster nodes, example: 10.0.0.1:8500,10.0.0.2:8500,10.0.0.3:8500
+#    hostPort: ${SW_CLUSTER_CONSUL_HOST_PORT:localhost:8500}
+core:
+  default:
+    # Mixed: Receive agent data, Level 1 aggregate, Level 2 aggregate
+    # Aggregator: Level 2 aggregate
+    role: ${SW_CORE_ROLE:Mixed} # Mixed/Receiver/Aggregator
+    restHost: ${SW_CORE_REST_HOST:0.0.0.0}
+    restPort: ${SW_CORE_REST_PORT:12800}
+    restContextPath: ${SW_CORE_REST_CONTEXT_PATH:/}
+    gRPCHost: ${SW_CORE_GRPC_HOST:0.0.0.0}
+    gRPCPort: ${SW_CORE_GRPC_PORT:11800}
+    downsampling:
+      - Hour
+      - Day
+      - Month
+    # Set a timeout on metric data. After the timeout has expired, the metric data will automatically be deleted.
+    recordDataTTL: ${SW_CORE_RECORD_DATA_TTL:90} # Unit is minute
+    minuteMetricsDataTTL: ${SW_CORE_MINUTE_METRIC_DATA_TTL:90} # Unit is minute
+    hourMetricsDataTTL: ${SW_CORE_HOUR_METRIC_DATA_TTL:36} # Unit is hour
+    dayMetricsDataTTL: ${SW_CORE_DAY_METRIC_DATA_TTL:45} # Unit is day
+    monthMetricsDataTTL: ${SW_CORE_MONTH_METRIC_DATA_TTL:18} # Unit is month
+storage:
+  elasticsearch:
+    # set the namespace in elasticsearch
+    clusterNodes: ${SW_STORAGE_ES_CLUSTER_NODES:elasticsearch:9200}
+    indexShardsNumber: ${SW_STORAGE_ES_INDEX_SHARDS_NUMBER:2}
+    indexReplicasNumber: ${SW_STORAGE_ES_INDEX_REPLICAS_NUMBER:0}
+    # Batch process setting, refer to https://www.elastic.co/guide/en/elasticsearch/client/java-api/5.5/java-docs-bulk-processor.html
+    bulkActions: ${SW_STORAGE_ES_BULK_ACTIONS:2000} # Execute the bulk every 2000 requests
+    bulkSize: ${SW_STORAGE_ES_BULK_SIZE:20} # flush the bulk every 20mb
+    flushInterval: ${SW_STORAGE_ES_FLUSH_INTERVAL:10} # flush the bulk every 10 seconds whatever the number of requests
+    concurrentRequests: ${SW_STORAGE_ES_CONCURRENT_REQUESTS:2} # the number of concurrent requests
+    metadataQueryMaxSize: ${SW_STORAGE_ES_QUERY_MAX_SIZE:5000}
+    segmentQueryMaxSize: ${SW_STORAGE_ES_QUERY_SEGMENT_SIZE:200}
+#  h2:
+#    driver: ${SW_STORAGE_H2_DRIVER:org.h2.jdbcx.JdbcDataSource}
+#    url: ${SW_STORAGE_H2_URL:jdbc:h2:mem:skywalking-oap-db}
+#    user: ${SW_STORAGE_H2_USER:sa}
+#    metadataQueryMaxSize: ${SW_STORAGE_H2_QUERY_MAX_SIZE:5000}
+#  mysql:
+#    metadataQueryMaxSize: ${SW_STORAGE_H2_QUERY_MAX_SIZE:5000}
+receiver-sharing-server:
+  default:
+receiver-register:
+  default:
+receiver-trace:
+  default:
+    bufferPath: ${SW_RECEIVER_BUFFER_PATH:../trace-buffer/}  # Path to trace buffer files, suggest to use absolute path
+    bufferOffsetMaxFileSize: ${SW_RECEIVER_BUFFER_OFFSET_MAX_FILE_SIZE:100} # Unit is MB
+    bufferDataMaxFileSize: ${SW_RECEIVER_BUFFER_DATA_MAX_FILE_SIZE:500} # Unit is MB
+    bufferFileCleanWhenRestart: ${SW_RECEIVER_BUFFER_FILE_CLEAN_WHEN_RESTART:false}
+    sampleRate: ${SW_TRACE_SAMPLE_RATE:10000} # The sample rate precision is 1/10000. 10000 means 100% sample in default.
+    slowDBAccessThreshold: ${SW_SLOW_DB_THRESHOLD:default:200,mongodb:100} # The slow database access thresholds. Unit ms.
+receiver-jvm:
+  default:
+service-mesh:
+  default:
+    bufferPath: ${SW_SERVICE_MESH_BUFFER_PATH:../mesh-buffer/}  # Path to trace buffer files, suggest to use absolute path
+    bufferOffsetMaxFileSize: ${SW_SERVICE_MESH_OFFSET_MAX_FILE_SIZE:100} # Unit is MB
+    bufferDataMaxFileSize: ${SW_SERVICE_MESH_BUFFER_DATA_MAX_FILE_SIZE:500} # Unit is MB
+    bufferFileCleanWhenRestart: ${SW_SERVICE_MESH_BUFFER_FILE_CLEAN_WHEN_RESTART:false}
+istio-telemetry:
+  default:
+envoy-metric:
+  default:
+# receiver_zipkin:
+#   default:
+#     host: ${SW_RECEIVER_ZIPKIN_HOST:0.0.0.0}
+#     port: ${SW_RECEIVER_ZIPKIN_PORT:9411}
+#     contextPath: ${SW_RECEIVER_ZIPKIN_CONTEXT_PATH:/}
+query:
+  graphql:
+    path: ${SW_QUERY_GRAPHQL_PATH:/graphql}
+alarm:
+  default:
+telemetry:
   none:

BIN
febs-auth/.DS_Store


+ 2 - 2
febs-auth/Dockerfile

@@ -1,7 +1,7 @@
 FROM openjdk:8u212-jre
 MAINTAINER MrBird 852252810@qq.com
 
-COPY ./target/febs-auth-1.4-RELEASE.jar /febs/febs-auth-1.4-RELEASE.jar
+COPY ./target/febs-auth-2.0-RELEASE.jar /febs/febs-auth-2.0-RELEASE.jar
 ADD agent/ /agent
 
-ENTRYPOINT ["java", "-javaagent:/agent/skywalking-agent.jar", "-Dskywalking.agent.service_name=febs-auth", "-Dskywalking.collector.backend_service=${skywalking.url}:11800", "-jar", "/febs/febs-auth-1.4-RELEASE.jar"]
+ENTRYPOINT ["java", "-javaagent:/agent/skywalking-agent.jar", "-Dskywalking.agent.service_name=febs-auth", "-Dskywalking.collector.backend_service=skywalkingIp:11800", "-jar", "/febs/febs-auth-2.0-RELEASE.jar"]

+ 21 - 17
febs-auth/pom.xml

@@ -5,44 +5,48 @@
     <parent>
         <groupId>cc.mrbird</groupId>
         <artifactId>febs-cloud</artifactId>
-        <version>1.6-RELEASE</version>
+        <version>2.0-RELEASE</version>
         <relativePath>../febs-cloud/pom.xml</relativePath>
     </parent>
 
     <artifactId>febs-auth</artifactId>
-    <version>1.6-RELEASE</version>
     <name>FEBS-Auth</name>
     <description>FEBS-Cloud认证服务器</description>
 
+    <properties>
+        <febs-cloud.version>2.0-RELEASE</febs-cloud.version>
+    </properties>
+
     <dependencies>
         <dependency>
             <groupId>cc.mrbird</groupId>
-            <artifactId>febs-common</artifactId>
-            <version>1.6-RELEASE</version>
+            <artifactId>febs-common-redis-starter</artifactId>
+            <version>${febs-cloud.version}</version>
         </dependency>
         <dependency>
-            <groupId>com.baomidou</groupId>
-            <artifactId>dynamic-datasource-spring-boot-starter</artifactId>
-            <version>2.5.7</version>
+            <groupId>cc.mrbird</groupId>
+            <artifactId>febs-common-datasource-starter</artifactId>
+            <version>${febs-cloud.version}</version>
         </dependency>
         <dependency>
-            <groupId>mysql</groupId>
-            <artifactId>mysql-connector-java</artifactId>
-            <scope>runtime</scope>
+            <groupId>cc.mrbird</groupId>
+            <artifactId>febs-common-doc-starter</artifactId>
+            <version>${febs-cloud.version}</version>
         </dependency>
         <dependency>
-            <groupId>com.github.whvcse</groupId>
-            <artifactId>easy-captcha</artifactId>
-            <version>1.6.2</version>
+            <groupId>cc.mrbird</groupId>
+            <artifactId>febs-common-security-starter</artifactId>
+            <version>${febs-cloud.version}</version>
         </dependency>
         <dependency>
-            <groupId>org.apache.commons</groupId>
-            <artifactId>commons-pool2</artifactId>
+            <groupId>com.github.whvcse</groupId>
+            <artifactId>easy-captcha</artifactId>
+            <version>${easy-captcha.version}</version>
         </dependency>
         <dependency>
             <groupId>net.logstash.logback</groupId>
             <artifactId>logstash-logback-encoder</artifactId>
-            <version>6.1</version>
+            <version>${logstash-logback-encoder.version}</version>
         </dependency>
         <dependency>
             <groupId>org.springframework.boot</groupId>
@@ -51,7 +55,7 @@
         <dependency>
             <groupId>com.xkcoding</groupId>
             <artifactId>justauth-spring-boot-starter</artifactId>
-            <version>1.1.0</version>
+            <version>${justauth.version}</version>
         </dependency>
         <dependency>
             <groupId>org.springframework.boot</groupId>

+ 22 - 27
febs-auth/src/main/java/cc/mrbird/febs/auth/FebsAuthApplication.java

@@ -1,27 +1,22 @@
-package cc.mrbird.febs.auth;
-
-import cc.mrbird.febs.common.annotation.EnableFebsAuthExceptionHandler;
-import cc.mrbird.febs.common.annotation.EnableFebsLettuceRedis;
-import cc.mrbird.febs.common.annotation.EnableFebsServerProtect;
-import org.mybatis.spring.annotation.MapperScan;
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
-import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
-
-/**
- * @author MrBird
- */
-@EnableDiscoveryClient
-@EnableFebsLettuceRedis
-@EnableFebsAuthExceptionHandler
-@EnableFebsServerProtect
-@SpringBootApplication
-@MapperScan("cc.mrbird.febs.auth.mapper")
-@EnableGlobalMethodSecurity(prePostEnabled = true)
-public class FebsAuthApplication {
-
-    public static void main(String[] args) {
-        SpringApplication.run(FebsAuthApplication.class, args);
-    }
-}
+package cc.mrbird.febs.auth;
+
+import cc.mrbird.febs.common.security.starter.annotation.EnableFebsCloudResourceServer;
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.boot.WebApplicationType;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.builder.SpringApplicationBuilder;
+
+/**
+ * @author MrBird
+ */
+@SpringBootApplication
+@EnableFebsCloudResourceServer
+@MapperScan("cc.mrbird.febs.auth.mapper")
+public class FebsAuthApplication {
+
+    public static void main(String[] args) {
+        new SpringApplicationBuilder(FebsAuthApplication.class)
+                .web(WebApplicationType.SERVLET)
+                .run(args);
+    }
+}

+ 114 - 114
febs-auth/src/main/java/cc/mrbird/febs/auth/configure/FebsAuthorizationServerConfigure.java

@@ -1,114 +1,114 @@
-package cc.mrbird.febs.auth.configure;
-
-import cc.mrbird.febs.auth.properties.FebsAuthProperties;
-import cc.mrbird.febs.auth.service.impl.RedisClientDetailsService;
-import cc.mrbird.febs.auth.translator.FebsWebResponseExceptionTranslator;
-import lombok.RequiredArgsConstructor;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.Primary;
-import org.springframework.data.redis.connection.RedisConnectionFactory;
-import org.springframework.security.authentication.AuthenticationManager;
-import org.springframework.security.core.userdetails.UserDetailsService;
-import org.springframework.security.crypto.password.PasswordEncoder;
-import org.springframework.security.oauth2.config.annotation.configurers.ClientDetailsServiceConfigurer;
-import org.springframework.security.oauth2.config.annotation.web.configuration.AuthorizationServerConfigurerAdapter;
-import org.springframework.security.oauth2.config.annotation.web.configuration.EnableAuthorizationServer;
-import org.springframework.security.oauth2.config.annotation.web.configurers.AuthorizationServerEndpointsConfigurer;
-import org.springframework.security.oauth2.provider.OAuth2RequestFactory;
-import org.springframework.security.oauth2.provider.password.ResourceOwnerPasswordTokenGranter;
-import org.springframework.security.oauth2.provider.request.DefaultOAuth2RequestFactory;
-import org.springframework.security.oauth2.provider.token.DefaultAccessTokenConverter;
-import org.springframework.security.oauth2.provider.token.DefaultTokenServices;
-import org.springframework.security.oauth2.provider.token.DefaultUserAuthenticationConverter;
-import org.springframework.security.oauth2.provider.token.TokenStore;
-import org.springframework.security.oauth2.provider.token.store.JwtAccessTokenConverter;
-import org.springframework.security.oauth2.provider.token.store.JwtTokenStore;
-import org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStore;
-
-import java.util.UUID;
-
-/**
- * 认证服务器配置
- *
- * @author MrBird
- */
-@Configuration
-@EnableAuthorizationServer
-@RequiredArgsConstructor
-public class FebsAuthorizationServerConfigure extends AuthorizationServerConfigurerAdapter {
-
-    private final AuthenticationManager authenticationManager;
-    private final UserDetailsService userDetailService;
-    private final PasswordEncoder passwordEncoder;
-    private final FebsWebResponseExceptionTranslator exceptionTranslator;
-    private final FebsAuthProperties properties;
-    private final RedisClientDetailsService redisClientDetailsService;
-    private final RedisConnectionFactory redisConnectionFactory;
-
-    @Override
-    public void configure(ClientDetailsServiceConfigurer clients) throws Exception {
-        clients.withClientDetails(redisClientDetailsService);
-    }
-
-    @Override
-    @SuppressWarnings("unchecked")
-    public void configure(AuthorizationServerEndpointsConfigurer endpoints) {
-        endpoints.tokenStore(tokenStore())
-                .userDetailsService(userDetailService)
-                .authenticationManager(authenticationManager)
-                .exceptionTranslator(exceptionTranslator);
-        if (properties.getEnableJwt()) {
-            endpoints.accessTokenConverter(jwtAccessTokenConverter());
-        }
-    }
-
-    @Bean
-    public TokenStore tokenStore() {
-        if (properties.getEnableJwt()) {
-            return new JwtTokenStore(jwtAccessTokenConverter());
-        } else {
-            RedisTokenStore redisTokenStore = new RedisTokenStore(redisConnectionFactory);
-            // 解决每次生成的 token都一样的问题
-            redisTokenStore.setAuthenticationKeyGenerator(oAuth2Authentication -> UUID.randomUUID().toString());
-            return redisTokenStore;
-        }
-    }
-
-    @Bean
-    @Primary
-    public DefaultTokenServices defaultTokenServices() {
-        DefaultTokenServices tokenServices = new DefaultTokenServices();
-
-        tokenServices.setTokenStore(tokenStore());
-        tokenServices.setSupportRefreshToken(true);
-        tokenServices.setClientDetailsService(redisClientDetailsService);
-        return tokenServices;
-    }
-
-    @Bean
-    public JwtAccessTokenConverter jwtAccessTokenConverter() {
-        JwtAccessTokenConverter accessTokenConverter = new JwtAccessTokenConverter();
-        DefaultAccessTokenConverter defaultAccessTokenConverter = (DefaultAccessTokenConverter) accessTokenConverter.getAccessTokenConverter();
-        DefaultUserAuthenticationConverter userAuthenticationConverter = new DefaultUserAuthenticationConverter();
-        userAuthenticationConverter.setUserDetailsService(userDetailService);
-        defaultAccessTokenConverter.setUserTokenConverter(userAuthenticationConverter);
-        accessTokenConverter.setSigningKey(properties.getJwtAccessKey());
-        return accessTokenConverter;
-    }
-
-    @Bean
-    public ResourceOwnerPasswordTokenGranter resourceOwnerPasswordTokenGranter(AuthenticationManager authenticationManager, OAuth2RequestFactory oAuth2RequestFactory) {
-        DefaultTokenServices defaultTokenServices = defaultTokenServices();
-        if (properties.getEnableJwt()) {
-            defaultTokenServices.setTokenEnhancer(jwtAccessTokenConverter());
-        }
-        return new ResourceOwnerPasswordTokenGranter(authenticationManager, defaultTokenServices, redisClientDetailsService, oAuth2RequestFactory);
-    }
-
-    @Bean
-    public DefaultOAuth2RequestFactory oAuth2RequestFactory() {
-        return new DefaultOAuth2RequestFactory(redisClientDetailsService);
-    }
-
-}
+package cc.mrbird.febs.auth.configure;
+
+import cc.mrbird.febs.auth.properties.FebsAuthProperties;
+import cc.mrbird.febs.auth.service.impl.RedisClientDetailsService;
+import cc.mrbird.febs.auth.translator.FebsWebResponseExceptionTranslator;
+import lombok.RequiredArgsConstructor;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Primary;
+import org.springframework.data.redis.connection.RedisConnectionFactory;
+import org.springframework.security.authentication.AuthenticationManager;
+import org.springframework.security.core.userdetails.UserDetailsService;
+import org.springframework.security.crypto.password.PasswordEncoder;
+import org.springframework.security.oauth2.config.annotation.configurers.ClientDetailsServiceConfigurer;
+import org.springframework.security.oauth2.config.annotation.web.configuration.AuthorizationServerConfigurerAdapter;
+import org.springframework.security.oauth2.config.annotation.web.configuration.EnableAuthorizationServer;
+import org.springframework.security.oauth2.config.annotation.web.configurers.AuthorizationServerEndpointsConfigurer;
+import org.springframework.security.oauth2.provider.OAuth2RequestFactory;
+import org.springframework.security.oauth2.provider.password.ResourceOwnerPasswordTokenGranter;
+import org.springframework.security.oauth2.provider.request.DefaultOAuth2RequestFactory;
+import org.springframework.security.oauth2.provider.token.DefaultAccessTokenConverter;
+import org.springframework.security.oauth2.provider.token.DefaultTokenServices;
+import org.springframework.security.oauth2.provider.token.DefaultUserAuthenticationConverter;
+import org.springframework.security.oauth2.provider.token.TokenStore;
+import org.springframework.security.oauth2.provider.token.store.JwtAccessTokenConverter;
+import org.springframework.security.oauth2.provider.token.store.JwtTokenStore;
+import org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStore;
+
+import java.util.UUID;
+
+/**
+ * 认证服务器配置
+ *
+ * @author MrBird
+ */
+@Configuration
+@EnableAuthorizationServer
+@RequiredArgsConstructor
+public class FebsAuthorizationServerConfigure extends AuthorizationServerConfigurerAdapter {
+
+    private final AuthenticationManager authenticationManager;
+    private final UserDetailsService userDetailService;
+    private final PasswordEncoder passwordEncoder;
+    private final FebsWebResponseExceptionTranslator exceptionTranslator;
+    private final FebsAuthProperties properties;
+    private final RedisClientDetailsService redisClientDetailsService;
+    private final RedisConnectionFactory redisConnectionFactory;
+
+    @Override
+    public void configure(ClientDetailsServiceConfigurer clients) throws Exception {
+        clients.withClientDetails(redisClientDetailsService);
+    }
+
+    @Override
+    @SuppressWarnings("unchecked")
+    public void configure(AuthorizationServerEndpointsConfigurer endpoints) {
+        endpoints.tokenStore(tokenStore())
+                .userDetailsService(userDetailService)
+                .authenticationManager(authenticationManager)
+                .exceptionTranslator(exceptionTranslator);
+        if (properties.getEnableJwt()) {
+            endpoints.accessTokenConverter(jwtAccessTokenConverter());
+        }
+    }
+
+    @Bean
+    public TokenStore tokenStore() {
+        if (properties.getEnableJwt()) {
+            return new JwtTokenStore(jwtAccessTokenConverter());
+        } else {
+            RedisTokenStore redisTokenStore = new RedisTokenStore(redisConnectionFactory);
+            // 解决每次生成的 token都一样的问题
+            redisTokenStore.setAuthenticationKeyGenerator(oAuth2Authentication -> UUID.randomUUID().toString());
+            return redisTokenStore;
+        }
+    }
+
+    @Bean
+    @Primary
+    public DefaultTokenServices defaultTokenServices() {
+        DefaultTokenServices tokenServices = new DefaultTokenServices();
+
+        tokenServices.setTokenStore(tokenStore());
+        tokenServices.setSupportRefreshToken(true);
+        tokenServices.setClientDetailsService(redisClientDetailsService);
+        return tokenServices;
+    }
+
+    @Bean
+    public JwtAccessTokenConverter jwtAccessTokenConverter() {
+        JwtAccessTokenConverter accessTokenConverter = new JwtAccessTokenConverter();
+        DefaultAccessTokenConverter defaultAccessTokenConverter = (DefaultAccessTokenConverter) accessTokenConverter.getAccessTokenConverter();
+        DefaultUserAuthenticationConverter userAuthenticationConverter = new DefaultUserAuthenticationConverter();
+        userAuthenticationConverter.setUserDetailsService(userDetailService);
+        defaultAccessTokenConverter.setUserTokenConverter(userAuthenticationConverter);
+        accessTokenConverter.setSigningKey(properties.getJwtAccessKey());
+        return accessTokenConverter;
+    }
+
+    @Bean
+    public ResourceOwnerPasswordTokenGranter resourceOwnerPasswordTokenGranter(AuthenticationManager authenticationManager, OAuth2RequestFactory oAuth2RequestFactory) {
+        DefaultTokenServices defaultTokenServices = defaultTokenServices();
+        if (properties.getEnableJwt()) {
+            defaultTokenServices.setTokenEnhancer(jwtAccessTokenConverter());
+        }
+        return new ResourceOwnerPasswordTokenGranter(authenticationManager, defaultTokenServices, redisClientDetailsService, oAuth2RequestFactory);
+    }
+
+    @Bean
+    public DefaultOAuth2RequestFactory oAuth2RequestFactory() {
+        return new DefaultOAuth2RequestFactory(redisClientDetailsService);
+    }
+
+}

+ 0 - 47
febs-auth/src/main/java/cc/mrbird/febs/auth/configure/FebsResourceServerConfigure.java

@@ -1,47 +0,0 @@
-package cc.mrbird.febs.auth.configure;
-
-import cc.mrbird.febs.auth.properties.FebsAuthProperties;
-import cc.mrbird.febs.common.entity.constant.EndpointConstant;
-import cc.mrbird.febs.common.handler.FebsAccessDeniedHandler;
-import cc.mrbird.febs.common.handler.FebsAuthExceptionEntryPoint;
-import lombok.RequiredArgsConstructor;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.security.config.annotation.web.builders.HttpSecurity;
-import org.springframework.security.oauth2.config.annotation.web.configuration.EnableResourceServer;
-import org.springframework.security.oauth2.config.annotation.web.configuration.ResourceServerConfigurerAdapter;
-import org.springframework.security.oauth2.config.annotation.web.configurers.ResourceServerSecurityConfigurer;
-
-/**
- * 资源服务器配置
- *
- * @author MrBird
- */
-@Configuration
-@EnableResourceServer
-@RequiredArgsConstructor
-public class FebsResourceServerConfigure extends ResourceServerConfigurerAdapter {
-
-    private final FebsAccessDeniedHandler accessDeniedHandler;
-    private final FebsAuthExceptionEntryPoint exceptionEntryPoint;
-    private final FebsAuthProperties properties;
-
-    @Override
-    public void configure(HttpSecurity http) throws Exception {
-        String[] anonUrls = StringUtils.splitByWholeSeparatorPreserveAllTokens(properties.getAnonUrl(), ",");
-
-        http.csrf().disable()
-                .requestMatchers().antMatchers(EndpointConstant.ALL)
-                .and()
-                .authorizeRequests()
-                .antMatchers(anonUrls).permitAll()
-                .antMatchers(EndpointConstant.ALL).authenticated()
-                .and().httpBasic();
-    }
-
-    @Override
-    public void configure(ResourceServerSecurityConfigurer resources) {
-        resources.authenticationEntryPoint(exceptionEntryPoint)
-                .accessDeniedHandler(accessDeniedHandler);
-    }
-}

+ 53 - 53
febs-auth/src/main/java/cc/mrbird/febs/auth/configure/FebsSecurityConfigure.java

@@ -1,53 +1,53 @@
-package cc.mrbird.febs.auth.configure;
-
-import cc.mrbird.febs.auth.filter.ValidateCodeFilter;
-import cc.mrbird.febs.common.entity.constant.EndpointConstant;
-import lombok.RequiredArgsConstructor;
-import org.springframework.context.annotation.Bean;
-import org.springframework.core.annotation.Order;
-import org.springframework.security.authentication.AuthenticationManager;
-import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
-import org.springframework.security.config.annotation.web.builders.HttpSecurity;
-import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
-import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
-import org.springframework.security.core.userdetails.UserDetailsService;
-import org.springframework.security.crypto.password.PasswordEncoder;
-import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
-
-/**
- * WebSecurity配置
- *
- * @author MrBird
- */
-@Order(2)
-@EnableWebSecurity
-@RequiredArgsConstructor
-public class FebsSecurityConfigure extends WebSecurityConfigurerAdapter {
-
-    private final UserDetailsService userDetailService;
-    private final ValidateCodeFilter validateCodeFilter;
-    private final PasswordEncoder passwordEncoder;
-
-    @Bean
-    @Override
-    public AuthenticationManager authenticationManagerBean() throws Exception {
-        return super.authenticationManagerBean();
-    }
-
-    @Override
-    protected void configure(HttpSecurity http) throws Exception {
-        http.addFilterBefore(validateCodeFilter, UsernamePasswordAuthenticationFilter.class)
-                .requestMatchers()
-                .antMatchers(EndpointConstant.OAUTH_ALL)
-                .and()
-                .authorizeRequests()
-                .antMatchers(EndpointConstant.OAUTH_ALL).authenticated()
-                .and()
-                .csrf().disable();
-    }
-
-    @Override
-    protected void configure(AuthenticationManagerBuilder auth) throws Exception {
-        auth.userDetailsService(userDetailService).passwordEncoder(passwordEncoder);
-    }
-}
+package cc.mrbird.febs.auth.configure;
+
+import cc.mrbird.febs.common.core.entity.constant.EndpointConstant;
+import cc.mrbird.febs.auth.filter.ValidateCodeFilter;
+import lombok.RequiredArgsConstructor;
+import org.springframework.context.annotation.Bean;
+import org.springframework.core.annotation.Order;
+import org.springframework.security.authentication.AuthenticationManager;
+import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
+import org.springframework.security.config.annotation.web.builders.HttpSecurity;
+import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
+import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
+import org.springframework.security.core.userdetails.UserDetailsService;
+import org.springframework.security.crypto.password.PasswordEncoder;
+import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
+
+/**
+ * WebSecurity配置
+ *
+ * @author MrBird
+ */
+@Order(2)
+@EnableWebSecurity
+@RequiredArgsConstructor
+public class FebsSecurityConfigure extends WebSecurityConfigurerAdapter {
+
+    private final UserDetailsService userDetailService;
+    private final ValidateCodeFilter validateCodeFilter;
+    private final PasswordEncoder passwordEncoder;
+
+    @Bean
+    @Override
+    public AuthenticationManager authenticationManagerBean() throws Exception {
+        return super.authenticationManagerBean();
+    }
+
+    @Override
+    protected void configure(HttpSecurity http) throws Exception {
+        http.addFilterBefore(validateCodeFilter, UsernamePasswordAuthenticationFilter.class)
+                .requestMatchers()
+                .antMatchers(EndpointConstant.OAUTH_ALL)
+                .and()
+                .authorizeRequests()
+                .antMatchers(EndpointConstant.OAUTH_ALL).authenticated()
+                .and()
+                .csrf().disable();
+    }
+
+    @Override
+    protected void configure(AuthenticationManagerBuilder auth) throws Exception {
+        auth.userDetailsService(userDetailService).passwordEncoder(passwordEncoder);
+    }
+}

+ 89 - 89
febs-auth/src/main/java/cc/mrbird/febs/auth/controller/OauthClientDetailsController.java

@@ -1,89 +1,89 @@
-package cc.mrbird.febs.auth.controller;
-
-import cc.mrbird.febs.auth.entity.OauthClientDetails;
-import cc.mrbird.febs.auth.service.OauthClientDetailsService;
-import cc.mrbird.febs.common.entity.FebsResponse;
-import cc.mrbird.febs.common.entity.QueryRequest;
-import cc.mrbird.febs.common.exception.FebsException;
-import cc.mrbird.febs.common.utils.FebsUtil;
-import lombok.RequiredArgsConstructor;
-import lombok.extern.slf4j.Slf4j;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.*;
-
-import javax.validation.Valid;
-import javax.validation.constraints.NotBlank;
-import java.util.Map;
-
-/**
- * @author Yuuki
- */
-@Slf4j
-@Validated
-@RestController
-@RequiredArgsConstructor
-@RequestMapping("client")
-public class OauthClientDetailsController {
-
-    private final OauthClientDetailsService oauthClientDetailsService;
-
-    @GetMapping("check/{clientId}")
-    public boolean checkUserName(@NotBlank(message = "{required}") @PathVariable String clientId) {
-        OauthClientDetails client = this.oauthClientDetailsService.findById(clientId);
-        return client == null;
-    }
-
-    @GetMapping("secret/{clientId}")
-    @PreAuthorize("hasAuthority('client:decrypt')")
-    public FebsResponse getOriginClientSecret(@NotBlank(message = "{required}") @PathVariable String clientId) {
-        OauthClientDetails client = this.oauthClientDetailsService.findById(clientId);
-        String origin = client != null ? client.getOriginSecret() : StringUtils.EMPTY;
-        return new FebsResponse().data(origin);
-    }
-
-    @GetMapping
-    @PreAuthorize("hasAuthority('client:view')")
-    public FebsResponse oauthCliendetailsList(QueryRequest request, OauthClientDetails oAuthClientDetails) {
-        Map<String, Object> dataTable = FebsUtil.getDataTable(this.oauthClientDetailsService.findOauthClientDetails(request, oAuthClientDetails));
-        return new FebsResponse().data(dataTable);
-    }
-
-
-    @PostMapping
-    @PreAuthorize("hasAuthority('client:add')")
-    public void addOauthCliendetails(@Valid OauthClientDetails oAuthClientDetails) throws FebsException {
-        try {
-            this.oauthClientDetailsService.createOauthClientDetails(oAuthClientDetails);
-        } catch (Exception e) {
-            String message = "新增客户端失败";
-            log.error(message, e);
-            throw new FebsException(message);
-        }
-    }
-
-    @DeleteMapping
-    @PreAuthorize("hasAuthority('client:delete')")
-    public void deleteOauthCliendetails(@NotBlank(message = "{required}") String clientIds) throws FebsException {
-        try {
-            this.oauthClientDetailsService.deleteOauthClientDetails(clientIds);
-        } catch (Exception e) {
-            String message = "删除客户端失败";
-            log.error(message, e);
-            throw new FebsException(message);
-        }
-    }
-
-    @PutMapping
-    @PreAuthorize("hasAuthority('client:update')")
-    public void updateOauthCliendetails(@Valid OauthClientDetails oAuthClientDetails) throws FebsException {
-        try {
-            this.oauthClientDetailsService.updateOauthClientDetails(oAuthClientDetails);
-        } catch (Exception e) {
-            String message = "修改客户端失败";
-            log.error(message, e);
-            throw new FebsException(message);
-        }
-    }
-}
+package cc.mrbird.febs.auth.controller;
+
+import cc.mrbird.febs.common.core.entity.FebsResponse;
+import cc.mrbird.febs.common.core.entity.QueryRequest;
+import cc.mrbird.febs.common.core.exception.FebsException;
+import cc.mrbird.febs.common.core.utils.FebsUtil;
+import cc.mrbird.febs.auth.entity.OauthClientDetails;
+import cc.mrbird.febs.auth.service.OauthClientDetailsService;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import javax.validation.Valid;
+import javax.validation.constraints.NotBlank;
+import java.util.Map;
+
+/**
+ * @author Yuuki
+ */
+@Slf4j
+@Validated
+@RestController
+@RequiredArgsConstructor
+@RequestMapping("client")
+public class OauthClientDetailsController {
+
+    private final OauthClientDetailsService oauthClientDetailsService;
+
+    @GetMapping("check/{clientId}")
+    public boolean checkUserName(@NotBlank(message = "{required}") @PathVariable String clientId) {
+        OauthClientDetails client = this.oauthClientDetailsService.findById(clientId);
+        return client == null;
+    }
+
+    @GetMapping("secret/{clientId}")
+    @PreAuthorize("hasAuthority('client:decrypt')")
+    public FebsResponse getOriginClientSecret(@NotBlank(message = "{required}") @PathVariable String clientId) {
+        OauthClientDetails client = this.oauthClientDetailsService.findById(clientId);
+        String origin = client != null ? client.getOriginSecret() : StringUtils.EMPTY;
+        return new FebsResponse().data(origin);
+    }
+
+    @GetMapping
+    @PreAuthorize("hasAuthority('client:view')")
+    public FebsResponse oauthCliendetailsList(QueryRequest request, OauthClientDetails oAuthClientDetails) {
+        Map<String, Object> dataTable = FebsUtil.getDataTable(this.oauthClientDetailsService.findOauthClientDetails(request, oAuthClientDetails));
+        return new FebsResponse().data(dataTable);
+    }
+
+
+    @PostMapping
+    @PreAuthorize("hasAuthority('client:add')")
+    public void addOauthCliendetails(@Valid OauthClientDetails oAuthClientDetails) throws FebsException {
+        try {
+            this.oauthClientDetailsService.createOauthClientDetails(oAuthClientDetails);
+        } catch (Exception e) {
+            String message = "新增客户端失败";
+            log.error(message, e);
+            throw new FebsException(message);
+        }
+    }
+
+    @DeleteMapping
+    @PreAuthorize("hasAuthority('client:delete')")
+    public void deleteOauthCliendetails(@NotBlank(message = "{required}") String clientIds) throws FebsException {
+        try {
+            this.oauthClientDetailsService.deleteOauthClientDetails(clientIds);
+        } catch (Exception e) {
+            String message = "删除客户端失败";
+            log.error(message, e);
+            throw new FebsException(message);
+        }
+    }
+
+    @PutMapping
+    @PreAuthorize("hasAuthority('client:update')")
+    public void updateOauthCliendetails(@Valid OauthClientDetails oAuthClientDetails) throws FebsException {
+        try {
+            this.oauthClientDetailsService.updateOauthClientDetails(oAuthClientDetails);
+        } catch (Exception e) {
+            String message = "修改客户端失败";
+            log.error(message, e);
+            throw new FebsException(message);
+        }
+    }
+}

+ 34 - 34
febs-auth/src/main/java/cc/mrbird/febs/auth/controller/SecurityController.java

@@ -1,34 +1,34 @@
-package cc.mrbird.febs.auth.controller;
-
-import cc.mrbird.febs.auth.manager.UserManager;
-import cc.mrbird.febs.auth.service.ValidateCodeService;
-import cc.mrbird.febs.common.exception.ValidateCodeException;
-import lombok.RequiredArgsConstructor;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-import java.security.Principal;
-
-/**
- * @author MrBird
- */
-@RestController
-@RequiredArgsConstructor
-public class SecurityController {
-
-    private final ValidateCodeService validateCodeService;
-    private final UserManager userManager;
-
-    @GetMapping("user")
-    public Principal currentUser(Principal principal) {
-        return principal;
-    }
-
-    @GetMapping("captcha")
-    public void captcha(HttpServletRequest request, HttpServletResponse response) throws IOException, ValidateCodeException {
-        validateCodeService.create(request, response);
-    }
-}
+package cc.mrbird.febs.auth.controller;
+
+import cc.mrbird.febs.common.core.exception.ValidateCodeException;
+import cc.mrbird.febs.auth.manager.UserManager;
+import cc.mrbird.febs.auth.service.ValidateCodeService;
+import lombok.RequiredArgsConstructor;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.security.Principal;
+
+/**
+ * @author MrBird
+ */
+@RestController
+@RequiredArgsConstructor
+public class SecurityController {
+
+    private final ValidateCodeService validateCodeService;
+    private final UserManager userManager;
+
+    @GetMapping("user")
+    public Principal currentUser(Principal principal) {
+        return principal;
+    }
+
+    @GetMapping("captcha")
+    public void captcha(HttpServletRequest request, HttpServletResponse response) throws IOException, ValidateCodeException {
+        validateCodeService.create(request, response);
+    }
+}

+ 149 - 149
febs-auth/src/main/java/cc/mrbird/febs/auth/controller/SocialLoginController.java

@@ -1,149 +1,149 @@
-package cc.mrbird.febs.auth.controller;
-
-import cc.mrbird.febs.auth.entity.BindUser;
-import cc.mrbird.febs.auth.entity.UserConnection;
-import cc.mrbird.febs.auth.service.SocialLoginService;
-import cc.mrbird.febs.common.entity.FebsResponse;
-import cc.mrbird.febs.common.exception.FebsException;
-import cc.mrbird.febs.common.utils.FebsUtil;
-import lombok.RequiredArgsConstructor;
-import lombok.extern.slf4j.Slf4j;
-import me.zhyd.oauth.model.AuthCallback;
-import me.zhyd.oauth.model.AuthUser;
-import me.zhyd.oauth.request.AuthRequest;
-import me.zhyd.oauth.utils.AuthStateUtils;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.security.oauth2.common.OAuth2AccessToken;
-import org.springframework.stereotype.Controller;
-import org.springframework.ui.Model;
-import org.springframework.web.bind.annotation.*;
-
-import javax.servlet.http.HttpServletResponse;
-import javax.validation.Valid;
-import javax.validation.constraints.NotBlank;
-import java.io.IOException;
-import java.util.List;
-
-/**
- * @author MrBird
- */
-@Slf4j
-@Controller
-@RequiredArgsConstructor
-@RequestMapping("social")
-public class SocialLoginController {
-
-    private static final String TYPE_LOGIN = "login";
-    private static final String TYPE_BIND = "bind";
-
-    private final SocialLoginService socialLoginService;
-    @Value("${febs.frontUrl}")
-    private String frontUrl;
-
-
-    /**
-     * 登录
-     *
-     * @param oauthType 第三方登录类型
-     * @param response  response
-     */
-    @ResponseBody
-    @GetMapping("/login/{oauthType}/{type}")
-    public void renderAuth(@PathVariable String oauthType, @PathVariable String type, HttpServletResponse response) throws IOException, FebsException {
-        AuthRequest authRequest = socialLoginService.renderAuth(oauthType);
-        response.sendRedirect(authRequest.authorize(oauthType + "::" + AuthStateUtils.createState()) + "::" + type);
-    }
-
-    /**
-     * 登录成功后的回调
-     *
-     * @param oauthType 第三方登录类型
-     * @param callback  携带返回的信息
-     * @return String
-     */
-    @GetMapping("/{oauthType}/callback")
-    public String login(@PathVariable String oauthType, AuthCallback callback, String state, Model model) {
-        try {
-            FebsResponse febsResponse = null;
-            String type = StringUtils.substringAfterLast(state, "::");
-            if (StringUtils.equals(type, TYPE_BIND)) {
-                febsResponse = socialLoginService.resolveBind(oauthType, callback);
-            } else {
-                febsResponse = socialLoginService.resolveLogin(oauthType, callback);
-            }
-            model.addAttribute("response", febsResponse);
-            model.addAttribute("frontUrl", frontUrl);
-            return "result";
-        } catch (Exception e) {
-            String errorMessage = FebsUtil.containChinese(e.getMessage()) ? e.getMessage() : "第三方登录失败";
-            model.addAttribute("error", e.getMessage());
-            return "error";
-        }
-    }
-
-    /**
-     * 绑定并登录
-     *
-     * @param bindUser bindUser
-     * @param authUser authUser
-     * @return FebsResponse
-     */
-    @ResponseBody
-    @PostMapping("bind/login")
-    public FebsResponse bindLogin(@Valid BindUser bindUser, AuthUser authUser) throws FebsException {
-        OAuth2AccessToken oAuth2AccessToken = this.socialLoginService.bindLogin(bindUser, authUser);
-        return new FebsResponse().data(oAuth2AccessToken);
-    }
-
-    /**
-     * 注册并登录
-     *
-     * @param registUser registUser
-     * @param authUser   authUser
-     * @return FebsResponse
-     */
-    @ResponseBody
-    @PostMapping("sign/login")
-    public FebsResponse signLogin(@Valid BindUser registUser, AuthUser authUser) throws FebsException {
-        OAuth2AccessToken oAuth2AccessToken = this.socialLoginService.signLogin(registUser, authUser);
-        return new FebsResponse().data(oAuth2AccessToken);
-    }
-
-    /**
-     * 绑定
-     *
-     * @param bindUser bindUser
-     * @param authUser authUser
-     */
-    @ResponseBody
-    @PostMapping("bind")
-    public void bind(BindUser bindUser, AuthUser authUser) throws FebsException {
-        this.socialLoginService.bind(bindUser, authUser);
-    }
-
-    /**
-     * 解绑
-     *
-     * @param bindUser  bindUser
-     * @param oauthType oauthType
-     */
-    @ResponseBody
-    @DeleteMapping("unbind")
-    public void unbind(BindUser bindUser, String oauthType) throws FebsException {
-        this.socialLoginService.unbind(bindUser, oauthType);
-    }
-
-    /**
-     * 根据用户名获取绑定关系
-     *
-     * @param username 用户名
-     * @return FebsResponse
-     */
-    @ResponseBody
-    @GetMapping("connections/{username}")
-    public FebsResponse findUserConnections(@NotBlank(message = "{required}") @PathVariable String username) {
-        List<UserConnection> userConnections = this.socialLoginService.findUserConnections(username);
-        return new FebsResponse().data(userConnections);
-    }
-}
+package cc.mrbird.febs.auth.controller;
+
+import cc.mrbird.febs.common.core.entity.FebsResponse;
+import cc.mrbird.febs.common.core.exception.FebsException;
+import cc.mrbird.febs.common.core.utils.FebsUtil;
+import cc.mrbird.febs.auth.entity.BindUser;
+import cc.mrbird.febs.auth.entity.UserConnection;
+import cc.mrbird.febs.auth.service.SocialLoginService;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import me.zhyd.oauth.model.AuthCallback;
+import me.zhyd.oauth.model.AuthUser;
+import me.zhyd.oauth.request.AuthRequest;
+import me.zhyd.oauth.utils.AuthStateUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.security.oauth2.common.OAuth2AccessToken;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import javax.validation.Valid;
+import javax.validation.constraints.NotBlank;
+import java.io.IOException;
+import java.util.List;
+
+/**
+ * @author MrBird
+ */
+@Slf4j
+@Controller
+@RequiredArgsConstructor
+@RequestMapping("social")
+public class SocialLoginController {
+
+    private static final String TYPE_LOGIN = "login";
+    private static final String TYPE_BIND = "bind";
+
+    private final SocialLoginService socialLoginService;
+    @Value("${febs.frontUrl}")
+    private String frontUrl;
+
+
+    /**
+     * 登录
+     *
+     * @param oauthType 第三方登录类型
+     * @param response  response
+     */
+    @ResponseBody
+    @GetMapping("/login/{oauthType}/{type}")
+    public void renderAuth(@PathVariable String oauthType, @PathVariable String type, HttpServletResponse response) throws IOException, FebsException {
+        AuthRequest authRequest = socialLoginService.renderAuth(oauthType);
+        response.sendRedirect(authRequest.authorize(oauthType + "::" + AuthStateUtils.createState()) + "::" + type);
+    }
+
+    /**
+     * 登录成功后的回调
+     *
+     * @param oauthType 第三方登录类型
+     * @param callback  携带返回的信息
+     * @return String
+     */
+    @GetMapping("/{oauthType}/callback")
+    public String login(@PathVariable String oauthType, AuthCallback callback, String state, Model model) {
+        try {
+            FebsResponse febsResponse = null;
+            String type = StringUtils.substringAfterLast(state, "::");
+            if (StringUtils.equals(type, TYPE_BIND)) {
+                febsResponse = socialLoginService.resolveBind(oauthType, callback);
+            } else {
+                febsResponse = socialLoginService.resolveLogin(oauthType, callback);
+            }
+            model.addAttribute("response", febsResponse);
+            model.addAttribute("frontUrl", frontUrl);
+            return "result";
+        } catch (Exception e) {
+            String errorMessage = FebsUtil.containChinese(e.getMessage()) ? e.getMessage() : "第三方登录失败";
+            model.addAttribute("error", e.getMessage());
+            return "error";
+        }
+    }
+
+    /**
+     * 绑定并登录
+     *
+     * @param bindUser bindUser
+     * @param authUser authUser
+     * @return FebsResponse
+     */
+    @ResponseBody
+    @PostMapping("bind/login")
+    public FebsResponse bindLogin(@Valid BindUser bindUser, AuthUser authUser) throws FebsException {
+        OAuth2AccessToken oAuth2AccessToken = this.socialLoginService.bindLogin(bindUser, authUser);
+        return new FebsResponse().data(oAuth2AccessToken);
+    }
+
+    /**
+     * 注册并登录
+     *
+     * @param registUser registUser
+     * @param authUser   authUser
+     * @return FebsResponse
+     */
+    @ResponseBody
+    @PostMapping("sign/login")
+    public FebsResponse signLogin(@Valid BindUser registUser, AuthUser authUser) throws FebsException {
+        OAuth2AccessToken oAuth2AccessToken = this.socialLoginService.signLogin(registUser, authUser);
+        return new FebsResponse().data(oAuth2AccessToken);
+    }
+
+    /**
+     * 绑定
+     *
+     * @param bindUser bindUser
+     * @param authUser authUser
+     */
+    @ResponseBody
+    @PostMapping("bind")
+    public void bind(BindUser bindUser, AuthUser authUser) throws FebsException {
+        this.socialLoginService.bind(bindUser, authUser);
+    }
+
+    /**
+     * 解绑
+     *
+     * @param bindUser  bindUser
+     * @param oauthType oauthType
+     */
+    @ResponseBody
+    @DeleteMapping("unbind")
+    public void unbind(BindUser bindUser, String oauthType) throws FebsException {
+        this.socialLoginService.unbind(bindUser, oauthType);
+    }
+
+    /**
+     * 根据用户名获取绑定关系
+     *
+     * @param username 用户名
+     * @return FebsResponse
+     */
+    @ResponseBody
+    @GetMapping("connections/{username}")
+    public FebsResponse findUserConnections(@NotBlank(message = "{required}") @PathVariable String username) {
+        List<UserConnection> userConnections = this.socialLoginService.findUserConnections(username);
+        return new FebsResponse().data(userConnections);
+    }
+}

+ 20 - 20
febs-auth/src/main/java/cc/mrbird/febs/auth/entity/BindUser.java

@@ -1,20 +1,20 @@
-package cc.mrbird.febs.auth.entity;
-
-import lombok.Data;
-
-import javax.validation.constraints.NotBlank;
-import java.io.Serializable;
-
-/**
- * @author MrBird
- */
-@Data
-public class BindUser implements Serializable {
-
-    private static final long serialVersionUID = -3890998115990166651L;
-
-    @NotBlank(message = "{required}")
-    private String bindUsername;
-    @NotBlank(message = "{required}")
-    private String bindPassword;
-}
+package cc.mrbird.febs.auth.entity;
+
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import java.io.Serializable;
+
+/**
+ * @author MrBird
+ */
+@Data
+public class BindUser implements Serializable {
+
+    private static final long serialVersionUID = -3890998115990166651L;
+
+    @NotBlank(message = "{required}")
+    private String bindUsername;
+    @NotBlank(message = "{required}")
+    private String bindPassword;
+}

+ 67 - 66
febs-auth/src/main/java/cc/mrbird/febs/auth/entity/OauthClientDetails.java

@@ -1,66 +1,67 @@
-package cc.mrbird.febs.auth.entity;
-
-import com.baomidou.mybatisplus.annotation.TableField;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-import lombok.Data;
-
-import javax.validation.constraints.NotBlank;
-import javax.validation.constraints.NotNull;
-import javax.validation.constraints.Size;
-import java.io.Serializable;
-
-/**
- * @author Yuuki
- */
-@Data
-@TableName("oauth_client_details")
-public class OauthClientDetails implements Serializable {
-
-    private static final long serialVersionUID = 421783821058285802L;
-
-    @TableId(value = "client_id")
-    @NotBlank(message = "{required}")
-    @Size(max = 255, message = "{noMoreThan}")
-    private String clientId;
-
-    @TableField("resource_ids")
-    @Size(max = 255, message = "{noMoreThan}")
-    private String resourceIds;
-
-    @TableField("client_secret")
-    @NotBlank(message = "{required}")
-    @Size(max = 255, message = "{noMoreThan}")
-    private String clientSecret;
-
-    @TableField("scope")
-    @NotBlank(message = "{required}")
-    @Size(max = 255, message = "{noMoreThan}")
-    private String scope;
-
-    @TableField("authorized_grant_types")
-    @NotBlank(message = "{required}")
-    @Size(max = 255, message = "{noMoreThan}")
-    private String authorizedGrantTypes;
-
-    @TableField("web_server_redirect_uri")
-    @Size(max = 255, message = "{noMoreThan}")
-    private String webServerRedirectUri;
-
-    @TableField("authorities")
-    @Size(max = 255, message = "{noMoreThan}")
-    private String authorities;
-
-    @TableField("access_token_validity")
-    @NotNull(message = "{required}")
-    private Integer accessTokenValidity;
-
-    @TableField("refresh_token_validity")
-    private Integer refreshTokenValidity;
-
-    @TableField("autoapprove")
-    private Byte autoapprove;
-
-    @TableField("origin_secret")
-    private String originSecret;
-}
+package cc.mrbird.febs.auth.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Size;
+import java.io.Serializable;
+
+/**
+ * @author Yuuki
+ */
+@Data
+@TableName("oauth_client_details")
+public class OauthClientDetails implements Serializable {
+
+    private static final long serialVersionUID = 421783821058285802L;
+
+    @TableId(value = "client_id")
+    @NotBlank(message = "{required}")
+    @Size(max = 255, message = "{noMoreThan}")
+    private String clientId;
+
+    @TableField("resource_ids")
+    @Size(max = 255, message = "{noMoreThan}")
+    private String resourceIds;
+
+    @TableField("client_secret")
+    @NotBlank(message = "{required}")
+    @Size(max = 255, message = "{noMoreThan}")
+    private String clientSecret;
+
+    @TableField("scope")
+    @NotBlank(message = "{required}")
+    @Size(max = 255, message = "{noMoreThan}")
+    private String scope;
+
+    @TableField("authorized_grant_types")
+    @NotBlank(message = "{required}")
+    @Size(max = 255, message = "{noMoreThan}")
+    private String authorizedGrantTypes;
+
+    @TableField("web_server_redirect_uri")
+    @Size(max = 255, message = "{noMoreThan}")
+    private String webServerRedirectUri;
+
+    @TableField("authorities")
+    @Size(max = 255, message = "{noMoreThan}")
+    private String authorities;
+
+    @TableField("access_token_validity")
+    @NotNull(message = "{required}")
+    private Integer accessTokenValidity;
+
+    @TableField("refresh_token_validity")
+    private Integer refreshTokenValidity;
+
+    @TableField("autoapprove")
+    private Byte autoapprove;
+
+    @TableField("origin_secret")
+    private String originSecret;
+
+}

+ 44 - 44
febs-auth/src/main/java/cc/mrbird/febs/auth/entity/UserConnection.java

@@ -1,45 +1,45 @@
-package cc.mrbird.febs.auth.entity;
-
-
-import com.baomidou.mybatisplus.annotation.TableField;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-import lombok.Data;
-
-import javax.validation.constraints.NotBlank;
-
-/**
- * @author MrBird
- */
-@Data
-@TableName("t_user_connection")
-public class UserConnection {
-
-    @TableId(value = "USER_NAME")
-    @NotBlank(message = "{required}")
-    private String userName;
-
-    @TableId(value = "PROVIDER_NAME")
-    @NotBlank(message = "{required}")
-    private String providerName;
-
-    @TableId(value = "PROVIDER_USER_ID")
-    @NotBlank(message = "{required}")
-    private String providerUserId;
-
-    @TableField(value = "PROVIDER_USER_NAME")
-    private String providerUserName;
-
-    @TableField(value = "NICK_NAME")
-    private String nickName;
-
-    @TableField("IMAGE_URL")
-    private String imageUrl;
-
-    @TableField("LOCATION")
-    private String location;
-
-    @TableField("REMARK")
-    private String remark;
-
+package cc.mrbird.febs.auth.entity;
+
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+
+/**
+ * @author MrBird
+ */
+@Data
+@TableName("t_user_connection")
+public class UserConnection {
+
+    @TableId(value = "USER_NAME")
+    @NotBlank(message = "{required}")
+    private String userName;
+
+    @TableId(value = "PROVIDER_NAME")
+    @NotBlank(message = "{required}")
+    private String providerName;
+
+    @TableId(value = "PROVIDER_USER_ID")
+    @NotBlank(message = "{required}")
+    private String providerUserId;
+
+    @TableField(value = "PROVIDER_USER_NAME")
+    private String providerUserName;
+
+    @TableField(value = "NICK_NAME")
+    private String nickName;
+
+    @TableField("IMAGE_URL")
+    private String imageUrl;
+
+    @TableField("LOCATION")
+    private String location;
+
+    @TableField("REMARK")
+    private String remark;
+
 }

+ 67 - 86
febs-auth/src/main/java/cc/mrbird/febs/auth/filter/ValidateCodeFilter.java

@@ -1,86 +1,67 @@
-package cc.mrbird.febs.auth.filter;
-
-import cc.mrbird.febs.auth.service.ValidateCodeService;
-import cc.mrbird.febs.common.entity.FebsResponse;
-import cc.mrbird.febs.common.entity.constant.EndpointConstant;
-import cc.mrbird.febs.common.entity.constant.GrantTypeConstant;
-import cc.mrbird.febs.common.entity.constant.ParamsConstant;
-import cc.mrbird.febs.common.exception.ValidateCodeException;
-import cc.mrbird.febs.common.utils.FebsUtil;
-import lombok.RequiredArgsConstructor;
-import lombok.extern.slf4j.Slf4j;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.http.HttpHeaders;
-import org.springframework.http.HttpMethod;
-import org.springframework.http.MediaType;
-import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
-import org.springframework.security.web.util.matcher.RequestMatcher;
-import org.springframework.stereotype.Component;
-import org.springframework.web.filter.OncePerRequestFilter;
-
-import javax.annotation.Nonnull;
-import javax.servlet.FilterChain;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-import java.nio.charset.StandardCharsets;
-import java.util.Base64;
-
-/**
- * 验证码过滤器
- *
- * @author MrBird
- */
-@Slf4j
-@Component
-@RequiredArgsConstructor
-public class ValidateCodeFilter extends OncePerRequestFilter {
-
-    private final ValidateCodeService validateCodeService;
-
-    @Override
-    protected void doFilterInternal(@Nonnull HttpServletRequest httpServletRequest, @Nonnull HttpServletResponse httpServletResponse, @Nonnull FilterChain filterChain) throws ServletException, IOException {
-        String header = httpServletRequest.getHeader(HttpHeaders.AUTHORIZATION);
-        String clientId = getClientId(header, httpServletRequest);
-
-        RequestMatcher matcher = new AntPathRequestMatcher(EndpointConstant.OAUTH_TOKEN, HttpMethod.POST.toString());
-        if (matcher.matches(httpServletRequest)
-                && StringUtils.equalsIgnoreCase(httpServletRequest.getParameter(ParamsConstant.GRANT_TYPE), GrantTypeConstant.PASSWORD)
-                && !StringUtils.equalsAnyIgnoreCase(clientId, "swagger")) {
-            try {
-                validateCode(httpServletRequest);
-                filterChain.doFilter(httpServletRequest, httpServletResponse);
-            } catch (ValidateCodeException e) {
-                FebsResponse febsResponse = new FebsResponse();
-                FebsUtil.makeResponse(httpServletResponse, MediaType.APPLICATION_JSON_VALUE,
-                        HttpServletResponse.SC_INTERNAL_SERVER_ERROR, febsResponse.message(e.getMessage()));
-                log.error(e.getMessage(), e);
-            }
-        } else {
-            filterChain.doFilter(httpServletRequest, httpServletResponse);
-        }
-    }
-
-    private void validateCode(HttpServletRequest httpServletRequest) throws ValidateCodeException {
-        String code = httpServletRequest.getParameter(ParamsConstant.VALIDATE_CODE_CODE);
-        String key = httpServletRequest.getParameter(ParamsConstant.VALIDATE_CODE_KEY);
-        validateCodeService.check(key, code);
-    }
-
-    private String getClientId(String header, HttpServletRequest request) {
-        String clientId = "";
-        try {
-            byte[] base64Token = header.substring(6).getBytes(StandardCharsets.UTF_8);
-            byte[] decoded;
-            decoded = Base64.getDecoder().decode(base64Token);
-            String token = new String(decoded, StandardCharsets.UTF_8);
-            int delim = token.indexOf(":");
-            if (delim != -1) {
-                clientId = new String[]{token.substring(0, delim), token.substring(delim + 1)}[0];
-            }
-        } catch (Exception ignore) {
-        }
-        return clientId;
-    }
-}
+package cc.mrbird.febs.auth.filter;
+
+import cc.mrbird.febs.auth.service.ValidateCodeService;
+import cc.mrbird.febs.common.core.entity.FebsResponse;
+import cc.mrbird.febs.common.core.entity.constant.EndpointConstant;
+import cc.mrbird.febs.common.core.entity.constant.GrantTypeConstant;
+import cc.mrbird.febs.common.core.entity.constant.ParamsConstant;
+import cc.mrbird.febs.common.core.exception.ValidateCodeException;
+import cc.mrbird.febs.common.core.utils.FebsUtil;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.MediaType;
+import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
+import org.springframework.security.web.util.matcher.RequestMatcher;
+import org.springframework.stereotype.Component;
+import org.springframework.web.filter.OncePerRequestFilter;
+
+import javax.annotation.Nonnull;
+import javax.servlet.FilterChain;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+
+/**
+ * 验证码过滤器
+ *
+ * @author MrBird
+ */
+@Slf4j
+@Component
+@RequiredArgsConstructor
+public class ValidateCodeFilter extends OncePerRequestFilter {
+
+    private final ValidateCodeService validateCodeService;
+
+    @Override
+    protected void doFilterInternal(@Nonnull HttpServletRequest httpServletRequest, @Nonnull HttpServletResponse httpServletResponse,
+                                    @Nonnull FilterChain filterChain) throws ServletException, IOException {
+        String header = httpServletRequest.getHeader(HttpHeaders.AUTHORIZATION);
+
+        RequestMatcher matcher = new AntPathRequestMatcher(EndpointConstant.OAUTH_TOKEN, HttpMethod.POST.toString());
+        if (matcher.matches(httpServletRequest)
+                && StringUtils.equalsIgnoreCase(httpServletRequest.getParameter(ParamsConstant.GRANT_TYPE), GrantTypeConstant.PASSWORD)) {
+            try {
+                validateCode(httpServletRequest);
+                filterChain.doFilter(httpServletRequest, httpServletResponse);
+            } catch (Exception e) {
+                FebsResponse febsResponse = new FebsResponse();
+                FebsUtil.makeResponse(httpServletResponse, MediaType.APPLICATION_JSON_VALUE,
+                        HttpServletResponse.SC_INTERNAL_SERVER_ERROR, febsResponse.message(e.getMessage()));
+                log.error(e.getMessage(), e);
+            }
+        } else {
+            filterChain.doFilter(httpServletRequest, httpServletResponse);
+        }
+    }
+
+    private void validateCode(HttpServletRequest httpServletRequest) throws ValidateCodeException {
+        String code = httpServletRequest.getParameter(ParamsConstant.VALIDATE_CODE_CODE);
+        String key = httpServletRequest.getParameter(ParamsConstant.VALIDATE_CODE_KEY);
+        validateCodeService.check(key, code);
+    }
+}

+ 1 - 1
febs-auth/src/main/java/cc/mrbird/febs/auth/handler/GlobalExceptionHandler.java

@@ -1,6 +1,6 @@
 package cc.mrbird.febs.auth.handler;
 
-import cc.mrbird.febs.common.handler.BaseExceptionHandler;
+import cc.mrbird.febs.common.core.handler.BaseExceptionHandler;
 import org.springframework.core.Ordered;
 import org.springframework.core.annotation.Order;
 import org.springframework.web.bind.annotation.RestControllerAdvice;

+ 86 - 80
febs-auth/src/main/java/cc/mrbird/febs/auth/manager/UserManager.java

@@ -1,80 +1,86 @@
-package cc.mrbird.febs.auth.manager;
-
-import cc.mrbird.febs.auth.mapper.MenuMapper;
-import cc.mrbird.febs.auth.mapper.UserMapper;
-import cc.mrbird.febs.auth.mapper.UserRoleMapper;
-import cc.mrbird.febs.common.entity.constant.FebsConstant;
-import cc.mrbird.febs.common.entity.system.Menu;
-import cc.mrbird.febs.common.entity.system.SystemUser;
-import cc.mrbird.febs.common.entity.system.UserRole;
-import lombok.RequiredArgsConstructor;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Propagation;
-import org.springframework.transaction.annotation.Transactional;
-
-import java.util.Date;
-import java.util.List;
-import java.util.stream.Collectors;
-
-/**
- * 用户业务逻辑
- *
- * @author MrBird
- */
-@Service
-@RequiredArgsConstructor
-@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
-public class UserManager {
-
-    private final UserMapper userMapper;
-    private final MenuMapper menuMapper;
-    private final UserRoleMapper userRoleMapper;
-
-    /**
-     * 通过用户名查询用户信息
-     *
-     * @param username 用户名
-     * @return 用户
-     */
-    public SystemUser findByName(String username) {
-        return userMapper.findByName(username);
-    }
-
-    /**
-     * 通过用户名查询用户权限串
-     *
-     * @param username 用户名
-     * @return 权限
-     */
-    public String findUserPermissions(String username) {
-        List<Menu> userPermissions = menuMapper.findUserPermissions(username);
-        return userPermissions.stream().map(Menu::getPerms).collect(Collectors.joining(","));
-    }
-
-    /**
-     * 注册用户
-     *
-     * @param username username
-     * @param password password
-     * @return SystemUser SystemUser
-     */
-    @Transactional(rollbackFor = Exception.class)
-    public SystemUser registUser(String username, String password) {
-        SystemUser systemUser = new SystemUser();
-        systemUser.setUsername(username);
-        systemUser.setPassword(password);
-        systemUser.setCreateTime(new Date());
-        systemUser.setStatus(SystemUser.STATUS_VALID);
-        systemUser.setSex(SystemUser.SEX_UNKNOW);
-        systemUser.setAvatar(SystemUser.DEFAULT_AVATAR);
-        systemUser.setDescription("注册用户");
-        this.userMapper.insert(systemUser);
-
-        UserRole userRole = new UserRole();
-        userRole.setUserId(systemUser.getUserId());
-        // 注册用户角色 ID
-        userRole.setRoleId(FebsConstant.REGISTER_ROLE_ID);
-        this.userRoleMapper.insert(userRole);
-        return systemUser;
-    }
-}
+package cc.mrbird.febs.auth.manager;
+
+import cc.mrbird.febs.auth.mapper.MenuMapper;
+import cc.mrbird.febs.auth.mapper.UserMapper;
+import cc.mrbird.febs.auth.mapper.UserRoleMapper;
+import cc.mrbird.febs.common.core.entity.constant.FebsConstant;
+import cc.mrbird.febs.common.core.entity.system.Menu;
+import cc.mrbird.febs.common.core.entity.system.SystemUser;
+import cc.mrbird.febs.common.core.entity.system.UserDataPermission;
+import cc.mrbird.febs.common.core.entity.system.UserRole;
+import com.baomidou.mybatisplus.core.toolkit.StringPool;
+import lombok.RequiredArgsConstructor;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Propagation;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.Date;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * 用户业务逻辑
+ *
+ * @author MrBird
+ */
+@Service
+@RequiredArgsConstructor
+@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
+public class UserManager {
+
+    private final UserMapper userMapper;
+    private final MenuMapper menuMapper;
+    private final UserRoleMapper userRoleMapper;
+
+    /**
+     * 通过用户名查询用户信息
+     *
+     * @param username 用户名
+     * @return 用户
+     */
+    public SystemUser findByName(String username) {
+        SystemUser user = userMapper.findByName(username);
+        List<UserDataPermission> permissions = userMapper.findUserDataPermissions(user.getUserId());
+        String deptIds = permissions.stream().map(p -> String.valueOf(p.getDeptId())).collect(Collectors.joining(StringPool.COMMA));
+        user.setDeptIds(deptIds);
+        return user;
+    }
+
+    /**
+     * 通过用户名查询用户权限串
+     *
+     * @param username 用户名
+     * @return 权限
+     */
+    public String findUserPermissions(String username) {
+        List<Menu> userPermissions = menuMapper.findUserPermissions(username);
+        return userPermissions.stream().map(Menu::getPerms).collect(Collectors.joining(","));
+    }
+
+    /**
+     * 注册用户
+     *
+     * @param username username
+     * @param password password
+     * @return SystemUser SystemUser
+     */
+    @Transactional(rollbackFor = Exception.class)
+    public SystemUser registUser(String username, String password) {
+        SystemUser systemUser = new SystemUser();
+        systemUser.setUsername(username);
+        systemUser.setPassword(password);
+        systemUser.setCreateTime(new Date());
+        systemUser.setStatus(SystemUser.STATUS_VALID);
+        systemUser.setSex(SystemUser.SEX_UNKNOW);
+        systemUser.setAvatar(SystemUser.DEFAULT_AVATAR);
+        systemUser.setDescription("注册用户");
+        this.userMapper.insert(systemUser);
+
+        UserRole userRole = new UserRole();
+        userRole.setUserId(systemUser.getUserId());
+        // 注册用户角色 ID
+        userRole.setRoleId(FebsConstant.REGISTER_ROLE_ID);
+        this.userRoleMapper.insert(userRole);
+        return systemUser;
+    }
+}

+ 19 - 19
febs-auth/src/main/java/cc/mrbird/febs/auth/mapper/MenuMapper.java

@@ -1,20 +1,20 @@
-package cc.mrbird.febs.auth.mapper;
-
-import cc.mrbird.febs.common.entity.system.Menu;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-
-import java.util.List;
-
-/**
- * @author MrBird
- */
-public interface MenuMapper extends BaseMapper<Menu> {
-
-    /**
-     * 获取用户权限集
-     *
-     * @param username 用户名
-     * @return 权限集合
-     */
-    List<Menu> findUserPermissions(String username);
+package cc.mrbird.febs.auth.mapper;
+
+import cc.mrbird.febs.common.core.entity.system.Menu;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+import java.util.List;
+
+/**
+ * @author MrBird
+ */
+public interface MenuMapper extends BaseMapper<Menu> {
+
+    /**
+     * 获取用户权限集
+     *
+     * @param username 用户名
+     * @return 权限集合
+     */
+    List<Menu> findUserPermissions(String username);
 }

+ 10 - 10
febs-auth/src/main/java/cc/mrbird/febs/auth/mapper/OauthClientDetailsMapper.java

@@ -1,10 +1,10 @@
-package cc.mrbird.febs.auth.mapper;
-
-import cc.mrbird.febs.auth.entity.OauthClientDetails;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-
-/**
- * @author Yuuki
- */
-public interface OauthClientDetailsMapper extends BaseMapper<OauthClientDetails> {
-}
+package cc.mrbird.febs.auth.mapper;
+
+import cc.mrbird.febs.auth.entity.OauthClientDetails;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * @author Yuuki
+ */
+public interface OauthClientDetailsMapper extends BaseMapper<OauthClientDetails> {
+}

+ 12 - 1
febs-auth/src/main/java/cc/mrbird/febs/auth/mapper/UserMapper.java

@@ -1,8 +1,11 @@
 package cc.mrbird.febs.auth.mapper;
 
-import cc.mrbird.febs.common.entity.system.SystemUser;
+import cc.mrbird.febs.common.core.entity.system.SystemUser;
+import cc.mrbird.febs.common.core.entity.system.UserDataPermission;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
+import java.util.List;
+
 /**
  * @author MrBird
  */
@@ -15,4 +18,12 @@ public interface UserMapper extends BaseMapper<SystemUser> {
      * @return 用户
      */
     SystemUser findByName(String username);
+
+    /**
+     * 获取用户数据权限
+     *
+     * @param userId 用户id
+     * @return 数据权限
+     */
+    List<UserDataPermission> findUserDataPermissions(Long userId);
 }

+ 1 - 1
febs-auth/src/main/java/cc/mrbird/febs/auth/mapper/UserRoleMapper.java

@@ -1,6 +1,6 @@
 package cc.mrbird.febs.auth.mapper;
 
-import cc.mrbird.febs.common.entity.system.UserRole;
+import cc.mrbird.febs.common.core.entity.system.UserRole;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
 /**

+ 33 - 38
febs-auth/src/main/java/cc/mrbird/febs/auth/properties/FebsAuthProperties.java

@@ -1,38 +1,33 @@
-package cc.mrbird.febs.auth.properties;
-
-import lombok.Data;
-import org.springframework.boot.SpringBootConfiguration;
-import org.springframework.boot.context.properties.ConfigurationProperties;
-import org.springframework.context.annotation.PropertySource;
-
-/**
- * @author MrBird
- */
-@Data
-@SpringBootConfiguration
-@PropertySource(value = {"classpath:febs-auth.properties"})
-@ConfigurationProperties(prefix = "febs.auth")
-public class FebsAuthProperties {
-
-    /**
-     * 免认证访问路径
-     */
-    private String anonUrl;
-    /**
-     * 验证码配置
-     */
-    private FebsValidateCodeProperties code = new FebsValidateCodeProperties();
-    /**
-     * JWT加签密钥
-     */
-    private String jwtAccessKey;
-    /**
-     * 是否使用 JWT令牌
-     */
-    private Boolean enableJwt;
-
-    /**
-     * 社交登录所使用的 Client
-     */
-    private String socialLoginClientId;
-}
+package cc.mrbird.febs.auth.properties;
+
+import lombok.Data;
+import org.springframework.boot.SpringBootConfiguration;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.PropertySource;
+
+/**
+ * @author MrBird
+ */
+@Data
+@SpringBootConfiguration
+@PropertySource(value = {"classpath:febs-auth.properties"})
+@ConfigurationProperties(prefix = "febs.auth")
+public class FebsAuthProperties {
+    /**
+     * 验证码配置
+     */
+    private FebsValidateCodeProperties code = new FebsValidateCodeProperties();
+    /**
+     * JWT加签密钥
+     */
+    private String jwtAccessKey;
+    /**
+     * 是否使用 JWT令牌
+     */
+    private Boolean enableJwt;
+
+    /**
+     * 社交登录所使用的 Client
+     */
+    private String socialLoginClientId;
+}

+ 1 - 1
febs-auth/src/main/java/cc/mrbird/febs/auth/properties/FebsValidateCodeProperties.java

@@ -1,6 +1,6 @@
 package cc.mrbird.febs.auth.properties;
 
-import cc.mrbird.febs.common.entity.constant.ImageTypeConstant;
+import cc.mrbird.febs.common.core.entity.constant.ImageTypeConstant;
 import lombok.Data;
 
 /**

+ 27 - 37
febs-auth/src/main/java/cc/mrbird/febs/auth/runner/StartedUpRunner.java

@@ -1,37 +1,27 @@
-package cc.mrbird.febs.auth.runner;
-
-import cc.mrbird.febs.common.entity.constant.FebsServerConstant;
-import lombok.RequiredArgsConstructor;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.boot.ApplicationArguments;
-import org.springframework.boot.ApplicationRunner;
-import org.springframework.context.ConfigurableApplicationContext;
-import org.springframework.stereotype.Component;
-
-import java.time.LocalDateTime;
-
-/**
- * @author MrBird
- */
-@Slf4j
-@Component
-@RequiredArgsConstructor
-public class StartedUpRunner implements ApplicationRunner {
-
-    private final ConfigurableApplicationContext context;
-
-    @Value("${spring.application.name:'" + FebsServerConstant.FEBS_AUTH + "'}")
-    private String applicationName;
-
-    @Override
-    public void run(ApplicationArguments args) {
-        if (context.isActive()) {
-            log.info("  _   _   _   _   _   _   _   _");
-            log.info(" / \\ / \\ / \\ / \\ / \\ / \\ / \\ / \\");
-            log.info("( c | o | m | p | l | e | t | e )");
-            log.info(" \\_/ \\_/ \\_/ \\_/ \\_/ \\_/ \\_/ \\_/");
-            log.info("{} 启动完毕,时间:{}", applicationName, LocalDateTime.now());
-        }
-    }
-}
+package cc.mrbird.febs.auth.runner;
+
+import cc.mrbird.febs.common.core.utils.FebsUtil;
+import lombok.RequiredArgsConstructor;
+import org.springframework.boot.ApplicationArguments;
+import org.springframework.boot.ApplicationRunner;
+import org.springframework.context.ConfigurableApplicationContext;
+import org.springframework.core.env.Environment;
+import org.springframework.stereotype.Component;
+
+/**
+ * @author MrBird
+ */
+@Component
+@RequiredArgsConstructor
+public class StartedUpRunner implements ApplicationRunner {
+
+    private final ConfigurableApplicationContext context;
+    private final Environment environment;
+
+    @Override
+    public void run(ApplicationArguments args) {
+        if (context.isActive()) {
+            FebsUtil.printSystemUpBanner(environment);
+        }
+    }
+}

+ 52 - 52
febs-auth/src/main/java/cc/mrbird/febs/auth/service/OauthClientDetailsService.java

@@ -1,52 +1,52 @@
-package cc.mrbird.febs.auth.service;
-
-import cc.mrbird.febs.auth.entity.OauthClientDetails;
-import cc.mrbird.febs.common.entity.QueryRequest;
-import cc.mrbird.febs.common.exception.FebsException;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.service.IService;
-
-/**
- * @author Yuuki
- */
-public interface OauthClientDetailsService extends IService<OauthClientDetails> {
-
-    /**
-     * 查询(分页)
-     *
-     * @param request            QueryRequest
-     * @param oauthClientDetails oauthClientDetails
-     * @return IPage<OauthClientDetails>
-     */
-    IPage<OauthClientDetails> findOauthClientDetails(QueryRequest request, OauthClientDetails oauthClientDetails);
-
-    /**
-     * 根据主键查询
-     *
-     * @param clientId clientId
-     * @return OauthClientDetails
-     */
-    OauthClientDetails findById(String clientId);
-
-    /**
-     * 新增
-     *
-     * @param oauthClientDetails oauthClientDetails
-     * @throws FebsException FebsException
-     */
-    void createOauthClientDetails(OauthClientDetails oauthClientDetails) throws FebsException;
-
-    /**
-     * 修改
-     *
-     * @param oauthClientDetails oauthClientDetails
-     */
-    void updateOauthClientDetails(OauthClientDetails oauthClientDetails);
-
-    /**
-     * 删除
-     *
-     * @param clientIds clientIds
-     */
-    void deleteOauthClientDetails(String clientIds);
-}
+package cc.mrbird.febs.auth.service;
+
+import cc.mrbird.febs.common.core.entity.QueryRequest;
+import cc.mrbird.febs.common.core.exception.FebsException;
+import cc.mrbird.febs.auth.entity.OauthClientDetails;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * @author Yuuki
+ */
+public interface OauthClientDetailsService extends IService<OauthClientDetails> {
+
+    /**
+     * 查询(分页)
+     *
+     * @param request            QueryRequest
+     * @param oauthClientDetails oauthClientDetails
+     * @return IPage<OauthClientDetails>
+     */
+    IPage<OauthClientDetails> findOauthClientDetails(QueryRequest request, OauthClientDetails oauthClientDetails);
+
+    /**
+     * 根据主键查询
+     *
+     * @param clientId clientId
+     * @return OauthClientDetails
+     */
+    OauthClientDetails findById(String clientId);
+
+    /**
+     * 新增
+     *
+     * @param oauthClientDetails oauthClientDetails
+     * @throws FebsException FebsException
+     */
+    void createOauthClientDetails(OauthClientDetails oauthClientDetails) throws FebsException;
+
+    /**
+     * 修改
+     *
+     * @param oauthClientDetails oauthClientDetails
+     */
+    void updateOauthClientDetails(OauthClientDetails oauthClientDetails);
+
+    /**
+     * 删除
+     *
+     * @param clientIds clientIds
+     */
+    void deleteOauthClientDetails(String clientIds);
+}

+ 93 - 93
febs-auth/src/main/java/cc/mrbird/febs/auth/service/SocialLoginService.java

@@ -1,93 +1,93 @@
-package cc.mrbird.febs.auth.service;
-
-import cc.mrbird.febs.auth.entity.BindUser;
-import cc.mrbird.febs.auth.entity.UserConnection;
-import cc.mrbird.febs.common.entity.FebsResponse;
-import cc.mrbird.febs.common.exception.FebsException;
-import me.zhyd.oauth.model.AuthCallback;
-import me.zhyd.oauth.model.AuthUser;
-import me.zhyd.oauth.request.AuthRequest;
-import org.springframework.security.oauth2.common.OAuth2AccessToken;
-
-import java.util.List;
-
-/**
- * @author MrBird
- */
-public interface SocialLoginService {
-
-    /**
-     * 解析第三方登录请求
-     *
-     * @param oauthType 第三方平台类型
-     * @return AuthRequest
-     * @throws FebsException 异常
-     */
-    AuthRequest renderAuth(String oauthType) throws FebsException;
-
-    /**
-     * 处理第三方登录(绑定页面)
-     *
-     * @param oauthType 第三方平台类型
-     * @param callback  回调
-     * @return FebsResponse
-     * @throws FebsException 异常
-     */
-    FebsResponse resolveBind(String oauthType, AuthCallback callback) throws FebsException;
-
-    /**
-     * 处理第三方登录(登录页面)
-     *
-     * @param oauthType 第三方平台类型
-     * @param callback  回调
-     * @return FebsResponse
-     * @throws FebsException 异常
-     */
-    FebsResponse resolveLogin(String oauthType, AuthCallback callback) throws FebsException;
-
-    /**
-     * 绑定并登录
-     *
-     * @param bindUser 绑定用户
-     * @param authUser 第三方平台对象
-     * @return OAuth2AccessToken 令牌对象
-     * @throws FebsException 异常
-     */
-    OAuth2AccessToken bindLogin(BindUser bindUser, AuthUser authUser) throws FebsException;
-
-    /**
-     * 注册并登录
-     *
-     * @param registUser 注册用户
-     * @param authUser   第三方平台对象
-     * @return OAuth2AccessToken 令牌对象
-     * @throws FebsException 异常
-     */
-    OAuth2AccessToken signLogin(BindUser registUser, AuthUser authUser) throws FebsException;
-
-    /**
-     * 绑定
-     *
-     * @param bindUser 绑定对象
-     * @param authUser 第三方平台对象
-     * @throws FebsException 异常
-     */
-    void bind(BindUser bindUser, AuthUser authUser) throws FebsException;
-
-    /**
-     * 解绑
-     *
-     * @param bindUser  绑定对象
-     * @param oauthType 第三方平台对象
-     * @throws FebsException 异常
-     */
-    void unbind(BindUser bindUser, String oauthType) throws FebsException;
-
-    /**
-     * 根据用户名获取绑定关系
-     *
-     * @param username 用户名
-     * @return 绑定关系集合
-     */
-    List<UserConnection> findUserConnections(String username);
-}
+package cc.mrbird.febs.auth.service;
+
+import cc.mrbird.febs.common.core.entity.FebsResponse;
+import cc.mrbird.febs.common.core.exception.FebsException;
+import cc.mrbird.febs.auth.entity.BindUser;
+import cc.mrbird.febs.auth.entity.UserConnection;
+import me.zhyd.oauth.model.AuthCallback;
+import me.zhyd.oauth.model.AuthUser;
+import me.zhyd.oauth.request.AuthRequest;
+import org.springframework.security.oauth2.common.OAuth2AccessToken;
+
+import java.util.List;
+
+/**
+ * @author MrBird
+ */
+public interface SocialLoginService {
+
+    /**
+     * 解析第三方登录请求
+     *
+     * @param oauthType 第三方平台类型
+     * @return AuthRequest
+     * @throws FebsException 异常
+     */
+    AuthRequest renderAuth(String oauthType) throws FebsException;
+
+    /**
+     * 处理第三方登录(绑定页面)
+     *
+     * @param oauthType 第三方平台类型
+     * @param callback  回调
+     * @return FebsResponse
+     * @throws FebsException 异常
+     */
+    FebsResponse resolveBind(String oauthType, AuthCallback callback) throws FebsException;
+
+    /**
+     * 处理第三方登录(登录页面)
+     *
+     * @param oauthType 第三方平台类型
+     * @param callback  回调
+     * @return FebsResponse
+     * @throws FebsException 异常
+     */
+    FebsResponse resolveLogin(String oauthType, AuthCallback callback) throws FebsException;
+
+    /**
+     * 绑定并登录
+     *
+     * @param bindUser 绑定用户
+     * @param authUser 第三方平台对象
+     * @return OAuth2AccessToken 令牌对象
+     * @throws FebsException 异常
+     */
+    OAuth2AccessToken bindLogin(BindUser bindUser, AuthUser authUser) throws FebsException;
+
+    /**
+     * 注册并登录
+     *
+     * @param registUser 注册用户
+     * @param authUser   第三方平台对象
+     * @return OAuth2AccessToken 令牌对象
+     * @throws FebsException 异常
+     */
+    OAuth2AccessToken signLogin(BindUser registUser, AuthUser authUser) throws FebsException;
+
+    /**
+     * 绑定
+     *
+     * @param bindUser 绑定对象
+     * @param authUser 第三方平台对象
+     * @throws FebsException 异常
+     */
+    void bind(BindUser bindUser, AuthUser authUser) throws FebsException;
+
+    /**
+     * 解绑
+     *
+     * @param bindUser  绑定对象
+     * @param oauthType 第三方平台对象
+     * @throws FebsException 异常
+     */
+    void unbind(BindUser bindUser, String oauthType) throws FebsException;
+
+    /**
+     * 根据用户名获取绑定关系
+     *
+     * @param username 用户名
+     * @return 绑定关系集合
+     */
+    List<UserConnection> findUserConnections(String username);
+}

+ 31 - 29
febs-auth/src/main/java/cc/mrbird/febs/auth/service/ValidateCodeService.java

@@ -1,29 +1,31 @@
-package cc.mrbird.febs.auth.service;
-
-import cc.mrbird.febs.common.exception.ValidateCodeException;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-
-/**
- * @author MrBird
- */
-public interface ValidateCodeService {
-
-    /**
-     * 生成验证码
-     *
-     * @param request  HttpServletRequest
-     * @param response HttpServletResponse
-     */
-    void create(HttpServletRequest request, HttpServletResponse response) throws IOException, ValidateCodeException;
-
-    /**
-     * 校验验证码
-     *
-     * @param key   前端上送 key
-     * @param value 前端上送待校验值
-     */
-    void check(String key, String value) throws ValidateCodeException;
-}
+package cc.mrbird.febs.auth.service;
+
+import cc.mrbird.febs.common.core.exception.ValidateCodeException;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+
+/**
+ * @author MrBird
+ */
+public interface ValidateCodeService {
+
+    /**
+     * 生成验证码
+     *
+     * @param request  HttpServletRequest
+     * @param response HttpServletResponse
+     * @throws ValidateCodeException 验证码异常
+     */
+    void create(HttpServletRequest request, HttpServletResponse response) throws IOException, ValidateCodeException;
+
+    /**
+     * 校验验证码
+     *
+     * @param key   前端上送 key
+     * @param value 前端上送待校验值
+     * @throws ValidateCodeException 验证码异常
+     */
+    void check(String key, String value) throws ValidateCodeException;
+}

+ 5 - 5
febs-auth/src/main/java/cc/mrbird/febs/auth/service/impl/FebsUserDetailServiceImpl.java

@@ -1,11 +1,11 @@
 package cc.mrbird.febs.auth.service.impl;
 
+import cc.mrbird.febs.common.core.entity.FebsAuthUser;
+import cc.mrbird.febs.common.core.entity.constant.ParamsConstant;
+import cc.mrbird.febs.common.core.entity.constant.SocialConstant;
+import cc.mrbird.febs.common.core.entity.system.SystemUser;
+import cc.mrbird.febs.common.core.utils.FebsUtil;
 import cc.mrbird.febs.auth.manager.UserManager;
-import cc.mrbird.febs.common.entity.FebsAuthUser;
-import cc.mrbird.febs.common.entity.constant.ParamsConstant;
-import cc.mrbird.febs.common.entity.constant.SocialConstant;
-import cc.mrbird.febs.common.entity.system.SystemUser;
-import cc.mrbird.febs.common.utils.FebsUtil;
 import lombok.RequiredArgsConstructor;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.BeanUtils;

+ 107 - 107
febs-auth/src/main/java/cc/mrbird/febs/auth/service/impl/OauthClientDetailsServiceImpl.java

@@ -1,107 +1,107 @@
-package cc.mrbird.febs.auth.service.impl;
-
-import cc.mrbird.febs.auth.entity.OauthClientDetails;
-import cc.mrbird.febs.auth.mapper.OauthClientDetailsMapper;
-import cc.mrbird.febs.auth.service.OauthClientDetailsService;
-import cc.mrbird.febs.common.entity.QueryRequest;
-import cc.mrbird.febs.common.exception.FebsException;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import lombok.RequiredArgsConstructor;
-import lombok.extern.slf4j.Slf4j;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.security.crypto.password.PasswordEncoder;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Propagation;
-import org.springframework.transaction.annotation.Transactional;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-/**
- * @author Yuuki
- */
-@Slf4j
-@Service
-@RequiredArgsConstructor
-@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
-public class OauthClientDetailsServiceImpl extends ServiceImpl<OauthClientDetailsMapper, OauthClientDetails> implements OauthClientDetailsService {
-
-    private final PasswordEncoder passwordEncoder;
-    private final RedisClientDetailsService redisClientDetailsService;
-
-    @Override
-    public IPage<OauthClientDetails> findOauthClientDetails(QueryRequest request, OauthClientDetails oauthClientDetails) {
-        LambdaQueryWrapper<OauthClientDetails> queryWrapper = new LambdaQueryWrapper<>();
-        if (StringUtils.isNotBlank(oauthClientDetails.getClientId())) {
-            queryWrapper.eq(OauthClientDetails::getClientId, oauthClientDetails.getClientId());
-        }
-        Page<OauthClientDetails> page = new Page<>(request.getPageNum(), request.getPageSize());
-        IPage<OauthClientDetails> result = this.page(page, queryWrapper);
-
-        List<OauthClientDetails> records = new ArrayList<>();
-        result.getRecords().forEach(o -> {
-            o.setOriginSecret(null);
-            o.setClientSecret(null);
-            records.add(o);
-        });
-        result.setRecords(records);
-        return result;
-    }
-
-    @Override
-    public OauthClientDetails findById(String clientId) {
-        return this.baseMapper.selectById(clientId);
-    }
-
-    @Override
-    @Transactional(rollbackFor = Exception.class)
-    public void createOauthClientDetails(OauthClientDetails oauthClientDetails) throws FebsException {
-        OauthClientDetails byId = this.findById(oauthClientDetails.getClientId());
-        if (byId != null) {
-            throw new FebsException("该Client已存在");
-        }
-        oauthClientDetails.setOriginSecret(oauthClientDetails.getClientSecret());
-        oauthClientDetails.setClientSecret(passwordEncoder.encode(oauthClientDetails.getClientSecret()));
-        boolean saved = this.save(oauthClientDetails);
-        if (saved) {
-            log.info("缓存Client -> {}", oauthClientDetails);
-            this.redisClientDetailsService.loadClientByClientId(oauthClientDetails.getClientId());
-        }
-    }
-
-    @Override
-    @Transactional(rollbackFor = Exception.class)
-    public void updateOauthClientDetails(OauthClientDetails oauthClientDetails) {
-        String clientId = oauthClientDetails.getClientId();
-
-        LambdaQueryWrapper<OauthClientDetails> queryWrapper = new LambdaQueryWrapper<>();
-        queryWrapper.eq(OauthClientDetails::getClientId, oauthClientDetails.getClientId());
-
-        oauthClientDetails.setClientId(null);
-        oauthClientDetails.setClientSecret(null);
-        boolean updated = this.update(oauthClientDetails, queryWrapper);
-        if (updated) {
-            log.info("更新Client -> {}", oauthClientDetails);
-            this.redisClientDetailsService.removeRedisCache(clientId);
-            this.redisClientDetailsService.loadClientByClientId(clientId);
-        }
-    }
-
-    @Override
-    @Transactional(rollbackFor = Exception.class)
-    public void deleteOauthClientDetails(String clientIds) {
-        Object[] clientIdArray = StringUtils.splitByWholeSeparatorPreserveAllTokens(clientIds, ",");
-        LambdaQueryWrapper<OauthClientDetails> queryWrapper = new LambdaQueryWrapper<>();
-        queryWrapper.in(OauthClientDetails::getClientId, clientIdArray);
-        boolean removed = this.remove(queryWrapper);
-        if (removed) {
-            log.info("删除ClientId为({})的Client", clientIds);
-            Arrays.stream(clientIdArray).forEach(c -> this.redisClientDetailsService.removeRedisCache(String.valueOf(c)));
-
-        }
-    }
-}
+package cc.mrbird.febs.auth.service.impl;
+
+import cc.mrbird.febs.common.core.entity.QueryRequest;
+import cc.mrbird.febs.common.core.exception.FebsException;
+import cc.mrbird.febs.auth.entity.OauthClientDetails;
+import cc.mrbird.febs.auth.mapper.OauthClientDetailsMapper;
+import cc.mrbird.febs.auth.service.OauthClientDetailsService;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.security.crypto.password.PasswordEncoder;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Propagation;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * @author Yuuki
+ */
+@Slf4j
+@Service
+@RequiredArgsConstructor
+@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
+public class OauthClientDetailsServiceImpl extends ServiceImpl<OauthClientDetailsMapper, OauthClientDetails> implements OauthClientDetailsService {
+
+    private final PasswordEncoder passwordEncoder;
+    private final RedisClientDetailsService redisClientDetailsService;
+
+    @Override
+    public IPage<OauthClientDetails> findOauthClientDetails(QueryRequest request, OauthClientDetails oauthClientDetails) {
+        LambdaQueryWrapper<OauthClientDetails> queryWrapper = new LambdaQueryWrapper<>();
+        if (StringUtils.isNotBlank(oauthClientDetails.getClientId())) {
+            queryWrapper.eq(OauthClientDetails::getClientId, oauthClientDetails.getClientId());
+        }
+        Page<OauthClientDetails> page = new Page<>(request.getPageNum(), request.getPageSize());
+        IPage<OauthClientDetails> result = this.page(page, queryWrapper);
+
+        List<OauthClientDetails> records = new ArrayList<>();
+        result.getRecords().forEach(o -> {
+            o.setOriginSecret(null);
+            o.setClientSecret(null);
+            records.add(o);
+        });
+        result.setRecords(records);
+        return result;
+    }
+
+    @Override
+    public OauthClientDetails findById(String clientId) {
+        return this.baseMapper.selectById(clientId);
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void createOauthClientDetails(OauthClientDetails oauthClientDetails) throws FebsException {
+        OauthClientDetails byId = this.findById(oauthClientDetails.getClientId());
+        if (byId != null) {
+            throw new FebsException("该Client已存在");
+        }
+        oauthClientDetails.setOriginSecret(oauthClientDetails.getClientSecret());
+        oauthClientDetails.setClientSecret(passwordEncoder.encode(oauthClientDetails.getClientSecret()));
+        boolean saved = this.save(oauthClientDetails);
+        if (saved) {
+            log.info("缓存Client -> {}", oauthClientDetails);
+            this.redisClientDetailsService.loadClientByClientId(oauthClientDetails.getClientId());
+        }
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void updateOauthClientDetails(OauthClientDetails oauthClientDetails) {
+        String clientId = oauthClientDetails.getClientId();
+
+        LambdaQueryWrapper<OauthClientDetails> queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper.eq(OauthClientDetails::getClientId, oauthClientDetails.getClientId());
+
+        oauthClientDetails.setClientId(null);
+        oauthClientDetails.setClientSecret(null);
+        boolean updated = this.update(oauthClientDetails, queryWrapper);
+        if (updated) {
+            log.info("更新Client -> {}", oauthClientDetails);
+            this.redisClientDetailsService.removeRedisCache(clientId);
+            this.redisClientDetailsService.loadClientByClientId(clientId);
+        }
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void deleteOauthClientDetails(String clientIds) {
+        Object[] clientIdArray = StringUtils.splitByWholeSeparatorPreserveAllTokens(clientIds, ",");
+        LambdaQueryWrapper<OauthClientDetails> queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper.in(OauthClientDetails::getClientId, clientIdArray);
+        boolean removed = this.remove(queryWrapper);
+        if (removed) {
+            log.info("删除ClientId为({})的Client", clientIds);
+            Arrays.stream(clientIdArray).forEach(c -> this.redisClientDetailsService.removeRedisCache(String.valueOf(c)));
+
+        }
+    }
+}

+ 87 - 87
febs-auth/src/main/java/cc/mrbird/febs/auth/service/impl/RedisClientDetailsService.java

@@ -1,87 +1,87 @@
-package cc.mrbird.febs.auth.service.impl;
-
-import cc.mrbird.febs.common.service.RedisService;
-import com.alibaba.fastjson.JSONObject;
-import lombok.extern.slf4j.Slf4j;
-import org.apache.commons.collections4.CollectionUtils;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.security.oauth2.common.exceptions.InvalidClientException;
-import org.springframework.security.oauth2.provider.ClientDetails;
-import org.springframework.security.oauth2.provider.client.BaseClientDetails;
-import org.springframework.security.oauth2.provider.client.JdbcClientDetailsService;
-import org.springframework.stereotype.Service;
-
-import javax.sql.DataSource;
-import java.util.List;
-
-/**
- * @author Yuuki
- */
-@Slf4j
-@Service
-public class RedisClientDetailsService extends JdbcClientDetailsService {
-    /**
-     * 缓存 client的 redis key,这里是 hash结构存储
-     */
-    private static final String CACHE_CLIENT_KEY = "client_details";
-
-    private final RedisService redisService;
-
-    public RedisClientDetailsService(DataSource dataSource, RedisService redisService) {
-        super(dataSource);
-        this.redisService = redisService;
-    }
-
-    @Override
-    public ClientDetails loadClientByClientId(String clientId) throws InvalidClientException {
-        ClientDetails clientDetails = null;
-        String value = (String) redisService.hget(CACHE_CLIENT_KEY, clientId);
-        if (StringUtils.isBlank(value)) {
-            clientDetails = cacheAndGetClient(clientId);
-        } else {
-            clientDetails = JSONObject.parseObject(value, BaseClientDetails.class);
-        }
-
-        return clientDetails;
-    }
-
-    /**
-     * 缓存 client并返回 client
-     *
-     * @param clientId clientId
-     */
-    public ClientDetails cacheAndGetClient(String clientId) {
-        ClientDetails clientDetails = null;
-        clientDetails = super.loadClientByClientId(clientId);
-        if (clientDetails != null) {
-            redisService.hset(CACHE_CLIENT_KEY, clientId, JSONObject.toJSONString(clientDetails));
-        }
-        return clientDetails;
-    }
-
-    /**
-     * 删除 redis缓存
-     *
-     * @param clientId clientId
-     */
-    public void removeRedisCache(String clientId) {
-        redisService.hdel(CACHE_CLIENT_KEY, clientId);
-    }
-
-    /**
-     * 将 oauth_client_details全表刷入 redis
-     */
-    public void loadAllClientToCache() {
-        if (redisService.hasKey(CACHE_CLIENT_KEY)) {
-            return;
-        }
-        log.info("将oauth_client_details全表刷入redis");
-
-        List<ClientDetails> list = super.listClientDetails();
-        if (CollectionUtils.isEmpty(list)) {
-            log.error("oauth_client_details表数据为空,请检查");
-            return;
-        }
-        list.forEach(client -> redisService.hset(CACHE_CLIENT_KEY, client.getClientId(), JSONObject.toJSONString(client)));
-    }
-}
+package cc.mrbird.febs.auth.service.impl;
+
+import cc.mrbird.febs.common.redis.service.RedisService;
+import com.alibaba.fastjson.JSONObject;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.security.oauth2.common.exceptions.InvalidClientException;
+import org.springframework.security.oauth2.provider.ClientDetails;
+import org.springframework.security.oauth2.provider.client.BaseClientDetails;
+import org.springframework.security.oauth2.provider.client.JdbcClientDetailsService;
+import org.springframework.stereotype.Service;
+
+import javax.sql.DataSource;
+import java.util.List;
+
+/**
+ * @author Yuuki
+ */
+@Slf4j
+@Service
+public class RedisClientDetailsService extends JdbcClientDetailsService {
+    /**
+     * 缓存 client的 redis key,这里是 hash结构存储
+     */
+    private static final String CACHE_CLIENT_KEY = "client_details";
+
+    private final RedisService redisService;
+
+    public RedisClientDetailsService(DataSource dataSource, RedisService redisService) {
+        super(dataSource);
+        this.redisService = redisService;
+    }
+
+    @Override
+    public ClientDetails loadClientByClientId(String clientId) throws InvalidClientException {
+        ClientDetails clientDetails = null;
+        String value = (String) redisService.hget(CACHE_CLIENT_KEY, clientId);
+        if (StringUtils.isBlank(value)) {
+            clientDetails = cacheAndGetClient(clientId);
+        } else {
+            clientDetails = JSONObject.parseObject(value, BaseClientDetails.class);
+        }
+
+        return clientDetails;
+    }
+
+    /**
+     * 缓存 client并返回 client
+     *
+     * @param clientId clientId
+     */
+    public ClientDetails cacheAndGetClient(String clientId) {
+        ClientDetails clientDetails = null;
+        clientDetails = super.loadClientByClientId(clientId);
+        if (clientDetails != null) {
+            redisService.hset(CACHE_CLIENT_KEY, clientId, JSONObject.toJSONString(clientDetails));
+        }
+        return clientDetails;
+    }
+
+    /**
+     * 删除 redis缓存
+     *
+     * @param clientId clientId
+     */
+    public void removeRedisCache(String clientId) {
+        redisService.hdel(CACHE_CLIENT_KEY, clientId);
+    }
+
+    /**
+     * 将 oauth_client_details全表刷入 redis
+     */
+    public void loadAllClientToCache() {
+        if (redisService.hasKey(CACHE_CLIENT_KEY)) {
+            return;
+        }
+        log.info("将oauth_client_details全表刷入redis");
+
+        List<ClientDetails> list = super.listClientDetails();
+        if (CollectionUtils.isEmpty(list)) {
+            log.error("oauth_client_details表数据为空,请检查");
+            return;
+        }
+        list.forEach(client -> redisService.hset(CACHE_CLIENT_KEY, client.getClientId(), JSONObject.toJSONString(client)));
+    }
+}

+ 211 - 211
febs-auth/src/main/java/cc/mrbird/febs/auth/service/impl/SocialLoginServiceImpl.java

@@ -1,211 +1,211 @@
-package cc.mrbird.febs.auth.service.impl;
-
-import cc.mrbird.febs.auth.entity.BindUser;
-import cc.mrbird.febs.auth.entity.UserConnection;
-import cc.mrbird.febs.auth.manager.UserManager;
-import cc.mrbird.febs.auth.properties.FebsAuthProperties;
-import cc.mrbird.febs.auth.service.SocialLoginService;
-import cc.mrbird.febs.auth.service.UserConnectionService;
-import cc.mrbird.febs.common.entity.FebsResponse;
-import cc.mrbird.febs.common.entity.constant.GrantTypeConstant;
-import cc.mrbird.febs.common.entity.constant.ParamsConstant;
-import cc.mrbird.febs.common.entity.constant.SocialConstant;
-import cc.mrbird.febs.common.entity.system.SystemUser;
-import cc.mrbird.febs.common.exception.FebsException;
-import cc.mrbird.febs.common.utils.FebsUtil;
-import cn.hutool.core.util.StrUtil;
-import com.xkcoding.justauth.AuthRequestFactory;
-import lombok.RequiredArgsConstructor;
-import me.zhyd.oauth.config.AuthSource;
-import me.zhyd.oauth.model.AuthCallback;
-import me.zhyd.oauth.model.AuthResponse;
-import me.zhyd.oauth.model.AuthUser;
-import me.zhyd.oauth.request.AuthRequest;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.security.crypto.password.PasswordEncoder;
-import org.springframework.security.oauth2.common.OAuth2AccessToken;
-import org.springframework.security.oauth2.provider.ClientDetails;
-import org.springframework.security.oauth2.provider.TokenRequest;
-import org.springframework.security.oauth2.provider.password.ResourceOwnerPasswordTokenGranter;
-import org.springframework.stereotype.Service;
-
-import javax.servlet.http.HttpServletRequest;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * @author MrBird
- */
-@Service
-@RequiredArgsConstructor
-public class SocialLoginServiceImpl implements SocialLoginService {
-
-    private static final String USERNAME = "username";
-    private static final String PASSWORD = "password";
-
-    private static final String NOT_BIND = "not_bind";
-    private static final String SOCIAL_LOGIN_SUCCESS = "social_login_success";
-
-    private final UserManager userManager;
-    private final AuthRequestFactory factory;
-    private final FebsAuthProperties properties;
-    private final PasswordEncoder passwordEncoder;
-    private final UserConnectionService userConnectionService;
-    private final ResourceOwnerPasswordTokenGranter granter;
-    private final RedisClientDetailsService redisClientDetailsService;
-
-    @Override
-    public AuthRequest renderAuth(String oauthType) throws FebsException {
-        return factory.get(getAuthSource(oauthType));
-    }
-
-    @Override
-    public FebsResponse resolveBind(String oauthType, AuthCallback callback) throws FebsException {
-        FebsResponse febsResponse = new FebsResponse();
-        AuthRequest authRequest = factory.get(getAuthSource(oauthType));
-        AuthResponse<?> response = authRequest.login(resolveAuthCallback(callback));
-        if (response.ok()) {
-            febsResponse.data(response.getData());
-        } else {
-            throw new FebsException(String.format("第三方登录失败,%s", response.getMsg()));
-        }
-        return febsResponse;
-    }
-
-    @Override
-    public FebsResponse resolveLogin(String oauthType, AuthCallback callback) throws FebsException {
-        FebsResponse febsResponse = new FebsResponse();
-        AuthRequest authRequest = factory.get(getAuthSource(oauthType));
-        AuthResponse<?> response = authRequest.login(resolveAuthCallback(callback));
-        if (response.ok()) {
-            AuthUser authUser = (AuthUser) response.getData();
-            UserConnection userConnection = userConnectionService.selectByCondition(authUser.getSource().toString(), authUser.getUuid());
-            if (userConnection == null) {
-                febsResponse.message(NOT_BIND).data(authUser);
-            } else {
-                SystemUser user = userManager.findByName(userConnection.getUserName());
-                if (user == null) {
-                    throw new FebsException("系统中未找到与第三方账号对应的账户");
-                }
-                OAuth2AccessToken oAuth2AccessToken = getOauth2AccessToken(user);
-                febsResponse.message(SOCIAL_LOGIN_SUCCESS).data(oAuth2AccessToken);
-                febsResponse.put(USERNAME, user.getUsername());
-            }
-        } else {
-            throw new FebsException(String.format("第三方登录失败,%s", response.getMsg()));
-        }
-        return febsResponse;
-    }
-
-    @Override
-    public OAuth2AccessToken bindLogin(BindUser bindUser, AuthUser authUser) throws FebsException {
-        SystemUser systemUser = userManager.findByName(bindUser.getBindUsername());
-        if (systemUser == null || !passwordEncoder.matches(bindUser.getBindPassword(), systemUser.getPassword())) {
-            throw new FebsException("绑定系统账号失败,用户名或密码错误!");
-        }
-        this.createConnection(systemUser, authUser);
-        return this.getOauth2AccessToken(systemUser);
-    }
-
-    @Override
-    public OAuth2AccessToken signLogin(BindUser registUser, AuthUser authUser) throws FebsException {
-        SystemUser user = this.userManager.findByName(registUser.getBindUsername());
-        if (user != null) {
-            throw new FebsException("该用户名已存在!");
-        }
-        String encryptPassword = passwordEncoder.encode(registUser.getBindPassword());
-        SystemUser systemUser = this.userManager.registUser(registUser.getBindUsername(), encryptPassword);
-        this.createConnection(systemUser, authUser);
-        return this.getOauth2AccessToken(systemUser);
-    }
-
-    @Override
-    public void bind(BindUser bindUser, AuthUser authUser) throws FebsException {
-        String username = bindUser.getBindUsername();
-        if (isCurrentUser(username)) {
-            UserConnection userConnection = userConnectionService.selectByCondition(authUser.getSource().toString(), authUser.getUuid());
-            if (userConnection != null) {
-                throw new FebsException("绑定失败,该第三方账号已绑定" + userConnection.getUserName() + "系统账户");
-            }
-            SystemUser systemUser = new SystemUser();
-            systemUser.setUsername(username);
-            this.createConnection(systemUser, authUser);
-        } else {
-            throw new FebsException("绑定失败,您无权绑定别人的账号");
-        }
-    }
-
-    @Override
-    public void unbind(BindUser bindUser, String oauthType) throws FebsException {
-        String username = bindUser.getBindUsername();
-        if (isCurrentUser(username)) {
-            this.userConnectionService.deleteByCondition(username, oauthType);
-        } else {
-            throw new FebsException("解绑失败,您无权解绑别人的账号");
-        }
-    }
-
-    @Override
-    public List<UserConnection> findUserConnections(String username) {
-        return this.userConnectionService.selectByCondition(username);
-    }
-
-    private void createConnection(SystemUser systemUser, AuthUser authUser) {
-        UserConnection userConnection = new UserConnection();
-        userConnection.setUserName(systemUser.getUsername());
-        userConnection.setProviderName(authUser.getSource().toString());
-        userConnection.setProviderUserId(authUser.getUuid());
-        userConnection.setProviderUserName(authUser.getUsername());
-        userConnection.setImageUrl(authUser.getAvatar());
-        userConnection.setNickName(authUser.getNickname());
-        userConnection.setLocation(authUser.getLocation());
-        this.userConnectionService.createUserConnection(userConnection);
-    }
-
-    private AuthCallback resolveAuthCallback(AuthCallback callback) {
-        int stateLength = 3;
-        String state = callback.getState();
-        String[] strings = StringUtils.splitByWholeSeparatorPreserveAllTokens(state, "::");
-        if (strings.length == stateLength) {
-            callback.setState(strings[0] + "::" + strings[1]);
-        }
-        return callback;
-    }
-
-    private AuthSource getAuthSource(String type) throws FebsException {
-        if (StrUtil.isNotBlank(type)) {
-            return AuthSource.valueOf(type.toUpperCase());
-        } else {
-            throw new FebsException(String.format("暂不支持%s第三方登录", type));
-        }
-    }
-
-    private boolean isCurrentUser(String username) {
-        String currentUsername = FebsUtil.getCurrentUsername();
-        return StringUtils.equalsIgnoreCase(username, currentUsername);
-    }
-
-    private OAuth2AccessToken getOauth2AccessToken(SystemUser user) throws FebsException {
-        final HttpServletRequest httpServletRequest = FebsUtil.getHttpServletRequest();
-        httpServletRequest.setAttribute(ParamsConstant.LOGIN_TYPE, SocialConstant.SOCIAL_LOGIN);
-        String socialLoginClientId = properties.getSocialLoginClientId();
-        ClientDetails clientDetails = null;
-        try {
-            clientDetails = redisClientDetailsService.loadClientByClientId(socialLoginClientId);
-        } catch (Exception e) {
-            throw new FebsException("获取第三方登录可用的Client失败");
-        }
-        if (clientDetails == null) {
-            throw new FebsException("未找到第三方登录可用的Client");
-        }
-        Map<String, String> requestParameters = new HashMap<>(5);
-        requestParameters.put(ParamsConstant.GRANT_TYPE, GrantTypeConstant.PASSWORD);
-        requestParameters.put(USERNAME, user.getUsername());
-        requestParameters.put(PASSWORD, SocialConstant.SOCIAL_LOGIN_PASSWORD);
-
-        String grantTypes = String.join(",", clientDetails.getAuthorizedGrantTypes());
-        TokenRequest tokenRequest = new TokenRequest(requestParameters, clientDetails.getClientId(), clientDetails.getScope(), grantTypes);
-        return granter.grant(GrantTypeConstant.PASSWORD, tokenRequest);
-    }
-}
+package cc.mrbird.febs.auth.service.impl;
+
+import cc.mrbird.febs.common.core.entity.FebsResponse;
+import cc.mrbird.febs.common.core.entity.constant.GrantTypeConstant;
+import cc.mrbird.febs.common.core.entity.constant.ParamsConstant;
+import cc.mrbird.febs.common.core.entity.constant.SocialConstant;
+import cc.mrbird.febs.common.core.entity.system.SystemUser;
+import cc.mrbird.febs.common.core.exception.FebsException;
+import cc.mrbird.febs.common.core.utils.FebsUtil;
+import cc.mrbird.febs.auth.entity.BindUser;
+import cc.mrbird.febs.auth.entity.UserConnection;
+import cc.mrbird.febs.auth.manager.UserManager;
+import cc.mrbird.febs.auth.properties.FebsAuthProperties;
+import cc.mrbird.febs.auth.service.SocialLoginService;
+import cc.mrbird.febs.auth.service.UserConnectionService;
+import cn.hutool.core.util.StrUtil;
+import com.xkcoding.justauth.AuthRequestFactory;
+import lombok.RequiredArgsConstructor;
+import me.zhyd.oauth.config.AuthSource;
+import me.zhyd.oauth.model.AuthCallback;
+import me.zhyd.oauth.model.AuthResponse;
+import me.zhyd.oauth.model.AuthUser;
+import me.zhyd.oauth.request.AuthRequest;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.security.crypto.password.PasswordEncoder;
+import org.springframework.security.oauth2.common.OAuth2AccessToken;
+import org.springframework.security.oauth2.provider.ClientDetails;
+import org.springframework.security.oauth2.provider.TokenRequest;
+import org.springframework.security.oauth2.provider.password.ResourceOwnerPasswordTokenGranter;
+import org.springframework.stereotype.Service;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author MrBird
+ */
+@Service
+@RequiredArgsConstructor
+public class SocialLoginServiceImpl implements SocialLoginService {
+
+    private static final String USERNAME = "username";
+    private static final String PASSWORD = "password";
+
+    private static final String NOT_BIND = "not_bind";
+    private static final String SOCIAL_LOGIN_SUCCESS = "social_login_success";
+
+    private final UserManager userManager;
+    private final AuthRequestFactory factory;
+    private final FebsAuthProperties properties;
+    private final PasswordEncoder passwordEncoder;
+    private final UserConnectionService userConnectionService;
+    private final ResourceOwnerPasswordTokenGranter granter;
+    private final RedisClientDetailsService redisClientDetailsService;
+
+    @Override
+    public AuthRequest renderAuth(String oauthType) throws FebsException {
+        return factory.get(getAuthSource(oauthType));
+    }
+
+    @Override
+    public FebsResponse resolveBind(String oauthType, AuthCallback callback) throws FebsException {
+        FebsResponse febsResponse = new FebsResponse();
+        AuthRequest authRequest = factory.get(getAuthSource(oauthType));
+        AuthResponse<?> response = authRequest.login(resolveAuthCallback(callback));
+        if (response.ok()) {
+            febsResponse.data(response.getData());
+        } else {
+            throw new FebsException(String.format("第三方登录失败,%s", response.getMsg()));
+        }
+        return febsResponse;
+    }
+
+    @Override
+    public FebsResponse resolveLogin(String oauthType, AuthCallback callback) throws FebsException {
+        FebsResponse febsResponse = new FebsResponse();
+        AuthRequest authRequest = factory.get(getAuthSource(oauthType));
+        AuthResponse<?> response = authRequest.login(resolveAuthCallback(callback));
+        if (response.ok()) {
+            AuthUser authUser = (AuthUser) response.getData();
+            UserConnection userConnection = userConnectionService.selectByCondition(authUser.getSource().toString(), authUser.getUuid());
+            if (userConnection == null) {
+                febsResponse.message(NOT_BIND).data(authUser);
+            } else {
+                SystemUser user = userManager.findByName(userConnection.getUserName());
+                if (user == null) {
+                    throw new FebsException("系统中未找到与第三方账号对应的账户");
+                }
+                OAuth2AccessToken oAuth2AccessToken = getOauth2AccessToken(user);
+                febsResponse.message(SOCIAL_LOGIN_SUCCESS).data(oAuth2AccessToken);
+                febsResponse.put(USERNAME, user.getUsername());
+            }
+        } else {
+            throw new FebsException(String.format("第三方登录失败,%s", response.getMsg()));
+        }
+        return febsResponse;
+    }
+
+    @Override
+    public OAuth2AccessToken bindLogin(BindUser bindUser, AuthUser authUser) throws FebsException {
+        SystemUser systemUser = userManager.findByName(bindUser.getBindUsername());
+        if (systemUser == null || !passwordEncoder.matches(bindUser.getBindPassword(), systemUser.getPassword())) {
+            throw new FebsException("绑定系统账号失败,用户名或密码错误!");
+        }
+        this.createConnection(systemUser, authUser);
+        return this.getOauth2AccessToken(systemUser);
+    }
+
+    @Override
+    public OAuth2AccessToken signLogin(BindUser registUser, AuthUser authUser) throws FebsException {
+        SystemUser user = this.userManager.findByName(registUser.getBindUsername());
+        if (user != null) {
+            throw new FebsException("该用户名已存在!");
+        }
+        String encryptPassword = passwordEncoder.encode(registUser.getBindPassword());
+        SystemUser systemUser = this.userManager.registUser(registUser.getBindUsername(), encryptPassword);
+        this.createConnection(systemUser, authUser);
+        return this.getOauth2AccessToken(systemUser);
+    }
+
+    @Override
+    public void bind(BindUser bindUser, AuthUser authUser) throws FebsException {
+        String username = bindUser.getBindUsername();
+        if (isCurrentUser(username)) {
+            UserConnection userConnection = userConnectionService.selectByCondition(authUser.getSource().toString(), authUser.getUuid());
+            if (userConnection != null) {
+                throw new FebsException("绑定失败,该第三方账号已绑定" + userConnection.getUserName() + "系统账户");
+            }
+            SystemUser systemUser = new SystemUser();
+            systemUser.setUsername(username);
+            this.createConnection(systemUser, authUser);
+        } else {
+            throw new FebsException("绑定失败,您无权绑定别人的账号");
+        }
+    }
+
+    @Override
+    public void unbind(BindUser bindUser, String oauthType) throws FebsException {
+        String username = bindUser.getBindUsername();
+        if (isCurrentUser(username)) {
+            this.userConnectionService.deleteByCondition(username, oauthType);
+        } else {
+            throw new FebsException("解绑失败,您无权解绑别人的账号");
+        }
+    }
+
+    @Override
+    public List<UserConnection> findUserConnections(String username) {
+        return this.userConnectionService.selectByCondition(username);
+    }
+
+    private void createConnection(SystemUser systemUser, AuthUser authUser) {
+        UserConnection userConnection = new UserConnection();
+        userConnection.setUserName(systemUser.getUsername());
+        userConnection.setProviderName(authUser.getSource().toString());
+        userConnection.setProviderUserId(authUser.getUuid());
+        userConnection.setProviderUserName(authUser.getUsername());
+        userConnection.setImageUrl(authUser.getAvatar());
+        userConnection.setNickName(authUser.getNickname());
+        userConnection.setLocation(authUser.getLocation());
+        this.userConnectionService.createUserConnection(userConnection);
+    }
+
+    private AuthCallback resolveAuthCallback(AuthCallback callback) {
+        int stateLength = 3;
+        String state = callback.getState();
+        String[] strings = StringUtils.splitByWholeSeparatorPreserveAllTokens(state, "::");
+        if (strings.length == stateLength) {
+            callback.setState(strings[0] + "::" + strings[1]);
+        }
+        return callback;
+    }
+
+    private AuthSource getAuthSource(String type) throws FebsException {
+        if (StrUtil.isNotBlank(type)) {
+            return AuthSource.valueOf(type.toUpperCase());
+        } else {
+            throw new FebsException(String.format("暂不支持%s第三方登录", type));
+        }
+    }
+
+    private boolean isCurrentUser(String username) {
+        String currentUsername = FebsUtil.getCurrentUsername();
+        return StringUtils.equalsIgnoreCase(username, currentUsername);
+    }
+
+    private OAuth2AccessToken getOauth2AccessToken(SystemUser user) throws FebsException {
+        final HttpServletRequest httpServletRequest = FebsUtil.getHttpServletRequest();
+        httpServletRequest.setAttribute(ParamsConstant.LOGIN_TYPE, SocialConstant.SOCIAL_LOGIN);
+        String socialLoginClientId = properties.getSocialLoginClientId();
+        ClientDetails clientDetails = null;
+        try {
+            clientDetails = redisClientDetailsService.loadClientByClientId(socialLoginClientId);
+        } catch (Exception e) {
+            throw new FebsException("获取第三方登录可用的Client失败");
+        }
+        if (clientDetails == null) {
+            throw new FebsException("未找到第三方登录可用的Client");
+        }
+        Map<String, String> requestParameters = new HashMap<>(5);
+        requestParameters.put(ParamsConstant.GRANT_TYPE, GrantTypeConstant.PASSWORD);
+        requestParameters.put(USERNAME, user.getUsername());
+        requestParameters.put(PASSWORD, SocialConstant.SOCIAL_LOGIN_PASSWORD);
+
+        String grantTypes = String.join(",", clientDetails.getAuthorizedGrantTypes());
+        TokenRequest tokenRequest = new TokenRequest(requestParameters, clientDetails.getClientId(), clientDetails.getScope(), grantTypes);
+        return granter.grant(GrantTypeConstant.PASSWORD, tokenRequest);
+    }
+}

+ 51 - 51
febs-auth/src/main/java/cc/mrbird/febs/auth/service/impl/UserConnectionServiceImpl.java

@@ -1,51 +1,51 @@
-package cc.mrbird.febs.auth.service.impl;
-
-import cc.mrbird.febs.auth.entity.UserConnection;
-import cc.mrbird.febs.auth.mapper.UserConnectionMapper;
-import cc.mrbird.febs.auth.service.UserConnectionService;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Propagation;
-import org.springframework.transaction.annotation.Transactional;
-
-import java.util.List;
-
-/**
- * @author MrBird
- */
-@Service
-@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
-public class UserConnectionServiceImpl extends ServiceImpl<UserConnectionMapper, UserConnection> implements UserConnectionService {
-
-    @Override
-    public UserConnection selectByCondition(String providerName, String providerUserId) {
-        LambdaQueryWrapper<UserConnection> queryWrapper = new LambdaQueryWrapper<>();
-        queryWrapper.eq(UserConnection::getProviderName, providerName)
-                .eq(UserConnection::getProviderUserId, providerUserId);
-        return this.baseMapper.selectOne(queryWrapper);
-    }
-
-    @Override
-    public List<UserConnection> selectByCondition(String username) {
-        LambdaQueryWrapper<UserConnection> queryWrapper = new LambdaQueryWrapper<>();
-        queryWrapper.eq(UserConnection::getUserName, username);
-        return this.baseMapper.selectList(queryWrapper);
-    }
-
-    @Override
-    @Transactional(rollbackFor = Exception.class)
-    public void createUserConnection(UserConnection userConnection) {
-        this.baseMapper.insert(userConnection);
-    }
-
-    @Override
-    @Transactional(rollbackFor = Exception.class)
-    public void deleteByCondition(String username, String providerName) {
-        LambdaQueryWrapper<UserConnection> queryWrapper = new LambdaQueryWrapper<>();
-        queryWrapper.eq(UserConnection::getUserName, username);
-        queryWrapper.eq(UserConnection::getProviderName, providerName);
-        this.remove(queryWrapper);
-    }
-
-}
+package cc.mrbird.febs.auth.service.impl;
+
+import cc.mrbird.febs.auth.entity.UserConnection;
+import cc.mrbird.febs.auth.mapper.UserConnectionMapper;
+import cc.mrbird.febs.auth.service.UserConnectionService;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Propagation;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+
+/**
+ * @author MrBird
+ */
+@Service
+@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
+public class UserConnectionServiceImpl extends ServiceImpl<UserConnectionMapper, UserConnection> implements UserConnectionService {
+
+    @Override
+    public UserConnection selectByCondition(String providerName, String providerUserId) {
+        LambdaQueryWrapper<UserConnection> queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper.eq(UserConnection::getProviderName, providerName)
+                .eq(UserConnection::getProviderUserId, providerUserId);
+        return this.baseMapper.selectOne(queryWrapper);
+    }
+
+    @Override
+    public List<UserConnection> selectByCondition(String username) {
+        LambdaQueryWrapper<UserConnection> queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper.eq(UserConnection::getUserName, username);
+        return this.baseMapper.selectList(queryWrapper);
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void createUserConnection(UserConnection userConnection) {
+        this.baseMapper.insert(userConnection);
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void deleteByCondition(String username, String providerName) {
+        LambdaQueryWrapper<UserConnection> queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper.eq(UserConnection::getUserName, username);
+        queryWrapper.eq(UserConnection::getProviderName, providerName);
+        this.remove(queryWrapper);
+    }
+
+}

+ 85 - 85
febs-auth/src/main/java/cc/mrbird/febs/auth/service/impl/ValidateCodeServiceImpl.java

@@ -1,85 +1,85 @@
-package cc.mrbird.febs.auth.service.impl;
-
-import cc.mrbird.febs.auth.properties.FebsAuthProperties;
-import cc.mrbird.febs.auth.properties.FebsValidateCodeProperties;
-import cc.mrbird.febs.auth.service.ValidateCodeService;
-import cc.mrbird.febs.common.entity.constant.FebsConstant;
-import cc.mrbird.febs.common.entity.constant.ImageTypeConstant;
-import cc.mrbird.febs.common.entity.constant.ParamsConstant;
-import cc.mrbird.febs.common.exception.ValidateCodeException;
-import cc.mrbird.febs.common.service.RedisService;
-import com.wf.captcha.GifCaptcha;
-import com.wf.captcha.SpecCaptcha;
-import com.wf.captcha.base.Captcha;
-import lombok.RequiredArgsConstructor;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.http.HttpHeaders;
-import org.springframework.http.MediaType;
-import org.springframework.stereotype.Service;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-
-/**
- * 验证码服务
- *
- * @author MrBird
- */
-@Service
-@RequiredArgsConstructor
-public class ValidateCodeServiceImpl implements ValidateCodeService {
-
-    private final RedisService redisService;
-    private final FebsAuthProperties properties;
-
-    @Override
-    public void create(HttpServletRequest request, HttpServletResponse response) throws IOException, ValidateCodeException {
-        String key = request.getParameter(ParamsConstant.VALIDATE_CODE_KEY);
-        if (StringUtils.isBlank(key)) {
-            throw new ValidateCodeException("验证码key不能为空");
-        }
-        FebsValidateCodeProperties code = properties.getCode();
-        setHeader(response, code.getType());
-
-        Captcha captcha = createCaptcha(code);
-        redisService.set(FebsConstant.CODE_PREFIX + key, StringUtils.lowerCase(captcha.text()), code.getTime());
-        captcha.out(response.getOutputStream());
-    }
-
-    @Override
-    public void check(String key, String value) throws ValidateCodeException {
-        Object codeInRedis = redisService.get(FebsConstant.CODE_PREFIX + key);
-        if (StringUtils.isBlank(value)) {
-            throw new ValidateCodeException("请输入验证码");
-        }
-        if (codeInRedis == null) {
-            throw new ValidateCodeException("验证码已过期");
-        }
-        if (!StringUtils.equalsIgnoreCase(value, String.valueOf(codeInRedis))) {
-            throw new ValidateCodeException("验证码不正确");
-        }
-    }
-
-    private Captcha createCaptcha(FebsValidateCodeProperties code) {
-        Captcha captcha = null;
-        if (StringUtils.equalsIgnoreCase(code.getType(), ImageTypeConstant.GIF)) {
-            captcha = new GifCaptcha(code.getWidth(), code.getHeight(), code.getLength());
-        } else {
-            captcha = new SpecCaptcha(code.getWidth(), code.getHeight(), code.getLength());
-        }
-        captcha.setCharType(code.getCharType());
-        return captcha;
-    }
-
-    private void setHeader(HttpServletResponse response, String type) {
-        if (StringUtils.equalsIgnoreCase(type, ImageTypeConstant.GIF)) {
-            response.setContentType(MediaType.IMAGE_GIF_VALUE);
-        } else {
-            response.setContentType(MediaType.IMAGE_PNG_VALUE);
-        }
-        response.setHeader(HttpHeaders.PRAGMA, "No-cache");
-        response.setHeader(HttpHeaders.CACHE_CONTROL, "No-cache");
-        response.setDateHeader(HttpHeaders.EXPIRES, 0L);
-    }
-}
+package cc.mrbird.febs.auth.service.impl;
+
+import cc.mrbird.febs.common.core.entity.constant.FebsConstant;
+import cc.mrbird.febs.common.core.entity.constant.ImageTypeConstant;
+import cc.mrbird.febs.common.core.entity.constant.ParamsConstant;
+import cc.mrbird.febs.common.core.exception.ValidateCodeException;
+import cc.mrbird.febs.common.redis.service.RedisService;
+import cc.mrbird.febs.auth.properties.FebsAuthProperties;
+import cc.mrbird.febs.auth.properties.FebsValidateCodeProperties;
+import cc.mrbird.febs.auth.service.ValidateCodeService;
+import com.wf.captcha.GifCaptcha;
+import com.wf.captcha.SpecCaptcha;
+import com.wf.captcha.base.Captcha;
+import lombok.RequiredArgsConstructor;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.MediaType;
+import org.springframework.stereotype.Service;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+
+/**
+ * 验证码服务
+ *
+ * @author MrBird
+ */
+@Service
+@RequiredArgsConstructor
+public class ValidateCodeServiceImpl implements ValidateCodeService {
+
+    private final RedisService redisService;
+    private final FebsAuthProperties properties;
+
+    @Override
+    public void create(HttpServletRequest request, HttpServletResponse response) throws IOException, ValidateCodeException {
+        String key = request.getParameter(ParamsConstant.VALIDATE_CODE_KEY);
+        if (StringUtils.isBlank(key)) {
+            throw new ValidateCodeException("验证码key不能为空");
+        }
+        FebsValidateCodeProperties code = properties.getCode();
+        setHeader(response, code.getType());
+
+        Captcha captcha = createCaptcha(code);
+        redisService.set(FebsConstant.CODE_PREFIX + key, StringUtils.lowerCase(captcha.text()), code.getTime());
+        captcha.out(response.getOutputStream());
+    }
+
+    @Override
+    public void check(String key, String value) throws ValidateCodeException {
+        Object codeInRedis = redisService.get(FebsConstant.CODE_PREFIX + key);
+        if (StringUtils.isBlank(value)) {
+            throw new ValidateCodeException("请输入验证码");
+        }
+        if (codeInRedis == null) {
+            throw new ValidateCodeException("验证码已过期");
+        }
+        if (!StringUtils.equalsIgnoreCase(value, String.valueOf(codeInRedis))) {
+            throw new ValidateCodeException("验证码不正确");
+        }
+    }
+
+    private Captcha createCaptcha(FebsValidateCodeProperties code) {
+        Captcha captcha = null;
+        if (StringUtils.equalsIgnoreCase(code.getType(), ImageTypeConstant.GIF)) {
+            captcha = new GifCaptcha(code.getWidth(), code.getHeight(), code.getLength());
+        } else {
+            captcha = new SpecCaptcha(code.getWidth(), code.getHeight(), code.getLength());
+        }
+        captcha.setCharType(code.getCharType());
+        return captcha;
+    }
+
+    private void setHeader(HttpServletResponse response, String type) {
+        if (StringUtils.equalsIgnoreCase(type, ImageTypeConstant.GIF)) {
+            response.setContentType(MediaType.IMAGE_GIF_VALUE);
+        } else {
+            response.setContentType(MediaType.IMAGE_PNG_VALUE);
+        }
+        response.setHeader(HttpHeaders.PRAGMA, "No-cache");
+        response.setHeader(HttpHeaders.CACHE_CONTROL, "No-cache");
+        response.setDateHeader(HttpHeaders.EXPIRES, 0L);
+    }
+}

+ 58 - 57
febs-auth/src/main/java/cc/mrbird/febs/auth/translator/FebsWebResponseExceptionTranslator.java

@@ -1,57 +1,58 @@
-package cc.mrbird.febs.auth.translator;
-
-import cc.mrbird.febs.common.entity.FebsResponse;
-import lombok.extern.slf4j.Slf4j;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-import org.springframework.security.oauth2.common.exceptions.InvalidGrantException;
-import org.springframework.security.oauth2.common.exceptions.InvalidScopeException;
-import org.springframework.security.oauth2.common.exceptions.InvalidTokenException;
-import org.springframework.security.oauth2.common.exceptions.UnsupportedGrantTypeException;
-import org.springframework.security.oauth2.provider.error.WebResponseExceptionTranslator;
-import org.springframework.stereotype.Component;
-
-/**
- * 异常翻译
- *
- * @author MrBird
- */
-@Slf4j
-@Component
-public class FebsWebResponseExceptionTranslator implements WebResponseExceptionTranslator {
-
-    @Override
-    public ResponseEntity<?> translate(Exception e) {
-        ResponseEntity.BodyBuilder status = ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR);
-        FebsResponse response = new FebsResponse();
-        String message = "认证失败";
-        log.error(message, e);
-        if (e instanceof UnsupportedGrantTypeException) {
-            message = "不支持该认证类型";
-            return status.body(response.message(message));
-        }
-        if (e instanceof InvalidTokenException
-                && StringUtils.containsIgnoreCase(e.getMessage(), "Invalid refresh token (expired)")) {
-            message = "刷新令牌已过期,请重新登录";
-            return status.body(response.message(message));
-        }
-        if (e instanceof InvalidScopeException) {
-            message = "不是有效的scope值";
-            return status.body(response.message(message));
-        }
-        if (e instanceof InvalidGrantException) {
-            if (StringUtils.containsIgnoreCase(e.getMessage(), "Invalid refresh token")) {
-                message = "refresh token无效";
-                return status.body(response.message(message));
-            }
-            if (StringUtils.containsIgnoreCase(e.getMessage(), "locked")) {
-                message = "用户已被锁定,请联系管理员";
-                return status.body(response.message(message));
-            }
-            message = "用户名或密码错误";
-            return status.body(response.message(message));
-        }
-        return status.body(response.message(message));
-    }
-}
+package cc.mrbird.febs.auth.translator;
+
+import cc.mrbird.febs.common.core.entity.FebsResponse;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.security.oauth2.common.exceptions.InvalidGrantException;
+import org.springframework.security.oauth2.common.exceptions.InvalidScopeException;
+import org.springframework.security.oauth2.common.exceptions.InvalidTokenException;
+import org.springframework.security.oauth2.common.exceptions.UnsupportedGrantTypeException;
+import org.springframework.security.oauth2.provider.error.WebResponseExceptionTranslator;
+import org.springframework.stereotype.Component;
+
+/**
+ * 异常翻译
+ *
+ * @author MrBird
+ */
+@Slf4j
+@Component
+@SuppressWarnings("all")
+public class FebsWebResponseExceptionTranslator implements WebResponseExceptionTranslator {
+
+    @Override
+    public ResponseEntity<?> translate(Exception e) {
+        ResponseEntity.BodyBuilder status = ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR);
+        FebsResponse response = new FebsResponse();
+        String message = "认证失败";
+        log.error(message, e);
+        if (e instanceof UnsupportedGrantTypeException) {
+            message = "不支持该认证类型";
+            return status.body(response.message(message));
+        }
+        if (e instanceof InvalidTokenException
+                && StringUtils.containsIgnoreCase(e.getMessage(), "Invalid refresh token (expired)")) {
+            message = "刷新令牌已过期,请重新登录";
+            return status.body(response.message(message));
+        }
+        if (e instanceof InvalidScopeException) {
+            message = "不是有效的scope值";
+            return status.body(response.message(message));
+        }
+        if (e instanceof InvalidGrantException) {
+            if (StringUtils.containsIgnoreCase(e.getMessage(), "Invalid refresh token")) {
+                message = "refresh token无效";
+                return status.body(response.message(message));
+            }
+            if (StringUtils.containsIgnoreCase(e.getMessage(), "locked")) {
+                message = "用户已被锁定,请联系管理员";
+                return status.body(response.message(message));
+            }
+            message = "用户名或密码错误";
+            return status.body(response.message(message));
+        }
+        return status.body(response.message(message));
+    }
+}

+ 7 - 2
febs-auth/src/main/resources/bootstrap.yml

@@ -12,12 +12,17 @@ spring:
         file-extension: yaml
       discovery:
         server-addr: ${nacos.url}:8001
-
 logging:
   level:
+    org:
+      springframework:
+        boot:
+          actuate:
+            endpoint:
+              EndpointId: error
     com:
       alibaba:
         cloud:
           nacos:
             client:
-              NacosPropertySourceBuilder: error
+              NacosPropertySourceBuilder: error

+ 0 - 1
febs-auth/src/main/resources/febs-auth.properties

@@ -1,4 +1,3 @@
-febs.auth.anonUrl=/actuator/**,/captcha,/social/**
 febs.auth.enableJwt=false
 febs.auth.jwtAccessKey=febs
 

+ 5 - 5
febs-auth/src/main/resources/logback-spring.xml

@@ -1,10 +1,10 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <configuration scan="true" scanPeriod="60 seconds" debug="false">
-    <contextName>febs</contextName>
-    <property name="log.path" value="log/febs-auth" />
-    <property name="log.maxHistory" value="15" />
-    <property name="log.colorPattern" value="%magenta(%d{yyyy-MM-dd HH:mm:ss}) %highlight(%-5level) %yellow(%thread) %green(%logger) %msg%n"/>
-    <property name="log.pattern" value="%d{yyyy-MM-dd HH:mm:ss} %-5level %thread %logger %msg%n"/>
+    <springProperty scope="context" name="springAppName" source="spring.application.name"/>
+    <property name="log.path" value="log/febs-auth"/>
+    <property name="log.maxHistory" value="15"/>
+    <property name="log.colorPattern" value="%magenta(%d{yyyy-MM-dd HH:mm:ss}) %highlight(%-5level) %boldCyan(${springAppName:-}) %yellow(%thread) %green(%logger) %msg%n"/>
+    <property name="log.pattern" value="%d{yyyy-MM-dd HH:mm:ss} %-5level ${springAppName:-} %thread %logger %msg%n"/>
 
     <!--输出到控制台-->
     <appender name="console" class="ch.qos.logback.core.ConsoleAppender">

+ 5 - 0
febs-auth/src/main/resources/mapper/UserMapper.xml

@@ -28,4 +28,9 @@
         group by u.username,u.user_id,u.email,u.mobile,u.password, u.status,u.create_time,u.ssex,u.dept_id
 				,u.last_login_time,u.modify_time,u.description,u.avatar
     </select>
+
+    <select id="findUserDataPermissions" parameterType="long" resultType="userDataPermission">
+        select user_id userId, dept_id deptId from t_user_data_permission
+        where user_id = #{userId}
+    </select>
 </mapper>

BIN
febs-cloud/.txlcn/FEBS-Server-System-8201.mv.db


+ 139 - 105
febs-cloud/docker compose/febs-cloud/docker-compose.yml

@@ -1,105 +1,139 @@
-version: '3'
-
-services:
-  febs-monitor-admin:
-    image: febs-monitor-admin:latest
-    container_name: febs-monitor-admin
-    volumes:
-      - "/febs/log:/log"
-    command:
-      - "--nacos.url=127.0.0.1"
-    environment:
-      - "TZ=Asia/Shanghai"
-    ports:
-      - 8401:8401
-    restart: on-failure
-  febs-gateway:
-    image: febs-gateway:latest
-    container_name: febs-gateway
-    volumes:
-      - "/febs/log:/log"
-    command:
-      - "--febs-monitor-admin=127.0.0.1"
-      - "--nacos.url=127.0.0.1"
-    environment:
-      - "TZ=Asia/Shanghai"
-    ports:
-      - 8301:8301
-    restart: on-failure
-  febs-auth:
-    image: febs-auth:latest
-    container_name: febs-auth
-    volumes:
-      - "/febs/log:/log"
-    command:
-      - "--febs-monitor-admin=127.0.0.1"
-      - "--nacos.url=127.0.0.1"
-      - "--mysql.url=127.0.0.1"
-      - "--redis.url=127.0.0.1"
-      - "--spring.profiles.active=prod"
-    environment:
-      - "TZ=Asia/Shanghai"
-    ports:
-      - 8101:8101
-    restart: on-failure
-  febs-server-system:
-    image: febs-server-system:latest
-    container_name: febs-server-system
-    volumes:
-      - "/febs/log:/log"
-    command:
-      - "--febs-monitor-admin=127.0.0.1"
-      - "--febs-gateway=127.0.0.1"
-      - "--nacos.url=127.0.0.1"
-      - "--mysql.url=127.0.0.1"
-      - "--rabbitmq.url=127.0.0.1"
-      - "--spring.profiles.active=prod"
-    environment:
-      - "TZ=Asia/Shanghai"
-    ports:
-      - 8201:8201
-    restart: on-failure
-  febs-server-test:
-    image: febs-server-test:latest
-    container_name: febs-server-test
-    volumes:
-      - "/febs/log:/log"
-    command:
-      - "--rabbitmq.url=127.0.0.1"
-      - "--nacos.url=127.0.0.1"
-      - "--febs-monitor-admin=127.0.0.1"
-      - "--febs-gateway=127.0.0.1"
-    environment:
-      - "TZ=Asia/Shanghai"
-    ports:
-      - 8202:8202
-    restart: on-failure
-  zipkin-server:
-    image: zipkin-server
-    container_name: zipkin-server
-    command:
-      - "--server.port=8402"
-      - "--zipkin.storage.type=mysql"
-      - "--zipkin.storage.mysql.db=febs_cloud_base"
-      - "--zipkin.storage.mysql.username=root"
-      - "--zipkin.storage.mysql.password=123456"
-      - "--zipkin.storage.mysql.host=127.0.0.1"
-      - "--zipkin.storage.mysql.port=3306"
-      - "--zipkin.collector.rabbitmq.addresses=127.0.0.1:5672"
-      - "--zipkin.collector.rabbitmq.username=febs"
-      - "--zipkin.collector.rabbitmq.password=123456"
-    environment:
-      - "TZ=Asia/Shanghai"
-    ports:
-      - 8402:8402
-    restart: on-failure
-  febs-cloud-web:
-    image: febs-cloud-web
-    container_name: febs-cloud-web
-    volumes:
-      - "/febs/log:/log"
-    environment:
-      - "TZ=Asia/Shanghai"
-    ports:
-      - 9527:80
-    restart: on-failure
+version: '3'
+
+services:
+  febs-admin:
+    image: febs-admin:latest
+    container_name: febs-admin
+    volumes:
+      - "/febs/log:/log"
+    command:
+      - "--nacos.url=127.0.0.1"
+    environment:
+      - "TZ=Asia/Shanghai"
+    ports:
+      - 8401:8401
+    restart: on-failure
+  febs-gateway:
+    image: febs-gateway:latest
+    container_name: febs-gateway
+    volumes:
+      - "/febs/log:/log"
+    command:
+      - "--febs-admin=127.0.0.1"
+      - "--mongo.url=127.0.0.1"
+      - "--nacos.url=127.0.0.1"
+      - "--redis.url=127.0.0.1"
+    environment:
+      - "TZ=Asia/Shanghai"
+    ports:
+      - 8301:8301
+    restart: on-failure
+  febs-auth:
+    image: febs-auth:latest
+    container_name: febs-auth
+    volumes:
+      - "/febs/log:/log"
+    command:
+      - "--febs-admin=127.0.0.1"
+      - "--nacos.url=127.0.0.1"
+      - "--mysql.url=127.0.0.1"
+      - "--redis.url=127.0.0.1"
+      - "--spring.profiles.active=prod"
+    environment:
+      - "TZ=Asia/Shanghai"
+    ports:
+      - 8101:8101
+    restart: on-failure
+  febs-server-system:
+    image: febs-server-system:latest
+    container_name: febs-server-system
+    volumes:
+      - "/febs/log:/log"
+    command:
+      - "--febs-admin=127.0.0.1"
+      - "--febs-gateway=127.0.0.1"
+      - "--nacos.url=127.0.0.1"
+      - "--mysql.url=127.0.0.1"
+      - "--febs-tx-manager=127.0.0.1"
+      - "--spring.profiles.active=prod"
+    environment:
+      - "TZ=Asia/Shanghai"
+    ports:
+      - 8201:8201
+    depends_on:
+      - febs-tx-manager
+    restart: on-failure
+  febs-server-test:
+    image: febs-server-test:latest
+    container_name: febs-server-test
+    volumes:
+      - "/febs/log:/log"
+    command:
+      - "--nacos.url=127.0.0.1"
+      - "--febs-admin=127.0.0.1"
+      - "--mysql.url=127.0.0.1"
+      - "--febs-tx-manager=127.0.0.1"
+      - "--febs-gateway=127.0.0.1"
+    environment:
+      - "TZ=Asia/Shanghai"
+    ports:
+      - 8202:8202
+    depends_on:
+      - febs-tx-manager
+    restart: on-failure
+  febs-server-generator:
+    image: febs-server-generator:latest
+    container_name: febs-server-generator
+    volumes:
+      - "/febs/log:/log"
+    command:
+      - "--nacos.url=127.0.0.1"
+      - "--febs-admin=127.0.0.1"
+      - "--mysql.url=127.0.0.1"
+      - "--febs-gateway=127.0.0.1"
+    environment:
+      - "TZ=Asia/Shanghai"
+    ports:
+      - 8203:8203
+    restart: on-failure
+  febs-server-job:
+    image: febs-server-job:latest
+    container_name: febs-server-job
+    volumes:
+      - "/febs/log:/log"
+    command:
+      - "--nacos.url=127.0.0.1"
+      - "--febs-admin=127.0.0.1"
+      - "--mysql.url=127.0.0.1"
+      - "--febs-gateway=127.0.0.1"
+    environment:
+      - "TZ=Asia/Shanghai"
+    ports:
+      - 8204:8204
+    restart: on-failure
+  febs-tx-manager:
+    image: febs-tx-manager:latest
+    container_name: febs-tx-manager
+    volumes:
+      - "/febs/log:/log"
+    command:
+      - "--nacos.url=127.0.0.1"
+      - "--febs-admin=127.0.0.1"
+      - "--mysql.url=127.0.0.1"
+      - "--redis.url=127.0.0.1"
+    environment:
+      - "TZ=Asia/Shanghai"
+    ports:
+      - 8501:8501
+      - 8888:8888
+    restart: on-failure
+  febs-cloud-web:
+    image: febs-cloud-web
+    container_name: febs-cloud-web
+    volumes:
+      - "/febs/log:/log"
+    environment:
+      - "TZ=Asia/Shanghai"
+    ports:
+      - 9527:80
+    restart: on-failure

+ 1 - 10
febs-cloud/docker compose/third-part/docker-compose.yml

@@ -18,13 +18,4 @@ services:
       - /febs/redis/data:/data #挂载 Redis数据
       - /febs/redis/conf/redis.conf:/usr/local/etc/redis/redis.conf #挂载 Redis配置
     ports:
-      - 6379:6379
-  rabbitmq:
-    image: rabbitmq:3.7.15-management
-    container_name: rabbitmq
-    volumes:
-      - /febs/rabbitmq/data:/var/lib/rabbitmq #挂载 RabbitMQ数据
-      - /febs/rabbitmq/log:/var/log/rabbitmq #挂载 RabbitMQ日志
-    ports:
-      - 5672:5672
-      - 15672:15672
+      - 6379:6379

+ 36 - 3
febs-cloud/pom.xml

@@ -6,7 +6,7 @@
 
     <groupId>cc.mrbird</groupId>
     <artifactId>febs-cloud</artifactId>
-    <version>1.6-RELEASE</version>
+    <version>2.0-RELEASE</version>
     <packaging>pom</packaging>
 
     <name>FEBS-Cloud</name>
@@ -17,7 +17,8 @@
         <module>../febs-common</module>
         <module>../febs-server</module>
         <module>../febs-gateway</module>
-        <module>../febs-monitor</module>
+        <module>../febs-apm</module>
+        <module>../febs-tx-manager</module>
     </modules>
 
     <parent>
@@ -31,6 +32,24 @@
         <java.version>1.8</java.version>
         <spring-cloud.version>Hoxton.RELEASE</spring-cloud.version>
         <com-alibaba-cloud.version>2.1.1.RELEASE</com-alibaba-cloud.version>
+        <codingapi.txlcn.version>5.0.2.RELEASE</codingapi.txlcn.version>
+
+        <fastjson.version>1.2.62</fastjson.version>
+        <xml-api.version>1.4.01</xml-api.version>
+        <ip2region.version>1.7</ip2region.version>
+        <guava.version>27.0-jre</guava.version>
+        <excelkit.version>2.0.71</excelkit.version>
+        <mybatis-plus.version>3.2.0</mybatis-plus.version>
+        <dynamic-datasource.version>2.5.7</dynamic-datasource.version>
+        <p6spy.version>3.8.5</p6spy.version>
+        <spring-boot-admin.version>2.2.0</spring-boot-admin.version>
+        <easy-captcha.version>1.6.2</easy-captcha.version>
+        <logstash-logback-encoder.version>6.1</logstash-logback-encoder.version>
+        <justauth.version>1.1.0</justauth.version>
+        <jjwt.version>0.9.1</jjwt.version>
+        <knife4j.version>2.0.2</knife4j.version>
+        <springfox.version>2.9.2</springfox.version>
+        <swagger.version>1.5.21</swagger.version>
     </properties>
 
     <dependencyManagement>
@@ -49,7 +68,21 @@
                 <type>pom</type>
                 <scope>import</scope>
             </dependency>
+            <dependency>
+                <groupId>com.codingapi.txlcn</groupId>
+                <artifactId>txlcn-tc</artifactId>
+                <version>${codingapi.txlcn.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>com.codingapi.txlcn</groupId>
+                <artifactId>txlcn-tm</artifactId>
+                <version>${codingapi.txlcn.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>com.codingapi.txlcn</groupId>
+                <artifactId>txlcn-txmsg-netty</artifactId>
+                <version>${codingapi.txlcn.version}</version>
+            </dependency>
         </dependencies>
     </dependencyManagement>
-
 </project>

+ 196 - 0
febs-cloud/postman/FEBS-Cloud.postman_collection.json

@@ -0,0 +1,196 @@
+{
+	"info": {
+		"_postman_id": "4d61085d-8340-4bf6-880c-15a4185fd915",
+		"name": "FEBS-Cloud",
+		"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
+	},
+	"item": [
+		{
+			"name": "1. 获取令牌",
+			"request": {
+				"auth": {
+					"type": "noauth"
+				},
+				"method": "POST",
+				"header": [
+					{
+						"description": "客户端凭证,值的格式为Basic空格 + client_id:client_secret经过Base64加密后的值",
+						"key": "Authorization",
+						"type": "text",
+						"value": "Basic ZmViczoxMjM0NTY="
+					}
+				],
+				"url": {
+					"raw": "http://localhost:8301/auth/oauth/token?grant_type=password&username=mrbird&password=1234qwer&key=1234&code=9976",
+					"protocol": "http",
+					"host": [
+						"localhost"
+					],
+					"port": "8301",
+					"path": [
+						"auth",
+						"oauth",
+						"token"
+					],
+					"query": [
+						{
+							"key": "grant_type",
+							"value": "password",
+							"description": "认证类型,password密码模式"
+						},
+						{
+							"key": "username",
+							"value": "mrbird",
+							"description": "用户名"
+						},
+						{
+							"key": "password",
+							"value": "1234qwer",
+							"description": "密码"
+						},
+						{
+							"key": "key",
+							"value": "1234",
+							"description": "代表每个验证码的唯一key"
+						},
+						{
+							"key": "code",
+							"value": "9976",
+							"description": "验证码值(验证码的值可以通过浏览器访问http://localhost:8301/auth/captcha?key=1234获取)"
+						}
+					]
+				}
+			},
+			"response": []
+		},
+		{
+			"name": "2. 刷新令牌",
+			"request": {
+				"method": "POST",
+				"header": [
+					{
+						"key": "Authorization",
+						"value": "Basic ZmViczoxMjM0NTY=",
+						"description": "客户端凭证,值的格式为Basic空格 + client_id:client_secret经过Base64加密后的值",
+						"type": "text"
+					}
+				],
+				"url": {
+					"raw": "localhost:8301/auth/oauth/token?grant_type=refresh_token&refresh_token=5d2dd6c3-bd99-4558-b622-bf8612d7c4fb",
+					"host": [
+						"localhost"
+					],
+					"port": "8301",
+					"path": [
+						"auth",
+						"oauth",
+						"token"
+					],
+					"query": [
+						{
+							"key": "grant_type",
+							"value": "refresh_token"
+						},
+						{
+							"key": "refresh_token",
+							"value": "5d2dd6c3-bd99-4558-b622-bf8612d7c4fb"
+						}
+					]
+				}
+			},
+			"response": []
+		},
+		{
+			"name": "3. feign测试",
+			"request": {
+				"method": "GET",
+				"header": [
+					{
+						"key": "Authorization",
+						"value": "bearer 41171c4d-5b22-41d3-bb41-cb08564b2373",
+						"equals": true,
+						"description": "值格式:bearer空格+访问令牌"
+					}
+				],
+				"url": {
+					"raw": "localhost:8301/test/user/list",
+					"host": [
+						"localhost"
+					],
+					"port": "8301",
+					"path": [
+						"test",
+						"user",
+						"list"
+					]
+				}
+			},
+			"response": []
+		},
+		{
+			"name": "4. 通过febsutil获取在线用户信息",
+			"request": {
+				"method": "GET",
+				"header": [
+					{
+						"description": "值格式:bearer空格+访问令牌",
+						"equals": true,
+						"key": "Authorization",
+						"value": "bearer 41171c4d-5b22-41d3-bb41-cb08564b2373"
+					}
+				],
+				"url": {
+					"raw": "localhost:8301/test/user",
+					"host": [
+						"localhost"
+					],
+					"port": "8301",
+					"path": [
+						"test",
+						"user"
+					]
+				}
+			},
+			"response": []
+		},
+		{
+			"name": "5. 分布式事务测试",
+			"request": {
+				"method": "GET",
+				"header": [
+					{
+						"description": "值格式:bearer空格+访问令牌",
+						"key": "Authorization",
+						"type": "text",
+						"value": "bearer 41171c4d-5b22-41d3-bb41-cb08564b2373"
+					}
+				],
+				"url": {
+					"raw": "localhost:8301/test/pay?goodsId=1&goodsName=iPhone SE",
+					"host": [
+						"localhost"
+					],
+					"port": "8301",
+					"path": [
+						"test",
+						"pay"
+					],
+					"query": [
+						{
+							"key": "goodsId",
+							"value": "1",
+							"description": "商品ID"
+						},
+						{
+							"key": "goodsName",
+							"value": "iPhone SE",
+							"description": "商品名称"
+						}
+					]
+				}
+			},
+			"response": []
+		}
+	],
+	"protocolProfileBehavior": {}
+}

+ 1 - 0
febs-cloud/postman/Readme.md

@@ -0,0 +1 @@
+系统一些使用者比较关心的接口的PostMan测试数据,使用PostMan导入即可。

+ 675 - 506
febs-cloud/sql/febs_cloud_base.sql

@@ -1,506 +1,675 @@
-/*
- Navicat Premium Data Transfer
-
- Source Server         : localhost_3306
- Source Server Type    : MySQL
- Source Server Version : 50726
- Source Host           : localhost:3306
- Source Schema         : febs_cloud_base
-
- Target Server Type    : MySQL
- Target Server Version : 50726
- File Encoding         : 65001
-
- Date: 16/01/2020 14:03:23
-*/
-
-SET NAMES utf8mb4;
-SET FOREIGN_KEY_CHECKS = 0;
-
--- ----------------------------
--- Table structure for oauth_client_details
--- ----------------------------
-DROP TABLE IF EXISTS `oauth_client_details`;
-CREATE TABLE `oauth_client_details`  (
-                                         `client_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
-                                         `resource_ids` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
-                                         `client_secret` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
-                                         `scope` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
-                                         `authorized_grant_types` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
-                                         `web_server_redirect_uri` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
-                                         `authorities` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
-                                         `access_token_validity` int(11) NOT NULL,
-                                         `refresh_token_validity` int(11) NULL DEFAULT NULL,
-                                         `additional_information` varchar(4096) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
-                                         `autoapprove` tinyint(4) NULL DEFAULT NULL,
-                                         `origin_secret` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
-                                         PRIMARY KEY (`client_id`) USING BTREE
-) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
-
--- ----------------------------
--- Records of oauth_client_details
--- ----------------------------
-INSERT INTO `oauth_client_details` VALUES ('app', '', '$2a$10$88IWBHS3PUn9.NSeA1cMbeotMCbc2tOposnW7efm4ed1T4ZCay2ei', 'all', 'password,refresh_token', '', NULL, 86400, 8640000, NULL, 1, '123456');
-INSERT INTO `oauth_client_details` VALUES ('febs', NULL, '$2a$10$aSZTvMOtUAYUQ.75z2n3ceJd6dCIk9Vy3J/SKZUE4hBLd6sz7.6ge', 'all', 'password,refresh_token', NULL, NULL, 86400, 8640000, NULL, 1, '123456');
-INSERT INTO `oauth_client_details` VALUES ('swagger', '', '$2a$10$HSXh7gb19pngr8gcvzkODOvhQ048m6mrlXtaHJmBUE2jca7RvjEBa', 'test', 'password,refresh_token', '', NULL, 86400, 86400, '', 0, '123456');
-
--- ----------------------------
--- Table structure for t_dept
--- ----------------------------
-DROP TABLE IF EXISTS `t_dept`;
-CREATE TABLE `t_dept`  (
-                           `DEPT_ID` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '部门ID',
-                           `PARENT_ID` bigint(20) NOT NULL COMMENT '上级部门ID',
-                           `DEPT_NAME` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '部门名称',
-                           `ORDER_NUM` double(20, 0) NULL DEFAULT NULL COMMENT '排序',
-                           `CREATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
-                           `MODIFY_TIME` datetime(0) NULL DEFAULT NULL COMMENT '修改时间',
-                           PRIMARY KEY (`DEPT_ID`) USING BTREE
-) ENGINE = InnoDB AUTO_INCREMENT = 7 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '部门表' ROW_FORMAT = Dynamic;
-
--- ----------------------------
--- Records of t_dept
--- ----------------------------
-INSERT INTO `t_dept` VALUES (1, 0, '开发部', 1, '2018-01-04 15:42:26', '2019-01-05 21:08:27');
-INSERT INTO `t_dept` VALUES (2, 1, '开发一部', 1, '2018-01-04 15:42:34', '2019-01-18 00:59:37');
-INSERT INTO `t_dept` VALUES (3, 1, '开发二部', 2, '2018-01-04 15:42:29', '2019-01-05 14:09:39');
-INSERT INTO `t_dept` VALUES (4, 0, '市场部', 2, '2018-01-04 15:42:36', '2019-01-23 06:27:56');
-INSERT INTO `t_dept` VALUES (5, 0, '人事部', 3, '2018-01-04 15:42:32', '2019-01-23 06:27:59');
-INSERT INTO `t_dept` VALUES (6, 0, '测试部', 4, '2018-01-04 15:42:38', '2019-01-17 08:15:47');
-
--- ----------------------------
--- Table structure for t_eximport
--- ----------------------------
-DROP TABLE IF EXISTS `t_eximport`;
-CREATE TABLE `t_eximport`  (
-                               `FIELD1` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
-                               `FIELD2` int(11) NOT NULL,
-                               `FIELD3` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
-                               `CREATE_TIME` datetime(0) NOT NULL
-) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = 'Excel导入导出测试' ROW_FORMAT = Dynamic;
-
--- ----------------------------
--- Records of t_eximport
--- ----------------------------
-INSERT INTO `t_eximport` VALUES ('字段1', 1, 'mrbird0@gmail.com', '2019-07-25 19:08:01');
-INSERT INTO `t_eximport` VALUES ('字段1', 2, 'mrbird1@gmail.com', '2019-07-25 19:08:01');
-INSERT INTO `t_eximport` VALUES ('字段1', 3, 'mrbird2@gmail.com', '2019-07-25 19:08:01');
-INSERT INTO `t_eximport` VALUES ('字段1', 4, 'mrbird3@gmail.com', '2019-07-25 19:08:01');
-INSERT INTO `t_eximport` VALUES ('字段1', 5, 'mrbird4@gmail.com', '2019-07-25 19:08:01');
-INSERT INTO `t_eximport` VALUES ('字段1', 6, 'mrbird5@gmail.com', '2019-07-25 19:08:01');
-INSERT INTO `t_eximport` VALUES ('字段1', 7, 'mrbird6@gmail.com', '2019-07-25 19:08:01');
-INSERT INTO `t_eximport` VALUES ('字段1', 8, 'mrbird7@gmail.com', '2019-07-25 19:08:01');
-
--- ----------------------------
--- Table structure for t_generator_config
--- ----------------------------
-DROP TABLE IF EXISTS `t_generator_config`;
-CREATE TABLE `t_generator_config`  (
-                                       `id` int(11) NOT NULL COMMENT '主键',
-                                       `author` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '作者',
-                                       `base_package` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '基础包名',
-                                       `entity_package` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'entity文件存放路径',
-                                       `mapper_package` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'mapper文件存放路径',
-                                       `mapper_xml_package` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'mapper xml文件存放路径',
-                                       `service_package` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'servcie文件存放路径',
-                                       `service_impl_package` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'serviceImpl文件存放路径',
-                                       `controller_package` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'controller文件存放路径',
-                                       `is_trim` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '是否去除前缀 1是 0否',
-                                       `trim_value` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '前缀内容',
-                                       PRIMARY KEY (`id`) USING BTREE
-) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '代码生成配置表' ROW_FORMAT = Dynamic;
-
--- ----------------------------
--- Records of t_generator_config
--- ----------------------------
-INSERT INTO `t_generator_config` VALUES (1, 'MrBird', 'cc.mrbird.febs.gen', 'entity', 'mapper', 'mapper', 'service', 'service.impl', 'controller', '1', 't_');
-
--- ----------------------------
--- Table structure for t_log
--- ----------------------------
-DROP TABLE IF EXISTS `t_log`;
-CREATE TABLE `t_log`  (
-                          `ID` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '日志ID',
-                          `USERNAME` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '操作用户',
-                          `OPERATION` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '操作内容',
-                          `TIME` decimal(11, 0) NULL DEFAULT NULL COMMENT '耗时',
-                          `METHOD` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '操作方法',
-                          `PARAMS` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '方法参数',
-                          `IP` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '操作者IP',
-                          `CREATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
-                          `location` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '操作地点',
-                          PRIMARY KEY (`ID`) USING BTREE
-) ENGINE = InnoDB AUTO_INCREMENT = 21 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '用户操作日志表' ROW_FORMAT = Dynamic;
-
--- ----------------------------
--- Table structure for t_login_log
--- ----------------------------
-DROP TABLE IF EXISTS `t_login_log`;
-CREATE TABLE `t_login_log`  (
-                                `ID` bigint(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
-                                `USERNAME` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '用户名',
-                                `LOGIN_TIME` datetime(0) NOT NULL COMMENT '登录时间',
-                                `LOCATION` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '登录地点',
-                                `IP` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'IP地址',
-                                `SYSTEM` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '操作系统',
-                                `BROWSER` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '浏览器',
-                                PRIMARY KEY (`ID`) USING BTREE
-) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '登录日志表' ROW_FORMAT = Dynamic;
-
--- ----------------------------
--- Table structure for t_menu
--- ----------------------------
-DROP TABLE IF EXISTS `t_menu`;
-CREATE TABLE `t_menu`  (
-                           `MENU_ID` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '菜单/按钮ID',
-                           `PARENT_ID` bigint(20) NOT NULL COMMENT '上级菜单ID',
-                           `MENU_NAME` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '菜单/按钮名称',
-                           `PATH` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '对应路由path',
-                           `COMPONENT` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '对应路由组件component',
-                           `PERMS` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '权限标识',
-                           `ICON` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '图标',
-                           `TYPE` char(2) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '类型 0菜单 1按钮',
-                           `ORDER_NUM` double(20, 0) NULL DEFAULT NULL COMMENT '排序',
-                           `CREATE_TIME` datetime(0) NOT NULL COMMENT '创建时间',
-                           `MODIFY_TIME` datetime(0) NULL DEFAULT NULL COMMENT '修改时间',
-                           PRIMARY KEY (`MENU_ID`) USING BTREE
-) ENGINE = InnoDB AUTO_INCREMENT = 180 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '菜单表' ROW_FORMAT = Dynamic;
-
--- ----------------------------
--- Records of t_menu
--- ----------------------------
-INSERT INTO `t_menu` VALUES (1, 0, '系统管理', '/system', 'Layout', NULL, 'el-icon-set-up', '0', 1, '2017-12-27 16:39:07', '2019-07-20 16:19:04');
-INSERT INTO `t_menu` VALUES (2, 0, '系统监控', '/monitor', 'Layout', NULL, 'el-icon-data-line', '0', 2, '2017-12-27 16:45:51', '2019-01-23 06:27:12');
-INSERT INTO `t_menu` VALUES (3, 1, '用户管理', '/system/user', 'febs/system/user/Index', 'user:view', '', '0', 1, '2017-12-27 16:47:13', '2019-01-22 06:45:55');
-INSERT INTO `t_menu` VALUES (4, 1, '角色管理', '/system/role', 'febs/system/role/Index', 'role:view', '', '0', 2, '2017-12-27 16:48:09', '2018-04-25 09:01:12');
-INSERT INTO `t_menu` VALUES (5, 1, '菜单管理', '/system/menu', 'febs/system/menu/Index', 'menu:view', '', '0', 3, '2017-12-27 16:48:57', '2018-04-25 09:01:30');
-INSERT INTO `t_menu` VALUES (6, 1, '部门管理', '/system/dept', 'febs/system/dept/Index', 'dept:view', '', '0', 4, '2017-12-27 16:57:33', '2018-04-25 09:01:40');
-INSERT INTO `t_menu` VALUES (10, 2, '系统日志', '/monitor/systemlog', 'febs/monitor/systemlog/Index', 'log:view', '', '0', 1, '2017-12-27 17:00:50', '2019-07-22 20:22:31');
-INSERT INTO `t_menu` VALUES (11, 3, '新增用户', '', '', 'user:add', NULL, '1', NULL, '2017-12-27 17:02:58', NULL);
-INSERT INTO `t_menu` VALUES (12, 3, '修改用户', '', '', 'user:update', NULL, '1', NULL, '2017-12-27 17:04:07', NULL);
-INSERT INTO `t_menu` VALUES (13, 3, '删除用户', '', '', 'user:delete', NULL, '1', NULL, '2017-12-27 17:04:58', NULL);
-INSERT INTO `t_menu` VALUES (14, 4, '新增角色', '', '', 'role:add', NULL, '1', NULL, '2017-12-27 17:06:38', NULL);
-INSERT INTO `t_menu` VALUES (15, 4, '修改角色', '', '', 'role:update', NULL, '1', NULL, '2017-12-27 17:06:38', NULL);
-INSERT INTO `t_menu` VALUES (16, 4, '删除角色', '', '', 'role:delete', NULL, '1', NULL, '2017-12-27 17:06:38', NULL);
-INSERT INTO `t_menu` VALUES (17, 5, '新增菜单', '', '', 'menu:add', NULL, '1', NULL, '2017-12-27 17:08:02', NULL);
-INSERT INTO `t_menu` VALUES (18, 5, '修改菜单', '', '', 'menu:update', NULL, '1', NULL, '2017-12-27 17:08:02', NULL);
-INSERT INTO `t_menu` VALUES (19, 5, '删除菜单', '', '', 'menu:delete', NULL, '1', NULL, '2017-12-27 17:08:02', NULL);
-INSERT INTO `t_menu` VALUES (20, 6, '新增部门', '', '', 'dept:add', NULL, '1', NULL, '2017-12-27 17:09:24', NULL);
-INSERT INTO `t_menu` VALUES (21, 6, '修改部门', '', '', 'dept:update', NULL, '1', NULL, '2017-12-27 17:09:24', NULL);
-INSERT INTO `t_menu` VALUES (22, 6, '删除部门', '', '', 'dept:delete', NULL, '1', NULL, '2017-12-27 17:09:24', NULL);
-INSERT INTO `t_menu` VALUES (24, 10, '删除日志', '', '', 'log:delete', NULL, '1', NULL, '2017-12-27 17:11:45', NULL);
-INSERT INTO `t_menu` VALUES (130, 3, '导出Excel', NULL, NULL, 'user:export', NULL, '1', NULL, '2019-01-23 06:35:16', NULL);
-INSERT INTO `t_menu` VALUES (131, 4, '导出Excel', NULL, NULL, 'role:export', NULL, '1', NULL, '2019-01-23 06:35:36', NULL);
-INSERT INTO `t_menu` VALUES (132, 5, '导出Excel', NULL, NULL, 'menu:export', NULL, '1', NULL, '2019-01-23 06:36:05', NULL);
-INSERT INTO `t_menu` VALUES (133, 6, '导出Excel', NULL, NULL, 'dept:export', NULL, '1', NULL, '2019-01-23 06:36:25', NULL);
-INSERT INTO `t_menu` VALUES (135, 3, '密码重置', NULL, NULL, 'user:reset', NULL, '1', NULL, '2019-01-23 06:37:00', NULL);
-INSERT INTO `t_menu` VALUES (136, 10, '导出Excel', NULL, NULL, 'log:export', NULL, '1', NULL, '2019-01-23 06:37:27', NULL);
-INSERT INTO `t_menu` VALUES (148, 2, '监控中心', '/monitor/admin', 'febs/monitor/admin/Index', 'mobitor:admin', '', '0', 6, '2019-07-20 19:42:07', '2019-09-01 10:48:12');
-INSERT INTO `t_menu` VALUES (149, 2, '注册中心', 'http://localhost:8001/nacos', 'Layout', 'monitor:register', '', '0', 3, '2019-07-20 20:07:00', '2019-07-22 20:22:43');
-INSERT INTO `t_menu` VALUES (150, 2, '登录日志', '/monitor/loginlog', 'febs/monitor/loginlog/Index', 'monitor:loginlog', '', '0', 2, '2019-07-22 13:41:17', '2019-07-22 20:22:35');
-INSERT INTO `t_menu` VALUES (151, 150, '删除日志', NULL, NULL, 'loginlog:delete', NULL, '1', NULL, '2019-07-22 13:43:04', NULL);
-INSERT INTO `t_menu` VALUES (152, 150, '导出Excel', NULL, NULL, 'loginlog:export', NULL, '1', NULL, '2019-07-22 13:43:30', NULL);
-INSERT INTO `t_menu` VALUES (153, 2, '接口文档', '/monitor/swagger', 'febs/monitor/swagger/Index', 'monitor:swagger', '', '0', 7, '2019-07-22 20:59:46', '2019-09-01 10:48:16');
-INSERT INTO `t_menu` VALUES (154, 0, '其他模块', '/others', 'Layout', '', 'el-icon-present', '0', 5, '2019-07-25 10:16:16', '2020-01-16 13:59:52');
-INSERT INTO `t_menu` VALUES (155, 154, '导入导出', '/others/eximport', 'febs/others/eximport/Index', 'others:eximport', '', '0', 1, '2019-07-25 10:19:31', NULL);
-INSERT INTO `t_menu` VALUES (156, 0, '代码生成', '/gen', 'Layout', '', 'el-icon-printer', '0', 4, '2019-07-25 10:24:03', '2020-01-16 13:59:49');
-INSERT INTO `t_menu` VALUES (157, 156, '生成配置', '/gen/config', 'febs/gen/config/Index', 'gen:config', '', '0', 1, '2019-07-25 10:24:55', NULL);
-INSERT INTO `t_menu` VALUES (158, 156, '生成代码', '/gen/generate', 'febs/gen/generate/Index', 'gen:generate', '', '0', 2, '2019-07-25 10:25:26', '2019-07-25 11:13:20');
-INSERT INTO `t_menu` VALUES (159, 157, '修改配置', NULL, NULL, 'gen:config:update', NULL, '1', NULL, '2019-07-26 16:22:56', NULL);
-INSERT INTO `t_menu` VALUES (160, 158, '打包生成', NULL, NULL, 'gen:generate:gen', NULL, '1', NULL, '2019-07-26 16:23:38', '2019-07-26 16:23:53');
-INSERT INTO `t_menu` VALUES (161, 2, '请求追踪', '/monitor/zipkin', 'febs/monitor/zipkin/Index', 'monitor:zipkin', '', '0', 4, '2019-09-01 10:41:49', NULL);
-INSERT INTO `t_menu` VALUES (162, 2, '日志收集', '/monitor/kibana', 'febs/monitor/kibana/Index', 'monitor:kibana', '', '0', 5, '2019-09-01 10:48:07', NULL);
-INSERT INTO `t_menu` VALUES (163, 1, '客户端管理', '/client', 'febs/system/client/Index', 'client:view', '', '0', 5, '2019-09-26 22:58:09', NULL);
-INSERT INTO `t_menu` VALUES (164, 163, '新增', NULL, NULL, 'client:add', NULL, '1', NULL, '2019-09-26 22:58:21', NULL);
-INSERT INTO `t_menu` VALUES (165, 163, '修改', NULL, NULL, 'client:update', NULL, '1', NULL, '2019-09-26 22:58:43', NULL);
-INSERT INTO `t_menu` VALUES (166, 163, '删除', NULL, NULL, 'client:delete', NULL, '1', NULL, '2019-09-26 22:58:55', NULL);
-INSERT INTO `t_menu` VALUES (167, 163, '解密', NULL, NULL, 'client:decrypt', NULL, '1', NULL, '2019-09-26 22:59:08', NULL);
-INSERT INTO `t_menu` VALUES (168, 0, '静态组件', '/components', 'Layout', '', 'el-icon-present', '0', 6, '2019-12-02 16:41:28', '2020-01-16 13:59:55');
-INSERT INTO `t_menu` VALUES (169, 168, '二级菜单', '/two', 'demos/two/Index', '', '', '0', 1, '2019-12-02 16:41:51', NULL);
-INSERT INTO `t_menu` VALUES (170, 169, '三级菜单', '/three', 'demos/two/three/Index', '', '', '0', 1, '2019-12-02 16:42:09', NULL);
-INSERT INTO `t_menu` VALUES (171, 168, 'MarkDown', '/components/markdown', 'demos/markdown', '', '', '0', 2, '2019-12-02 16:42:34', NULL);
-INSERT INTO `t_menu` VALUES (172, 168, '富文本编辑器', '/components/tinymce', 'demos/tinymce', '', '', '0', 3, '2019-12-02 16:42:50', NULL);
-INSERT INTO `t_menu` VALUES (173, 0, '网关管理', '/route', 'Layout', '', 'el-icon-odometer', '0', 3, '2020-01-16 14:00:15', NULL);
-INSERT INTO `t_menu` VALUES (174, 173, '网关用户', '/route/user', 'febs/route/routeuser/Index', '', '', '0', 1, '2020-01-16 14:00:32', NULL);
-INSERT INTO `t_menu` VALUES (175, 173, '网关日志', '/route/log', 'febs/route/routelog/Index', '', '', '0', 2, '2020-01-16 14:00:47', NULL);
-INSERT INTO `t_menu` VALUES (176, 173, '限流规则', '/route/ratelimitrule', 'febs/route/ratelimitrule/Index', '', '', '0', 3, '2020-01-16 14:01:01', NULL);
-INSERT INTO `t_menu` VALUES (177, 173, '限流日志', '/route/ratelimitlog', 'febs/route/ratelimitlog/Index', '', '', '0', 4, '2020-01-16 14:01:17', NULL);
-INSERT INTO `t_menu` VALUES (178, 173, '黑名单管理', '/route/blacklist', 'febs/route/blacklist/Index', '', '', '0', 5, '2020-01-16 14:01:32', NULL);
-INSERT INTO `t_menu` VALUES (179, 173, '黑名单日志', '/route/blocklog', 'febs/route/blocklog/Index', '', '', '0', 6, '2020-01-16 14:01:49', NULL);
-
--- ----------------------------
--- Table structure for t_role
--- ----------------------------
-DROP TABLE IF EXISTS `t_role`;
-CREATE TABLE `t_role`  (
-                           `ROLE_ID` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '角色ID',
-                           `ROLE_NAME` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '角色名称',
-                           `REMARK` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '角色描述',
-                           `CREATE_TIME` datetime(0) NOT NULL COMMENT '创建时间',
-                           `MODIFY_TIME` datetime(0) NULL DEFAULT NULL COMMENT '修改时间',
-                           PRIMARY KEY (`ROLE_ID`) USING BTREE
-) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '角色表' ROW_FORMAT = Dynamic;
-
--- ----------------------------
--- Records of t_role
--- ----------------------------
-INSERT INTO `t_role` VALUES (1, '管理员', '管理员', '2017-12-27 16:23:11', '2020-01-16 14:02:06');
-INSERT INTO `t_role` VALUES (2, '注册用户', '可查看,新增,导出', '2019-01-04 14:11:28', '2020-01-16 14:02:21');
-INSERT INTO `t_role` VALUES (3, '系统监控员', '负责系统监控模块', '2019-09-01 10:30:25', '2019-09-01 10:30:37');
-
--- ----------------------------
--- Table structure for t_role_menu
--- ----------------------------
-DROP TABLE IF EXISTS `t_role_menu`;
-CREATE TABLE `t_role_menu`  (
-                                `ROLE_ID` bigint(20) NOT NULL,
-                                `MENU_ID` bigint(20) NOT NULL
-) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '角色菜单关联表' ROW_FORMAT = Dynamic;
-
--- ----------------------------
--- Records of t_role_menu
--- ----------------------------
-INSERT INTO `t_role_menu` VALUES (3, 2);
-INSERT INTO `t_role_menu` VALUES (3, 10);
-INSERT INTO `t_role_menu` VALUES (3, 24);
-INSERT INTO `t_role_menu` VALUES (3, 136);
-INSERT INTO `t_role_menu` VALUES (3, 150);
-INSERT INTO `t_role_menu` VALUES (3, 151);
-INSERT INTO `t_role_menu` VALUES (3, 152);
-INSERT INTO `t_role_menu` VALUES (3, 149);
-INSERT INTO `t_role_menu` VALUES (3, 148);
-INSERT INTO `t_role_menu` VALUES (3, 153);
-INSERT INTO `t_role_menu` VALUES (1, 1);
-INSERT INTO `t_role_menu` VALUES (1, 3);
-INSERT INTO `t_role_menu` VALUES (1, 11);
-INSERT INTO `t_role_menu` VALUES (1, 12);
-INSERT INTO `t_role_menu` VALUES (1, 13);
-INSERT INTO `t_role_menu` VALUES (1, 130);
-INSERT INTO `t_role_menu` VALUES (1, 135);
-INSERT INTO `t_role_menu` VALUES (1, 4);
-INSERT INTO `t_role_menu` VALUES (1, 14);
-INSERT INTO `t_role_menu` VALUES (1, 15);
-INSERT INTO `t_role_menu` VALUES (1, 16);
-INSERT INTO `t_role_menu` VALUES (1, 131);
-INSERT INTO `t_role_menu` VALUES (1, 5);
-INSERT INTO `t_role_menu` VALUES (1, 17);
-INSERT INTO `t_role_menu` VALUES (1, 18);
-INSERT INTO `t_role_menu` VALUES (1, 19);
-INSERT INTO `t_role_menu` VALUES (1, 132);
-INSERT INTO `t_role_menu` VALUES (1, 6);
-INSERT INTO `t_role_menu` VALUES (1, 20);
-INSERT INTO `t_role_menu` VALUES (1, 21);
-INSERT INTO `t_role_menu` VALUES (1, 22);
-INSERT INTO `t_role_menu` VALUES (1, 133);
-INSERT INTO `t_role_menu` VALUES (1, 163);
-INSERT INTO `t_role_menu` VALUES (1, 164);
-INSERT INTO `t_role_menu` VALUES (1, 165);
-INSERT INTO `t_role_menu` VALUES (1, 166);
-INSERT INTO `t_role_menu` VALUES (1, 167);
-INSERT INTO `t_role_menu` VALUES (1, 2);
-INSERT INTO `t_role_menu` VALUES (1, 10);
-INSERT INTO `t_role_menu` VALUES (1, 24);
-INSERT INTO `t_role_menu` VALUES (1, 136);
-INSERT INTO `t_role_menu` VALUES (1, 150);
-INSERT INTO `t_role_menu` VALUES (1, 151);
-INSERT INTO `t_role_menu` VALUES (1, 152);
-INSERT INTO `t_role_menu` VALUES (1, 149);
-INSERT INTO `t_role_menu` VALUES (1, 161);
-INSERT INTO `t_role_menu` VALUES (1, 162);
-INSERT INTO `t_role_menu` VALUES (1, 148);
-INSERT INTO `t_role_menu` VALUES (1, 153);
-INSERT INTO `t_role_menu` VALUES (1, 173);
-INSERT INTO `t_role_menu` VALUES (1, 174);
-INSERT INTO `t_role_menu` VALUES (1, 175);
-INSERT INTO `t_role_menu` VALUES (1, 176);
-INSERT INTO `t_role_menu` VALUES (1, 177);
-INSERT INTO `t_role_menu` VALUES (1, 178);
-INSERT INTO `t_role_menu` VALUES (1, 179);
-INSERT INTO `t_role_menu` VALUES (1, 156);
-INSERT INTO `t_role_menu` VALUES (1, 157);
-INSERT INTO `t_role_menu` VALUES (1, 159);
-INSERT INTO `t_role_menu` VALUES (1, 158);
-INSERT INTO `t_role_menu` VALUES (1, 160);
-INSERT INTO `t_role_menu` VALUES (1, 154);
-INSERT INTO `t_role_menu` VALUES (1, 155);
-INSERT INTO `t_role_menu` VALUES (1, 168);
-INSERT INTO `t_role_menu` VALUES (1, 169);
-INSERT INTO `t_role_menu` VALUES (1, 170);
-INSERT INTO `t_role_menu` VALUES (1, 171);
-INSERT INTO `t_role_menu` VALUES (1, 172);
-INSERT INTO `t_role_menu` VALUES (2, 1);
-INSERT INTO `t_role_menu` VALUES (2, 3);
-INSERT INTO `t_role_menu` VALUES (2, 4);
-INSERT INTO `t_role_menu` VALUES (2, 5);
-INSERT INTO `t_role_menu` VALUES (2, 6);
-INSERT INTO `t_role_menu` VALUES (2, 2);
-INSERT INTO `t_role_menu` VALUES (2, 10);
-INSERT INTO `t_role_menu` VALUES (2, 150);
-INSERT INTO `t_role_menu` VALUES (2, 149);
-INSERT INTO `t_role_menu` VALUES (2, 148);
-INSERT INTO `t_role_menu` VALUES (2, 153);
-INSERT INTO `t_role_menu` VALUES (2, 173);
-INSERT INTO `t_role_menu` VALUES (2, 174);
-INSERT INTO `t_role_menu` VALUES (2, 175);
-INSERT INTO `t_role_menu` VALUES (2, 176);
-INSERT INTO `t_role_menu` VALUES (2, 177);
-INSERT INTO `t_role_menu` VALUES (2, 178);
-INSERT INTO `t_role_menu` VALUES (2, 179);
-INSERT INTO `t_role_menu` VALUES (2, 156);
-INSERT INTO `t_role_menu` VALUES (2, 157);
-INSERT INTO `t_role_menu` VALUES (2, 158);
-INSERT INTO `t_role_menu` VALUES (2, 154);
-INSERT INTO `t_role_menu` VALUES (2, 155);
-INSERT INTO `t_role_menu` VALUES (2, 168);
-INSERT INTO `t_role_menu` VALUES (2, 169);
-INSERT INTO `t_role_menu` VALUES (2, 170);
-INSERT INTO `t_role_menu` VALUES (2, 171);
-INSERT INTO `t_role_menu` VALUES (2, 172);
-
--- ----------------------------
--- Table structure for t_trade_log
--- ----------------------------
-DROP TABLE IF EXISTS `t_trade_log`;
-CREATE TABLE `t_trade_log`  (
-                                `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID',
-                                `goods_id` int(11) NOT NULL COMMENT '商品ID',
-                                `goods_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '商品名称',
-                                `status` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '状态',
-                                `create_time` datetime(0) NOT NULL COMMENT '创建时间',
-                                PRIMARY KEY (`id`) USING BTREE
-) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-
--- ----------------------------
--- Table structure for t_user
--- ----------------------------
-DROP TABLE IF EXISTS `t_user`;
-CREATE TABLE `t_user`  (
-                           `USER_ID` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '用户ID',
-                           `USERNAME` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '用户名',
-                           `PASSWORD` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '密码',
-                           `DEPT_ID` bigint(20) NULL DEFAULT NULL COMMENT '部门ID',
-                           `EMAIL` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '邮箱',
-                           `MOBILE` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '联系电话',
-                           `STATUS` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '状态 0锁定 1有效',
-                           `CREATE_TIME` datetime(0) NOT NULL COMMENT '创建时间',
-                           `MODIFY_TIME` datetime(0) NULL DEFAULT NULL COMMENT '修改时间',
-                           `LAST_LOGIN_TIME` datetime(0) NULL DEFAULT NULL COMMENT '最近访问时间',
-                           `SSEX` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '性别 0男 1女 2保密',
-                           `IS_TAB` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '是否开启tab,0关闭 1开启',
-                           `THEME` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '主题',
-                           `AVATAR` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '头像',
-                           `DESCRIPTION` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '描述',
-                           PRIMARY KEY (`USER_ID`) USING BTREE
-) ENGINE = InnoDB AUTO_INCREMENT = 17 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '用户表' ROW_FORMAT = Dynamic;
-
--- ----------------------------
--- Records of t_user
--- ----------------------------
-INSERT INTO `t_user` VALUES (1, 'MrBird', '$2a$10$gzhiUb1ldc1Rf3lka4k/WOoFKKGPepHSzJxzcPSN5/65SzkMdc.SK', 2, 'mrbird@qq.com', '17788888888', '1', '2019-06-14 20:39:22', '2019-07-19 10:18:36', '2020-01-16 13:58:28', '0', '1', 'white', 'gaOngJwsRYRaVAuXXcmB.png', '我是帅比作者。');
-INSERT INTO `t_user` VALUES (15, 'scott', '$2a$10$7tATi2STciLHnEgO/RfIxOYf2MQBu/SDVMRDs54rlSYVj2VmwwCHC', 5, 'scott@hotmail.com', '17720888888', '1', '2019-07-20 19:00:32', '2019-07-31 10:14:29', '2019-09-01 10:35:31', '2', NULL, NULL, 'BiazfanxmamNRoxxVxka.png', NULL);
-INSERT INTO `t_user` VALUES (16, 'Jane', '$2a$10$ECkfipOPY7hORVdlSzIOX.8hnig0shAZQPG8pQ7D5iVP.uVogmmHy', 4, 'Jane@hotmail.com', '13489898989', '1', '2019-09-01 10:31:21', '2019-09-01 10:32:10', '2019-09-01 10:32:27', '1', NULL, NULL, '2dd7a2d09fa94bf8b5c52e5318868b4d9.jpg', NULL);
-
--- ----------------------------
--- Table structure for t_user_connection
--- ----------------------------
-DROP TABLE IF EXISTS `t_user_connection`;
-CREATE TABLE `t_user_connection`  (
-                                      `USER_NAME` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'FEBS系统用户名',
-                                      `PROVIDER_NAME` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '第三方平台名称',
-                                      `PROVIDER_USER_ID` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '第三方平台账户ID',
-                                      `PROVIDER_USER_NAME` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '第三方平台用户名',
-                                      `NICK_NAME` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '第三方平台昵称',
-                                      `IMAGE_URL` varchar(512) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '第三方平台头像',
-                                      `LOCATION` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '地址',
-                                      `REMARK` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
-                                      PRIMARY KEY (`USER_NAME`, `PROVIDER_NAME`, `PROVIDER_USER_ID`) USING BTREE,
-                                      UNIQUE INDEX `UserConnectionRank`(`USER_NAME`, `PROVIDER_NAME`, `PROVIDER_USER_ID`) USING BTREE
-) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-
--- ----------------------------
--- Table structure for t_user_role
--- ----------------------------
-DROP TABLE IF EXISTS `t_user_role`;
-CREATE TABLE `t_user_role`  (
-                                `USER_ID` bigint(20) NOT NULL COMMENT '用户ID',
-                                `ROLE_ID` bigint(20) NOT NULL COMMENT '角色ID'
-) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '用户角色关联表' ROW_FORMAT = Dynamic;
-
--- ----------------------------
--- Records of t_user_role
--- ----------------------------
-INSERT INTO `t_user_role` VALUES (1, 1);
-INSERT INTO `t_user_role` VALUES (15, 2);
-INSERT INTO `t_user_role` VALUES (16, 3);
-
--- ----------------------------
--- Table structure for zipkin_annotations
--- ----------------------------
-DROP TABLE IF EXISTS `zipkin_annotations`;
-CREATE TABLE `zipkin_annotations`  (
-                                       `trace_id_high` bigint(20) NOT NULL DEFAULT 0 COMMENT 'If non zero, this means the trace uses 128 bit traceIds instead of 64 bit',
-                                       `trace_id` bigint(20) NOT NULL COMMENT 'coincides with zipkin_spans.trace_id',
-                                       `span_id` bigint(20) NOT NULL COMMENT 'coincides with zipkin_spans.id',
-                                       `a_key` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'BinaryAnnotation.key or Annotation.value if type == -1',
-                                       `a_value` blob NULL COMMENT 'BinaryAnnotation.value(), which must be smaller than 64KB',
-                                       `a_type` int(11) NOT NULL COMMENT 'BinaryAnnotation.type() or -1 if Annotation',
-                                       `a_timestamp` bigint(20) NULL DEFAULT NULL COMMENT 'Used to implement TTL; Annotation.timestamp or zipkin_spans.timestamp',
-                                       `endpoint_ipv4` int(11) NULL DEFAULT NULL COMMENT 'Null when Binary/Annotation.endpoint is null',
-                                       `endpoint_ipv6` binary(16) NULL DEFAULT NULL COMMENT 'Null when Binary/Annotation.endpoint is null, or no IPv6 address',
-                                       `endpoint_port` smallint(6) NULL DEFAULT NULL COMMENT 'Null when Binary/Annotation.endpoint is null',
-                                       `endpoint_service_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'Null when Binary/Annotation.endpoint is null',
-                                       UNIQUE INDEX `trace_id_high`(`trace_id_high`, `trace_id`, `span_id`, `a_key`, `a_timestamp`) USING BTREE COMMENT 'Ignore insert on duplicate',
-                                       UNIQUE INDEX `trace_id_high_4`(`trace_id_high`, `trace_id`, `span_id`, `a_key`, `a_timestamp`) USING BTREE COMMENT 'Ignore insert on duplicate',
-                                       INDEX `trace_id_high_2`(`trace_id_high`, `trace_id`, `span_id`) USING BTREE COMMENT 'for joining with zipkin_spans',
-                                       INDEX `trace_id_high_3`(`trace_id_high`, `trace_id`) USING BTREE COMMENT 'for getTraces/ByIds',
-                                       INDEX `endpoint_service_name`(`endpoint_service_name`) USING BTREE COMMENT 'for getTraces and getServiceNames',
-                                       INDEX `a_type`(`a_type`) USING BTREE COMMENT 'for getTraces and autocomplete values',
-                                       INDEX `a_key`(`a_key`) USING BTREE COMMENT 'for getTraces and autocomplete values',
-                                       INDEX `trace_id`(`trace_id`, `span_id`, `a_key`) USING BTREE COMMENT 'for dependencies job',
-                                       INDEX `trace_id_high_5`(`trace_id_high`, `trace_id`, `span_id`) USING BTREE COMMENT 'for joining with zipkin_spans',
-                                       INDEX `trace_id_high_6`(`trace_id_high`, `trace_id`) USING BTREE COMMENT 'for getTraces/ByIds',
-                                       INDEX `endpoint_service_name_2`(`endpoint_service_name`) USING BTREE COMMENT 'for getTraces and getServiceNames',
-                                       INDEX `a_type_2`(`a_type`) USING BTREE COMMENT 'for getTraces and autocomplete values',
-                                       INDEX `a_key_2`(`a_key`) USING BTREE COMMENT 'for getTraces and autocomplete values',
-                                       INDEX `trace_id_2`(`trace_id`, `span_id`, `a_key`) USING BTREE COMMENT 'for dependencies job'
-) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compressed;
-
--- ----------------------------
--- Table structure for zipkin_dependencies
--- ----------------------------
-DROP TABLE IF EXISTS `zipkin_dependencies`;
-CREATE TABLE `zipkin_dependencies`  (
-                                        `day` date NOT NULL,
-                                        `parent` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
-                                        `child` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
-                                        `call_count` bigint(20) NULL DEFAULT NULL,
-                                        `error_count` bigint(20) NULL DEFAULT NULL,
-                                        PRIMARY KEY (`day`, `parent`, `child`) USING BTREE
-) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compressed;
-
--- ----------------------------
--- Table structure for zipkin_spans
--- ----------------------------
-DROP TABLE IF EXISTS `zipkin_spans`;
-CREATE TABLE `zipkin_spans`  (
-                                 `trace_id_high` bigint(20) NOT NULL DEFAULT 0 COMMENT 'If non zero, this means the trace uses 128 bit traceIds instead of 64 bit',
-                                 `trace_id` bigint(20) NOT NULL,
-                                 `id` bigint(20) NOT NULL,
-                                 `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
-                                 `remote_service_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
-                                 `parent_id` bigint(20) NULL DEFAULT NULL,
-                                 `debug` bit(1) NULL DEFAULT NULL,
-                                 `start_ts` bigint(20) NULL DEFAULT NULL COMMENT 'Span.timestamp(): epoch micros used for endTs query and to implement TTL',
-                                 `duration` bigint(20) NULL DEFAULT NULL COMMENT 'Span.duration(): micros used for minDuration and maxDuration query',
-                                 PRIMARY KEY (`trace_id_high`, `trace_id`, `id`) USING BTREE,
-                                 INDEX `trace_id_high`(`trace_id_high`, `trace_id`) USING BTREE COMMENT 'for getTracesByIds',
-                                 INDEX `name`(`name`) USING BTREE COMMENT 'for getTraces and getSpanNames',
-                                 INDEX `remote_service_name`(`remote_service_name`) USING BTREE COMMENT 'for getTraces and getRemoteServiceNames',
-                                 INDEX `start_ts`(`start_ts`) USING BTREE COMMENT 'for getTraces ordering and range',
-                                 INDEX `trace_id_high_2`(`trace_id_high`, `trace_id`) USING BTREE COMMENT 'for getTracesByIds',
-                                 INDEX `name_2`(`name`) USING BTREE COMMENT 'for getTraces and getSpanNames',
-                                 INDEX `remote_service_name_2`(`remote_service_name`) USING BTREE COMMENT 'for getTraces and getRemoteServiceNames',
-                                 INDEX `start_ts_2`(`start_ts`) USING BTREE COMMENT 'for getTraces ordering and range'
-) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compressed;
-
-SET FOREIGN_KEY_CHECKS = 1;
+/*
+ Navicat Premium Data Transfer
+
+ Source Server         : localhost_mysql
+ Source Server Type    : MySQL
+ Source Server Version : 50724
+ Source Host           : localhost:3306
+ Source Schema         : febs_cloud_base
+
+ Target Server Type    : MySQL
+ Target Server Version : 50724
+ File Encoding         : 65001
+
+ Date: 15/04/2020 16:04:11
+*/
+
+SET NAMES utf8mb4;
+SET FOREIGN_KEY_CHECKS = 0;
+
+-- ----------------------------
+-- Table structure for oauth_client_details
+-- ----------------------------
+DROP TABLE IF EXISTS `oauth_client_details`;
+CREATE TABLE `oauth_client_details` (
+                                        `client_id` varchar(255) NOT NULL,
+                                        `resource_ids` varchar(255) DEFAULT NULL,
+                                        `client_secret` varchar(255) NOT NULL,
+                                        `scope` varchar(255) NOT NULL,
+                                        `authorized_grant_types` varchar(255) NOT NULL,
+                                        `web_server_redirect_uri` varchar(255) DEFAULT NULL,
+                                        `authorities` varchar(255) DEFAULT NULL,
+                                        `access_token_validity` int(11) NOT NULL,
+                                        `refresh_token_validity` int(11) DEFAULT NULL,
+                                        `additional_information` varchar(4096) DEFAULT NULL,
+                                        `autoapprove` tinyint(4) DEFAULT NULL,
+                                        `origin_secret` varchar(255) DEFAULT NULL,
+                                        PRIMARY KEY (`client_id`) USING BTREE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='客户端配置表';
+
+-- ----------------------------
+-- Records of oauth_client_details
+-- ----------------------------
+BEGIN;
+INSERT INTO `oauth_client_details` VALUES ('app', '', '$2a$10$8Qk/efslEpO1Af1kyw/rp.DdJGsdnET8UCp1vGDzpQEa.1qBklvua', 'all', 'refresh_token,password', '', NULL, 86400, 864000, NULL, NULL, '123456');
+INSERT INTO `oauth_client_details` VALUES ('febs', ' ', '$2a$10$aSZTvMOtUAYUQ.75z2n3ceJd6dCIk9Vy3J/SKZUE4hBLd6sz7.6ge', 'all', 'password,refresh_token', NULL, NULL, 86400, 8640000, NULL, 1, '123456');
+COMMIT;
+
+-- ----------------------------
+-- Table structure for t_data_permission_test
+-- ----------------------------
+DROP TABLE IF EXISTS `t_data_permission_test`;
+CREATE TABLE `t_data_permission_test` (
+                                          `FIELD1` varchar(20) NOT NULL,
+                                          `FIELD2` varchar(20) NOT NULL,
+                                          `FIELD3` varchar(20) NOT NULL,
+                                          `FIELD4` varchar(20) NOT NULL,
+                                          `DEPT_ID` int(11) NOT NULL,
+                                          `CREATE_TIME` datetime NOT NULL,
+                                          `ID` int(11) NOT NULL,
+                                          PRIMARY KEY (`ID`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户权限测试';
+
+-- ----------------------------
+-- Records of t_data_permission_test
+-- ----------------------------
+BEGIN;
+INSERT INTO `t_data_permission_test` VALUES ('小米', '小米10Pro', '4999', '珍珠白', 1, '2020-04-14 15:00:38', 1);
+INSERT INTO `t_data_permission_test` VALUES ('腾讯', '黑鲨游戏手机3', '3799', '铠甲灰', 2, '2020-04-14 15:01:36', 2);
+INSERT INTO `t_data_permission_test` VALUES ('华为', '华为P30', '3299', '天空之境', 1, '2020-04-14 15:03:11', 3);
+INSERT INTO `t_data_permission_test` VALUES ('华为', '华为P40Pro', '6488', '亮黑色', 3, '2020-04-14 15:04:31', 4);
+INSERT INTO `t_data_permission_test` VALUES ('vivo', 'Vivo iQOO 3', '3998', '拉力橙', 4, '2020-04-14 15:05:55', 5);
+INSERT INTO `t_data_permission_test` VALUES ('一加', '一加7T', '3199', '冰际蓝', 5, '2020-04-14 15:06:53', 6);
+INSERT INTO `t_data_permission_test` VALUES ('三星', '三星Galaxy S10', '4098', '浩玉白', 6, '2020-04-14 15:08:25', 7);
+INSERT INTO `t_data_permission_test` VALUES ('苹果', 'iPhone 11 pro max', '9198', '暗夜绿', 4, '2020-04-14 15:09:20', 8);
+COMMIT;
+
+-- ----------------------------
+-- Table structure for t_dept
+-- ----------------------------
+DROP TABLE IF EXISTS `t_dept`;
+CREATE TABLE `t_dept` (
+                          `DEPT_ID` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '部门ID',
+                          `PARENT_ID` bigint(20) NOT NULL COMMENT '上级部门ID',
+                          `DEPT_NAME` varchar(100) NOT NULL COMMENT '部门名称',
+                          `ORDER_NUM` double(20,0) DEFAULT NULL COMMENT '排序',
+                          `CREATE_TIME` datetime DEFAULT NULL COMMENT '创建时间',
+                          `MODIFY_TIME` datetime DEFAULT NULL COMMENT '修改时间',
+                          PRIMARY KEY (`DEPT_ID`) USING BTREE,
+                          KEY `t_dept_parent_id` (`PARENT_ID`),
+                          KEY `t_dept_dept_name` (`DEPT_NAME`)
+) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='部门表';
+
+-- ----------------------------
+-- Records of t_dept
+-- ----------------------------
+BEGIN;
+INSERT INTO `t_dept` VALUES (1, 0, '开发部', 1, '2018-01-04 15:42:26', '2019-01-05 21:08:27');
+INSERT INTO `t_dept` VALUES (2, 1, '开发一部', 1, '2018-01-04 15:42:34', '2019-01-18 00:59:37');
+INSERT INTO `t_dept` VALUES (3, 1, '开发二部', 2, '2018-01-04 15:42:29', '2019-01-05 14:09:39');
+INSERT INTO `t_dept` VALUES (4, 0, '市场部', 2, '2018-01-04 15:42:36', '2019-01-23 06:27:56');
+INSERT INTO `t_dept` VALUES (5, 0, '人事部', 3, '2018-01-04 15:42:32', '2019-01-23 06:27:59');
+INSERT INTO `t_dept` VALUES (6, 0, '测试部', 4, '2018-01-04 15:42:38', '2019-01-17 08:15:47');
+COMMIT;
+
+-- ----------------------------
+-- Table structure for t_eximport
+-- ----------------------------
+DROP TABLE IF EXISTS `t_eximport`;
+CREATE TABLE `t_eximport` (
+                              `FIELD1` varchar(20) NOT NULL,
+                              `FIELD2` int(11) NOT NULL,
+                              `FIELD3` varchar(100) NOT NULL,
+                              `CREATE_TIME` datetime NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Excel导入导出测试';
+
+-- ----------------------------
+-- Records of t_eximport
+-- ----------------------------
+BEGIN;
+INSERT INTO `t_eximport` VALUES ('字段1', 1, 'mrbird0@gmail.com', '2019-07-25 19:08:01');
+INSERT INTO `t_eximport` VALUES ('字段1', 2, 'mrbird1@gmail.com', '2019-07-25 19:08:01');
+INSERT INTO `t_eximport` VALUES ('字段1', 3, 'mrbird2@gmail.com', '2019-07-25 19:08:01');
+INSERT INTO `t_eximport` VALUES ('字段1', 4, 'mrbird3@gmail.com', '2019-07-25 19:08:01');
+INSERT INTO `t_eximport` VALUES ('字段1', 5, 'mrbird4@gmail.com', '2019-07-25 19:08:01');
+INSERT INTO `t_eximport` VALUES ('字段1', 6, 'mrbird5@gmail.com', '2019-07-25 19:08:01');
+INSERT INTO `t_eximport` VALUES ('字段1', 7, 'mrbird6@gmail.com', '2019-07-25 19:08:01');
+INSERT INTO `t_eximport` VALUES ('字段1', 8, 'mrbird7@gmail.com', '2019-07-25 19:08:01');
+COMMIT;
+
+-- ----------------------------
+-- Table structure for t_generator_config
+-- ----------------------------
+DROP TABLE IF EXISTS `t_generator_config`;
+CREATE TABLE `t_generator_config` (
+                                      `id` int(11) NOT NULL COMMENT '主键',
+                                      `author` varchar(20) NOT NULL COMMENT '作者',
+                                      `base_package` varchar(50) NOT NULL COMMENT '基础包名',
+                                      `entity_package` varchar(20) NOT NULL COMMENT 'entity文件存放路径',
+                                      `mapper_package` varchar(20) NOT NULL COMMENT 'mapper文件存放路径',
+                                      `mapper_xml_package` varchar(20) NOT NULL COMMENT 'mapper xml文件存放路径',
+                                      `service_package` varchar(20) NOT NULL COMMENT 'servcie文件存放路径',
+                                      `service_impl_package` varchar(20) NOT NULL COMMENT 'serviceImpl文件存放路径',
+                                      `controller_package` varchar(20) NOT NULL COMMENT 'controller文件存放路径',
+                                      `is_trim` char(1) NOT NULL COMMENT '是否去除前缀 1是 0否',
+                                      `trim_value` varchar(10) DEFAULT NULL COMMENT '前缀内容',
+                                      PRIMARY KEY (`id`) USING BTREE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='代码生成配置表';
+
+-- ----------------------------
+-- Records of t_generator_config
+-- ----------------------------
+BEGIN;
+INSERT INTO `t_generator_config` VALUES (1, 'MrBird', 'cc.mrbird.febs.server.generator.gen', 'entity', 'mapper', 'mapper', 'service', 'service.impl', 'controller', '1', 't_');
+COMMIT;
+
+-- ----------------------------
+-- Table structure for t_job
+-- ----------------------------
+DROP TABLE IF EXISTS `t_job`;
+CREATE TABLE `t_job` (
+                         `JOB_ID` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '任务id',
+                         `BEAN_NAME` varchar(50) NOT NULL COMMENT 'spring bean名称',
+                         `METHOD_NAME` varchar(50) NOT NULL COMMENT '方法名',
+                         `PARAMS` varchar(50) DEFAULT NULL COMMENT '参数',
+                         `CRON_EXPRESSION` varchar(20) NOT NULL COMMENT 'cron表达式',
+                         `STATUS` char(2) NOT NULL COMMENT '任务状态  0:正常  1:暂停',
+                         `REMARK` varchar(50) DEFAULT NULL COMMENT '备注',
+                         `CREATE_TIME` datetime DEFAULT NULL COMMENT '创建时间',
+                         PRIMARY KEY (`JOB_ID`) USING BTREE,
+                         KEY `t_job_create_time` (`CREATE_TIME`)
+) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='定时任务表';
+
+-- ----------------------------
+-- Records of t_job
+-- ----------------------------
+BEGIN;
+INSERT INTO `t_job` VALUES (1, 'taskList', 'test', 'hello', '0/1 * * * * ?', '1', '有参任务调度测试', '2018-02-24 16:26:14');
+INSERT INTO `t_job` VALUES (2, 'taskList', 'test1', NULL, '0/10 * * * * ?', '1', '无参任务调度测试', '2018-02-24 17:06:23');
+INSERT INTO `t_job` VALUES (3, 'taskList', 'test2', '{\"name\":\"mrbird\",\"age\":18}', '0/1 * * * * ?', '1', 'JSON类型参数任务测试', '2018-02-26 09:28:26');
+INSERT INTO `t_job` VALUES (4, 'taskList', 'test3', '', '0/5 * * * * ?', '1', '测试异常,没有编写test3任务', '2018-02-26 11:15:30');
+COMMIT;
+
+-- ----------------------------
+-- Table structure for t_job_log
+-- ----------------------------
+DROP TABLE IF EXISTS `t_job_log`;
+CREATE TABLE `t_job_log` (
+                             `LOG_ID` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '任务日志id',
+                             `JOB_ID` bigint(20) NOT NULL COMMENT '任务id',
+                             `BEAN_NAME` varchar(100) NOT NULL COMMENT 'spring bean名称',
+                             `METHOD_NAME` varchar(100) NOT NULL COMMENT '方法名',
+                             `PARAMS` varchar(200) DEFAULT NULL COMMENT '参数',
+                             `STATUS` char(2) NOT NULL COMMENT '任务状态    0:成功    1:失败',
+                             `ERROR` text COMMENT '失败信息',
+                             `TIMES` decimal(11,0) DEFAULT NULL COMMENT '耗时(单位:毫秒)',
+                             `CREATE_TIME` datetime DEFAULT NULL COMMENT '创建时间',
+                             PRIMARY KEY (`LOG_ID`) USING BTREE,
+                             KEY `t_job_log_create_time` (`CREATE_TIME`)
+) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='调度日志表';
+
+-- ----------------------------
+-- Records of t_job_log
+-- ----------------------------
+BEGIN;
+COMMIT;
+
+-- ----------------------------
+-- Table structure for t_log
+-- ----------------------------
+DROP TABLE IF EXISTS `t_log`;
+CREATE TABLE `t_log` (
+                         `ID` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '日志ID',
+                         `USERNAME` varchar(50) DEFAULT NULL COMMENT '操作用户',
+                         `OPERATION` text COMMENT '操作内容',
+                         `TIME` decimal(11,0) DEFAULT NULL COMMENT '耗时',
+                         `METHOD` text COMMENT '操作方法',
+                         `PARAMS` text COMMENT '方法参数',
+                         `IP` varchar(64) DEFAULT NULL COMMENT '操作者IP',
+                         `CREATE_TIME` datetime DEFAULT NULL COMMENT '创建时间',
+                         `location` varchar(50) DEFAULT NULL COMMENT '操作地点',
+                         PRIMARY KEY (`ID`) USING BTREE,
+                         KEY `t_log_create_time` (`CREATE_TIME`)
+) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='用户操作日志表';
+
+-- ----------------------------
+-- Records of t_log
+-- ----------------------------
+BEGIN;
+COMMIT;
+
+-- ----------------------------
+-- Table structure for t_logger
+-- ----------------------------
+DROP TABLE IF EXISTS `t_logger`;
+CREATE TABLE `t_logger` (
+                            `id` bigint(20) NOT NULL AUTO_INCREMENT,
+                            `group_id` varchar(64) NOT NULL,
+                            `unit_id` varchar(32) NOT NULL,
+                            `tag` varchar(50) NOT NULL,
+                            `content` varchar(1024) NOT NULL,
+                            `create_time` varchar(30) NOT NULL,
+                            `app_name` varchar(128) NOT NULL,
+                            PRIMARY KEY (`id`) USING BTREE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='分布式事务日志';
+
+-- ----------------------------
+-- Records of t_logger
+-- ----------------------------
+BEGIN;
+COMMIT;
+
+-- ----------------------------
+-- Table structure for t_login_log
+-- ----------------------------
+DROP TABLE IF EXISTS `t_login_log`;
+CREATE TABLE `t_login_log` (
+                               `ID` bigint(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
+                               `USERNAME` varchar(50) NOT NULL COMMENT '用户名',
+                               `LOGIN_TIME` datetime NOT NULL COMMENT '登录时间',
+                               `LOCATION` varchar(50) DEFAULT NULL COMMENT '登录地点',
+                               `IP` varchar(50) DEFAULT NULL COMMENT 'IP地址',
+                               `SYSTEM` varchar(50) DEFAULT NULL COMMENT '操作系统',
+                               `BROWSER` varchar(50) DEFAULT NULL COMMENT '浏览器',
+                               PRIMARY KEY (`ID`) USING BTREE,
+                               KEY `t_login_log_login_time` (`LOGIN_TIME`)
+) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='登录日志表';
+
+-- ----------------------------
+-- Records of t_login_log
+-- ----------------------------
+BEGIN;
+COMMIT;
+
+-- ----------------------------
+-- Table structure for t_menu
+-- ----------------------------
+DROP TABLE IF EXISTS `t_menu`;
+CREATE TABLE `t_menu` (
+                          `MENU_ID` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '菜单/按钮ID',
+                          `PARENT_ID` bigint(20) NOT NULL COMMENT '上级菜单ID',
+                          `MENU_NAME` varchar(50) NOT NULL COMMENT '菜单/按钮名称',
+                          `PATH` varchar(255) DEFAULT NULL COMMENT '对应路由path',
+                          `COMPONENT` varchar(255) DEFAULT NULL COMMENT '对应路由组件component',
+                          `PERMS` varchar(50) DEFAULT NULL COMMENT '权限标识',
+                          `ICON` varchar(50) DEFAULT NULL COMMENT '图标',
+                          `TYPE` char(2) NOT NULL COMMENT '类型 0菜单 1按钮',
+                          `ORDER_NUM` double(20,0) DEFAULT NULL COMMENT '排序',
+                          `CREATE_TIME` datetime NOT NULL COMMENT '创建时间',
+                          `MODIFY_TIME` datetime DEFAULT NULL COMMENT '修改时间',
+                          PRIMARY KEY (`MENU_ID`) USING BTREE,
+                          KEY `t_menu_parent_id` (`PARENT_ID`),
+                          KEY `t_menu_menu_id` (`MENU_ID`)
+) ENGINE=InnoDB AUTO_INCREMENT=195 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='菜单表';
+
+-- ----------------------------
+-- Records of t_menu
+-- ----------------------------
+BEGIN;
+INSERT INTO `t_menu` VALUES (1, 0, '系统管理', '/system', 'Layout', NULL, 'el-icon-set-up', '0', 1, '2017-12-27 16:39:07', '2019-07-20 16:19:04');
+INSERT INTO `t_menu` VALUES (2, 0, '系统监控', '/monitor', 'Layout', NULL, 'el-icon-data-line', '0', 2, '2017-12-27 16:45:51', '2019-01-23 06:27:12');
+INSERT INTO `t_menu` VALUES (3, 1, '用户管理', '/system/user', 'febs/system/user/Index', 'user:view', '', '0', 1, '2017-12-27 16:47:13', '2019-01-22 06:45:55');
+INSERT INTO `t_menu` VALUES (4, 1, '角色管理', '/system/role', 'febs/system/role/Index', 'role:view', '', '0', 2, '2017-12-27 16:48:09', '2018-04-25 09:01:12');
+INSERT INTO `t_menu` VALUES (5, 1, '菜单管理', '/system/menu', 'febs/system/menu/Index', 'menu:view', '', '0', 3, '2017-12-27 16:48:57', '2018-04-25 09:01:30');
+INSERT INTO `t_menu` VALUES (6, 1, '部门管理', '/system/dept', 'febs/system/dept/Index', 'dept:view', '', '0', 4, '2017-12-27 16:57:33', '2018-04-25 09:01:40');
+INSERT INTO `t_menu` VALUES (10, 2, '系统日志', '/monitor/systemlog', 'febs/monitor/systemlog/Index', 'log:view', '', '0', 2, '2017-12-27 17:00:50', '2020-04-13 11:38:04');
+INSERT INTO `t_menu` VALUES (11, 3, '新增用户', '', '', 'user:add', NULL, '1', NULL, '2017-12-27 17:02:58', NULL);
+INSERT INTO `t_menu` VALUES (12, 3, '修改用户', '', '', 'user:update', NULL, '1', NULL, '2017-12-27 17:04:07', NULL);
+INSERT INTO `t_menu` VALUES (13, 3, '删除用户', '', '', 'user:delete', NULL, '1', NULL, '2017-12-27 17:04:58', NULL);
+INSERT INTO `t_menu` VALUES (14, 4, '新增角色', '', '', 'role:add', NULL, '1', NULL, '2017-12-27 17:06:38', NULL);
+INSERT INTO `t_menu` VALUES (15, 4, '修改角色', '', '', 'role:update', NULL, '1', NULL, '2017-12-27 17:06:38', NULL);
+INSERT INTO `t_menu` VALUES (16, 4, '删除角色', '', '', 'role:delete', NULL, '1', NULL, '2017-12-27 17:06:38', NULL);
+INSERT INTO `t_menu` VALUES (17, 5, '新增菜单', '', '', 'menu:add', NULL, '1', NULL, '2017-12-27 17:08:02', NULL);
+INSERT INTO `t_menu` VALUES (18, 5, '修改菜单', '', '', 'menu:update', NULL, '1', NULL, '2017-12-27 17:08:02', NULL);
+INSERT INTO `t_menu` VALUES (19, 5, '删除菜单', '', '', 'menu:delete', NULL, '1', NULL, '2017-12-27 17:08:02', NULL);
+INSERT INTO `t_menu` VALUES (20, 6, '新增部门', '', '', 'dept:add', NULL, '1', NULL, '2017-12-27 17:09:24', NULL);
+INSERT INTO `t_menu` VALUES (21, 6, '修改部门', '', '', 'dept:update', NULL, '1', NULL, '2017-12-27 17:09:24', NULL);
+INSERT INTO `t_menu` VALUES (22, 6, '删除部门', '', '', 'dept:delete', NULL, '1', NULL, '2017-12-27 17:09:24', NULL);
+INSERT INTO `t_menu` VALUES (24, 10, '删除日志', '', '', 'log:delete', NULL, '1', NULL, '2017-12-27 17:11:45', NULL);
+INSERT INTO `t_menu` VALUES (130, 3, '导出Excel', NULL, NULL, 'user:export', NULL, '1', NULL, '2019-01-23 06:35:16', NULL);
+INSERT INTO `t_menu` VALUES (131, 4, '导出Excel', NULL, NULL, 'role:export', NULL, '1', NULL, '2019-01-23 06:35:36', NULL);
+INSERT INTO `t_menu` VALUES (132, 5, '导出Excel', NULL, NULL, 'menu:export', NULL, '1', NULL, '2019-01-23 06:36:05', NULL);
+INSERT INTO `t_menu` VALUES (133, 6, '导出Excel', NULL, NULL, 'dept:export', NULL, '1', NULL, '2019-01-23 06:36:25', NULL);
+INSERT INTO `t_menu` VALUES (135, 3, '密码重置', NULL, NULL, 'user:reset', NULL, '1', NULL, '2019-01-23 06:37:00', NULL);
+INSERT INTO `t_menu` VALUES (136, 10, '导出Excel', NULL, NULL, 'log:export', NULL, '1', NULL, '2019-01-23 06:37:27', NULL);
+INSERT INTO `t_menu` VALUES (150, 2, '登录日志', '/monitor/loginlog', 'febs/monitor/loginlog/Index', 'monitor:loginlog', '', '0', 3, '2019-07-22 13:41:17', '2020-04-13 11:38:08');
+INSERT INTO `t_menu` VALUES (151, 150, '删除日志', NULL, NULL, 'loginlog:delete', NULL, '1', NULL, '2019-07-22 13:43:04', NULL);
+INSERT INTO `t_menu` VALUES (152, 150, '导出Excel', NULL, NULL, 'loginlog:export', NULL, '1', NULL, '2019-07-22 13:43:30', NULL);
+INSERT INTO `t_menu` VALUES (154, 0, '其他模块', '/others', 'Layout', '', 'el-icon-shopping-bag-1', '0', 6, '2019-07-25 10:16:16', '2020-04-14 18:38:20');
+INSERT INTO `t_menu` VALUES (155, 154, '导入导出', '/others/eximport', 'febs/others/eximport/Index', 'others:eximport', '', '0', 1, '2019-07-25 10:19:31', NULL);
+INSERT INTO `t_menu` VALUES (156, 0, '代码生成', '/gen', 'Layout', '', 'el-icon-printer', '0', 4, '2019-07-25 10:24:03', '2020-01-16 13:59:49');
+INSERT INTO `t_menu` VALUES (157, 156, '基础配置', '/gen/config', 'febs/gen/config/Index', 'gen:config', '', '0', 1, '2019-07-25 10:24:55', '2020-04-09 14:21:54');
+INSERT INTO `t_menu` VALUES (158, 156, '生成代码', '/gen/generate', 'febs/gen/generate/Index', 'gen:generate', '', '0', 2, '2019-07-25 10:25:26', '2019-07-25 11:13:20');
+INSERT INTO `t_menu` VALUES (159, 157, '修改配置', NULL, NULL, 'gen:config:update', NULL, '1', NULL, '2019-07-26 16:22:56', NULL);
+INSERT INTO `t_menu` VALUES (160, 158, '打包生成', NULL, NULL, 'gen:generate:gen', NULL, '1', NULL, '2019-07-26 16:23:38', '2019-07-26 16:23:53');
+INSERT INTO `t_menu` VALUES (163, 1, '客户端管理', '/client', 'febs/system/client/Index', 'client:view', '', '0', 5, '2019-09-26 22:58:09', NULL);
+INSERT INTO `t_menu` VALUES (164, 163, '新增', NULL, NULL, 'client:add', NULL, '1', NULL, '2019-09-26 22:58:21', NULL);
+INSERT INTO `t_menu` VALUES (165, 163, '修改', NULL, NULL, 'client:update', NULL, '1', NULL, '2019-09-26 22:58:43', NULL);
+INSERT INTO `t_menu` VALUES (166, 163, '删除', NULL, NULL, 'client:delete', NULL, '1', NULL, '2019-09-26 22:58:55', NULL);
+INSERT INTO `t_menu` VALUES (167, 163, '解密', NULL, NULL, 'client:decrypt', NULL, '1', NULL, '2019-09-26 22:59:08', NULL);
+INSERT INTO `t_menu` VALUES (168, 0, '静态组件', '/components', 'Layout', '', 'el-icon-present', '0', 7, '2019-12-02 16:41:28', '2020-04-14 18:38:23');
+INSERT INTO `t_menu` VALUES (169, 168, '二级菜单', '/two', 'demos/two/Index', '', '', '0', 1, '2019-12-02 16:41:51', NULL);
+INSERT INTO `t_menu` VALUES (170, 169, '三级菜单', '/three', 'demos/two/three/Index', '', '', '0', 1, '2019-12-02 16:42:09', NULL);
+INSERT INTO `t_menu` VALUES (171, 168, 'MarkDown', '/components/markdown', 'demos/markdown', '', '', '0', 2, '2019-12-02 16:42:34', NULL);
+INSERT INTO `t_menu` VALUES (172, 168, '富文本编辑器', '/components/tinymce', 'demos/tinymce', '', '', '0', 3, '2019-12-02 16:42:50', NULL);
+INSERT INTO `t_menu` VALUES (173, 0, '网关管理', '/route', 'Layout', '', 'el-icon-odometer', '0', 3, '2020-01-16 14:00:15', NULL);
+INSERT INTO `t_menu` VALUES (174, 173, '网关用户', '/route/user', 'febs/route/routeuser/Index', '', '', '0', 1, '2020-01-16 14:00:32', NULL);
+INSERT INTO `t_menu` VALUES (175, 173, '网关日志', '/route/log', 'febs/route/routelog/Index', '', '', '0', 2, '2020-01-16 14:00:47', NULL);
+INSERT INTO `t_menu` VALUES (176, 173, '限流规则', '/route/ratelimitrule', 'febs/route/ratelimitrule/Index', '', '', '0', 3, '2020-01-16 14:01:01', NULL);
+INSERT INTO `t_menu` VALUES (177, 173, '限流日志', '/route/ratelimitlog', 'febs/route/ratelimitlog/Index', '', '', '0', 4, '2020-01-16 14:01:17', NULL);
+INSERT INTO `t_menu` VALUES (178, 173, '黑名单管理', '/route/blacklist', 'febs/route/blacklist/Index', '', '', '0', 5, '2020-01-16 14:01:32', NULL);
+INSERT INTO `t_menu` VALUES (179, 173, '黑名单日志', '/route/blocklog', 'febs/route/blocklog/Index', '', '', '0', 6, '2020-01-16 14:01:49', NULL);
+INSERT INTO `t_menu` VALUES (180, 2, '监控面板', '/monitor/dashboard', 'febs/monitor/dashboard/Index', 'monitor:dashboard', '', '0', 1, '2020-04-13 09:44:09', '2020-04-13 11:38:00');
+INSERT INTO `t_menu` VALUES (181, 154, '个人博客', '/others/blog', 'febs/others/blog/Index', '', '', '0', 2, '2020-04-13 16:11:48', '2020-04-13 16:12:26');
+INSERT INTO `t_menu` VALUES (182, 154, '数据权限', '/others/datapermission', 'febs/others/datapermission/Index', 'others:datapermission', '', '0', 3, '2020-04-14 14:51:35', '2020-04-14 15:37:19');
+INSERT INTO `t_menu` VALUES (183, 0, '任务调度', '/job', 'Layout', '', 'el-icon-alarm-clock', '0', 5, '2020-04-14 18:39:35', '2020-04-14 18:39:53');
+INSERT INTO `t_menu` VALUES (184, 183, '任务列表', '/job/list', 'febs/job/job/Index', 'job:view', '', '0', 1, '2020-04-14 18:40:37', '2020-04-14 18:41:36');
+INSERT INTO `t_menu` VALUES (185, 183, '调度日志', '/job/log', 'febs/job/log/Index', 'job:log:view', '', '0', 2, '2020-04-14 18:42:25', NULL);
+INSERT INTO `t_menu` VALUES (186, 184, '新增任务', NULL, NULL, 'job:add', NULL, '1', NULL, '2020-04-14 18:59:55', '2020-04-15 08:56:03');
+INSERT INTO `t_menu` VALUES (187, 184, '修改任务', NULL, NULL, 'job:update', NULL, '1', NULL, '2020-04-14 19:00:13', NULL);
+INSERT INTO `t_menu` VALUES (188, 184, '删除任务', NULL, NULL, 'job:delete', NULL, '1', NULL, '2020-04-14 19:00:26', NULL);
+INSERT INTO `t_menu` VALUES (189, 184, '暂停任务', NULL, NULL, 'job:pause', NULL, '1', NULL, '2020-04-14 19:00:42', NULL);
+INSERT INTO `t_menu` VALUES (190, 184, '恢复任务', NULL, NULL, 'job:resume', NULL, '1', NULL, '2020-04-14 19:00:56', NULL);
+INSERT INTO `t_menu` VALUES (191, 184, '立即执行一次', NULL, NULL, 'job:run', NULL, '1', NULL, '2020-04-14 19:01:42', NULL);
+INSERT INTO `t_menu` VALUES (192, 184, '导出Excel', NULL, NULL, 'job:export', NULL, '1', NULL, '2020-04-14 19:01:59', NULL);
+INSERT INTO `t_menu` VALUES (193, 185, '删除', NULL, NULL, 'job:log:delete', NULL, '1', NULL, '2020-04-15 14:01:33', NULL);
+INSERT INTO `t_menu` VALUES (194, 185, '导出', NULL, NULL, 'job:log:export', NULL, '1', NULL, '2020-04-15 14:01:45', NULL);
+COMMIT;
+
+-- ----------------------------
+-- Table structure for t_role
+-- ----------------------------
+DROP TABLE IF EXISTS `t_role`;
+CREATE TABLE `t_role` (
+                          `ROLE_ID` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '角色ID',
+                          `ROLE_NAME` varchar(10) NOT NULL COMMENT '角色名称',
+                          `REMARK` varchar(100) DEFAULT NULL COMMENT '角色描述',
+                          `CREATE_TIME` datetime NOT NULL COMMENT '创建时间',
+                          `MODIFY_TIME` datetime DEFAULT NULL COMMENT '修改时间',
+                          PRIMARY KEY (`ROLE_ID`) USING BTREE
+) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='角色表';
+
+-- ----------------------------
+-- Records of t_role
+-- ----------------------------
+BEGIN;
+INSERT INTO `t_role` VALUES (1, '管理员', '管理员', '2017-12-27 16:23:11', '2020-04-15 14:02:27');
+INSERT INTO `t_role` VALUES (2, '注册用户', '可查看,新增,导出', '2019-01-04 14:11:28', '2020-04-15 16:00:16');
+INSERT INTO `t_role` VALUES (3, '系统监控员', '负责系统监控模块', '2019-09-01 10:30:25', '2019-09-01 10:30:37');
+INSERT INTO `t_role` VALUES (4, '测试角色', '测试角色', '2020-03-08 19:16:01', '2020-04-13 11:26:13');
+COMMIT;
+
+-- ----------------------------
+-- Table structure for t_role_menu
+-- ----------------------------
+DROP TABLE IF EXISTS `t_role_menu`;
+CREATE TABLE `t_role_menu` (
+                               `ROLE_ID` bigint(20) NOT NULL,
+                               `MENU_ID` bigint(20) NOT NULL,
+                               PRIMARY KEY (`ROLE_ID`,`MENU_ID`),
+                               KEY `t_role_menu_menu_id` (`MENU_ID`),
+                               KEY `t_role_menu_role_id` (`ROLE_ID`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='角色菜单关联表';
+
+-- ----------------------------
+-- Records of t_role_menu
+-- ----------------------------
+BEGIN;
+INSERT INTO `t_role_menu` VALUES (1, 1);
+INSERT INTO `t_role_menu` VALUES (1, 2);
+INSERT INTO `t_role_menu` VALUES (1, 3);
+INSERT INTO `t_role_menu` VALUES (1, 4);
+INSERT INTO `t_role_menu` VALUES (1, 5);
+INSERT INTO `t_role_menu` VALUES (1, 6);
+INSERT INTO `t_role_menu` VALUES (1, 10);
+INSERT INTO `t_role_menu` VALUES (1, 11);
+INSERT INTO `t_role_menu` VALUES (1, 12);
+INSERT INTO `t_role_menu` VALUES (1, 13);
+INSERT INTO `t_role_menu` VALUES (1, 14);
+INSERT INTO `t_role_menu` VALUES (1, 15);
+INSERT INTO `t_role_menu` VALUES (1, 16);
+INSERT INTO `t_role_menu` VALUES (1, 17);
+INSERT INTO `t_role_menu` VALUES (1, 18);
+INSERT INTO `t_role_menu` VALUES (1, 19);
+INSERT INTO `t_role_menu` VALUES (1, 20);
+INSERT INTO `t_role_menu` VALUES (1, 21);
+INSERT INTO `t_role_menu` VALUES (1, 22);
+INSERT INTO `t_role_menu` VALUES (1, 24);
+INSERT INTO `t_role_menu` VALUES (1, 130);
+INSERT INTO `t_role_menu` VALUES (1, 131);
+INSERT INTO `t_role_menu` VALUES (1, 132);
+INSERT INTO `t_role_menu` VALUES (1, 133);
+INSERT INTO `t_role_menu` VALUES (1, 135);
+INSERT INTO `t_role_menu` VALUES (1, 136);
+INSERT INTO `t_role_menu` VALUES (1, 150);
+INSERT INTO `t_role_menu` VALUES (1, 151);
+INSERT INTO `t_role_menu` VALUES (1, 152);
+INSERT INTO `t_role_menu` VALUES (1, 154);
+INSERT INTO `t_role_menu` VALUES (1, 155);
+INSERT INTO `t_role_menu` VALUES (1, 156);
+INSERT INTO `t_role_menu` VALUES (1, 157);
+INSERT INTO `t_role_menu` VALUES (1, 158);
+INSERT INTO `t_role_menu` VALUES (1, 159);
+INSERT INTO `t_role_menu` VALUES (1, 160);
+INSERT INTO `t_role_menu` VALUES (1, 163);
+INSERT INTO `t_role_menu` VALUES (1, 164);
+INSERT INTO `t_role_menu` VALUES (1, 165);
+INSERT INTO `t_role_menu` VALUES (1, 166);
+INSERT INTO `t_role_menu` VALUES (1, 167);
+INSERT INTO `t_role_menu` VALUES (1, 168);
+INSERT INTO `t_role_menu` VALUES (1, 169);
+INSERT INTO `t_role_menu` VALUES (1, 170);
+INSERT INTO `t_role_menu` VALUES (1, 171);
+INSERT INTO `t_role_menu` VALUES (1, 172);
+INSERT INTO `t_role_menu` VALUES (1, 173);
+INSERT INTO `t_role_menu` VALUES (1, 174);
+INSERT INTO `t_role_menu` VALUES (1, 175);
+INSERT INTO `t_role_menu` VALUES (1, 176);
+INSERT INTO `t_role_menu` VALUES (1, 177);
+INSERT INTO `t_role_menu` VALUES (1, 178);
+INSERT INTO `t_role_menu` VALUES (1, 179);
+INSERT INTO `t_role_menu` VALUES (1, 180);
+INSERT INTO `t_role_menu` VALUES (1, 181);
+INSERT INTO `t_role_menu` VALUES (1, 182);
+INSERT INTO `t_role_menu` VALUES (1, 183);
+INSERT INTO `t_role_menu` VALUES (1, 184);
+INSERT INTO `t_role_menu` VALUES (1, 185);
+INSERT INTO `t_role_menu` VALUES (1, 186);
+INSERT INTO `t_role_menu` VALUES (1, 187);
+INSERT INTO `t_role_menu` VALUES (1, 188);
+INSERT INTO `t_role_menu` VALUES (1, 189);
+INSERT INTO `t_role_menu` VALUES (1, 190);
+INSERT INTO `t_role_menu` VALUES (1, 191);
+INSERT INTO `t_role_menu` VALUES (1, 192);
+INSERT INTO `t_role_menu` VALUES (1, 193);
+INSERT INTO `t_role_menu` VALUES (1, 194);
+INSERT INTO `t_role_menu` VALUES (2, 1);
+INSERT INTO `t_role_menu` VALUES (2, 2);
+INSERT INTO `t_role_menu` VALUES (2, 3);
+INSERT INTO `t_role_menu` VALUES (2, 4);
+INSERT INTO `t_role_menu` VALUES (2, 5);
+INSERT INTO `t_role_menu` VALUES (2, 6);
+INSERT INTO `t_role_menu` VALUES (2, 10);
+INSERT INTO `t_role_menu` VALUES (2, 14);
+INSERT INTO `t_role_menu` VALUES (2, 17);
+INSERT INTO `t_role_menu` VALUES (2, 20);
+INSERT INTO `t_role_menu` VALUES (2, 130);
+INSERT INTO `t_role_menu` VALUES (2, 131);
+INSERT INTO `t_role_menu` VALUES (2, 132);
+INSERT INTO `t_role_menu` VALUES (2, 133);
+INSERT INTO `t_role_menu` VALUES (2, 136);
+INSERT INTO `t_role_menu` VALUES (2, 150);
+INSERT INTO `t_role_menu` VALUES (2, 152);
+INSERT INTO `t_role_menu` VALUES (2, 154);
+INSERT INTO `t_role_menu` VALUES (2, 155);
+INSERT INTO `t_role_menu` VALUES (2, 156);
+INSERT INTO `t_role_menu` VALUES (2, 157);
+INSERT INTO `t_role_menu` VALUES (2, 158);
+INSERT INTO `t_role_menu` VALUES (2, 160);
+INSERT INTO `t_role_menu` VALUES (2, 163);
+INSERT INTO `t_role_menu` VALUES (2, 164);
+INSERT INTO `t_role_menu` VALUES (2, 167);
+INSERT INTO `t_role_menu` VALUES (2, 168);
+INSERT INTO `t_role_menu` VALUES (2, 169);
+INSERT INTO `t_role_menu` VALUES (2, 170);
+INSERT INTO `t_role_menu` VALUES (2, 171);
+INSERT INTO `t_role_menu` VALUES (2, 172);
+INSERT INTO `t_role_menu` VALUES (2, 173);
+INSERT INTO `t_role_menu` VALUES (2, 174);
+INSERT INTO `t_role_menu` VALUES (2, 175);
+INSERT INTO `t_role_menu` VALUES (2, 176);
+INSERT INTO `t_role_menu` VALUES (2, 177);
+INSERT INTO `t_role_menu` VALUES (2, 178);
+INSERT INTO `t_role_menu` VALUES (2, 179);
+INSERT INTO `t_role_menu` VALUES (2, 180);
+INSERT INTO `t_role_menu` VALUES (2, 181);
+INSERT INTO `t_role_menu` VALUES (2, 182);
+INSERT INTO `t_role_menu` VALUES (2, 183);
+INSERT INTO `t_role_menu` VALUES (2, 184);
+INSERT INTO `t_role_menu` VALUES (2, 185);
+INSERT INTO `t_role_menu` VALUES (2, 192);
+INSERT INTO `t_role_menu` VALUES (2, 194);
+INSERT INTO `t_role_menu` VALUES (3, 2);
+INSERT INTO `t_role_menu` VALUES (3, 10);
+INSERT INTO `t_role_menu` VALUES (3, 24);
+INSERT INTO `t_role_menu` VALUES (3, 136);
+INSERT INTO `t_role_menu` VALUES (3, 148);
+INSERT INTO `t_role_menu` VALUES (3, 149);
+INSERT INTO `t_role_menu` VALUES (3, 150);
+INSERT INTO `t_role_menu` VALUES (3, 151);
+INSERT INTO `t_role_menu` VALUES (3, 152);
+INSERT INTO `t_role_menu` VALUES (3, 153);
+INSERT INTO `t_role_menu` VALUES (4, 1);
+INSERT INTO `t_role_menu` VALUES (4, 3);
+INSERT INTO `t_role_menu` VALUES (4, 11);
+INSERT INTO `t_role_menu` VALUES (4, 12);
+INSERT INTO `t_role_menu` VALUES (4, 13);
+INSERT INTO `t_role_menu` VALUES (4, 130);
+INSERT INTO `t_role_menu` VALUES (4, 135);
+COMMIT;
+
+-- ----------------------------
+-- Table structure for t_trade_log
+-- ----------------------------
+DROP TABLE IF EXISTS `t_trade_log`;
+CREATE TABLE `t_trade_log` (
+                               `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID',
+                               `goods_id` int(11) NOT NULL COMMENT '商品ID',
+                               `goods_name` varchar(50) NOT NULL COMMENT '商品名称',
+                               `status` varchar(50) NOT NULL COMMENT '状态',
+                               `create_time` datetime NOT NULL COMMENT '创建时间',
+                               PRIMARY KEY (`id`) USING BTREE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='分布式事务测试';
+
+-- ----------------------------
+-- Records of t_trade_log
+-- ----------------------------
+BEGIN;
+COMMIT;
+
+-- ----------------------------
+-- Table structure for t_user
+-- ----------------------------
+DROP TABLE IF EXISTS `t_user`;
+CREATE TABLE `t_user` (
+                          `USER_ID` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '用户ID',
+                          `USERNAME` varchar(50) NOT NULL COMMENT '用户名',
+                          `PASSWORD` varchar(128) NOT NULL COMMENT '密码',
+                          `DEPT_ID` bigint(20) DEFAULT NULL COMMENT '部门ID',
+                          `EMAIL` varchar(128) DEFAULT NULL COMMENT '邮箱',
+                          `MOBILE` varchar(20) DEFAULT NULL COMMENT '联系电话',
+                          `STATUS` char(1) NOT NULL COMMENT '状态 0锁定 1有效',
+                          `CREATE_TIME` datetime NOT NULL COMMENT '创建时间',
+                          `MODIFY_TIME` datetime DEFAULT NULL COMMENT '修改时间',
+                          `LAST_LOGIN_TIME` datetime DEFAULT NULL COMMENT '最近访问时间',
+                          `SSEX` char(1) DEFAULT NULL COMMENT '性别 0男 1女 2保密',
+                          `IS_TAB` char(1) DEFAULT NULL COMMENT '是否开启tab,0关闭 1开启',
+                          `THEME` varchar(10) DEFAULT NULL COMMENT '主题',
+                          `AVATAR` varchar(100) DEFAULT NULL COMMENT '头像',
+                          `DESCRIPTION` varchar(100) DEFAULT NULL COMMENT '描述',
+                          PRIMARY KEY (`USER_ID`) USING BTREE,
+                          KEY `t_user_username` (`USERNAME`),
+                          KEY `t_user_mobile` (`MOBILE`)
+) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='用户表';
+
+-- ----------------------------
+-- Records of t_user
+-- ----------------------------
+BEGIN;
+INSERT INTO `t_user` VALUES (1, 'MrBird', '$2a$10$gzhiUb1ldc1Rf3lka4k/WOoFKKGPepHSzJxzcPSN5/65SzkMdc.SK', 2, 'mrbird@qq.com', '17788888888', '1', '2019-06-14 20:39:22', '2020-04-15 16:00:32', '2020-04-15 16:03:13', '0', '1', 'white', 'gaOngJwsRYRaVAuXXcmB.png', '我是帅比作者。');
+INSERT INTO `t_user` VALUES (15, 'scott', '$2a$10$7tATi2STciLHnEgO/RfIxOYf2MQBu/SDVMRDs54rlSYVj2VmwwCHC', 5, 'scott@hotmail.com', '17720888888', '1', '2019-07-20 19:00:32', '2020-04-15 16:00:42', '2020-04-14 16:49:27', '2', NULL, NULL, 'BiazfanxmamNRoxxVxka.png', NULL);
+INSERT INTO `t_user` VALUES (16, 'Jane', '$2a$10$ECkfipOPY7hORVdlSzIOX.8hnig0shAZQPG8pQ7D5iVP.uVogmmHy', 4, 'Jane@hotmail.com', '13489898989', '1', '2019-09-01 10:31:21', '2020-04-15 16:00:48', '2019-09-01 10:32:27', '1', NULL, NULL, '2dd7a2d09fa94bf8b5c52e5318868b4d9.jpg', NULL);
+COMMIT;
+
+-- ----------------------------
+-- Table structure for t_user_connection
+-- ----------------------------
+DROP TABLE IF EXISTS `t_user_connection`;
+CREATE TABLE `t_user_connection` (
+                                     `USER_NAME` varchar(50) NOT NULL COMMENT 'FEBS系统用户名',
+                                     `PROVIDER_NAME` varchar(20) NOT NULL COMMENT '第三方平台名称',
+                                     `PROVIDER_USER_ID` varchar(50) NOT NULL COMMENT '第三方平台账户ID',
+                                     `PROVIDER_USER_NAME` varchar(50) DEFAULT NULL COMMENT '第三方平台用户名',
+                                     `NICK_NAME` varchar(50) DEFAULT NULL COMMENT '第三方平台昵称',
+                                     `IMAGE_URL` varchar(512) DEFAULT NULL COMMENT '第三方平台头像',
+                                     `LOCATION` varchar(255) DEFAULT NULL COMMENT '地址',
+                                     `REMARK` varchar(255) DEFAULT NULL COMMENT '备注',
+                                     PRIMARY KEY (`USER_NAME`,`PROVIDER_NAME`,`PROVIDER_USER_ID`) USING BTREE,
+                                     UNIQUE KEY `UserConnectionRank` (`USER_NAME`,`PROVIDER_NAME`,`PROVIDER_USER_ID`) USING BTREE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='系统用户社交账户关联表';
+
+-- ----------------------------
+-- Records of t_user_connection
+-- ----------------------------
+BEGIN;
+COMMIT;
+
+-- ----------------------------
+-- Table structure for t_user_data_permission
+-- ----------------------------
+DROP TABLE IF EXISTS `t_user_data_permission`;
+CREATE TABLE `t_user_data_permission` (
+                                          `USER_ID` bigint(20) NOT NULL,
+                                          `DEPT_ID` bigint(20) NOT NULL,
+                                          PRIMARY KEY (`USER_ID`,`DEPT_ID`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户数据权限关联表';
+
+-- ----------------------------
+-- Records of t_user_data_permission
+-- ----------------------------
+BEGIN;
+INSERT INTO `t_user_data_permission` VALUES (1, 1);
+INSERT INTO `t_user_data_permission` VALUES (1, 2);
+INSERT INTO `t_user_data_permission` VALUES (1, 3);
+INSERT INTO `t_user_data_permission` VALUES (1, 4);
+INSERT INTO `t_user_data_permission` VALUES (1, 5);
+INSERT INTO `t_user_data_permission` VALUES (1, 6);
+INSERT INTO `t_user_data_permission` VALUES (15, 1);
+INSERT INTO `t_user_data_permission` VALUES (15, 2);
+INSERT INTO `t_user_data_permission` VALUES (16, 4);
+INSERT INTO `t_user_data_permission` VALUES (16, 5);
+COMMIT;
+
+-- ----------------------------
+-- Table structure for t_user_role
+-- ----------------------------
+DROP TABLE IF EXISTS `t_user_role`;
+CREATE TABLE `t_user_role` (
+                               `USER_ID` bigint(20) NOT NULL COMMENT '用户ID',
+                               `ROLE_ID` bigint(20) NOT NULL COMMENT '角色ID',
+                               PRIMARY KEY (`USER_ID`,`ROLE_ID`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='用户角色关联表';
+
+-- ----------------------------
+-- Records of t_user_role
+-- ----------------------------
+BEGIN;
+INSERT INTO `t_user_role` VALUES (1, 1);
+INSERT INTO `t_user_role` VALUES (15, 2);
+INSERT INTO `t_user_role` VALUES (16, 3);
+COMMIT;
+
+CREATE TABLE `t_tx_exception`  (
+                                   `id` bigint(20) NOT NULL AUTO_INCREMENT,
+                                   `group_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
+                                   `unit_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
+                                   `mod_id` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
+                                   `transaction_state` tinyint(4) NULL DEFAULT NULL,
+                                   `registrar` tinyint(4) NULL DEFAULT NULL,
+                                   `ex_state` tinyint(4) NULL DEFAULT NULL COMMENT '0 待处理 1已处理',
+                                   `remark` varchar(10240) NULL DEFAULT NULL COMMENT '备注',
+                                   `create_time` datetime(0) NULL DEFAULT NULL,
+                                   PRIMARY KEY (`id`) USING BTREE
+) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
+
+SET FOREIGN_KEY_CHECKS = 1;

+ 158 - 0
febs-cloud/sql/febs_cloud_job.sql

@@ -0,0 +1,158 @@
+DROP TABLE IF EXISTS QRTZ_FIRED_TRIGGERS;
+DROP TABLE IF EXISTS QRTZ_PAUSED_TRIGGER_GRPS;
+DROP TABLE IF EXISTS QRTZ_SCHEDULER_STATE;
+DROP TABLE IF EXISTS QRTZ_LOCKS;
+DROP TABLE IF EXISTS QRTZ_SIMPLE_TRIGGERS;
+DROP TABLE IF EXISTS QRTZ_SIMPROP_TRIGGERS;
+DROP TABLE IF EXISTS QRTZ_CRON_TRIGGERS;
+DROP TABLE IF EXISTS QRTZ_BLOB_TRIGGERS;
+DROP TABLE IF EXISTS QRTZ_TRIGGERS;
+DROP TABLE IF EXISTS QRTZ_JOB_DETAILS;
+DROP TABLE IF EXISTS QRTZ_CALENDARS;
+
+
+CREATE TABLE QRTZ_JOB_DETAILS
+  (
+    SCHED_NAME VARCHAR(120) NOT NULL,
+    JOB_NAME  VARCHAR(200) NOT NULL,
+    JOB_GROUP VARCHAR(200) NOT NULL,
+    DESCRIPTION VARCHAR(250) NULL,
+    JOB_CLASS_NAME   VARCHAR(250) NOT NULL,
+    IS_DURABLE VARCHAR(1) NOT NULL,
+    IS_NONCONCURRENT VARCHAR(1) NOT NULL,
+    IS_UPDATE_DATA VARCHAR(1) NOT NULL,
+    REQUESTS_RECOVERY VARCHAR(1) NOT NULL,
+    JOB_DATA BLOB NULL,
+    PRIMARY KEY (SCHED_NAME,JOB_NAME,JOB_GROUP)
+);
+
+CREATE TABLE QRTZ_TRIGGERS
+  (
+    SCHED_NAME VARCHAR(120) NOT NULL,
+    TRIGGER_NAME VARCHAR(200) NOT NULL,
+    TRIGGER_GROUP VARCHAR(200) NOT NULL,
+    JOB_NAME  VARCHAR(200) NOT NULL,
+    JOB_GROUP VARCHAR(200) NOT NULL,
+    DESCRIPTION VARCHAR(250) NULL,
+    NEXT_FIRE_TIME BIGINT(13) NULL,
+    PREV_FIRE_TIME BIGINT(13) NULL,
+    PRIORITY INTEGER NULL,
+    TRIGGER_STATE VARCHAR(16) NOT NULL,
+    TRIGGER_TYPE VARCHAR(8) NOT NULL,
+    START_TIME BIGINT(13) NOT NULL,
+    END_TIME BIGINT(13) NULL,
+    CALENDAR_NAME VARCHAR(200) NULL,
+    MISFIRE_INSTR SMALLINT(2) NULL,
+    JOB_DATA BLOB NULL,
+    PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
+    FOREIGN KEY (SCHED_NAME,JOB_NAME,JOB_GROUP)
+        REFERENCES QRTZ_JOB_DETAILS(SCHED_NAME,JOB_NAME,JOB_GROUP)
+);
+
+CREATE TABLE QRTZ_SIMPLE_TRIGGERS
+  (
+    SCHED_NAME VARCHAR(120) NOT NULL,
+    TRIGGER_NAME VARCHAR(200) NOT NULL,
+    TRIGGER_GROUP VARCHAR(200) NOT NULL,
+    REPEAT_COUNT BIGINT(7) NOT NULL,
+    REPEAT_INTERVAL BIGINT(12) NOT NULL,
+    TIMES_TRIGGERED BIGINT(10) NOT NULL,
+    PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
+    FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
+        REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
+);
+
+CREATE TABLE QRTZ_CRON_TRIGGERS
+  (
+    SCHED_NAME VARCHAR(120) NOT NULL,
+    TRIGGER_NAME VARCHAR(200) NOT NULL,
+    TRIGGER_GROUP VARCHAR(200) NOT NULL,
+    CRON_EXPRESSION VARCHAR(200) NOT NULL,
+    TIME_ZONE_ID VARCHAR(80),
+    PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
+    FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
+        REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
+);
+
+CREATE TABLE QRTZ_SIMPROP_TRIGGERS
+  (
+    SCHED_NAME VARCHAR(120) NOT NULL,
+    TRIGGER_NAME VARCHAR(200) NOT NULL,
+    TRIGGER_GROUP VARCHAR(200) NOT NULL,
+    STR_PROP_1 VARCHAR(512) NULL,
+    STR_PROP_2 VARCHAR(512) NULL,
+    STR_PROP_3 VARCHAR(512) NULL,
+    INT_PROP_1 INT NULL,
+    INT_PROP_2 INT NULL,
+    LONG_PROP_1 BIGINT NULL,
+    LONG_PROP_2 BIGINT NULL,
+    DEC_PROP_1 NUMERIC(13,4) NULL,
+    DEC_PROP_2 NUMERIC(13,4) NULL,
+    BOOL_PROP_1 VARCHAR(1) NULL,
+    BOOL_PROP_2 VARCHAR(1) NULL,
+    PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
+    FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
+    REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
+);
+
+CREATE TABLE QRTZ_BLOB_TRIGGERS
+  (
+    SCHED_NAME VARCHAR(120) NOT NULL,
+    TRIGGER_NAME VARCHAR(200) NOT NULL,
+    TRIGGER_GROUP VARCHAR(200) NOT NULL,
+    BLOB_DATA BLOB NULL,
+    PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
+    FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
+        REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
+);
+
+CREATE TABLE QRTZ_CALENDARS
+  (
+    SCHED_NAME VARCHAR(120) NOT NULL,
+    CALENDAR_NAME  VARCHAR(200) NOT NULL,
+    CALENDAR BLOB NOT NULL,
+    PRIMARY KEY (SCHED_NAME,CALENDAR_NAME)
+);
+
+CREATE TABLE QRTZ_PAUSED_TRIGGER_GRPS
+  (
+    SCHED_NAME VARCHAR(120) NOT NULL,
+    TRIGGER_GROUP  VARCHAR(200) NOT NULL,
+    PRIMARY KEY (SCHED_NAME,TRIGGER_GROUP)
+);
+
+CREATE TABLE QRTZ_FIRED_TRIGGERS
+  (
+    SCHED_NAME VARCHAR(120) NOT NULL,
+    ENTRY_ID VARCHAR(95) NOT NULL,
+    TRIGGER_NAME VARCHAR(200) NOT NULL,
+    TRIGGER_GROUP VARCHAR(200) NOT NULL,
+    INSTANCE_NAME VARCHAR(200) NOT NULL,
+    FIRED_TIME BIGINT(13) NOT NULL,
+    SCHED_TIME BIGINT(13) NOT NULL,
+    PRIORITY INTEGER NOT NULL,
+    STATE VARCHAR(16) NOT NULL,
+    JOB_NAME VARCHAR(200) NULL,
+    JOB_GROUP VARCHAR(200) NULL,
+    IS_NONCONCURRENT VARCHAR(1) NULL,
+    REQUESTS_RECOVERY VARCHAR(1) NULL,
+    PRIMARY KEY (SCHED_NAME,ENTRY_ID)
+);
+
+CREATE TABLE QRTZ_SCHEDULER_STATE
+  (
+    SCHED_NAME VARCHAR(120) NOT NULL,
+    INSTANCE_NAME VARCHAR(200) NOT NULL,
+    LAST_CHECKIN_TIME BIGINT(13) NOT NULL,
+    CHECKIN_INTERVAL BIGINT(13) NOT NULL,
+    PRIMARY KEY (SCHED_NAME,INSTANCE_NAME)
+);
+
+CREATE TABLE QRTZ_LOCKS
+  (
+    SCHED_NAME VARCHAR(120) NOT NULL,
+    LOCK_NAME  VARCHAR(40) NOT NULL,
+    PRIMARY KEY (SCHED_NAME,LOCK_NAME)
+);
+
+SET FOREIGN_KEY_CHECKS=0;

Fichier diff supprimé car celui-ci est trop grand
+ 24 - 24
febs-cloud/sql/febs_nacos.sql


BIN
febs-common/.DS_Store


BIN
febs-common/febs-common-core/.DS_Store


+ 104 - 0
febs-common/febs-common-core/pom.xml

@@ -0,0 +1,104 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>febs-common</artifactId>
+        <groupId>cc.mrbird</groupId>
+        <version>2.0-RELEASE</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+    <name>FEBS-Common-Core</name>
+    <description>FEBS-Common-Core系统核心模块</description>
+    <packaging>jar</packaging>
+    <artifactId>febs-common-core</artifactId>
+
+    <dependencies>
+        <dependency>
+            <groupId>io.projectreactor</groupId>
+            <artifactId>reactor-core</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>fastjson</artifactId>
+            <version>${fastjson.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>xml-apis</groupId>
+            <artifactId>xml-apis</artifactId>
+            <version>${xml-api.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.lionsoul</groupId>
+            <artifactId>ip2region</artifactId>
+            <version>${ip2region.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-lang3</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.google.guava</groupId>
+            <artifactId>guava</artifactId>
+            <version>${guava.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>com.wuwenze</groupId>
+            <artifactId>ExcelKit</artifactId>
+            <version>${excelkit.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-boot-starter</artifactId>
+            <version>${mybatis-plus.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-oauth2</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-security</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.alibaba.cloud</groupId>
+            <artifactId>spring-cloud-alibaba-nacos-config</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.alibaba.cloud</groupId>
+            <artifactId>spring-cloud-alibaba-nacos-discovery</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-openfeign</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-configuration-processor</artifactId>
+            <optional>true</optional>
+        </dependency>
+        <dependency>
+            <groupId>de.codecentric</groupId>
+            <artifactId>spring-boot-admin-starter-client</artifactId>
+            <version>${spring-boot-admin.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>io.micrometer</groupId>
+            <artifactId>micrometer-registry-prometheus</artifactId>
+        </dependency>
+    </dependencies>
+</project>

BIN
febs-common/febs-common-core/src/main/java/cc/mrbird/febs/common/core/.DS_Store


+ 1 - 1
febs-common/src/main/java/cc/mrbird/febs/common/annotation/Fallback.java → febs-common/febs-common-core/src/main/java/cc/mrbird/febs/common/core/annotation/Fallback.java

@@ -1,4 +1,4 @@
-package cc.mrbird.febs.common.annotation;
+package cc.mrbird.febs.common.core.annotation;
 
 import org.springframework.core.annotation.AliasFor;
 import org.springframework.stereotype.Component;

+ 1 - 1
febs-common/src/main/java/cc/mrbird/febs/common/annotation/Helper.java → febs-common/febs-common-core/src/main/java/cc/mrbird/febs/common/core/annotation/Helper.java

@@ -1,4 +1,4 @@
-package cc.mrbird.febs.common.annotation;
+package cc.mrbird.febs.common.core.annotation;
 
 import org.springframework.core.annotation.AliasFor;
 import org.springframework.stereotype.Component;

+ 3 - 2
febs-common/src/main/java/cc/mrbird/febs/common/annotation/IsMobile.java → febs-common/febs-common-core/src/main/java/cc/mrbird/febs/common/core/annotation/IsMobile.java

@@ -1,6 +1,7 @@
-package cc.mrbird.febs.common.annotation;
+package cc.mrbird.febs.common.core.annotation;
 
-import cc.mrbird.febs.common.validator.MobileValidator;
+
+import cc.mrbird.febs.common.core.validator.MobileValidator;
 
 import javax.validation.Constraint;
 import javax.validation.Payload;

+ 2 - 2
febs-common/src/main/java/cc/mrbird/febs/common/converter/TimeConverter.java → febs-common/febs-common-core/src/main/java/cc/mrbird/febs/common/core/converter/TimeConverter.java

@@ -1,6 +1,6 @@
-package cc.mrbird.febs.common.converter;
+package cc.mrbird.febs.common.core.converter;
 
-import cc.mrbird.febs.common.utils.DateUtil;
+import cc.mrbird.febs.common.core.utils.DateUtil;
 import com.wuwenze.poi.convert.WriteConverter;
 import com.wuwenze.poi.exception.ExcelKitWriteConverterException;
 import lombok.extern.slf4j.Slf4j;

+ 46 - 45
febs-common/src/main/java/cc/mrbird/febs/common/entity/CurrentUser.java → febs-common/febs-common-core/src/main/java/cc/mrbird/febs/common/core/entity/CurrentUser.java

@@ -1,45 +1,46 @@
-package cc.mrbird.febs.common.entity;
-
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-import org.springframework.security.core.GrantedAuthority;
-
-import java.io.Serializable;
-import java.util.Date;
-import java.util.Set;
-
-/**
- * @author MrBird
- */
-@Data
-@AllArgsConstructor
-@NoArgsConstructor
-public class CurrentUser implements Serializable {
-
-    private static long serialVersionUID = 761748087824726463L;
-
-    @JsonIgnore
-    private String password;
-    private String username;
-    @JsonIgnore
-    private Set<GrantedAuthority> authorities;
-    private boolean accountNonExpired;
-    private boolean accountNonLocked;
-    private boolean credentialsNonExpired;
-    private boolean enabled;
-    private Long userId;
-    private String avatar;
-    private String email;
-    private String mobile;
-    private String sex;
-    private Long deptId;
-    private String deptName;
-    private String roleId;
-    private String roleName;
-    @JsonIgnore
-    private Date lastLoginTime;
-    private String description;
-    private String status;
-}
+package cc.mrbird.febs.common.core.entity;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import org.springframework.security.core.GrantedAuthority;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.util.Set;
+
+/**
+ * @author MrBird
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class CurrentUser implements Serializable {
+
+    private static long serialVersionUID = 761748087824726463L;
+
+    @JsonIgnore
+    private String password;
+    private String username;
+    @JsonIgnore
+    private Set<GrantedAuthority> authorities;
+    private boolean accountNonExpired;
+    private boolean accountNonLocked;
+    private boolean credentialsNonExpired;
+    private boolean enabled;
+    private Long userId;
+    private String avatar;
+    private String email;
+    private String mobile;
+    private String sex;
+    private Long deptId;
+    private String deptName;
+    private String roleId;
+    private String roleName;
+    @JsonIgnore
+    private Date lastLoginTime;
+    private String description;
+    private String status;
+    private String deptIds;
+}

+ 15 - 15
febs-common/src/main/java/cc/mrbird/febs/common/entity/DeptTree.java → febs-common/febs-common-core/src/main/java/cc/mrbird/febs/common/core/entity/DeptTree.java

@@ -1,15 +1,15 @@
-package cc.mrbird.febs.common.entity;
-
-import cc.mrbird.febs.common.entity.system.Dept;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-
-/**
- * @author MrBird
- */
-@Data
-@EqualsAndHashCode(callSuper = true)
-public class DeptTree extends Tree<Dept>{
-
-    private Integer orderNum;
-}
+package cc.mrbird.febs.common.core.entity;
+
+import cc.mrbird.febs.common.core.entity.system.Dept;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * @author MrBird
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class DeptTree extends Tree<Dept>{
+
+    private Integer orderNum;
+}

+ 54 - 51
febs-common/src/main/java/cc/mrbird/febs/common/entity/FebsAuthUser.java → febs-common/febs-common-core/src/main/java/cc/mrbird/febs/common/core/entity/FebsAuthUser.java

@@ -1,51 +1,54 @@
-package cc.mrbird.febs.common.entity;
-
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import org.springframework.security.core.GrantedAuthority;
-import org.springframework.security.core.userdetails.User;
-
-import java.util.Collection;
-import java.util.Date;
-
-/**
- * @author MrBird
- */
-@Data
-@EqualsAndHashCode(callSuper = true)
-public class FebsAuthUser extends User {
-
-    private static final long serialVersionUID = -6411066541689297219L;
-
-    private Long userId;
-
-    private String avatar;
-
-    private String email;
-
-    private String mobile;
-
-    private String sex;
-
-    private Long deptId;
-
-    private String deptName;
-
-    private String roleId;
-
-    private String roleName;
-
-    private Date lastLoginTime;
-
-    private String description;
-
-    private String status;
-
-    public FebsAuthUser(String username, String password, Collection<? extends GrantedAuthority> authorities) {
-        super(username, password, authorities);
-    }
-
-    public FebsAuthUser(String username, String password, boolean enabled, boolean accountNonExpired, boolean credentialsNonExpired, boolean accountNonLocked, Collection<? extends GrantedAuthority> authorities) {
-        super(username, password, enabled, accountNonExpired, credentialsNonExpired, accountNonLocked, authorities);
-    }
-}
+package cc.mrbird.febs.common.core.entity;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springframework.security.core.GrantedAuthority;
+import org.springframework.security.core.userdetails.User;
+
+import java.util.Collection;
+import java.util.Date;
+
+/**
+ * @author MrBird
+ */
+@Data
+@SuppressWarnings("all")
+@EqualsAndHashCode(callSuper = true)
+public class FebsAuthUser extends User {
+
+    private static final long serialVersionUID = -6411066541689297219L;
+
+    private Long userId;
+
+    private String avatar;
+
+    private String email;
+
+    private String mobile;
+
+    private String sex;
+
+    private Long deptId;
+
+    private String deptName;
+
+    private String roleId;
+
+    private String roleName;
+
+    private Date lastLoginTime;
+
+    private String description;
+
+    private String status;
+
+    private String deptIds;
+
+    public FebsAuthUser(String username, String password, Collection<? extends GrantedAuthority> authorities) {
+        super(username, password, authorities);
+    }
+
+    public FebsAuthUser(String username, String password, boolean enabled, boolean accountNonExpired, boolean credentialsNonExpired, boolean accountNonLocked, Collection<? extends GrantedAuthority> authorities) {
+        super(username, password, enabled, accountNonExpired, credentialsNonExpired, accountNonLocked, authorities);
+    }
+}

+ 1 - 1
febs-common/src/main/java/cc/mrbird/febs/common/entity/FebsResponse.java → febs-common/febs-common-core/src/main/java/cc/mrbird/febs/common/core/entity/FebsResponse.java

@@ -1,4 +1,4 @@
-package cc.mrbird.febs.common.entity;
+package cc.mrbird.febs.common.core.entity;
 
 import java.util.HashMap;
 

+ 21 - 20
febs-common/src/main/java/cc/mrbird/febs/common/entity/MenuTree.java → febs-common/febs-common-core/src/main/java/cc/mrbird/febs/common/core/entity/MenuTree.java

@@ -1,20 +1,21 @@
-package cc.mrbird.febs.common.entity;
-
-import cc.mrbird.febs.common.entity.system.Menu;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-
-/**
- * @author MrBird
- */
-@Data
-@EqualsAndHashCode(callSuper = true)
-public class MenuTree extends Tree<Menu>{
-
-    private String path;
-    private String component;
-    private String perms;
-    private String icon;
-    private String type;
-    private Integer orderNum;
-}
+package cc.mrbird.febs.common.core.entity;
+
+
+import cc.mrbird.febs.common.core.entity.system.Menu;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * @author MrBird
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class MenuTree extends Tree<Menu>{
+
+    private String path;
+    private String component;
+    private String perms;
+    private String icon;
+    private String type;
+    private Integer orderNum;
+}

+ 32 - 32
febs-common/src/main/java/cc/mrbird/febs/common/entity/QueryRequest.java → febs-common/febs-common-core/src/main/java/cc/mrbird/febs/common/core/entity/QueryRequest.java

@@ -1,32 +1,32 @@
-package cc.mrbird.febs.common.entity;
-
-import lombok.Data;
-import lombok.ToString;
-
-import java.io.Serializable;
-
-/**
- * @author MrBird
- */
-@Data
-@ToString
-public class QueryRequest implements Serializable {
-
-    private static final long serialVersionUID = -4869594085374385813L;
-    /**
-     * 当前页面数据量
-     */
-    private int pageSize = 10;
-    /**
-     * 当前页码
-     */
-    private int pageNum = 1;
-    /**
-     * 排序字段
-     */
-    private String field;
-    /**
-     * 排序规则,asc升序,desc降序
-     */
-    private String order;
-}
+package cc.mrbird.febs.common.core.entity;
+
+import lombok.Data;
+import lombok.ToString;
+
+import java.io.Serializable;
+
+/**
+ * @author MrBird
+ */
+@Data
+@ToString
+public class QueryRequest implements Serializable {
+
+    private static final long serialVersionUID = -4869594085374385813L;
+    /**
+     * 当前页面数据量
+     */
+    private int pageSize = 10;
+    /**
+     * 当前页码
+     */
+    private int pageNum = 1;
+    /**
+     * 排序字段
+     */
+    private String field;
+    /**
+     * 排序规则,asc升序,desc降序
+     */
+    private String order;
+}

+ 32 - 32
febs-common/src/main/java/cc/mrbird/febs/common/entity/Tree.java → febs-common/febs-common-core/src/main/java/cc/mrbird/febs/common/core/entity/Tree.java

@@ -1,32 +1,32 @@
-package cc.mrbird.febs.common.entity;
-
-import com.fasterxml.jackson.annotation.JsonInclude;
-import lombok.Data;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * @author MrBird
- */
-@Data
-@JsonInclude(JsonInclude.Include.NON_NULL)
-public class Tree<T> {
-
-    private String id;
-
-    private String label;
-
-    private List<Tree<T>> children;
-
-    private String parentId;
-
-    private boolean hasParent = false;
-
-    private boolean hasChildren = false;
-
-    public void initChildren(){
-        this.children = new ArrayList<>();
-    }
-
-}
+package cc.mrbird.febs.common.core.entity;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import lombok.Data;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author MrBird
+ */
+@Data
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class Tree<T> {
+
+    private String id;
+
+    private String label;
+
+    private List<Tree<T>> children;
+
+    private String parentId;
+
+    private boolean hasParent = false;
+
+    private boolean hasChildren = false;
+
+    public void initChildren(){
+        this.children = new ArrayList<>();
+    }
+
+}

+ 85 - 85
febs-common/src/main/java/cc/mrbird/febs/common/entity/auth/OauthCliendetails.java → febs-common/febs-common-core/src/main/java/cc/mrbird/febs/common/core/entity/auth/OauthCliendetails.java

@@ -1,86 +1,86 @@
-package cc.mrbird.febs.common.entity.auth;
-
-
-import lombok.Data;
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableField;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-
-/**
- *  Entity
- *
- * @author MrBird
- * @date 2019-09-09 14:13:23
- */
-@Data
-@TableName("oauth_client_details")
-public class OauthCliendetails {
-
-    /**
-     * 
-     */
-    @TableId(value = "client_id", type = IdType.AUTO)
-    private String clientId;
-
-    /**
-     * 
-     */
-    @TableField("resource_ids")
-    private String resourceIds;
-
-    /**
-     * 
-     */
-    @TableField("client_secret")
-    private String clientSecret;
-
-    /**
-     * 
-     */
-    @TableField("scope")
-    private String scope;
-
-    /**
-     * 
-     */
-    @TableField("authorized_grant_types")
-    private String authorizedGrantTypes;
-
-    /**
-     * 
-     */
-    @TableField("web_server_redirect_uri")
-    private String webServerRedirectUri;
-
-    /**
-     * 
-     */
-    @TableField("authorities")
-    private String authorities;
-
-    /**
-     * 
-     */
-    @TableField("access_token_validity")
-    private Integer accessTokenValidity;
-
-    /**
-     * 
-     */
-    @TableField("refresh_token_validity")
-    private Integer refreshTokenValidity;
-
-    /**
-     * 
-     */
-    @TableField("additional_information")
-    private String additionalInformation;
-
-    /**
-     * 
-     */
-    @TableField("autoapprove")
-    private Byte autoapprove;
-
+package cc.mrbird.febs.common.core.entity.auth;
+
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+/**
+ *  Entity
+ *
+ * @author MrBird
+ * @date 2019-09-09 14:13:23
+ */
+@Data
+@TableName("oauth_client_details")
+public class OauthCliendetails {
+
+    /**
+     * 
+     */
+    @TableId(value = "client_id", type = IdType.AUTO)
+    private String clientId;
+
+    /**
+     * 
+     */
+    @TableField("resource_ids")
+    private String resourceIds;
+
+    /**
+     * 
+     */
+    @TableField("client_secret")
+    private String clientSecret;
+
+    /**
+     * 
+     */
+    @TableField("scope")
+    private String scope;
+
+    /**
+     * 
+     */
+    @TableField("authorized_grant_types")
+    private String authorizedGrantTypes;
+
+    /**
+     * 
+     */
+    @TableField("web_server_redirect_uri")
+    private String webServerRedirectUri;
+
+    /**
+     * 
+     */
+    @TableField("authorities")
+    private String authorities;
+
+    /**
+     * 
+     */
+    @TableField("access_token_validity")
+    private Integer accessTokenValidity;
+
+    /**
+     * 
+     */
+    @TableField("refresh_token_validity")
+    private Integer refreshTokenValidity;
+
+    /**
+     * 
+     */
+    @TableField("additional_information")
+    private String additionalInformation;
+
+    /**
+     * 
+     */
+    @TableField("autoapprove")
+    private Byte autoapprove;
+
 }

+ 27 - 25
febs-common/src/main/java/cc/mrbird/febs/common/entity/constant/EndpointConstant.java → febs-common/febs-common-core/src/main/java/cc/mrbird/febs/common/core/entity/constant/EndpointConstant.java

@@ -1,25 +1,27 @@
-package cc.mrbird.febs.common.entity.constant;
-
-/**
- * 端点常量
- *
- * @author MrBird
- */
-public class EndpointConstant {
-
-    public static final String ALL = "/**";
-
-    public static final String OAUTH_ALL = "/oauth/**";
-
-    public static final String OAUTH_AUTHORIZE = "/oauth/authorize";
-
-    public static final String OAUTH_CHECK_TOKEN = "/oauth/check_token";
-
-    public static final String OAUTH_CONFIRM_ACCESS = "/oauth/confirm_access";
-
-    public static final String OAUTH_TOKEN = "/oauth/token";
-
-    public static final String OAUTH_TOKEN_KEY = "/oauth/token_key";
-
-    public static final String OAUTH_ERROR = "/oauth/error";
-}
+package cc.mrbird.febs.common.core.entity.constant;
+
+/**
+ * 端点常量
+ *
+ * @author MrBird
+ */
+public class EndpointConstant {
+
+    public static final String ALL = "/**";
+
+    public static final String OAUTH_ALL = "/oauth/**";
+
+    public static final String OAUTH_AUTHORIZE = "/oauth/authorize";
+
+    public static final String OAUTH_CHECK_TOKEN = "/oauth/check_token";
+
+    public static final String OAUTH_CONFIRM_ACCESS = "/oauth/confirm_access";
+
+    public static final String OAUTH_TOKEN = "/oauth/token";
+
+    public static final String OAUTH_TOKEN_KEY = "/oauth/token_key";
+
+    public static final String OAUTH_ERROR = "/oauth/error";
+
+    public static final String ACTUATOR_ALL= "/actuator/**";
+}

+ 67 - 63
febs-common/src/main/java/cc/mrbird/febs/common/entity/constant/FebsConstant.java → febs-common/febs-common-core/src/main/java/cc/mrbird/febs/common/core/entity/constant/FebsConstant.java

@@ -1,63 +1,67 @@
-package cc.mrbird.febs.common.entity.constant;
-
-/**
- * FEBS系统常量类
- *
- * @author MrBird
- */
-public class FebsConstant {
-
-    /**
-     * 排序规则:降序
-     */
-    public static final String ORDER_DESC = "descending";
-    /**
-     * 排序规则:升序
-     */
-    public static final String ORDER_ASC = "ascending";
-
-    /**
-     * Gateway请求头TOKEN名称(不要有空格)
-     */
-    public static final String GATEWAY_TOKEN_HEADER = "GatewayToken";
-    /**
-     * Gateway请求头TOKEN值
-     */
-    public static final String GATEWAY_TOKEN_VALUE = "febs:gateway:123456";
-
-    /**
-     * 允许下载的文件类型,根据需求自己添加(小写)
-     */
-    public static final String[] VALID_FILE_TYPE = {"xlsx", "zip"};
-
-    /**
-     * 验证码 key前缀
-     */
-    public static final String CODE_PREFIX = "febs.captcha.";
-
-    /**
-     * 异步线程池名称
-     */
-    public static final String ASYNC_POOL = "febsAsyncThreadPool";
-
-    /**
-     * OAUTH2 令牌类型 https://oauth.net/2/bearer-tokens/
-     */
-    public static final String OAUTH2_TOKEN_TYPE = "bearer";
-    /**
-     * Java默认临时目录
-     */
-    public static final String JAVA_TEMP_DIR = "java.io.tmpdir";
-    /**
-     * utf-8
-     */
-    public static final String UTF8 = "utf-8";
-    /**
-     * 注册用户角色ID
-     */
-    public static final Long REGISTER_ROLE_ID = 2L;
-
-    public static final String LOCALHOST = "localhost";
-    public static final String LOCALHOST_IP = "127.0.0.1";
-
-}
+package cc.mrbird.febs.common.core.entity.constant;
+
+/**
+ * FEBS系统常量类
+ *
+ * @author MrBird
+ */
+public class FebsConstant {
+
+    /**
+     * 排序规则:降序
+     */
+    public static final String ORDER_DESC = "descending";
+    /**
+     * 排序规则:升序
+     */
+    public static final String ORDER_ASC = "ascending";
+
+    /**
+     * Gateway请求头TOKEN名称(不要有空格)
+     */
+    public static final String GATEWAY_TOKEN_HEADER = "GatewayToken";
+    /**
+     * Gateway请求头TOKEN值
+     */
+    public static final String GATEWAY_TOKEN_VALUE = "febs:gateway:123456";
+
+    /**
+     * 允许下载的文件类型,根据需求自己添加(小写)
+     */
+    public static final String[] VALID_FILE_TYPE = {"xlsx", "zip"};
+
+    /**
+     * 验证码 key前缀
+     */
+    public static final String CODE_PREFIX = "febs.captcha.";
+
+    /**
+     * 异步线程池名称
+     */
+    public static final String ASYNC_POOL = "febsAsyncThreadPool";
+
+    /**
+     * OAUTH2 令牌类型 https://oauth.net/2/bearer-tokens/
+     */
+    public static final String OAUTH2_TOKEN_TYPE = "bearer";
+    /**
+     * Java默认临时目录
+     */
+    public static final String JAVA_TEMP_DIR = "java.io.tmpdir";
+    /**
+     * utf-8
+     */
+    public static final String UTF8 = "utf-8";
+    /**
+     * 注册用户角色ID
+     */
+    public static final Long REGISTER_ROLE_ID = 2L;
+
+    public static final String LOCALHOST = "localhost";
+    public static final String LOCALHOST_IP = "127.0.0.1";
+    /**
+     * 启动banner
+     */
+    public static final String COMPLETE_BANNER = "  _   _   _   _   _   _   _   _\n / \\ / \\ / \\ / \\ / \\ / \\ / \\ / \\\n( c | o | m | p | l | e | t | e )\n \\_/ \\_/ \\_/ \\_/ \\_/ \\_/ \\_/ \\_/";
+
+}

+ 24 - 0
febs-common/febs-common-core/src/main/java/cc/mrbird/febs/common/core/entity/constant/FebsServerConstant.java

@@ -0,0 +1,24 @@
+package cc.mrbird.febs.common.core.entity.constant;
+
+/**
+ * @author MrBird
+ */
+public class FebsServerConstant {
+
+    public static final String FEBS_AUTH = "FEBS-Auth";
+    public static final String FEBS_CLOUD = "FEBS-Cloud";
+    public static final String FEBS_COMMON = "FEBS-Common";
+    public static final String FEBS_COMMON_CORE = "FEBS-Common-Core";
+    public static final String FEBS_COMMON_DATASOURCE = "FEBS-Common-Datasource";
+    public static final String FEBS_COMMON_REDIS = "FEBS-Common-Redis";
+    public static final String FEBS_GATEWAY = "FEBS-Gateway";
+    public static final String FEBS_APM = "FEBS-APM";
+    public static final String FEBS_ADMIN = "FEBS-Admin";
+    public static final String FEBS_SERVER = "FEBS-Server";
+    public static final String FEBS_SERVER_SYSTEM = "FEBS-Server-System";
+    public static final String FEBS_SERVER_TEST = "FEBS-Server-Test";
+    public static final String FEBS_SERVER_JOB = "FEBS-Server-Job";
+    public static final String FEBS_SERVER_GENERATOR = "FEBS-Server-Generator";
+    public static final String FEBS_SERVER_SOCKET = "FEBS-Server-Socket";
+    public static final String FEBS_TX_MANAGER = "FEBS-TX-Manager";
+}

+ 1 - 5
febs-common/src/main/java/cc/mrbird/febs/common/entity/constant/GeneratorConstant.java → febs-common/febs-common-core/src/main/java/cc/mrbird/febs/common/core/entity/constant/GeneratorConstant.java

@@ -1,4 +1,4 @@
-package cc.mrbird.febs.common.entity.constant;
+package cc.mrbird.febs.common.core.entity.constant;
 
 /**
  * 代码生成常量
@@ -11,10 +11,6 @@ public class GeneratorConstant {
      * 数据库类型
      */
     public static final String DATABASE_TYPE = "mysql";
-    /**
-     * 数据库名称
-     */
-    public static final String DATABASE_NAME = "febs_cloud_base";
 
     /**
      * 生成代码的临时目录

+ 30 - 30
febs-common/src/main/java/cc/mrbird/febs/common/entity/constant/GrantTypeConstant.java → febs-common/febs-common-core/src/main/java/cc/mrbird/febs/common/core/entity/constant/GrantTypeConstant.java

@@ -1,30 +1,30 @@
-package cc.mrbird.febs.common.entity.constant;
-
-/**
- * 认证类型常量类
- *
- * @author MrBird
- */
-public class GrantTypeConstant {
-
-    /**
-     * 刷新模式
-     */
-    public static final String REFRESH_TOKEN = "refresh_token";
-    /**
-     * 授权码模式
-     */
-    public static final String AUTHORIZATION_CODE = "authorization_code";
-    /**
-     * 客户端模式
-     */
-    public static final String CLIENT_CREDENTIALS = "client_credentials";
-    /**
-     * 密码模式
-     */
-    public static final String PASSWORD = "password";
-    /**
-     * 简化模式
-     */
-    public static final String IMPLICIT = "implicit";
-}
+package cc.mrbird.febs.common.core.entity.constant;
+
+/**
+ * 认证类型常量类
+ *
+ * @author MrBird
+ */
+public class GrantTypeConstant {
+
+    /**
+     * 刷新模式
+     */
+    public static final String REFRESH_TOKEN = "refresh_token";
+    /**
+     * 授权码模式
+     */
+    public static final String AUTHORIZATION_CODE = "authorization_code";
+    /**
+     * 客户端模式
+     */
+    public static final String CLIENT_CREDENTIALS = "client_credentials";
+    /**
+     * 密码模式
+     */
+    public static final String PASSWORD = "password";
+    /**
+     * 简化模式
+     */
+    public static final String IMPLICIT = "implicit";
+}

+ 18 - 18
febs-common/src/main/java/cc/mrbird/febs/common/entity/constant/ImageTypeConstant.java → febs-common/febs-common-core/src/main/java/cc/mrbird/febs/common/core/entity/constant/ImageTypeConstant.java

@@ -1,18 +1,18 @@
-package cc.mrbird.febs.common.entity.constant;
-
-/**
- * 图片类型常量类
- *
- * @author MrBird
- */
-public class ImageTypeConstant {
-
-    /**
-     * gif类型
-     */
-    public static final String GIF = "gif";
-    /**
-     * png类型
-     */
-    public static final String PNG = "png";
-}
+package cc.mrbird.febs.common.core.entity.constant;
+
+/**
+ * 图片类型常量类
+ *
+ * @author MrBird
+ */
+public class ImageTypeConstant {
+
+    /**
+     * gif类型
+     */
+    public static final String GIF = "gif";
+    /**
+     * png类型
+     */
+    public static final String PNG = "png";
+}

+ 12 - 12
febs-common/src/main/java/cc/mrbird/febs/common/entity/constant/PageConstant.java → febs-common/febs-common-core/src/main/java/cc/mrbird/febs/common/core/entity/constant/PageConstant.java

@@ -1,12 +1,12 @@
-package cc.mrbird.febs.common.entity.constant;
-
-/**
- * 分页常量
- *
- * @author MrBird
- */
-public class PageConstant {
-
-    public static final String ROWS = "rows";
-    public static final String TOTAL = "total";
-}
+package cc.mrbird.febs.common.core.entity.constant;
+
+/**
+ * 分页常量
+ *
+ * @author MrBird
+ */
+public class PageConstant {
+
+    public static final String ROWS = "rows";
+    public static final String TOTAL = "total";
+}

+ 27 - 27
febs-common/src/main/java/cc/mrbird/febs/common/entity/constant/ParamsConstant.java → febs-common/febs-common-core/src/main/java/cc/mrbird/febs/common/core/entity/constant/ParamsConstant.java

@@ -1,27 +1,27 @@
-package cc.mrbird.febs.common.entity.constant;
-
-/**
- * 请求参数常量
- *
- * @author MrBird
- */
-public class ParamsConstant {
-
-    /**
-     * 验证码 key
-     */
-    public static final String VALIDATE_CODE_KEY = "key";
-    /**
-     * 验证码 code
-     */
-    public static final String VALIDATE_CODE_CODE = "code";
-    /**
-     * 认证类型参数 key
-     */
-    public static final String GRANT_TYPE = "grant_type";
-    /**
-     * 登录类型
-     */
-    public static final String LOGIN_TYPE = "login_type";
-
-}
+package cc.mrbird.febs.common.core.entity.constant;
+
+/**
+ * 请求参数常量
+ *
+ * @author MrBird
+ */
+public class ParamsConstant {
+
+    /**
+     * 验证码 key
+     */
+    public static final String VALIDATE_CODE_KEY = "key";
+    /**
+     * 验证码 code
+     */
+    public static final String VALIDATE_CODE_CODE = "code";
+    /**
+     * 认证类型参数 key
+     */
+    public static final String GRANT_TYPE = "grant_type";
+    /**
+     * 登录类型
+     */
+    public static final String LOGIN_TYPE = "login_type";
+
+}

+ 1 - 1
febs-common/src/main/java/cc/mrbird/febs/common/entity/constant/RegexpConstant.java → febs-common/febs-common-core/src/main/java/cc/mrbird/febs/common/core/entity/constant/RegexpConstant.java

@@ -1,4 +1,4 @@
-package cc.mrbird.febs.common.entity.constant;
+package cc.mrbird.febs.common.core.entity.constant;
 
 /**
  * 正则常量

+ 10 - 10
febs-common/src/main/java/cc/mrbird/febs/common/entity/constant/SocialConstant.java → febs-common/febs-common-core/src/main/java/cc/mrbird/febs/common/core/entity/constant/SocialConstant.java

@@ -1,10 +1,10 @@
-package cc.mrbird.febs.common.entity.constant;
-
-/**
- * @author MrBird
- */
-public class SocialConstant {
-
-    public static final String SOCIAL_LOGIN = "social_login";
-    public static final String SOCIAL_LOGIN_PASSWORD = "febs_social_login_password";
-}
+package cc.mrbird.febs.common.core.entity.constant;
+
+/**
+ * @author MrBird
+ */
+public class SocialConstant {
+
+    public static final String SOCIAL_LOGIN = "social_login";
+    public static final String SOCIAL_LOGIN_PASSWORD = "febs_social_login_password";
+}

+ 1 - 1
febs-common/src/main/java/cc/mrbird/febs/common/entity/router/RouterMeta.java → febs-common/febs-common-core/src/main/java/cc/mrbird/febs/common/core/entity/router/RouterMeta.java

@@ -1,4 +1,4 @@
-package cc.mrbird.febs.common.entity.router;
+package cc.mrbird.febs.common.core.entity.router;
 
 import com.fasterxml.jackson.annotation.JsonInclude;
 import lombok.AllArgsConstructor;

+ 46 - 46
febs-common/src/main/java/cc/mrbird/febs/common/entity/router/VueRouter.java → febs-common/febs-common-core/src/main/java/cc/mrbird/febs/common/core/entity/router/VueRouter.java

@@ -1,46 +1,46 @@
-package cc.mrbird.febs.common.entity.router;
-
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.fasterxml.jackson.annotation.JsonInclude;
-import lombok.Data;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * 构建 Vue路由
- *
- * @author MrBird
- */
-@Data
-@JsonInclude(JsonInclude.Include.NON_NULL)
-public class VueRouter<T> implements Serializable {
-
-    private static final long serialVersionUID = -3327478146308500708L;
-
-    @JsonIgnore
-    private String id;
-    @JsonIgnore
-    private String parentId;
-
-    private String path;
-    private String name;
-    private String component;
-    private String redirect;
-    private RouterMeta meta;
-    private Boolean hidden = false;
-    private Boolean alwaysShow = false;
-    private List<VueRouter<T>> children;
-
-    @JsonIgnore
-    private Boolean hasParent = false;
-
-    @JsonIgnore
-    private Boolean hasChildren = false;
-
-    public void initChildren(){
-        this.children = new ArrayList<>();
-    }
-
-}
+package cc.mrbird.febs.common.core.entity.router;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 构建 Vue路由
+ *
+ * @author MrBird
+ */
+@Data
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class VueRouter<T> implements Serializable {
+
+    private static final long serialVersionUID = -3327478146308500708L;
+
+    @JsonIgnore
+    private String id;
+    @JsonIgnore
+    private String parentId;
+
+    private String path;
+    private String name;
+    private String component;
+    private String redirect;
+    private RouterMeta meta;
+    private Boolean hidden = false;
+    private Boolean alwaysShow = false;
+    private List<VueRouter<T>> children;
+
+    @JsonIgnore
+    private Boolean hasParent = false;
+
+    @JsonIgnore
+    private Boolean hasChildren = false;
+
+    public void initChildren(){
+        this.children = new ArrayList<>();
+    }
+
+}

+ 1 - 1
febs-common/src/main/java/cc/mrbird/febs/common/entity/system/Column.java → febs-common/febs-common-core/src/main/java/cc/mrbird/febs/common/core/entity/system/Column.java

@@ -1,4 +1,4 @@
-package cc.mrbird.febs.common.entity.system;
+package cc.mrbird.febs.common.core.entity.system;
 
 import lombok.Data;
 

+ 60 - 0
febs-common/febs-common-core/src/main/java/cc/mrbird/febs/common/core/entity/system/DataPermissionTest.java

@@ -0,0 +1,60 @@
+package cc.mrbird.febs.common.core.entity.system;
+
+import java.util.Date;
+
+import lombok.Data;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+
+/**
+ * @author MrBird
+ */
+@Data
+@TableName("t_data_permission_test")
+public class DataPermissionTest {
+
+    /**
+     * 字段1
+     */
+    @TableField("FIELD1")
+    private String field1;
+
+    /**
+     * 字段2
+     */
+    @TableField("FIELD2")
+    private String field2;
+
+    /**
+     * 字段3
+     */
+    @TableField("FIELD3")
+    private String field3;
+
+    /**
+     * 字段4
+     */
+    @TableField("FIELD4")
+    private String field4;
+
+    /**
+     * 部门id
+     */
+    @TableField("DEPT_ID")
+    private Integer deptId;
+
+    /**
+     * 创建时间
+     */
+    @TableField("CREATE_TIME")
+    private Date createTime;
+
+    /**
+     * id
+     */
+    @TableId(value = "ID", type = IdType.AUTO)
+    private Integer id;
+
+}

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