adding active-filter if not null
This commit is contained in:
parent
3b491c978f
commit
7b21a1fde5
@ -1359,11 +1359,14 @@ public class RestClient implements Closeable {
|
|||||||
public PageData<DeviceInfo> getTenantDeviceInfos(String type, Boolean active, DeviceProfileId deviceProfileId, PageLink pageLink) {
|
public PageData<DeviceInfo> getTenantDeviceInfos(String type, Boolean active, DeviceProfileId deviceProfileId, PageLink pageLink) {
|
||||||
Map<String, String> params = new HashMap<>();
|
Map<String, String> params = new HashMap<>();
|
||||||
params.put("type", type);
|
params.put("type", type);
|
||||||
params.put("active", active != null ? active.toString() : null);
|
|
||||||
params.put("deviceProfileId", deviceProfileId != null ? deviceProfileId.toString() : null);
|
params.put("deviceProfileId", deviceProfileId != null ? deviceProfileId.toString() : null);
|
||||||
|
if (active != null) {
|
||||||
|
params.put("active", active.toString());
|
||||||
|
}
|
||||||
addPageLinkToParam(params, pageLink);
|
addPageLinkToParam(params, pageLink);
|
||||||
return restTemplate.exchange(
|
return restTemplate.exchange(
|
||||||
baseURL + "/api/tenant/deviceInfos?type={type}&active={active}&deviceProfileId={deviceProfileId}&" + getUrlParams(pageLink),
|
baseURL + "/api/tenant/deviceInfos?type={type}&deviceProfileId={deviceProfileId}&"
|
||||||
|
+ (active != null ? "active={active}&" : "") + getUrlParams(pageLink),
|
||||||
HttpMethod.GET, HttpEntity.EMPTY,
|
HttpMethod.GET, HttpEntity.EMPTY,
|
||||||
new ParameterizedTypeReference<PageData<DeviceInfo>>() {
|
new ParameterizedTypeReference<PageData<DeviceInfo>>() {
|
||||||
}, params).getBody();
|
}, params).getBody();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user