From 445a7242568e282fc79c777bd0416ebdcccdb367 Mon Sep 17 00:00:00 2001 From: jcardus Date: Tue, 13 Jul 2021 01:25:20 +0100 Subject: order methods --- .../traccar/api/resource/PermissionsResource.java | 32 +++++++++++----------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/main/java/org/traccar/api/resource/PermissionsResource.java b/src/main/java/org/traccar/api/resource/PermissionsResource.java index 50ae11aaf..54d3964b6 100644 --- a/src/main/java/org/traccar/api/resource/PermissionsResource.java +++ b/src/main/java/org/traccar/api/resource/PermissionsResource.java @@ -59,9 +59,14 @@ public class PermissionsResource extends BaseResource { permission.getPropertyClass(), getUserId(), permission.getPropertyId()); } - @POST - public Response add(LinkedHashMap entity) throws SQLException, ClassNotFoundException { - return add(Collections.singletonList(entity)); + private void checkPermissionTypes(List> entities) { + Set keys = null; + for (LinkedHashMap entity: entities) { + if (keys != null & !entity.keySet().equals(keys)) { + throw new WebApplicationException(Response.status(Response.Status.BAD_REQUEST).build()); + } + keys = entity.keySet(); + } } @Path("bulk") @@ -83,19 +88,9 @@ public class PermissionsResource extends BaseResource { return Response.noContent().build(); } - private void checkPermissionTypes(List> entities) { - Set keys = null; - for (LinkedHashMap entity: entities) { - if (keys != null & !entity.keySet().equals(keys)) { - throw new WebApplicationException(Response.status(Response.Status.BAD_REQUEST).build()); - } - keys = entity.keySet(); - } - } - - @DELETE - public Response remove(LinkedHashMap entity) throws SQLException, ClassNotFoundException { - return remove(Collections.singletonList(entity)); + @POST + public Response add(LinkedHashMap entity) throws SQLException, ClassNotFoundException { + return add(Collections.singletonList(entity)); } @DELETE @@ -117,4 +112,9 @@ public class PermissionsResource extends BaseResource { return Response.noContent().build(); } + @DELETE + public Response remove(LinkedHashMap entity) throws SQLException, ClassNotFoundException { + return remove(Collections.singletonList(entity)); + } + } -- cgit v1.2.3