Initial 智念AIGC platform

This commit is contained in:
inman
2026-05-29 10:26:02 +08:00
commit f9c3393f84
86 changed files with 14741 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
import { deleteAsset, getAsset } from "@/lib/server/data-store";
import { jsonError, jsonOk } from "@/lib/server/api";
import { deleteStoredAsset } from "@/lib/server/storage";
export const runtime = "nodejs";
export async function DELETE(_request: Request, context: { params: Promise<{ id: string }> }) {
try {
const { id } = await context.params;
const asset = await getAsset(id);
if (!asset) return jsonError("资产不存在", 404);
await deleteStoredAsset(asset);
await deleteAsset(id);
return jsonOk({ ok: true, deletedAssetId: id });
} catch (error) {
return jsonError(error, 500);
}
}