ZimPlatfProject/docs/z_im-mysql.sql
2025-06-21 13:41:52 +08:00

84 lines
5.0 KiB
SQL
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

CREATE TABLE `appinfo` (
`appid` varchar(64) NOT NULL DEFAULT '' COMMENT '[平台标识]',
`appname` varchar(64) NOT NULL DEFAULT '' COMMENT '[平台名称]',
`appsecret` varchar(64) NOT NULL DEFAULT '' COMMENT '[校验码]',
`createtime` bigint NOT NULL DEFAULT '0' COMMENT '[创建时间]',
`updatetime` bigint NOT NULL DEFAULT '0' COMMENT '[修改时间]',
`status` smallint NOT NULL DEFAULT '10' COMMENT '[状态]10正常, 40停用80删除',
`checkfriend` smallint NOT NULL DEFAULT '0' COMMENT '[是否检查好友关系1是0否]',
`checkblack` smallint NOT NULL DEFAULT '0' COMMENT '[是否检查拉黑关系1是0否]',
`machineretract` smallint NOT NULL DEFAULT '0' COMMENT '[是否需要机审撤回处理1是0否]',
`hasnext` smallint NOT NULL DEFAULT '0' COMMENT '[是否有下一步流程1是0否]',
PRIMARY KEY (`appid`)
) ENGINE=InnoDB COMMENT='平台信息表';
CREATE TABLE `channelmessage` (
`messageid` varchar(64) NOT NULL DEFAULT '' COMMENT '[消息ID]',
`content` text NOT NULL COMMENT '[消息内容]',
`appid` varchar(8) NOT NULL DEFAULT '' COMMENT '[平台ID]',
`channeltype` varchar(15) NOT NULL DEFAULT '' COMMENT '[平台频道类型]',
`channelvalue` varchar(64) NOT NULL DEFAULT '' COMMENT '[平台频道ID]',
`senduserid` int NOT NULL DEFAULT '0' COMMENT '[发送人]',
`createtime` bigint NOT NULL DEFAULT '0' COMMENT '[创建时间]',
`status` smallint NOT NULL DEFAULT '10' COMMENT '[状态]80删除',
`type` varchar(255) NOT NULL DEFAULT '' COMMENT '[消息类型]',
`title` varchar(255) NOT NULL DEFAULT '' COMMENT '[消息标题]',
`attachment` varchar(2048) NOT NULL DEFAULT '' COMMENT '[消息附加信息]',
PRIMARY KEY (`messageid`) USING BTREE
) ENGINE=InnoDB COMMENT='频道内容表';
CREATE TABLE `channeluser` (
`cuid` varchar(64) NOT NULL DEFAULT '' COMMENT '[用户组ID]',
`appid` varchar(64) NOT NULL DEFAULT '' COMMENT '[平台ID]',
`channeltype` varchar(15) NOT NULL DEFAULT '' COMMENT '[平台频道类型]',
`channelvalue` varchar(64) NOT NULL DEFAULT '' COMMENT '[平台频道ID]',
`userid` int NOT NULL DEFAULT '0' COMMENT '[订阅用户]',
`createtime` bigint NOT NULL DEFAULT '0' COMMENT '[创建时间]',
`lastaccepttime` bigint NOT NULL DEFAULT '0' COMMENT '[最后接收时间]',
`status` smallint NOT NULL DEFAULT '10' COMMENT '[状态]10正常42禁言',
`identitytype` smallint NOT NULL DEFAULT '10' COMMENT '[用户身份0游客10成员20管理员30群主]',
PRIMARY KEY (`cuid`)
) ENGINE=InnoDB COMMENT='用户组信息表';
CREATE TABLE `friendmessage` (
`messageid` varchar(64) NOT NULL DEFAULT '' COMMENT '[私聊ID]发送人-时间戳',
`messagetype` varchar(32) NOT NULL DEFAULT '' COMMENT '[消息类型]',
`content` text NOT NULL COMMENT '[私聊内容]',
`senduserid` int NOT NULL DEFAULT '0' COMMENT '[发送人]',
`receiveuserid` int NOT NULL DEFAULT '0' COMMENT '[接收人]',
`createtime` bigint NOT NULL DEFAULT '0' COMMENT '[创建时间]',
`status` smallint NOT NULL DEFAULT '20' COMMENT '[状态]10已发送20未发送21仅在线发送',
`type` varchar(255) NOT NULL DEFAULT '' COMMENT '[消息类型]',
`title` varchar(255) NOT NULL DEFAULT '' COMMENT '[消息标题]',
`attachment` varchar(2048) NOT NULL DEFAULT '' COMMENT '[消息附加信息]',
`newField` varchar(255) NOT NULL DEFAULT '' COMMENT '[新字段描述]',
PRIMARY KEY (`messageid`)
) ENGINE=InnoDB COMMENT='私聊内容表';
CREATE TABLE `imuser` (
`userid` int NOT NULL COMMENT '[用户标识]',
`guserid` varchar(64) NOT NULL DEFAULT '' COMMENT '[平台自用用户标识]',
`appid` varchar(8) NOT NULL DEFAULT '' COMMENT '[关联平台标识]',
`gender` smallint NOT NULL DEFAULT '0' COMMENT '[性别]',
`nickname` varchar(32) NOT NULL DEFAULT '' COMMENT '[昵称]',
`face` varchar(128) NOT NULL DEFAULT '' COMMENT '[头像]',
`createtime` bigint NOT NULL DEFAULT '0' COMMENT '[创建时间]',
`imtoken` varchar(125) DEFAULT '' COMMENT '[用户认证]',
`updatetime` bigint NOT NULL DEFAULT '0' COMMENT '[修改时间]',
`lastaccepttime` bigint NOT NULL DEFAULT '0' COMMENT '[接收时间]',
`status` smallint NOT NULL DEFAULT '10' COMMENT '[状态]10正常40停用80删除',
PRIMARY KEY (`userid`)
) ENGINE=InnoDB COMMENT='IM用户';
--
INSERT INTO z_im.appinfo (appid, appname, appsecret, createtime, updatetime, status, checkfriend, checkblack, machineretract, hasnext) VALUES
('krlq2lp4', '应用A-开发服', '108319232efb4880bcb4f3323829692c', 0, 0, 10, 0, 0, 0, 0),
('xrkqglth', '应用A-测试服', '108319232efb4880bcb4f3323829692d', 0, 0, 10, 0, 0, 0, 0);
INSERT INTO imuser (userid, guserid, appid, gender, nickname, face, createtime, imtoken, updatetime, lastaccepttime, status) VALUES
(10001, '1784509137732849665', 'xrkqglth', 0, '', '', 1721373487374, 'c75ab6feda394d8c8b28371cda45ec12', 1748780429, 1748780429, 10),
(10002, '1784421470808907778', 'xrkqglth', 0, '', '', 1721377122233, '69ca1dcbebc645b78f84a9e88287382d', 1748780432, 1748780432, 10);