Initial 智念AIGC platform

This commit is contained in:
inman committed 2026-05-29 10:26:02 +08:00
commit f9c3393f84
86 files changed
+14741

No files matched your search

+25
View File
@@ -0,0 +1,25 @@
import { listGenerationJobs } from "@/lib/server/data-store";
import { jsonError, jsonOk, readJsonBody } from "@/lib/server/api";
import { requestOrigin } from "@/lib/server/runtime";
import { submitVideoJob, type SubmitVideoJobInput } from "@/lib/server/video-generation-service";
export const runtime = "nodejs";
export async function GET() {
try {
const jobs = (await listGenerationJobs()).filter((job) => job.capability === "video.generate");
return jsonOk({ jobs });
} catch (error) {
return jsonError(error, 500);
}
}
export async function POST(request: Request) {
try {
const body = await readJsonBody<SubmitVideoJobInput & Record<string, unknown>>(request);
const job = await submitVideoJob(body, requestOrigin(request));
return jsonOk({ job }, { status: 202 });
} catch (error) {
return jsonError(error);
}
}