feat: ✨ 新增会话管理删除,编辑接口

This commit is contained in:
何嘉悦
2025-05-26 07:42:56 +08:00
parent ebbaca9f35
commit b00380d617
11 changed files with 361 additions and 102 deletions
+11 -3
View File
@@ -4,12 +4,20 @@ import type {
// CreateSessionVO,
GetSessionListParams,
} from './types';
import { get, post } from '@/utils/request';
import { del, get, post, put } from '@/utils/request';
export function getSessionList(params: GetSessionListParams) {
export function get_session_list(params: GetSessionListParams) {
return get<ChatSessionVo[]>('/system/session/list', params);
}
export function createSession(data: CreateSessionDTO) {
export function create_session(data: CreateSessionDTO) {
return post('/system/session', data);
}
export function update_session(data: ChatSessionVo) {
return put('/system/session', data);
}
export function delete_session(ids: string[]) {
return del(`/system/session/${ids}`);
}
+12 -4
View File
@@ -1,3 +1,5 @@
import type { Component } from 'vue';
export interface GetSessionListParams {
/**
* 创建者
@@ -68,7 +70,8 @@ export interface ChatSessionVo {
/**
* 主键
*/
id?: number;
// id?: number
id?: string;
/**
* 备注
*/
@@ -85,6 +88,10 @@ export interface ChatSessionVo {
* 用户id
*/
userId?: number;
/**
* 自定义的消息前缀图标字段
*/
prefixIcon?: Component;
}
/**
@@ -106,7 +113,8 @@ export interface CreateSessionDTO {
/**
* 主键
*/
id?: number;
// id?: number;
id?: string;
/**
* 请求参数
*/
@@ -114,11 +122,11 @@ export interface CreateSessionDTO {
/**
* 备注
*/
remark: string;
remark?: string;
/**
* 会话内容
*/
sessionContent: string;
sessionContent?: string;
/**
* 会话标题
*/