Skip to content

后端开发 ​

环境搭建 ​

1. 克隆源码 ​

bash
git clone https://gitee.com/beecue/fastbee.git

2. 导入 IDEA ​

使用 IntelliJ IDEA 打开 springboot 目录,等待 Maven 依赖下载完成。

3. 数据库初始化 ​

bash
mysql -uroot -p -e "CREATE DATABASE fastbee DEFAULT CHARSET utf8 COLLATE utf8_unicode_ci;"
mysql -uroot -p fastbee < sql/fastbee.sql

4. 修改配置 ​

编辑 fastbee-admin/src/main/resources/application-druid.yml。

yaml
spring:
  datasource:
    druid:
      master:
        url: jdbc:mysql://localhost:3306/fastbee?...
        username: root
        password: your_password
  redis:
    host: localhost
    port: 6379
    password: your_password

5. 启动 ​

运行 FastbeeApplication.main() 方法。

模块说明 ​

模块职责
fastbee-admin启动入口,配置文件
fastbee-common工具类、常量、异常、实体基类
fastbee-frameworkSpring Security 集成、JWT 认证、若依框架
fastbee-open-api37 个 REST Controller
fastbee-serviceIoT 和系统业务 Service 层
fastbee-serverNetty MQTT Broker + SIP Server
fastbee-protocol协议编解码
fastbee-plugs扩展插件

API 控制器层 ​

fastbee-open-api 模块包含以下 API 控制器:

类别Controller说明
IoTProductController产品管理
IoTDeviceController设备管理
IoTThingsModelController物模型
IoTSceneController场景联动
IoTScriptController规则脚本
IoTGroupController设备分组
视频SipDeviceControllerSIP 设备
视频PlayerController视频播放
视频PtzController云台控制
系统DashBoardController仪表盘
系统DataCenterController数据中心

扩展开发 ​

添加新接口 ​

  1. 在 fastbee-open-api 中创建 Controller
  2. 在 fastbee-service 中创建 Service 和 Mapper
  3. 添加对应的 SQL 和数据库表

添加新协议 ​

  1. 在 fastbee-protocol 中实现协议编解码
  2. 在 fastbee-server 中注册协议处理器

蜂信物联 | fastbee.cn