通过接口启用通道
订阅已经启用的通道
消息中心接收消息
根据设备deviceId获取设备归属人userId
根据归属人userId获取已经订阅的通道
CREATE TABLE channel_type
(
id bigint PRIMARY KEY AUTO_INCREMENT COMMENT 'ID',
title varchar(128) NOT NULL COMMENT '标题',
createTime timestamp DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
updateTime timestamp DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间'
) COMMENT '通道类型';
INSERT INTO channel_type(title, createTime, updateTime)
VALUES ('邮箱', current_timestamp(), current_timestamp());
INSERT INTO channel_type(title, createTime, updateTime)
VALUES ('飞书', current_timestamp(), current_timestamp());
INSERT INTO channel_type(title, createTime, updateTime)
VALUES ('短信', current_timestamp(), current_timestamp());
INSERT INTO channel_type(title, createTime, updateTime)
VALUES ('钉钉', current_timestamp(), current_timestamp());
INSERT INTO channel_type(title, createTime, updateTime)
VALUES ('企业微信', current_timestamp(), current_timestamp());
CREATE TABLE channel
(
id bigint PRIMARY KEY AUTO_INCREMENT COMMENT 'ID',
title varchar(128) COMMENT '标题',
channelType bigint NOT NULL COMMENT '渠道类型',
configParam text NOT NULL COMMENT '配置参数',
userId bigint COMMENT '配置归属',
createTime timestamp DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
updateTime timestamp DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间'
) COMMENT '通道';
CREATE TABLE message
(
id bigint PRIMARY KEY AUTO_INCREMENT COMMENT 'ID',
mac varchar(128) COMMENT '设备MAC',
deviceId varchar(128) COMMENT '设备ID',
content text NOT NULL COMMENT '消息内容',
createTime timestamp DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
updateTime timestamp DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间'
) COMMENT '消息';