Class IntegrationController

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

@RestController @RequestMapping("/api/integrations") public class IntegrationController extends Object
REST controller for LMS integration management. Provides endpoints for managing integrations with learning management systems.
  • Constructor Details

    • IntegrationController

      public IntegrationController(IntegrationService integrationService, SyncService syncService, CurrentUserService currentUserService)
      Creates the integration controller with required services.
      Parameters:
      integrationService - service for integration operations
      syncService - service for synchronizing LMS data
      currentUserService - service to resolve the current authenticated user
  • Method Details

    • handleGetAllIntegrationsRequest

      @GetMapping public List<IntegrationResponse> handleGetAllIntegrationsRequest()
      Retrieves all integrations for the authenticated user.
      Returns:
      list of integration responses
    • handleIntegrationCreationRequest

      @PostMapping public IntegrationResponse handleIntegrationCreationRequest(@Valid @RequestBody @Valid CreateIntegrationRequest request)
      Creates a new integration.
      Parameters:
      request - creation details including ICS URL and provider
      Returns:
      created integration response
    • handleIntegrationUpdateRequest

      @PutMapping("/{id}") public IntegrationResponse handleIntegrationUpdateRequest(@PathVariable Long id, @Valid @RequestBody @Valid UpdateIntegrationRequest request)
      Updates an existing integration.
      Parameters:
      id - the integration ID
      request - update details
      Returns:
      updated integration response
    • handleIntegrationDeletionRequest

      @DeleteMapping("/{id}") public MessageResponse handleIntegrationDeletionRequest(@PathVariable Long id)
      Deletes an integration.
      Parameters:
      id - the integration ID
      Returns:
      success message
    • handleIntegrationSyncRequest

      @PostMapping("/{id}/sync") public ImportedResponse handleIntegrationSyncRequest(@PathVariable Long id)
      Synchronizes a specific integration with the LMS.
      Parameters:
      id - the integration ID
      Returns:
      response with imported courses and assignments
    • handleSyncAllIntegrationsRequest

      @PostMapping("/sync-all") public void handleSyncAllIntegrationsRequest()
      Synchronizes all integrations for the authenticated user with their LMS providers.