mirror of
https://github.com/cfngc4594/monaco-editor-lsp-next.git
synced 2025-05-18 15:26:36 +00:00
feat: change prototype seed.ts and run-code.tsx
This commit is contained in:
parent
16ec2d3730
commit
614552bfc6
@ -51,6 +51,28 @@ const editorLanguageConfigData: Prisma.EditorLanguageConfigCreateInput[] = [
|
||||
},
|
||||
];
|
||||
|
||||
const testcaseDataConfigData = [
|
||||
{
|
||||
label: "l1",
|
||||
value: "[2,4,3]",
|
||||
index: 0,
|
||||
config: {
|
||||
type: "STRING",
|
||||
pattern: "^\\[(\\d+,)*\\d+\\]$",
|
||||
},
|
||||
},
|
||||
{
|
||||
label: "l2",
|
||||
value: "[5,6,4]",
|
||||
index: 1,
|
||||
config: {
|
||||
type: "STRING",
|
||||
pattern: "^\\[(\\d+,)*\\d+\\]$",
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
const userData: Prisma.UserCreateInput[] = [
|
||||
{
|
||||
name: "cfngc4594",
|
||||
@ -1100,6 +1122,25 @@ export async function main() {
|
||||
for (const u of userData) {
|
||||
await prisma.user.create({ data: u });
|
||||
}
|
||||
|
||||
// 插入 TestcaseData 和其配置
|
||||
for (const item of testcaseDataConfigData) {
|
||||
const testcaseData = await prisma.testcaseData.create({
|
||||
data: {
|
||||
label: item.label,
|
||||
value: item.value,
|
||||
index: item.index,
|
||||
},
|
||||
});
|
||||
|
||||
await prisma.testcaseDataConfig.create({
|
||||
data: {
|
||||
testcaseDataId: testcaseData.id,
|
||||
type: item.config.type,
|
||||
pattern: item.config.pattern,
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
main();
|
||||
main();
|
@ -9,7 +9,7 @@ import {
|
||||
import { cn } from "@/lib/utils";
|
||||
import { useState } from "react";
|
||||
import { Session } from "next-auth";
|
||||
import { judge } from "@/actions/judge";
|
||||
import { judge } from "@/actions/randomjudge";
|
||||
import { useTranslations } from "next-intl";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { useProblem } from "@/hooks/use-problem";
|
||||
|
Loading…
Reference in New Issue
Block a user