fix: 新增后台账号数据,本地ip解析

This commit is contained in:
乾乾
2025-12-03 15:18:56 +08:00
parent d152fea9fc
commit 8cdc3cf98c
118 changed files with 329 additions and 276 deletions
+17 -20
View File
@@ -11,7 +11,7 @@
Target Server Version : 80030 (8.0.30)
File Encoding : 65001
Date: 26/11/2025 08:05:50
Date: 03/12/2025 15:16:20
*/
SET NAMES utf8mb4;
@@ -37,7 +37,7 @@ CREATE TABLE `ai_api_key` (
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 98364012618753 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'AI API 密钥表' ROW_FORMAT = Dynamic;
) ENGINE = InnoDB AUTO_INCREMENT = 101622399644673 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'AI API 密钥表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of ai_api_key
@@ -75,7 +75,7 @@ CREATE TABLE `ai_audio` (
INDEX `idx_status`(`status` ASC) USING BTREE,
INDEX `idx_task_id`(`task_id` ASC) USING BTREE,
INDEX `idx_create_time`(`create_time` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 93206302122497 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'AI 音频生成表' ROW_FORMAT = Dynamic;
) ENGINE = InnoDB AUTO_INCREMENT = 100761795572737 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'AI 音频生成表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of ai_audio
@@ -106,7 +106,7 @@ CREATE TABLE `ai_chat_conversation` (
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
`tenant_id` bigint NULL DEFAULT NULL COMMENT '租户编号',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 99658689418753 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'AI 聊天对话表' ROW_FORMAT = Dynamic;
) ENGINE = InnoDB AUTO_INCREMENT = 102357606609921 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'AI 聊天对话表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of ai_chat_conversation
@@ -138,7 +138,7 @@ CREATE TABLE `ai_chat_message` (
`tenant_id` bigint NOT NULL DEFAULT 1 COMMENT '租户编号',
PRIMARY KEY (`id`) USING BTREE,
INDEX `idx_msg_type`(`msg_type` ASC) USING BTREE COMMENT '消息内容类型索引'
) ENGINE = InnoDB AUTO_INCREMENT = 99659553445378 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'AI 聊天消息表' ROW_FORMAT = Dynamic;
) ENGINE = InnoDB AUTO_INCREMENT = 102357791159299 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'AI 聊天消息表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of ai_chat_message
@@ -205,7 +205,7 @@ CREATE TABLE `ai_image` (
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 99652444100098 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'AI 绘画表' ROW_FORMAT = Dynamic;
) ENGINE = InnoDB AUTO_INCREMENT = 101648039425026 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'AI 绘画表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of ai_image
@@ -349,7 +349,7 @@ CREATE TABLE `ai_model` (
INDEX `idx_user_id`(`user_id` ASC) USING BTREE,
INDEX `idx_public_status`(`public_status` ASC) USING BTREE,
INDEX `idx_user_public`(`user_id` ASC, `public_status` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 98365405127681 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'AI 模型表' ROW_FORMAT = Dynamic;
) ENGINE = InnoDB AUTO_INCREMENT = 100761590051841 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'AI 模型表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of ai_model
@@ -372,7 +372,7 @@ CREATE TABLE `ai_model_usage_record` (
`tenant_id` bigint NOT NULL DEFAULT 1 COMMENT '租户编号',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `uk_user_model`(`user_id` ASC, `model_id` ASC) USING BTREE COMMENT '用户-模型唯一索引'
) ENGINE = InnoDB AUTO_INCREMENT = 99658790082049 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'AI 公开模型使用记录表' ROW_FORMAT = Dynamic;
) ENGINE = InnoDB AUTO_INCREMENT = 102357791159297 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'AI 公开模型使用记录表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of ai_model_usage_record
@@ -451,7 +451,7 @@ INSERT INTO `ai_platform` VALUES (5, 'HunYuan', '混元', 'Tencent (混元)', 'h
INSERT INTO `ai_platform` VALUES (6, 'ZhiPu', '智谱', 'Zhipu (智谱)', 'glm-4, glm-3-turbo, glm-4v', 'https://open.bigmodel.cn/dev/api', '请前往智谱 AI 官网查看可用模型列表', 6, 0, '', '2025-11-11 01:19:48', '', '2025-11-11 02:33:25', b'0', 1);
INSERT INTO `ai_platform` VALUES (7, 'XingHuo', '星火', 'XingHuo (星火)', 'generalv3.5, generalv3, generalv2.1', 'https://www.xfyun.cn/doc/spark/Web.html', '请前往讯飞星火官网查看可用模型列表', 7, 0, '', '2025-11-11 01:19:48', '', '2025-11-11 02:33:25', b'0', 1);
INSERT INTO `ai_platform` VALUES (8, 'DouBao', '豆包', 'DouBao (豆包)', 'doubao-lite-4k, doubao-lite-32k, doubao-pro-4k', 'https://www.volcengine.com/docs/82379', '请前往字节豆包官网查看可用模型列表', 8, 0, '', '2025-11-11 01:19:48', '', '2025-11-11 02:33:25', b'0', 1);
INSERT INTO `ai_platform` VALUES (9, 'SiliconFlow', '硅基流动', 'SiliconFlow (硅基流动)', 'Qwen/Qwen2-7B-Instruct, meta-llama/Llama-2-7b-chat-hf, Wan-AI/Wan2.2-T2V-A14B, THUDM/GLM-Z1-9B-0414, Kwai-Kolors/Kolors, deepseek-ai/DeepSeek-R1-0528-Qwen3-8B, DeepSeek-R1-0528-Qwen3-8B, tencent/Hunyuan-MT-7B', 'https://docs.siliconflow.cn/cn/userguide/capabilities/text-generation', '请前往硅基流动官网查看可用模型列表', 2, 0, '', '2025-11-11 01:19:48', '', '2025-11-12 11:15:26', b'0', 1);
INSERT INTO `ai_platform` VALUES (9, 'SiliconFlow', '硅基流动', 'SiliconFlow (硅基流动)', 'Qwen/Qwen2-7B-Instruct, meta-llama/Llama-2-7b-chat-hf, Wan-AI/Wan2.2-T2V-A14B, THUDM/GLM-Z1-9B-0414, Kwai-Kolors/Kolors, deepseek-ai/DeepSeek-R1-0528-Qwen3-8B, DeepSeek-R1-0528-Qwen3-8B, tencent/Hunyuan-MT-7B, deepseek-ai/DeepSeek-R1-Distill-Qwen-7B, DeepSeek-R1-Distill-Qwen-7B, deepseek-ai/DeepSeek-V3.2-Exp', 'https://docs.siliconflow.cn/cn/userguide/capabilities/text-generation', '请前往硅基流动官网查看可用模型列表', 2, 0, '', '2025-11-11 01:19:48', '', '2025-11-12 11:15:26', b'0', 1);
INSERT INTO `ai_platform` VALUES (10, 'MiniMax', 'MiniMax', 'MiniMax', 'abab6.5-chat, abab5.5-chat, abab5-chat', 'https://www.minimaxi.com/document/guides/chat', '请前往 MiniMax 官网查看可用模型列表', 10, 0, '', '2025-11-11 01:19:48', '', '2025-11-11 02:33:25', b'0', 1);
INSERT INTO `ai_platform` VALUES (11, 'BaiChuan', '百川智能', 'BaiChuan (百川)', 'Baichuan2-Turbo, Baichuan2-Turbo-192k, Baichuan2-53B', 'https://platform.baichuan-ai.com/docs/api', '请前往百川智能官网查看可用模型列表', 11, 0, '', '2025-11-11 01:19:48', '', '2025-11-11 02:33:25', b'0', 1);
INSERT INTO `ai_platform` VALUES (12, 'GiteeAI', 'Gitee AI', 'Gitee AI (魔力方舟)', 'tts-1, tts-1-hd, gpt-4o, gpt-4o-mini', 'https://ai.gitee.com/docs', '请前往 Gitee AI 魔力方舟官网查看可用模型列表', 2, 0, '', '2025-11-11 01:19:48', '', '2025-11-12 11:15:29', b'0', 1);
@@ -460,7 +460,7 @@ INSERT INTO `ai_platform` VALUES (14, 'AzureOpenAI', 'Azure OpenAI', 'Azure Open
INSERT INTO `ai_platform` VALUES (15, 'Anthropic', 'Anthropic', 'Anthropic', 'claude-3-opus, claude-3-sonnet, claude-3-haiku', 'https://docs.anthropic.com/claude/docs/models-overview', '请前往 Anthropic 官网查看可用模型列表', 15, 0, '', '2025-11-11 01:19:48', '', '2025-11-11 02:33:25', b'0', 1);
INSERT INTO `ai_platform` VALUES (16, 'Google', 'Google', 'Google', 'gemini-pro, gemini-pro-vision, gemini-1.5-pro', 'https://ai.google.dev/models', '请前往 Google AI 官网查看可用模型列表', 16, 0, '', '2025-11-11 01:19:48', '', '2025-11-11 02:33:25', b'0', 1);
INSERT INTO `ai_platform` VALUES (17, 'Ollama', 'Ollama', 'Ollama', 'llama2, mistral, neural-chat, dolphin-mixtral', 'https://ollama.ai/library', '请前往 Ollama 官网查看可用模型列表', 17, 0, '', '2025-11-11 01:19:48', '', '2025-11-11 02:33:25', b'0', 1);
INSERT INTO `ai_platform` VALUES (18, 'OpenRouter', 'OpenRouter', 'OpenRouter', 'openai/gpt-3.5-turbo, openai/gpt-4, anthropic/claude-3-opus', 'https://openrouter.ai/docs', '请前往 OpenRouter 官网查看可用模型列表', 3, 0, '', '2025-11-12 04:16:46', '', '2025-11-12 11:15:13', b'0', 1);
INSERT INTO `ai_platform` VALUES (18, 'OpenRouter', 'OpenRouter', 'OpenRouter', 'openai/gpt-3.5-turbo, openai/gpt-4, anthropic/claude-3-opus, FunAudioLLM/SenseVoiceSmall, SenseVoiceSmall', 'https://openrouter.ai/docs', '请前往 OpenRouter 官网查看可用模型列表', 3, 0, '', '2025-11-12 04:16:46', '', '2025-11-12 11:15:13', b'0', 1);
INSERT INTO `ai_platform` VALUES (19, 'Gemini', 'Gemini', 'Google (Gemini)', 'gemini-1.5-pro, gemini-1.5-flash', 'https://developers.google.cn/ai/build', '请前往 Google AI Build 查看可用模型列表', 10, 0, '', '2025-11-21 00:00:00', '', '2025-11-21 00:00:00', b'0', 1);
-- ----------------------------
@@ -521,7 +521,7 @@ CREATE TABLE `ai_video` (
INDEX `idx_status`(`status` ASC) USING BTREE,
INDEX `idx_task_id`(`task_id` ASC) USING BTREE,
INDEX `idx_create_time`(`create_time` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 99652406351361 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'AI 视频生成表' ROW_FORMAT = Dynamic;
) ENGINE = InnoDB AUTO_INCREMENT = 100281191248898 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'AI 视频生成表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of ai_video
@@ -1788,6 +1788,7 @@ INSERT INTO `def_resource` VALUES (6, 1, 'im:contact', '联系人 / 好友管理
INSERT INTO `def_resource` VALUES (7, 1, 'im:config', 'IM 配置', '20', 1, '01', 'im_config 配置、系统参数与高级设置', '/im/config', 'page/ImConfig', '', 'Settings', b'0', b'0', b'1', 70, '', b'0', b'1', NULL, NULL, NULL, '/1/', 1, '{}', 1, '2021-12-12 12:12:12', 1, '2021-12-12 12:12:12', 0);
INSERT INTO `def_resource` VALUES (8, 1, 'ai:model', 'AI 能力中心', '20', 1, '01', '配置 AI 平台与模型,查看调用情况', '/ai/model', 'page/AiModel', '', 'Robot', b'0', b'0', b'1', 80, '', b'0', b'1', NULL, NULL, NULL, '/1/', 1, '{}', 1, '2021-12-12 12:12:12', 1, '2021-12-12 12:12:12', 0);
INSERT INTO `def_resource` VALUES (9, 1, 'im:active', '活跃用户', '20', 1, '01', '按时间范围查看活跃用户列表', '/im/active', 'page/ActiveUsers', '', 'Users', b'0', b'0', b'1', 20, '', b'0', b'1', NULL, NULL, NULL, '/1/', 1, '{}', 1, '2021-12-12 12:12:12', 1, '2021-12-12 12:12:12', 0);
INSERT INTO `def_resource` VALUES (10, 1, 'im:online', '在线用户', '20', 1, '01', '查看与管理在线用户(查询、踢人、冻结)', '/im/online', 'page/OnlineUsers', '', 'Users', b'0', b'0', b'1', 21, '', b'0', b'1', NULL, NULL, NULL, '/1/', 1, '{}', 1, '2021-12-12 12:12:12', 1, '2021-12-12 12:12:12', 0);
INSERT INTO `def_resource` VALUES (138191972908138500, 3, 'demo:multiple:view3', '多级-隐藏菜单3', '20', 138191972908138497, '01', '', '/multiple/view3', 'demo/test/index', NULL, '', b'1', b'0', b'1', 30, '', b'0', b'1', NULL, NULL, NULL, '/138191972908138497/', 1, '{}', 2, '2021-12-12 12:12:12', 2, '2024-03-05 22:45:51', 0);
INSERT INTO `def_resource` VALUES (138191972908138501, 3, 'demo:multiple:menu4', '下级是隐藏菜单', '20', 138191972908138497, '01', '', '/multiple/menu4', 'demo/test/index', NULL, '', b'0', b'0', b'1', 40, '', b'0', b'1', NULL, NULL, NULL, '/138191972908138497/', 1, '{}', 2, '2021-12-12 12:12:12', 2, '2024-03-05 22:47:07', 0);
INSERT INTO `def_resource` VALUES (138191972908138502, 3, 'demo:multiple:menu4:view1', '多级-隐藏菜单-视图1', '20', 138191972908138501, '01', '', '/multiple/menu4/view1', 'demo/test/index', NULL, '', b'1', b'0', b'1', 1, '', b'0', b'1', NULL, NULL, NULL, '/138191972908138497/138191972908138501/', 2, '{\"currentActiveMenu\":\"/multiple/menu4\"}', 2, '2021-12-12 12:12:12', 2, '2024-05-15 23:08:31', 0);
@@ -1912,7 +1913,6 @@ INSERT INTO `def_resource` VALUES (1449733521265393664, 1, 'basic:msg', '消息
INSERT INTO `def_resource` VALUES (1449733787893104640, 1, 'basic:msg:myMsg', '我的消息', '20', 1449733521265393664, '01', '', '/msg/myMsg', '/basic/msg/extendNotice/index', '', 'Notebook', b'0', b'0', b'1', 10, '', b'0', b'1', NULL, NULL, NULL, '/1449733521265393664/', 1, '{}', 2, '2021-12-12 12:12:12', 1452186486253289472, '2021-12-12 12:12:12', 0);
INSERT INTO `def_resource` VALUES (1449734007292952576, 1, 'basic:msg:msg', '消息管理', '20', 1449733521265393664, '01', '', '/msg/msg', '/basic/msg/extendMsg/index', '', 'GitCommit', b'0', b'0', b'1', 20, '', b'0', b'1', NULL, NULL, NULL, '/1449733521265393664/', 1, '{\"content\":\"数据权限\"}', 2, '2021-12-12 12:12:12', 2, '2024-04-10 15:12:13', 0);
INSERT INTO `def_resource` VALUES (1449734450995789824, 1, 'basic:system:role', '角色权限维护', '20', 144313439471271947, '01', '', '/system/role', '/basic/system/baseRole/index', '', 'Lock', b'0', b'0', b'1', 10, '', b'0', b'1', NULL, NULL, NULL, '/144313439471271947/', 1, '{}', 2, '2021-12-12 12:12:12', 1452186486253289472, '2021-12-12 12:12:12', 0);
INSERT INTO `def_resource` VALUES (1449734707225821184, 1, 'basic:system:appendix', '附件管理', '20', 144313439471271947, '01', '', '/system/file', '/basic/system/baseFile/index', '', 'Refresh', b'0', b'0', b'1', 20, '', b'0', b'1', NULL, NULL, NULL, '/144313439471271947/', 1, '{}', 2, '2021-10-17 21:51:04', 1452186486253289472, '2021-12-12 00:50:10', 0);
INSERT INTO `def_resource` VALUES (1449734944434683904, 1, 'basic:system:webLog', '操作日志', '20', 144313439471271947, '01', '', '/system/operationLog', '/basic/system/baseOperationLog/index', '', 'Receipt', b'0', b'0', b'1', 30, '', b'0', b'1', NULL, NULL, NULL, '/144313439471271947/', 1, '{}', 2, '2021-12-12 12:12:12', 1452186486253289472, '2021-12-12 12:12:12', 0);
INSERT INTO `def_resource` VALUES (1449735103088427008, 1, 'basic:system:loginLog', '登录日志', '20', 144313439471271947, '01', '', '/sysFunction/loginLog', '/basic/system/baseLoginLog/index', '', 'Login', b'0', b'0', b'1', 40, '', b'0', b'1', NULL, NULL, NULL, '/144313439471271947/', 1, '{}', 2, '2021-12-12 12:12:12', 1452186486253289472, '2021-12-12 12:12:12', 0);
INSERT INTO `def_resource` VALUES (1449738119237599232, 1, 'basic:user:org', '组织机构', '20', 1449732267470487552, '01', '', '/user/org', '/basic/user/baseOrg/index', '', 'Server', b'0', b'0', b'1', 20, '', b'0', b'1', NULL, NULL, NULL, '/1449732267470487552/', 1, '{}', 2, '2021-12-12 12:12:12', 1452186486253289472, '2021-12-12 12:12:12', 0);
@@ -1946,10 +1946,6 @@ INSERT INTO `def_resource` VALUES (1460538960118808576, 1, 'basic:system:webLog:
INSERT INTO `def_resource` VALUES (1460539047851065344, 1, 'basic:system:webLog:view', '查看', '40', 1449734944434683904, '01', '', '', '', '', '', b'0', b'0', b'1', 2, '', b'0', b'1', NULL, NULL, NULL, '/144313439471271947/1449734944434683904/', 2, '{}', 1452186486253289472, '2021-12-12 12:12:12', 1452186486253289472, '2021-12-12 12:12:12', 0);
INSERT INTO `def_resource` VALUES (1460540557393657856, 1, 'basic:system:loginLog:delete', '删除', '40', 1449735103088427008, '01', '', '', '', '', '', b'0', b'0', b'1', 1, '', b'0', b'1', NULL, NULL, NULL, '/144313439471271947/1449735103088427008/', 2, '{}', 1452186486253289472, '2021-12-12 12:12:12', 1452186486253289472, '2021-12-12 12:12:12', 0);
INSERT INTO `def_resource` VALUES (1460540612146102272, 1, 'basic:system:loginLog:view', '查看', '40', 1449735103088427008, '01', '', '', '', '', '', b'0', b'0', b'1', 2, '', b'0', b'1', NULL, NULL, NULL, '/144313439471271947/1449735103088427008/', 2, '{}', 1452186486253289472, '2021-12-12 12:12:12', 1452186486253289472, '2021-12-12 12:12:12', 0);
INSERT INTO `def_resource` VALUES (1460540797257515008, 1, 'basic:system:appendix:upload', '上传', '40', 1449734707225821184, '01', '', '', '', '', '', b'0', b'0', b'1', 1, '', b'0', b'1', NULL, NULL, NULL, '/144313439471271947/1449734707225821184/', 2, '{}', 1452186486253289472, '2021-11-16 17:30:36', 1452186486253289472, '2021-11-16 17:30:36', 0);
INSERT INTO `def_resource` VALUES (1460540870838190080, 1, 'basic:system:appendix:debug:upload', '调试上传', '40', 1449734707225821184, '01', '', '', '', '', '', b'0', b'0', b'1', 2, '', b'0', b'1', NULL, NULL, NULL, '/144313439471271947/1449734707225821184/', 2, '{}', 1452186486253289472, '2021-11-16 17:30:54', 1452186486253289472, '2021-11-16 17:30:54', 0);
INSERT INTO `def_resource` VALUES (1460540935568883712, 1, 'basic:system:appendix:download', '下载', '40', 1449734707225821184, '01', '', '', '', '', '', b'0', b'0', b'1', 3, '', b'0', b'1', NULL, NULL, NULL, '/144313439471271947/1449734707225821184/', 2, '{}', 1452186486253289472, '2021-11-16 17:31:09', 1452186486253289472, '2021-11-16 17:31:09', 0);
INSERT INTO `def_resource` VALUES (1460540979420332032, 1, 'basic:system:appendix:delete', '删除', '40', 1449734707225821184, '01', '', '', '', '', '', b'0', b'0', b'1', 10, '', b'0', b'1', NULL, NULL, NULL, '/144313439471271947/1449734707225821184/', 2, '{}', 1452186486253289472, '2021-11-16 17:31:20', 1452186486253289472, '2021-12-12 00:57:27', 0);
INSERT INTO `def_resource` VALUES (1460542581971615744, 2, 'tenant:tenant:user:add', '新增', '40', 137848577387921412, '01', '', '', '', '', '', b'0', b'0', b'1', 1, '', b'0', b'1', NULL, NULL, NULL, '/137848577387921409/137848577387921412/', 2, '{}', 1452186486253289472, '2021-12-12 12:12:12', 1452186486253289472, '2021-12-12 12:12:12', 0);
INSERT INTO `def_resource` VALUES (1460542629845401600, 2, 'tenant:tenant:user:edit', '编辑', '40', 137848577387921412, '01', '', '', '', '', '', b'0', b'0', b'1', 2, '', b'0', b'1', NULL, NULL, NULL, '/137848577387921409/137848577387921412/', 2, '{}', 1452186486253289472, '2021-12-12 12:12:12', 1452186486253289472, '2021-12-12 12:12:12', 0);
INSERT INTO `def_resource` VALUES (1460542675554926592, 2, 'tenant:tenant:user:delete', '删除', '40', 137848577387921412, '01', '', '', '', '', '', b'0', b'0', b'1', 3, '', b'0', b'1', NULL, NULL, NULL, '/137848577387921409/137848577387921412/', 2, '{}', 1452186486253289472, '2021-12-12 12:12:12', 1452186486253289472, '2021-12-12 12:12:12', 0);
@@ -2285,8 +2281,9 @@ CREATE TABLE `def_user` (
-- ----------------------------
-- Records of def_user
-- ----------------------------
INSERT INTO `def_user` VALUES (61170828519936, 2, '15147891644', 'HuLa小管家', '', '022', NULL, NULL, '', NULL, b'0', '', '', '1', b'1', '', '2025-08-11 11:11:03.139', '{\"createIp\": \"206.237.119.215\", \"updateIp\": \"120.231.232.41\", \"createIpDetail\": null, \"updateIpDetail\": null}', '2025-11-25 12:09:10', 5, NULL, 'b6351c5c1e5c172aca2ba36c00598a4b77db41f2240f38a9ed5f6b0ed98e4251', 'HuLa小管家', '2025-07-07 15:27:02', 1, '2025-03-27 04:23:08', NULL, '2025-07-16 12:26:15', 0, 1);
INSERT INTO `def_user` VALUES (61170828519937, 2, '13275346112', 'Dawn', '2439646234@qq.com', 'https://cdn.hulaspark.com/avatar/2439646234/6ec99d37b8ba1296c325d2d36b46a14d.webp', NULL, NULL, '', NULL, b'0', '', '', '1', b'1', '', '2025-08-11 11:11:03.189', '{\"createIp\": \"206.237.119.215\", \"updateIp\": \"116.24.67.61\", \"createIpDetail\": null, \"updateIpDetail\": {\"ip\": \"116.24.67.61\", \"isp\": \"电信\", \"area\": \"\", \"city\": \"深圳\", \"isp_id\": \"100017\", \"region\": \"广东\", \"city_id\": \"440300\", \"country\": \"中国\", \"region_id\": \"440000\", \"country_id\": \"CN\"}}', NULL, 0, NULL, 'ab6ec4358efb64760e5f248c1f9130d03aaa1856f9c03e4dc5fa63fb38a796b6', 'Dawn', '2025-11-26 05:10:02', 1, '2025-03-27 04:23:08', NULL, '2025-11-26 07:32:15', 0, 1);
INSERT INTO `def_user` VALUES (61170828519936, 2, '15147891644', 'HuLa小管家', '', '022', NULL, NULL, '', NULL, b'0', '', '', '1', b'1', '', '2025-08-11 11:11:03.139', '{\"createIp\": \"206.237.119.215\", \"updateIp\": \"120.231.232.41\", \"createIpDetail\": null, \"updateIpDetail\": null}', '2025-12-01 20:30:50', 6, NULL, 'a4d5c225e6709ba025272a31c7e90e0121d5e5ba16695afe0b61370bedb677d0', 'Dawn', '2025-07-07 15:27:02', 1, '2025-03-27 04:23:08', NULL, '2025-07-16 12:26:15', 0, 1);
INSERT INTO `def_user` VALUES (61170828519937, 2, '13275346112', 'Dawn', '2439646234@qq.com', 'https://cdn.hulaspark.com/avatar/2439646234/6ec99d37b8ba1296c325d2d36b46a14d.webp', NULL, NULL, '', NULL, b'0', '', '', '1', b'1', '', '2025-08-11 11:11:03.189', '{\"createIp\": \"206.237.119.215\", \"updateIp\": \"116.24.64.57\", \"createIpDetail\": null, \"updateIpDetail\": {\"ip\": \"116.24.64.57\", \"isp\": \"电信\", \"area\": \"\", \"city\": \"深圳\", \"isp_id\": \"\", \"region\": \"广东\", \"city_id\": \"\", \"country\": \"中国\", \"region_id\": \"\", \"country_id\": \"\"}}', NULL, 0, NULL, 'a4d5c225e6709ba025272a31c7e90e0121d5e5ba16695afe0b61370bedb677d0', 'Dawn', '2025-12-03 14:44:57', 1, '2025-03-27 04:23:08', NULL, '2025-12-03 14:59:18', 0, 1);
INSERT INTO `def_user` VALUES (61170828529941, 1, '24396462341', 'Dawn', '24396462341@qq.com', 'https://cdn.hulaspark.com/avatar/2439646234/6ec99d37b8ba1296c325d2d36b46a14d.webp', NULL, NULL, '', NULL, b'0', '', '', '1', b'1', '', '2025-08-11 11:11:03.189', '{\"createIp\": \"206.237.119.215\", \"updateIp\": \"116.24.64.57\", \"createIpDetail\": null, \"updateIpDetail\": {\"ip\": \"116.24.64.57\", \"isp\": \"电信\", \"area\": \"\", \"city\": \"深圳\", \"isp_id\": \"\", \"region\": \"广东省\", \"city_id\": \"\", \"country\": \"中国\", \"region_id\": \"\", \"country_id\": \"\"}}', NULL, 0, NULL, 'a4d5c225e6709ba025272a31c7e90e0121d5e5ba16695afe0b61370bedb677d0', 'Dawn', '2025-11-27 12:02:05', 1, '2025-03-27 04:23:08', NULL, '2025-12-02 11:41:54', 0, 1);
-- ----------------------------
-- Table structure for def_user_application
@@ -2362,7 +2359,7 @@ CREATE TABLE `extend_interface_log` (
-- Records of extend_interface_log
-- ----------------------------
INSERT INTO `extend_interface_log` VALUES (66567882983426, 244439130119864323, '阿里短信', 0, 1, '2025-08-26 16:37:01', '2025-08-26 16:37:00', NULL, '2025-08-26 16:37:00', NULL, 0, 0);
INSERT INTO `extend_interface_log` VALUES (655249535051914248, 244881451621810192, '腾讯邮件', 1334, 62, '2025-11-26 04:10:51', '2025-07-16 18:41:01', NULL, '2025-07-16 18:41:01', NULL, 0, 0);
INSERT INTO `extend_interface_log` VALUES (655249535051914248, 244881451621810192, '腾讯邮件', 1619, 65, '2025-12-03 13:38:12', '2025-07-16 18:41:01', NULL, '2025-07-16 18:41:01', NULL, 0, 0);
-- ----------------------------
-- Table structure for extend_interface_logging
@@ -2576,7 +2573,7 @@ CREATE TABLE `worker_node` (
`created` timestamp NULL DEFAULT NULL COMMENT '创建时间',
`is_del` tinyint(1) NOT NULL DEFAULT 0,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1036 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = 'DB;WorkerID Assigner for UID Generator' ROW_FORMAT = Dynamic;
) ENGINE = InnoDB AUTO_INCREMENT = 1051 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = 'DB;WorkerID Assigner for UID Generator' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of worker_node
+20 -19
View File
@@ -11,7 +11,7 @@
Target Server Version : 80030 (8.0.30)
File Encoding : 65001
Date: 26/11/2025 08:05:58
Date: 03/12/2025 15:16:13
*/
SET NAMES utf8mb4;
@@ -151,7 +151,7 @@ CREATE TABLE `im_contact` (
INDEX `idx_create_time`(`create_time` ASC) USING BTREE,
INDEX `idx_update_time`(`update_time` ASC) USING BTREE,
INDEX `idx_contact_room_uid_hide`(`room_id` ASC, `uid` ASC, `hide` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 69082079607468 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '会话列表' ROW_FORMAT = Dynamic;
) ENGINE = InnoDB AUTO_INCREMENT = 69082079618161 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '会话列表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of im_contact
@@ -324,7 +324,7 @@ CREATE TABLE `im_group_member` (
INDEX `idx_create_time`(`create_time` ASC) USING BTREE,
INDEX `idx_update_time`(`update_time` ASC) USING BTREE,
INDEX `idx_group_member_uid_isdel_groupid`(`uid` ASC, `is_del` ASC, `group_id` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 99719888100866 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '群成员表' ROW_FORMAT = Dynamic;
) ENGINE = InnoDB AUTO_INCREMENT = 102399356298242 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '群成员表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of im_group_member
@@ -387,7 +387,7 @@ CREATE TABLE `im_message` (
INDEX `idx_from_uid`(`from_uid` ASC) USING BTREE,
INDEX `idx_create_time`(`create_time` ASC) USING BTREE,
INDEX `idx_update_time`(`update_time` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 99741140639233 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '消息表' ROW_FORMAT = Dynamic;
) ENGINE = InnoDB AUTO_INCREMENT = 102414250271745 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '消息表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of im_message
@@ -417,7 +417,7 @@ CREATE TABLE `im_message_mark` (
INDEX `idx_uid`(`uid` ASC) USING BTREE,
INDEX `idx_create_time`(`create_time` ASC) USING BTREE,
INDEX `idx_update_time`(`update_time` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 99551872670721 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '消息标记表' ROW_FORMAT = Dynamic;
) ENGINE = InnoDB AUTO_INCREMENT = 102005775393793 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '消息标记表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of im_message_mark
@@ -449,7 +449,7 @@ CREATE TABLE `im_notice` (
INDEX `idx_receiver_type`(`receiver_id` ASC, `event_type` ASC) USING BTREE,
INDEX `idx_sender`(`sender_id` ASC) USING BTREE,
INDEX `idx_related`(`apply_id` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 99540803902467 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '统一通知表' ROW_FORMAT = Dynamic;
) ENGINE = InnoDB AUTO_INCREMENT = 102075312759811 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '统一通知表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of im_notice
@@ -499,12 +499,12 @@ CREATE TABLE `im_room` (
PRIMARY KEY (`id`) USING BTREE,
INDEX `idx_create_time`(`create_time` ASC) USING BTREE,
INDEX `idx_update_time`(`update_time` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 99719888100867 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '房间表' ROW_FORMAT = Dynamic;
) ENGINE = InnoDB AUTO_INCREMENT = 102399356298243 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '房间表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of im_room
-- ----------------------------
INSERT INTO `im_room` VALUES (1, 1, 1, '2025-11-26 05:35:41.099', 99741140639232, NULL, '2024-07-10 11:17:15.521', '2025-11-25 21:35:41.134', 1, 1, NULL, 0);
INSERT INTO `im_room` VALUES (1, 1, 1, '2025-12-03 14:37:40.514', 102414250271744, NULL, '2024-07-10 11:17:15.521', '2025-12-03 06:37:40.533', 1, 1, NULL, 0);
-- ----------------------------
-- Table structure for im_room_friend
@@ -529,7 +529,7 @@ CREATE TABLE `im_room_friend` (
INDEX `idx_room_id`(`room_id` ASC) USING BTREE,
INDEX `idx_create_time`(`create_time` ASC) USING BTREE,
INDEX `idx_update_time`(`update_time` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 99719888100868 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '单聊房间表' ROW_FORMAT = Dynamic;
) ENGINE = InnoDB AUTO_INCREMENT = 102399356298244 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '单聊房间表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of im_room_friend
@@ -558,7 +558,7 @@ CREATE TABLE `im_room_group` (
INDEX `idx_room_id`(`room_id` ASC) USING BTREE,
INDEX `idx_create_time`(`create_time` ASC) USING BTREE,
INDEX `idx_update_time`(`update_time` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 97720639541763 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '群聊房间表' ROW_FORMAT = Dynamic;
) ENGINE = InnoDB AUTO_INCREMENT = 101643924399107 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '群聊房间表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of im_room_group
@@ -640,13 +640,13 @@ CREATE TABLE `im_user` (
INDEX `idx_update_time`(`update_time` ASC) USING BTREE,
INDEX `idx_active_status_last_opt_time`(`last_opt_time` ASC) USING BTREE,
INDEX `account_UNIQUE`(`account` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 99719888100865 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户表' ROW_FORMAT = Dynamic;
) ENGINE = InnoDB AUTO_INCREMENT = 102399356298241 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of im_user
-- ----------------------------
INSERT INTO `im_user` VALUES (1, 61170828519936, 2, 'HuLa小管家', '022', '', 'bot', NULL, '', 0, '2025-07-07 15:27:01.711', '{\"createIp\": \"206.237.119.215\", \"updateIp\": \"116.24.67.61\", \"createIpDetail\": null, \"updateIpDetail\": {\"ip\": \"116.24.67.61\", \"isp\": \"电信\", \"area\": \"\", \"city\": \"深圳\", \"isp_id\": \"100017\", \"region\": \"广东\", \"city_id\": \"440300\", \"country\": \"中国\", \"region_id\": \"440000\", \"country_id\": \"CN\"}}', 6, 0, '', '2025-03-27 04:23:08.393', '2025-11-24 18:51:22.015', 0, NULL, 0, '2025-05-09 18:24:37.089', 0, 1, 10);
INSERT INTO `im_user` VALUES (10937855681024, 61170828519937, 3, 'Dawn', 'https://cdn.hulaspark.com/avatar/2439646234/97320189485dca88dcc7a70054445a56.webp', '2439646234@qq.com', '13275346112', NULL, '', 23, '2025-07-30 15:31:57.651', '{\"createIp\": \"206.237.119.215\", \"updateIp\": \"116.24.67.61\", \"createIpDetail\": null, \"updateIpDetail\": {\"ip\": \"116.24.67.61\", \"isp\": \"电信\", \"area\": \"\", \"city\": \"深圳\", \"isp_id\": \"100017\", \"region\": \"广东\", \"city_id\": \"440300\", \"country\": \"中国\", \"region_id\": \"440000\", \"country_id\": \"CN\"}}', 6, 0, '', '2025-03-27 04:23:08.393', '2025-11-25 20:33:08.979', 0, NULL, 0, '2025-09-20 21:35:31.415', 0, 1, 10);
INSERT INTO `im_user` VALUES (1, 61170828519936, 2, 'HuLa小管家', '022', '', 'bot', NULL, '', 0, '2025-07-07 15:27:01.711', '{\"createIp\": \"206.237.119.215\", \"updateIp\": \"116.24.64.57\", \"createIpDetail\": null, \"updateIpDetail\": {\"ip\": \"116.24.64.57\", \"isp\": \"电信\", \"area\": \"\", \"city\": \"深圳\", \"isp_id\": null, \"region\": \"广东\", \"city_id\": null, \"country\": \"中国\", \"region_id\": null, \"country_id\": null}}', 6, 0, '', '2025-03-27 04:23:08.393', '2025-12-02 11:37:40.510', 0, 61170828529941, 0, '2025-05-09 18:24:37.089', 0, 1, 10);
INSERT INTO `im_user` VALUES (10937855681024, 61170828519937, 3, 'Dawn', 'https://cdn.hulaspark.com/avatar/2439646234/97320189485dca88dcc7a70054445a56.webp', '2439646234@qq.com', '13275346112', NULL, '', 11, '2025-07-30 15:31:57.651', '{\"createIp\": \"206.237.119.215\", \"updateIp\": \"116.24.64.57\", \"createIpDetail\": null, \"updateIpDetail\": {\"ip\": \"116.24.64.57\", \"isp\": \"电信\", \"area\": \"\", \"city\": \"深圳\", \"isp_id\": null, \"region\": \"广东\", \"city_id\": null, \"country\": \"中国\", \"region_id\": null, \"country_id\": null}}', 6, 0, '', '2025-03-27 04:23:08.393', '2025-12-03 08:33:26.968', 0, 61170828529941, 0, '2025-09-20 21:35:31.415', 0, 1, 10);
-- ----------------------------
-- Table structure for im_user_apply
@@ -661,6 +661,7 @@ CREATE TABLE `im_user_apply` (
`msg` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '申请信息',
`status` int NOT NULL COMMENT '申请状态 1待审批 2同意',
`apply_for` tinyint NOT NULL DEFAULT 0 COMMENT '主动申请加群',
`join_channel` tinyint NOT NULL DEFAULT 1 COMMENT '渠道',
`read_status` int NOT NULL COMMENT '阅读状态 1未读 2已读',
`create_time` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) COMMENT '创建时间',
`update_time` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3) COMMENT '修改时间',
@@ -675,7 +676,7 @@ CREATE TABLE `im_user_apply` (
INDEX `idx_target_id`(`target_id` ASC) USING BTREE,
INDEX `idx_create_time`(`create_time` ASC) USING BTREE,
INDEX `idx_update_time`(`update_time` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 99540803902465 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户申请表' ROW_FORMAT = Dynamic;
) ENGINE = InnoDB AUTO_INCREMENT = 102075312759809 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户申请表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of im_user_apply
@@ -702,7 +703,7 @@ CREATE TABLE `im_user_backpack` (
INDEX `idx_uid`(`uid` ASC) USING BTREE,
INDEX `idx_create_time`(`create_time` ASC) USING BTREE,
INDEX `idx_update_time`(`update_time` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 99719888100875 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户背包表' ROW_FORMAT = Dynamic;
) ENGINE = InnoDB AUTO_INCREMENT = 102399356298251 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户背包表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of im_user_backpack
@@ -745,7 +746,7 @@ CREATE TABLE `im_user_emoji` (
`update_by` bigint NULL DEFAULT NULL COMMENT '更新者',
PRIMARY KEY (`id`) USING BTREE,
INDEX `IDX_USER_EMOJIS_UID`(`uid` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 99458897533953 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户表情包' ROW_FORMAT = Dynamic;
) ENGINE = InnoDB AUTO_INCREMENT = 102122003751937 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户表情包' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of im_user_emoji
@@ -778,7 +779,7 @@ CREATE TABLE `im_user_friend` (
INDEX `idx_uid_friend_uid`(`uid` ASC, `friend_uid` ASC) USING BTREE,
INDEX `idx_create_time`(`create_time` ASC) USING BTREE,
INDEX `idx_update_time`(`update_time` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 99719888100870 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户联系人表' ROW_FORMAT = Dynamic;
) ENGINE = InnoDB AUTO_INCREMENT = 102399356298246 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户联系人表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of im_user_friend
@@ -956,7 +957,7 @@ CREATE TABLE `secure_invoke_record` (
`is_del` tinyint NOT NULL DEFAULT 0 COMMENT '是否删除',
PRIMARY KEY (`id`) USING BTREE,
INDEX `idx_next_retry_time`(`next_retry_time` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 99741140639234 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '本地消息表' ROW_FORMAT = Dynamic;
) ENGINE = InnoDB AUTO_INCREMENT = 102414250271746 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '本地消息表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of secure_invoke_record
@@ -975,7 +976,7 @@ CREATE TABLE `worker_node` (
`modified` timestamp NULL DEFAULT NULL COMMENT '修改时间',
`created` timestamp NULL DEFAULT NULL COMMENT '创建时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 240 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = 'DB;WorkerID Assigner for UID Generator' ROW_FORMAT = Dynamic;
) ENGINE = InnoDB AUTO_INCREMENT = 243 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = 'DB;WorkerID Assigner for UID Generator' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of worker_node
+1 -1
View File
@@ -6,7 +6,7 @@
<parent>
<groupId>com.luohuo.flex</groupId>
<artifactId>luohuo-ai</artifactId>
<version>3.0.5</version>
<version>3.0.6</version>
<relativePath>../pom.xml</relativePath>
</parent>
@@ -5,6 +5,7 @@ import com.agentsflex.llm.ollama.OllamaLlmConfig;
import com.agentsflex.llm.qwen.QwenLlm;
import com.agentsflex.llm.qwen.QwenLlmConfig;
import cn.hutool.core.util.ObjectUtil;
import com.luohuo.basic.constant.Constants;
import com.luohuo.basic.context.ContextUtil;
import com.luohuo.flex.ai.common.pojo.PageResult;
import com.luohuo.flex.ai.controller.model.vo.model.AiModelPageReqVO;
@@ -62,6 +63,9 @@ public class AiModelServiceImpl implements AiModelService {
// 2. 插入
AiModelDO model = BeanUtils.toBean(createReqVO, AiModelDO.class);
if (Integer.valueOf(0).equals(createReqVO.getPublicStatus())) {
model.setAvatar(Constants.BOT_AVATAR);
}
// 如果是私有模型且没有设置 userId,则抛出异常
if (Integer.valueOf(1).equals(createReqVO.getPublicStatus()) && model.getUserId() == null) {
throw exception(MODEL_NOT_EXISTS); // 使用适当的错误码
@@ -99,6 +103,9 @@ public class AiModelServiceImpl implements AiModelService {
// 3. 更新
AiModelDO updateObj = BeanUtils.toBean(updateReqVO, AiModelDO.class);
if (Integer.valueOf(0).equals(updateReqVO.getPublicStatus())) {
updateObj.setAvatar(Constants.BOT_AVATAR);
}
updateObj.setUserId(userId);
modelMapper.updateById(updateObj);
}
@@ -133,6 +140,9 @@ public class AiModelServiceImpl implements AiModelService {
// 管理员更新,无权限校验
AiModelDO updateObj = BeanUtils.toBean(updateReqVO, AiModelDO.class);
if (Integer.valueOf(0).equals(updateReqVO.getPublicStatus())) {
updateObj.setAvatar(Constants.BOT_AVATAR);
}
modelMapper.updateById(updateObj);
}
@@ -6,7 +6,7 @@
<parent>
<groupId>com.luohuo.flex</groupId>
<artifactId>luohuo-ai</artifactId>
<version>3.0.5</version>
<version>3.0.6</version>
</parent>
<artifactId>luohuo-ai-entity</artifactId>
@@ -5,7 +5,7 @@
<parent>
<groupId>com.luohuo.flex</groupId>
<artifactId>luohuo-ai-facade</artifactId>
<version>3.0.5</version>
<version>3.0.6</version>
<relativePath>../pom.xml</relativePath>
</parent>
@@ -5,7 +5,7 @@
<parent>
<groupId>com.luohuo.flex</groupId>
<artifactId>luohuo-ai-facade</artifactId>
<version>3.0.5</version>
<version>3.0.6</version>
<relativePath>../pom.xml</relativePath>
</parent>
@@ -5,7 +5,7 @@
<parent>
<groupId>com.luohuo.flex</groupId>
<artifactId>luohuo-ai-facade</artifactId>
<version>3.0.5</version>
<version>3.0.6</version>
<relativePath>../pom.xml</relativePath>
</parent>
@@ -6,7 +6,7 @@
<parent>
<groupId>com.luohuo.flex</groupId>
<artifactId>luohuo-ai</artifactId>
<version>3.0.5</version>
<version>3.0.6</version>
</parent>
<artifactId>luohuo-ai-facade</artifactId>
@@ -5,7 +5,7 @@
<parent>
<artifactId>luohuo-ai</artifactId>
<groupId>com.luohuo.flex</groupId>
<version>3.0.5</version>
<version>3.0.6</version>
<relativePath>../pom.xml</relativePath>
</parent>
+1 -1
View File
@@ -6,7 +6,7 @@
<parent>
<groupId>com.luohuo.flex</groupId>
<artifactId>luohuo-dependencies-parent</artifactId>
<version>3.0.5</version>
<version>3.0.6</version>
<relativePath>../luohuo-dependencies-parent/pom.xml</relativePath>
</parent>
@@ -5,7 +5,7 @@
<parent>
<artifactId>luohuo-base</artifactId>
<groupId>com.luohuo.flex</groupId>
<version>3.0.5</version>
<version>3.0.6</version>
<relativePath>../pom.xml</relativePath>
</parent>
@@ -6,6 +6,7 @@
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="create_by" jdbcType="BIGINT" property="createBy"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="name" jdbcType="CHAR" property="name"/>
<result column="update_by" jdbcType="BIGINT" property="updateBy"/>
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
<result column="user_id" jdbcType="BIGINT" property="userId"/>
@@ -20,9 +21,7 @@
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id
, create_by, create_time, update_by, update_time, active_status, last_company_id, last_dept_id,
is_default, user_id, position_id, real_name, position_status, state, created_org_id
id, create_by, create_time, update_by, update_time, active_status, last_company_id, last_dept_id, user_id, position_id, name, position_status, state, created_org_id
</sql>
<!-- 通用查询映射结果 -->
@@ -72,8 +71,7 @@
utr
.
id
, utr.create_by, utr.create_time, utr.update_by, utr.update_time,
utr.is_default, utr.user_id, utr.state
, utr.create_by, utr.create_time, utr.update_by, utr.update_time, utr.user_id, utr.state
</sql>
<select id="listEmployeeByUserId" resultMap="ResultVOResultMap">
@@ -81,6 +79,6 @@
<include refid="Uar_Column_List"/>
FROM base_employee utr
where utr.user_id = ${userId}
order by utr.state desc, utr.is_default desc
order by utr.state desc
</select>
</mapper>
@@ -5,7 +5,7 @@
<parent>
<artifactId>luohuo-base</artifactId>
<groupId>com.luohuo.flex</groupId>
<version>3.0.5</version>
<version>3.0.6</version>
<relativePath>../pom.xml</relativePath>
</parent>
@@ -16,6 +16,7 @@ import com.luohuo.basic.interfaces.echo.EchoService;
import com.luohuo.flex.base.entity.system.BaseOperationLog;
import com.luohuo.flex.base.service.system.BaseOperationLogService;
import com.luohuo.flex.base.vo.query.system.BaseOperationLogPageQuery;
import com.luohuo.basic.base.request.PageParams;
import com.luohuo.flex.base.vo.result.system.BaseOperationLogResultVO;
import com.luohuo.flex.base.vo.save.system.BaseOperationLogSaveVO;
import com.luohuo.flex.base.vo.update.system.BaseOperationLogUpdateVO;
@@ -81,4 +82,10 @@ public class BaseOperationLogController extends SuperController<BaseOperationLog
}
return success(superService.clearLog(clearBeforeTime, clearBeforeNum));
}
@Override
public void handlerQueryParams(PageParams<BaseOperationLogPageQuery> params) {
params.setSort("createTime");
params.setOrder("descending");
}
}
@@ -19,6 +19,7 @@ import com.luohuo.flex.base.vo.result.system.DefLoginLogResultVO;
import com.luohuo.flex.base.vo.save.system.DefLoginLogSaveVO;
import com.luohuo.flex.base.vo.update.system.DefLoginLogUpdateVO;
import com.luohuo.flex.base.vo.query.system.DefLoginLogPageQuery;
import com.luohuo.basic.base.request.PageParams;
import java.time.LocalDateTime;
@@ -78,4 +79,10 @@ public class DefLoginLogController extends SuperController<DefLoginLogService, L
}
return success(superService.clearLog(clearBeforeTime, clearBeforeNum));
}
@Override
public void handlerQueryParams(PageParams<DefLoginLogPageQuery> params) {
params.setSort("createTime");
params.setOrder("descending");
}
}
@@ -5,7 +5,7 @@
<parent>
<artifactId>luohuo-base</artifactId>
<groupId>com.luohuo.flex</groupId>
<version>3.0.5</version>
<version>3.0.6</version>
<relativePath>../pom.xml</relativePath>
</parent>
@@ -62,7 +62,6 @@ public class BaseEmployeeResultVO extends Entity<Long> implements Serializable,
* 组织Id
*/
@Schema(description = "组织Id")
@Echo(api = EchoApi.ORG_ID_CLASS)
private List<Long> orgIdList;
@@ -77,15 +76,15 @@ public class BaseEmployeeResultVO extends Entity<Long> implements Serializable,
* 真实姓名
*/
@Schema(description = "真实姓名")
private String realName;
private String name;
/**
* 职位状态;[10-在职 20-离职]@Echo(api = EchoApi.DICTIONARY_ITEM_FEIGN_CLASS, dictType = EchoDictType.Base.POSITION_STATUS)
*/
@Schema(description = "职位状态")
@Echo(api = EchoApi.DICTIONARY_ITEM_FEIGN_CLASS, dictType = EchoDictType.Base.POSITION_STATUS)
private String positionStatus;
/**
* 状态;[0-禁用 1-启用]
*/
@@ -97,4 +96,7 @@ public class BaseEmployeeResultVO extends Entity<Long> implements Serializable,
*/
@Schema(description = "激活状态")
private String activeStatus;
@Schema(description = "创建部门")
private Long createdOrgId;
}
@@ -5,7 +5,7 @@
<parent>
<groupId>com.luohuo.flex</groupId>
<artifactId>luohuo-base-facade</artifactId>
<version>3.0.5</version>
<version>3.0.6</version>
<relativePath>../pom.xml</relativePath>
</parent>
@@ -5,7 +5,7 @@
<parent>
<groupId>com.luohuo.flex</groupId>
<artifactId>luohuo-base-facade</artifactId>
<version>3.0.5</version>
<version>3.0.6</version>
<relativePath>../pom.xml</relativePath>
</parent>
@@ -5,7 +5,7 @@
<parent>
<groupId>com.luohuo.flex</groupId>
<artifactId>luohuo-base-facade</artifactId>
<version>3.0.5</version>
<version>3.0.6</version>
<relativePath>../pom.xml</relativePath>
</parent>
@@ -5,7 +5,7 @@
<parent>
<artifactId>luohuo-base</artifactId>
<groupId>com.luohuo.flex</groupId>
<version>3.0.5</version>
<version>3.0.6</version>
<relativePath>../pom.xml</relativePath>
</parent>
@@ -5,7 +5,7 @@
<parent>
<artifactId>luohuo-base</artifactId>
<groupId>com.luohuo.flex</groupId>
<version>3.0.5</version>
<version>3.0.6</version>
<relativePath>../pom.xml</relativePath>
</parent>
+1 -1
View File
@@ -5,7 +5,7 @@
<parent>
<groupId>com.luohuo.flex</groupId>
<artifactId>luohuo-dependencies-parent</artifactId>
<version>3.0.5</version>
<version>3.0.6</version>
<relativePath>../luohuo-dependencies-parent/pom.xml</relativePath>
</parent>
@@ -6,13 +6,13 @@
<parent>
<groupId>com.luohuo.basic</groupId>
<artifactId>luohuo-parent</artifactId>
<version>3.0.5</version>
<version>3.0.6</version>
<relativePath/>
</parent>
<groupId>com.luohuo.flex</groupId>
<artifactId>luohuo-dependencies-parent</artifactId>
<version>3.0.5</version>
<version>3.0.6</version>
<packaging>pom</packaging>
<modelVersion>4.0.0</modelVersion>
@@ -21,8 +21,8 @@
<description>luohuo项目业务父pom</description>
<url>https://gitee.com/HuLaSpark/HuLa-Server</url>
<properties>
<luohuo-util.version>3.0.5</luohuo-util.version>
<luohuo-project.version>3.0.5</luohuo-project.version>
<luohuo-util.version>3.0.6</luohuo-util.version>
<luohuo-project.version>3.0.6</luohuo-project.version>
<docker.image.prefix>hula</docker.image.prefix>
<transmittable-thread-local.version>2.14.5</transmittable-thread-local.version>
</properties>
@@ -5,7 +5,7 @@
<parent>
<artifactId>luohuo-gateway</artifactId>
<groupId>com.luohuo.flex</groupId>
<version>3.0.5</version>
<version>3.0.6</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -5,7 +5,7 @@
<parent>
<artifactId>luohuo-gateway</artifactId>
<groupId>com.luohuo.flex</groupId>
<version>3.0.5</version>
<version>3.0.6</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
+1 -1
View File
@@ -5,7 +5,7 @@
<parent>
<groupId>com.luohuo.flex</groupId>
<artifactId>luohuo-dependencies-parent</artifactId>
<version>3.0.5</version>
<version>3.0.6</version>
<relativePath>../luohuo-dependencies-parent/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -5,7 +5,7 @@
<parent>
<artifactId>luohuo-generator</artifactId>
<groupId>com.luohuo.flex</groupId>
<version>3.0.5</version>
<version>3.0.6</version>
<relativePath>../pom.xml</relativePath>
</parent>
@@ -5,7 +5,7 @@
<parent>
<artifactId>luohuo-generator</artifactId>
<groupId>com.luohuo.flex</groupId>
<version>3.0.5</version>
<version>3.0.6</version>
<relativePath>../pom.xml</relativePath>
</parent>
@@ -5,7 +5,7 @@
<parent>
<artifactId>luohuo-generator</artifactId>
<groupId>com.luohuo.flex</groupId>
<version>3.0.5</version>
<version>3.0.6</version>
<relativePath>../pom.xml</relativePath>
</parent>
@@ -5,7 +5,7 @@
<parent>
<artifactId>luohuo-generator</artifactId>
<groupId>com.luohuo.flex</groupId>
<version>3.0.5</version>
<version>3.0.6</version>
<relativePath>../pom.xml</relativePath>
</parent>
+1 -1
View File
@@ -5,7 +5,7 @@
<parent>
<groupId>com.luohuo.flex</groupId>
<artifactId>luohuo-dependencies-parent</artifactId>
<version>3.0.5</version>
<version>3.0.6</version>
<relativePath>../luohuo-dependencies-parent/pom.xml</relativePath>
</parent>
+1 -1
View File
@@ -5,7 +5,7 @@
<parent>
<artifactId>luohuo-im</artifactId>
<groupId>com.luohuo.flex</groupId>
<version>3.0.5</version>
<version>3.0.6</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -11,20 +11,22 @@ import java.util.List;
@Getter
public class GroupInviteMemberEvent extends ApplicationEvent {
// 变动的成员
// 变动的成员
private final List<Long> memberList;
private final Long roomId;
// 消息接收人
private final Long uid;
// 是否是申请进群
private final Boolean applyFor;
// 消息接收人
private final Long uid;
// 是否是申请进群
private final Boolean applyFor;
private final Integer channel;
public GroupInviteMemberEvent(Object source, Long roomId, List<Long> memberList, Long uid, Boolean applyFor) {
public GroupInviteMemberEvent(Object source, Long roomId, List<Long> memberList, Long uid, Boolean applyFor, Integer channel) {
super(source);
this.memberList = memberList;
this.roomId = roomId;
this.uid = uid;
this.applyFor = applyFor;
this.roomId = roomId;
this.uid = uid;
this.applyFor = applyFor;
this.channel = channel;
}
}
@@ -37,11 +37,11 @@ public class GroupInviteMemberListener {
@Async(LUOHUO_EXECUTOR)
@TransactionalEventListener(classes = GroupInviteMemberEvent.class, fallbackExecution = true, phase = TransactionPhase.AFTER_COMMIT)
public void sendAddMsg(GroupInviteMemberEvent event) {
List<Long> uidList = event.getMemberList();
Long roomId = event.getRoomId();
User user = userCache.get(event.getUid());
ChatMessageReq chatMessageReq = RoomAdapter.buildGroupAddMessage(event.getApplyFor(), roomId, user, userCache.getBatch(uidList));
chatService.sendMsg(chatMessageReq, user.getId());
List<Long> uidList = event.getMemberList();
Long roomId = event.getRoomId();
User user = userCache.get(event.getUid());
ChatMessageReq chatMessageReq = RoomAdapter.buildGroupAddMessage(event.getApplyFor(), event.getChannel(), roomId, user, userCache.getBatch(uidList));
chatService.sendMsg(chatMessageReq, user.getId());
}
}
@@ -61,12 +61,12 @@ public class RoomAdapter {
* 创建群的消息
* @return
*/
public static ChatMessageReq buildGroupAddMessage(Boolean applyFor, Long roomId, User inviter, Map<Long, User> member) {
public static ChatMessageReq buildGroupAddMessage(Boolean applyFor, Integer channel, Long roomId, User inviter, Map<Long, User> member) {
ChatMessageReq chatMessageReq = new ChatMessageReq();
chatMessageReq.setRoomId(roomId);
chatMessageReq.setMsgType(MessageTypeEnum.SYSTEM.getType());
String body = applyFor? String.format("%s加入群聊", inviter.getName()):
String.format("%s邀请%s加入群聊", inviter.getName(), member.values().stream().map(User::getName).collect(Collectors.joining("")));
String body = applyFor ? (channel != null && channel.equals(2) ? String.format("%s扫码进群", inviter.getName()) : String.format("%s加入群聊", inviter.getName()))
: String.format("%s邀请%s加入群聊", inviter.getName(), member.values().stream().map(User::getName).collect(Collectors.joining("")));
chatMessageReq.setBody(body);
return chatMessageReq;
}
@@ -1066,7 +1066,7 @@ public class RoomAppServiceImpl implements RoomAppService, InitializingBean {
}
// 2. 创建邀请记录
List<UserApply> invites = validUids.stream().map(inviteeUid -> new UserApply(uid, RoomTypeEnum.GROUP.getType(), roomGroup.getRoomId(), inviteeUid, StrUtil.format("{}邀请你加入{}", userSummaryCache.get(uid).getName(), roomGroup.getName()), NoticeStatusEnum.UNTREATED.getStatus(), UNREAD.getCode(), 0, false)).collect(Collectors.toList());
List<UserApply> invites = validUids.stream().map(inviteeUid -> new UserApply(uid, RoomTypeEnum.GROUP.getType(), roomGroup.getRoomId(), inviteeUid, StrUtil.format("{}邀请你加入{}", userSummaryCache.get(uid).getName(), roomGroup.getName()), NoticeStatusEnum.UNTREATED.getStatus(), UNREAD.getCode(), 0, false, 1)).collect(Collectors.toList());
transactionTemplate.execute(e -> userApplyDao.saveBatch(invites));
// 3. 通知被邀请的人进群, 通知时绑定通知id
@@ -44,7 +44,7 @@ public interface FriendService {
* @param type 申请类型
* @return
*/
Long createUserApply(Long uid, Long roomId, Long targetId, String msg, Integer type);
Long createUserApply(Long uid, Long roomId, Long targetId, String msg, Integer type, Integer channel);
/**
* 与系统用户创建好友关系
@@ -8,6 +8,7 @@ import com.luohuo.flex.common.cache.common.WxMsgKeyBuilder;
import com.luohuo.flex.common.constant.MqConstant;
import com.luohuo.flex.im.common.constant.RedisKey;
import com.luohuo.flex.im.core.user.dao.UserDao;
import com.luohuo.flex.im.enums.UserTypeEnum;
import com.luohuo.flex.model.entity.dto.LoginMessageDTO;
import com.luohuo.flex.model.entity.dto.ScanSuccessMessageDTO;
import com.luohuo.flex.im.domain.entity.User;
@@ -70,6 +71,9 @@ public class WxMsgService {
User user = userDao.getByOpenId(openid);
// 如果已经注册,直接登录成功
if (Objects.nonNull(user) && StringUtils.isNotEmpty(user.getAvatar())) {
if (Objects.equals(user.getUserType(), UserTypeEnum.BOT.getValue())) {
return new TextBuilder().build("机器人账号不允许登录", wxMpXmlMessage, wxMpService);
}
mqProducer.sendMsg(MqConstant.LOGIN_MSG_TOPIC, new LoginMessageDTO(user.getId(), loginCode));
return null;
}
@@ -101,6 +105,9 @@ public class WxMsgService {
*/
public void authorize(WxOAuth2UserInfo userInfo) {
User user = userDao.getByOpenId(userInfo.getOpenid());
if (Objects.nonNull(user) && Objects.equals(user.getUserType(), UserTypeEnum.BOT.getValue())) {
return;
}
// 更新用户信息
if (StringUtils.isEmpty(user.getName())) {
fillUserInfo(user.getId(), userInfo);
@@ -162,11 +162,17 @@ public class ApplyServiceImpl implements ApplyService {
// 获取到这个群的管理员的人的信息
List<Long> groupAdminIds = roomService.getGroupUsers(roomGroup.getId(), true);
SummeryInfoDTO userInfo = userSummaryCache.get(uid);
String msg = StrUtil.format("用户{}申请加入群聊{}", userInfo.getName(), roomGroup.getName());
SummeryInfoDTO userInfo = userSummaryCache.get(uid);
String msg = StrUtil.format("用户{}申请加入群聊{}", userInfo.getName(), roomGroup.getName());
if (req.getType().equals(2) && StrUtil.isBlank(req.getMsg())) {
req.setMsg("扫码加入群聊");
} else if (StrUtil.isBlank(req.getMsg())) {
req.setMsg("申请加入群聊");
}
// 申请进入群聊
Long applyId = friendService.createUserApply(uid, roomGroup.getRoomId(), uid, msg, RoomTypeEnum.GROUP.getType());
Integer channel = req.getType().equals(2) ? 2 : 3;
Long applyId = friendService.createUserApply(uid, roomGroup.getRoomId(), uid, msg, RoomTypeEnum.GROUP.getType(), channel);
noticeService.createNotice(
RoomTypeEnum.GROUP,
NoticeTypeEnum.GROUP_APPLY,
@@ -175,8 +181,8 @@ public class ApplyServiceImpl implements ApplyService {
applyId,
uid,
roomGroup.getRoomId(),
req.getMsg()
);
req.getMsg()
);
for (Long groupAdminId : groupAdminIds) {
noticeService.createNotice(
@@ -187,8 +193,8 @@ public class ApplyServiceImpl implements ApplyService {
applyId,
uid,
roomGroup.getRoomId(),
req.getMsg()
);
req.getMsg()
);
}
return true;
}
@@ -314,8 +320,8 @@ public class ApplyServiceImpl implements ApplyService {
cachePlusOps.sAdd(gKey, infoUid);
roomAppService.asyncOnline(Arrays.asList(infoUid), room.getId(), true);
SpringUtils.publishEvent(new GroupInviteMemberEvent(this, room.getId(), Arrays.asList(infoUid), invite.getUid(), invite.getApplyFor()));
SpringUtils.publishEvent(new GroupMemberAddEvent(this, room.getId(), Math.toIntExact(cachePlusOps.sCard(gKey)), Math.toIntExact(cachePlusOps.sCard(onlineGroupMembersKey)), Arrays.asList(infoUid), uid));
SpringUtils.publishEvent(new GroupInviteMemberEvent(this, room.getId(), Arrays.asList(infoUid), invite.getUid(), invite.getApplyFor(), invite.getJoinChannel()));
SpringUtils.publishEvent(new GroupMemberAddEvent(this, room.getId(), Math.toIntExact(cachePlusOps.sCard(gKey)), Math.toIntExact(cachePlusOps.sCard(onlineGroupMembersKey)), Arrays.asList(infoUid), uid));
}
}
case IGNORE -> {
@@ -131,7 +131,7 @@ public class FriendServiceImpl implements FriendService, InitializingBean {
}
@Override
public Long createUserApply(Long uid, Long roomId, Long targetId, String msg, Integer type) {
public Long createUserApply(Long uid, Long roomId, Long targetId, String msg, Integer type, Integer channel) {
UserApply userApply = new UserApply();
userApply.setMsg(msg);
userApply.setUid(uid);
@@ -141,6 +141,7 @@ public class FriendServiceImpl implements FriendService, InitializingBean {
userApply.setStatus(NoticeStatusEnum.UNTREATED.getStatus());
userApply.setReadStatus(ApplyReadStatusEnum.UNREAD.getCode());
userApply.setApplyFor(true);
userApply.setJoinChannel(channel);
userApplyDao.save(userApply);
return userApply.getId();
}
@@ -5,7 +5,7 @@
<parent>
<artifactId>luohuo-im</artifactId>
<groupId>com.luohuo.flex</groupId>
<version>3.0.5</version>
<version>3.0.6</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -5,7 +5,7 @@
<parent>
<artifactId>luohuo-im</artifactId>
<groupId>com.luohuo.flex</groupId>
<version>3.0.5</version>
<version>3.0.6</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -82,4 +82,10 @@ public class UserApply extends Entity<Long> {
*/
@TableField("apply_for")
private Boolean applyFor;
/**
* 进群渠道 1-邀请 2-扫码 3-搜索
*/
@TableField("join_channel")
private Integer joinChannel;
}
@@ -5,7 +5,7 @@
<parent>
<groupId>com.luohuo.flex</groupId>
<artifactId>luohuo-im-facade</artifactId>
<version>3.0.5</version>
<version>3.0.6</version>
<relativePath>../pom.xml</relativePath>
</parent>
@@ -5,7 +5,7 @@
<parent>
<groupId>com.luohuo.flex</groupId>
<artifactId>luohuo-im-facade</artifactId>
<version>3.0.5</version>
<version>3.0.6</version>
<relativePath>../pom.xml</relativePath>
</parent>
@@ -5,7 +5,7 @@
<parent>
<groupId>com.luohuo.flex</groupId>
<artifactId>luohuo-im-facade</artifactId>
<version>3.0.5</version>
<version>3.0.6</version>
<relativePath>../pom.xml</relativePath>
</parent>
@@ -5,7 +5,7 @@
<parent>
<artifactId>luohuo-im</artifactId>
<groupId>com.luohuo.flex</groupId>
<version>3.0.5</version>
<version>3.0.6</version>
<relativePath>../pom.xml</relativePath>
</parent>
@@ -5,7 +5,7 @@
<parent>
<artifactId>luohuo-im</artifactId>
<groupId>com.luohuo.flex</groupId>
<version>3.0.5</version>
<version>3.0.6</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
+1 -1
View File
@@ -5,7 +5,7 @@
<parent>
<groupId>com.luohuo.flex</groupId>
<artifactId>luohuo-dependencies-parent</artifactId>
<version>3.0.5</version>
<version>3.0.6</version>
<relativePath>../luohuo-dependencies-parent/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -5,7 +5,7 @@
<parent>
<artifactId>luohuo-oauth</artifactId>
<groupId>com.luohuo.flex</groupId>
<version>3.0.5</version>
<version>3.0.6</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -148,9 +148,8 @@ public class LoginStatusDTO implements Serializable {
private boolean isLocalHostIp(String ipAddress) {
try {
InetAddress inetAddress = InetAddress.getByName(ipAddress);
return inetAddress.isLoopbackAddress();
return inetAddress.isLoopbackAddress() || inetAddress.isLinkLocalAddress() || inetAddress.isSiteLocalAddress();
} catch (UnknownHostException e) {
// 处理异常情况,如果无法解析IP地址,则不视为本地地址
return false;
}
}
@@ -2,11 +2,6 @@ package com.luohuo.flex.oauth.service.impl;
import cn.hutool.core.thread.NamedThreadFactory;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpUtil;
import com.fasterxml.jackson.core.type.TypeReference;
import com.luohuo.basic.base.R;
import com.luohuo.basic.utils.JsonUtils;
import com.luohuo.basic.utils.TimeUtils;
import com.luohuo.flex.base.entity.tenant.DefUser;
import com.luohuo.flex.base.service.tenant.DefUserService;
import com.luohuo.flex.im.api.ImUserApi;
@@ -19,7 +14,8 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import com.luohuo.basic.log.util.AddressUtil;
import java.util.Objects;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.LinkedBlockingQueue;
@@ -35,89 +31,97 @@ import java.util.concurrent.TimeUnit;
@Slf4j
@RequiredArgsConstructor
public class IpServiceImpl implements IpService, DisposableBean {
private static final ExecutorService EXECUTOR = new ThreadPoolExecutor(1, 1,
0L, TimeUnit.MILLISECONDS,
new LinkedBlockingQueue<>(500),
new NamedThreadFactory("refresh-ipDetail",false));
private static final ExecutorService EXECUTOR = new ThreadPoolExecutor(1, 1,
0L, TimeUnit.MILLISECONDS,
new LinkedBlockingQueue<>(500),
new NamedThreadFactory("refresh-ipDetail",false));
private final ImUserApi userApi;
private final DefUserService defUserService;
private final DefUserService defUserService;
@Override
public void refreshIpDetailAsync(Long uid, Long userId, IpInfo ipInfo) {
EXECUTOR.execute(() -> {
if (Objects.isNull(ipInfo)) {
return;
}
String ip = ipInfo.needRefreshIp();
if (StrUtil.isBlank(ip)) {
return;
}
IpDetail ipDetail = tryGetIpDetailOrNullTreeTimes(ip);
if (Objects.nonNull(ipDetail)) {
ipInfo.refreshIpDetail(ipDetail);
@Override
public void refreshIpDetailAsync(Long uid, Long userId, IpInfo ipInfo) {
EXECUTOR.execute(() -> {
if (Objects.isNull(ipInfo)) {
return;
}
String ip = ipInfo.needRefreshIp();
if (StrUtil.isBlank(ip)) {
return;
}
IpDetail ipDetail = getIpDetailOrNull(ip);
if (Objects.nonNull(ipDetail)) {
ipInfo.refreshIpDetail(ipDetail);
DefUser update = new DefUser();
update.setId(userId);
update.setIpInfo(ipInfo);
defUserService.updateById(update);
update.setId(userId);
update.setIpInfo(ipInfo);
defUserService.updateById(update);
userApi.refreshIpInfo(new RefreshIpInfo(uid, ipInfo));
} else {
log.error("get ip detail fail ip:{},userId:{}", ip, userId);
}
});
}
private static IpDetail tryGetIpDetailOrNullTreeTimes(String ip) {
for (int i = 0; i < 3; i++) {
IpDetail ipDetail = getIpDetailOrNull(ip);
if (Objects.nonNull(ipDetail)) {
return ipDetail;
}
try {
Thread.sleep(2000);
} catch (InterruptedException e) {
log.error("get ip detail fail ip:{},uid:{}", ip, i);
}
}
return null;
}
} else {
log.error("get ip detail fail ip:{},userId:{}", ip, userId);
}
});
}
public static IpDetail getIpDetailOrNull(String ip) {
String body = HttpUtil.get("https://ip.taobao.com/outGetIpInfo?ip=" + ip + "&accessKey=alibaba-inc");
try {
R<IpDetail> result = JsonUtils.toObj(body.replace("XX", "").replace("xx", ""), new TypeReference<>() {});
return result.getData();
} catch (Exception ignored) {
}
return null;
}
//测试耗时结果 100次查询总耗时约100s,平均一次成功查询需要1s,可以接受
//第99次成功,目前耗时:99545ms
public static void main(String[] args) {
LocalDateTime begin = LocalDateTime.now();
for (int i = 0; i < 100; i++) {
int finalI = i;
EXECUTOR.execute(() -> {
IpDetail ipDetail = tryGetIpDetailOrNullTreeTimes("127.0.0.1");
if (Objects.nonNull(ipDetail)) {
LocalDateTime date = LocalDateTime.now();
System.out.println(String.format("第%d次成功,目前耗时:%dms", finalI, (TimeUtils.getTime(date) - TimeUtils.getTime(begin))));
}
});
}
}
@Override
public void destroy() throws InterruptedException {
EXECUTOR.shutdown();
if (!EXECUTOR.awaitTermination(30, TimeUnit.SECONDS)) {
//最多等30秒,处理不完就拉倒
if (log.isErrorEnabled()) {
log.error("Timed out while waiting for executor [{}] to terminate", EXECUTOR);
if (StrUtil.isBlank(ip)) {
return null;
}
String region = AddressUtil.getRegion(ip);
if (StrUtil.isBlank(region) || "localhost".equalsIgnoreCase(region)) {
return null;
}
String[] arr = region.split("\\|");
for (int i = 0; i < arr.length; i++) {
String v = StrUtil.trim(arr[i]);
arr[i] = "0".equals(v) ? StrUtil.EMPTY : v;
}
IpDetail detail = new IpDetail();
detail.setIp(ip);
int len = arr.length;
if (len >= 1) detail.setCountry(arr[0]);
if (len == 5) {
detail.setArea(arr[1]);
detail.setRegion(arr[2]);
detail.setCity(normalizeCity(arr[3]));
detail.setIsp(arr[4]);
} else if (len == 4) {
detail.setArea(StrUtil.EMPTY);
detail.setRegion(arr[1]);
detail.setCity(normalizeCity(arr[2]));
detail.setIsp(arr[3]);
} else if (len == 3) {
detail.setRegion(arr[1]);
detail.setCity(normalizeCity(arr[2]));
} else if (len == 2) {
detail.setRegion(arr[1]);
}
return detail;
} catch (Exception e) {
return null;
}
}
}
private static String normalizeCity(String city) {
if (StrUtil.isBlank(city)) {
return city;
}
String v = StrUtil.trim(city);
return StrUtil.removeSuffix(v, "");
}
@Override
public void destroy() throws InterruptedException {
EXECUTOR.shutdown();
if (!EXECUTOR.awaitTermination(30, TimeUnit.SECONDS)) {
//最多等30秒,处理不完就拉倒
if (log.isErrorEnabled()) {
log.error("Timed out while waiting for executor [{}] to terminate", EXECUTOR);
}
}
}
}
@@ -5,7 +5,7 @@
<parent>
<artifactId>luohuo-oauth</artifactId>
<groupId>com.luohuo.flex</groupId>
<version>3.0.5</version>
<version>3.0.6</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -5,7 +5,7 @@
<parent>
<groupId>com.luohuo.flex</groupId>
<artifactId>luohuo-oauth</artifactId>
<version>3.0.5</version>
<version>3.0.6</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -5,7 +5,7 @@
<parent>
<groupId>com.luohuo.flex</groupId>
<artifactId>luohuo-oauth-facade</artifactId>
<version>3.0.5</version>
<version>3.0.6</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -5,7 +5,7 @@
<parent>
<groupId>com.luohuo.flex</groupId>
<artifactId>luohuo-oauth-facade</artifactId>
<version>3.0.5</version>
<version>3.0.6</version>
<relativePath>../pom.xml</relativePath>
</parent>
@@ -5,7 +5,7 @@
<parent>
<groupId>com.luohuo.flex</groupId>
<artifactId>luohuo-oauth-facade</artifactId>
<version>3.0.5</version>
<version>3.0.6</version>
<relativePath>../pom.xml</relativePath>
</parent>
@@ -5,7 +5,7 @@
<parent>
<artifactId>luohuo-oauth</artifactId>
<groupId>com.luohuo.flex</groupId>
<version>3.0.5</version>
<version>3.0.6</version>
<relativePath>../pom.xml</relativePath>
</parent>
@@ -5,7 +5,7 @@
<parent>
<artifactId>luohuo-oauth</artifactId>
<groupId>com.luohuo.flex</groupId>
<version>3.0.5</version>
<version>3.0.6</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
+1 -1
View File
@@ -5,7 +5,7 @@
<parent>
<groupId>com.luohuo.flex</groupId>
<artifactId>luohuo-dependencies-parent</artifactId>
<version>3.0.5</version>
<version>3.0.6</version>
<relativePath>../luohuo-dependencies-parent/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -5,7 +5,7 @@
<parent>
<groupId>com.luohuo.flex</groupId>
<artifactId>luohuo-public</artifactId>
<version>3.0.5</version>
<version>3.0.6</version>
<relativePath>../pom.xml</relativePath>
</parent>
@@ -5,7 +5,7 @@
<parent>
<groupId>com.luohuo.flex</groupId>
<artifactId>luohuo-public</artifactId>
<version>3.0.5</version>
<version>3.0.6</version>
<relativePath>../pom.xml</relativePath>
</parent>
@@ -5,7 +5,7 @@
<parent>
<groupId>com.luohuo.flex</groupId>
<artifactId>luohuo-public</artifactId>
<version>3.0.5</version>
<version>3.0.6</version>
<relativePath>../pom.xml</relativePath>
</parent>
@@ -5,7 +5,7 @@
<parent>
<groupId>com.luohuo.flex</groupId>
<artifactId>luohuo-public</artifactId>
<version>3.0.5</version>
<version>3.0.6</version>
<relativePath>../pom.xml</relativePath>
</parent>
@@ -5,7 +5,7 @@
<parent>
<groupId>com.luohuo.flex</groupId>
<artifactId>luohuo-public</artifactId>
<version>3.0.5</version>
<version>3.0.6</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -5,7 +5,7 @@
<parent>
<groupId>com.luohuo.flex</groupId>
<artifactId>luohuo-login-user-facade</artifactId>
<version>3.0.5</version>
<version>3.0.6</version>
<relativePath>../pom.xml</relativePath>
</parent>
@@ -5,7 +5,7 @@
<parent>
<groupId>com.luohuo.flex</groupId>
<artifactId>luohuo-login-user-facade</artifactId>
<version>3.0.5</version>
<version>3.0.6</version>
<relativePath>../pom.xml</relativePath>
</parent>
@@ -5,7 +5,7 @@
<parent>
<groupId>com.luohuo.flex</groupId>
<artifactId>luohuo-login-user-facade</artifactId>
<version>3.0.5</version>
<version>3.0.6</version>
<relativePath>../pom.xml</relativePath>
</parent>
@@ -5,7 +5,7 @@
<parent>
<groupId>com.luohuo.flex</groupId>
<artifactId>luohuo-public</artifactId>
<version>3.0.5</version>
<version>3.0.6</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>luohuo-login-user-facade</artifactId>
@@ -5,7 +5,7 @@
<parent>
<groupId>com.luohuo.flex</groupId>
<artifactId>luohuo-public</artifactId>
<version>3.0.5</version>
<version>3.0.6</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -5,7 +5,7 @@
<parent>
<groupId>com.luohuo.flex</groupId>
<artifactId>luohuo-public</artifactId>
<version>3.0.5</version>
<version>3.0.6</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -5,7 +5,7 @@
<parent>
<groupId>com.luohuo.flex</groupId>
<artifactId>luohuo-public</artifactId>
<version>3.0.5</version>
<version>3.0.6</version>
<relativePath>../pom.xml</relativePath>
</parent>
+1 -1
View File
@@ -5,7 +5,7 @@
<parent>
<groupId>com.luohuo.flex</groupId>
<artifactId>luohuo-dependencies-parent</artifactId>
<version>3.0.5</version>
<version>3.0.6</version>
<relativePath>../luohuo-dependencies-parent/pom.xml</relativePath>
</parent>
@@ -5,7 +5,7 @@
<parent>
<artifactId>luohuo-support</artifactId>
<groupId>com.luohuo.flex</groupId>
<version>3.0.5</version>
<version>3.0.6</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -6,7 +6,7 @@
<parent>
<artifactId>luohuo-support</artifactId>
<groupId>com.luohuo.flex</groupId>
<version>3.0.5</version>
<version>3.0.6</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>luohuo-job-executor</artifactId>
@@ -5,7 +5,7 @@
<parent>
<artifactId>luohuo-support</artifactId>
<groupId>com.luohuo.flex</groupId>
<version>3.0.5</version>
<version>3.0.6</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
+1 -1
View File
@@ -5,7 +5,7 @@
<parent>
<groupId>com.luohuo.flex</groupId>
<artifactId>luohuo-dependencies-parent</artifactId>
<version>3.0.5</version>
<version>3.0.6</version>
<relativePath>../luohuo-dependencies-parent/pom.xml</relativePath>
</parent>
@@ -6,7 +6,7 @@
<parent>
<groupId>com.luohuo.flex</groupId>
<artifactId>luohuo-system</artifactId>
<version>3.0.5</version>
<version>3.0.6</version>
<relativePath>../pom.xml</relativePath>
</parent>
@@ -6,7 +6,7 @@
<parent>
<groupId>com.luohuo.flex</groupId>
<artifactId>luohuo-system</artifactId>
<version>3.0.5</version>
<version>3.0.6</version>
</parent>
<artifactId>luohuo-system-controller</artifactId>
@@ -6,7 +6,7 @@
<parent>
<groupId>com.luohuo.flex</groupId>
<artifactId>luohuo-system</artifactId>
<version>3.0.5</version>
<version>3.0.6</version>
</parent>
<artifactId>luohuo-system-entity</artifactId>
@@ -5,7 +5,7 @@
<parent>
<groupId>com.luohuo.flex</groupId>
<artifactId>luohuo-system-facade</artifactId>
<version>3.0.5</version>
<version>3.0.6</version>
<relativePath>../pom.xml</relativePath>
</parent>
@@ -5,7 +5,7 @@
<parent>
<groupId>com.luohuo.flex</groupId>
<artifactId>luohuo-system-facade</artifactId>
<version>3.0.5</version>
<version>3.0.6</version>
<relativePath>../pom.xml</relativePath>
</parent>
@@ -5,7 +5,7 @@
<parent>
<groupId>com.luohuo.flex</groupId>
<artifactId>luohuo-system-facade</artifactId>
<version>3.0.5</version>
<version>3.0.6</version>
<relativePath>../pom.xml</relativePath>
</parent>
@@ -6,7 +6,7 @@
<parent>
<groupId>com.luohuo.flex</groupId>
<artifactId>luohuo-system</artifactId>
<version>3.0.5</version>
<version>3.0.6</version>
</parent>
<artifactId>luohuo-system-facade</artifactId>
@@ -5,7 +5,7 @@
<parent>
<artifactId>luohuo-system</artifactId>
<groupId>com.luohuo.flex</groupId>
<version>3.0.5</version>
<version>3.0.6</version>
<relativePath>../pom.xml</relativePath>
</parent>
+1 -1
View File
@@ -6,7 +6,7 @@
<parent>
<groupId>com.luohuo.flex</groupId>
<artifactId>luohuo-dependencies-parent</artifactId>
<version>3.0.5</version>
<version>3.0.6</version>
<relativePath>../luohuo-dependencies-parent/pom.xml</relativePath>
</parent>
+1 -1
View File
@@ -5,7 +5,7 @@
<parent>
<artifactId>luohuo-ws</artifactId>
<groupId>com.luohuo.flex</groupId>
<version>3.0.5</version>
<version>3.0.6</version>
<relativePath>../pom.xml</relativePath>
</parent>
@@ -5,7 +5,7 @@
<parent>
<artifactId>luohuo-ws</artifactId>
<groupId>com.luohuo.flex</groupId>
<version>3.0.5</version>
<version>3.0.6</version>
<relativePath>../pom.xml</relativePath>
</parent>
@@ -5,7 +5,7 @@
<parent>
<artifactId>luohuo-ws</artifactId>
<groupId>com.luohuo.flex</groupId>
<version>3.0.5</version>
<version>3.0.6</version>
<relativePath>../pom.xml</relativePath>
</parent>
+1 -1
View File
@@ -5,7 +5,7 @@
<parent>
<groupId>com.luohuo.flex</groupId>
<artifactId>luohuo-dependencies-parent</artifactId>
<version>3.0.5</version>
<version>3.0.6</version>
<relativePath>../luohuo-dependencies-parent/pom.xml</relativePath>
</parent>
+1 -1
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>luohuo-util</artifactId>
<groupId>com.luohuo.basic</groupId>
<version>3.0.5</version>
<version>3.0.6</version>
<relativePath>../pom.xml</relativePath>
</parent>
+1 -1
View File
@@ -5,7 +5,7 @@
<parent>
<artifactId>luohuo-util</artifactId>
<groupId>com.luohuo.basic</groupId>
<version>3.0.5</version>
<version>3.0.6</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
+1 -1
View File
@@ -5,7 +5,7 @@
<parent>
<artifactId>luohuo-util</artifactId>
<groupId>com.luohuo.basic</groupId>
<version>3.0.5</version>
<version>3.0.6</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
+1 -1
View File
@@ -5,7 +5,7 @@
<parent>
<artifactId>luohuo-util</artifactId>
<groupId>com.luohuo.basic</groupId>
<version>3.0.5</version>
<version>3.0.6</version>
<relativePath>../pom.xml</relativePath>
</parent>
+1 -1
View File
@@ -5,7 +5,7 @@
<parent>
<artifactId>luohuo-util</artifactId>
<groupId>com.luohuo.basic</groupId>
<version>3.0.5</version>
<version>3.0.6</version>
<relativePath>../pom.xml</relativePath>
</parent>
+1 -1
View File
@@ -5,7 +5,7 @@
<parent>
<artifactId>luohuo-util</artifactId>
<groupId>com.luohuo.basic</groupId>
<version>3.0.5</version>
<version>3.0.6</version>
<relativePath>../pom.xml</relativePath>
</parent>

Some files were not shown because too many files have changed in this diff Show More