# 基于Spring Cloud的在线学院微服务项目
**Repository Path**: wuccloud/springcloud_onlineedu
## Basic Information
- **Project Name**: 基于Spring Cloud的在线学院微服务项目
- **Description**: 基于https://gitee.com/lisaqqqww/springcloud_replica.git,迭代!
基于SpringCloud微服务架构的在线教育平台,提供完整的在线教育解决方案,包括课程管理、讲师管理、文件上传、视频点播等功能。
- **Primary Language**: Unknown
- **License**: Not specified
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 1
- **Created**: 2025-07-16
- **Last Updated**: 2025-10-21
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# 🎓 SpringCloud在线教育平台
[](https://www.oracle.com/java/)
[](https://spring.io/projects/spring-boot)
[](https://spring.io/projects/spring-cloud)
[](https://mp.baomidou.com/)
[](LICENSE)
## 📋 项目简介
这是一个基于SpringCloud微服务架构的在线教育平台,提供完整的在线学习解决方案。平台采用前后端分离架构,支持课程管理、用户管理、订单支付、数据统计等核心功能。
## 🏗️ 系统架构
```mermaid
graph TB
subgraph "前端层"
A["🖥️ 管理后台
Vue + Element UI"]
B["📱 用户前台
Vue + Nuxt.js"]
end
subgraph "网关层"
C["🚪 API Gateway
Spring Cloud Gateway"]
end
subgraph "微服务层"
D["📚 教育服务
service-edu"]
E["👤 用户中心
service-ucenter"]
F["💰 订单服务
service-order"]
G["📊 统计服务
service-statistics"]
H["☁️ 文件服务
service-oss"]
I["🎬 视频服务
service-vod"]
J["📄 CMS服务
service-cms"]
end
subgraph "基础设施层"
K["🗄️ MySQL
数据存储"]
L["🔍 Nacos
服务注册发现"]
M["⚡ Redis
缓存"]
N["☁️ 阿里云OSS
文件存储"]
O["🎥 阿里云VOD
视频点播"]
end
A --> C
B --> C
C --> D
C --> E
C --> F
C --> G
C --> H
C --> I
C --> J
D --> K
E --> K
F --> K
G --> K
J --> K
D --> L
E --> L
F --> L
G --> L
H --> L
I --> L
J --> L
D --> M
E --> M
F --> M
H --> N
I --> O
```
## 🛠️ 技术栈
```mermaid
graph TB
subgraph "🎓 在线教育平台技术栈"
subgraph "后端技术"
A1["☕ Java 17+"]
A2["🍃 Spring Boot 3.0.13"]
A3["☁️ Spring Cloud Hoxton.SR1"]
A4["🚪 Spring Cloud Gateway"]
A5["🔍 Nacos"]
A6["🗄️ MyBatis Plus"]
A7["🔐 Spring Security"]
A8["📊 Swagger2"]
end
subgraph "前端技术"
B1["🖼️ Vue.js"]
B2["🎨 Element UI"]
B3["📱 Nuxt.js"]
B4["📦 Webpack"]
B5["🎯 Axios"]
end
subgraph "数据存储"
C1["🗄️ MySQL 8.0"]
C2["⚡ Redis"]
C3["☁️ 阿里云OSS"]
C4["🎥 阿里云VOD"]
end
subgraph "开发工具"
D1["🔧 Maven"]
D2["🐳 Docker"]
D3["📝 Git"]
D4["💡 IntelliJ IDEA"]
end
end
style A1 fill:#fff2cc
style A2 fill:#d5e8d4
style A3 fill:#dae8fc
style B1 fill:#e1d5e7
style C1 fill:#f8cecc
style D1 fill:#fff2cc
```
## 📁 项目结构
```
springcloud_onlineedu/
├── 📁 common/ # 公共模块
│ ├── 📁 common_utils/ # 通用工具类
│ └── 📁 service_base/ # 服务基础配置
├── 📁 gateway/ # API网关
├── 📁 service/ # 微服务模块
│ ├── 📁 service_edu/ # 📚 教育服务
│ ├── 📁 service_ucenter/ # 👤 用户中心
│ ├── 📁 service_order/ # 💰 订单服务
│ ├── 📁 service_statistics/ # 📊 统计服务
│ ├── 📁 service_oss/ # ☁️ 文件服务
│ ├── 📁 service_vod/ # 🎬 视频服务
│ └── 📁 service_cms/ # 📄 CMS服务
└── 📄 pom.xml # Maven父项目配置
```
## 🚀 核心功能
### 📚 教育管理模块
- ✅ 课程分类管理
- ✅ 课程信息管理
- ✅ 章节管理
- ✅ 视频管理
- ✅ 讲师管理
### 👤 用户管理模块
- ✅ 用户注册登录
- ✅ 用户信息管理
- ✅ 权限控制
- ✅ JWT认证
### 💰 订单支付模块
- ✅ 订单生成
- ✅ 支付宝支付
- ✅ 微信支付
- ✅ 订单状态管理
### 📊 数据统计模块
- ✅ 注册人数统计
- ✅ 课程销量统计
- ✅ 收入统计
- ✅ 图表展示
## 🔄 业务流程
```mermaid
sequenceDiagram
participant U as 👤 用户
participant G as 🚪 网关
participant A as 🔐 认证服务
participant E as 📚 教育服务
participant O as 💰 订单服务
participant P as 💳 支付服务
U->>G: 1. 用户登录
G->>A: 2. 验证用户信息
A-->>G: 3. 返回JWT Token
G-->>U: 4. 登录成功
U->>G: 5. 浏览课程
G->>E: 6. 获取课程列表
E-->>G: 7. 返回课程信息
G-->>U: 8. 展示课程
U->>G: 9. 购买课程
G->>O: 10. 创建订单
O->>P: 11. 发起支付
P-->>O: 12. 支付结果
O-->>G: 13. 订单状态
G-->>U: 14. 购买完成
```
## 🏃♂️ 快速开始
### 📋 环境要求
- ☕ JDK 17+
- 🔧 Maven 3.6+
- 🗄️ MySQL 8.0+
- ⚡ Redis 6.0+
- 🔍 Nacos 2.3.15+
### 🛠️ 安装步骤
1. **克隆项目**
```bash
git clone https://gitee.com/lisaqqqww/springcloud_onlineedu.git
cd springcloud_onlineedu
```
2. **配置数据库**
```sql
-- 创建数据库
CREATE DATABASE online_edu DEFAULT CHARACTER SET utf8mb4;
-- 导入SQL文件
source sql/online_edu.sql;
```
3. **启动Nacos**
```bash
# 下载Nacos
wget https://github.com/alibaba/nacos/releases/download/2.3.15/nacos-server-2.3.15.tar.gz
# 解压并启动
tar -xzf nacos-server-2.3.15.tar.gz
cd nacos/bin
./startup.sh -m standalone
```
4. **启动Redis**
```bash
redis-server
```
5. **编译项目**
```bash
mvn clean compile
```
6. **启动服务**
```bash
# 按顺序启动各个服务
# 1. 启动网关
cd gateway && mvn spring-boot:run
# 2. 启动教育服务
cd service/service_edu && mvn spring-boot:run
# 3. 启动其他服务...
```
## 🔧 配置说明
### 🔍 Nacos配置
```yaml
# application.yml
spring:
cloud:
nacos:
discovery:
server-addr: localhost:8848
config:
server-addr: localhost:8848
file-extension: yml
```
### 🗄️ 数据库配置
```yaml
# application.yml
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/online_edu?serverTimezone=GMT%2B8
username: root
password: your_password
```
## 📊 服务端口
```mermaid
graph LR
A["🚪 Gateway
:10010"] --> B["📚 Edu Service
:8001"]
A --> C["👤 Ucenter Service
:8006"]
A --> D["💰 Order Service
:8007"]
A --> E["📊 Statistics Service
:8008"]
A --> F["☁️ OSS Service
:8002"]
A --> G["🎬 VOD Service
:8003"]
A --> H["📄 CMS Service
:8004"]
style A fill:#e1f5fe
style B fill:#f3e5f5
style C fill:#e8f5e8
style D fill:#fff3e0
style E fill:#fce4ec
style F fill:#e0f2f1
style G fill:#f1f8e9
style H fill:#fff8e1
```
## 🔐 API文档
项目集成了Swagger2,启动服务后可访问API文档:
- 📚 教育服务API: http://localhost:8001/swagger-ui.html
- 👤 用户中心API: http://localhost:8006/swagger-ui.html
- 💰 订单服务API: http://localhost:8007/swagger-ui.html
## 🧪 测试
```bash
# 运行单元测试
mvn test
# 运行集成测试
mvn verify
# 生成测试报告
mvn surefire-report:report
```
## 📦 部署(未上传)
### 🐳 Docker部署
```dockerfile
# Dockerfile示例
FROM openjdk:17-jre-alpine
VOLUME /tmp
COPY target/*.jar app.jar
EXPOSE 8001
ENTRYPOINT ["java","-jar","/app.jar"]
```
```bash
# 构建镜像
docker build -t online-edu:latest .
# 运行容器
docker run -d -p 8001:8001 online-edu:latest
```
### ☁️ 云部署流程
```mermaid
flowchart TD
A["📝 代码提交"] --> B["🔨 Maven构建"]
B --> C["🧪 自动化测试"]
C --> D{"✅ 测试通过?"}
D -->|是| E["🐳 Docker构建"]
D -->|否| F["❌ 构建失败"]
E --> G["📤 推送镜像"]
G --> H["🚀 部署到测试环境"]
H --> I["🔍 环境验证"]
I --> J{"✅ 验证通过?"}
J -->|是| K["🌟 部署到生产环境"]
J -->|否| L["🔄 回滚"]
K --> M["📊 监控告警"]
style A fill:#e3f2fd
style K fill:#e8f5e8
style F fill:#ffebee
style L fill:#fff3e0
```
## 📈 性能监控
```mermaid
graph TB
subgraph "监控体系"
A["📊 应用监控
Spring Boot Actuator"]
B["🔍 链路追踪
Sleuth + Zipkin"]
C["📈 指标收集
Micrometer"]
D["🚨 告警通知
钉钉/邮件"]
end
subgraph "监控指标"
E["⚡ 响应时间"]
F["🔢 QPS/TPS"]
G["💾 内存使用"]
H["💿 磁盘IO"]
I["🌐 网络流量"]
J["❌ 错误率"]
end
A --> E
A --> F
B --> G
C --> H
C --> I
D --> J
```
## 🤝 贡献指南
1. 🍴 Fork 项目
2. 🌿 创建特性分支 (`git checkout -b feature/AmazingFeature`)
3. 💾 提交更改 (`git commit -m 'Add some AmazingFeature'`)
4. 📤 推送到分支 (`git push origin feature/AmazingFeature`)
5. 🔀 创建 Pull Request
## 👥 团队
- 🧑💻 **项目负责人**: [困得睡不醒]
- 📧 **联系邮箱**: 2821105997@qq.com
- 🌐 **项目主页**: https://gitee.com/lisaqqqww/springcloud_onlineedu
- 🌐 **友情链接**: https://gitee.com/lisaqqqww/5201314.git
## 🙏 致谢
感谢以下开源项目的支持:
- [Spring Boot](https://spring.io/projects/spring-boot)
- [Spring Cloud](https://spring.io/projects/spring-cloud)
- [MyBatis Plus](https://mp.baomidou.com/)
- [Vue.js](https://vuejs.org/)
- [Element UI](https://element.eleme.io/)
---
如果这个项目对你有帮助,请给个 ⭐ Star 支持一下!