Commit fad1040f249a74e2be3d4fcf63b6def20736230f
Committed by
Andrew Shvayka
1 parent
a100d07d
Refactoring: offset added to request URL
Showing
1 changed file
with
6 additions
and
2 deletions
... | ... | @@ -127,6 +127,7 @@ import java.util.HashMap; |
127 | 127 | import java.util.List; |
128 | 128 | import java.util.Map; |
129 | 129 | import java.util.Optional; |
130 | +import java.util.UUID; | |
130 | 131 | import java.util.concurrent.ConcurrentHashMap; |
131 | 132 | import java.util.concurrent.ExecutorService; |
132 | 133 | import java.util.concurrent.Executors; |
... | ... | @@ -305,7 +306,7 @@ public class RestClient implements ClientHttpRequestInterceptor, Closeable { |
305 | 306 | restTemplate.postForLocation(baseURL + "/api/alarm/{alarmId}/clear", null, alarmId.getId()); |
306 | 307 | } |
307 | 308 | |
308 | - public PageData<AlarmInfo> getAlarms(EntityId entityId, AlarmSearchStatus searchStatus, AlarmStatus status, TimePageLink pageLink, String offset, Boolean fetchOriginator) { | |
309 | + public PageData<AlarmInfo> getAlarms(EntityId entityId, AlarmSearchStatus searchStatus, AlarmStatus status, TimePageLink pageLink, UUID offset, Boolean fetchOriginator) { | |
309 | 310 | String urlSecondPart = "/api/alarm/{entityType}/{entityId}?fetchOriginator={fetchOriginator}&"; |
310 | 311 | Map<String, String> params = new HashMap<>(); |
311 | 312 | params.put("entityType", entityId.getEntityType().name()); |
... | ... | @@ -319,7 +320,10 @@ public class RestClient implements ClientHttpRequestInterceptor, Closeable { |
319 | 320 | urlSecondPart += "status={status}&"; |
320 | 321 | } |
321 | 322 | params.put("fetchOriginator", String.valueOf(fetchOriginator)); |
322 | - params.put("offset", offset); | |
323 | + if(offset != null) { | |
324 | + params.put("offset", offset.toString()); | |
325 | + urlSecondPart += "offset={offset}&"; | |
326 | + } | |
323 | 327 | addTimePageLinkToParam(params, pageLink); |
324 | 328 | |
325 | 329 | return restTemplate.exchange( | ... | ... |