Class DeviceTelemetryRestController
java.lang.Object
com.endurancetrio.app.tracker.api.DeviceTelemetryRestController
- All Implemented Interfaces:
DeviceTelemetryAPI
@EnduranceTrioRestController
@RequestMapping("/api/tracker/v1")
public class DeviceTelemetryRestController
extends Object
implements DeviceTelemetryAPI
-
Constructor Summary
ConstructorsConstructorDescriptionDeviceTelemetryRestController(DeviceTelemetryService deviceTelemetryService) -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<@NonNull EnduranceTrioResponse<List<DeviceTelemetryDTO>>> Gets the most recent telemetry data record for each device present in the database.org.springframework.http.ResponseEntity<@NonNull EnduranceTrioResponse<DeviceTelemetryDTO>> save(@Valid DeviceTelemetryDTO deviceTelemetryDTO) Saves the provided telemetry data, using the authenticated user as the owner account
-
Constructor Details
-
DeviceTelemetryRestController
-
-
Method Details
-
getMostRecentRecordForEachDevice
@ResponseStatus(OK) @GetMapping(value="/devices", produces="application/json") public org.springframework.http.ResponseEntity<@NonNull EnduranceTrioResponse<List<DeviceTelemetryDTO>>> getMostRecentRecordForEachDevice()Description copied from interface:DeviceTelemetryAPIGets the most recent telemetry data record for each device present in the database.- Specified by:
getMostRecentRecordForEachDevicein interfaceDeviceTelemetryAPI- Returns:
- list of telemetry data records containing the latest record for each device
-
save
@ResponseStatus(CREATED) @PostMapping(value="/devices", consumes="application/json", produces="application/json") public org.springframework.http.ResponseEntity<@NonNull EnduranceTrioResponse<DeviceTelemetryDTO>> save(@Valid @RequestBody @Valid DeviceTelemetryDTO deviceTelemetryDTO) Description copied from interface:DeviceTelemetryAPISaves the provided telemetry data, using the authenticated user as the owner account- Specified by:
savein interfaceDeviceTelemetryAPI- Parameters:
deviceTelemetryDTO- the device telemetry data to be saved- Returns:
- the saved
DeviceTelemetryDTOwrapped in anEnduranceTrioResponse
-