From 3ffa64648831ceade32fba83047d0e99ff92c990 Mon Sep 17 00:00:00 2001
From: 张涛 <“2538313560@qq.com”>
Date: 星期一, 18 十一月 2024 14:06:00 +0800
Subject: [PATCH] fix:改动

---
 src/api/session.ts |   80 +++++++++++++++++++++++++++++++++++++--
 1 files changed, 75 insertions(+), 5 deletions(-)

diff --git a/src/api/session.ts b/src/api/session.ts
index 0731538..031daf1 100644
--- a/src/api/session.ts
+++ b/src/api/session.ts
@@ -8,13 +8,25 @@
 // 浼氳瘽鍒楄〃
 export function sessionListApi(dialog_id) {
   return axios.get<ISessionListResult>(
-    "/api/conversation/list?modeltype=localragflow&dialogid=" + dialog_id
+    "/api/conversation/list?modeltype=localragflow&dialogid=" + dialog_id,
   );
+}
+// 浼氳瘽鍒楄〃鍒嗛〉
+export function sessionListApiPage(data) {
+  if (data?.searchParam) {
+    return axios.get<ISessionListResult>(
+      `/api/conversation/list?modeltype=localragflow&search=${data.searchParam}&dialogid=&page=${data.page}&per_page=${data.page_size}`
+    );
+  } else {
+    return axios.get<ISessionListResult>(
+      `/api/conversation/list?modeltype=localragflow&dialogid=&page=${data.page}&per_page=${data.page_size}`
+    );
+  }
 }
 // 鍒犻櫎浼氳瘽
 export function deleteSessionApi(conversation_ids: string[]) {
   return axios.post<ISessionListResult>(
-    '/api/conversation/del?modeltype=localragflow',
+    '/api/v1/conversation/rm?modeltype=localragflow',
     { conversation_ids }
   );
 }
@@ -22,7 +34,7 @@
 export function addSessionApi(params: any) {
   return axios.post<ISessionListResult>(
     '/api/v1/conversation/set?platform=localragflow',
-    { params }
+    params
   );
 }
 
@@ -43,7 +55,7 @@
 }
 // 鑾峰彇鏅鸿兘鍔╂墜鍒楄〃
 export function getDialogListApi() {
-  return axios.get<ISessionListResult>('/api/dialog/list');
+  return axios.get<ISessionListResult>('/api/v1/dialog/list');
 }
 
 
@@ -55,4 +67,62 @@
     },
   };
   return axios.post('/api/v1/document/upload_without_kb', params, config);
-}
\ No newline at end of file
+}
+
+
+export function upload_and_parse(params) {
+  const config = {
+    headers: {
+      'Content-Type': 'application/x-www-form-urlencoded',
+      // token: token,
+    },
+  };
+  return axios.post('/api/v1/document/upload_and_parse', params, config);
+}
+
+
+export function getDocumentStatus(doc_ids) {
+  let params = { "doc_ids": doc_ids };
+  return axios.post("/api/v1/document/infos", params);
+}
+
+
+// 鑾峰彇瑙f瀽鏂规硶鍒楄〃
+export function getParseMethodsListApi() {
+  return axios.get<ISessionListResult>('/api/v1/user/parse-methods');
+}
+
+// 涓婁紶v1/document/upload_and_parse
+export function uploadAndParse(params) {
+  const config = {
+    headers: {
+      'Content-Type': 'application/x-www-form-urlencoded',
+      // token: token,
+    },
+  };
+  return axios.post('/api/v1/document/upload_and_parse', params, config);
+}
+//涓婁紶瑙f瀽v1/document/infos
+
+export function chatInfos(data: { doc_ids: Array }) {
+  return axios.post<ISessionListResult>(
+    '/api/v1/document/infos',
+    data
+  );
+}
+
+//涓婁紶鍒犻櫎鏂囨。v1/document/rm
+export function chatRm(data: { doc_id: Array }) {
+  return axios.post<ISessionListResult>(
+    '/api/v1/document/rm',
+    data
+  );
+}
+
+//楂樼骇浼氳瘽
+export function seniorAgentApi(params) {
+  return axios.get<ISessionListResult>(
+    '/api/v1/advanced-agent/list',
+    params
+  );
+}

--
Gitblit v1.8.0