feat(阶段1): monorepo 骨架与 @oj2/contract 契约包
This commit is contained in:
1
packages/contract/src/index.ts
Normal file
1
packages/contract/src/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export * from "./problem"
|
||||
13
packages/contract/src/problem.ts
Normal file
13
packages/contract/src/problem.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { z } from "zod"
|
||||
|
||||
/** 题目列表项。字段取自 problem 表,只含列表页需要的列。 */
|
||||
export const problemSummarySchema = z.object({
|
||||
id: z.number().int(),
|
||||
_id: z.string(), // 展示用编号,与自增 id 不同
|
||||
title: z.string(),
|
||||
difficulty: z.string(),
|
||||
submissionNumber: z.number().int(),
|
||||
acceptedNumber: z.number().int(),
|
||||
})
|
||||
|
||||
export type ProblemSummary = z.infer<typeof problemSummarySchema>
|
||||
Reference in New Issue
Block a user