YunParking智慧停车
一、部署前置准备
1.1 环境要求
根据开源版本 README 标注:
| 组件 | 版本要求 |
|---|---|
| JDK | 1.8 |
| MySQL | 5.7+ |
| Redis | 5.0+ |
| RabbitMQ | 3.x |
| Maven | 3.6+ |
| IDE | IntelliJ IDEA(需安装 Lombok 插件) |
1.2 获取源码
# GitHub
git clone https://github.com/yuncitys/YunParking.git
# Gitee(国内推荐)
git clone https://gitee.com/yuncitys/YunParking.git1.3 项目结构概览
开源版本包含以下核心模块:
YunParking/
├─ DB/ # 数据库文件
├─ smart-auth/ # 认证服务
├─ smart-base/ # 基础模块
├─ smart-center/ # 注册中心
├─ smart-config/ # 配置中心
├─ smart-control/ # 监控管理
├─ smart-gate/ # 网关
├─ smart-job/ # 任务调度
├─ smart-modules/ # 停车业务
│ ├─ smart-admin/ # 运营后台管理
│ ├─ smart-app/ # 巡查APP服务
│ ├─ smart-charge-server/ # 计费规则服务
│ ├─ smart-dev-manage/ # 设备管理服务
│ ├─ smart-dict/ # 数据字典服务
│ ├─ smart-interface/ # 数据接口服务
│ ├─ smart-mqtt-common/ # MQTT设备数据订阅
│ ├─ smart-parking/ # 路内外停车服务
│ ├─ smart-pay/ # 支付中心服务
│ └─ smart-tool/ # 第三方存储/短信二、基础设施准备
2.1 启动 MySQL
创建数据库并导入 DB/ 目录下的 SQL 文件:
CREATE DATABASE yunparking CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;mysql -u root -p yunparking < DB/yunparking.sql2.2 启动 Redis
redis-server2.3 启动 RabbitMQ
rabbitmq-server2.4 验证中间件
redis-cli ping # 应返回 PONG
rabbitmqctl status # 确认服务运行三、编译与启动
3.1 安装公共模块到本地仓库
部分模块之间有依赖关系,需先安装基础模块:
cd smart-base
mvn clean install -DskipTests
cd ../smart-auth
mvn clean install -DskipTests3.2 配置数据库连接
在各业务模块的 application.yml 或 bootstrap.yml 中修改数据库连接:
spring:
datasource:
url: jdbc:mysql://localhost:3306/yunparking?useUnicode=true&characterEncoding=utf8
username: root
password: your_password
redis:
host: localhost
port: 6379
rabbitmq:
host: localhost
port: 5672
username: guest
password: guest3.3 启动顺序
微服务需要按依赖关系依次启动:
- smart-center(注册中心)→ 先启动
- smart-config(配置中心)→ 后启动
- smart-gate(网关)
- smart-auth(认证服务)
- smart-admin(运营后台)
- smart-parking(停车服务)
- smart-pay(支付中心)
- 其余模块按需启动
3.4 验证服务注册
访问注册中心控制台(默认通常为 http://localhost:8848 或项目配置的端口),确认各服务已注册。
四、常见问题
编译报错找不到 Lombok:IDEA 需安装 Lombok 插件,并在设置中开启 Annotation Processing。
服务无法注册到 Nacos:检查 Nacos 地址配置是否正确,确认 Nacos 服务已启动。部分开源版本可能使用 Eureka,需根据实际配置调整。
数据库连接失败:确认 MySQL 服务运行中,JDBC URL 中的数据库名与实际创建的一致,用户权限已授予。
MQTT 设备数据无法订阅:检查 RabbitMQ 运行状态,确认 MQTT 插件已启用(rabbitmq-plugins enable rabbitmq_mqtt)。
五、部署建议
开源版仅用于学习:官方明确标注开源部分为 7 年前老版本代码,功能完整度和稳定性与当前商业版差距巨大。生产环境请勿直接使用开源版部署。
商业版需联系官方:如需部署生产环境,建议联系深圳市云创智城科技有限公司获取商业版授权。交付形式包括 SaaS 租用、私有化镜像版(非源码)、单项目源码授权、城市级全源码授权等。
关注硬件接入:系统的核心价值在于与地磁、道闸、充电桩等硬件的联动。部署前需确认目标硬件的协议兼容性,或联系官方获取设备接入方案。