Package org.cswteams.ms3.rest
Class ShiftRestEndpoint
java.lang.Object
org.cswteams.ms3.rest.ShiftRestEndpoint
REST endpoint for api/shifts
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<?> createShift(ShiftDTOIn shift) Creates a shift definition
Reached from POST api/shifts/service={serviceName}org.springframework.http.ResponseEntity<?> Retrieves all shift definitions
Reached from GET api/shiftsorg.springframework.http.ResponseEntity<?> readShiftsByServiceName(String serviceName) Retrieves all shift definitions
Reached from GET api/shifts/service={serviceName}
-
Constructor Details
-
ShiftRestEndpoint
public ShiftRestEndpoint()
-
-
Method Details
-
readAllShifts
@RequestMapping(method=GET) public org.springframework.http.ResponseEntity<?> readAllShifts()Retrieves all shift definitions
Reached from GET api/shifts- Returns:
- A response containing a list of
ShiftDTOOut
-
readShiftsByServiceName
@RequestMapping(method=GET, path="/service={serviceName}") public org.springframework.http.ResponseEntity<?> readShiftsByServiceName(@PathVariable String serviceName) Retrieves all shift definitions
Reached from GET api/shifts/service={serviceName}- Parameters:
serviceName- A string describing the service to use- Returns:
- The shift definitions relative to the specified service
-
createShift
@RequestMapping(method=POST, path="") public org.springframework.http.ResponseEntity<?> createShift(@RequestBody ShiftDTOIn shift) Creates a shift definition
Reached from POST api/shifts/service={serviceName}- Parameters:
shift- A DTO containing all the shift's information, in request body- Returns:
- A response containing a
ShiftDTOOut
-