service->getProgress($studentId); if (!$result['success']) { return response()->json($result, 400); } return response()->json($result); } catch (\Exception $e) { return response()->json([ 'success' => false, 'message' => '计算学习进度失败: ' . $e->getMessage() ], 500); } } /** * 批量获取学生学习进度 * POST /api/students/learning-progress/batch */ public function batch(Request $request): JsonResponse { try { $studentIds = $request->input('student_ids', []); $result = $this->service->getBatchProgress($studentIds); if (!$result['success']) { return response()->json($result, 400); } return response()->json($result); } catch (\Exception $e) { return response()->json([ 'success' => false, 'message' => '批量计算学习进度失败: ' . $e->getMessage() ], 500); } } }