Files
Yi.Admin/Yi.Ai.Vue3/src/api/chat/index.ts

17 lines
562 B
TypeScript
Raw Normal View History

2025-06-17 22:37:37 +08:00
import type { ChatMessageVo, GetChatListParams, SendDTO } from './types';
import { get, post } from '@/utils/request';
// 发送消息
2025-06-22 19:09:13 +08:00
export const send = (data: SendDTO) => post<null>('/ai-chat/send', data);
2025-06-17 22:37:37 +08:00
// 新增对应会话聊天记录
export function addChat(data: ChatMessageVo) {
2025-06-28 23:07:32 +08:00
return post('/system/message', data).json();
2025-06-17 22:37:37 +08:00
}
// 获取当前会话的聊天记录
export function getChatList(params: GetChatListParams) {
2025-06-21 22:12:21 +08:00
// return get<ChatMessageVo[]>('/system/message/list', params);
2025-06-28 23:07:32 +08:00
return get<ChatMessageVo[]>('/message', params).json();
2025-06-17 22:37:37 +08:00
}