From b2c15ab2cb7d8f97292db798b1deb1dab224568f Mon Sep 17 00:00:00 2001 From: cherishsince Date: Wed, 15 May 2024 23:11:40 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=A2=9E=E5=8A=A0=E3=80=91AI=20?= =?UTF-8?q?=E8=A7=92=E8=89=B2=E5=AE=9A=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/ai/model/chatRole/index.ts | 20 +++- src/views/ai/chat/role/RoleList.vue | 54 ++++++++++- src/views/ai/chat/role/index.vue | 72 +++++++++++---- src/views/ai/model/chatRole/ChatRoleForm.vue | 96 ++++++++++++++------ 4 files changed, 194 insertions(+), 48 deletions(-) diff --git a/src/api/ai/model/chatRole/index.ts b/src/api/ai/model/chatRole/index.ts index 35aba833..a9fce13c 100644 --- a/src/api/ai/model/chatRole/index.ts +++ b/src/api/ai/model/chatRole/index.ts @@ -10,6 +10,7 @@ export interface ChatRoleVO { sort: number // 角色排序 description: string // 角色描述 systemMessage: string // 角色设定 + welcomeMessage: string // 角色设定 publicStatus: boolean // 是否公开 status: number // 状态 } @@ -50,6 +51,8 @@ export const ChatRoleApi = { return await request.delete({ url: `/ai/chat-role/delete?id=` + id }) }, + // ======= chat 聊天 + // 获取 my role getMyPage: async (params: ChatRolePageReqVO) => { return await request.get({ url: `/ai/chat-role/my-page`, params}) @@ -58,5 +61,20 @@ export const ChatRoleApi = { // 获取角色分类 getCategoryList: async () => { return await request.get({ url: `/ai/chat-role/category-list`}) - } + }, + + // 创建角色 + createMy: async (data: ChatRoleVO) => { + return await request.post({ url: `/ai/chat-role/create-my`, data}) + }, + + // 更新角色 + updateMy: async (data: ChatRoleVO) => { + return await request.put({ url: `/ai/chat-role/update-my`, data}) + }, + + // 删除角色 my + deleteMy: async (id: number) => { + return await request.delete({ url: `/ai/chat-role/delete-my?id=` + id }) + }, } diff --git a/src/views/ai/chat/role/RoleList.vue b/src/views/ai/chat/role/RoleList.vue index e57f09ab..b4e5c6ec 100644 --- a/src/views/ai/chat/role/RoleList.vue +++ b/src/views/ai/chat/role/RoleList.vue @@ -1,6 +1,28 @@