Class DashboardController

java.lang.Object
com.nicholasalfonso.lato.controller.DashboardController

@RestController @RequestMapping("/api/dashboard") public class DashboardController extends Object
REST controller for dashboard data aggregation. Provides endpoints for retrieving dashboard summaries and statistics for the user.
  • Constructor Details

    • DashboardController

      public DashboardController(DashboardService dashboardService, CurrentUserService currentUserService, AssignmentMapper assignmentMapper)
      Creates the dashboard controller with required services and mappers.
      Parameters:
      dashboardService - service for dashboard data aggregation
      currentUserService - service to resolve the current authenticated user
      assignmentMapper - mapper for assignment response DTOs
  • Method Details

    • handleGetDashboardDataRequest

      @GetMapping public DashboardService.DashboardData handleGetDashboardDataRequest()
      Retrieves aggregated dashboard data for the authenticated user.
      Returns:
      dashboard data including upcoming assignments and course progress
    • handleGetUpcomingAssignmentsRequest

      @GetMapping("/upcoming-assignments") public List<AssignmentResponse> handleGetUpcomingAssignmentsRequest()
      Retrieves upcoming incomplete assignments for the authenticated user.
      Returns:
      list of upcoming assignment responses
    • handleGetStatisticsRequest

      @GetMapping("/statistics") public DashboardService.DashboardStatistics handleGetStatisticsRequest()
      Retrieves overall statistics for the authenticated user.
      Returns:
      dashboard statistics including course and assignment counts