database.sql 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  1. --
  2. -- Database: `imts`
  3. --
  4. -- --------------------------------------------------------
  5. --
  6. -- 表的结构 `yu_config`
  7. --
  8. CREATE TABLE IF NOT EXISTS `yu_config` (
  9. `id` int(11) NOT NULL AUTO_INCREMENT,
  10. `name` varchar(128) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  11. `value` json DEFAULT NULL,
  12. `create_user` int(11) NOT NULL DEFAULT '0',
  13. `update_time` int(11) NOT NULL DEFAULT '0',
  14. `create_time` int(11) NOT NULL DEFAULT '0',
  15. `remark` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  16. `status` tinyint(1) NOT NULL DEFAULT '1',
  17. PRIMARY KEY (`id`)
  18. ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='配置表';
  19. --
  20. -- 转存表中的数据 `yu_config`
  21. --
  22. INSERT INTO `yu_config` (`id`, `name`, `value`, `create_user`, `update_time`, `create_time`, `remark`, `status`) VALUES
  23. (1, 'sysInfo', '{\"logo\": \"https://im.file.raingad.com/logo/logo.png\", \"name\": \"raingad-IM\", \"state\": \"1\", \"regtype\": \"2\", \"runMode\": \"1\", \"closeTips\": \"系统升级维护中,请稍候再试!\", \"description\": \"一款基于vue2.0的即时通信系统\"}', 0, 1688462862, 1688462862, NULL, 1),
  24. (2, 'chatInfo', '{\"stun\": \"\", \"online\": \"1\", \"webrtc\": \"1\", \"msgClear\": \"0\", \"stunPass\": \"\", \"stunUser\": \"\", \"groupChat\": \"1\", \"simpleChat\": \"1\", \"msgClearDay\": \"0\", \"groupUserMax\": \"0\"}', 0, 1688463300, 1688463300, NULL, 1),
  25. (3, 'smtp', '{\"addr\": \"\", \"host\": \"\", \"pass\": \"\", \"port\": \"465\", \"sign\": \"\", \"security\": \"ssl\"}', 0, 1688464072, 1688464072, NULL, 1),
  26. (4, 'fileUpload', '{\"disk\": \"local\", \"size\": \"50\", \"qiniu\": {\"url\": \"\", \"bucket\": \"\", \"accessKey\": \"\", \"secretKey\": \"\"}, \"aliyun\": {\"url\": \"\", \"bucket\": \"\", \"accessId\": \"\", \"endpoint\": \"\", \"accessSecret\": \"\"}, \"qcloud\": {\"cdn\": \"\", \"appId\": \"\", \"bucket\": \"\", \"region\": \"\", \"secretId\": \"\", \"secretKey\": \"\"}, \"fileExt\": [\"jpg\", \"jpeg\", \"png\", \"bmp\", \"gif\", \"pdf\", \"mp3\", \"wav\", \"wmv\", \"amr\", \"mp4\", \"3gp\", \"avi\", \"m2v\", \"mkv\", \"mov\", \"webp\", \"ppt\", \"pptx\", \"doc\", \"docx\", \"xls\", \"xlsx\", \"txt\", \"md\"], \"preview\": \"\"}', 0, 1688464130, 1688464130, NULL, 1);
  27. -- --------------------------------------------------------
  28. --
  29. -- 表的结构 `yu_file`
  30. --
  31. CREATE TABLE IF NOT EXISTS `yu_file` (
  32. `file_id` int(11) NOT NULL AUTO_INCREMENT,
  33. `cate` tinyint(1) NOT NULL DEFAULT '9' COMMENT '文件分类',
  34. `file_type` varchar(128) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '文件类型',
  35. `parent_id` int(11) NOT NULL DEFAULT '0' COMMENT '父Id',
  36. `name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '名称',
  37. `src` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '链接',
  38. `size` int(11) DEFAULT '0' COMMENT '大小',
  39. `ext` varchar(16) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '文件后缀',
  40. `md5` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'md5',
  41. `user_id` int(11) NOT NULL DEFAULT '0' COMMENT '创建人',
  42. `create_time` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
  43. `update_time` int(11) NOT NULL DEFAULT '0' COMMENT '更新时间',
  44. `delete_time` int(11) NOT NULL DEFAULT '0' COMMENT '删除时间',
  45. `status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态',
  46. `is_lock` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否锁定',
  47. PRIMARY KEY (`file_id`)
  48. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='文件库';
  49. -- --------------------------------------------------------
  50. --
  51. -- 表的结构 `yu_friend`
  52. --
  53. CREATE TABLE IF NOT EXISTS `yu_friend` (
  54. `friend_id` int(11) NOT NULL AUTO_INCREMENT,
  55. `friend_user_id` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '好友ID',
  56. `nickname` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '好友备注',
  57. `is_invite` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否为邀请方',
  58. `is_top` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否置顶',
  59. `is_notice` tinyint(1) NOT NULL DEFAULT '1' COMMENT '是否消息提醒',
  60. `create_user` int(11) NOT NULL DEFAULT '0',
  61. `update_time` int(11) NOT NULL DEFAULT '0',
  62. `create_time` int(11) NOT NULL DEFAULT '0',
  63. `delete_time` int(11) NOT NULL DEFAULT '0',
  64. `remark` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '申请备注',
  65. `status` tinyint(1) NOT NULL DEFAULT '1',
  66. PRIMARY KEY (`friend_id`)
  67. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='联系人置顶表';
  68. -- --------------------------------------------------------
  69. --
  70. -- 表的结构 `yu_group`
  71. --
  72. CREATE TABLE IF NOT EXISTS `yu_group` (
  73. `group_id` int(11) NOT NULL AUTO_INCREMENT,
  74. `name` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '团队名称',
  75. `name_py` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '团队的拼音',
  76. `avatar` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '群聊头像',
  77. `level` tinyint(1) NOT NULL DEFAULT '1' COMMENT '等级',
  78. `create_user` int(11) NOT NULL DEFAULT '0' COMMENT '创建人',
  79. `create_time` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
  80. `owner_id` int(11) NOT NULL DEFAULT '0' COMMENT '拥有者',
  81. `is_public` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否公开',
  82. `notice` mediumtext COLLATE utf8mb4_unicode_ci COMMENT '公告',
  83. `setting` mediumtext COLLATE utf8mb4_unicode_ci COMMENT '设置',
  84. `status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态',
  85. `delete_time` int(11) NOT NULL DEFAULT '0' COMMENT '删除时间',
  86. PRIMARY KEY (`group_id`)
  87. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  88. -- --------------------------------------------------------
  89. --
  90. -- 表的结构 `yu_group_user`
  91. --
  92. CREATE TABLE IF NOT EXISTS `yu_group_user` (
  93. `id` int(11) NOT NULL AUTO_INCREMENT,
  94. `group_id` int(11) NOT NULL DEFAULT '0' COMMENT '团队Id',
  95. `user_id` int(11) NOT NULL DEFAULT '0' COMMENT '用户Id',
  96. `role` tinyint(1) NOT NULL DEFAULT '2' COMMENT '角色 1拥有者,2管理员,3成员',
  97. `invite_id` int(11) NOT NULL DEFAULT '0' COMMENT '邀请人',
  98. `create_time` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
  99. `unread` int(11) NOT NULL DEFAULT '0' COMMENT '群未读消息',
  100. `is_notice` tinyint(1) NOT NULL DEFAULT '1' COMMENT '1是否提醒',
  101. `is_top` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否置顶',
  102. `status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态 0 ,未同意邀请,1,同意',
  103. `delete_time` int(11) NOT NULL DEFAULT '0' COMMENT '删除时间',
  104. PRIMARY KEY (`id`)
  105. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  106. -- --------------------------------------------------------
  107. --
  108. -- 表的结构 `yu_message`
  109. --
  110. CREATE TABLE IF NOT EXISTS `yu_message` (
  111. `msg_id` int(11) NOT NULL AUTO_INCREMENT,
  112. `id` varchar(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '消息id',
  113. `from_user` int(11) NOT NULL DEFAULT '0' COMMENT '发送者',
  114. `to_user` int(11) NOT NULL DEFAULT '0' COMMENT '接受收者',
  115. `content` text COLLATE utf8mb4_unicode_ci COMMENT '消息内容,如果为文件或图片就是url',
  116. `chat_identify` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '标识 :a与b聊天,b与a聊天。记录 a-b',
  117. `type` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'text' COMMENT '消息类型:text、file、image...',
  118. `is_group` tinyint(1) NOT NULL DEFAULT '0' COMMENT '群聊消息',
  119. `is_read` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否阅读',
  120. `is_last` tinyint(1) NOT NULL DEFAULT '1' COMMENT '是否是最后一条消息',
  121. `create_time` int(13) NOT NULL DEFAULT '0' COMMENT '发送时间',
  122. `is_undo` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否撤回',
  123. `at` text COLLATE utf8mb4_unicode_ci COMMENT '提及某人',
  124. `pid` int(11) NOT NULL DEFAULT '0' COMMENT '引用的消息ID',
  125. `file_id` int(11) NOT NULL DEFAULT '0' COMMENT '文件id',
  126. `file_cate` tinyint(1) NOT NULL DEFAULT '0' COMMENT '文件类型',
  127. `file_size` int(11) NOT NULL DEFAULT '0' COMMENT '文件大小',
  128. `file_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '文件名称',
  129. `extends` json DEFAULT NULL COMMENT '消息扩展内容',
  130. `status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态',
  131. `del_user` text COLLATE utf8mb4_unicode_ci COMMENT '已删除成员',
  132. PRIMARY KEY (`msg_id`)
  133. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  134. -- --------------------------------------------------------
  135. --
  136. -- 表的结构 `yu_user`
  137. --
  138. CREATE TABLE IF NOT EXISTS `yu_user` (
  139. `user_id` int(11) NOT NULL AUTO_INCREMENT,
  140. `account` char(32) COLLATE utf8mb4_unicode_ci NOT NULL,
  141. `realname` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  142. `password` char(32) COLLATE utf8mb4_unicode_ci NOT NULL,
  143. `salt` varchar(4) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '加密盐',
  144. `avatar` varchar(128) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '头像',
  145. `email` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '电子邮箱',
  146. `sex` tinyint(1) NOT NULL DEFAULT '2' COMMENT '性别,0女,1男,2未知',
  147. `role` tinyint(1) NOT NULL DEFAULT '0' COMMENT '角色,0无角色,1超管,2普管',
  148. `motto` text COLLATE utf8mb4_unicode_ci COMMENT '个性签名',
  149. `remark` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注',
  150. `name_py` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '名字的拼音',
  151. `setting` json DEFAULT NULL COMMENT '用户设置',
  152. `create_time` int(11) UNSIGNED NOT NULL COMMENT '创建时间',
  153. `update_time` int(11) UNSIGNED DEFAULT NULL,
  154. `login_count` mediumint(8) UNSIGNED DEFAULT '0' COMMENT '登录次数',
  155. `is_auth` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否认证',
  156. `last_login_time` int(11) UNSIGNED DEFAULT '0' COMMENT '最后登录时间',
  157. `last_login_ip` char(15) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '最后登录Ip\n',
  158. `register_ip` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '注册IP',
  159. `delete_time` int(11) UNSIGNED NOT NULL DEFAULT '0',
  160. `status` tinyint(1) UNSIGNED DEFAULT '1',
  161. PRIMARY KEY (`user_id`),
  162. UNIQUE KEY `account` (`account`) USING BTREE,
  163. KEY `accountpassword` (`account`,`password`)
  164. ) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPACT;
  165. --
  166. -- 转存表中的数据 `yu_user`
  167. --
  168. INSERT INTO `yu_user` (`user_id`, `account`, `realname`, `password`, `salt`, `avatar`, `email`, `sex`, `role`, `motto`, `remark`, `name_py`, `setting`, `create_time`, `update_time`, `login_count`, `is_auth`, `last_login_time`, `last_login_ip`, `register_ip`, `delete_time`, `status`) VALUES
  169. (1, 'administrator', '管理员', '2cb4ecb7fd5295685e275edc7d44e02e', 'srww', NULL, 'service@kaishanlaw.com', 2, 1, NULL, '', 'guanliyuan', NULL, 1222907803, 1451033528, 4, 0, 1693189512, '218.89.238.248', NULL, 0, 1),
  170. (2, '13800000002', '熊大', '2cb4ecb7fd5295685e275edc7d44e02e', 'srww', NULL, 'xiongda@kaishanlaw.com', 2, 0, NULL, '', 'xiongda', NULL, 1555341865, 1558019786, 1, 0, 0, NULL, NULL, 0, 1),
  171. (3, '13800000003', '熊二', '2cb4ecb7fd5295685e275edc7d44e02e', 'srww', NULL, 'xionger@163.com', 2, 0, NULL, '', 'xionger', NULL, 1557933999, 1604587104, 0, 0, 0, NULL, NULL, 0, 1),
  172. (4, '13800000004', '喜洋洋', '2cb4ecb7fd5295685e275edc7d44e02e', 'srww', NULL, 'xiyangyang@qq.com', 2, 0, NULL, '', 'xiyangyang', NULL, 1604587165, 1604587250, 0, 0, 0, NULL, NULL, 0, 1),
  173. (5, '13800000005', '灰太狼', '2cb4ecb7fd5295685e275edc7d44e02e', 'srww', NULL, 'huitailang@qq.com', 2, 0, NULL, '', 'huitailang', NULL, 1604587246, 1604587246, 0, 0, 0, NULL, NULL, 0, 1),
  174. (6, '13800000006', '奥特曼', '2cb4ecb7fd5295685e275edc7d44e02e', 'srww', NULL, 'aoteman@qq.com', 2, 0, NULL, '', 'aoteman', NULL, 1604587295, 1604587295, 0, 0, 0, NULL, NULL, 0, 1),
  175. (7, '13800000007', '孙悟空', '2cb4ecb7fd5295685e275edc7d44e02e', 'srww', NULL, 'sunwukong@qq.com', 2, 0, NULL, '', 'sunwukong', NULL, 1604587347, 1604587347, 0, 0, 0, NULL, NULL, 0, 1),
  176. (8, '13800000008', '猪八戒', '2cb4ecb7fd5295685e275edc7d44e02e', 'srww', NULL, 'zhubajie@qq.com', 2, 0, NULL, '', 'zhubajie', NULL, 1604587378, 1604587378, 0, 0, 0, NULL, NULL, 0, 1),
  177. (9, '13800000009', '唐三藏', '2cb4ecb7fd5295685e275edc7d44e02e', 'srww', NULL, 'tangsanzang@qq.com', 2, 0, NULL, '', 'tangsanzang', NULL, 1604587409, 1604587409, 0, 0, 0, NULL, NULL, 0, 1),
  178. (10, '13800000010', '沙悟净', '2cb4ecb7fd5295685e275edc7d44e02e', 'srww', NULL, 'lantian@qq.com', 2, 0, NULL, '', 'shawujing', NULL, 1604587409, 1604587409, 0, 0, 0, NULL, NULL, 0, 1),
  179. (11, '13800000011', '刘备', '2cb4ecb7fd5295685e275edc7d44e02e', 'srww', NULL, 'liubei@kaishanlaw.com', 2, 0, NULL, '', 'liubei', NULL, 1555341865, 1558019786, 4, 0, 0, NULL, NULL, 0, 1),
  180. (12, '13800000012', '关羽', '2cb4ecb7fd5295685e275edc7d44e02e', 'srww', NULL, 'guanyu@163.com', 2, 0, NULL, '', 'guanyu', NULL, 1557933999, 1604587104, 0, 0, 0, NULL, NULL, 0, 1),
  181. (13, '13800000013', '张飞', '2cb4ecb7fd5295685e275edc7d44e02e', 'srww', NULL, 'zhangfei@qq.com', 2, 0, NULL, '', 'zhangfei', NULL, 1604587165, 1604587250, 0, 0, 0, NULL, NULL, 0, 1),
  182. (14, '13800000014', '赵云', '2cb4ecb7fd5295685e275edc7d44e02e', 'srww', NULL, 'zhaoyun@qq.com', 2, 0, NULL, '', 'zhaoyun', NULL, 1604587246, 1604587246, 0, 0, 0, NULL, NULL, 0, 1),
  183. (15, '13800000015', '曹操', '2cb4ecb7fd5295685e275edc7d44e02e', 'srww', NULL, 'caocao@qq.com', 2, 0, NULL, '', 'caocao', NULL, 1604587295, 1604587295, 0, 0, 0, NULL, NULL, 0, 1),
  184. (16, '13800000016', '司马懿', '2cb4ecb7fd5295685e275edc7d44e02e', 'srww', NULL, 'simayi@qq.com', 2, 0, NULL, '', 'simayi', NULL, 1604587347, 1604587347, 0, 0, 0, NULL, NULL, 0, 1),
  185. (17, '13800000017', '孙权', '2cb4ecb7fd5295685e275edc7d44e02e', 'srww', NULL, 'sunquan@qq.com', 2, 0, NULL, '', 'sunquan', NULL, 1604587378, 1604587378, 0, 0, 0, NULL, NULL, 0, 1),
  186. (18, '13800000018', '周瑜', '2cb4ecb7fd5295685e275edc7d44e02e', 'srww', NULL, 'zhouyu@qq.com', 2, 0, NULL, '', 'zhouyu', NULL, 1604587409, 1604587409, 0, 0, 0, NULL, NULL, 0, 1),
  187. (19, '13800000019', '诸葛亮', '2cb4ecb7fd5295685e275edc7d44e02e', 'srww', NULL, 'zhugeliang@qq.com', 2, 0, NULL, '', 'zhugeliang', NULL, 1604587378, 1604587378, 0, 0, 0, NULL, NULL, 0, 1),
  188. (20, '13800000020', '吕布', '2cb4ecb7fd5295685e275edc7d44e02e', 'srww', NULL, 'lvbu@qq.com', 2, 0, NULL, '', 'lvbu', NULL, 1604587409, 1604587409, 0, 0, 0, NULL, NULL, 0, 1);
  189. COMMIT;