feat(project): init

This commit is contained in:
zhangheng
2026-04-25 11:26:33 +08:00
commit 9bf212f67c
63 changed files with 11141 additions and 0 deletions

24
app/api/images/route.ts Normal file
View File

@@ -0,0 +1,24 @@
import { NextResponse, type NextRequest } from "next/server";
import { requireApiUser } from "@/lib/api-auth";
import { listImageHistoryForViewer } from "@/lib/db";
import { jsonError, normalizeError } from "@/lib/http";
export const runtime = "nodejs";
export async function GET(request: NextRequest) {
try {
const viewer = requireApiUser(request);
const items = listImageHistoryForViewer({
viewerId: viewer.id,
viewerRole: viewer.role,
});
return NextResponse.json({
ok: true,
items,
});
} catch (error) {
const normalizedError = normalizeError(error, "读取图片历史失败。");
return jsonError(normalizedError.message, normalizedError.statusCode);
}
}