#!/bin/bash
# 测试所有统计分析API

API_BASE="http://localhost:8000/api/v1/statistics"
PERIOD="month"

echo "=========================================="
echo "测试统计分析API"
echo "=========================================="
echo ""

echo "1️⃣  测试关键指标..."
curl -s "${API_BASE}/key-metrics?period=${PERIOD}" | python3 -m json.tool | head -20

echo ""
echo "2️⃣  测试成绩分布..."
curl -s "${API_BASE}/score-distribution?period=${PERIOD}" | python3 -m json.tool

echo ""
echo "3️⃣  测试难度分析..."
curl -s "${API_BASE}/difficulty-analysis?period=${PERIOD}" | python3 -m json.tool

echo ""
echo "4️⃣  测试知识点掌握度..."
curl -s "${API_BASE}/knowledge-mastery" | python3 -m json.tool | head -30

echo ""
echo "5️⃣  测试学习时长..."
curl -s "${API_BASE}/study-time?period=${PERIOD}" | python3 -m json.tool | head -30

echo ""
echo "6️⃣  测试详细数据..."
curl -s "${API_BASE}/detail?period=${PERIOD}" | python3 -m json.tool | head -40

echo ""
echo "=========================================="
echo "✅ 测试完成"
echo "=========================================="

