19 lines
712 B
TypeScript
19 lines
712 B
TypeScript
import { NextRequest, NextResponse } from 'next/server';
|
|
import { prisma } from '@/lib/prisma';
|
|
import type { FeedItem, FeedResponse } from '@/app/types/feed';
|
|
import { getFileUrl } from '@/lib/minio';
|
|
import { transcriptAweme } from '.';
|
|
|
|
// Contract
|
|
// Inputs: search params { before?: ISOString, limit?: number }
|
|
// Output: { items: FeedItem[], nextCursor: ISOString | null }
|
|
|
|
export async function GET(req: NextRequest) {
|
|
const { searchParams } = new URL(req.url)
|
|
const awemeId = searchParams.get('awemeId');
|
|
if (!awemeId) {
|
|
return NextResponse.json({ error: "Missing awemeId parameter" }, { status: 400 });
|
|
}
|
|
const script = await transcriptAweme(awemeId);
|
|
return NextResponse.json(script);
|
|
} |