/*
 直播系统完整数据库表
 
 包含所有管理端功能所需的数据库表
 合并自: zhibo_live_tables.sql + zhibo_live_tables_update.sql
 
 Date: 2025-12-30
 
 使用说明:
 1. 此文件包含所有直播系统扩展表的完整定义
 2. 使用 DROP TABLE IF EXISTS 确保可重复执行
 3. 建议在执行前备份现有数据
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ============================================
-- 家族管理相关表
-- ============================================

-- ----------------------------
-- Table structure for eb_family (家族管理)
-- ----------------------------
DROP TABLE IF EXISTS `eb_family`;
CREATE TABLE `eb_family` (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '家族名称',
  `owner_id` int UNSIGNED NOT NULL COMMENT '族长用户ID',
  `owner_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '族长昵称',
  `logo` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '家族Logo',
  `description` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '家族简介',
  `member_count` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '成员数量',
  `level` int UNSIGNED NOT NULL DEFAULT 1 COMMENT '家族等级',
  `total_income` decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '家族总收入',
  `status` tinyint NOT NULL DEFAULT 1 COMMENT '状态 0=禁用 1=正常',
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_owner_id` (`owner_id`) USING BTREE,
  KEY `idx_status` (`status`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '家族管理表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for eb_family_member (家族成员)
-- ----------------------------
DROP TABLE IF EXISTS `eb_family_member`;
CREATE TABLE `eb_family_member` (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `family_id` int UNSIGNED NOT NULL COMMENT '家族ID',
  `uid` int UNSIGNED NOT NULL COMMENT '用户ID',
  `nickname` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '用户昵称',
  `role` tinyint NOT NULL DEFAULT 0 COMMENT '角色 0=成员 1=管理员 2=族长',
  `contribution` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '贡献值',
  `join_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '加入时间',
  `status` tinyint NOT NULL DEFAULT 1 COMMENT '状态 0=已退出 1=正常',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_family_id` (`family_id`) USING BTREE,
  KEY `idx_uid` (`uid`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '家族成员表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for eb_family_level (家族等级)
-- ----------------------------
DROP TABLE IF EXISTS `eb_family_level`;
CREATE TABLE `eb_family_level` (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `level` int UNSIGNED NOT NULL COMMENT '等级',
  `name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '等级名称',
  `icon` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '等级图标',
  `min_contribution` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '最低贡献值',
  `max_member` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '最大成员数',
  `privileges` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '等级特权(JSON)',
  `status` tinyint NOT NULL DEFAULT 1 COMMENT '状态 0=禁用 1=启用',
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE KEY `uk_level` (`level`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '家族等级表' ROW_FORMAT = DYNAMIC;

-- ============================================
-- 动态与社交相关表
-- ============================================

-- ----------------------------
-- Table structure for eb_dynamic (动态管理)
-- ----------------------------
DROP TABLE IF EXISTS `eb_dynamic`;
CREATE TABLE `eb_dynamic` (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `uid` int UNSIGNED NOT NULL COMMENT '用户ID',
  `nickname` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '用户昵称',
  `avatar` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '用户头像',
  `content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '动态内容',
  `images` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '图片列表(JSON)',
  `video` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '视频地址',
  `location` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '位置信息',
  `like_count` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '点赞数',
  `comment_count` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '评论数',
  `share_count` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '分享数',
  `view_count` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '浏览数',
  `is_top` tinyint NOT NULL DEFAULT 0 COMMENT '是否置顶 0=否 1=是',
  `status` tinyint NOT NULL DEFAULT 1 COMMENT '状态 0=已删除 1=正常 2=审核中',
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_uid` (`uid`) USING BTREE,
  KEY `idx_status` (`status`) USING BTREE,
  KEY `idx_create_time` (`create_time`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '动态管理表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for eb_dynamic_comment (动态评论)
-- ----------------------------
DROP TABLE IF EXISTS `eb_dynamic_comment`;
CREATE TABLE `eb_dynamic_comment` (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `dynamic_id` int UNSIGNED NOT NULL COMMENT '动态ID',
  `uid` int UNSIGNED NOT NULL COMMENT '评论用户ID',
  `nickname` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '用户昵称',
  `avatar` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '用户头像',
  `content` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '评论内容',
  `reply_id` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '回复的评论ID',
  `reply_uid` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '回复的用户ID',
  `like_count` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '点赞数',
  `status` tinyint NOT NULL DEFAULT 1 COMMENT '状态 0=已删除 1=正常',
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_dynamic_id` (`dynamic_id`) USING BTREE,
  KEY `idx_uid` (`uid`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '动态评论表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for eb_follow (关注记录)
-- ----------------------------
DROP TABLE IF EXISTS `eb_follow`;
CREATE TABLE `eb_follow` (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `uid` int UNSIGNED NOT NULL COMMENT '用户ID',
  `nickname` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '用户昵称',
  `follow_uid` int UNSIGNED NOT NULL COMMENT '被关注用户ID',
  `follow_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '被关注用户昵称',
  `is_mutual` tinyint NOT NULL DEFAULT 0 COMMENT '是否互相关注 0=否 1=是',
  `status` tinyint NOT NULL DEFAULT 1 COMMENT '状态 0=已取消 1=关注中',
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '关注时间',
  `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_uid` (`uid`) USING BTREE,
  KEY `idx_follow_uid` (`follow_uid`) USING BTREE,
  UNIQUE KEY `uk_uid_follow` (`uid`, `follow_uid`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '关注记录表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for eb_friend (好友关系)
-- ----------------------------
DROP TABLE IF EXISTS `eb_friend`;
CREATE TABLE `eb_friend` (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `uid` int UNSIGNED NOT NULL COMMENT '用户ID',
  `friend_uid` int UNSIGNED NOT NULL COMMENT '好友用户ID',
  `remark` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '备注名',
  `status` tinyint NOT NULL DEFAULT 1 COMMENT '状态 0=已删除 1=正常',
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '添加时间',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_uid` (`uid`) USING BTREE,
  KEY `idx_friend_uid` (`friend_uid`) USING BTREE,
  UNIQUE KEY `uk_uid_friend` (`uid`, `friend_uid`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '好友关系表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for eb_friend_request (好友申请)
-- ----------------------------
DROP TABLE IF EXISTS `eb_friend_request`;
CREATE TABLE `eb_friend_request` (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `uid` int UNSIGNED NOT NULL COMMENT '申请人ID',
  `nickname` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '申请人昵称',
  `target_uid` int UNSIGNED NOT NULL COMMENT '目标用户ID',
  `message` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '申请消息',
  `status` tinyint NOT NULL DEFAULT 0 COMMENT '状态 0=待处理 1=已同意 2=已拒绝 3=已过期',
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '申请时间',
  `handle_time` datetime NULL DEFAULT NULL COMMENT '处理时间',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_uid` (`uid`) USING BTREE,
  KEY `idx_target_uid` (`target_uid`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '好友申请表' ROW_FORMAT = DYNAMIC;

-- ============================================
-- 粉丝团相关表
-- ============================================

-- ----------------------------
-- Table structure for eb_fan_group (粉丝团)
-- ----------------------------
DROP TABLE IF EXISTS `eb_fan_group`;
CREATE TABLE `eb_fan_group` (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `anchor_id` int UNSIGNED NOT NULL COMMENT '主播ID',
  `anchor_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '主播昵称',
  `name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '粉丝团名称',
  `badge` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '粉丝团徽章',
  `badge_color` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '#FF6B6B' COMMENT '徽章颜色',
  `member_count` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '成员数量',
  `status` tinyint NOT NULL DEFAULT 1 COMMENT '状态 0=已解散 1=正常',
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_anchor_id` (`anchor_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '粉丝团表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for eb_fan_group_member (粉丝团成员)
-- ----------------------------
DROP TABLE IF EXISTS `eb_fan_group_member`;
CREATE TABLE `eb_fan_group_member` (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `group_id` int UNSIGNED NOT NULL COMMENT '粉丝团ID',
  `uid` int UNSIGNED NOT NULL COMMENT '用户ID',
  `nickname` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '用户昵称',
  `level` int UNSIGNED NOT NULL DEFAULT 1 COMMENT '粉丝等级',
  `intimacy` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '亲密度',
  `status` tinyint NOT NULL DEFAULT 1 COMMENT '状态 0=已退出 1=正常',
  `join_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '加入时间',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_group_id` (`group_id`) USING BTREE,
  KEY `idx_uid` (`uid`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '粉丝团成员表' ROW_FORMAT = DYNAMIC;

-- ============================================
-- 通话与会话相关表
-- ============================================

-- ----------------------------
-- Table structure for eb_call (通话记录)
-- ----------------------------
DROP TABLE IF EXISTS `eb_call`;
CREATE TABLE `eb_call` (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `caller_id` int UNSIGNED NOT NULL COMMENT '主叫用户ID',
  `caller_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '主叫昵称',
  `callee_id` int UNSIGNED NOT NULL COMMENT '被叫用户ID',
  `callee_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '被叫昵称',
  `call_type` tinyint NOT NULL DEFAULT 1 COMMENT '通话类型 1=语音 2=视频',
  `duration` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '通话时长(秒)',
  `cost` decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '通话费用',
  `status` tinyint NOT NULL DEFAULT 0 COMMENT '状态 0=未接通 1=已接通 2=已拒绝 3=已取消',
  `start_time` datetime NULL DEFAULT NULL COMMENT '开始时间',
  `end_time` datetime NULL DEFAULT NULL COMMENT '结束时间',
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_caller_id` (`caller_id`) USING BTREE,
  KEY `idx_callee_id` (`callee_id`) USING BTREE,
  KEY `idx_create_time` (`create_time`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '通话记录表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for eb_session (会话记录)
-- ----------------------------
DROP TABLE IF EXISTS `eb_session`;
CREATE TABLE `eb_session` (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `user1_id` int UNSIGNED NOT NULL COMMENT '用户1 ID',
  `user1_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '用户1昵称',
  `user2_id` int UNSIGNED NOT NULL COMMENT '用户2 ID',
  `user2_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '用户2昵称',
  `last_message` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '最后一条消息',
  `last_time` datetime NULL DEFAULT NULL COMMENT '最后消息时间',
  `message_count` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '消息数量',
  `status` tinyint NOT NULL DEFAULT 1 COMMENT '状态 0=已删除 1=正常',
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_user1_id` (`user1_id`) USING BTREE,
  KEY `idx_user2_id` (`user2_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '会话记录表' ROW_FORMAT = DYNAMIC;

-- ============================================
-- 运营管理相关表
-- ============================================

-- ----------------------------
-- Table structure for eb_banner (轮播图)
-- ----------------------------
DROP TABLE IF EXISTS `eb_banner`;
CREATE TABLE `eb_banner` (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `title` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '标题',
  `image` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '图片地址',
  `jump_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '跳转类型',
  `url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '跳转链接',
  `position` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'home' COMMENT '位置 home=首页 live=直播页',
  `sort` int NOT NULL DEFAULT 0 COMMENT '排序',
  `status` tinyint NOT NULL DEFAULT 1 COMMENT '状态 0=禁用 1=启用',
  `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '备注',
  `start_time` datetime NULL DEFAULT NULL COMMENT '开始时间',
  `end_time` datetime NULL DEFAULT NULL COMMENT '结束时间',
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_position` (`position`) USING BTREE,
  KEY `idx_status` (`status`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '轮播图表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for eb_activity (平台活动)
-- ----------------------------
DROP TABLE IF EXISTS `eb_activity`;
CREATE TABLE `eb_activity` (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '活动名称',
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '活动描述',
  `image` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '活动图片',
  `banner` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '活动横幅',
  `type` tinyint NOT NULL DEFAULT 1 COMMENT '活动类型 1=普通活动 2=节日活动 3=运营活动',
  `link_type` tinyint NOT NULL DEFAULT 0 COMMENT '链接类型 0=无 1=内部页面 2=外部链接',
  `link_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '链接地址',
  `start_time` datetime NULL DEFAULT NULL COMMENT '开始时间',
  `end_time` datetime NULL DEFAULT NULL COMMENT '结束时间',
  `sort` int NOT NULL DEFAULT 0 COMMENT '排序',
  `status` tinyint NOT NULL DEFAULT 1 COMMENT '状态 0=禁用 1=启用',
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_status` (`status`) USING BTREE,
  KEY `idx_type` (`type`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '平台活动表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for eb_system_message (系统消息)
-- ----------------------------
DROP TABLE IF EXISTS `eb_system_message`;
CREATE TABLE `eb_system_message` (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `title` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '消息标题',
  `content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '消息内容',
  `type` tinyint NOT NULL DEFAULT 1 COMMENT '类型 1=系统通知 2=活动公告 3=更新公告',
  `target_type` tinyint NOT NULL DEFAULT 0 COMMENT '目标类型 0=全部用户 1=指定用户',
  `target_users` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '目标用户ID列表(JSON)',
  `link_type` tinyint NOT NULL DEFAULT 0 COMMENT '链接类型 0=无 1=内部页面 2=外部链接',
  `link_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '链接地址',
  `is_popup` tinyint NOT NULL DEFAULT 0 COMMENT '是否弹窗 0=否 1=是',
  `send_time` datetime NULL DEFAULT NULL COMMENT '发送时间',
  `status` tinyint NOT NULL DEFAULT 1 COMMENT '状态 0=草稿 1=已发送',
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_type` (`type`) USING BTREE,
  KEY `idx_status` (`status`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '系统消息表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for eb_sensitive_word (敏感词)
-- ----------------------------
DROP TABLE IF EXISTS `eb_sensitive_word`;
CREATE TABLE `eb_sensitive_word` (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `word` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '敏感词',
  `category` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'default' COMMENT '分类',
  `level` tinyint NOT NULL DEFAULT 1 COMMENT '级别 1=轻度 2=中度 3=重度',
  `action` tinyint NOT NULL DEFAULT 1 COMMENT '处理方式 1=替换 2=拦截 3=警告',
  `replace_text` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '***' COMMENT '替换文本',
  `status` tinyint NOT NULL DEFAULT 1 COMMENT '状态 0=禁用 1=启用',
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE KEY `uk_word` (`word`) USING BTREE,
  KEY `idx_category` (`category`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '敏感词表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for eb_chat_phrase (聊天常用语)
-- ----------------------------
DROP TABLE IF EXISTS `eb_chat_phrase`;
CREATE TABLE `eb_chat_phrase` (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `content` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '常用语内容',
  `category` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'default' COMMENT '分类',
  `sort` int NOT NULL DEFAULT 0 COMMENT '排序',
  `status` tinyint NOT NULL DEFAULT 1 COMMENT '状态 0=禁用 1=启用',
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_category` (`category`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '聊天常用语表' ROW_FORMAT = DYNAMIC;

-- ============================================
-- 抽奖活动相关表
-- ============================================

-- ----------------------------
-- Table structure for eb_lottery (抽奖活动)
-- ----------------------------
DROP TABLE IF EXISTS `eb_lottery`;
CREATE TABLE `eb_lottery` (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '活动名称',
  `description` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '活动描述',
  `image` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '活动图片',
  `type` tinyint NOT NULL DEFAULT 1 COMMENT '类型 1=转盘抽奖 2=九宫格',
  `cost_type` tinyint NOT NULL DEFAULT 1 COMMENT '消耗类型 1=钻石 2=金币 3=积分',
  `cost_amount` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '单次消耗数量',
  `daily_limit` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '每日限制次数(0=不限)',
  `total_limit` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '总限制次数(0=不限)',
  `start_time` datetime NULL DEFAULT NULL COMMENT '开始时间',
  `end_time` datetime NULL DEFAULT NULL COMMENT '结束时间',
  `status` tinyint NOT NULL DEFAULT 1 COMMENT '状态 0=禁用 1=启用',
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_status` (`status`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '抽奖活动表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for eb_lottery_prize (抽奖奖品)
-- ----------------------------
DROP TABLE IF EXISTS `eb_lottery_prize`;
CREATE TABLE `eb_lottery_prize` (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `lottery_id` int UNSIGNED NOT NULL COMMENT '抽奖活动ID',
  `name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '奖品名称',
  `image` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '奖品图片',
  `type` tinyint NOT NULL DEFAULT 1 COMMENT '奖品类型 1=钻石 2=金币 3=积分 4=礼物 5=实物 6=谢谢参与',
  `value` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '奖品数值',
  `probability` decimal(5,2) NOT NULL DEFAULT 0.00 COMMENT '中奖概率(%)',
  `stock` int NOT NULL DEFAULT -1 COMMENT '库存(-1=无限)',
  `sort` int NOT NULL DEFAULT 0 COMMENT '排序',
  `status` tinyint NOT NULL DEFAULT 1 COMMENT '状态 0=禁用 1=启用',
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_lottery_id` (`lottery_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '抽奖奖品表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for eb_lottery_record (抽奖记录)
-- ----------------------------
DROP TABLE IF EXISTS `eb_lottery_record`;
CREATE TABLE `eb_lottery_record` (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `lottery_id` int UNSIGNED NOT NULL COMMENT '抽奖活动ID',
  `uid` int UNSIGNED NOT NULL COMMENT '用户ID',
  `nickname` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '用户昵称',
  `prize_id` int UNSIGNED NOT NULL COMMENT '奖品ID',
  `prize_name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '奖品名称',
  `prize_type` tinyint NOT NULL DEFAULT 1 COMMENT '奖品类型',
  `prize_value` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '奖品数值',
  `status` tinyint NOT NULL DEFAULT 0 COMMENT '状态 0=待发放 1=已发放 2=已领取',
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '抽奖时间',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_lottery_id` (`lottery_id`) USING BTREE,
  KEY `idx_uid` (`uid`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '抽奖记录表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for eb_lottery_config (抽奖配置)
-- ----------------------------
DROP TABLE IF EXISTS `eb_lottery_config`;
CREATE TABLE `eb_lottery_config` (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `config_key` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '配置键',
  `config_value` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '配置值',
  `description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '描述',
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE KEY `uk_config_key` (`config_key`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '抽奖配置表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for eb_lottery_probability (抽奖概率配置)
-- ----------------------------
DROP TABLE IF EXISTS `eb_lottery_probability`;
CREATE TABLE `eb_lottery_probability` (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `lottery_id` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '抽奖活动ID(0=全局配置)',
  `user_type` tinyint NOT NULL DEFAULT 0 COMMENT '用户类型 0=普通用户 1=新用户 2=VIP用户',
  `win_rate` decimal(5,2) NOT NULL DEFAULT 100.00 COMMENT '中奖率(%)',
  `big_prize_rate` decimal(5,2) NOT NULL DEFAULT 10.00 COMMENT '大奖概率(%)',
  `daily_win_limit` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '每日中奖上限(0=不限)',
  `status` tinyint NOT NULL DEFAULT 1 COMMENT '状态 0=禁用 1=启用',
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_lottery_id` (`lottery_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '抽奖概率配置表' ROW_FORMAT = DYNAMIC;

-- ============================================
-- 任务与签到相关表
-- ============================================

-- ----------------------------
-- Table structure for eb_novice_task (新手任务)
-- ----------------------------
DROP TABLE IF EXISTS `eb_novice_task`;
CREATE TABLE `eb_novice_task` (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '任务名称',
  `description` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '任务描述',
  `icon` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '任务图标',
  `type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '任务类型',
  `target_value` int UNSIGNED NOT NULL DEFAULT 1 COMMENT '目标值',
  `reward_type` tinyint NOT NULL DEFAULT 1 COMMENT '奖励类型 1=钻石 2=金币 3=积分',
  `reward_value` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '奖励数值',
  `sort` int NOT NULL DEFAULT 0 COMMENT '排序',
  `status` tinyint NOT NULL DEFAULT 1 COMMENT '状态 0=禁用 1=启用',
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '新手任务表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for eb_user_task (用户任务进度)
-- ----------------------------
DROP TABLE IF EXISTS `eb_user_task`;
CREATE TABLE `eb_user_task` (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `uid` int UNSIGNED NOT NULL COMMENT '用户ID',
  `task_id` int UNSIGNED NOT NULL COMMENT '任务ID',
  `current_value` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '当前进度',
  `status` tinyint NOT NULL DEFAULT 0 COMMENT '状态 0=进行中 1=已完成 2=已领取',
  `complete_time` datetime NULL DEFAULT NULL COMMENT '完成时间',
  `receive_time` datetime NULL DEFAULT NULL COMMENT '领取时间',
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE KEY `uk_uid_task` (`uid`, `task_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户任务进度表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for eb_user_task_record (用户任务记录)
-- ----------------------------
DROP TABLE IF EXISTS `eb_user_task_record`;
CREATE TABLE `eb_user_task_record` (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `uid` int UNSIGNED NOT NULL COMMENT '用户ID',
  `user_nickname` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '用户昵称',
  `task_id` int UNSIGNED NOT NULL COMMENT '任务ID',
  `task_name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '任务名称',
  `reward_type` tinyint NOT NULL DEFAULT 1 COMMENT '奖励类型',
  `reward_value` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '奖励数值',
  `status` tinyint NOT NULL DEFAULT 0 COMMENT '状态 0=进行中 1=已完成 2=已领取',
  `complete_time` datetime NULL DEFAULT NULL COMMENT '完成时间',
  `receive_time` datetime NULL DEFAULT NULL COMMENT '领取时间',
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_uid` (`uid`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户任务记录表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for eb_sign_config (签到配置)
-- ----------------------------
DROP TABLE IF EXISTS `eb_sign_config`;
CREATE TABLE `eb_sign_config` (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `day` int UNSIGNED NOT NULL COMMENT '签到天数',
  `reward_type` tinyint NOT NULL DEFAULT 1 COMMENT '奖励类型 1=钻石 2=金币 3=积分',
  `reward_amount` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '奖励数量',
  `is_double` tinyint NOT NULL DEFAULT 0 COMMENT '是否双倍 0=否 1=是',
  `status` tinyint NOT NULL DEFAULT 1 COMMENT '状态 0=禁用 1=启用',
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE KEY `uk_day` (`day`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '签到配置表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for eb_user_sign (用户签到记录)
-- ----------------------------
DROP TABLE IF EXISTS `eb_user_sign`;
CREATE TABLE `eb_user_sign` (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `uid` int UNSIGNED NOT NULL COMMENT '用户ID',
  `sign_date` date NOT NULL COMMENT '签到日期',
  `continuous_days` int UNSIGNED NOT NULL DEFAULT 1 COMMENT '连续签到天数',
  `reward_type` tinyint NOT NULL DEFAULT 1 COMMENT '奖励类型',
  `reward_amount` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '奖励数量',
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '签到时间',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE KEY `uk_uid_date` (`uid`, `sign_date`) USING BTREE,
  KEY `idx_uid` (`uid`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户签到记录表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for eb_user_signin_record (用户签到记录-扩展)
-- ----------------------------
DROP TABLE IF EXISTS `eb_user_signin_record`;
CREATE TABLE `eb_user_signin_record` (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `uid` int UNSIGNED NOT NULL COMMENT '用户ID',
  `user_nickname` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '用户昵称',
  `sign_date` date NOT NULL COMMENT '签到日期',
  `continuous_days` int UNSIGNED NOT NULL DEFAULT 1 COMMENT '连续签到天数',
  `reward_type` tinyint NOT NULL DEFAULT 1 COMMENT '奖励类型',
  `reward_value` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '奖励数值',
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '签到时间',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_uid` (`uid`) USING BTREE,
  UNIQUE KEY `uk_uid_date` (`uid`, `sign_date`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户签到记录表' ROW_FORMAT = DYNAMIC;

-- ============================================
-- 用户管理相关表
-- ============================================

-- ----------------------------
-- Table structure for eb_blacklist (黑名单)
-- ----------------------------
DROP TABLE IF EXISTS `eb_blacklist`;
CREATE TABLE `eb_blacklist` (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `uid` int UNSIGNED NOT NULL COMMENT '用户ID',
  `nickname` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '用户昵称',
  `blocked_uid` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '被拉黑用户ID(用户黑名单)',
  `blocked_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '被拉黑用户昵称',
  `room_id` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '房间ID(房间黑名单)',
  `type` tinyint NOT NULL DEFAULT 1 COMMENT '类型 1=用户黑名单 2=房间黑名单 3=平台黑名单',
  `reason` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '拉黑原因',
  `expire_time` datetime NULL DEFAULT NULL COMMENT '过期时间(NULL为永久)',
  `operator_id` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '操作人ID',
  `status` tinyint NOT NULL DEFAULT 1 COMMENT '状态 0=已解除 1=生效中',
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_uid` (`uid`) USING BTREE,
  KEY `idx_blocked_uid` (`blocked_uid`) USING BTREE,
  KEY `idx_room_id` (`room_id`) USING BTREE,
  KEY `idx_type` (`type`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '黑名单表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for eb_charm_level (魅力等级)
-- ----------------------------
DROP TABLE IF EXISTS `eb_charm_level`;
CREATE TABLE `eb_charm_level` (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `level` int UNSIGNED NOT NULL COMMENT '等级',
  `name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '等级名称',
  `icon` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '等级图标',
  `min_charm` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '最低魅力值',
  `max_charm` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '最高魅力值',
  `privileges` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '等级特权(JSON)',
  `status` tinyint NOT NULL DEFAULT 1 COMMENT '状态 0=禁用 1=启用',
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE KEY `uk_level` (`level`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '魅力等级表' ROW_FORMAT = DYNAMIC;

-- ============================================
-- 审核管理相关表
-- ============================================

-- ----------------------------
-- Table structure for eb_appeal (申诉)
-- ----------------------------
DROP TABLE IF EXISTS `eb_appeal`;
CREATE TABLE `eb_appeal` (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `uid` int UNSIGNED NOT NULL COMMENT '用户ID',
  `nickname` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '用户昵称',
  `type` tinyint NOT NULL DEFAULT 1 COMMENT '申诉类型 1=封号申诉 2=禁言申诉 3=处罚申诉',
  `reason` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '申诉原因',
  `images` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '证据图片(JSON)',
  `contact` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '联系方式',
  `status` tinyint NOT NULL DEFAULT 0 COMMENT '状态 0=待处理 1=处理中 2=已通过 3=已拒绝',
  `reply` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '处理回复',
  `operator_id` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '处理人ID',
  `handle_time` datetime NULL DEFAULT NULL COMMENT '处理时间',
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_uid` (`uid`) USING BTREE,
  KEY `idx_status` (`status`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '申诉表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for eb_certification (认证)
-- ----------------------------
DROP TABLE IF EXISTS `eb_certification`;
CREATE TABLE `eb_certification` (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `uid` int UNSIGNED NOT NULL COMMENT '用户ID',
  `nickname` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '用户昵称',
  `type` tinyint NOT NULL DEFAULT 1 COMMENT '认证类型 1=实名认证 2=主播认证 3=公会认证',
  `real_name` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '真实姓名',
  `id_card` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '身份证号',
  `id_card_front` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '身份证正面',
  `id_card_back` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '身份证反面',
  `hold_id_card` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '手持身份证',
  `status` tinyint NOT NULL DEFAULT 0 COMMENT '状态 0=待审核 1=审核通过 2=审核拒绝',
  `reject_reason` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '拒绝原因',
  `operator_id` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '审核人ID',
  `audit_time` datetime NULL DEFAULT NULL COMMENT '审核时间',
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_uid` (`uid`) USING BTREE,
  KEY `idx_status` (`status`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '认证表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for eb_report (举报)
-- ----------------------------
DROP TABLE IF EXISTS `eb_report`;
CREATE TABLE `eb_report` (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `uid` int UNSIGNED NOT NULL COMMENT '举报人ID',
  `nickname` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '举报人昵称',
  `target_type` tinyint NOT NULL DEFAULT 1 COMMENT '举报目标类型 1=用户 2=直播间 3=动态 4=评论',
  `target_id` int UNSIGNED NOT NULL COMMENT '举报目标ID',
  `target_name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '举报目标名称',
  `reason_type` tinyint NOT NULL DEFAULT 1 COMMENT '举报原因类型',
  `reason` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '举报原因详情',
  `images` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '证据图片(JSON)',
  `status` tinyint NOT NULL DEFAULT 0 COMMENT '状态 0=待处理 1=处理中 2=已处理 3=已忽略',
  `result` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '处理结果',
  `operator_id` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '处理人ID',
  `handle_time` datetime NULL DEFAULT NULL COMMENT '处理时间',
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_uid` (`uid`) USING BTREE,
  KEY `idx_target` (`target_type`, `target_id`) USING BTREE,
  KEY `idx_status` (`status`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '举报表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for eb_feedback (用户反馈)
-- ----------------------------
DROP TABLE IF EXISTS `eb_feedback`;
CREATE TABLE `eb_feedback` (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `uid` int UNSIGNED NOT NULL COMMENT '用户ID',
  `nickname` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '用户昵称',
  `type` tinyint NOT NULL DEFAULT 1 COMMENT '反馈类型 1=功能建议 2=BUG反馈 3=其他',
  `content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '反馈内容',
  `images` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '图片(JSON)',
  `contact` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '联系方式',
  `status` tinyint NOT NULL DEFAULT 0 COMMENT '状态 0=待处理 1=处理中 2=已处理',
  `reply` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '回复内容',
  `operator_id` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '处理人ID',
  `handle_time` datetime NULL DEFAULT NULL COMMENT '处理时间',
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_uid` (`uid`) USING BTREE,
  KEY `idx_status` (`status`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户反馈表' ROW_FORMAT = DYNAMIC;

-- ============================================
-- 财务管理相关表
-- ============================================

-- ----------------------------
-- Table structure for eb_withdraw (提现)
-- ----------------------------
DROP TABLE IF EXISTS `eb_withdraw`;
CREATE TABLE `eb_withdraw` (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `uid` int UNSIGNED NOT NULL COMMENT '用户ID',
  `nickname` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '用户昵称',
  `amount` decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '提现金额',
  `fee` decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '手续费',
  `actual_amount` decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '实际到账金额',
  `withdraw_type` tinyint NOT NULL DEFAULT 1 COMMENT '提现方式 1=支付宝 2=微信 3=银行卡',
  `account` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '提现账号',
  `account_name` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '账户姓名',
  `bank_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '银行名称',
  `status` tinyint NOT NULL DEFAULT 0 COMMENT '状态 0=待审核 1=审核通过 2=已打款 3=已拒绝',
  `reject_reason` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '拒绝原因',
  `operator_id` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '处理人ID',
  `audit_time` datetime NULL DEFAULT NULL COMMENT '审核时间',
  `pay_time` datetime NULL DEFAULT NULL COMMENT '打款时间',
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_uid` (`uid`) USING BTREE,
  KEY `idx_status` (`status`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '提现表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for eb_withdraw_amount (提现金额配置)
-- ----------------------------
DROP TABLE IF EXISTS `eb_withdraw_amount`;
CREATE TABLE `eb_withdraw_amount` (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `amount` decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '提现金额',
  `fee_type` tinyint NOT NULL DEFAULT 1 COMMENT '手续费类型 1=固定金额 2=百分比',
  `fee_value` decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '手续费值',
  `min_balance` decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '最低余额要求',
  `sort` int NOT NULL DEFAULT 0 COMMENT '排序',
  `status` tinyint NOT NULL DEFAULT 1 COMMENT '状态 0=禁用 1=启用',
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '提现金额配置表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for eb_coin_exchange_config (金币兑换配置)
-- ----------------------------
DROP TABLE IF EXISTS `eb_coin_exchange_config`;
CREATE TABLE `eb_coin_exchange_config` (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `exchange_ratio` decimal(10,4) NOT NULL DEFAULT 1.0000 COMMENT '兑换比例(1钻石=X金币)',
  `fee_ratio` decimal(5,2) NOT NULL DEFAULT 0.00 COMMENT '手续费比例(%)',
  `min_amount` int UNSIGNED NOT NULL DEFAULT 1 COMMENT '最低兑换数量',
  `max_amount` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '最高兑换数量(0=不限)',
  `daily_limit` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '每日限制次数(0=不限)',
  `status` tinyint NOT NULL DEFAULT 1 COMMENT '状态 0=禁用 1=启用',
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '金币兑换配置表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for eb_recharge_order (充值订单)
-- ----------------------------
DROP TABLE IF EXISTS `eb_recharge_order`;
CREATE TABLE `eb_recharge_order` (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `order_no` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '订单号',
  `uid` int UNSIGNED NOT NULL COMMENT '用户ID',
  `nickname` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '用户昵称',
  `amount` decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '充值金额',
  `diamond_amount` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '钻石数量',
  `gift_amount` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '赠送数量',
  `pay_type` tinyint NOT NULL DEFAULT 1 COMMENT '支付方式 1=支付宝 2=微信 3=苹果支付',
  `pay_time` datetime NULL DEFAULT NULL COMMENT '支付时间',
  `status` tinyint NOT NULL DEFAULT 0 COMMENT '状态 0=待支付 1=已支付 2=已取消 3=已退款',
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE KEY `uk_order_no` (`order_no`) USING BTREE,
  KEY `idx_uid` (`uid`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '充值订单表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for eb_exchange_record (兑换记录)
-- ----------------------------
DROP TABLE IF EXISTS `eb_exchange_record`;
CREATE TABLE `eb_exchange_record` (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `uid` int UNSIGNED NOT NULL COMMENT '用户ID',
  `nickname` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '用户昵称',
  `from_type` tinyint NOT NULL DEFAULT 1 COMMENT '来源类型 1=钻石 2=金币',
  `from_amount` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '来源数量',
  `to_type` tinyint NOT NULL DEFAULT 2 COMMENT '目标类型 1=钻石 2=金币',
  `to_amount` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '目标数量',
  `fee` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '手续费',
  `exchange_rate` decimal(10,4) NOT NULL DEFAULT 1.0000 COMMENT '兑换比例',
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '兑换时间',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_uid` (`uid`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '兑换记录表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for eb_diamond_recharge_amount (钻石充值金额配置)
-- ----------------------------
DROP TABLE IF EXISTS `eb_diamond_recharge_amount`;
CREATE TABLE `eb_diamond_recharge_amount` (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '配置名称',
  `diamond_amount` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '钻石数量',
  `price` decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '价格(元)',
  `gift_amount` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '赠送钻石数量',
  `first_gift` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '首充赠送',
  `is_hot` tinyint NOT NULL DEFAULT 0 COMMENT '是否热销 0=否 1=是',
  `is_recommend` tinyint NOT NULL DEFAULT 0 COMMENT '是否推荐 0=否 1=是',
  `sort` int NOT NULL DEFAULT 0 COMMENT '排序',
  `status` tinyint NOT NULL DEFAULT 1 COMMENT '状态 0=禁用 1=启用',
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '钻石充值金额配置表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for eb_gold_diamond_config (金币钻石配置)
-- ----------------------------
DROP TABLE IF EXISTS `eb_gold_diamond_config`;
CREATE TABLE `eb_gold_diamond_config` (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `type` tinyint NOT NULL DEFAULT 1 COMMENT '类型 1=钻石充值 2=金币兑换',
  `name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '配置名称',
  `amount` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '数量',
  `price` decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '价格(元)',
  `gift_amount` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '赠送数量',
  `is_hot` tinyint NOT NULL DEFAULT 0 COMMENT '是否热销 0=否 1=是',
  `sort` int NOT NULL DEFAULT 0 COMMENT '排序',
  `status` tinyint NOT NULL DEFAULT 1 COMMENT '状态 0=禁用 1=启用',
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_type` (`type`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '金币钻石配置表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for eb_gift_record (礼物记录)
-- ----------------------------
DROP TABLE IF EXISTS `eb_gift_record`;
CREATE TABLE `eb_gift_record` (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `sender_id` int UNSIGNED NOT NULL COMMENT '送礼人ID',
  `sender_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '送礼人昵称',
  `receiver_id` int UNSIGNED NOT NULL COMMENT '收礼人ID',
  `receiver_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '收礼人昵称',
  `room_id` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '房间ID',
  `gift_id` int UNSIGNED NOT NULL COMMENT '礼物ID',
  `gift_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '礼物名称',
  `gift_price` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '礼物单价',
  `quantity` int UNSIGNED NOT NULL DEFAULT 1 COMMENT '数量',
  `total_price` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '总价',
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_sender_id` (`sender_id`) USING BTREE,
  KEY `idx_receiver_id` (`receiver_id`) USING BTREE,
  KEY `idx_room_id` (`room_id`) USING BTREE,
  KEY `idx_create_time` (`create_time`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '礼物记录表' ROW_FORMAT = DYNAMIC;

-- ============================================
-- 代理商相关表
-- ============================================

-- ----------------------------
-- Table structure for eb_agent (代理商)
-- ----------------------------
DROP TABLE IF EXISTS `eb_agent`;
CREATE TABLE `eb_agent` (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '代理商名称',
  `contact` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '联系人',
  `phone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '联系电话',
  `email` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '邮箱',
  `level` int UNSIGNED NOT NULL DEFAULT 1 COMMENT '代理等级',
  `commission_rate` decimal(5,2) NOT NULL DEFAULT 0.00 COMMENT '佣金比例(%)',
  `total_income` decimal(12,2) NOT NULL DEFAULT 0.00 COMMENT '累计收入',
  `balance` decimal(12,2) NOT NULL DEFAULT 0.00 COMMENT '可提现余额',
  `user_count` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '下级用户数',
  `status` tinyint NOT NULL DEFAULT 1 COMMENT '状态 0=禁用 1=启用',
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '代理商表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for eb_agent_message (代理商消息)
-- ----------------------------
DROP TABLE IF EXISTS `eb_agent_message`;
CREATE TABLE `eb_agent_message` (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `agent_id` int UNSIGNED NOT NULL COMMENT '代理商ID',
  `title` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '消息标题',
  `content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '消息内容',
  `type` tinyint NOT NULL DEFAULT 1 COMMENT '消息类型 1=系统通知 2=收益通知',
  `is_read` tinyint NOT NULL DEFAULT 0 COMMENT '是否已读 0=未读 1=已读',
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_agent_id` (`agent_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '代理商消息表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for eb_agent_withdraw (代理商提现)
-- ----------------------------
DROP TABLE IF EXISTS `eb_agent_withdraw`;
CREATE TABLE `eb_agent_withdraw` (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `agent_id` int UNSIGNED NOT NULL COMMENT '代理商ID',
  `agent_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '代理商名称',
  `amount` decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '提现金额',
  `fee` decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '手续费',
  `actual_amount` decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '实际到账',
  `withdraw_type` tinyint NOT NULL DEFAULT 1 COMMENT '提现方式 1=支付宝 2=微信 3=银行卡',
  `account` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '提现账号',
  `account_name` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '账户姓名',
  `status` tinyint NOT NULL DEFAULT 0 COMMENT '状态 0=待审核 1=已通过 2=已打款 3=已拒绝',
  `reject_reason` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '拒绝原因',
  `operator_id` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '处理人ID',
  `audit_time` datetime NULL DEFAULT NULL COMMENT '审核时间',
  `pay_time` datetime NULL DEFAULT NULL COMMENT '打款时间',
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_agent_id` (`agent_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '代理商提现表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for eb_invite (邀请记录)
-- ----------------------------
DROP TABLE IF EXISTS `eb_invite`;
CREATE TABLE `eb_invite` (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `inviter_id` int UNSIGNED NOT NULL COMMENT '邀请人ID',
  `inviter_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '邀请人昵称',
  `invitee_id` int UNSIGNED NOT NULL COMMENT '被邀请人ID',
  `invitee_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '被邀请人昵称',
  `invite_code` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '邀请码',
  `reward_type` tinyint NOT NULL DEFAULT 1 COMMENT '奖励类型 1=钻石 2=金币',
  `reward_amount` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '奖励数量',
  `status` tinyint NOT NULL DEFAULT 0 COMMENT '状态 0=待发放 1=已发放',
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '邀请时间',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_inviter_id` (`inviter_id`) USING BTREE,
  KEY `idx_invitee_id` (`invitee_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '邀请记录表' ROW_FORMAT = DYNAMIC;

-- ============================================
-- 系统配置相关表
-- ============================================

-- ----------------------------
-- Table structure for eb_client_version (客户端版本)
-- ----------------------------
DROP TABLE IF EXISTS `eb_client_version`;
CREATE TABLE `eb_client_version` (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `platform` tinyint NOT NULL DEFAULT 1 COMMENT '平台 1=Android 2=iOS',
  `version` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '版本号',
  `version_code` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '版本代码',
  `download_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '下载地址',
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '更新说明',
  `is_force` tinyint NOT NULL DEFAULT 0 COMMENT '是否强制更新 0=否 1=是',
  `min_version` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '最低支持版本',
  `status` tinyint NOT NULL DEFAULT 1 COMMENT '状态 0=禁用 1=启用',
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_platform` (`platform`) USING BTREE,
  KEY `idx_version_code` (`version_code`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '客户端版本表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for eb_system_version (系统版本)
-- ----------------------------
DROP TABLE IF EXISTS `eb_system_version`;
CREATE TABLE `eb_system_version` (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `version_name` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '版本名称',
  `version_number` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '版本号',
  `channel` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'android' COMMENT '渠道 android/ios',
  `is_valid` tinyint NOT NULL DEFAULT 1 COMMENT '是否有效 0=否 1=是',
  `is_force_update` tinyint NOT NULL DEFAULT 0 COMMENT '是否强制更新 0=否 1=是',
  `download_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '下载地址',
  `jump_link` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '跳转链接',
  `update_content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '更新内容',
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_channel` (`channel`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '系统版本表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for eb_customer_service (客服联系方式)
-- ----------------------------
DROP TABLE IF EXISTS `eb_customer_service`;
CREATE TABLE `eb_customer_service` (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '客服名称',
  `type` tinyint NOT NULL DEFAULT 1 COMMENT '类型 1=QQ 2=微信 3=电话 4=邮箱',
  `contact` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '联系方式',
  `qrcode` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '二维码图片',
  `work_time` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '工作时间',
  `sort` int NOT NULL DEFAULT 0 COMMENT '排序',
  `status` tinyint NOT NULL DEFAULT 1 COMMENT '状态 0=禁用 1=启用',
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '客服联系方式表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for eb_customer_service_group (客服分组)
-- ----------------------------
DROP TABLE IF EXISTS `eb_customer_service_group`;
CREATE TABLE `eb_customer_service_group` (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '分组名称',
  `description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '分组描述',
  `sort` int NOT NULL DEFAULT 0 COMMENT '排序',
  `status` tinyint NOT NULL DEFAULT 1 COMMENT '状态 0=禁用 1=启用',
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '客服分组表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for eb_chat_pay_config (聊天付费配置)
-- ----------------------------
DROP TABLE IF EXISTS `eb_chat_pay_config`;
CREATE TABLE `eb_chat_pay_config` (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '类型 text=文字 voice=语音 video=视频',
  `name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '配置名称',
  `price` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '单价(钻石)',
  `unit` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '计费单位 条/分钟',
  `free_duration` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '免费时长(秒)',
  `description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '描述',
  `status` tinyint NOT NULL DEFAULT 1 COMMENT '状态 0=禁用 1=启用',
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_type` (`type`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '聊天付费配置表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for eb_match_text (匹配文案)
-- ----------------------------
DROP TABLE IF EXISTS `eb_match_text`;
CREATE TABLE `eb_match_text` (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `content` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '文案内容',
  `type` tinyint NOT NULL DEFAULT 1 COMMENT '类型 1=匹配中 2=匹配成功 3=匹配失败',
  `sort` int NOT NULL DEFAULT 0 COMMENT '排序',
  `status` tinyint NOT NULL DEFAULT 1 COMMENT '状态 0=禁用 1=启用',
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '匹配文案表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for eb_member_package (会员套餐)
-- ----------------------------
DROP TABLE IF EXISTS `eb_member_package`;
CREATE TABLE `eb_member_package` (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '套餐名称',
  `description` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '套餐描述',
  `icon` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '套餐图标',
  `duration` int UNSIGNED NOT NULL DEFAULT 30 COMMENT '有效期(天)',
  `original_price` decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '原价',
  `price` decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '现价',
  `privileges` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '特权列表(JSON)',
  `is_hot` tinyint NOT NULL DEFAULT 0 COMMENT '是否热销 0=否 1=是',
  `sort` int NOT NULL DEFAULT 0 COMMENT '排序',
  `status` tinyint NOT NULL DEFAULT 1 COMMENT '状态 0=禁用 1=启用',
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '会员套餐表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for eb_platform_activity (平台活动-旧表兼容)
-- ----------------------------
DROP TABLE IF EXISTS `eb_platform_activity`;
CREATE TABLE `eb_platform_activity` (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `title` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '活动标题',
  `cover` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '封面图',
  `content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '活动内容',
  `status` tinyint NOT NULL DEFAULT 1 COMMENT '状态 0=禁用 1=启用',
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '平台活动表(旧)' ROW_FORMAT = DYNAMIC;

-- ============================================
-- 默认数据插入
-- ============================================

-- 插入默认金币兑换配置
INSERT INTO `eb_coin_exchange_config` VALUES (1, 10.0000, 0.00, 1, 0, 0, 1, NOW(), NOW());

-- 插入默认签到配置
INSERT INTO `eb_sign_config` (`day`, `reward_type`, `reward_amount`) VALUES 
(1, 1, 10), (2, 1, 20), (3, 1, 30), (4, 1, 40), (5, 1, 50), (6, 1, 60), (7, 1, 100);

-- 插入默认抽奖配置
INSERT INTO `eb_lottery_config` (`config_key`, `config_value`, `description`) VALUES 
('lottery_cost_diamond', '10', '抽奖消耗钻石数');

SET FOREIGN_KEY_CHECKS = 1;

-- ============================================
-- 数据库表统计
-- ============================================
/*
本SQL文件包含以下数据库表(共55个):

【家族管理】
1. eb_family - 家族管理表
2. eb_family_member - 家族成员表
3. eb_family_level - 家族等级表

【动态与社交】
4. eb_dynamic - 动态管理表
5. eb_dynamic_comment - 动态评论表
6. eb_follow - 关注记录表
7. eb_friend - 好友关系表
8. eb_friend_request - 好友申请表

【粉丝团】
9. eb_fan_group - 粉丝团表
10. eb_fan_group_member - 粉丝团成员表

【通话与会话】
11. eb_call - 通话记录表
12. eb_session - 会话记录表

【运营管理】
13. eb_banner - 轮播图表
14. eb_activity - 平台活动表
15. eb_system_message - 系统消息表
16. eb_sensitive_word - 敏感词表
17. eb_chat_phrase - 聊天常用语表

【抽奖活动】
18. eb_lottery - 抽奖活动表
19. eb_lottery_prize - 抽奖奖品表
20. eb_lottery_record - 抽奖记录表
21. eb_lottery_config - 抽奖配置表
22. eb_lottery_probability - 抽奖概率配置表

【任务与签到】
23. eb_novice_task - 新手任务表
24. eb_user_task - 用户任务进度表
25. eb_user_task_record - 用户任务记录表
26. eb_sign_config - 签到配置表
27. eb_user_sign - 用户签到记录表
28. eb_user_signin_record - 用户签到记录表(扩展)

【用户管理】
29. eb_blacklist - 黑名单表
30. eb_charm_level - 魅力等级表

【审核管理】
31. eb_appeal - 申诉表
32. eb_certification - 认证表
33. eb_report - 举报表
34. eb_feedback - 用户反馈表

【财务管理】
35. eb_withdraw - 提现表
36. eb_withdraw_amount - 提现金额配置表
37. eb_coin_exchange_config - 金币兑换配置表
38. eb_recharge_order - 充值订单表
39. eb_exchange_record - 兑换记录表
40. eb_diamond_recharge_amount - 钻石充值金额配置表
41. eb_gold_diamond_config - 金币钻石配置表
42. eb_gift_record - 礼物记录表

【代理商】
43. eb_agent - 代理商表
44. eb_agent_message - 代理商消息表
45. eb_agent_withdraw - 代理商提现表
46. eb_invite - 邀请记录表

【系统配置】
47. eb_client_version - 客户端版本表
48. eb_system_version - 系统版本表
49. eb_customer_service - 客服联系方式表
50. eb_customer_service_group - 客服分组表
51. eb_chat_pay_config - 聊天付费配置表
52. eb_match_text - 匹配文案表
53. eb_member_package - 会员套餐表
54. eb_platform_activity - 平台活动表(旧)

使用说明:
1. 在MySQL客户端或管理工具中执行此SQL文件
2. 确保数据库字符集为utf8mb4
3. 建议在执行前备份现有数据
4. 如果表已存在会先删除再创建(DROP TABLE IF EXISTS)
*/
