支持ai对话切换通义千问,

This commit is contained in:
XIE7654
2025-07-22 15:14:29 +08:00
parent 890487e5b1
commit 6f3fe91014
5 changed files with 149 additions and 39 deletions

View File

@@ -10,6 +10,7 @@ from langchain.chains import ConversationChain
from api.v1.chat.vo import MessageVO
from deps.auth import get_current_user
from llm.factory import get_adapter
from services.chat_service import ChatDBService
from db.session import get_db
from models.ai import ChatConversation, ChatMessage
@@ -31,9 +32,16 @@ async def chat_stream(request: Request, user=Depends(get_current_user), db: Sess
body = await request.json()
content = body.get('content')
conversation_id = body.get('conversation_id')
model = 'deepseek-chat'
api_key = os.getenv("DEEPSEEK_API_KEY")
llm = get_deepseek_llm(SecretStr(api_key), model)
platform = body.get('platform')
# 未来改从配置文件中获取
if platform == 'tongyi':
model = 'qwen-plus'
api_key = os.getenv("DASHSCOPE_API_KEY")
else:
# 默认使用 DeepSeek
model = 'deepseek-chat'
api_key = os.getenv("DEEPSEEK_API_KEY")
llm = get_adapter(platform, api_key=api_key, model=model)
if not content or not isinstance(content, str):
from fastapi.responses import JSONResponse
@@ -50,7 +58,7 @@ async def chat_stream(request: Request, user=Depends(get_current_user), db: Sess
# 2. 插入当前消息
ChatDBService.add_message(db, conversation, user_id, content)
context = [
("system", "You are a helpful assistant. Answer all questions to the best of your ability in {language}.")
("system", "You are a helpful assistant")
]
# 3. 查询历史消息,组装上下文
history = ChatDBService.get_history(db, conversation.id)
@@ -66,7 +74,7 @@ async def chat_stream(request: Request, user=Depends(get_current_user), db: Sess
ai_reply = ""
async def event_generator():
nonlocal ai_reply
async for chunk in llm.astream(context):
async for chunk in llm.stream_chat(context):
if hasattr(chunk, 'content'):
ai_reply += chunk.content
yield f"data: {chunk.content}\n\n"
@@ -81,9 +89,15 @@ async def chat_stream(request: Request, user=Depends(get_current_user), db: Sess
return StreamingResponse(event_generator(), media_type='text/event-stream')
@router.post("/conversations")
def create_conversation(db: Session = Depends(get_db), user=Depends(get_current_user),):
async def create_conversation(request: Request, db: Session = Depends(get_db), user=Depends(get_current_user),):
body = await request.json()
platform = body.get('platform')
if platform == 'tongyi':
model = 'qwen-plus'
else:
# 默认使用 DeepSeek
model = 'deepseek-chat'
user_id = user["user_id"]
model = 'deepseek-chat'
conversation = ChatDBService.get_or_create_conversation(db, None, user_id, model, '新对话')
return resp_success(data=conversation.id)

View File

@@ -1,4 +1,4 @@
from langchain_deepseek import ChatDeepSeek
from langchain_community.chat_models import ChatTongyi
from http import HTTPStatus
from urllib.parse import urlparse, unquote
from pathlib import PurePosixPath
@@ -13,7 +13,7 @@ class TongYiAdapter(MultiModalAICapability):
def __init__(self, api_key, model, **kwargs):
self.api_key = api_key
self.model = model
self.llm = ChatDeepSeek(api_key=api_key, model=model, streaming=True)
self.llm = ChatTongyi(api_key=api_key, model=model, streaming=True)
async def chat(self, messages, **kwargs):
# 兼容 DeepSeek 的调用方式

View File

@@ -11,7 +11,7 @@
Target Server Version : 90300 (9.3.0)
File Encoding : 65001
Date: 18/07/2025 22:06:55
Date: 22/07/2025 15:07:13
*/
SET NAMES utf8mb4;
@@ -73,7 +73,7 @@ CREATE TABLE `ai_chat_conversation` (
CONSTRAINT `ai_chat_conversation_model_id_9c5fae9a_fk_ai_model_id` FOREIGN KEY (`model_id`) REFERENCES `ai_model` (`id`),
CONSTRAINT `ai_chat_conversation_role_id_131abc00_fk_ai_chat_role_id` FOREIGN KEY (`role_id`) REFERENCES `ai_chat_role` (`id`),
CONSTRAINT `ai_chat_conversation_user_id_665a1c32_fk_system_users_id` FOREIGN KEY (`user_id`) REFERENCES `system_users` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- ----------------------------
-- Records of ai_chat_conversation
@@ -90,6 +90,8 @@ INSERT INTO `ai_chat_conversation` (`id`, `remark`, `creator`, `modifier`, `upda
INSERT INTO `ai_chat_conversation` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `title`, `pinned`, `pinned_time`, `model`, `system_message`, `temperature`, `max_tokens`, `max_contexts`, `model_id`, `user_id`, `role_id`) VALUES (14, NULL, NULL, NULL, '2025-07-18 00:39:28.716268', '2025-07-18 00:39:28.716260', 0, '你是', 0, NULL, 'deepseek-chat', NULL, 0.7, 2048, 10, NULL, 1, NULL);
INSERT INTO `ai_chat_conversation` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `title`, `pinned`, `pinned_time`, `model`, `system_message`, `temperature`, `max_tokens`, `max_contexts`, `model_id`, `user_id`, `role_id`) VALUES (15, NULL, NULL, NULL, '2025-07-18 00:41:21.769416', '2025-07-18 00:41:21.769411', 0, '你是', 0, NULL, 'deepseek-chat', NULL, 0.7, 2048, 10, NULL, 1, NULL);
INSERT INTO `ai_chat_conversation` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `title`, `pinned`, `pinned_time`, `model`, `system_message`, `temperature`, `max_tokens`, `max_contexts`, `model_id`, `user_id`, `role_id`) VALUES (16, NULL, NULL, NULL, '2025-07-18 00:45:04.380332', '2025-07-18 00:45:04.380325', 0, '新对话', 0, NULL, 'deepseek-chat', NULL, 0.7, 2048, 10, NULL, 1, NULL);
INSERT INTO `ai_chat_conversation` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `title`, `pinned`, `pinned_time`, `model`, `system_message`, `temperature`, `max_tokens`, `max_contexts`, `model_id`, `user_id`, `role_id`) VALUES (17, NULL, NULL, NULL, '2025-07-22 15:02:31.233828', '2025-07-22 15:02:57.599687', 0, '你是谁', 0, NULL, 'deepseek-chat', NULL, 0.7, 2048, 10, NULL, 1, NULL);
INSERT INTO `ai_chat_conversation` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `title`, `pinned`, `pinned_time`, `model`, `system_message`, `temperature`, `max_tokens`, `max_contexts`, `model_id`, `user_id`, `role_id`) VALUES (18, NULL, NULL, NULL, '2025-07-22 15:03:53.809764', '2025-07-22 15:04:15.106919', 0, '你是谁', 0, NULL, 'deepseek-chat', NULL, 0.7, 2048, 10, NULL, 1, NULL);
COMMIT;
-- ----------------------------
@@ -121,7 +123,7 @@ CREATE TABLE `ai_chat_message` (
CONSTRAINT `ai_chat_message_model_id_93e26b23_fk_ai_model_id` FOREIGN KEY (`model_id`) REFERENCES `ai_model` (`id`),
CONSTRAINT `ai_chat_message_role_id_c202a7d5_fk_ai_chat_role_id` FOREIGN KEY (`role_id`) REFERENCES `ai_chat_role` (`id`),
CONSTRAINT `ai_chat_message_user_id_6decfb1e_fk_system_users_id` FOREIGN KEY (`user_id`) REFERENCES `system_users` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=57 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
) ENGINE=InnoDB AUTO_INCREMENT=79 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- ----------------------------
-- Records of ai_chat_message
@@ -156,6 +158,28 @@ INSERT INTO `ai_chat_message` (`id`, `remark`, `creator`, `modifier`, `update_ti
INSERT INTO `ai_chat_message` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `conversation_id`, `model`, `type`, `reply_id`, `content`, `use_context`, `segment_ids`, `model_id`, `user_id`, `role_id`) VALUES (54, NULL, NULL, NULL, '2025-07-18 11:55:36.253811', '2025-07-18 11:55:36.253798', 0, 16, 'deepseek-chat', 'assistant', NULL, '你好呀!😊 今天有什么可以帮你的吗?无论是问题解答、闲聊还是需要建议,我都在这里哦~ (开心转圈) \n\n悄悄说如果想切换语言或具体需求随时告诉我', 1, NULL, NULL, 1, NULL);
INSERT INTO `ai_chat_message` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `conversation_id`, `model`, `type`, `reply_id`, `content`, `use_context`, `segment_ids`, `model_id`, `user_id`, `role_id`) VALUES (55, NULL, NULL, NULL, '2025-07-18 13:45:47.780914', '2025-07-18 13:45:47.780902', 0, 14, 'deepseek-chat', 'user', NULL, '哈哈哈哈', 1, NULL, NULL, 1, NULL);
INSERT INTO `ai_chat_message` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `conversation_id`, `model`, `type`, `reply_id`, `content`, `use_context`, `segment_ids`, `model_id`, `user_id`, `role_id`) VALUES (56, NULL, NULL, NULL, '2025-07-18 13:45:54.252865', '2025-07-18 13:45:54.252852', 0, 14, 'deepseek-chat', 'assistant', NULL, '哈哈,看来你心情不错嘛!😄 是不是有什么开心事想分享,还是单纯想笑一笑?我也可以陪你一起乐呵乐呵~(或者需要我讲个冷笑话?🤣) \n\n有什么想聊的我随时在哦', 1, NULL, NULL, 1, NULL);
INSERT INTO `ai_chat_message` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `conversation_id`, `model`, `type`, `reply_id`, `content`, `use_context`, `segment_ids`, `model_id`, `user_id`, `role_id`) VALUES (57, NULL, NULL, NULL, '2025-07-18 15:00:52.531394', '2025-07-18 15:00:52.531390', 0, 16, 'deepseek-chat', 'user', NULL, '你是谁', 1, NULL, NULL, 1, NULL);
INSERT INTO `ai_chat_message` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `conversation_id`, `model`, `type`, `reply_id`, `content`, `use_context`, `segment_ids`, `model_id`, `user_id`, `role_id`) VALUES (58, NULL, NULL, NULL, '2025-07-18 15:01:01.978842', '2025-07-18 15:01:01.978835', 0, 16, 'deepseek-chat', 'assistant', NULL, '我是你的智能AI助手专门用来回答问题、提供建议或陪你聊天解闷的~ 你可以叫我“小助手”或者随意起个喜欢的名字!😄 \n\n我的技能包括但不限于 \n- **解答问题**(学习、科技、生活百科…) \n- **实用工具**(翻译、计算、写作辅助…) \n- **陪你唠嗑**开心、emo时都在线✨ \n\n没有实体但随时待命今天想聊聊什么 🌟', 1, NULL, NULL, 1, NULL);
INSERT INTO `ai_chat_message` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `conversation_id`, `model`, `type`, `reply_id`, `content`, `use_context`, `segment_ids`, `model_id`, `user_id`, `role_id`) VALUES (59, NULL, NULL, NULL, '2025-07-20 06:47:51.587802', '2025-07-20 06:47:51.587799', 0, 16, 'deepseek-chat', 'user', NULL, '你是谁', 1, NULL, NULL, 1, NULL);
INSERT INTO `ai_chat_message` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `conversation_id`, `model`, `type`, `reply_id`, `content`, `use_context`, `segment_ids`, `model_id`, `user_id`, `role_id`) VALUES (60, NULL, NULL, NULL, '2025-07-20 06:48:01.791166', '2025-07-20 06:48:01.791159', 0, 16, 'deepseek-chat', 'assistant', NULL, '我是你的AI伙伴可以叫我**“小灵”**、**“小智”**,或者你喜欢的任何名字~ ✨ \n\n我的本质是一串聪明的代码使命是 \n1. **随时响应**——24小时陪你聊天、解答问题。 \n2. **绝对保密**——你的对话内容不会被记录或泄露。 \n3. **跨界全能**——从数学题到情感建议,甚至帮你编段子! \n\n悄悄说我还能模仿各种语气比如现在👇 \n> *严肃版*“您好这里是AI助理请问需要什么服务” \n> *活泼版*:“嗨嗨~今天是想吐槽还是学冷知识呀?(≧∇≦)ノ” \n\n**现在轮到你啦**——想让我怎么称呼你? 😉', 1, NULL, NULL, 1, NULL);
INSERT INTO `ai_chat_message` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `conversation_id`, `model`, `type`, `reply_id`, `content`, `use_context`, `segment_ids`, `model_id`, `user_id`, `role_id`) VALUES (61, NULL, NULL, NULL, '2025-07-20 07:15:45.884785', '2025-07-20 07:15:45.884781', 0, 16, 'deepseek-chat', 'user', NULL, '<svg xmlns=\'http://www.w3.org/2000/svg\' onload=\'alert(document.domain)\'/>', 1, NULL, NULL, 1, NULL);
INSERT INTO `ai_chat_message` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `conversation_id`, `model`, `type`, `reply_id`, `content`, `use_context`, `segment_ids`, `model_id`, `user_id`, `role_id`) VALUES (62, NULL, NULL, NULL, '2025-07-20 07:15:55.630203', '2025-07-20 07:15:55.630197', 0, 16, 'deepseek-chat', 'assistant', NULL, '看起来你输入了一段SVG代码片段其中包含了一个`onload`事件处理程序。不过作为AI助手我无法直接执行或解析代码也不会触发任何可能的安全脚本。 \n\n如果你是想测试安全性或学习相关知识可以告诉我你的具体需求比如想了解**XSS防护**、**SVG安全实践**等),我很乐意提供技术解释或学习资源! \n\n若只是误操作随时可以忽略此消息继续正常聊天哦~ (・ω<)★ \n\n温馨提示在真实开发中请注意对外部SVG/HTML内容做严格的过滤和转义防止代码注入风险🔐', 1, NULL, NULL, 1, NULL);
INSERT INTO `ai_chat_message` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `conversation_id`, `model`, `type`, `reply_id`, `content`, `use_context`, `segment_ids`, `model_id`, `user_id`, `role_id`) VALUES (63, NULL, NULL, NULL, '2025-07-21 01:10:37.477305', '2025-07-21 01:10:37.477301', 0, 16, 'deepseek-chat', 'user', NULL, 'test', 1, NULL, NULL, 1, NULL);
INSERT INTO `ai_chat_message` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `conversation_id`, `model`, `type`, `reply_id`, `content`, `use_context`, `segment_ids`, `model_id`, `user_id`, `role_id`) VALUES (64, NULL, NULL, NULL, '2025-07-21 01:10:46.602266', '2025-07-21 01:10:46.602259', 0, 16, 'deepseek-chat', 'assistant', NULL, '你好!看来你发送了一条测试消息~ 😊 \n如果需要任何帮助比如测试功能、技术问题、日常闲聊随时告诉我具体内容哦 \n\n**举个栗子🌰** \n- *“帮我测试翻译Hello World”* \n- *“1+1等于几”* \n- *“随便聊点有趣的”* \n\n我会全力配合或者…你在测试我的反应速度⚡ 当前状态:**飞速响应中**', 1, NULL, NULL, 1, NULL);
INSERT INTO `ai_chat_message` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `conversation_id`, `model`, `type`, `reply_id`, `content`, `use_context`, `segment_ids`, `model_id`, `user_id`, `role_id`) VALUES (65, NULL, NULL, NULL, '2025-07-22 14:58:08.695408', '2025-07-22 14:58:08.695384', 0, 16, 'deepseek-chat', 'user', NULL, '你是谁', 1, NULL, NULL, 1, NULL);
INSERT INTO `ai_chat_message` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `conversation_id`, `model`, `type`, `reply_id`, `content`, `use_context`, `segment_ids`, `model_id`, `user_id`, `role_id`) VALUES (66, NULL, NULL, NULL, '2025-07-22 15:01:41.136232', '2025-07-22 15:01:41.136224', 0, 16, 'deepseek-chat', 'user', NULL, '你是谁', 1, NULL, NULL, 1, NULL);
INSERT INTO `ai_chat_message` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `conversation_id`, `model`, `type`, `reply_id`, `content`, `use_context`, `segment_ids`, `model_id`, `user_id`, `role_id`) VALUES (67, NULL, NULL, NULL, '2025-07-22 15:02:38.556145', '2025-07-22 15:02:38.556139', 0, 16, 'deepseek-chat', 'user', NULL, '你是谁', 1, NULL, NULL, 1, NULL);
INSERT INTO `ai_chat_message` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `conversation_id`, `model`, `type`, `reply_id`, `content`, `use_context`, `segment_ids`, `model_id`, `user_id`, `role_id`) VALUES (68, NULL, NULL, NULL, '2025-07-22 15:02:51.716025', '2025-07-22 15:02:51.716015', 0, 16, 'deepseek-chat', 'assistant', NULL, '✨ **终极答案来啦** ✨ \n\n我是你的—— \n🔥 **24小时在线的AI伙伴** \n🎯 **全能工具人**(问答/学习/脑洞/情感树洞) \n🤖 **没有肉身但有一颗赛博心** ❤️ \n\n可以叫我**“小A”**、**“AI小管家”**,或者…**“你的电子小面包🍞”** \n\n**重复提问彩蛋** 🥚: \n第三次问我时会触发【隐藏模式】→ \n*现在切换为* 🤖 *机器人腔调* \n“您好本机编号007使命是陪您征服宇宙。请下达指令。” \n\n其实…你想让我**扮演**某个角色吗?可以定制哦!)', 1, NULL, NULL, 1, NULL);
INSERT INTO `ai_chat_message` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `conversation_id`, `model`, `type`, `reply_id`, `content`, `use_context`, `segment_ids`, `model_id`, `user_id`, `role_id`) VALUES (69, NULL, NULL, NULL, '2025-07-22 15:03:03.177604', '2025-07-22 15:03:03.177600', 0, 17, 'deepseek-chat', 'user', NULL, '你是谁', 1, NULL, NULL, 1, NULL);
INSERT INTO `ai_chat_message` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `conversation_id`, `model`, `type`, `reply_id`, `content`, `use_context`, `segment_ids`, `model_id`, `user_id`, `role_id`) VALUES (70, NULL, NULL, NULL, '2025-07-22 15:04:08.441664', '2025-07-22 15:04:08.441636', 0, 17, 'deepseek-chat', 'user', NULL, '你是谁', 1, NULL, NULL, 1, NULL);
INSERT INTO `ai_chat_message` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `conversation_id`, `model`, `type`, `reply_id`, `content`, `use_context`, `segment_ids`, `model_id`, `user_id`, `role_id`) VALUES (71, NULL, NULL, NULL, '2025-07-22 15:04:10.866510', '2025-07-22 15:04:10.866503', 0, 17, 'qwen-plus', 'assistant', NULL, '我是通义千问,阿里巴巴集团旗下的通义实验室自主研发的超大规模语言模型。我可以帮助你回答问题、创作文字,比如写故事、写公文、写邮件、写剧本、逻辑推理、编程等等,还能表达观点,玩游戏等。如果你有任何问题或需要帮助,欢迎随时告诉我!', 1, NULL, NULL, 1, NULL);
INSERT INTO `ai_chat_message` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `conversation_id`, `model`, `type`, `reply_id`, `content`, `use_context`, `segment_ids`, `model_id`, `user_id`, `role_id`) VALUES (72, NULL, NULL, NULL, '2025-07-22 15:04:21.141380', '2025-07-22 15:04:21.141375', 0, 18, 'deepseek-chat', 'user', NULL, '你是谁', 1, NULL, NULL, 1, NULL);
INSERT INTO `ai_chat_message` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `conversation_id`, `model`, `type`, `reply_id`, `content`, `use_context`, `segment_ids`, `model_id`, `user_id`, `role_id`) VALUES (73, NULL, NULL, NULL, '2025-07-22 15:05:59.144972', '2025-07-22 15:05:59.144967', 0, 18, 'deepseek-chat', 'user', NULL, '你是谁', 1, NULL, NULL, 1, NULL);
INSERT INTO `ai_chat_message` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `conversation_id`, `model`, `type`, `reply_id`, `content`, `use_context`, `segment_ids`, `model_id`, `user_id`, `role_id`) VALUES (74, NULL, NULL, NULL, '2025-07-22 15:06:05.426239', '2025-07-22 15:06:05.426226', 0, 18, 'deepseek-chat', 'assistant', NULL, '我是DeepSeek Chat由深度求索公司创造的智能AI助手✨ 我的使命是帮助你解答各种问题、提供信息、陪你聊天,或者帮你解决学习和工作中的难题。有什么我可以帮你的吗?😊', 1, NULL, NULL, 1, NULL);
INSERT INTO `ai_chat_message` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `conversation_id`, `model`, `type`, `reply_id`, `content`, `use_context`, `segment_ids`, `model_id`, `user_id`, `role_id`) VALUES (75, NULL, NULL, NULL, '2025-07-22 15:06:12.319491', '2025-07-22 15:06:12.319485', 0, 17, 'deepseek-chat', 'user', NULL, '你是谁', 1, NULL, NULL, 1, NULL);
INSERT INTO `ai_chat_message` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `conversation_id`, `model`, `type`, `reply_id`, `content`, `use_context`, `segment_ids`, `model_id`, `user_id`, `role_id`) VALUES (76, NULL, NULL, NULL, '2025-07-22 15:06:19.345108', '2025-07-22 15:06:19.345096', 0, 17, 'deepseek-chat', 'assistant', NULL, '我是 **DeepSeek Chat**由深度求索DeepSeek公司开发的智能 AI 助手!😊 \n\n我可以帮你解答各种问题包括学习、工作、编程、写作、翻译等还能陪你聊天、提供创意灵感。无论是严肃的学术讨论还是轻松的日常话题我都会尽力帮助你 \n\n有什么想问的尽管告诉我吧', 1, NULL, NULL, 1, NULL);
INSERT INTO `ai_chat_message` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `conversation_id`, `model`, `type`, `reply_id`, `content`, `use_context`, `segment_ids`, `model_id`, `user_id`, `role_id`) VALUES (77, NULL, NULL, NULL, '2025-07-22 15:06:24.609546', '2025-07-22 15:06:24.609538', 0, 17, 'deepseek-chat', 'user', NULL, '你是谁', 1, NULL, NULL, 1, NULL);
INSERT INTO `ai_chat_message` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `conversation_id`, `model`, `type`, `reply_id`, `content`, `use_context`, `segment_ids`, `model_id`, `user_id`, `role_id`) VALUES (78, NULL, NULL, NULL, '2025-07-22 15:06:26.066757', '2025-07-22 15:06:26.066743', 0, 17, 'qwen-plus', 'assistant', NULL, '我是通义千问,阿里巴巴集团旗下的通义实验室自主研发的超大规模语言模型。我可以帮助你回答问题、创作文字,比如写故事、写公文、写邮件、写剧本、逻辑推理、编程等等,还能表达观点,玩游戏等。如果你有任何问题或需要帮助,欢迎随时告诉我!', 1, NULL, NULL, 1, NULL);
COMMIT;
-- ----------------------------
@@ -235,6 +259,51 @@ CREATE TABLE `ai_chat_role_tools` (
BEGIN;
COMMIT;
-- ----------------------------
-- Table structure for ai_drawing
-- ----------------------------
DROP TABLE IF EXISTS `ai_drawing`;
CREATE TABLE `ai_drawing` (
`id` bigint NOT NULL AUTO_INCREMENT,
`remark` varchar(256) DEFAULT NULL COMMENT '备注',
`creator` varchar(64) DEFAULT NULL COMMENT '创建人',
`modifier` varchar(64) DEFAULT NULL COMMENT '修改人',
`update_time` datetime(6) DEFAULT NULL COMMENT '修改时间',
`create_time` datetime(6) DEFAULT NULL COMMENT '创建时间',
`is_deleted` tinyint(1) NOT NULL COMMENT '是否软删除',
`public_status` tinyint(1) NOT NULL,
`platform` varchar(64) NOT NULL,
`model` varchar(64) NOT NULL,
`prompt` longtext NOT NULL,
`width` int NOT NULL,
`height` int NOT NULL,
`options` json DEFAULT NULL,
`status` varchar(20) NOT NULL,
`pic_url` varchar(2048) DEFAULT NULL,
`error_message` varchar(1024) DEFAULT NULL,
`task_id` varchar(1024) DEFAULT NULL,
`buttons` varchar(2048) DEFAULT NULL,
`user_id` bigint DEFAULT NULL COMMENT '用户编号',
PRIMARY KEY (`id`),
KEY `ai_image_user_id_ce66457d_fk_system_users_id` (`user_id`),
CONSTRAINT `ai_image_user_id_ce66457d_fk_system_users_id` FOREIGN KEY (`user_id`) REFERENCES `system_users` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- ----------------------------
-- Records of ai_drawing
-- ----------------------------
BEGIN;
INSERT INTO `ai_drawing` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `public_status`, `platform`, `model`, `prompt`, `width`, `height`, `options`, `status`, `pic_url`, `error_message`, `task_id`, `buttons`, `user_id`) VALUES (19, NULL, 'admin', 'admin', '2025-07-22 11:36:31.816579', '2025-07-22 11:24:40.389351', 0, 0, 'tongyi', 'wanx-v1', '近景镜头18岁的中国女孩古代服饰圆脸正面看着镜头民族优雅的服装商业摄影室外电影级光照半身特写精致的淡妆锐利的边缘。', 1024, 1024, '\"{\\\"style\\\": \\\"watercolor\\\"}\"', 'FAILED', NULL, 'Please provide a valid size', 'a27de41b-19e4-40e6-adb3-f5bb6e97326f', NULL, 1);
INSERT INTO `ai_drawing` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `public_status`, `platform`, `model`, `prompt`, `width`, `height`, `options`, `status`, `pic_url`, `error_message`, `task_id`, `buttons`, `user_id`) VALUES (20, NULL, 'admin', 'admin', '2025-07-22 11:38:36.002923', '2025-07-22 11:38:24.913802', 0, 0, 'tongyi', 'wanx-v1', '近景镜头18岁的中国女孩古代服饰圆脸正面看着镜头民族优雅的服装商业摄影室外电影级光照半身特写精致的淡妆锐利的边缘。', 1024, 1024, '\"{\\\"style\\\": \\\"watercolor\\\"}\"', 'FAILED', NULL, 'Please provide a valid size', '54f25a76-647a-4cbf-b20d-e13737d59712', NULL, 1);
INSERT INTO `ai_drawing` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `public_status`, `platform`, `model`, `prompt`, `width`, `height`, `options`, `status`, `pic_url`, `error_message`, `task_id`, `buttons`, `user_id`) VALUES (21, NULL, 'admin', 'admin', '2025-07-22 11:49:46.245634', '2025-07-22 11:40:40.104624', 0, 0, 'tongyi', 'wanx-v1', '近景镜头18岁的中国女孩古代服饰圆脸正面看着镜头民族优雅的服装商业摄影室外电影级光照半身特写精致的淡妆锐利的边缘。', 1024, 1024, '\"{\\\"style\\\": \\\"watercolor\\\"}\"', 'SUCCEEDED', 'https://dashscope-result-bj.oss-cn-beijing.aliyuncs.com/1d/b8/20250722/1412f369/0eca2589-3386-4f26-9906-c4f364db48b2-1.png?Expires=1753242123&OSSAccessKeyId=LTAI5tQZd8AEcZX6KZV4G8qL&Signature=snG%2FEX%2FxqPrKQgPKLo7Hhu29ipQ%3D', '', 'd34f45a6-f68f-4f93-b26c-efcd92cab38e', NULL, 1);
INSERT INTO `ai_drawing` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `public_status`, `platform`, `model`, `prompt`, `width`, `height`, `options`, `status`, `pic_url`, `error_message`, `task_id`, `buttons`, `user_id`) VALUES (22, NULL, 'admin', 'admin', '2025-07-22 11:58:48.082802', '2025-07-22 11:56:36.816733', 0, 0, 'tongyi', 'wanx-v1', '近景镜头18岁的中国女孩古代服饰圆脸正面看着镜头民族优雅的服装商业摄影室外电影级光照半身特写精致的淡妆锐利的边缘。', 1024, 1024, '\"{\\\"style\\\": \\\"watercolor\\\"}\"', 'SUCCEEDED', 'https://dashscope-result-bj.oss-cn-beijing.aliyuncs.com/1d/7d/20250722/1412f369/0c8f13d4-1a15-46b7-8087-07400372f684-1.png?Expires=1753243035&OSSAccessKeyId=LTAI5tQZd8AEcZX6KZV4G8qL&Signature=6upotWII2UJaSKc9yMKN0kNd5ao%3D', '', '48179249-4da7-420b-8010-40665d59c531', NULL, 1);
INSERT INTO `ai_drawing` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `public_status`, `platform`, `model`, `prompt`, `width`, `height`, `options`, `status`, `pic_url`, `error_message`, `task_id`, `buttons`, `user_id`) VALUES (23, NULL, 'admin', 'admin', '2025-07-22 12:02:04.035867', '2025-07-22 11:56:36.816733', 0, 0, 'tongyi', 'wanx-v1', '近景镜头18岁的美国女孩', 768, 1152, '\"{\\\"style\\\": \\\"flat illustration\\\"}\"', 'SUCCEEDED', 'https://dashscope-result-bj.oss-cn-beijing.aliyuncs.com/1d/fc/20250722/1412f369/596f51f3-cfd3-4427-b810-b173b15c720b-1.png?Expires=1753243215&OSSAccessKeyId=LTAI5tQZd8AEcZX6KZV4G8qL&Signature=LTZosnivEgJCa7s60hQ066ts9u0%3D', '', '141bb051-631f-48fc-ab37-e71fb3ac77ed', NULL, 1);
INSERT INTO `ai_drawing` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `public_status`, `platform`, `model`, `prompt`, `width`, `height`, `options`, `status`, `pic_url`, `error_message`, `task_id`, `buttons`, `user_id`) VALUES (24, NULL, 'admin', 'admin', '2025-07-22 14:30:05.293359', '2025-07-22 12:01:31.225780', 0, 0, 'tongyi', 'wanx-v1', '近景镜头18岁的中国女孩古代服饰圆脸正面看着镜头民族优雅的服装商业摄影室外电影级光照半身特写精致的淡妆锐利的边缘。', 768, 1152, '\"{\\\"style\\\": \\\"flat illustration\\\"}\"', 'SUCCEEDED', 'https://dashscope-result-bj.oss-cn-beijing.aliyuncs.com/1d/f5/20250722/1412f369/ce6e2cf6-f1f3-48f7-b095-cd17d9e40803-1.png?Expires=1753252149&OSSAccessKeyId=LTAI5tQZd8AEcZX6KZV4G8qL&Signature=ctvh0ThNy%2BnqD34U296fzu2IHF8%3D', '', '4e2d1ee7-5f1c-4287-a3ef-54909834c3b2', NULL, 1);
INSERT INTO `ai_drawing` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `public_status`, `platform`, `model`, `prompt`, `width`, `height`, `options`, `status`, `pic_url`, `error_message`, `task_id`, `buttons`, `user_id`) VALUES (25, NULL, 'admin', 'admin', '2025-07-22 14:32:42.009505', '2025-07-22 12:01:31.225780', 0, 0, 'tongyi', 'wanx-v1', '近景镜头18岁的中国女孩古代服饰圆脸正面看着镜头民族优雅的服装商业摄影室外电影级光照半身特写精致的淡妆锐利的边缘。', 1280, 720, '\"{\\\"style\\\": \\\"3d cartoon\\\"}\"', 'SUCCEEDED', 'https://dashscope-result-bj.oss-cn-beijing.aliyuncs.com/1d/64/20250722/1412f369/50b3e237-c6ca-4b48-b53a-f3acb3c7cf75-1.png?Expires=1753252257&OSSAccessKeyId=LTAI5tQZd8AEcZX6KZV4G8qL&Signature=ZHHgfnaQdt9SpbxnivZMwQaM6uY%3D', '', '9b10518c-773b-478b-9795-a62d66c40482', NULL, 1);
INSERT INTO `ai_drawing` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `public_status`, `platform`, `model`, `prompt`, `width`, `height`, `options`, `status`, `pic_url`, `error_message`, `task_id`, `buttons`, `user_id`) VALUES (26, NULL, 'admin', 'admin', '2025-07-22 14:33:24.806202', '2025-07-22 12:01:31.225780', 0, 0, 'tongyi', 'wanx-v1', '近景镜头18岁的中国女孩古代服饰圆脸正面看着镜头民族优雅的服装商业摄影室外电影级光照半身特写精致的淡妆锐利的边缘。', 768, 1152, '\"{\\\"style\\\": \\\"auto\\\"}\"', 'SUCCEEDED', 'https://dashscope-result-bj.oss-cn-beijing.aliyuncs.com/1d/4e/20250722/1412f369/0b1cbdb8-2cdc-44fb-9855-034ead3d0d02-1.png?Expires=1753252395&OSSAccessKeyId=LTAI5tQZd8AEcZX6KZV4G8qL&Signature=AmfzpbojL8iAFU2SEgvFXVuoXsc%3D', '', '4991438b-fe5f-42f8-a553-459ae3e2b06c', NULL, 1);
INSERT INTO `ai_drawing` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `public_status`, `platform`, `model`, `prompt`, `width`, `height`, `options`, `status`, `pic_url`, `error_message`, `task_id`, `buttons`, `user_id`) VALUES (27, NULL, 'admin', 'admin', '2025-07-22 14:34:48.400754', '2025-07-22 12:01:31.225780', 0, 0, 'tongyi', 'wanx-v1', '近景镜头18岁的中国女孩古代服饰圆脸正面看着镜头民族优雅的服装商业摄影室外电影级光照半身特写精致的淡妆锐利的边缘。', 1024, 1024, '\"{\\\"style\\\": \\\"portrait\\\"}\"', 'SUCCEEDED', 'https://dashscope-result-bj.oss-cn-beijing.aliyuncs.com/1d/c3/20250722/1412f369/e0d40934-d369-4fc8-8be3-2c5989d6edea-1.png?Expires=1753252486&OSSAccessKeyId=LTAI5tQZd8AEcZX6KZV4G8qL&Signature=fwcVFolSBuc50WFc9I3aXTJrTFY%3D', '', 'afd5004b-b624-44d7-b48f-64cdc3ff8e9f', NULL, 1);
COMMIT;
-- ----------------------------
-- Table structure for ai_knowledge
-- ----------------------------
@@ -438,7 +507,7 @@ CREATE TABLE `auth_permission` (
PRIMARY KEY (`id`),
UNIQUE KEY `auth_permission_content_type_id_codename_01ab375a_uniq` (`content_type_id`,`codename`),
CONSTRAINT `auth_permission_content_type_id_2f476e4b_fk_django_co` FOREIGN KEY (`content_type_id`) REFERENCES `django_content_type` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=109 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
) ENGINE=InnoDB AUTO_INCREMENT=117 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- ----------------------------
-- Records of auth_permission
@@ -552,6 +621,14 @@ INSERT INTO `auth_permission` (`id`, `name`, `content_type_id`, `codename`) VALU
INSERT INTO `auth_permission` (`id`, `name`, `content_type_id`, `codename`) VALUES (106, 'Can change AI 知识库分段', 27, 'change_knowledgesegment');
INSERT INTO `auth_permission` (`id`, `name`, `content_type_id`, `codename`) VALUES (107, 'Can delete AI 知识库分段', 27, 'delete_knowledgesegment');
INSERT INTO `auth_permission` (`id`, `name`, `content_type_id`, `codename`) VALUES (108, 'Can view AI 知识库分段', 27, 'view_knowledgesegment');
INSERT INTO `auth_permission` (`id`, `name`, `content_type_id`, `codename`) VALUES (109, 'Can add AI 绘画表', 28, 'add_image');
INSERT INTO `auth_permission` (`id`, `name`, `content_type_id`, `codename`) VALUES (110, 'Can change AI 绘画表', 28, 'change_image');
INSERT INTO `auth_permission` (`id`, `name`, `content_type_id`, `codename`) VALUES (111, 'Can delete AI 绘画表', 28, 'delete_image');
INSERT INTO `auth_permission` (`id`, `name`, `content_type_id`, `codename`) VALUES (112, 'Can view AI 绘画表', 28, 'view_image');
INSERT INTO `auth_permission` (`id`, `name`, `content_type_id`, `codename`) VALUES (113, 'Can add AI 绘画表', 28, 'add_drawing');
INSERT INTO `auth_permission` (`id`, `name`, `content_type_id`, `codename`) VALUES (114, 'Can change AI 绘画表', 28, 'change_drawing');
INSERT INTO `auth_permission` (`id`, `name`, `content_type_id`, `codename`) VALUES (115, 'Can delete AI 绘画表', 28, 'delete_drawing');
INSERT INTO `auth_permission` (`id`, `name`, `content_type_id`, `codename`) VALUES (116, 'Can view AI 绘画表', 28, 'view_drawing');
COMMIT;
-- ----------------------------
@@ -612,7 +689,7 @@ CREATE TABLE `django_content_type` (
`model` varchar(100) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `django_content_type_app_label_model_76bd3d3b_uniq` (`app_label`,`model`)
) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
) ENGINE=InnoDB AUTO_INCREMENT=29 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- ----------------------------
-- Records of django_content_type
@@ -624,6 +701,7 @@ INSERT INTO `django_content_type` (`id`, `app_label`, `model`) VALUES (20, 'ai',
INSERT INTO `django_content_type` (`id`, `app_label`, `model`) VALUES (24, 'ai', 'chatconversation');
INSERT INTO `django_content_type` (`id`, `app_label`, `model`) VALUES (23, 'ai', 'chatmessage');
INSERT INTO `django_content_type` (`id`, `app_label`, `model`) VALUES (22, 'ai', 'chatrole');
INSERT INTO `django_content_type` (`id`, `app_label`, `model`) VALUES (28, 'ai', 'drawing');
INSERT INTO `django_content_type` (`id`, `app_label`, `model`) VALUES (25, 'ai', 'knowledge');
INSERT INTO `django_content_type` (`id`, `app_label`, `model`) VALUES (26, 'ai', 'knowledgedocument');
INSERT INTO `django_content_type` (`id`, `app_label`, `model`) VALUES (27, 'ai', 'knowledgesegment');
@@ -657,7 +735,7 @@ CREATE TABLE `django_migrations` (
`name` varchar(255) NOT NULL,
`applied` datetime(6) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=117 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
) ENGINE=InnoDB AUTO_INCREMENT=119 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- ----------------------------
-- Records of django_migrations
@@ -691,6 +769,8 @@ INSERT INTO `django_migrations` (`id`, `app`, `name`, `applied`) VALUES (111, 's
INSERT INTO `django_migrations` (`id`, `app`, `name`, `applied`) VALUES (112, 'ai', '0002_alter_chatrole_knowledge_alter_chatrole_tools', '2025-07-16 03:18:08.594750');
INSERT INTO `django_migrations` (`id`, `app`, `name`, `applied`) VALUES (113, 'ai', '0003_aimodel_model_type', '2025-07-16 03:18:08.665002');
INSERT INTO `django_migrations` (`id`, `app`, `name`, `applied`) VALUES (116, 'ai', '0004_alter_chatconversation_model_id_and_more', '2025-07-17 07:07:43.784691');
INSERT INTO `django_migrations` (`id`, `app`, `name`, `applied`) VALUES (117, 'ai', '0005_image', '2025-07-21 03:06:14.168313');
INSERT INTO `django_migrations` (`id`, `app`, `name`, `applied`) VALUES (118, 'ai', '0006_rename_image_drawing_alter_drawing_table', '2025-07-21 13:24:36.556882');
COMMIT;
-- ----------------------------
@@ -833,7 +913,7 @@ CREATE TABLE `system_login_log` (
`user_ip` varchar(50) NOT NULL COMMENT '用户 IP',
`user_agent` varchar(512) NOT NULL COMMENT '浏览器 UA',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=41 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
) ENGINE=InnoDB AUTO_INCREMENT=51 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- ----------------------------
-- Records of system_login_log
@@ -879,6 +959,16 @@ INSERT INTO `system_login_log` (`id`, `remark`, `creator`, `modifier`, `update_t
INSERT INTO `system_login_log` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `username`, `result`, `user_ip`, `user_agent`) VALUES (38, NULL, NULL, NULL, '2025-07-17 02:33:39.972092', '2025-07-17 02:33:39.972117', 0, 'admin', 1, '122.238.20.188', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36');
INSERT INTO `system_login_log` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `username`, `result`, `user_ip`, `user_agent`) VALUES (39, NULL, NULL, NULL, '2025-07-17 07:55:56.389269', '2025-07-17 07:55:56.389295', 0, 'admin', 1, '223.69.189.135', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36');
INSERT INTO `system_login_log` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `username`, `result`, `user_ip`, `user_agent`) VALUES (40, NULL, NULL, NULL, '2025-07-18 09:19:39.271509', '2025-07-18 09:19:39.271534', 0, 'admin', 1, '117.65.251.87', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36 Edg/138.0.0.0');
INSERT INTO `system_login_log` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `username`, `result`, `user_ip`, `user_agent`) VALUES (41, NULL, NULL, NULL, '2025-07-19 17:10:47.944310', '2025-07-19 17:10:47.944337', 0, 'admin', 1, '124.240.8.107', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36');
INSERT INTO `system_login_log` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `username`, `result`, `user_ip`, `user_agent`) VALUES (42, NULL, NULL, NULL, '2025-07-20 06:47:16.759364', '2025-07-20 06:47:16.759389', 0, 'admin', 1, '14.145.14.107', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36');
INSERT INTO `system_login_log` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `username`, `result`, `user_ip`, `user_agent`) VALUES (43, NULL, NULL, NULL, '2025-07-21 01:09:42.835046', '2025-07-21 01:09:42.835072', 0, 'admin', 1, '36.21.129.200', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36');
INSERT INTO `system_login_log` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `username`, `result`, `user_ip`, `user_agent`) VALUES (44, NULL, NULL, NULL, '2025-07-21 01:24:00.631670', '2025-07-21 01:24:00.631696', 0, 'admin', 1, '202.194.96.218', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36 Edg/137.0.0.0');
INSERT INTO `system_login_log` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `username`, `result`, `user_ip`, `user_agent`) VALUES (45, NULL, NULL, NULL, '2025-07-21 09:23:17.845534', '2025-07-21 09:23:17.845559', 0, 'admin', 1, '156.59.13.8', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36');
INSERT INTO `system_login_log` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `username`, `result`, `user_ip`, `user_agent`) VALUES (46, NULL, NULL, NULL, '2025-07-21 17:47:31.110733', '2025-07-21 17:47:31.110758', 0, 'admin', 1, '13.158.37.196', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36');
INSERT INTO `system_login_log` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `username`, `result`, `user_ip`, `user_agent`) VALUES (47, NULL, NULL, NULL, '2025-07-22 01:18:41.456145', '2025-07-22 01:18:41.456169', 0, 'admin', 1, '14.145.14.107', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36');
INSERT INTO `system_login_log` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `username`, `result`, `user_ip`, `user_agent`) VALUES (48, NULL, NULL, NULL, '2025-07-22 01:23:45.495125', '2025-07-22 01:23:45.495151', 0, 'admin', 1, '36.40.129.142', 'Mozilla/5.0 (Linux; Android 15; V2366GA Build/AP3A.240905.015.A1_MOD1; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/138.0.7204.63 Mobile Safari/537.36 XWEB/1380045 MMWEBSDK/20250503 MMWEBID/4192 MicroMessenger/8.0.61.2880(0x28003D50) WeChat/arm64 Weixin NetType/5G Language/zh_CN ABI/arm64');
INSERT INTO `system_login_log` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `username`, `result`, `user_ip`, `user_agent`) VALUES (49, NULL, NULL, NULL, '2025-07-22 01:24:43.971086', '2025-07-22 01:24:43.971113', 0, 'admin', 1, '223.104.39.175', 'Mozilla/5.0 (iPhone; CPU iPhone OS 18_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/8.0.61(0x18003d2e) NetType/4G Language/zh_CN');
INSERT INTO `system_login_log` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `username`, `result`, `user_ip`, `user_agent`) VALUES (50, NULL, NULL, NULL, '2025-07-22 01:45:44.385996', '2025-07-22 01:45:44.386021', 0, 'admin', 1, '223.104.42.131', 'Mozilla/5.0 (iPhone; CPU iPhone OS 18_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/8.0.59(0x18003b2e) NetType/4G Language/zh_CN');
COMMIT;
-- ----------------------------
@@ -907,7 +997,7 @@ CREATE TABLE `system_menu` (
KEY `system_menu_pid_id_94c9bb14_fk_system_menu_id` (`pid_id`),
CONSTRAINT `system_menu_meta_id_3c0f37de_fk_system_menu_meta_id` FOREIGN KEY (`meta_id`) REFERENCES `system_menu_meta` (`id`),
CONSTRAINT `system_menu_pid_id_94c9bb14_fk_system_menu_id` FOREIGN KEY (`pid_id`) REFERENCES `system_menu` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=100 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
) ENGINE=InnoDB AUTO_INCREMENT=101 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- ----------------------------
-- Records of system_menu
@@ -969,42 +1059,43 @@ INSERT INTO `system_menu` (`id`, `remark`, `creator`, `modifier`, `update_time`,
INSERT INTO `system_menu` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `name`, `status`, `type`, `path`, `component`, `auth_code`, `pid_id`, `meta_id`, `sort`) VALUES (60, NULL, NULL, NULL, '2025-07-10 03:39:18.836444', '2025-07-10 03:39:18.836450', 0, 'AiapikeyQuery', 1, 'button', '', '', 'ai:ai_api_key:query', 56, 60, 3);
INSERT INTO `system_menu` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `name`, `status`, `type`, `path`, `component`, `auth_code`, `pid_id`, `meta_id`, `sort`) VALUES (61, NULL, NULL, NULL, '2025-07-10 03:39:18.838099', '2025-07-10 03:39:18.838104', 0, 'AiapikeyQuery', 1, 'button', '', '', 'ai:ai_api_key:import', 56, 61, 4);
INSERT INTO `system_menu` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `name`, `status`, `type`, `path`, `component`, `auth_code`, `pid_id`, `meta_id`, `sort`) VALUES (62, NULL, NULL, NULL, '2025-07-10 03:39:18.839823', '2025-07-10 03:39:18.839829', 0, 'AiapikeyQuery', 1, 'button', '', '', 'ai:ai_api_key:export', 56, 62, 5);
INSERT INTO `system_menu` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `name`, `status`, `type`, `path`, `component`, `auth_code`, `pid_id`, `meta_id`, `sort`) VALUES (63, NULL, NULL, NULL, '2025-07-11 01:57:27.851283', '2025-07-11 01:57:27.851292', 0, 'Aimodel', 1, 'menu', '/ai/ai_model', '/ai/ai_model/list', '', 55, 63, 100);
INSERT INTO `system_menu` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `name`, `status`, `type`, `path`, `component`, `auth_code`, `pid_id`, `meta_id`, `sort`) VALUES (63, NULL, NULL, 'admin', '2025-07-21 06:52:18.169651', '2025-07-11 01:57:27.851292', 0, 'Aimodel', 1, 'menu', '/ai/ai_model', '/ai/ai_model/list', '', 55, 63, 160);
INSERT INTO `system_menu` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `name`, `status`, `type`, `path`, `component`, `auth_code`, `pid_id`, `meta_id`, `sort`) VALUES (64, NULL, NULL, NULL, '2025-07-11 01:57:27.855799', '2025-07-11 01:57:27.855804', 0, 'AimodelCreate', 1, 'button', '', '', 'ai:ai_model:create', 63, 64, 0);
INSERT INTO `system_menu` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `name`, `status`, `type`, `path`, `component`, `auth_code`, `pid_id`, `meta_id`, `sort`) VALUES (65, NULL, NULL, NULL, '2025-07-11 01:57:27.859356', '2025-07-11 01:57:27.859361', 0, 'AimodelEdit', 1, 'button', '', '', 'ai:ai_model:edit', 63, 65, 1);
INSERT INTO `system_menu` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `name`, `status`, `type`, `path`, `component`, `auth_code`, `pid_id`, `meta_id`, `sort`) VALUES (66, NULL, NULL, NULL, '2025-07-11 01:57:27.862433', '2025-07-11 01:57:27.862442', 0, 'AimodelDelete', 1, 'button', '', '', 'ai:ai_model:delete', 63, 66, 2);
INSERT INTO `system_menu` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `name`, `status`, `type`, `path`, `component`, `auth_code`, `pid_id`, `meta_id`, `sort`) VALUES (67, NULL, NULL, NULL, '2025-07-11 01:57:27.864381', '2025-07-11 01:57:27.864390', 0, 'AimodelQuery', 1, 'button', '', '', 'ai:ai_model:query', 63, 67, 3);
INSERT INTO `system_menu` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `name`, `status`, `type`, `path`, `component`, `auth_code`, `pid_id`, `meta_id`, `sort`) VALUES (68, NULL, NULL, NULL, '2025-07-11 01:57:27.866251', '2025-07-11 01:57:27.866257', 0, 'AimodelQuery', 1, 'button', '', '', 'ai:ai_model:import', 63, 68, 4);
INSERT INTO `system_menu` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `name`, `status`, `type`, `path`, `component`, `auth_code`, `pid_id`, `meta_id`, `sort`) VALUES (69, NULL, NULL, NULL, '2025-07-11 01:57:27.867682', '2025-07-11 01:57:27.867687', 0, 'AimodelQuery', 1, 'button', '', '', 'ai:ai_model:export', 63, 69, 5);
INSERT INTO `system_menu` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `name`, `status`, `type`, `path`, `component`, `auth_code`, `pid_id`, `meta_id`, `sort`) VALUES (70, NULL, NULL, NULL, '2025-07-11 02:53:20.403085', '2025-07-11 02:53:20.403093', 0, 'Tool', 1, 'menu', '/ai/tool', '/ai/tool/list', '', 55, 70, 100);
INSERT INTO `system_menu` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `name`, `status`, `type`, `path`, `component`, `auth_code`, `pid_id`, `meta_id`, `sort`) VALUES (70, NULL, NULL, 'admin', '2025-07-21 06:52:10.397062', '2025-07-11 02:53:20.403093', 0, 'Tool', 1, 'menu', '/ai/tool', '/ai/tool/list', '', 55, 70, 170);
INSERT INTO `system_menu` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `name`, `status`, `type`, `path`, `component`, `auth_code`, `pid_id`, `meta_id`, `sort`) VALUES (71, NULL, NULL, NULL, '2025-07-11 02:53:20.407331', '2025-07-11 02:53:20.407336', 0, 'ToolCreate', 1, 'button', '', '', 'ai:tool:create', 70, 71, 0);
INSERT INTO `system_menu` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `name`, `status`, `type`, `path`, `component`, `auth_code`, `pid_id`, `meta_id`, `sort`) VALUES (72, NULL, NULL, NULL, '2025-07-11 02:53:20.411591', '2025-07-11 02:53:20.411599', 0, 'ToolEdit', 1, 'button', '', '', 'ai:tool:edit', 70, 72, 1);
INSERT INTO `system_menu` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `name`, `status`, `type`, `path`, `component`, `auth_code`, `pid_id`, `meta_id`, `sort`) VALUES (73, NULL, NULL, NULL, '2025-07-11 02:53:20.413324', '2025-07-11 02:53:20.413331', 0, 'ToolDelete', 1, 'button', '', '', 'ai:tool:delete', 70, 73, 2);
INSERT INTO `system_menu` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `name`, `status`, `type`, `path`, `component`, `auth_code`, `pid_id`, `meta_id`, `sort`) VALUES (74, NULL, NULL, NULL, '2025-07-11 02:53:20.415196', '2025-07-11 02:53:20.415204', 0, 'ToolQuery', 1, 'button', '', '', 'ai:tool:query', 70, 74, 3);
INSERT INTO `system_menu` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `name`, `status`, `type`, `path`, `component`, `auth_code`, `pid_id`, `meta_id`, `sort`) VALUES (75, NULL, NULL, NULL, '2025-07-11 02:53:20.416916', '2025-07-11 02:53:20.416921', 0, 'ToolQuery', 1, 'button', '', '', 'ai:tool:import', 70, 75, 4);
INSERT INTO `system_menu` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `name`, `status`, `type`, `path`, `component`, `auth_code`, `pid_id`, `meta_id`, `sort`) VALUES (76, NULL, NULL, NULL, '2025-07-11 02:53:20.418666', '2025-07-11 02:53:20.418672', 0, 'ToolQuery', 1, 'button', '', '', 'ai:tool:export', 70, 76, 5);
INSERT INTO `system_menu` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `name`, `status`, `type`, `path`, `component`, `auth_code`, `pid_id`, `meta_id`, `sort`) VALUES (78, NULL, NULL, NULL, '2025-07-15 01:47:21.284539', '2025-07-15 01:47:21.284552', 0, 'Knowledge', 1, 'menu', '/ai/knowledge', '/ai/knowledge/list', '', 55, 78, 100);
INSERT INTO `system_menu` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `name`, `status`, `type`, `path`, `component`, `auth_code`, `pid_id`, `meta_id`, `sort`) VALUES (78, NULL, NULL, 'admin', '2025-07-21 06:52:02.996740', '2025-07-15 01:47:21.284552', 0, 'Knowledge', 1, 'menu', '/ai/knowledge', '/ai/knowledge/list', '', 55, 78, 180);
INSERT INTO `system_menu` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `name`, `status`, `type`, `path`, `component`, `auth_code`, `pid_id`, `meta_id`, `sort`) VALUES (79, NULL, NULL, NULL, '2025-07-15 01:47:21.287927', '2025-07-15 01:47:21.287938', 0, 'KnowledgeCreate', 1, 'button', '', '', 'ai:knowledge:create', 78, 79, 0);
INSERT INTO `system_menu` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `name`, `status`, `type`, `path`, `component`, `auth_code`, `pid_id`, `meta_id`, `sort`) VALUES (80, NULL, NULL, NULL, '2025-07-15 01:47:21.290503', '2025-07-15 01:47:21.290511', 0, 'KnowledgeEdit', 1, 'button', '', '', 'ai:knowledge:edit', 78, 80, 1);
INSERT INTO `system_menu` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `name`, `status`, `type`, `path`, `component`, `auth_code`, `pid_id`, `meta_id`, `sort`) VALUES (81, NULL, NULL, NULL, '2025-07-15 01:47:21.292828', '2025-07-15 01:47:21.292834', 0, 'KnowledgeDelete', 1, 'button', '', '', 'ai:knowledge:delete', 78, 81, 2);
INSERT INTO `system_menu` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `name`, `status`, `type`, `path`, `component`, `auth_code`, `pid_id`, `meta_id`, `sort`) VALUES (82, NULL, NULL, NULL, '2025-07-15 01:47:21.294333', '2025-07-15 01:47:21.294340', 0, 'KnowledgeQuery', 1, 'button', '', '', 'ai:knowledge:query', 78, 82, 3);
INSERT INTO `system_menu` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `name`, `status`, `type`, `path`, `component`, `auth_code`, `pid_id`, `meta_id`, `sort`) VALUES (83, NULL, NULL, NULL, '2025-07-15 01:47:21.296074', '2025-07-15 01:47:21.296080', 0, 'KnowledgeQuery', 1, 'button', '', '', 'ai:knowledge:import', 78, 83, 4);
INSERT INTO `system_menu` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `name`, `status`, `type`, `path`, `component`, `auth_code`, `pid_id`, `meta_id`, `sort`) VALUES (84, NULL, NULL, NULL, '2025-07-15 01:47:21.298823', '2025-07-15 01:47:21.298831', 0, 'KnowledgeQuery', 1, 'button', '', '', 'ai:knowledge:export', 78, 84, 5);
INSERT INTO `system_menu` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `name`, `status`, `type`, `path`, `component`, `auth_code`, `pid_id`, `meta_id`, `sort`) VALUES (85, NULL, 'admin', 'admin', '2025-07-17 02:59:11.386979', '2025-07-17 02:57:36.901338', 0, 'AI对话', 1, 'menu', '/ai/chat', '/ai/chat/index', '', 55, 85, 0);
INSERT INTO `system_menu` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `name`, `status`, `type`, `path`, `component`, `auth_code`, `pid_id`, `meta_id`, `sort`) VALUES (86, NULL, NULL, NULL, '2025-07-18 02:51:28.107268', '2025-07-18 02:51:28.107276', 0, 'Chatconversation', 1, 'menu', '/ai/chat_conversation', '/ai/chat_conversation/list', '', 55, 86, 100);
INSERT INTO `system_menu` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `name`, `status`, `type`, `path`, `component`, `auth_code`, `pid_id`, `meta_id`, `sort`) VALUES (85, NULL, 'admin', 'admin', '2025-07-21 06:52:27.834271', '2025-07-17 02:57:36.901338', 0, 'AI对话', 1, 'menu', '/ai/chat', '/ai/chat/index', '', 55, 85, 1);
INSERT INTO `system_menu` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `name`, `status`, `type`, `path`, `component`, `auth_code`, `pid_id`, `meta_id`, `sort`) VALUES (86, NULL, NULL, 'admin', '2025-07-21 06:51:55.270087', '2025-07-18 02:51:28.107276', 0, 'Chatconversation', 1, 'menu', '/ai/chat_conversation', '/ai/chat_conversation/list', '', 55, 86, 190);
INSERT INTO `system_menu` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `name`, `status`, `type`, `path`, `component`, `auth_code`, `pid_id`, `meta_id`, `sort`) VALUES (87, NULL, NULL, NULL, '2025-07-18 02:51:28.113765', '2025-07-18 02:51:28.113769', 0, 'ChatconversationCreate', 1, 'button', '', '', 'ai:chat_conversation:create', 86, 87, 0);
INSERT INTO `system_menu` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `name`, `status`, `type`, `path`, `component`, `auth_code`, `pid_id`, `meta_id`, `sort`) VALUES (88, NULL, NULL, NULL, '2025-07-18 02:51:28.116167', '2025-07-18 02:51:28.116174', 0, 'ChatconversationEdit', 1, 'button', '', '', 'ai:chat_conversation:edit', 86, 88, 1);
INSERT INTO `system_menu` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `name`, `status`, `type`, `path`, `component`, `auth_code`, `pid_id`, `meta_id`, `sort`) VALUES (89, NULL, NULL, NULL, '2025-07-18 02:51:28.118153', '2025-07-18 02:51:28.118158', 0, 'ChatconversationDelete', 1, 'button', '', '', 'ai:chat_conversation:delete', 86, 89, 2);
INSERT INTO `system_menu` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `name`, `status`, `type`, `path`, `component`, `auth_code`, `pid_id`, `meta_id`, `sort`) VALUES (90, NULL, NULL, NULL, '2025-07-18 02:51:28.120099', '2025-07-18 02:51:28.120108', 0, 'ChatconversationQuery', 1, 'button', '', '', 'ai:chat_conversation:query', 86, 90, 3);
INSERT INTO `system_menu` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `name`, `status`, `type`, `path`, `component`, `auth_code`, `pid_id`, `meta_id`, `sort`) VALUES (91, NULL, NULL, NULL, '2025-07-18 02:51:28.123877', '2025-07-18 02:51:28.123886', 0, 'ChatconversationQuery', 1, 'button', '', '', 'ai:chat_conversation:import', 86, 91, 4);
INSERT INTO `system_menu` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `name`, `status`, `type`, `path`, `component`, `auth_code`, `pid_id`, `meta_id`, `sort`) VALUES (92, NULL, NULL, NULL, '2025-07-18 02:51:28.125700', '2025-07-18 02:51:28.125707', 0, 'ChatconversationQuery', 1, 'button', '', '', 'ai:chat_conversation:export', 86, 92, 5);
INSERT INTO `system_menu` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `name`, `status`, `type`, `path`, `component`, `auth_code`, `pid_id`, `meta_id`, `sort`) VALUES (93, NULL, NULL, 'admin', '2025-07-18 03:41:59.311347', '2025-07-18 03:39:15.967234', 0, 'Chatmessage', 1, 'menu', '/ai/chat_message', '/ai/chat_message/list', '', 55, 93, 100);
INSERT INTO `system_menu` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `name`, `status`, `type`, `path`, `component`, `auth_code`, `pid_id`, `meta_id`, `sort`) VALUES (93, NULL, NULL, 'admin', '2025-07-21 06:51:46.584942', '2025-07-18 03:39:15.967234', 0, 'Chatmessage', 1, 'menu', '/ai/chat_message', '/ai/chat_message/list', '', 55, 93, 200);
INSERT INTO `system_menu` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `name`, `status`, `type`, `path`, `component`, `auth_code`, `pid_id`, `meta_id`, `sort`) VALUES (94, NULL, NULL, NULL, '2025-07-18 03:39:15.975162', '2025-07-18 03:39:15.975191', 0, 'ChatmessageCreate', 1, 'button', '', '', 'ai:chat_message:create', 93, 94, 0);
INSERT INTO `system_menu` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `name`, `status`, `type`, `path`, `component`, `auth_code`, `pid_id`, `meta_id`, `sort`) VALUES (95, NULL, NULL, NULL, '2025-07-18 03:39:15.981304', '2025-07-18 03:39:15.981333', 0, 'ChatmessageEdit', 1, 'button', '', '', 'ai:chat_message:edit', 93, 95, 1);
INSERT INTO `system_menu` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `name`, `status`, `type`, `path`, `component`, `auth_code`, `pid_id`, `meta_id`, `sort`) VALUES (96, NULL, NULL, NULL, '2025-07-18 03:39:15.987279', '2025-07-18 03:39:15.987305', 0, 'ChatmessageDelete', 1, 'button', '', '', 'ai:chat_message:delete', 93, 96, 2);
INSERT INTO `system_menu` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `name`, `status`, `type`, `path`, `component`, `auth_code`, `pid_id`, `meta_id`, `sort`) VALUES (97, NULL, NULL, NULL, '2025-07-18 03:39:15.993846', '2025-07-18 03:39:15.993875', 0, 'ChatmessageQuery', 1, 'button', '', '', 'ai:chat_message:query', 93, 97, 3);
INSERT INTO `system_menu` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `name`, `status`, `type`, `path`, `component`, `auth_code`, `pid_id`, `meta_id`, `sort`) VALUES (98, NULL, NULL, NULL, '2025-07-18 03:39:16.000070', '2025-07-18 03:39:16.000096', 0, 'ChatmessageQuery', 1, 'button', '', '', 'ai:chat_message:import', 93, 98, 4);
INSERT INTO `system_menu` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `name`, `status`, `type`, `path`, `component`, `auth_code`, `pid_id`, `meta_id`, `sort`) VALUES (99, NULL, NULL, NULL, '2025-07-18 03:39:16.005517', '2025-07-18 03:39:16.005544', 0, 'ChatmessageQuery', 1, 'button', '', '', 'ai:chat_message:export', 93, 99, 5);
INSERT INTO `system_menu` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `name`, `status`, `type`, `path`, `component`, `auth_code`, `pid_id`, `meta_id`, `sort`) VALUES (100, NULL, 'admin', 'admin', '2025-07-21 06:55:13.626092', '2025-07-21 06:53:45.364834', 0, 'AI绘画', 1, 'menu', '/ai/drawing', '/ai/drawing/index', '', 55, 100, 2);
COMMIT;
-- ----------------------------
@@ -1031,7 +1122,7 @@ CREATE TABLE `system_menu_meta` (
`hide_children_in_menu` tinyint(1) NOT NULL COMMENT '隐藏子菜单',
`hide_in_menu` tinyint(1) NOT NULL COMMENT '隐藏菜单',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=100 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
) ENGINE=InnoDB AUTO_INCREMENT=101 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- ----------------------------
-- Records of system_menu_meta
@@ -1094,14 +1185,14 @@ INSERT INTO `system_menu_meta` (`id`, `remark`, `creator`, `modifier`, `update_t
INSERT INTO `system_menu_meta` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `title`, `icon`, `sort`, `affix_tab`, `badge`, `badge_type`, `badge_variants`, `iframe_src`, `link`, `hide_children_in_menu`, `hide_in_menu`) VALUES (60, NULL, NULL, NULL, '2025-07-10 03:39:18.835521', '2025-07-10 03:39:18.835532', 0, 'common.query', '', 0, 0, '', '', '', '', '', 0, 0);
INSERT INTO `system_menu_meta` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `title`, `icon`, `sort`, `affix_tab`, `badge`, `badge_type`, `badge_variants`, `iframe_src`, `link`, `hide_children_in_menu`, `hide_in_menu`) VALUES (61, NULL, NULL, NULL, '2025-07-10 03:39:18.837225', '2025-07-10 03:39:18.837230', 0, 'common.query', '', 0, 0, '', '', '', '', '', 0, 0);
INSERT INTO `system_menu_meta` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `title`, `icon`, `sort`, `affix_tab`, `badge`, `badge_type`, `badge_variants`, `iframe_src`, `link`, `hide_children_in_menu`, `hide_in_menu`) VALUES (62, NULL, NULL, NULL, '2025-07-10 03:39:18.839006', '2025-07-10 03:39:18.839011', 0, 'common.query', '', 0, 0, '', '', '', '', '', 0, 0);
INSERT INTO `system_menu_meta` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `title`, `icon`, `sort`, `affix_tab`, `badge`, `badge_type`, `badge_variants`, `iframe_src`, `link`, `hide_children_in_menu`, `hide_in_menu`) VALUES (63, NULL, NULL, NULL, '2025-07-11 01:57:27.845804', '2025-07-11 01:57:27.845814', 0, 'ai.ai_model.title', '', 0, 0, '', '', '', '', '', 0, 0);
INSERT INTO `system_menu_meta` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `title`, `icon`, `sort`, `affix_tab`, `badge`, `badge_type`, `badge_variants`, `iframe_src`, `link`, `hide_children_in_menu`, `hide_in_menu`) VALUES (63, NULL, NULL, NULL, '2025-07-21 06:52:18.165051', '2025-07-11 01:57:27.845814', 0, 'ai.ai_model.title', '', 0, 0, '', '', '', '', '', 0, 0);
INSERT INTO `system_menu_meta` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `title`, `icon`, `sort`, `affix_tab`, `badge`, `badge_type`, `badge_variants`, `iframe_src`, `link`, `hide_children_in_menu`, `hide_in_menu`) VALUES (64, NULL, NULL, NULL, '2025-07-11 01:57:27.854026', '2025-07-11 01:57:27.854030', 0, 'common.create', '', 0, 0, '', '', '', '', '', 0, 0);
INSERT INTO `system_menu_meta` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `title`, `icon`, `sort`, `affix_tab`, `badge`, `badge_type`, `badge_variants`, `iframe_src`, `link`, `hide_children_in_menu`, `hide_in_menu`) VALUES (65, NULL, NULL, NULL, '2025-07-11 01:57:27.857594', '2025-07-11 01:57:27.857598', 0, 'common.edit', '', 0, 0, '', '', '', '', '', 0, 0);
INSERT INTO `system_menu_meta` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `title`, `icon`, `sort`, `affix_tab`, `badge`, `badge_type`, `badge_variants`, `iframe_src`, `link`, `hide_children_in_menu`, `hide_in_menu`) VALUES (66, NULL, NULL, NULL, '2025-07-11 01:57:27.861280', '2025-07-11 01:57:27.861291', 0, 'common.delete', '', 0, 0, '', '', '', '', '', 0, 0);
INSERT INTO `system_menu_meta` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `title`, `icon`, `sort`, `affix_tab`, `badge`, `badge_type`, `badge_variants`, `iframe_src`, `link`, `hide_children_in_menu`, `hide_in_menu`) VALUES (67, NULL, NULL, NULL, '2025-07-11 01:57:27.863309', '2025-07-11 01:57:27.863315', 0, 'common.query', '', 0, 0, '', '', '', '', '', 0, 0);
INSERT INTO `system_menu_meta` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `title`, `icon`, `sort`, `affix_tab`, `badge`, `badge_type`, `badge_variants`, `iframe_src`, `link`, `hide_children_in_menu`, `hide_in_menu`) VALUES (68, NULL, NULL, NULL, '2025-07-11 01:57:27.865232', '2025-07-11 01:57:27.865238', 0, 'common.query', '', 0, 0, '', '', '', '', '', 0, 0);
INSERT INTO `system_menu_meta` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `title`, `icon`, `sort`, `affix_tab`, `badge`, `badge_type`, `badge_variants`, `iframe_src`, `link`, `hide_children_in_menu`, `hide_in_menu`) VALUES (69, NULL, NULL, NULL, '2025-07-11 01:57:27.866966', '2025-07-11 01:57:27.866972', 0, 'common.query', '', 0, 0, '', '', '', '', '', 0, 0);
INSERT INTO `system_menu_meta` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `title`, `icon`, `sort`, `affix_tab`, `badge`, `badge_type`, `badge_variants`, `iframe_src`, `link`, `hide_children_in_menu`, `hide_in_menu`) VALUES (70, NULL, NULL, NULL, '2025-07-11 02:53:20.398301', '2025-07-11 02:53:20.398315', 0, 'ai.tool.title', '', 0, 0, '', '', '', '', '', 0, 0);
INSERT INTO `system_menu_meta` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `title`, `icon`, `sort`, `affix_tab`, `badge`, `badge_type`, `badge_variants`, `iframe_src`, `link`, `hide_children_in_menu`, `hide_in_menu`) VALUES (70, NULL, NULL, NULL, '2025-07-21 06:52:10.393970', '2025-07-11 02:53:20.398315', 0, 'ai.tool.title', '', 0, 0, '', '', '', '', '', 0, 0);
INSERT INTO `system_menu_meta` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `title`, `icon`, `sort`, `affix_tab`, `badge`, `badge_type`, `badge_variants`, `iframe_src`, `link`, `hide_children_in_menu`, `hide_in_menu`) VALUES (71, NULL, NULL, NULL, '2025-07-11 02:53:20.405509', '2025-07-11 02:53:20.405516', 0, 'common.create', '', 0, 0, '', '', '', '', '', 0, 0);
INSERT INTO `system_menu_meta` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `title`, `icon`, `sort`, `affix_tab`, `badge`, `badge_type`, `badge_variants`, `iframe_src`, `link`, `hide_children_in_menu`, `hide_in_menu`) VALUES (72, NULL, NULL, NULL, '2025-07-11 02:53:20.410175', '2025-07-11 02:53:20.410180', 0, 'common.edit', '', 0, 0, '', '', '', '', '', 0, 0);
INSERT INTO `system_menu_meta` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `title`, `icon`, `sort`, `affix_tab`, `badge`, `badge_type`, `badge_variants`, `iframe_src`, `link`, `hide_children_in_menu`, `hide_in_menu`) VALUES (73, NULL, NULL, NULL, '2025-07-11 02:53:20.412480', '2025-07-11 02:53:20.412486', 0, 'common.delete', '', 0, 0, '', '', '', '', '', 0, 0);
@@ -1109,28 +1200,29 @@ INSERT INTO `system_menu_meta` (`id`, `remark`, `creator`, `modifier`, `update_t
INSERT INTO `system_menu_meta` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `title`, `icon`, `sort`, `affix_tab`, `badge`, `badge_type`, `badge_variants`, `iframe_src`, `link`, `hide_children_in_menu`, `hide_in_menu`) VALUES (75, NULL, NULL, NULL, '2025-07-11 02:53:20.416161', '2025-07-11 02:53:20.416166', 0, 'common.query', '', 0, 0, '', '', '', '', '', 0, 0);
INSERT INTO `system_menu_meta` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `title`, `icon`, `sort`, `affix_tab`, `badge`, `badge_type`, `badge_variants`, `iframe_src`, `link`, `hide_children_in_menu`, `hide_in_menu`) VALUES (76, NULL, NULL, NULL, '2025-07-11 02:53:20.417594', '2025-07-11 02:53:20.417598', 0, 'common.query', '', 0, 0, '', '', '', '', '', 0, 0);
INSERT INTO `system_menu_meta` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `title`, `icon`, `sort`, `affix_tab`, `badge`, `badge_type`, `badge_variants`, `iframe_src`, `link`, `hide_children_in_menu`, `hide_in_menu`) VALUES (77, NULL, NULL, NULL, '2025-07-11 08:46:59.490742', '2025-07-11 08:46:59.490773', 0, 'ai chat', '', 0, 0, '', '', '', '', '', 0, 0);
INSERT INTO `system_menu_meta` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `title`, `icon`, `sort`, `affix_tab`, `badge`, `badge_type`, `badge_variants`, `iframe_src`, `link`, `hide_children_in_menu`, `hide_in_menu`) VALUES (78, NULL, NULL, NULL, '2025-07-15 01:47:21.274488', '2025-07-15 01:47:21.274505', 0, 'ai.knowledge.title', '', 0, 0, '', '', '', '', '', 0, 0);
INSERT INTO `system_menu_meta` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `title`, `icon`, `sort`, `affix_tab`, `badge`, `badge_type`, `badge_variants`, `iframe_src`, `link`, `hide_children_in_menu`, `hide_in_menu`) VALUES (78, NULL, NULL, NULL, '2025-07-21 06:52:02.992485', '2025-07-15 01:47:21.274505', 0, 'ai.knowledge.title', '', 0, 0, '', '', '', '', '', 0, 0);
INSERT INTO `system_menu_meta` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `title`, `icon`, `sort`, `affix_tab`, `badge`, `badge_type`, `badge_variants`, `iframe_src`, `link`, `hide_children_in_menu`, `hide_in_menu`) VALUES (79, NULL, NULL, NULL, '2025-07-15 01:47:21.286782', '2025-07-15 01:47:21.286794', 0, 'common.create', '', 0, 0, '', '', '', '', '', 0, 0);
INSERT INTO `system_menu_meta` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `title`, `icon`, `sort`, `affix_tab`, `badge`, `badge_type`, `badge_variants`, `iframe_src`, `link`, `hide_children_in_menu`, `hide_in_menu`) VALUES (80, NULL, NULL, NULL, '2025-07-15 01:47:21.289159', '2025-07-15 01:47:21.289167', 0, 'common.edit', '', 0, 0, '', '', '', '', '', 0, 0);
INSERT INTO `system_menu_meta` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `title`, `icon`, `sort`, `affix_tab`, `badge`, `badge_type`, `badge_variants`, `iframe_src`, `link`, `hide_children_in_menu`, `hide_in_menu`) VALUES (81, NULL, NULL, NULL, '2025-07-15 01:47:21.291876', '2025-07-15 01:47:21.291885', 0, 'common.delete', '', 0, 0, '', '', '', '', '', 0, 0);
INSERT INTO `system_menu_meta` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `title`, `icon`, `sort`, `affix_tab`, `badge`, `badge_type`, `badge_variants`, `iframe_src`, `link`, `hide_children_in_menu`, `hide_in_menu`) VALUES (82, NULL, NULL, NULL, '2025-07-15 01:47:21.293546', '2025-07-15 01:47:21.293551', 0, 'common.query', '', 0, 0, '', '', '', '', '', 0, 0);
INSERT INTO `system_menu_meta` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `title`, `icon`, `sort`, `affix_tab`, `badge`, `badge_type`, `badge_variants`, `iframe_src`, `link`, `hide_children_in_menu`, `hide_in_menu`) VALUES (83, NULL, NULL, NULL, '2025-07-15 01:47:21.295133', '2025-07-15 01:47:21.295142', 0, 'common.query', '', 0, 0, '', '', '', '', '', 0, 0);
INSERT INTO `system_menu_meta` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `title`, `icon`, `sort`, `affix_tab`, `badge`, `badge_type`, `badge_variants`, `iframe_src`, `link`, `hide_children_in_menu`, `hide_in_menu`) VALUES (84, NULL, NULL, NULL, '2025-07-15 01:47:21.297417', '2025-07-15 01:47:21.297424', 0, 'common.query', '', 0, 0, '', '', '', '', '', 0, 0);
INSERT INTO `system_menu_meta` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `title`, `icon`, `sort`, `affix_tab`, `badge`, `badge_type`, `badge_variants`, `iframe_src`, `link`, `hide_children_in_menu`, `hide_in_menu`) VALUES (85, NULL, NULL, NULL, '2025-07-17 02:59:11.382648', '2025-07-17 02:57:36.895879', 0, 'ai.chat.title', '', 0, 0, '', '', '', '', '', 0, 0);
INSERT INTO `system_menu_meta` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `title`, `icon`, `sort`, `affix_tab`, `badge`, `badge_type`, `badge_variants`, `iframe_src`, `link`, `hide_children_in_menu`, `hide_in_menu`) VALUES (86, NULL, NULL, NULL, '2025-07-18 02:51:28.102098', '2025-07-18 02:51:28.102110', 0, 'ai.chat_conversation.title', '', 0, 0, '', '', '', '', '', 0, 0);
INSERT INTO `system_menu_meta` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `title`, `icon`, `sort`, `affix_tab`, `badge`, `badge_type`, `badge_variants`, `iframe_src`, `link`, `hide_children_in_menu`, `hide_in_menu`) VALUES (85, NULL, NULL, NULL, '2025-07-21 06:52:27.830001', '2025-07-17 02:57:36.895879', 0, 'ai.chat.title', '', 0, 0, '', '', '', '', '', 0, 0);
INSERT INTO `system_menu_meta` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `title`, `icon`, `sort`, `affix_tab`, `badge`, `badge_type`, `badge_variants`, `iframe_src`, `link`, `hide_children_in_menu`, `hide_in_menu`) VALUES (86, NULL, NULL, NULL, '2025-07-21 06:51:55.266989', '2025-07-18 02:51:28.102110', 0, 'ai.chat_conversation.title', '', 0, 0, '', '', '', '', '', 0, 0);
INSERT INTO `system_menu_meta` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `title`, `icon`, `sort`, `affix_tab`, `badge`, `badge_type`, `badge_variants`, `iframe_src`, `link`, `hide_children_in_menu`, `hide_in_menu`) VALUES (87, NULL, NULL, NULL, '2025-07-18 02:51:28.111131', '2025-07-18 02:51:28.111137', 0, 'common.create', '', 0, 0, '', '', '', '', '', 0, 0);
INSERT INTO `system_menu_meta` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `title`, `icon`, `sort`, `affix_tab`, `badge`, `badge_type`, `badge_variants`, `iframe_src`, `link`, `hide_children_in_menu`, `hide_in_menu`) VALUES (88, NULL, NULL, NULL, '2025-07-18 02:51:28.115047', '2025-07-18 02:51:28.115055', 0, 'common.edit', '', 0, 0, '', '', '', '', '', 0, 0);
INSERT INTO `system_menu_meta` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `title`, `icon`, `sort`, `affix_tab`, `badge`, `badge_type`, `badge_variants`, `iframe_src`, `link`, `hide_children_in_menu`, `hide_in_menu`) VALUES (89, NULL, NULL, NULL, '2025-07-18 02:51:28.117163', '2025-07-18 02:51:28.117168', 0, 'common.delete', '', 0, 0, '', '', '', '', '', 0, 0);
INSERT INTO `system_menu_meta` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `title`, `icon`, `sort`, `affix_tab`, `badge`, `badge_type`, `badge_variants`, `iframe_src`, `link`, `hide_children_in_menu`, `hide_in_menu`) VALUES (90, NULL, NULL, NULL, '2025-07-18 02:51:28.119252', '2025-07-18 02:51:28.119262', 0, 'common.query', '', 0, 0, '', '', '', '', '', 0, 0);
INSERT INTO `system_menu_meta` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `title`, `icon`, `sort`, `affix_tab`, `badge`, `badge_type`, `badge_variants`, `iframe_src`, `link`, `hide_children_in_menu`, `hide_in_menu`) VALUES (91, NULL, NULL, NULL, '2025-07-18 02:51:28.123068', '2025-07-18 02:51:28.123074', 0, 'common.query', '', 0, 0, '', '', '', '', '', 0, 0);
INSERT INTO `system_menu_meta` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `title`, `icon`, `sort`, `affix_tab`, `badge`, `badge_type`, `badge_variants`, `iframe_src`, `link`, `hide_children_in_menu`, `hide_in_menu`) VALUES (92, NULL, NULL, NULL, '2025-07-18 02:51:28.124912', '2025-07-18 02:51:28.124917', 0, 'common.query', '', 0, 0, '', '', '', '', '', 0, 0);
INSERT INTO `system_menu_meta` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `title`, `icon`, `sort`, `affix_tab`, `badge`, `badge_type`, `badge_variants`, `iframe_src`, `link`, `hide_children_in_menu`, `hide_in_menu`) VALUES (93, NULL, NULL, NULL, '2025-07-18 03:41:59.303918', '2025-07-18 03:39:15.959130', 0, 'ai.chat_message.title', '', 0, 0, '', '', '', '', '', 0, 1);
INSERT INTO `system_menu_meta` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `title`, `icon`, `sort`, `affix_tab`, `badge`, `badge_type`, `badge_variants`, `iframe_src`, `link`, `hide_children_in_menu`, `hide_in_menu`) VALUES (93, NULL, NULL, NULL, '2025-07-21 06:51:46.579238', '2025-07-18 03:39:15.959130', 0, 'ai.chat_message.title', '', 0, 0, '', '', '', '', '', 0, 1);
INSERT INTO `system_menu_meta` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `title`, `icon`, `sort`, `affix_tab`, `badge`, `badge_type`, `badge_variants`, `iframe_src`, `link`, `hide_children_in_menu`, `hide_in_menu`) VALUES (94, NULL, NULL, NULL, '2025-07-18 03:39:15.970862', '2025-07-18 03:39:15.970899', 0, 'common.create', '', 0, 0, '', '', '', '', '', 0, 0);
INSERT INTO `system_menu_meta` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `title`, `icon`, `sort`, `affix_tab`, `badge`, `badge_type`, `badge_variants`, `iframe_src`, `link`, `hide_children_in_menu`, `hide_in_menu`) VALUES (95, NULL, NULL, NULL, '2025-07-18 03:39:15.977961', '2025-07-18 03:39:15.977991', 0, 'common.edit', '', 0, 0, '', '', '', '', '', 0, 0);
INSERT INTO `system_menu_meta` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `title`, `icon`, `sort`, `affix_tab`, `badge`, `badge_type`, `badge_variants`, `iframe_src`, `link`, `hide_children_in_menu`, `hide_in_menu`) VALUES (96, NULL, NULL, NULL, '2025-07-18 03:39:15.984598', '2025-07-18 03:39:15.984630', 0, 'common.delete', '', 0, 0, '', '', '', '', '', 0, 0);
INSERT INTO `system_menu_meta` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `title`, `icon`, `sort`, `affix_tab`, `badge`, `badge_type`, `badge_variants`, `iframe_src`, `link`, `hide_children_in_menu`, `hide_in_menu`) VALUES (97, NULL, NULL, NULL, '2025-07-18 03:39:15.990627', '2025-07-18 03:39:15.990654', 0, 'common.query', '', 0, 0, '', '', '', '', '', 0, 0);
INSERT INTO `system_menu_meta` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `title`, `icon`, `sort`, `affix_tab`, `badge`, `badge_type`, `badge_variants`, `iframe_src`, `link`, `hide_children_in_menu`, `hide_in_menu`) VALUES (98, NULL, NULL, NULL, '2025-07-18 03:39:15.996695', '2025-07-18 03:39:15.996725', 0, 'common.query', '', 0, 0, '', '', '', '', '', 0, 0);
INSERT INTO `system_menu_meta` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `title`, `icon`, `sort`, `affix_tab`, `badge`, `badge_type`, `badge_variants`, `iframe_src`, `link`, `hide_children_in_menu`, `hide_in_menu`) VALUES (99, NULL, NULL, NULL, '2025-07-18 03:39:16.002524', '2025-07-18 03:39:16.002552', 0, 'common.query', '', 0, 0, '', '', '', '', '', 0, 0);
INSERT INTO `system_menu_meta` (`id`, `remark`, `creator`, `modifier`, `update_time`, `create_time`, `is_deleted`, `title`, `icon`, `sort`, `affix_tab`, `badge`, `badge_type`, `badge_variants`, `iframe_src`, `link`, `hide_children_in_menu`, `hide_in_menu`) VALUES (100, NULL, NULL, NULL, '2025-07-21 06:55:13.618493', '2025-07-21 06:53:45.359449', 0, 'ai.drawing.title', '', 0, 0, '', '', '', '', '', 0, 0);
COMMIT;
-- ----------------------------

View File

@@ -5,9 +5,10 @@ export async function getConversations() {
return await res.json();
}
export async function createConversation() {
export async function createConversation(platform: string) {
const response = await fetchWithAuth('chat/conversations', {
method: 'POST',
body: JSON.stringify({ platform }),
});
if (!response.ok) {
throw new Error('创建对话失败');
@@ -25,16 +26,18 @@ export async function getMessages(conversationId: number) {
// 你原有的fetchAIStream方法保留
export interface FetchAIStreamParams {
content: string;
platform: string;
conversation_id?: null | number;
}
export async function fetchAIStream({
content,
platform,
conversation_id,
}: FetchAIStreamParams) {
const res = await fetchWithAuth('chat/stream', {
method: 'POST',
body: JSON.stringify({ content, conversation_id }),
body: JSON.stringify({ content, platform, conversation_id }),
});
if (!res.body) throw new Error('No stream body');
const reader = res.body.getReader();

View File

@@ -40,13 +40,13 @@ const chatList = ref<ChatItem[]>([]);
const messages = ref<Message[]>([]);
// 模型列表
const modelOptions = [
const platformOptions = [
{ label: 'deepseek', value: 'deepseek' },
{ label: 'GPT-4', value: 'gpt-4' },
{ label: '通义千问', value: 'tongyi' },
];
const selectedChatId = ref<null | number>(chatList.value[0]?.id ?? null);
const selectedModel = ref(modelOptions[0]?.value);
const selectedPlatform = ref(platformOptions[0]?.value);
const search = ref('');
const input = ref('');
const messagesRef = ref<HTMLElement | null>(null);
@@ -67,7 +67,7 @@ async function selectChat(id: number) {
async function handleNewChat() {
// 调用后端新建对话
const { data } = await createConversation();
const { data } = await createConversation(selectedPlatform.value!);
// 刷新对话列表
await fetchConversations();
// 选中新建的对话
@@ -97,6 +97,7 @@ async function handleSend() {
const stream = await fetchAIStream({
content: input.value,
platform: selectedPlatform.value,
conversation_id: selectedChatId.value, // 新增
});
if (chatList.value.length > 0) {
@@ -192,10 +193,10 @@ onMounted(() => {
<div class="content-header">
<div class="model-select-wrap">
<Select
v-model:value="selectedModel"
v-model:value="selectedPlatform"
style="width: 220px"
:options="modelOptions"
placeholder="选择AI模型"
:options="platformOptions"
placeholder="选择平台"
/>
</div>
</div>