refactor: 抽离企业级微服务脚手架

- 删除业务特定模块(device-center, order-center, coupon-center, msg-center)
- 保留核心通用模块(user-center, file-center, search-center, code-generator)
- 创建 demo-center 示例模块
- 清理业务特定文档和前端项目
- 创建数据库初始化脚本
- 更新 README 和快速开始文档
- 保留所有 zlt-commons 公共组件库
This commit is contained in:
2026-03-07 18:41:49 +08:00
parent c6dfad912d
commit 74d99e6b60
1879 changed files with 605 additions and 293419 deletions
+108 -32
View File
@@ -1,47 +1,123 @@
# Central Platform - 企业级微服务脚手架
[![Java](https://img.shields.io/badge/Java-17-orange.svg)](https://www.oracle.com/java/)
[![Spring Boot](https://img.shields.io/badge/Spring%20Boot-3.1.6-brightgreen.svg)](https://spring.io/projects/spring-boot)
[![Spring Cloud](https://img.shields.io/badge/Spring%20Cloud-2022.0.4-blue.svg)](https://spring.io/projects/spring-cloud)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0)
## 项目简介
Central Platform 是一个基于 Spring Cloud 的企业级微服务脚手架,提供完整的微服务基础设施和通用业务模块,帮助快速构建企业级应用。
### 核心特性
- ✅ **微服务架构** - 基于 Spring Cloud 2022.0.4
- ✅ **服务治理** - Nacos 服务注册发现与配置中心
- ✅ **API 网关** - Spring Cloud Gateway + Sentinel 限流熔断
- ✅ **认证授权** - OAuth2 + JWT + Spring Security
- ✅ **多租户支持** - 完整的多租户数据隔离方案
- ✅ **分布式缓存** - Redis + Redisson 分布式锁
- ✅ **数据库** - MyBatis Plus + 多数据源
- ✅ **全文搜索** - Elasticsearch 集成
- ✅ **文件存储** - 多云存储支持(阿里云OSS、七牛云、MinIO)
- ✅ **监控中心** - Spring Boot Admin 应用监控
- ✅ **代码生成** - 基于数据库表的代码生成器
## 技术栈
| 技术 | 版本 | 说明 |
|------|------|------|
| Java | 17 | 编程语言 |
| Spring Boot | 3.1.6 | 应用框架 |
| Spring Cloud | 2022.0.4 | 微服务框架 |
| Spring Cloud Alibaba | 2022.0.0.0 | 阿里云组件 |
| MyBatis Plus | 3.5.4.1 | ORM 框架 |
| MySQL | 8.0+ | 关系数据库 |
| Redis | 7.0+ | 缓存数据库 |
| Elasticsearch | 7.13.4 | 搜索引擎 |
| Nacos | Latest | 注册中心/配置中心 |
| Sentinel | Latest | 限流熔断 |
## 模块说明
## 5. 模块说明
```lua
central-platform -- 父项目,公共依赖
│ ├─zlt-business -- 业务模块一级工程
│ │ ├─user-center -- 用户中心[7000]
│ │ ├─file-center -- 文件中心[5000]
│ │ ├─code-generator -- 代码生成器[7300]
│ │ ├─search-center -- 搜索中心
│ │ │ ├─search-client -- 搜索中心客户端
│ │ │ ├─search-server -- 搜索中心服务端[7100]
│ │─zlt-commons -- 通用工具一级工程
│ │ ├─zlt-auth-client-spring-boot-starter -- 封装spring security client端的通用操作逻辑
│ │ ├─zlt-common-core -- 封装通用操作逻辑
│ │ ├─zlt-common-spring-boot-starter -- 封装通用操作逻辑
│ │ ├─zlt-db-spring-boot-starter -- 封装数据库通用操作逻辑
│ │ ├─zlt-log-spring-boot-starter -- 封装log通用操作逻辑
│ │ ├─zlt-redis-spring-boot-starter -- 封装Redis通用操作逻辑
│ │ ├─zlt-loadbalancer-spring-boot-starter -- 封装Loadbalancer和Feign的通用操作逻辑
│ │ ├─zlt-sentinel-spring-boot-starter -- 封装Sentinel的通用操作逻辑
│ │ ├─zlt-elasticsearch-spring-boot-starter -- 封装Elasticsearch通用操作逻辑
│ │ ├─zlt-oss-spring-boot-starter -- 封装对象存储通用操作逻辑
│ │ ├─zlt-zookeeper-spring-boot-starter -- 封装Zookeeper通用操作逻辑
│ │ ├─code-generator -- 代码生成器[7300]
│ │ └─demo-center -- 示例模块[8100]
│ ├─zlt-commons -- 通用工具一级工程
│ │ ├─zlt-common-core -- 核心工具类
│ │ ├─zlt-common-spring-boot-starter -- 通用配置
│ │ ├─zlt-db-spring-boot-starter -- 数据库集成
│ │ ├─zlt-redis-spring-boot-starter -- Redis集成
│ │ ├─zlt-log-spring-boot-starter -- 日志集成
│ │ ├─zlt-auth-client-spring-boot-starter -- 认证客户端
│ │ ├─zlt-loadbalancer-spring-boot-starter -- 负载均衡
│ │ ├─zlt-sentinel-spring-boot-starter -- 限流熔断
│ │ ├─zlt-elasticsearch-spring-boot-starter -- 搜索引擎
│ │ ├─zlt-oss-spring-boot-starter -- 对象存储
│ │ ├─zlt-sms-spring-boot-starter -- 短信集成
│ │ ├─zlt-zookeeper-spring-boot-starter -- Zookeeper集成
│ │ ├─zlt-wechat-common-core -- 微信通用核心
│ │ └─zlt-wechat-spring-boot-starter -- 微信集成
│ ├─zlt-gateway -- API网关[9900]
│ ├─zlt-uaa -- 认证授权中心[8000]
│ ├─zlt-config -- 配置中心
│ ├─zlt-doc -- 项目文档
│ ├─zlt-gateway -- api网关一级工程
│ │ ├─sc-gateway -- spring-cloud-gateway[9900]
│ ├─zlt-monitor -- 监控一级工程
│ ├─zlt-monitor -- 监控中心
│ │ ├─sc-admin -- 应用监控[6500]
│ │ ├─log-center -- 日志中心[7200]
│ ├─zlt-uaa -- spring-security认证中心[8000]
│ ├─zlt-register -- 注册中心Nacos[8848]
│ ├─zlt-web -- 前端一级工程
│ │ ├─layui-web -- layui前端[8066]
│ │ ├─react-web -- react前端[8066]
│ ├─zlt-demo -- demo一级工程
│ │ ├─dubbo-demo -- dubbo服务demo
│ │ ├─resource-server-demo -- 资源服务器demo
│ │ ├─seata-demo -- seata分布式事务demo
│ │ ├─sharding-jdbc-demo -- sharding-jdbc分库分表demo
│ │ ├─rocketmq-demo -- rocketmq和mq事务demo
│ │ ├─sso-demo -- 单点登录demo
│ │ ├─websocket-demo -- websocket demo
│ │ └─log-center -- 日志中心[7200]
│ └─zlt-doc -- 项目文档
└─database -- 数据库脚本
```
## 快速开始
### 环境要求
- JDK 17+
- Maven 3.6+
- MySQL 8.0+
- Redis 7.0+
- Nacos 2.0+
### 数据库初始化
```bash
mysql -u root -p < zlt-doc/database/init.sql
```
### 启动 Nacos
```bash
# 单机模式启动
sh nacos/bin/startup.sh -m standalone
```
访问: http://localhost:8848/nacos (账号: nacos/nacos)
### 编译项目
```bash
mvn clean install -DskipTests
```
### 启动服务
1. 启动网关 (9900)
2. 启动认证中心 (8000)
3. 启动用户中心 (7000)
4. 启动文件中心 (5000)
### 默认账号
- 用户名: `admin`
- 密码: `admin123`
## 许可证
Apache License 2.0