Publish updated WeChat Radar

This commit is contained in:
joeseesun
2026-05-26 09:10:04 +08:00
parent 8abb29e13e
commit de7ec99fed
44 changed files with 2900 additions and 746 deletions
+24
View File
@@ -0,0 +1,24 @@
import { NextRequest, NextResponse } from 'next/server';
import { backfillMessageLinks } from '@/lib/message-links';
export const dynamic = 'force-dynamic';
export const maxDuration = 300;
const DATE_RE = /^\d{4}-\d{2}-\d{2}$/;
export async function POST(req: NextRequest) {
const body = (await req.json().catch(() => ({}))) as {
since?: string;
until?: string;
};
if (body.since && !DATE_RE.test(body.since)) {
return NextResponse.json({ ok: false, error: 'invalid since' }, { status: 400 });
}
if (body.until && !DATE_RE.test(body.until)) {
return NextResponse.json({ ok: false, error: 'invalid until' }, { status: 400 });
}
const result = backfillMessageLinks(body.since, body.until);
return NextResponse.json({ ok: true, ...result });
}