aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/api/resource/DeviceResource.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-10-23 16:35:14 +1300
committerGitHub <noreply@github.com>2016-10-23 16:35:14 +1300
commit91d94457e0a8eedf9824bb2c1e1bce4864308352 (patch)
tree8d68ea66854c694ed3db1b7da5c1c3b936d60da0 /src/org/traccar/api/resource/DeviceResource.java
parentc7b678d8b9fa60849b8ff8cc480c60f2039c9598 (diff)
parent75a86394ec26725cf9460d336c03a3f55a82d599 (diff)
downloadtrackermap-server-91d94457e0a8eedf9824bb2c1e1bce4864308352.tar.gz
trackermap-server-91d94457e0a8eedf9824bb2c1e1bce4864308352.tar.bz2
trackermap-server-91d94457e0a8eedf9824bb2c1e1bce4864308352.zip
Merge pull request #2470 from Abyss777/reset_distance
Implement reset total distance API
Diffstat (limited to 'src/org/traccar/api/resource/DeviceResource.java')
-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();
+ }
+
}