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/chat/conversation/index.ts |   65 ++++++++++++++++++++++++++++++++
 1 files changed, 65 insertions(+), 0 deletions(-)

diff --git a/src/api/ai/chat/conversation/index.ts b/src/api/ai/chat/conversation/index.ts
new file mode 100644
index 0000000..6ce4482
--- /dev/null
+++ b/src/api/ai/chat/conversation/index.ts
@@ -0,0 +1,65 @@
+import request from '@/config/axios'
+
+// AI 鑱婂ぉ瀵硅瘽 VO
+export interface ChatConversationVO {
+  id: number // ID 缂栧彿
+  userId: number // 鐢ㄦ埛缂栧彿
+  title: string // 瀵硅瘽鏍囬
+  pinned: boolean // 鏄惁缃《
+  roleId: number // 瑙掕壊缂栧彿
+  modelId: number // 妯″瀷缂栧彿
+  model: string // 妯″瀷鏍囧織
+  temperature: number // 娓╁害鍙傛暟
+  maxTokens: number // 鍗曟潯鍥炲鐨勬渶澶� Token 鏁伴噺
+  maxContexts: number // 涓婁笅鏂囩殑鏈�澶� Message 鏁伴噺
+  createTime?: Date // 鍒涘缓鏃堕棿
+  // 棰濆瀛楁
+  systemMessage?: string // 瑙掕壊璁惧畾
+  modelName?: string // 妯″瀷鍚嶅瓧
+  roleAvatar?: string // 瑙掕壊澶村儚
+  modelMaxTokens?: string // 妯″瀷鐨勫崟鏉″洖澶嶇殑鏈�澶� Token 鏁伴噺
+  modelMaxContexts?: string // 妯″瀷鐨勪笂涓嬫枃鐨勬渶澶� Message 鏁伴噺
+}
+
+// AI 鑱婂ぉ瀵硅瘽 API
+export const ChatConversationApi = {
+  // 鑾峰緱銆愭垜鐨勩�戣亰澶╁璇�
+  getChatConversationMy: async (id: number) => {
+    return await request.get({ url: `/ai/chat/conversation/get-my?id=${id}` })
+  },
+
+  // 鏂板銆愭垜鐨勩�戣亰澶╁璇�
+  createChatConversationMy: async (data?: ChatConversationVO) => {
+    return await request.post({ url: `/ai/chat/conversation/create-my`, data })
+  },
+
+  // 鏇存柊銆愭垜鐨勩�戣亰澶╁璇�
+  updateChatConversationMy: async (data: ChatConversationVO) => {
+    return await request.put({ url: `/ai/chat/conversation/update-my`, data })
+  },
+
+  // 鍒犻櫎銆愭垜鐨勩�戣亰澶╁璇�
+  deleteChatConversationMy: async (id: string) => {
+    return await request.delete({ url: `/ai/chat/conversation/delete-my?id=${id}` })
+  },
+
+  // 鍒犻櫎銆愭垜鐨勩�戞墍鏈夊璇濓紝缃《闄ゅ
+  deleteChatConversationMyByUnpinned: async () => {
+    return await request.delete({ url: `/ai/chat/conversation/delete-by-unpinned` })
+  },
+
+  // 鑾峰緱銆愭垜鐨勩�戣亰澶╁璇濆垪琛�
+  getChatConversationMyList: async () => {
+    return await request.get({ url: `/ai/chat/conversation/my-list` })
+  },
+
+  // 鑾峰緱瀵硅瘽鍒嗛〉
+  getChatConversationPage: async (params: any) => {
+    return await request.get({ url: `/ai/chat/conversation/page`, params })
+  },
+
+  // 绠$悊鍛樺垹闄ゆ秷鎭�
+  deleteChatConversationByAdmin: async (id: number) => {
+    return await request.delete({ url: `/ai/chat/conversation/delete-by-admin?id=${id}` })
+  }
+}

--
Gitblit v1.8.0