feat: 项目初始化

This commit is contained in:
2026-05-22 00:50:13 +08:00
commit 397ccdca13
17 changed files with 11107 additions and 0 deletions
+6
View File
@@ -0,0 +1,6 @@
export default defineEventHandler(async () => {
return prisma.user.findMany({
include: { posts: true },
orderBy: { id: "desc" },
});
});
+10
View File
@@ -0,0 +1,10 @@
export default defineEventHandler(async (event) => {
const body = await readBody<{ email: string; name?: string | null }>(event);
return prisma.user.create({
data: {
email: body.email,
name: body.name,
},
});
});