增加翻译缓存

This commit is contained in:
2026-01-06 19:11:21 +08:00
parent 06e90687f1
commit 504ecd259d
18 changed files with 556 additions and 246 deletions

View File

@@ -1,5 +1,5 @@
import prisma from "@/lib/db";
import { UserCreateInput } from "../../../../generated/prisma/models";
import { randomUUID } from "crypto";
export async function createUserIfNotExists(email: string, name?: string | null) {
const user = await prisma.user.upsert({
@@ -8,9 +8,10 @@ export async function createUserIfNotExists(email: string, name?: string | null)
},
update: {},
create: {
id: randomUUID(),
email: email,
name: name || "New User",
} as UserCreateInput,
},
});
return user;
}