Class ShiftRestEndpoint

java.lang.Object
org.cswteams.ms3.rest.ShiftRestEndpoint

@RestController @RequestMapping("/shifts/") public class ShiftRestEndpoint extends Object
REST endpoint for api/shifts
  • 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