feat: 双端题库统一与 PDP/DISC 结果文案、测评 API 与企测上下文

1、修复了测评/结果页与个人中心展示不一致问题;废弃独立 questions.js,统一使用 questionBank;结果格式与详情解析相关问题。

2、新增了 PdpDiscResultText(PDP+DISC 双类型摘要文案)、抖音 questionBank 与 enterpriseContext;扩展 api/Test 与路由、管理端 Order 与 ExtractsTestResults。

3、优化了 resultFormat 与 questionBank 组织方式、UserDetailDialog;移除不再使用的 mbti_test_results 恢复 SQL/脚本。

Made-with: Cursor
This commit is contained in:
Ghost
2026-03-31 15:26:21 +08:00
parent 3fdf9b6ed2
commit e672ad4ede
48 changed files with 1455 additions and 627 deletions

View File

@@ -1,38 +0,0 @@
# -*- coding: utf-8 -*-
"""Generate restore_mbti_test_results_1_145.sql from api/mbti_data.sql."""
import pathlib
ROOT = pathlib.Path(__file__).resolve().parents[2]
src = ROOT / "mbti_data.sql"
out = pathlib.Path(__file__).resolve().parent / "restore_mbti_test_results_1_145.sql"
lines = src.read_text(encoding="utf-8").splitlines()
starts = None
ends = None
for i, L in enumerate(lines):
if starts is None and L.startswith("INSERT INTO `mbti_test_results`") and "VALUES (1," in L:
starts = i
if L.startswith("INSERT INTO `mbti_test_results`") and "VALUES (145," in L:
ends = i + 1
break
if starts is None or ends is None:
raise SystemExit(f"range not found: starts={starts} ends={ends}")
chunk = lines[starts:ends]
head = """-- 恢复 mbti_test_results 表 id 1145与 api/mbti_data.sql 中导出一致)
-- 用法mysql -u... -p... 数据库名 < restore_mbti_test_results_1_145.sql
-- REPLACE 会按主键删除旧行再插入,执行前请备份。
SET NAMES utf8mb4 COLLATE utf8mb4_unicode_ci;
SET FOREIGN_KEY_CHECKS = 0;
START TRANSACTION;
"""
body = "\n".join(L.replace("INSERT INTO", "REPLACE INTO", 1) for L in chunk)
tail = """
COMMIT;
SET FOREIGN_KEY_CHECKS = 1;
"""
out.write_text(head + body + tail, encoding="utf-8")
print("wrote", out, "statements", len(chunk))

File diff suppressed because one or more lines are too long