Class DataController
java.lang.Object
fr.sandro642.github.spring.controller.DataController
@RestController
@RequestMapping("/api")
@CrossOrigin(origins="*")
public class DataController
extends Object
DataController is a REST controller that provides endpoints to manage requests and retrieve status and routes.
-
Method Summary
Modifier and TypeMethodDescriptioncreateRequest(String route, String branch) Endpoint to create a new request.static DataControllerGet the singleton instance of DataController.Endpoint to get all requests.Endpoint to get the status of the ConnectLib.updateRequestStatus(Long id, String status) Endpoint to update the status of an existing request.
-
Method Details
-
getInstance
Get the singleton instance of DataController.- Returns:
- the singleton instance
-
getStatus
Endpoint to get the status of the ConnectLib.- Returns:
- a map containing the initialization status and resource type
-
getRoutes
-
getRequests
Endpoint to get all requests.- Returns:
- a list of Request objects
-
getConfig
-
createRequest
Endpoint to create a new request.- Parameters:
route- the route for the requestbranch- the branch for the request- Returns:
- the created Request object
-
updateRequestStatus
Endpoint to update the status of an existing request.- Parameters:
id- the ID of the request to updatestatus- the new status for the request- Returns:
- the updated Request object, or null if not found
-