feat: P3b 会话重命名 (PATCH + 双击编辑)
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user