docs: Update project documentation
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,34 @@
|
||||
# video-common模块实现步骤和代码
|
||||
|
||||
基于Spring Boot 3.2.4、Spring Cloud 2023.0.1和Spring Cloud Alibaba 2023.0.1.0技术栈,完整实现video-common模块。
|
||||
|
||||
## 目录结构设计
|
||||
|
||||
首先,创建以下目录结构:
|
||||
|
||||
```
|
||||
video-common/
|
||||
├── src/
|
||||
│ ├── main/
|
||||
│ │ ├── java/
|
||||
│ │ │ └── com/
|
||||
│ │ │ └── nuaa/
|
||||
│ │ │ └── video/
|
||||
│ │ │ └── common/
|
||||
│ │ │ ├── annotation/ # 自定义注解
|
||||
│ │ │ ├── config/ # 配置类
|
||||
│ │ │ ├── constants/ # 常量定义
|
||||
│ │ │ ├── exception/ # 异常处理
|
||||
│ │ │ ├── model/ # 通用数据模型
|
||||
│ │ │ │ ├── dto/ # 数据传输对象
|
||||
│ │ │ │ ├── entity/ # 实体类
|
||||
│ │ │ │ ├── enums/ # 枚举类
|
||||
│ │ │ │ └── vo/ # 视图对象
|
||||
│ │ │ ├── utils/ # 工具类
|
||||
│ │ │ └── feign/ # Feign接口
|
||||
│ │ └── resources/
|
||||
│ │ └── META-INF/
|
||||
│ │ └── spring.factories # 自动配置
|
||||
│ └── test/
|
||||
└── pom.xml
|
||||
```
|
||||
@@ -0,0 +1,38 @@
|
||||
# video-gateway模块实现步骤和代码
|
||||
|
||||
API网关模块(video-gateway)实现,这是微服务架构中的入口点,负责请求路由、限流、鉴权等功能。
|
||||
|
||||
## 目录结构设计
|
||||
|
||||
为video-gateway模块创建以下目录结构:
|
||||
|
||||
```
|
||||
video-gateway/
|
||||
├── src/
|
||||
│ ├── main/
|
||||
│ │ ├── java/
|
||||
│ │ │ └── com/
|
||||
│ │ │ └── nuaa/
|
||||
│ │ │ └── video/
|
||||
│ │ │ └── gateway/
|
||||
│ │ │ ├── config/ # 配置类
|
||||
│ │ │ ├── filter/ # 过滤器
|
||||
│ │ │ ├── handler/ # 处理器
|
||||
│ │ │ └── GatewayApplication.java # 启动类
|
||||
│ │ └── resources/
|
||||
│ │ ├── application.yml # 主配置文件
|
||||
│ │ └── application-dev.yml # 开发环境配置
|
||||
└── pom.xml
|
||||
```
|
||||
|
||||
gateway模块具备以下功能:
|
||||
|
||||
1. 基于Spring Cloud Gateway的路由功能
|
||||
2. JWT认证鉴权
|
||||
3. 基于Sentinel的流量控制和服务熔断
|
||||
4. CORS跨域支持
|
||||
5. 请求日志记录
|
||||
6. 全局异常处理
|
||||
7. 动态路由配置
|
||||
|
||||
这个网关将作为整个微服务架构的入口点,为各个微服务提供统一的API访问层。
|
||||
Reference in New Issue
Block a user