diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index 1d7c1f6..556304a 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -52,6 +52,18 @@ module.exports = { '/wiki/back-build/' ] // 根据自己的需求来订,对应自己在docs下的文件夹名,默认首页是README.md }, + // { + // title: '模块介绍', + // collapsable: false, + // children: [ + // '/module/', + // '/module/gateway/', + // '/module/auth/', + // '/module/umps/', + // '/module/common/', + // '/module/visual/', + // ] // 根据自己的需求来订,对应自己在docs下的文件夹名,默认首页是README.md + // }, { title: 'CI/CD', collapsable: false, diff --git a/docs/module/README.md b/docs/module/README.md new file mode 100644 index 0000000..42c38a4 --- /dev/null +++ b/docs/module/README.md @@ -0,0 +1,21 @@ +# 模块信息 + +> 以下是security-cloud所以模块,本章节将对其中的每一个模块进行详细的介绍。 +```lua +security-cloud +├── auth -- 授权服务模块 +├── gateway -- 网关服务模块 +└── common -- 系统公共模块 + ├── common-core -- 公共工具类核心包 + ├── common-mybatis -- mybatis 扩展封装 + ├── common-security -- 安全工具类 + ├── common-swagger -- 接口文档 + ├── common-feign -- feign 扩展封装 + └── common-log -- 系统日志记录 +└── upms -- 通用用户权限管理模块 + └── upms-api -- 通用用户权限管理系统公共api模块 + └── upms-biz -- 通用用户权限管理系统业务处理模块[4000] +└── visual -- 图形化管理模块 + └── monitor -- 服务监控 + └── codegen -- 图形化代码生成 +``` diff --git a/docs/module/auth/README.md b/docs/module/auth/README.md new file mode 100644 index 0000000..23487ad --- /dev/null +++ b/docs/module/auth/README.md @@ -0,0 +1 @@ +# 授权服务模块 diff --git a/docs/module/common/README.md b/docs/module/common/README.md new file mode 100644 index 0000000..b76ecb2 --- /dev/null +++ b/docs/module/common/README.md @@ -0,0 +1 @@ +# 系统公共模块 diff --git a/docs/module/gateway/README.md b/docs/module/gateway/README.md new file mode 100644 index 0000000..909247e --- /dev/null +++ b/docs/module/gateway/README.md @@ -0,0 +1,10 @@ +# 网关服务模块 +security-cloud使用spring官方的网关主键,spring gateway。 + +## 路由配置 + + + + + + diff --git a/docs/module/gateway/README111.md b/docs/module/gateway/README111.md new file mode 100644 index 0000000..bcbfb35 --- /dev/null +++ b/docs/module/gateway/README111.md @@ -0,0 +1,86 @@ +# 网关服务模块 +在集群环境中,gateway将会是集群网络的唯一出入口,是系统安全的重要节点,同时gateway承担Sentinel限流,服务分发负载均衡和提供swagger文档等工作。 + +## 文件结构 +```lua +gateway + +└── java + ├── config -- 配置包 + ├── controller -- swagger聚合需要使用的到的接口 + ├── filter -- 全局过滤器 + ├── handler -- 异常处理 + ├── util -- 工具 + └── GatewayApplication.java -- 启动类 +└── resources + ├── bootstrap.yml -- 配置文件 + └── logback-spring.xml -- 日志记录文件 +``` + +## 配置文件 +```yaml +# Tomcat +server: + port: 5000 + +# Spring +spring: + application: + # 应用名称 + name: monitor + profiles: + # 环境配置 + active: local + security: + user: + name: root + password: password + cloud: + nacos: + discovery: + # 服务注册地址 + server-addr: 192.168.101.108:8848 + username: nacos + password: nacos + namespace: ${spring.profiles.active} + metadata: + management: + context-path: /actuator + config: + # 配置中心地址 + server-addr: ${spring.cloud.nacos.discovery.server-addr} + file-extension: yaml + namespace: ${spring.profiles.active} + shared-configs: + - ${spring.application.name}-${spring.profiles.active}.yml +``` +配置文件相当简洁,主要为设置运行端口,active的环境以及注册到nacos,并从nacos读取到gateway自身的配置文件 + +属于gateway的配置文件: + +```yaml +spring: + cloud: + gateway: + discovery: + locator: + # gateway 能够进行服务发现 + enabled: true + routes: + # 认证中心 + - id: auth + uri: lb://auth + predicates: + - Path=/auth/** +``` + +## 路由分发 +路由分发是gateway的一个重要功能,当gateway启动后会向nacos发起注册,并从nacos cconfig中心获取到gateway的那一份配置文件,gateway再将文件加载到自己的路由中,当又接口请求到后,gateway则可以根据路由表对请求进行分发。 + +gateway中配置了全局路由器,对 + + + + + + diff --git a/docs/module/umps/README.md b/docs/module/umps/README.md new file mode 100644 index 0000000..b4a67c0 --- /dev/null +++ b/docs/module/umps/README.md @@ -0,0 +1 @@ +# 通用用户权限管理模块 diff --git a/docs/module/visual/README.md b/docs/module/visual/README.md new file mode 100644 index 0000000..8f8a08f --- /dev/null +++ b/docs/module/visual/README.md @@ -0,0 +1 @@ +# 图形化管理模块