M1: FastAPI 分层后端(judge.engine hydro/judge0 + AI 多厂商) + 前端工作台(真实API/速查表/公式小课堂)
这个提交包含在:
@@ -0,0 +1,18 @@
|
||||
"""LaTeX 速查表 API:AP 数理化生四科常用 LaTeX(数据在 data/latex_sheet.json)。"""
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
from pathlib import Path
|
||||
|
||||
from fastapi import APIRouter, HTTPException
|
||||
|
||||
router = APIRouter(prefix="/latex", tags=["latex"])
|
||||
|
||||
_SHEET_PATH = Path(__file__).resolve().parents[3] / "data" / "latex_sheet.json"
|
||||
|
||||
|
||||
@router.get("/sheet")
|
||||
async def latex_sheet():
|
||||
if not _SHEET_PATH.exists():
|
||||
raise HTTPException(404, "速查表数据缺失")
|
||||
return json.loads(_SHEET_PATH.read_text(encoding="utf-8"))
|
||||
在新工单中引用
屏蔽一个用户