/*
 Navicat Premium Dump SQL

 Source Server         : 新Mysql服务器
 Source Server Type    : MySQL
 Source Server Version : 80407 (8.4.7)
 Source Host           : 101.43.12.11:3306
 Source Schema         : nl_im_plus

 Target Server Type    : MySQL
 Target Server Version : 80407 (8.4.7)
 File Encoding         : 65001

 Date: 08/12/2025 14:10:48
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for api_request_logs
-- ----------------------------
DROP TABLE IF EXISTS `api_request_logs`;
CREATE TABLE `api_request_logs`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `route` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '请求路由',
  `ip` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '请求IP',
  `ip_location` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT 'IP归属地',
  `user_id` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '请求用户ID',
  `method` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '请求方式',
  `request_params` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '请求参数',
  `response_params` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '返回参数',
  `response_code` bigint NULL DEFAULT NULL COMMENT '返回code',
  `http_status` bigint NULL DEFAULT NULL COMMENT '返回http状态',
  `request_time` datetime NULL DEFAULT NULL COMMENT '请求时间',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `idx_api_request_logs_route`(`route` ASC) USING BTREE,
  INDEX `idx_api_request_logs_ip`(`ip` ASC) USING BTREE,
  INDEX `idx_api_request_logs_user_id`(`user_id` ASC) USING BTREE,
  INDEX `idx_api_request_logs_response_code`(`response_code` ASC) USING BTREE,
  INDEX `idx_api_request_logs_request_time`(`request_time` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '接口请求日志表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of api_request_logs
-- ----------------------------

-- ----------------------------
-- Table structure for attachments
-- ----------------------------
DROP TABLE IF EXISTS `attachments`;
CREATE TABLE `attachments`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `uploader_id` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '上传者ID',
  `file_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '文件名',
  `file_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '文件类型',
  `file_size` bigint NULL DEFAULT NULL COMMENT '文件大小（字节）',
  `file_path` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '文件路径',
  `file_url` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '文件URL',
  `mime_type` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT 'MIME类型',
  `width` bigint NULL DEFAULT NULL COMMENT '宽度',
  `height` bigint NULL DEFAULT NULL COMMENT '高度',
  `duration` bigint NULL DEFAULT NULL COMMENT '时长（秒）',
  `created_at` datetime(3) NULL DEFAULT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `idx_attachments_uploader_id`(`uploader_id` ASC) USING BTREE,
  INDEX `idx_attachments_file_type`(`file_type` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 8 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '附件表，记录上传的文件信息' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of attachments
-- ----------------------------
INSERT INTO `attachments` VALUES (1, '10001', 'app-logo.png', 'image', 50300, 'uploads\\images\\1765155994172139000_139000.png', '/uploads/images/1765155994172139000_139000.png', 'image/png', 0, 0, 0, '2025-12-08 09:06:34.394');
INSERT INTO `attachments` VALUES (2, '10002', 'acf44708-e9f2-45c3-8399-16237ff619b4.jpg', 'image', 80342, 'uploads\\images\\1765159407925763500_763500.jpg', '/uploads/images/1765159407925763500_763500.jpg', 'image/jpeg', 0, 0, 0, '2025-12-08 10:03:27.937');
INSERT INTO `attachments` VALUES (3, '10002', 'acf44708-e9f2-45c3-8399-16237ff619b4.png', 'image', 1106410, 'uploads\\images\\1765159407978118500_118500.png', '/uploads/images/1765159407978118500_118500.png', 'image/png', 0, 0, 0, '2025-12-08 10:03:27.991');
INSERT INTO `attachments` VALUES (4, '10002', 'app-logo.png', 'image', 50300, 'uploads\\images\\1765159408031331600_331600.png', '/uploads/images/1765159408031331600_331600.png', 'image/png', 0, 0, 0, '2025-12-08 10:03:28.045');
INSERT INTO `attachments` VALUES (5, '10002', 'qd.png', 'image', 83764, 'uploads\\images\\1765159408083277400_277400.png', '/uploads/images/1765159408083277400_277400.png', 'image/png', 0, 0, 0, '2025-12-08 10:03:28.094');
INSERT INTO `attachments` VALUES (6, '10002', 'weibo_login.mp4', 'video', 20268266, 'uploads\\videos\\1765159423732615800_615800.mp4', '/uploads/videos/1765159423732615800_615800.mp4', 'video/mp4', 0, 0, 0, '2025-12-08 10:03:43.753');
INSERT INTO `attachments` VALUES (7, '10001', 'app-logo.png', 'image', 50300, 'uploads\\images\\1765170659549540900_540900.png', '/uploads/images/1765170659549540900_540900.png', 'image/png', 0, 0, 0, '2025-12-08 13:10:59.734');

-- ----------------------------
-- Table structure for chat_conversations
-- ----------------------------
DROP TABLE IF EXISTS `chat_conversations`;
CREATE TABLE `chat_conversations`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `user_id` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '用户ID',
  `target_id` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '目标ID(好友或群)',
  `room_id` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '房间ID',
  `type` bigint NULL DEFAULT NULL COMMENT '会话类型(1=私聊,2=群聊)',
  `is_top` tinyint(1) NULL DEFAULT 0 COMMENT '是否置顶',
  `is_muted` tinyint(1) NULL DEFAULT 0 COMMENT '是否免打扰',
  `is_special_care` tinyint(1) NULL DEFAULT 0 COMMENT '是否特别关心',
  `unread_count` int NULL DEFAULT 0 COMMENT '未读消息数',
  `last_message` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '最后一条消息内容',
  `last_time` datetime NULL DEFAULT NULL COMMENT '最后消息时间',
  `created_at` datetime(3) NULL DEFAULT NULL COMMENT '创建时间',
  `updated_at` datetime(3) NULL DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `idx_chat_conversations_user_id`(`user_id` ASC) USING BTREE,
  INDEX `idx_chat_conversations_target_id`(`target_id` ASC) USING BTREE,
  INDEX `idx_chat_conversations_room_id`(`room_id` ASC) USING BTREE,
  INDEX `idx_chat_conversations_last_time`(`last_time` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '用户会话表，记录每个用户的最近会话列表和未读信息' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of chat_conversations
-- ----------------------------
INSERT INTO `chat_conversations` VALUES (1, '10002', '10001', '256224828233748480', 1, 0, 0, 0, 0, '我已经通过了你的好友申请，开始和我聊天吧~', '2025-12-08 09:06:00', '2025-12-08 09:05:59.742', '2025-12-08 11:30:28.569');
INSERT INTO `chat_conversations` VALUES (2, '10001', '10002', '256224828233748480', 1, 0, 0, 0, 0, '我已经通过了你的好友申请，开始和我聊天吧~', '2025-12-08 09:06:00', '2025-12-08 09:05:59.813', '2025-12-08 09:06:00.018');
INSERT INTO `chat_conversations` VALUES (3, '10001', 'group_256244427461365760', 'group_256244427461365760', 2, 0, 0, 0, 0, '李四：222', '2025-12-08 13:54:45', '2025-12-08 10:23:52.545', '2025-12-08 13:54:47.473');
INSERT INTO `chat_conversations` VALUES (4, '10002', 'group_256244427461365760', 'group_256244427461365760', 2, 0, 0, 0, 0, '李四：222', '2025-12-08 13:54:45', '2025-12-08 10:23:52.545', '2025-12-08 13:54:44.991');

-- ----------------------------
-- Table structure for chat_messages
-- ----------------------------
DROP TABLE IF EXISTS `chat_messages`;
CREATE TABLE `chat_messages`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '消息唯一标识ID',
  `room_id` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '房间ID',
  `sender_user_id` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '发送者用户ID',
  `receiver_user_id` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '接收者用户ID',
  `message_type` bigint NULL DEFAULT NULL COMMENT '消息类型',
  `content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '消息内容',
  `extra` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '扩展字段，存储JSON格式的元数据',
  `duration` bigint NULL DEFAULT NULL COMMENT '通话时长(秒)',
  `call_id` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '关联的通话ID',
  `call_status` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '通话状态',
  `created_at` datetime(3) NULL DEFAULT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `idx_chat_messages_room_id`(`room_id` ASC) USING BTREE,
  INDEX `idx_chat_messages_sender_user_id`(`sender_user_id` ASC) USING BTREE,
  INDEX `idx_chat_messages_receiver_user_id`(`receiver_user_id` ASC) USING BTREE,
  INDEX `idx_chat_messages_call_id`(`call_id` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 7 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '聊天消息表，持久化存储聊天记录，包括文本、多媒体和信令状态' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of chat_messages
-- ----------------------------
INSERT INTO `chat_messages` VALUES (1, '256224828233748480', '10001', '10002', 0, '我已经通过了你的好友申请，开始和我聊天吧~', '', 0, '', '', '2025-12-08 09:05:59.882');
INSERT INTO `chat_messages` VALUES (2, 'group_256244427461365760', '10001', 'group_256244427461365760', 4, '张三 邀请你加入了群聊', '{\"creator\":\"10001\",\"room_id\":\"group_256244427461365760\",\"type\":\"group_created\"}', 0, '', '', '2025-12-08 10:23:52.740');
INSERT INTO `chat_messages` VALUES (3, 'group_256244427461365760', '10001', 'group_256244427461365760', 0, '@李四 你好', '{\"mention_user_ids\":[\"10002\"]}', 0, '', '', '2025-12-08 11:27:32.014');
INSERT INTO `chat_messages` VALUES (4, 'group_256244427461365760', '10002', 'group_256244427461365760', 0, '.', '{}', 0, '', '', '2025-12-08 13:54:30.347');
INSERT INTO `chat_messages` VALUES (5, 'group_256244427461365760', '10002', 'group_256244427461365760', 0, '123', '{}', 0, '', '', '2025-12-08 13:54:35.594');
INSERT INTO `chat_messages` VALUES (6, 'group_256244427461365760', '10002', 'group_256244427461365760', 0, '222', '{}', 0, '', '', '2025-12-08 13:54:44.646');

-- ----------------------------
-- Table structure for chat_rooms
-- ----------------------------
DROP TABLE IF EXISTS `chat_rooms`;
CREATE TABLE `chat_rooms`  (
  `room_id` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '房间ID',
  `room_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '房间类型',
  `room_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '房间名称',
  `room_avatar` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '房间头像',
  `owner_id` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT '0' COMMENT '群主ID(群聊必填,单聊为0)',
  `admin_ids` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '管理员ID列表(逗号分隔)',
  `creator_id` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '创建者ID',
  `last_message_time` datetime NULL DEFAULT NULL COMMENT '最后消息时间',
  `last_message` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '最后消息内容',
  `announcement` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '群公告',
  `created_at` datetime(3) NULL DEFAULT NULL COMMENT '创建时间',
  `updated_at` datetime(3) NULL DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`room_id`) USING BTREE,
  INDEX `idx_chat_rooms_room_type`(`room_type` ASC) USING BTREE,
  INDEX `idx_chat_rooms_owner_id`(`owner_id` ASC) USING BTREE,
  INDEX `idx_chat_rooms_creator_id`(`creator_id` ASC) USING BTREE,
  INDEX `idx_chat_rooms_last_message_time`(`last_message_time` ASC) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '聊天房间表，支持点对点和群聊' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of chat_rooms
-- ----------------------------
INSERT INTO `chat_rooms` VALUES ('256224828233748480', 'p2p', '', '', '0', '', '10001', NULL, '', '', '2025-12-08 09:05:59.479', '2025-12-08 09:05:59.479');
INSERT INTO `chat_rooms` VALUES ('group_256244427461365760', 'group', '1', '1', '10001', '', '10001', NULL, '', '你好', '2025-12-08 10:23:52.329', '2025-12-08 13:54:08.971');

-- ----------------------------
-- Table structure for contact_groups
-- ----------------------------
DROP TABLE IF EXISTS `contact_groups`;
CREATE TABLE `contact_groups`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `user_id` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '用户ID',
  `group_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '分组名称',
  `sort_order` bigint NULL DEFAULT 0 COMMENT '排序顺序',
  `created_at` datetime(3) NULL DEFAULT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `idx_contact_groups_user_id`(`user_id` ASC) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '联系人分组表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of contact_groups
-- ----------------------------

-- ----------------------------
-- Table structure for friend_requests
-- ----------------------------
DROP TABLE IF EXISTS `friend_requests`;
CREATE TABLE `friend_requests`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `from_user_id` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '发送者用户ID',
  `to_user_id` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '接收者用户ID',
  `message` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '申请消息',
  `status` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT 'pending' COMMENT '状态',
  `created_at` datetime(3) NULL DEFAULT NULL COMMENT '创建时间',
  `updated_at` datetime(3) NULL DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `idx_friend_requests_from_user_id`(`from_user_id` ASC) USING BTREE,
  INDEX `idx_friend_requests_to_user_id`(`to_user_id` ASC) USING BTREE,
  INDEX `idx_friend_requests_status`(`status` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '好友申请表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of friend_requests
-- ----------------------------
INSERT INTO `friend_requests` VALUES (1, '10002', '10001', '你好，我是张三', 'accepted', '2025-12-08 09:05:54.580', '2025-12-08 09:05:59.446');

-- ----------------------------
-- Table structure for login_logs
-- ----------------------------
DROP TABLE IF EXISTS `login_logs`;
CREATE TABLE `login_logs`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `account` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '登录账号',
  `user_id` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '登录ID',
  `location` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '归属地',
  `ip` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT 'IP地址',
  `success` tinyint(1) NULL DEFAULT NULL COMMENT '成功状态',
  `login_time` datetime NULL DEFAULT NULL COMMENT '登录时间',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `idx_login_logs_account`(`account` ASC) USING BTREE,
  INDEX `idx_login_logs_user_id`(`user_id` ASC) USING BTREE,
  INDEX `idx_login_logs_ip`(`ip` ASC) USING BTREE,
  INDEX `idx_login_logs_success`(`success` ASC) USING BTREE,
  INDEX `idx_login_logs_login_time`(`login_time` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '登录日志表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of login_logs
-- ----------------------------
INSERT INTO `login_logs` VALUES (1, 'user002@example.com', '10002', '本地', '::1', 1, '2025-12-08 13:10:40');
INSERT INTO `login_logs` VALUES (2, 'workerqi@163.com', '10001', '本地', '::1', 1, '2025-12-08 13:10:48');

-- ----------------------------
-- Table structure for moment_comments
-- ----------------------------
DROP TABLE IF EXISTS `moment_comments`;
CREATE TABLE `moment_comments`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '评论ID',
  `moment_id` bigint NULL DEFAULT NULL COMMENT '动态ID',
  `user_id` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '评论者ID',
  `reply_to_comment_id` bigint NULL DEFAULT NULL COMMENT '回复的评论ID',
  `reply_to_user_id` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '回复的用户ID',
  `content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '评论内容',
  `is_deleted` tinyint(1) NULL DEFAULT 0 COMMENT '是否已删除',
  `created_at` datetime(3) NULL DEFAULT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `idx_moment_comments_moment_id`(`moment_id` ASC) USING BTREE,
  INDEX `idx_moment_comments_user_id`(`user_id` ASC) USING BTREE,
  INDEX `idx_moment_comments_reply_to`(`reply_to_comment_id` ASC) USING BTREE,
  INDEX `idx_moment_comments_reply_to_comment_id`(`reply_to_comment_id` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '动态评论表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of moment_comments
-- ----------------------------
INSERT INTO `moment_comments` VALUES (1, 1, '10002', NULL, '', '好', 0, '2025-12-08 09:51:33.512');
INSERT INTO `moment_comments` VALUES (2, 2, '10001', NULL, '', '你好', 0, '2025-12-08 09:52:13.529');
INSERT INTO `moment_comments` VALUES (3, 5, '10001', NULL, '', '确实不错', 0, '2025-12-08 11:31:23.850');
INSERT INTO `moment_comments` VALUES (4, 2, '10002', 2, '10001', '嗯嗯', 0, '2025-12-08 12:53:31.946');

-- ----------------------------
-- Table structure for moment_likes
-- ----------------------------
DROP TABLE IF EXISTS `moment_likes`;
CREATE TABLE `moment_likes`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `moment_id` bigint NULL DEFAULT NULL COMMENT '动态ID',
  `user_id` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '点赞用户ID',
  `created_at` datetime(3) NULL DEFAULT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `uk_moment_user`(`moment_id` ASC, `user_id` ASC) USING BTREE,
  INDEX `idx_moment_likes_moment_id`(`moment_id` ASC) USING BTREE,
  INDEX `idx_moment_likes_user_id`(`user_id` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 8 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '动态点赞表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of moment_likes
-- ----------------------------
INSERT INTO `moment_likes` VALUES (1, 1, '10002', '2025-12-08 09:06:47.565');
INSERT INTO `moment_likes` VALUES (2, 2, '10001', '2025-12-08 09:52:07.061');
INSERT INTO `moment_likes` VALUES (3, 4, '10002', '2025-12-08 10:03:53.559');
INSERT INTO `moment_likes` VALUES (4, 4, '10001', '2025-12-08 10:04:06.564');
INSERT INTO `moment_likes` VALUES (5, 5, '10001', '2025-12-08 11:31:16.553');
INSERT INTO `moment_likes` VALUES (6, 2, '10002', '2025-12-08 13:10:29.289');
INSERT INTO `moment_likes` VALUES (7, 7, '10002', '2025-12-08 13:45:53.852');

-- ----------------------------
-- Table structure for moment_notifications
-- ----------------------------
DROP TABLE IF EXISTS `moment_notifications`;
CREATE TABLE `moment_notifications`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '通知ID',
  `user_id` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '接收通知的用户ID',
  `from_user_id` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '触发通知的用户ID',
  `moment_id` bigint NULL DEFAULT NULL COMMENT '关联的动态ID',
  `type` tinyint NULL DEFAULT NULL COMMENT '通知类型',
  `comment_id` bigint UNSIGNED NULL DEFAULT NULL COMMENT '关联的评论ID',
  `is_read` tinyint(1) NULL DEFAULT 0 COMMENT '是否已读',
  `created_at` datetime(3) NULL DEFAULT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `idx_moment_notifications_user_id`(`user_id` ASC) USING BTREE,
  INDEX `idx_moment_notifications_is_read`(`is_read` ASC) USING BTREE,
  INDEX `idx_moment_notifications_created_at`(`created_at` ASC) USING BTREE,
  INDEX `idx_moment_notifications_moment_id`(`moment_id` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 13 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '朋友圈通知表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of moment_notifications
-- ----------------------------
INSERT INTO `moment_notifications` VALUES (1, '10001', '10002', 1, 1, NULL, 0, '2025-12-08 09:06:47.673');
INSERT INTO `moment_notifications` VALUES (2, '10001', '10002', 1, 2, 1, 0, '2025-12-08 09:51:33.620');
INSERT INTO `moment_notifications` VALUES (3, '10002', '10001', 2, 1, NULL, 1, '2025-12-08 09:52:07.164');
INSERT INTO `moment_notifications` VALUES (4, '10002', '10001', 2, 2, 2, 1, '2025-12-08 09:52:13.624');
INSERT INTO `moment_notifications` VALUES (5, '10002', '10001', 4, 1, NULL, 1, '2025-12-08 10:04:06.659');
INSERT INTO `moment_notifications` VALUES (6, '10001', '10002', 5, 4, NULL, 0, '2025-12-08 11:31:11.609');
INSERT INTO `moment_notifications` VALUES (7, '10002', '10001', 5, 1, NULL, 1, '2025-12-08 11:31:16.642');
INSERT INTO `moment_notifications` VALUES (8, '10002', '10001', 5, 2, 3, 1, '2025-12-08 11:31:23.936');
INSERT INTO `moment_notifications` VALUES (9, '10001', '10002', 2, 3, 4, 0, '2025-12-08 12:53:32.069');
INSERT INTO `moment_notifications` VALUES (10, '10002', '10001', 6, 4, NULL, 0, '2025-12-08 13:45:09.606');
INSERT INTO `moment_notifications` VALUES (11, '10002', '10001', 7, 4, NULL, 0, '2025-12-08 13:45:33.703');
INSERT INTO `moment_notifications` VALUES (12, '10001', '10002', 7, 1, NULL, 0, '2025-12-08 13:45:53.961');

-- ----------------------------
-- Table structure for moments
-- ----------------------------
DROP TABLE IF EXISTS `moments`;
CREATE TABLE `moments`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '动态ID',
  `user_id` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '发布者ID',
  `content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '文字内容',
  `media_type` tinyint NULL DEFAULT 0 COMMENT '媒体类型',
  `media_urls` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '媒体URL列表',
  `location` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '位置信息',
  `visibility` tinyint NULL DEFAULT 0 COMMENT '可见性',
  `visible_user_ids` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '可见用户ID列表',
  `mention_user_ids` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '@的用户ID列表',
  `topic_tags` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '话题标签',
  `like_count` int NULL DEFAULT 0 COMMENT '点赞数',
  `comment_count` int NULL DEFAULT 0 COMMENT '评论数',
  `is_deleted` tinyint(1) NULL DEFAULT 0 COMMENT '是否已删除',
  `created_at` datetime(3) NULL DEFAULT NULL COMMENT '创建时间',
  `updated_at` datetime(3) NULL DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `idx_moments_user_id`(`user_id` ASC) USING BTREE,
  INDEX `idx_moments_created_at`(`created_at` ASC) USING BTREE,
  INDEX `idx_moments_visibility`(`visibility` ASC) USING BTREE,
  INDEX `idx_moments_is_deleted`(`is_deleted` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 8 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '朋友圈动态表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of moments
-- ----------------------------
INSERT INTO `moments` VALUES (1, '10001', '大家好，这个是我第一条动态~', 1, '[\"/uploads/images/1765155994172139000_139000.png\"]', '', 0, 'null', 'null', 'null', 1, 1, 0, '2025-12-08 09:06:34.699', '2025-12-08 09:06:34.699');
INSERT INTO `moments` VALUES (2, '10002', '这个是我第一个朋友圈~', 0, '[]', '', 0, 'null', 'null', 'null', 2, 2, 0, '2025-12-08 09:52:02.097', '2025-12-08 09:52:02.097');
INSERT INTO `moments` VALUES (3, '10002', '很开心', 1, '[\"/uploads/images/1765159407925763500_763500.jpg\",\"/uploads/images/1765159407978118500_118500.png\",\"/uploads/images/1765159408031331600_331600.png\",\"/uploads/images/1765159408083277400_277400.png\"]', '', 0, 'null', 'null', 'null', 0, 0, 0, '2025-12-08 10:03:28.142', '2025-12-08 10:03:28.142');
INSERT INTO `moments` VALUES (4, '10002', '哦豁', 2, '[\"/uploads/videos/1765159423732615800_615800.mp4\"]', '', 0, 'null', 'null', 'null', 2, 0, 0, '2025-12-08 10:03:43.810', '2025-12-08 10:03:43.810');
INSERT INTO `moments` VALUES (5, '10002', '今天天气真好 @张三 ', 0, '[]', '', 0, 'null', '[\"10001\"]', 'null', 1, 1, 0, '2025-12-08 11:31:11.549', '2025-12-08 11:31:11.549');
INSERT INTO `moments` VALUES (6, '10001', '... @李四 ', 0, '[]', '', 0, 'null', '[\"10002\"]', 'null', 0, 0, 0, '2025-12-08 13:45:09.525', '2025-12-08 13:45:09.525');
INSERT INTO `moments` VALUES (7, '10001', '@李四 ', 0, '[]', '', 0, 'null', '[\"10002\"]', 'null', 1, 0, 0, '2025-12-08 13:45:33.502', '2025-12-08 13:45:33.502');

-- ----------------------------
-- Table structure for room_members
-- ----------------------------
DROP TABLE IF EXISTS `room_members`;
CREATE TABLE `room_members`  (
  `room_id` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '房间ID',
  `user_id` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '用户ID',
  `role` tinyint(1) NOT NULL DEFAULT 0 COMMENT '成员角色(0=成员,1=管理员,2=群主)',
  `joined_at` datetime(3) NULL DEFAULT NULL COMMENT '加入时间',
  `muted_until` datetime NULL DEFAULT NULL COMMENT '禁言到期时间',
  PRIMARY KEY (`room_id`, `user_id`) USING BTREE,
  INDEX `idx_room_members_user_id`(`user_id` ASC) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '房间成员表，存储房间与用户的关联关系' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of room_members
-- ----------------------------
INSERT INTO `room_members` VALUES ('256224828233748480', '10001', 0, '2025-12-08 09:05:59.562', NULL);
INSERT INTO `room_members` VALUES ('256224828233748480', '10002', 0, '2025-12-08 09:05:59.523', NULL);
INSERT INTO `room_members` VALUES ('group_256244427461365760', '10001', 2, '2025-12-08 10:23:52.375', NULL);
INSERT INTO `room_members` VALUES ('group_256244427461365760', '10002', 1, '2025-12-08 10:23:52.351', NULL);

-- ----------------------------
-- Table structure for user_contacts
-- ----------------------------
DROP TABLE IF EXISTS `user_contacts`;
CREATE TABLE `user_contacts`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `user_id` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '用户ID',
  `contact_id` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '联系人ID',
  `room_id` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '房间ID',
  `remark_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '备注名称',
  `group_id` bigint NULL DEFAULT NULL COMMENT '分组ID',
  `is_top` tinyint(1) NULL DEFAULT 0 COMMENT '是否置顶',
  `is_muted` tinyint(1) NULL DEFAULT 0 COMMENT '是否免打扰',
  `is_special_care` tinyint(1) NULL DEFAULT 0 COMMENT '是否特别关心',
  `is_blocked` tinyint(1) NULL DEFAULT 0 COMMENT '是否拉黑',
  `last_chat_time` datetime NULL DEFAULT NULL COMMENT '最后聊天时间',
  `last_message` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '最后一条消息',
  `unread_count` bigint NULL DEFAULT 0 COMMENT '未读消息数',
  `created_at` datetime(3) NULL DEFAULT NULL COMMENT '创建时间',
  `updated_at` datetime(3) NULL DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `idx_user_contacts_user_id`(`user_id` ASC) USING BTREE,
  INDEX `idx_user_contacts_contact_id`(`contact_id` ASC) USING BTREE,
  INDEX `idx_user_contacts_room_id`(`room_id` ASC) USING BTREE,
  INDEX `idx_user_contacts_group_id`(`group_id` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '用户联系人表，存储好友关系、分组、备注等信息' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of user_contacts
-- ----------------------------
INSERT INTO `user_contacts` VALUES (1, '10002', '10001', '256224828233748480', '', 0, 0, 0, 0, 0, NULL, '', 0, '2025-12-08 09:05:59.632', '2025-12-08 09:05:59.632');
INSERT INTO `user_contacts` VALUES (2, '10001', '10002', '256224828233748480', '', 0, 0, 0, 0, 0, NULL, '', 0, '2025-12-08 09:05:59.662', '2025-12-08 09:05:59.662');

-- ----------------------------
-- Table structure for users
-- ----------------------------
DROP TABLE IF EXISTS `users`;
CREATE TABLE `users`  (
  `id` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '用户唯一ID',
  `email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '邮箱',
  `phone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '手机号',
  `password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '密码（加密后）',
  `name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '用户名称',
  `avatar` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '用户头像',
  `desc` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '用户描述或签名',
  `region` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '地区',
  `created_at` datetime(3) NULL DEFAULT NULL COMMENT '创建时间',
  `updated_at` datetime(3) NULL DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `idx_users_email`(`email` ASC) USING BTREE,
  UNIQUE INDEX `idx_users_phone`(`phone` ASC) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '用户基本信息表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of users
-- ----------------------------
INSERT INTO `users` VALUES ('10001', 'workerqi@163.com', '13800138001', '$2a$10$OsVRHKowu.mVT4GNxzZ3/eo8xEABkWsUGAt4nV5nalzOXW47vtBmC', '张三', '/uploads/images/1765170659549540900_540900.png', 'Golang 开发工程师', '北京', '2025-12-03 09:53:49.000', '2025-12-08 13:10:59.809');
INSERT INTO `users` VALUES ('10002', 'user002@example.com', '13800138002', '$2a$10$OsVRHKowu.mVT4GNxzZ3/eo8xEABkWsUGAt4nV5nalzOXW47vtBmC', '李四', '李', '前端开发工程师', '上海', '2025-12-03 09:53:49.000', '2025-12-03 09:53:49.000');
INSERT INTO `users` VALUES ('10003', 'user003@example.com', '13800138003', '$2a$10$OsVRHKowu.mVT4GNxzZ3/eo8xEABkWsUGAt4nV5nalzOXW47vtBmC', '王五', '王', '产品经理', '深圳', '2025-12-03 09:53:49.000', '2025-12-03 09:53:49.000');
INSERT INTO `users` VALUES ('10004', 'user004@example.com', '13800138004', '$2a$10$OsVRHKowu.mVT4GNxzZ3/eo8xEABkWsUGAt4nV5nalzOXW47vtBmC', '赵六', '赵', 'UI设计师', '广州', '2025-12-03 09:53:49.000', '2025-12-03 09:53:49.000');
INSERT INTO `users` VALUES ('10005', 'user005@example.com', '13800138005', '$2a$10$OsVRHKowu.mVT4GNxzZ3/eo8xEABkWsUGAt4nV5nalzOXW47vtBmC', '钱七', '钱', '测试工程师', '杭州', '2025-12-03 09:53:49.000', '2025-12-03 09:53:49.000');
INSERT INTO `users` VALUES ('10006', 'user006@example.com', '13800138006', '$2a$10$OsVRHKowu.mVT4GNxzZ3/eo8xEABkWsUGAt4nV5nalzOXW47vtBmC', '孙八', '孙', '运维工程师', '成都', '2025-12-03 09:53:49.000', '2025-12-03 09:53:49.000');
INSERT INTO `users` VALUES ('10007', 'user007@example.com', '13800138007', '$2a$10$OsVRHKowu.mVT4GNxzZ3/eo8xEABkWsUGAt4nV5nalzOXW47vtBmC', '周九', '周', '数据分析师', '武汉', '2025-12-03 09:53:49.000', '2025-12-03 09:53:49.000');
INSERT INTO `users` VALUES ('10008', 'user008@example.com', '13800138008', '$2a$10$OsVRHKowu.mVT4GNxzZ3/eo8xEABkWsUGAt4nV5nalzOXW47vtBmC', '吴十', '吴', '项目经理', '西安', '2025-12-03 09:53:49.000', '2025-12-03 09:53:49.000');
INSERT INTO `users` VALUES ('10009', 'user009@example.com', '13800138009', '$2a$10$OsVRHKowu.mVT4GNxzZ3/eo8xEABkWsUGAt4nV5nalzOXW47vtBmC', '郑十一', '郑', '架构师', '南京', '2025-12-03 09:53:49.000', '2025-12-03 09:53:49.000');
INSERT INTO `users` VALUES ('10010', 'user010@example.com', '13800138010', '$2a$10$OsVRHKowu.mVT4GNxzZ3/eo8xEABkWsUGAt4nV5nalzOXW47vtBmC', '王十二', '王', '技术总监', '苏州', '2025-12-03 09:53:49.000', '2025-12-03 09:53:49.000');
INSERT INTO `users` VALUES ('10011', 'user011@example.com', '13800138011', '$2a$10$OsVRHKowu.mVT4GNxzZ3/eo8xEABkWsUGAt4nV5nalzOXW47vtBmC', '冯十三', '冯', 'HR经理', '天津', '2025-12-03 09:53:49.000', '2025-12-03 09:53:49.000');
INSERT INTO `users` VALUES ('10012', 'user012@example.com', '13800138012', '$2a$10$OsVRHKowu.mVT4GNxzZ3/eo8xEABkWsUGAt4nV5nalzOXW47vtBmC', '陈十四', '陈', '财务经理', '重庆', '2025-12-03 09:53:49.000', '2025-12-03 09:53:49.000');
INSERT INTO `users` VALUES ('10013', 'user013@example.com', '13800138013', '$2a$10$OsVRHKowu.mVT4GNxzZ3/eo8xEABkWsUGAt4nV5nalzOXW47vtBmC', '褚十五', '褚', '市场经理', '长沙', '2025-12-03 09:53:49.000', '2025-12-03 09:53:49.000');
INSERT INTO `users` VALUES ('10014', 'user014@example.com', '13800138014', '$2a$10$OsVRHKowu.mVT4GNxzZ3/eo8xEABkWsUGAt4nV5nalzOXW47vtBmC', '卫十六', '卫', '销售经理', '郑州', '2025-12-03 09:53:49.000', '2025-12-03 09:53:49.000');
INSERT INTO `users` VALUES ('10015', 'user015@example.com', '13800138015', '$2a$10$OsVRHKowu.mVT4GNxzZ3/eo8xEABkWsUGAt4nV5nalzOXW47vtBmC', '蒋十七', '蒋', '客服主管', '济南', '2025-12-03 09:53:49.000', '2025-12-03 09:53:49.000');
INSERT INTO `users` VALUES ('10016', 'user016@example.com', '13800138016', '$2a$10$OsVRHKowu.mVT4GNxzZ3/eo8xEABkWsUGAt4nV5nalzOXW47vtBmC', '沈十八', '沈', '运营专员', '青岛', '2025-12-03 09:53:49.000', '2025-12-03 09:53:49.000');
INSERT INTO `users` VALUES ('10017', 'user017@example.com', '13800138017', '$2a$10$OsVRHKowu.mVT4GNxzZ3/eo8xEABkWsUGAt4nV5nalzOXW47vtBmC', '韩十九', '韩', '内容编辑', '大连', '2025-12-03 09:53:49.000', '2025-12-03 09:53:49.000');
INSERT INTO `users` VALUES ('10018', 'user018@example.com', '13800138018', '$2a$10$OsVRHKowu.mVT4GNxzZ3/eo8xEABkWsUGAt4nV5nalzOXW47vtBmC', '杨二十', '杨', '商务拓展', '厦门', '2025-12-03 09:53:49.000', '2025-12-03 09:53:49.000');
INSERT INTO `users` VALUES ('10019', 'user019@example.com', '13800138019', '$2a$10$OsVRHKowu.mVT4GNxzZ3/eo8xEABkWsUGAt4nV5nalzOXW47vtBmC', '朱二一', '朱', '法务专员', '福州', '2025-12-03 09:53:49.000', '2025-12-03 09:53:49.000');
INSERT INTO `users` VALUES ('10020', 'user020@example.com', '13800138020', '$2a$10$OsVRHKowu.mVT4GNxzZ3/eo8xEABkWsUGAt4nV5nalzOXW47vtBmC', '秦二二', '秦', '行政助理', '合肥', '2025-12-03 09:53:49.000', '2025-12-03 09:53:49.000');

-- ----------------------------
-- Table structure for verification_codes
-- ----------------------------
DROP TABLE IF EXISTS `verification_codes`;
CREATE TABLE `verification_codes`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `target` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '邮箱或手机号',
  `code` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '验证码',
  `type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '类型',
  `expires_at` datetime NULL DEFAULT NULL COMMENT '过期时间',
  `created_at` datetime(3) NULL DEFAULT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `idx_verification_codes_target`(`target` ASC) USING BTREE,
  INDEX `idx_verification_codes_expires_at`(`expires_at` ASC) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '验证码表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of verification_codes
-- ----------------------------

SET FOREIGN_KEY_CHECKS = 1;
