Sfoglia il codice sorgente

feat:添加消息中心设计文档

荭琪枫 2 anni fa
parent
commit
86b4f05ada
1 ha cambiato i file con 15 aggiunte e 33 eliminazioni
  1. 15 33
      iot-common/iot-message-notify/消息中心文档.md

+ 15 - 33
iot-common/iot-message-notify/messageCenter.md → iot-common/iot-message-notify/消息中心文档.md

@@ -1,9 +1,21 @@
 # 消息中心
 
-## 数据库设计
-
-### 通道类型配置
 
+## 用户通道配置
+1. 用户通过接口获取系统已经支持的通道列表
+2. 选择某个通道配置对应的参数
+   1. 企业微信:先添加消息机器人 再获取token
+   2. 飞书:先添加消息机器人 再获取token
+   3. 邮箱:配置host 发件人 收件人
+3. 保存通道配置
+4. 通过接口启用通道
+   1. 修改已经保存的通道的状态为启用
+   2. 订阅已经启用的通道 
+## 设备发送消息
+1. 消息中心接收消息
+2. 根据设备deviceId获取设备归属人userId
+3. 根据归属人userId获取已经订阅的通道 
+## SQL
 ~~~mysql
 CREATE TABLE channel_type
 (
@@ -45,34 +57,4 @@ CREATE TABLE message
     createTime timestamp DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
     updateTime timestamp DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间'
 ) COMMENT '消息';
-
-
-
-
 ~~~
-
-### 通道类型配置
-
-~~~mysql
-CREATE TABLE channel
-(
-    id          bigint PRIMARY KEY AUTO_INCREMENT COMMENT 'ID',
-    title       varchar(128) COMMENT '类型',
-    configParam text COMMENT '配置参数',
-    createTime  datetime COMMENT '创建时间',
-    updateTime  datetime COMMENT '修改时间'
-) COMMENT '渠道';
-~~~
-
-### 通道订阅
-
-~~~mysql
-CREATE TABLE channel_subscribe
-(
-    id         bigint PRIMARY KEY AUTO_INCREMENT COMMENT 'ID',
-    channelId  bigint COMMENT '通道',
-    userId     bigint COMMENT '用户ID',
-    createTime datetime COMMENT '创建时间',
-    updateTime datetime COMMENT '修改时间'
-) COMMENT '渠道';
-~~~