feat: complete minute birth-time rectification flow

This commit is contained in:
Jesse_Chen
2026-07-25 01:15:48 +08:00
parent f90aba217f
commit 3ca30ed7de
93 changed files with 8347 additions and 1646 deletions
@@ -0,0 +1,23 @@
import { NextResponse } from "next/server";
import { birthLocationSearchQuerySchema } from "@/lib/location-contract";
import { searchGlobalBirthLocations } from "@/lib/geoapify-location-service";
import { createServerSupabaseClient } from "@/lib/supabase/server";
export const runtime = "nodejs";
export async function GET(request: Request) {
const supabase = await createServerSupabaseClient();
const { data: { user }, error: authError } = await supabase.auth.getUser();
if (authError || !user) return NextResponse.json({ error: "请先登录" }, { status: 401 });
const url = new URL(request.url);
const parsed = birthLocationSearchQuerySchema.safeParse(Object.fromEntries(url.searchParams));
if (!parsed.success) return NextResponse.json({
error: "地点搜索参数不正确",
details: parsed.error.flatten(),
}, { status: 400 });
const result = await searchGlobalBirthLocations(parsed.data);
const status = result.status === "ok" ? 200 : 503;
return NextResponse.json(result, { status });
}