From 11ce542b5dcfc8fdf329229f1ef9f5e4e9a48fa3 Mon Sep 17 00:00:00 2001 From: Json_Lee <2622336659@qq.com> Date: Mon, 5 May 2025 23:08:18 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=B0=83=E7=94=A8=E4=BC=9A=E8=AF=9D?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/index.ts | 1 + src/api/session/index.ts | 14 ++++ src/api/session/types.ts | 138 +++++++++++++++++++++++++++++++++++++++ src/layout/index.vue | 94 ++++++++++++++------------ src/pages/chat/index.vue | 28 +++++++- src/utils/request.ts | 12 +++- 6 files changed, 240 insertions(+), 47 deletions(-) create mode 100644 src/api/session/index.ts create mode 100644 src/api/session/types.ts diff --git a/src/api/index.ts b/src/api/index.ts index 269586e..62e8022 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -1 +1,2 @@ export * from './auth'; +export * from './session'; diff --git a/src/api/session/index.ts b/src/api/session/index.ts new file mode 100644 index 0000000..bac8dc1 --- /dev/null +++ b/src/api/session/index.ts @@ -0,0 +1,14 @@ +import type { + ChatSessionVo, + CreateSessionDTO, + GetSessionListParams, +} from './types'; +import { get, post } from '@/utils/request'; + +export function getSessionList(params: GetSessionListParams) { + return get('/system/session/list', params); +} + +export function createSession(data: CreateSessionDTO) { + return post('/system/session', data); +} diff --git a/src/api/session/types.ts b/src/api/session/types.ts new file mode 100644 index 0000000..92e8b25 --- /dev/null +++ b/src/api/session/types.ts @@ -0,0 +1,138 @@ +export interface GetSessionListParams { + /** + * 创建者 + */ + createBy?: number; + /** + * 创建部门 + */ + createDept?: number; + /** + * 创建时间 + */ + createTime?: Date; + /** + * 主键 + */ + id?: number; + /** + * 排序的方向desc或者asc + */ + isAsc?: string; + /** + * 排序列 + */ + orderByColumn?: string; + /** + * 当前页数 + */ + pageNum?: number; + /** + * 分页大小 + */ + pageSize?: number; + /** + * 请求参数 + */ + params?: { [key: string]: { [key: string]: any } }; + /** + * 备注 + */ + remark?: string; + /** + * 会话内容 + */ + sessionContent?: string; + /** + * 会话标题 + */ + sessionTitle?: string; + /** + * 更新者 + */ + updateBy?: number; + /** + * 更新时间 + */ + updateTime?: Date; + /** + * 用户id + */ + userId: number; +} + +/** + * ChatSessionVo,会话管理视图对象 chat_session + */ +export interface ChatSessionVo { + /** + * 主键 + */ + id?: number; + /** + * 备注 + */ + remark?: string; + /** + * 会话内容 + */ + sessionContent?: string; + /** + * 会话标题 + */ + sessionTitle?: string; + /** + * 用户id + */ + userId?: number; +} + +/** + * ChatSessionBo,会话管理业务对象 chat_session + */ +export interface CreateSessionDTO { + /** + * 创建者 + */ + createBy?: number; + /** + * 创建部门 + */ + createDept?: number; + /** + * 创建时间 + */ + createTime?: Date; + /** + * 主键 + */ + id?: number; + /** + * 请求参数 + */ + params?: { [key: string]: { [key: string]: any } }; + /** + * 备注 + */ + remark: string; + /** + * 会话内容 + */ + sessionContent: string; + /** + * 会话标题 + */ + sessionTitle: string; + /** + * 更新者 + */ + updateBy?: number; + /** + * 更新时间 + */ + updateTime?: Date; + /** + * 用户id + */ + userId: number; +} diff --git a/src/layout/index.vue b/src/layout/index.vue index 8e26351..11111f6 100644 --- a/src/layout/index.vue +++ b/src/layout/index.vue @@ -1,66 +1,76 @@