Sort device analytics data

3.x.x
Turcy 5 years ago
parent 0af18b0255
commit e33f28bf8a

@ -106,7 +106,9 @@ public class DeviceEventManagementServiceImpl implements DeviceEventManagementSe
List<String> recordIds = getRecordIds(resultEntries);
AnalyticsDataResponse response = analyticsDataAPI.get(tenantId, tableName, 1, null, recordIds);
eventRecords.setCount(eventCount);
eventRecords.setList(AnalyticsDataAPIUtil.listRecords(analyticsDataAPI, response));
List<Record> records = AnalyticsDataAPIUtil.listRecords(analyticsDataAPI, response);
records.sort((Record r1, Record r2) -> Long.compare(r2.getTimestamp(), r1.getTimestamp()));
eventRecords.setList(records);
return eventRecords;
}

Loading…
Cancel
Save