fix: restore rectification agent message actions

This commit is contained in:
Jesse_Chen
2026-07-30 00:41:48 +08:00
parent a5f409a500
commit 0a5b8cd239
15 changed files with 513 additions and 4 deletions
@@ -0,0 +1,22 @@
import { NextResponse } from "next/server";
import { caseActionRequestSchema } from "@/lib/rectification-v4/contracts";
import { rectificationV4Context, rectificationV4Error, requestBody, routeId } from "../../../_server";
export const runtime = "nodejs";
export async function POST(request: Request, { params }: { params: Promise<{ caseId: string }> }) {
try {
const body = await requestBody(request, caseActionRequestSchema);
const context = await rectificationV4Context();
const result = await context.service.regenerateQuestion({
...body,
userId: context.userId,
caseId: routeId((await params).caseId),
});
return result
? NextResponse.json(result)
: NextResponse.json({ error: "当前问题不能重新生成,请刷新后重试。" }, { status: 409 });
} catch (error) {
return rectificationV4Error(error);
}
}