From b116d82376119753924a39332ddca3c9a4f4acb7 Mon Sep 17 00:00:00 2001 From: cherishsince Date: Sun, 12 May 2024 14:28:27 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=A2=9E=E5=8A=A0=E3=80=91=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=20chat=20=E8=81=8A=E5=A4=A9=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E3=80=81=E5=88=A0=E9=99=A4=E3=80=81=E5=A4=8D=E5=88=B6=E5=88=B0?= =?UTF-8?q?=E7=B2=98=E8=B4=B4=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/ai/chat/message/index.ts | 41 +++ src/views/ai/chat/components/MessageList.vue | 276 +++++++++++++++++++ src/views/ai/chat/index.vue | 180 +----------- 3 files changed, 332 insertions(+), 165 deletions(-) create mode 100644 src/api/ai/chat/message/index.ts create mode 100644 src/views/ai/chat/components/MessageList.vue diff --git a/src/api/ai/chat/message/index.ts b/src/api/ai/chat/message/index.ts new file mode 100644 index 00000000..3dc1ea0f --- /dev/null +++ b/src/api/ai/chat/message/index.ts @@ -0,0 +1,41 @@ +import request from '@/config/axios' + +// 聊天VO +export interface ChatMessageVO { + id: number // 编号 + conversationId: string // 会话编号 + type: string // 消息类型 + userId: string // 用户编号 + roleId: string // 角色编号 + model: number // 模型标志 + modelId: number // 模型编号 + content: number // 聊天内容 + tokens: number // 消耗 Token 数量 + createTime: Date // 创建时间 +} + +export interface ChatMessageSendVO { + conversationId: string // 会话编号 + content: number // 聊天内容 +} + +// AI chat 聊天 +export const ChatMessageApi = { + + // 消息列表 + messageList: async (conversationId: string) => { + return await request.get({ url: `/ai/chat/message/list-by-conversation-id?conversationId=${conversationId}`}) + }, + + // 发送 send 消息 + send: async (data: ChatMessageSendVO) => { + return await request.post({ url: `/ai/chat/message/send`, data }) + }, + + + // 发送 send 消息 + delete: async (id: string) => { + return await request.delete({ url: `/ai/chat/message/delete?id=${id}` }) + }, + +} diff --git a/src/views/ai/chat/components/MessageList.vue b/src/views/ai/chat/components/MessageList.vue new file mode 100644 index 00000000..3038f886 --- /dev/null +++ b/src/views/ai/chat/components/MessageList.vue @@ -0,0 +1,276 @@ + + + + + + diff --git a/src/views/ai/chat/index.vue b/src/views/ai/chat/index.vue index 4b4bee22..f3dc471f 100644 --- a/src/views/ai/chat/index.vue +++ b/src/views/ai/chat/index.vue @@ -81,73 +81,10 @@ - - -
- -
-
- -
-
-
- 2024-05-10 22:38 -
-
- - 如果您想获取某个网页或程序的截图,可以使用浏览器自带的截图功能,或者使用第三方截图工具,如Snipping - Tool、FastStone Capture等。如果您想将屏幕上的某个区域截取下来,可以使用键盘上的“Prt - Sc”键(或“Print Screen”键)来获取整个屏幕的截图,并将其粘贴到图像编辑软件中进行编辑和保存。 - 如果您需要更具体的帮助,例如如何使用特定的截图工具或如何编辑截图,请提供更多详细信息,我将尽力为您提供帮助。 - - -
-
-
- - 复制 -
-
- - 删除 -
-
-
-
- -
-
- -
-
-
- 2024-05-10 22:38 -
-
- - 今天天气 - -
-
-
- - 复制 -
-
- - 删除 -
-
-
- -
-
- + + +