Skip to content

Commit

Permalink
Update src/main/java/ai/elimu/web/analytics/StoryBookLearningEventCsv…
Browse files Browse the repository at this point in the history
…ExportController.java

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
  • Loading branch information
jo-elimu and coderabbitai[bot] authored Aug 26, 2024
1 parent f4f6e6a commit db8ae28
Showing 1 changed file with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,22 @@ public void handleRequest(
);

csvPrinter.flush();
csvPrinter.close();
for (StoryBookLearningEvent storyBookLearningEvent : storyBookLearningEvents) {
logger.info("storyBookLearningEvent.getId(): " + storyBookLearningEvent.getId());

csvPrinter.printRecord(
storyBookLearningEvent.getId(),
storyBookLearningEvent.getTimestamp().getTimeInMillis(),
storyBookLearningEvent.getAndroidId(),
storyBookLearningEvent.getPackageName(),
(storyBookLearningEvent.getStoryBook() == null) ? null : storyBookLearningEvent.getStoryBook().getId(),
storyBookLearningEvent.getStoryBookTitle(),
storyBookLearningEvent.getLearningEventType()
);

csvPrinter.flush();
}
csvPrinter.close();
}

String csvFileContent = stringWriter.toString();
Expand Down

0 comments on commit db8ae28

Please sign in to comment.