feat: 对话中消息编辑与重新生成与删除功能

This commit is contained in:
Gsh
2026-01-31 17:39:23 +08:00
parent 4441244575
commit ec382995b4
9 changed files with 943 additions and 102 deletions

View File

@@ -1,5 +1,19 @@
import type { ChatMessageVo, GetChatListParams, SendDTO } from './types';
import { get, post } from '@/utils/request';
import { del, get, post } from '@/utils/request';
// 删除消息接口
export interface DeleteMessageParams {
ids: (number | string)[];
isDeleteSubsequent?: boolean;
}
export function deleteMessages(data: DeleteMessageParams) {
const idsQuery = data.ids.map(id => `ids=${encodeURIComponent(id)}`).join('&');
const subsequentQuery = data.isDeleteSubsequent !== undefined ? `isDeleteSubsequent=${data.isDeleteSubsequent}` : '';
const query = [idsQuery, subsequentQuery].filter(Boolean).join('&');
const url = `/message${query ? `?${query}` : ''}`;
return del<void>(url).json();
}
// 发送消息(旧接口)
export function send(data: SendDTO) {

View File

@@ -125,7 +125,7 @@ export interface GetChatListParams {
/**
* 主键
*/
id?: number;
id?: number | string;
/**
* 排序的方向desc或者asc
*/
@@ -195,7 +195,7 @@ export interface ChatMessageVo {
/**
* 主键
*/
id?: number;
id?: number | string;
/**
* 模型名称
*/