diff options
author | Abyss777 <abyss@fox5.ru> | 2016-10-22 17:33:12 +0500 |
---|---|---|
committer | Abyss777 <abyss@fox5.ru> | 2016-10-22 17:33:12 +0500 |
commit | 9eea2f26f64a3026f61f9deb13d1deac00cddcd6 (patch) | |
tree | 65676a07739153907fb4f4d42d4855e3a373c459 /src/org/traccar/api | |
parent | c7b678d8b9fa60849b8ff8cc480c60f2039c9598 (diff) | |
download | trackermap-server-9eea2f26f64a3026f61f9deb13d1deac00cddcd6.tar.gz trackermap-server-9eea2f26f64a3026f61f9deb13d1deac00cddcd6.tar.bz2 trackermap-server-9eea2f26f64a3026f61f9deb13d1deac00cddcd6.zip |
Implement reset total distance API
Diffstat (limited to 'src/org/traccar/api')
-rw-r--r-- | src/org/traccar/api/resource/DeviceResource.java | 9 |
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..449083cb1 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}/totaldistance") + @PUT + public Response updateTotalDistance(@PathParam("id") long id, DeviceTotalDistance entity) throws SQLException { + Context.getPermissionsManager().checkAdmin(getUserId()); + Context.getDeviceManager().resetTotalDistance(entity); + return Response.noContent().build(); + } + } |