outlook-report-demo.sh 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. #!/usr/bin/env bash
  2. set -euo pipefail
  3. BASE_URL="${BASE_URL:-http://localhost:8080}"
  4. ENDPOINT="${BASE_URL%/}/api/exam-sprint/outlook-reports"
  5. RESPONSE_BODY="$(mktemp)"
  6. cleanup() {
  7. rm -f "$RESPONSE_BODY"
  8. }
  9. trap cleanup EXIT
  10. http_code="$({
  11. curl -sS \
  12. -o "$RESPONSE_BODY" \
  13. -w '%{http_code}' \
  14. -X POST \
  15. -H 'Content-Type: application/json' \
  16. --data-binary @- \
  17. "$ENDPOINT" <<'JSON'
  18. {
  19. "reportMetadata": {
  20. "reportVersionLabel": "2026 词汇展望报告",
  21. "learnerName": "李同学",
  22. "targetExamName": "雅思 6.5",
  23. "sprintPeriodLabel": "2026 春季冲刺",
  24. "authorName": "Ability Bot"
  25. },
  26. "readinessOverview": {
  27. "summary": "词汇能力进入提分窗口,适合围绕考纲和高频场景做集中突破。",
  28. "currentStage": "当前阶段:稳态提升",
  29. "keyInsight": "核心观察:阅读词汇优于写作输出,仍需补齐同义替换。",
  30. "readinessScore": 78
  31. },
  32. "syllabusMasteryChart": {
  33. "totalWordCount": 4200,
  34. "masteredWordCount": 3192,
  35. "unmasteredWordCount": 1008,
  36. "masteryPercent": 76,
  37. "summaryLabel": "考纲词汇掌握概览",
  38. "recommendation": "先补齐教育、科技和环境主题词,再做套题复盘。"
  39. },
  40. "pastPaperVocabularyChart": {
  41. "totalWordCount": 800,
  42. "unknownWordCountBeforeSprint": 180,
  43. "unknownWordCountAfterSprint": 120,
  44. "projectedScoreGainLabel": "预计提分 5-10 分",
  45. "recommendation": "每次精听后补 5 组同义替换并做口头复述。"
  46. },
  47. "highFrequencyVocabularyChart": {
  48. "basicCorePercent": 77,
  49. "highScorePercent": 62,
  50. "highlightLabel": "Common 高频词覆盖较广,但易混词记忆不牢。"
  51. },
  52. "vocabularyFrequencyBandChart": {
  53. "bars": [
  54. {"bandLabel": "2k 高频", "currentValue": 86, "priorityLabel": "优先学习", "themeColor": "#448aff"},
  55. {"bandLabel": "3k 高频", "currentValue": 78, "priorityLabel": "重点突破", "themeColor": "#4caf50"},
  56. {"bandLabel": "学术词", "currentValue": 62, "priorityLabel": "酌情学习", "themeColor": "#ff9800"}
  57. ]
  58. },
  59. "frequencyPlan": {
  60. "cards": [
  61. {"cadencePerWeek": 3, "scoreGainLabel": "+12 分", "winRatePercent": 78, "recommended": true, "badgeLabel": "推荐", "emphasisIcon": "③"},
  62. {"cadencePerWeek": 2, "scoreGainLabel": "+8 分", "winRatePercent": 61, "recommended": false, "badgeLabel": "稳妥", "emphasisIcon": "②"}
  63. ],
  64. "recommendationTitle": "💡建议策略",
  65. "recommendationSummary": "7 天提分冲刺优先保证高频词正确率,再逐步覆盖中频词。",
  66. "phaseSuggestions": [
  67. {"title": "考前半个月·核心突击期", "description": "围绕高频词建立记忆闭环。"},
  68. {"title": "考前一周·强化巩固期", "description": "结合真题错词做循环复盘。"}
  69. ]
  70. },
  71. "scoreImprovementCaseStudy": {
  72. "headline": "教育类阅读题案例",
  73. "learnerName": "李同学",
  74. "studyPeriodLabel": "考前半个月·核心突击期",
  75. "memorizedWordCount": 705,
  76. "examHitWordCount": 237,
  77. "hitRatePercent": 33.6,
  78. "baselineScoreLabel": "70 分以下",
  79. "finalScore": 89,
  80. "scoreGain": 19
  81. }
  82. }
  83. JSON
  84. })"
  85. printf 'HTTP %s\n' "$http_code"
  86. cat "$RESPONSE_BODY"
  87. if [ "$http_code" != "202" ]; then
  88. exit 1
  89. fi