chore(题单): 删掉客户端自报进度的 PUT /problem-set-progress
Some checks failed
Deploy / deploy (push) Has been cancelled
Some checks failed
Deploy / deploy (push) Has been cancelled
这个端点是「AC 之后前端回调一下,把进度写进题单」那套设计的残留,早就被服务端记账 取代了 —— SubmitCode.vue 里留着当时的说明:客户端那条路只认路由参数里的那一个题单 (从普通题库入口做出同一道题不计进度),网络一抖、页面提前关掉进度就静默丢失; 现在判完之后由 judge/run.ts → services/problemset.ts 的 recordSolvedProblem 记账, 而且记进所有已加入且包含这道题的题单。 上一个提交删掉前端最后一个调用方 updateProblemSetProgress 之后,它就彻底没人打了。 留着的代价不只是死代码:那是一条**学生可以自己写进度**的写入口。 删之前逐个核过: - 前端零引用(唯一的 wrapper 已在上个提交删掉); - recomputeProgress 还有 POST 那条在用,保留;computeProgress / eligibleForBadge / updateAchievementsForProblemSet / publishAchievementNotification 在别处都有调用方; - 它往 problemset_submission 写的那一笔,services/problemset.ts:260 做的是一模一样的 去重后插入,不会因此少写。 顺带清掉因此变成孤儿的四个 import 和契约里的 updateProblemSetProgressRequestSchema 与 UpdateProblemSetProgressRequest。 ## 验证 起服务实跑: - PUT /api/problem-set-progress 现在 404; - 保留的 POST(加入题单)仍然 201,progress 行照常由 recomputeProgress 建出来; - 服务端那条替代路径端到端跑通:新建题单 → 加入题目 1004 → 学生加入 → 交一发 AC, 判完后 problemset_progress 自动变成 completed=1/total=1/100%/得分 10, problemset_submission 也落了一行 —— 全程没有任何客户端回调。 tsc、check:routes、vue-tsc、单二进制编译均通过;测试题单已清理。 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012j1vgeDqay8wKCh8dPgPcH
This commit is contained in:
@@ -71,11 +71,6 @@ export const joinProblemSetRequestSchema = z.object({
|
||||
problemSetId: z.number().int().positive(),
|
||||
})
|
||||
|
||||
export const updateProblemSetProgressRequestSchema = z.object({
|
||||
problemSetId: z.number().int().positive(),
|
||||
problemId: z.number().int().positive(),
|
||||
submissionId: z.string().min(1),
|
||||
})
|
||||
|
||||
export const completedProblemSchema = z.object({
|
||||
id: z.number().int(),
|
||||
@@ -125,4 +120,3 @@ export type CompletedProblem = z.infer<typeof completedProblemSchema>
|
||||
|
||||
export type ProblemSetUserProgressSummary = z.infer<typeof problemSetUserProgressSummarySchema>
|
||||
export type JoinProblemSetRequest = z.infer<typeof joinProblemSetRequestSchema>
|
||||
export type UpdateProblemSetProgressRequest = z.infer<typeof updateProblemSetProgressRequestSchema>
|
||||
|
||||
Reference in New Issue
Block a user