test(api): ✅ 测试接口,梳理逻辑

This commit is contained in:
何嘉悦
2025-05-29 01:27:35 +08:00
parent 4b39bbb2a5
commit d2275d5932
5 changed files with 86 additions and 42 deletions
+7
View File
@@ -1,8 +1,15 @@
import type { ChatMessageVo, GetChatListParams, SendDTO } from './types';
import { get, post } from '@/utils/request';
// 发送消息
export const send = (data: SendDTO) => post<null>('/chat/send', data).stream();
// 新增对应会话聊天记录
export function addChat(data: ChatMessageVo) {
return post('/system/message', data);
}
// 获取当前会话的聊天记录
export function getChatList(params: GetChatListParams) {
return get<ChatMessageVo[]>('/system/message/list', params);
}
+3 -4
View File
@@ -1,5 +1,3 @@
import type { ModelType } from '@/constants/enums';
/**
* ChatRequest,描述:对话请求对象
*/
@@ -21,7 +19,8 @@ export interface SendDTO {
*/
kid?: string;
messages: Message[];
model: ModelType;
// model: ModelType;
model?: string;
/**
* 提示词
*/
@@ -161,7 +160,7 @@ export interface GetChatListParams {
/**
* 会话id
*/
sessionId?: number;
sessionId?: string;
/**
* 累计 Tokens
*/