chore(阶段3): 删除阶段 1 的临时验证物
GET /api/dev/problems、dev-problems.vue、对应路由项,以及只服务于它的 problemSummarySchema。阶段 1 用来验证「能从真实库读出一道题」,已完成使命。 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -3,7 +3,6 @@ import {
|
||||
problemDetailSchema,
|
||||
problemListItemSchema,
|
||||
problemListSchema,
|
||||
problemSummarySchema,
|
||||
tagSchema,
|
||||
yearlyAcSchema,
|
||||
} from "@oj2/contract"
|
||||
@@ -228,25 +227,6 @@ problemRoutes.get("/problems/:displayId/yearly-ac", async (c) => {
|
||||
return success(c, rows.map((row) => yearlyAcSchema.parse({ ...row, acRate: row.total > 0 ? Math.round(row.accepted / row.total * 10_000) / 100 : 0 })))
|
||||
})
|
||||
|
||||
problemRoutes.get("/dev/problems", async (c) => {
|
||||
const rows = await db
|
||||
.select({
|
||||
id: schema.problem.id,
|
||||
_id: schema.problem.displayId,
|
||||
title: schema.problem.title,
|
||||
difficulty: schema.problem.difficulty,
|
||||
submissionNumber: schema.problem.submissionNumber,
|
||||
acceptedNumber: schema.problem.acceptedNumber,
|
||||
})
|
||||
.from(schema.problem)
|
||||
.where(and(eq(schema.problem.visible, true), isNull(schema.problem.contestId)))
|
||||
.orderBy(desc(schema.problem.id))
|
||||
.limit(20)
|
||||
|
||||
const data = rows.map((row) => problemSummarySchema.parse(row))
|
||||
return success(c, data)
|
||||
})
|
||||
|
||||
problemRoutes.get("/problems/:displayId", optionalAuth, async (c) => {
|
||||
const [row] = await db
|
||||
.select({
|
||||
|
||||
Reference in New Issue
Block a user