aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-06-04 11:02:22 -0700
committerAnton Tananaev <anton@traccar.org>2022-06-04 11:02:22 -0700
commite41c234ae93c6cc1b43f1e78af8566f288e0c10e (patch)
tree8fc44796eadde3271d99c09320cdd81e1fdb0b74
parent31c4ad41f4d91dec3c98af06614e9518d3689a14 (diff)
downloadtrackermap-server-e41c234ae93c6cc1b43f1e78af8566f288e0c10e.tar.gz
trackermap-server-e41c234ae93c6cc1b43f1e78af8566f288e0c10e.tar.bz2
trackermap-server-e41c234ae93c6cc1b43f1e78af8566f288e0c10e.zip
Inject storage for events report
-rw-r--r--src/main/java/org/traccar/reports/EventsReportProvider.java15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/main/java/org/traccar/reports/EventsReportProvider.java b/src/main/java/org/traccar/reports/EventsReportProvider.java
index c4b0aad86..9b4a7df2b 100644
--- a/src/main/java/org/traccar/reports/EventsReportProvider.java
+++ b/src/main/java/org/traccar/reports/EventsReportProvider.java
@@ -38,11 +38,19 @@ import org.traccar.reports.model.DeviceReportSection;
import org.traccar.storage.Storage;
import org.traccar.storage.StorageException;
+import javax.inject.Inject;
+
public class EventsReportProvider {
+ private final Storage storage;
+
+ @Inject
+ public EventsReportProvider(Storage storage) {
+ this.storage = storage;
+ }
+
public Collection<Event> getObjects(
- Storage storage, long userId,
- Collection<Long> deviceIds, Collection<Long> groupIds,
+ long userId, Collection<Long> deviceIds, Collection<Long> groupIds,
Collection<String> types, Date from, Date to) throws StorageException {
ReportUtils.checkPeriodLimit(from, to);
ArrayList<Event> result = new ArrayList<>();
@@ -66,8 +74,7 @@ public class EventsReportProvider {
}
public void getExcel(
- OutputStream outputStream, Storage storage, long userId,
- Collection<Long> deviceIds, Collection<Long> groupIds,
+ OutputStream outputStream, long userId, Collection<Long> deviceIds, Collection<Long> groupIds,
Collection<String> types, Date from, Date to) throws StorageException, IOException {
ReportUtils.checkPeriodLimit(from, to);
ArrayList<DeviceReportSection> devicesEvents = new ArrayList<>();