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 Summary
ConstructorsConstructorDescriptionIntegrationController(IntegrationService integrationService, SyncService syncService, CurrentUserService currentUserService) Creates the integration controller with required services. -
Method Summary
Modifier and TypeMethodDescriptionRetrieves all integrations for the authenticated user.handleIntegrationCreationRequest(@Valid CreateIntegrationRequest request) Creates a new integration.Deletes an integration.Synchronizes a specific integration with the LMS.handleIntegrationUpdateRequest(Long id, @Valid UpdateIntegrationRequest request) Updates an existing integration.voidSynchronizes all integrations for the authenticated user with their LMS providers.
-
Constructor Details
-
IntegrationController
public IntegrationController(IntegrationService integrationService, SyncService syncService, CurrentUserService currentUserService) Creates the integration controller with required services.- Parameters:
integrationService- service for integration operationssyncService- service for synchronizing LMS datacurrentUserService- service to resolve the current authenticated user
-
-
Method Details
-
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 IDrequest- 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.
-