feat(阶段4): SQL 测试点脚本回显

GET admin/problems/:id/sql-scripts

只读磁盘上的 N.sql,不需要 SQL 引擎 —— 同组的 sql-preview / sql-ai-gen 要跑 SQLite
生成展示数据,新后端还没有那条链路,那两个仍指向旧后端。

实测:SQL 题回显两个脚本内容正确;测试点不是 SQL 类型返回 409 并说明;题目不存在 404。

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-07 16:45:15 -06:00
parent cd5dd16f3b
commit 007ae8619b
3 changed files with 33 additions and 4 deletions

View File

@@ -228,9 +228,8 @@ export function previewSQLTestcase(data: {
// 回显已上传的 SQL 测试点脚本内容(按 1.sql, 2.sql... 排序)
export function getSQLTestcaseScripts(problemId: number) {
return http.get<{ name: string; content: string }[]>(
"admin/sql_test_case_scripts",
{ params: { problem_id: problemId } },
return legacyResponse<{ name: string; content: string }[]>(
api2.get(`admin/problems/${problemId}/sql-scripts`),
)
}