feat(version): shoulder 0.5->0.6 SNAPSHOT,ddl update

This commit is contained in:
15858193327
2020-12-14 00:27:49 +08:00
parent ce046b0e73
commit 1c149f6520
11 changed files with 73 additions and 31 deletions

View File

@@ -13,17 +13,31 @@
## 架构图
![架构图.png](img/architecture.png)
技术架构:
![系统技术架构图.png](img/architecture.png)
去掉技术细节,从全局角度看整个系统架构:
![系统整体能力.png](img/shoulder-platform.png)
在线工具:[https://app.diagrams.net/](https://app.diagrams.net/) [https://processon.com/](https://processon.com/)
## 在线预览
- [开发规范地址](http://spec.itlym.cn)
- [Grafana + Prometheus 监控系统](http://grafana.itlym.cn)(访客账号密码:`shoulder` / `shoulder123`,仅包含仪表盘查看权限)
- [EFK 日志系统](http://kibana.itlym.cn)(访客账号密码:`shoulder` / `shoulder123`,仅包含日志检索查看权限)
- [Grafana + Prometheus 监控系统](https://grafana.itlym.cn)(访客账号密码:`shoulder` / `shoulder123`,仅包含仪表盘查看权限)
- [EFK 日志系统](https://kibana.itlym.cn)(访客账号密码:`shoulder` / `shoulder123`,仅包含日志检索查看权限)
- 平台地址( 开发中 )
- ~~[zipkin 链路追踪系统](http://zipkin.itlym.cn)(暂时下线)~~
- [注册中心 / 配置中心地址](https://nacos.itlym.cn)
- [限流配置中心地址](https://sentinel.itlym.cn)
- ~~[zipkin 链路追踪系统](https://zipkin.itlym.cn)(暂时下线)~~
- [开发规范地址](https://spec.itlym.cn)
- [私有代码版本控制地址](https://git.itlym.cn)
- [持续集成服务器地址](https://drone.itlym.cn)
# 能力介绍
@@ -137,7 +151,7 @@
#### 监控
[监控系统预览地址](http://grafana.itlym.cn)(访客账号密码:`shoulder` / `shoulder123`,演示账号仅包含仪表盘查看权限,不能编辑)
[监控系统预览地址](https://grafana.itlym.cn)(访客账号密码:`shoulder` / `shoulder123`,演示账号仅包含仪表盘查看权限,不能编辑)
![主机监控](img/host.png)
@@ -173,10 +187,10 @@ ELK展示nginx日志演示
| 项目 | 开源地址 | 说明 |
|---|---|---|
| Shoulder Framework | [github](https://github.com/ChinaLym/Shoulder-Framework)、[gitee](https://gitee.com/ChinaLym/shoulder-framework) | 开发框架,在 Spring Boot 基础之上,结合[软件优雅设计与开发最佳实践](http://spec.itlym.cn),增加常用的功能,任何基于`Spring Boot`/`Spring Cloud`的项目都可以使用。 |
| Shoulder Framework | [github](https://github.com/ChinaLym/Shoulder-Framework)、[gitee](https://gitee.com/ChinaLym/shoulder-framework) | 开发框架,在 Spring Boot 基础之上,结合[软件优雅设计与开发最佳实践](https://spec.itlym.cn),增加常用的功能,任何基于`Spring Boot`/`Spring Cloud`的项目都可以使用。 |
| shoulder-framework-demo | [github](https://github.com/ChinaLym/shoulder-framework-demo)、[gitee](https://gitee.com/ChinaLym/shoulder-framework) | 以简单的例子介绍 `Shoulder Framework` 的使用 |
| shoulder-plugins | [github](https://github.com/ChinaLym/shoulder-plugins)、[gitee](https://gitee.com/ChinaLym/shoulder-plugins) | shoulder 提供的的减少开发工作量的`maven`插件(非必须,如遵循[软件优雅设计与开发最佳实践-国际化开发](http://doc.itlym.cn/specs/base/i18n.html)时推荐希望使用自动生成多语言翻译资源文件的插件减少开发工作量) |
| shoulder-lombok | [github](https://github.com/ChinaLym/shoulder-lombok)、[gitee](https://gitee.com/ChinaLym/shoulder-lombok) | 在`lombok`之上,增加 `@SLog` 注解,用于简化[软件优雅设计与开发最佳实践-错误码与日志](http://spec.itlym.cn/specs/base/errorCode.html) -shoulder 实现的日志框架的使用(非必须) |
| shoulder-plugins | [github](https://github.com/ChinaLym/shoulder-plugins)、[gitee](https://gitee.com/ChinaLym/shoulder-plugins) | shoulder 提供的的减少开发工作量的`maven`插件(非必须,如遵循[软件优雅设计与开发最佳实践-国际化开发](https://doc.itlym.cn/specs/base/i18n.html)时推荐希望使用自动生成多语言翻译资源文件的插件减少开发工作量) |
| shoulder-lombok | [github](https://github.com/ChinaLym/shoulder-lombok)、[gitee](https://gitee.com/ChinaLym/shoulder-lombok) | 在`lombok`之上,增加 `@SLog` 注解,用于简化[软件优雅设计与开发最佳实践-错误码与日志](https://spec.itlym.cn/specs/base/errorCode.html) -shoulder 实现的日志框架的使用(非必须) |
| shoulder-lombok-idea-plugin | [github](https://github.com/ChinaLym/lombok-intellij-plugin)、[gitee](https://gitee.com/ChinaLym/lombok-intellij-plugin) | 在 `lombok-idea-plugin`之上,在 IDEA 中增加`@SLog`的编码提示,以更好的使用 `shoulder-lombok`(非必须,使用 shoulder-lombok 时推荐) |
| **Shoulder Platform** | [github](https://github.com/ChinaLym/Shoulder-Platform)、[gitee](https://gitee.com/ChinaLym/shoulder-Platform) | SaaS 开发平台,提供了基础通用能力,与具体业务无关 |
| Shoulder iPaaS | [github](https://github.com/ChinaLym/shoulder-iPaaS)、[gitee](https://gitee.com/ChinaLym/shoulder-iPaaS) | iPaaS 平台,介绍了常见中间件、监控系统、私有基础平台如何部署 |
@@ -190,6 +204,6 @@ ELK展示nginx日志演示
| 平台对接开发包 `SDK` | 降低使用者调用 `shoulder` 的开发成本和难度 | 以 Spring Boot 自动装配形式提供包含使用文档和Demo | 提供对接 shoulder-platform的默认实现使用者也可根据平台api接口文档自行实现 |
| 共性业务层 `aPaaS` | 通用基础功能如认证、注册、授权、通知推送、知识库、错误码查询等 | api网关、web管理平台、用户中心、通知中心 | |
| 开发脚手架 `工具` | 统一维护共性代码,提供常用能力如异常拦截、错误码、安全加密等,统一管理技术和依赖版本 | `spring boot``spring cloud``shoulder-framework``shoulder-platform-common` 等 | 提供一些常用的功能封装,**可直接用于任何项目** |
| 软件开发设计理论指导 `理论` | 软件开发设计理论指导,主要为了系统的易维护、易扩展、易观测、安全性 | 总结业界开发设计实践经验如 `阿里巴巴Java开发规范` 结合而成,详见[优雅软件设计规范](http://spec.itlym.cn) | shoulder给予了一定的理论指导但这是**可选的**,不强制使用者必须遵循 |
| 软件开发设计理论指导 `理论` | 软件开发设计理论指导,主要为了系统的易维护、易扩展、易观测、安全性 | 总结业界开发设计实践经验如 `阿里巴巴Java开发规范` 结合而成,详见[优雅软件设计规范](https://spec.itlym.cn) | shoulder给予了一定的理论指导但这是**可选的**,不强制使用者必须遵循 |
| 软件平台基础层 `iPaaS` | 无业务含义的基础中间件,数据库、消息队列、监控中间件、告警中间件等 | MySql、RabbitMQ、Nacos、Zipkin、ElasticSearch、Docker、K8s 等,以 `Docker` 镜像方式提供 | 提供大部分场景的最佳技术方案选型,安装、部署、参数调优方案,**可直接用于任何项目** |
| 硬件基础层 `IaaS` | 硬件支撑如CPU、内存、网络、存储等 | 依赖云主机厂商,如阿里云、腾讯云、亚马逊云等 | 无shoulder不干涉该层 |

View File

@@ -69,14 +69,14 @@ CREATE TABLE `log_operation` (
`user_real_name` varchar(128) DEFAULT NULL COMMENT '用户真实姓名',
`user_org_id` BIGINT DEFAULT NULL COMMENT '用户组标识',
`user_org_name` varchar(64) DEFAULT NULL COMMENT '用户组名',
`ip` varchar(64) DEFAULT NULL COMMENT '操作者所在终端 ip支持ipv4(15)/v6(46)',
`terminal_id` varchar(64) DEFAULT NULL COMMENT '操作者所在终端标识如PC的 MAC手机的 IMSI、IMEI、ESN、MEID甚至持久化的 UUID',
`terminal_type` INT NOT NULL COMMENT '终端类型。0:服务内部定时任务等触发1:浏览器2:客户端3:移动App4:小程序。推荐前端支持多语言',
`terminal_address` varchar(64) DEFAULT NULL COMMENT '操作者所在终端地址,如 IPv4(15) IPv6(46)',
`terminal_id` varchar(64) DEFAULT NULL COMMENT '操作者所在终端标识如PC的 MAC手机的 IMSI、IMEI、ESN、MEID甚至持久化的 UUID',
`terminal_info` varchar(255) DEFAULT NULL COMMENT '操作者所在终端信息,如操作系统类型、浏览器、版本号等',
`object_type` varchar(128) DEFAULT NULL COMMENT '操作对象类型,通常展示,推荐支持多语言',
`object_id` varchar(128) DEFAULT NULL COMMENT '操作对象id',
`object_name` varchar(255) DEFAULT NULL COMMENT '操作对象名称',
`action_param` text COMMENT '触发该操作的参数',
`operation_param` text COMMENT '触发该操作的参数',
`operation` varchar(255) NOT NULL COMMENT '操作动作,通常展示,推荐支持多语言',
`detail` varchar(4096) DEFAULT NULL COMMENT '操作详情。详细的描述用户的操作内容、json对象等',
`detail_key` varchar(128) DEFAULT NULL COMMENT '操作详情对应的多语言key',
@@ -85,7 +85,7 @@ CREATE TABLE `log_operation` (
`error_code` varchar(32) DEFAULT NULL COMMENT '错误码',
`operation_time` timestamp NOT NULL COMMENT '操作触发时间,注意采集完成后替换为日志服务所在服务器时间',
`end_time` timestamp NULL DEFAULT NULL COMMENT '操作结束时间',
`last_time` BIGINT DEFAULT NULL COMMENT '操作持续时间,冗余字段',
`duration` BIGINT DEFAULT NULL COMMENT '操作持续时间,冗余字段,单位 ms',
`trace_id` varchar(64) DEFAULT NULL COMMENT '调用链id',
`relation_id` varchar(64) DEFAULT NULL COMMENT '关联的调用链id/业务id',
`tenant_code` varchar(20) DEFAULT '' COMMENT '租户编码',
@@ -99,7 +99,7 @@ CREATE TABLE `log_operation` (
KEY `idx_trace_id` (`trace_id`),
KEY `idx_operation_time` (`operation_time`),
KEY `idx_user_id` (`user_id`),
KEY `idx_ip` (`ip`)
KEY `idx_terminal_address` (`terminal_address`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='业务日志';
/*Data for the table `log_operation` */

BIN
img/shoulder-platform.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 209 KiB

View File

@@ -2,15 +2,24 @@
- 对外网关
- api-gateway 开放 api 网关
> Oauth2 授权码模式access-token 认证凭证
- web-gateway web网关
> 非前后分离 用户名密码登录、Session 作为认证凭证
> 前后分离 Oauth2-授权码/密码模式认证、accessToken 作为认证凭证
- app-gateway app网关
> Oauth2-授权码/密码模式认证access-token 认证凭证
- h5-gateway 小程序网关
> Oauth2 简化模式,适合纯前端应用,且通信为 https
- 注:这些网关用于隔离内部细节,虽然是系统对外服务的门面,但一般也不会直接暴露于外部网络,而是位于 nginx 等代理服务器之后,系统服务之前。
- 对内网关
> Oauth2 客户端模式access-token 认证凭证
- biz-gateway 业务网关
- storage-gateway 对象存储,统一存储
- third-api-gateway 调用第三方接口过该网关,按照业务重要程度选择性单独部署
- 后台应用
-
i.

View File

@@ -21,10 +21,10 @@
<properties>
<shoulder.version>0.5</shoulder.version><!-- shoulder-version -->
<spring-boot.version>2.2.8.RELEASE</spring-boot.version>
<spring-cloud.version>Hoxton.SR6</spring-cloud.version>
<spring-cloud-alibaba.version>2.2.1.RELEASE</spring-cloud-alibaba.version>
<shoulder.version>0.6-SNAPSHOT</shoulder.version><!-- shoulder-version -->
<spring-boot.version>2.3.6.RELEASE</spring-boot.version>
<spring-cloud.version>Hoxton.SR9</spring-cloud.version>
<spring-cloud-alibaba.version>2.2.3.RELEASE</spring-cloud-alibaba.version>
</properties>
</project>

View File

@@ -15,10 +15,10 @@
<name>${project.artifactId}</name>
<properties>
<shoulder.version>0.5</shoulder.version><!-- shoulder-version -->
<spring-boot.version>2.2.8.RELEASE</spring-boot.version>
<spring-cloud.version>Hoxton.SR6</spring-cloud.version>
<spring-cloud-alibaba.version>2.2.1.RELEASE</spring-cloud-alibaba.version>
<shoulder.version>0.6-SNAPSHOT</shoulder.version><!-- shoulder-version -->
<spring-boot.version>2.3.6.RELEASE</spring-boot.version>
<spring-cloud.version>Hoxton.SR9</spring-cloud.version>
<spring-cloud-alibaba.version>2.2.3.RELEASE</spring-cloud-alibaba.version>
</properties>
<dependencies>

View File

@@ -5,7 +5,7 @@
<parent>
<groupId>cn.itlym</groupId>
<artifactId>shoulder-parent</artifactId>
<version>0.5</version><!-- shoulder-version -->
<version>0.6-SNAPSHOT</version><!-- shoulder-version -->
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -30,8 +30,8 @@
</modules>
<properties>
<shoulder.version>0.5</shoulder.version><!-- shoulder-version -->
<shoulder-platform.version>0.1-SNAPSHOT</shoulder-platform.version>
<shoulder.version>0.6-SNAPSHOT</shoulder.version><!-- shoulder-version -->
<shoulder-platform.version>1.0-SNAPSHOT</shoulder-platform.version>
</properties>
<dependencyManagement>

View File

@@ -5,7 +5,7 @@
<parent>
<groupId>cn.itlym</groupId>
<artifactId>shoulder-parent</artifactId>
<version>0.5</version><!-- shoulder-version -->
<version>0.6-SNAPSHOT</version><!-- shoulder-version -->
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -18,16 +18,17 @@
<properties>
<!-- =============== Shoulder 版本 =============== -->
<shoulder.version>0.5</shoulder.version><!-- shoulder-version -->
<shoulder.version>0.6-SNAPSHOT</shoulder.version><!-- shoulder-version -->
<shoulder-platform.version>1.0-SNAPSHOT</shoulder-platform.version><!-- shoulder-platform-version -->
<shoulder-sms-aliyun.version>1.0-SNAPSHOT</shoulder-sms-aliyun.version><!-- shoulder-sms-aliyun.version -->
<!-- =============== 第三方依赖版本 =============== -->
<!-- alibaba 2.2.3 -> cloud hoxton.SR8 -> boot 2.3.3.RELEASE -->
<!--spring-cloud-alibaba-dependencies 太久没更新与最新版nacos存在版本不兼容 bug无线循环同步且不能指定 nacos 版本使用如 1.3 等,这里统一手动管理 -->
<!--其中 1.3.1 支持了优雅下线方式-->
<spring-cloud-alibaba.version>2.2.1.RELEASE</spring-cloud-alibaba.version>
<spring-cloud-alibaba.version>2.2.3.RELEASE</spring-cloud-alibaba.version>
<nacos.client.version>1.3.2</nacos.client.version>
<!--spring-cloud-alibaba引入了 fastJson而低版本的 fastJson 太多安全漏洞,故这里统一设置为高版本-->
@@ -45,7 +46,7 @@
<maven-resources-plugin.version>3.2.0</maven-resources-plugin.version>
<dockerfile-maven-plugin.version>1.4.19</dockerfile-maven-plugin.version>
<docker.image.prefix>shoulder</docker.image.prefix>
<spring-boot-maven-plugin.version>2.2.8.RELEASE</spring-boot-maven-plugin.version><!-- spring-boot.version -->
<spring-boot-maven-plugin.version>2.3.6.RELEASE</spring-boot-maven-plugin.version><!-- spring-boot.version -->
</properties>
<name>${project.artifactId}</name>

View File

@@ -5,7 +5,7 @@
<parent>
<groupId>cn.itlym</groupId>
<artifactId>shoulder-parent</artifactId>
<version>0.5</version><!-- shoulder-version -->
<version>0.6-SNAPSHOT</version><!-- shoulder-version -->
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -7,6 +7,24 @@
![目录结构](img/projectAndModule.png)
## 认证流程
- 请求通过网关抵达网关网关根据认证凭证session/token判断该请求是否已经通过认证登陆过
- 未认证
- 非登录/注册相关请求
- (根据租户标识等)重定向到某个登录界面(如默认门户)
- 登录相关请求
- 转发给认证授权中心,处理请求
- 已经认证过
- 根据认证凭证向登录会话管理中心获取当前用户
- 获取到(凭证有效)
- 进行风控过滤
- 通过,将用户信息放置于请求头中,放行
- 未通过,风险识别、记录,执行预置策略,如返回特定信息
- 未获取到
- 认为凭证过期,重定向到 会话过期页面 或直接跳转到 登录页面
---
## 扩展