From 9e99807bd091e58bf875baab251d12e4bebef3ec Mon Sep 17 00:00:00 2001 From: YunaiV Date: Mon, 13 May 2024 20:46:45 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E6=96=B0=E5=A2=9E=E3=80=91AI=EF=BC=9A?= =?UTF-8?q?=E8=81=8A=E5=A4=A9=E8=A7=92=E8=89=B2=E7=AE=A1=E7=90=86=EF=BC=88?= =?UTF-8?q?50%=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/ai/model/chatRole/index.ts | 44 +++++ src/views/ai/model/chatRole/ChatRoleForm.vue | 161 +++++++++++++++ src/views/ai/model/chatRole/index.vue | 194 +++++++++++++++++++ 3 files changed, 399 insertions(+) create mode 100644 src/api/ai/model/chatRole/index.ts create mode 100644 src/views/ai/model/chatRole/ChatRoleForm.vue create mode 100644 src/views/ai/model/chatRole/index.vue diff --git a/src/api/ai/model/chatRole/index.ts b/src/api/ai/model/chatRole/index.ts new file mode 100644 index 00000000..e573b667 --- /dev/null +++ b/src/api/ai/model/chatRole/index.ts @@ -0,0 +1,44 @@ +import request from '@/config/axios' + +// AI 聊天角色 VO +export interface ChatRoleVO { + id: number // 角色编号 + modelId: number // 模型编号 + name: string // 角色名称 + avatar: string // 角色头像 + category: string // 角色类别 + sort: number // 角色排序 + description: string // 角色描述 + welcomeMessage: string // 角色欢迎语 + systemMessage: string // 角色上下文 + publicStatus: boolean // 是否公开 + status: number // 状态 +} + +// AI 聊天角色 API +export const ChatRoleApi = { + // 查询聊天角色分页 + getChatRolePage: async (params: any) => { + return await request.get({ url: `/ai/chat-role/page`, params }) + }, + + // 查询聊天角色详情 + getChatRole: async (id: number) => { + return await request.get({ url: `/ai/chat-role/get?id=` + id }) + }, + + // 新增聊天角色 + createChatRole: async (data: ChatRoleVO) => { + return await request.post({ url: `/ai/chat-role/create`, data }) + }, + + // 修改聊天角色 + updateChatRole: async (data: ChatRoleVO) => { + return await request.put({ url: `/ai/chat-role/update`, data }) + }, + + // 删除聊天角色 + deleteChatRole: async (id: number) => { + return await request.delete({ url: `/ai/chat-role/delete?id=` + id }) + } +} diff --git a/src/views/ai/model/chatRole/ChatRoleForm.vue b/src/views/ai/model/chatRole/ChatRoleForm.vue new file mode 100644 index 00000000..1e184bff --- /dev/null +++ b/src/views/ai/model/chatRole/ChatRoleForm.vue @@ -0,0 +1,161 @@ + + diff --git a/src/views/ai/model/chatRole/index.vue b/src/views/ai/model/chatRole/index.vue new file mode 100644 index 00000000..40759e87 --- /dev/null +++ b/src/views/ai/model/chatRole/index.vue @@ -0,0 +1,194 @@ + + +