From e41c234ae93c6cc1b43f1e78af8566f288e0c10e Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 4 Jun 2022 11:02:22 -0700 Subject: Inject storage for events report --- .../java/org/traccar/reports/EventsReportProvider.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'src/main/java') 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 getObjects( - Storage storage, long userId, - Collection deviceIds, Collection groupIds, + long userId, Collection deviceIds, Collection groupIds, Collection types, Date from, Date to) throws StorageException { ReportUtils.checkPeriodLimit(from, to); ArrayList result = new ArrayList<>(); @@ -66,8 +74,7 @@ public class EventsReportProvider { } public void getExcel( - OutputStream outputStream, Storage storage, long userId, - Collection deviceIds, Collection groupIds, + OutputStream outputStream, long userId, Collection deviceIds, Collection groupIds, Collection types, Date from, Date to) throws StorageException, IOException { ReportUtils.checkPeriodLimit(from, to); ArrayList devicesEvents = new ArrayList<>(); -- cgit v1.2.3