aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/api
diff options
context:
space:
mode:
authorjcardus <asklocation.net@gmail.com>2021-07-13 01:25:20 +0100
committerjcardus <asklocation.net@gmail.com>2021-07-13 01:25:20 +0100
commit445a7242568e282fc79c777bd0416ebdcccdb367 (patch)
tree0996e251073f85aa8b92c626b1971e117ad61ab5 /src/main/java/org/traccar/api
parentce3a16ef9d235390e839e6c01bc2ccc96049ead6 (diff)
downloadtrackermap-server-445a7242568e282fc79c777bd0416ebdcccdb367.tar.gz
trackermap-server-445a7242568e282fc79c777bd0416ebdcccdb367.tar.bz2
trackermap-server-445a7242568e282fc79c777bd0416ebdcccdb367.zip
order methods
Diffstat (limited to 'src/main/java/org/traccar/api')
-rw-r--r--src/main/java/org/traccar/api/resource/PermissionsResource.java32
1 files 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<String, Long> entity) throws SQLException, ClassNotFoundException {
- return add(Collections.singletonList(entity));
+ private void checkPermissionTypes(List<LinkedHashMap<String, Long>> entities) {
+ Set<String> keys = null;
+ for (LinkedHashMap<String, Long> 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<LinkedHashMap<String, Long>> entities) {
- Set<String> keys = null;
- for (LinkedHashMap<String, Long> 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<String, Long> entity) throws SQLException, ClassNotFoundException {
- return remove(Collections.singletonList(entity));
+ @POST
+ public Response add(LinkedHashMap<String, Long> 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<String, Long> entity) throws SQLException, ClassNotFoundException {
+ return remove(Collections.singletonList(entity));
+ }
+
}