diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2020-08-13 20:38:29 -0700 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2020-08-13 20:38:29 -0700 |
commit | f9a564f5cf8859a92e8b8f18be9c1ad9df60f514 (patch) | |
tree | 3590b2b75e6dfc76fee6b68ff854e210159758c1 /src | |
parent | 6e2af295d0ef6bfa9b033810ce2e16e3122de38a (diff) | |
download | traccar-server-f9a564f5cf8859a92e8b8f18be9c1ad9df60f514.tar.gz traccar-server-f9a564f5cf8859a92e8b8f18be9c1ad9df60f514.tar.bz2 traccar-server-f9a564f5cf8859a92e8b8f18be9c1ad9df60f514.zip |
Option to load server model from db
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/org/traccar/api/resource/ServerResource.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/main/java/org/traccar/api/resource/ServerResource.java b/src/main/java/org/traccar/api/resource/ServerResource.java index e7cad2a0c..91488afff 100644 --- a/src/main/java/org/traccar/api/resource/ServerResource.java +++ b/src/main/java/org/traccar/api/resource/ServerResource.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 - 2017 Anton Tananaev (anton@traccar.org) + * Copyright 2015 - 2020 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. @@ -38,8 +38,12 @@ public class ServerResource extends BaseResource { @PermitAll @GET - public Server get() throws SQLException { - return Context.getPermissionsManager().getServer(); + public Server get(@QueryParam("force") boolean force) throws SQLException { + if (force) { + return Context.getDataManager().getServer(); + } else { + return Context.getPermissionsManager().getServer(); + } } @PUT |