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:
2026-08-07 06:48:20 -06:00
parent 6c18c57e7a
commit 44f6f27841
4 changed files with 0 additions and 64 deletions

View File

@@ -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({

View File

@@ -1,31 +0,0 @@
<script setup lang="ts">
import type { ProblemSummary } from "@oj2/contract"
import { onMounted, ref } from "vue"
const problems = ref<ProblemSummary[]>([])
const error = ref("")
onMounted(async () => {
try {
const response = await fetch("/api2/problems")
const body = await response.json()
problems.value = body.data
} catch (cause) {
error.value = String(cause)
}
})
</script>
<template>
<div style="padding: 24px">
<h2>阶段 1 链路验证临时页阶段 3 删除</h2>
<p v-if="error" style="color: red">{{ error }}</p>
<p> {{ problems.length }} 道题</p>
<ul>
<li v-for="problem in problems" :key="problem.id">
{{ problem._id }} {{ problem.title }}{{ problem.difficulty }}通过
{{ problem.acceptedNumber }}/{{ problem.submissionNumber }}
</li>
</ul>
</div>
</template>

View File

@@ -5,7 +5,6 @@ export const ojs: RouteRecordRaw = {
component: () => import("shared/layout/default.vue"),
children: [
{ path: "", component: () => import("oj/problem/list.vue") },
{ path: "dev-problems", component: () => import("oj/dev-problems.vue") },
{
path: "problem/:problemID",
component: () => import("oj/problem/detail.vue"),