| 123456789101112131415161718192021222324 |
- /**
- * Copyright (c) 2013-Now https://jeesite.com All rights reserved.
- * No deletion without permission, or be held responsible to law.
- * @author ThinkGem
- */
- import { defHttp } from '@jeesite/core/utils/http/axios';
- import { useGlobSetting } from '@jeesite/core/hooks/setting';
- import { Conversation, Message } from './dto';
- const { adminPath } = useGlobSetting();
- export const saveConversation = (data: Conversation) =>
- defHttp.postJson<void>({ url: adminPath + '/ai/session', data });
- export const getAllConversations = () => defHttp.get<Conversation[]>({ url: adminPath + '/ai/list' });
- export const getMessagesByConversation = (params?: string) =>
- defHttp.get<Message[]>({ url: adminPath + '/ai/getMessagesByConversation', params: { id: params } });
- export const editConversation = (data: Conversation) =>
- defHttp.postJson<void>({ url: adminPath + '/ai/editConversation', data });
- export const deleteConversation = (id: string) =>
- defHttp.get<void>({ url: adminPath + '/ai/deleteConversation', params: { id } });
|