Fixed the problem of getAlarmTypes method query failure in rest-client

This commit is contained in:
15608076017 2024-08-20 21:46:18 +08:00
parent 77d1ebb032
commit 455f4e59be

View File

@ -507,13 +507,16 @@ public class RestClient implements Closeable {
return restTemplate.postForEntity(baseURL + "/api/alarm", alarm, Alarm.class).getBody(); return restTemplate.postForEntity(baseURL + "/api/alarm", alarm, Alarm.class).getBody();
} }
public List<EntitySubtype> getAlarmTypes(PageLink pageLink) { public PageData<EntitySubtype> getAlarmTypes(PageLink pageLink) {
Map<String, String> params = new HashMap<>();
addPageLinkToParam(params, pageLink);
return restTemplate.exchange( return restTemplate.exchange(
baseURL + "/api/alarm/types?" + getUrlParams(pageLink), baseURL + "/api/alarm/types?" + getUrlParams(pageLink),
HttpMethod.GET, HttpMethod.GET,
HttpEntity.EMPTY, HttpEntity.EMPTY,
new ParameterizedTypeReference<List<EntitySubtype>>() { new ParameterizedTypeReference<PageData<EntitySubtype>>() {
}).getBody(); },
params).getBody();
} }
public AlarmComment saveAlarmComment(AlarmId alarmId, AlarmComment alarmComment) { public AlarmComment saveAlarmComment(AlarmId alarmId, AlarmComment alarmComment) {