From a1d7e81859f554f3a53680cc35f0f49bf1f77098 Mon Sep 17 00:00:00 2001
From: wwf <1971391498@qq.com>
Date: 星期四, 14 五月 2026 14:37:02 +0800
Subject: [PATCH] 导入项目

---
 src/api/ai/model/chatRole/index.ts |   83 +++++++++++++++++++++++++++++++++++++++++
 1 files changed, 83 insertions(+), 0 deletions(-)

diff --git a/src/api/ai/model/chatRole/index.ts b/src/api/ai/model/chatRole/index.ts
new file mode 100644
index 0000000..ffdd305
--- /dev/null
+++ b/src/api/ai/model/chatRole/index.ts
@@ -0,0 +1,83 @@
+import request from '@/config/axios'
+
+// AI 鑱婂ぉ瑙掕壊 VO
+export interface ChatRoleVO {
+  id: number // 瑙掕壊缂栧彿
+  modelId: number // 妯″瀷缂栧彿
+  name: string // 瑙掕壊鍚嶇О
+  avatar: string // 瑙掕壊澶村儚
+  category: string // 瑙掕壊绫诲埆
+  sort: number // 瑙掕壊鎺掑簭
+  description: string // 瑙掕壊鎻忚堪
+  systemMessage: string // 瑙掕壊璁惧畾
+  welcomeMessage: string // 瑙掕壊璁惧畾
+  publicStatus: boolean // 鏄惁鍏紑
+  status: number // 鐘舵��
+  knowledgeIds?: number[] // 寮曠敤鐨勭煡璇嗗簱 ID 鍒楄〃
+  toolIds?: number[] // 寮曠敤鐨勫伐鍏� ID 鍒楄〃
+  mcpClientNames?: string[] // 寮曠敤鐨� MCP Client 鍚嶅瓧鍒楄〃
+}
+
+// AI 鑱婂ぉ瑙掕壊 鍒嗛〉璇锋眰 vo
+export interface ChatRolePageReqVO {
+  name?: string // 瑙掕壊鍚嶇О
+  category?: string // 瑙掕壊绫诲埆
+  publicStatus: boolean // 鏄惁鍏紑
+  pageNo: number // 鏄惁鍏紑
+  pageSize: 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 })
+  },
+
+  // ======= chat 鑱婂ぉ
+
+  // 鑾峰彇 my role
+  getMyPage: async (params: ChatRolePageReqVO) => {
+    return await request.get({ url: `/ai/chat-role/my-page`, params })
+  },
+
+  // 鑾峰彇瑙掕壊鍒嗙被
+  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 })
+  }
+}

--
Gitblit v1.8.0