diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2018-08-23 18:05:35 +1200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-23 18:05:35 +1200 |
commit | cd774cc87bc88f91b8e1c881b745b9d2439db617 (patch) | |
tree | b9b7780bcbccf9c79f1ac610779f8175b69451f0 /src/org/traccar/api/resource/DeviceResource.java | |
parent | 2a386eab0a4baed5c606113dd9a875a088f9f4e5 (diff) | |
parent | e7d5dae5af7214f7f8dac39e8d081ad6c4533d20 (diff) | |
download | trackermap-server-cd774cc87bc88f91b8e1c881b745b9d2439db617.tar.gz trackermap-server-cd774cc87bc88f91b8e1c881b745b9d2439db617.tar.bz2 trackermap-server-cd774cc87bc88f91b8e1c881b745b9d2439db617.zip |
Merge pull request #4019 from Abyss777/device_accumulators
Implement Device Engine Hours reset
Diffstat (limited to 'src/org/traccar/api/resource/DeviceResource.java')
-rw-r--r-- | src/org/traccar/api/resource/DeviceResource.java | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/org/traccar/api/resource/DeviceResource.java b/src/org/traccar/api/resource/DeviceResource.java index 87927e45b..f9c9a139d 100644 --- a/src/org/traccar/api/resource/DeviceResource.java +++ b/src/org/traccar/api/resource/DeviceResource.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 - 2017 Anton Tananaev (anton@traccar.org) + * Copyright 2015 - 2018 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,7 +20,7 @@ import org.traccar.api.BaseObjectResource; import org.traccar.database.DeviceManager; import org.traccar.helper.LogAction; import org.traccar.model.Device; -import org.traccar.model.DeviceTotalDistance; +import org.traccar.model.DeviceAccumulators; import javax.ws.rs.Consumes; import javax.ws.rs.GET; @@ -85,15 +85,15 @@ public class DeviceResource extends BaseObjectResource<Device> { return deviceManager.getItems(result); } - @Path("{id}/distance") + @Path("{id}/accumulators") @PUT - public Response updateTotalDistance(DeviceTotalDistance entity) throws SQLException { + public Response updateAccumulators(DeviceAccumulators entity) throws SQLException { if (!Context.getPermissionsManager().getUserAdmin(getUserId())) { Context.getPermissionsManager().checkManager(getUserId()); Context.getPermissionsManager().checkPermission(Device.class, getUserId(), entity.getDeviceId()); } - Context.getDeviceManager().resetTotalDistance(entity); - LogAction.resetTotalDistance(getUserId(), entity.getDeviceId()); + Context.getDeviceManager().resetDeviceAccumulators(entity); + LogAction.resetDeviceAccumulators(getUserId(), entity.getDeviceId()); return Response.noContent().build(); } |