feat: P3b 会话重命名 (PATCH + 双击编辑)

This commit is contained in:
yuzhiran-dev
2026-05-18 12:08:32 +08:00
parent 4de042abcd
commit ed003d0ef0
4 changed files with 43 additions and 4 deletions
@@ -126,6 +126,15 @@ export class SandboxService {
return { success: true };
}
async renameSession(userId: number, id: number, title: string) {
const session = await this.prisma.sandboxSession.findFirst({
where: { id, userId },
});
if (!session) throw new HttpException('会话不存在', HttpStatus.NOT_FOUND);
await this.prisma.sandboxSession.update({ where: { id }, data: { title } });
return { success: true };
}
async getHistory(userId: number, params: { page?: number; pageSize?: number }) {
const page = Number(params.page ?? 1);
const pageSize = Number(params.pageSize ?? 20);