aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/api/resource
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/api/resource')
-rw-r--r--src/org/traccar/api/resource/DeviceResource.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/org/traccar/api/resource/DeviceResource.java b/src/org/traccar/api/resource/DeviceResource.java
index 56787b7bb..1f65fa041 100644
--- a/src/org/traccar/api/resource/DeviceResource.java
+++ b/src/org/traccar/api/resource/DeviceResource.java
@@ -18,6 +18,7 @@ package org.traccar.api.resource;
import org.traccar.Context;
import org.traccar.api.BaseResource;
import org.traccar.model.Device;
+import org.traccar.model.DeviceTotalDistance;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
@@ -92,4 +93,12 @@ public class DeviceResource extends BaseResource {
return Response.noContent().build();
}
+ @Path("{id}/distance")
+ @PUT
+ public Response updateTotalDistance(@PathParam("id") long id, DeviceTotalDistance entity) throws SQLException {
+ Context.getPermissionsManager().checkAdmin(getUserId());
+ Context.getDeviceManager().resetTotalDistance(entity);
+ return Response.noContent().build();
+ }
+
}