Browse Source
Merge pull request #12164 from dashevchenko/activeTenantDevices
Active tenant devices filter for RestClient
pull/12167/head
Andrew Shvayka
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
6 additions and
2 deletions
-
rest-client/src/main/java/org/thingsboard/rest/client/RestClient.java
|
|
|
@ -1358,13 +1358,17 @@ public class RestClient implements Closeable { |
|
|
|
}, params).getBody(); |
|
|
|
} |
|
|
|
|
|
|
|
public PageData<DeviceInfo> getTenantDeviceInfos(String type, DeviceProfileId deviceProfileId, PageLink pageLink) { |
|
|
|
public PageData<DeviceInfo> getTenantDeviceInfos(String type, Boolean active, DeviceProfileId deviceProfileId, PageLink pageLink) { |
|
|
|
Map<String, String> params = new HashMap<>(); |
|
|
|
params.put("type", type); |
|
|
|
params.put("deviceProfileId", deviceProfileId != null ? deviceProfileId.toString() : null); |
|
|
|
if (active != null) { |
|
|
|
params.put("active", active.toString()); |
|
|
|
} |
|
|
|
addPageLinkToParam(params, pageLink); |
|
|
|
return restTemplate.exchange( |
|
|
|
baseURL + "/api/tenant/deviceInfos?type={type}&deviceProfileId={deviceProfileId}&" + getUrlParams(pageLink), |
|
|
|
baseURL + "/api/tenant/deviceInfos?type={type}&deviceProfileId={deviceProfileId}&" |
|
|
|
+ (active != null ? "active={active}&" : "") + getUrlParams(pageLink), |
|
|
|
HttpMethod.GET, HttpEntity.EMPTY, |
|
|
|
new ParameterizedTypeReference<PageData<DeviceInfo>>() { |
|
|
|
}, params).getBody(); |
|
|
|
|