feat: 完成对接接口
This commit is contained in:
@@ -2,7 +2,7 @@ import type { ChatMessageVo, GetChatListParams, SendDTO } from './types';
|
||||
import { get, post } from '@/utils/request';
|
||||
|
||||
// 发送消息
|
||||
export const send = (data: SendDTO) => post<null>('/prod-api/ai-chat/send', data);
|
||||
export const send = (data: SendDTO) => post<null>('/ai-chat/send', data);
|
||||
// export const send = (data: SendDTO) => post<null>('/chat/send', data);
|
||||
|
||||
// 新增对应会话聊天记录
|
||||
@@ -13,5 +13,5 @@ export function addChat(data: ChatMessageVo) {
|
||||
// 获取当前会话的聊天记录
|
||||
export function getChatList(params: GetChatListParams) {
|
||||
// return get<ChatMessageVo[]>('/system/message/list', params);
|
||||
return get<ChatMessageVo[]>('/prod-api/message', params);
|
||||
return get<ChatMessageVo[]>('/message', params);
|
||||
}
|
||||
|
||||
@@ -4,5 +4,5 @@ import { get } from '@/utils/request';
|
||||
// 获取当前用户的模型列表
|
||||
export function getModelList() {
|
||||
// return get<GetSessionListVO[]>('/system/model/modelList');
|
||||
return get<GetSessionListVO[]>('/prod-api/ai-chat/model');
|
||||
return get<GetSessionListVO[]>('/ai-chat/model');
|
||||
}
|
||||
|
||||
@@ -9,21 +9,21 @@ import { del, get, post, put } from '@/utils/request';
|
||||
// 获取会话列表
|
||||
export function get_session_list(params: GetSessionListParams) {
|
||||
// return get<ChatSessionVo[]>('/system/session/list', params);
|
||||
return get<ChatSessionVo[]>('/prod-api/session', params);
|
||||
return get<ChatSessionVo[]>('/session', params);
|
||||
}
|
||||
// 创建会话
|
||||
export function create_session(data: CreateSessionDTO) {
|
||||
return post('/prod-api/session', data);
|
||||
return post('/session', data);
|
||||
}
|
||||
// 更新会话
|
||||
export function update_session(data: ChatSessionVo) {
|
||||
return put('/prod-api/session', data);
|
||||
return put(`/session/${data.id}`, data);
|
||||
}
|
||||
// 会话详情
|
||||
export function get_session(id: string) {
|
||||
return get<ChatSessionVo>(`/prod-api/session/${id}`);
|
||||
return get<ChatSessionVo>(`/session/${id}`);
|
||||
}
|
||||
// 删除会话
|
||||
export function delete_session(ids: string[]) {
|
||||
return del(`/prod-api/session/${ids}`);
|
||||
return del(`/session/${ids[0]}`);
|
||||
}
|
||||
|
||||
@@ -28,11 +28,11 @@ export interface GetSessionListParams {
|
||||
/**
|
||||
* 当前页数
|
||||
*/
|
||||
pageNum?: number;
|
||||
skipCount?: number;
|
||||
/**
|
||||
* 分页大小
|
||||
*/
|
||||
pageSize?: number;
|
||||
maxResultCount?: number;
|
||||
/**
|
||||
* 请求参数
|
||||
*/
|
||||
|
||||
@@ -2,5 +2,5 @@ import { get } from '@/utils/request';
|
||||
|
||||
// 获取用户信息
|
||||
export function getUserInfo() {
|
||||
return get<any>('/prod-api/ai-chat/account');
|
||||
return get<any>('/ai-chat/account');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user