| 1 | package edu.ucsb.cs156.happiercows.jobs; | |
| 2 | ||
| 3 | import java.util.Optional; | |
| 4 | ||
| 5 | import edu.ucsb.cs156.happiercows.entities.Commons; | |
| 6 | import edu.ucsb.cs156.happiercows.entities.Report; | |
| 7 | import edu.ucsb.cs156.happiercows.entities.User; | |
| 8 | import edu.ucsb.cs156.happiercows.entities.UserCommons; | |
| 9 | import edu.ucsb.cs156.happiercows.repositories.CommonsRepository; | |
| 10 | import edu.ucsb.cs156.happiercows.repositories.ReportLineRepository; | |
| 11 | import edu.ucsb.cs156.happiercows.repositories.ReportRepository; | |
| 12 | import edu.ucsb.cs156.happiercows.repositories.UserCommonsRepository; | |
| 13 | import edu.ucsb.cs156.happiercows.repositories.UserRepository; | |
| 14 | import edu.ucsb.cs156.happiercows.services.jobs.JobContext; | |
| 15 | import edu.ucsb.cs156.happiercows.services.jobs.JobContextConsumer; | |
| 16 | ||
| 17 | import edu.ucsb.cs156.happiercows.services.ReportService; | |
| 18 | ||
| 19 | ||
| 20 | import lombok.AllArgsConstructor; | |
| 21 | import lombok.Builder; | |
| 22 | import lombok.Getter; | |
| 23 | ||
| 24 | @Builder | |
| 25 | @AllArgsConstructor | |
| 26 | public class InstructorReportJobSingleCommons implements JobContextConsumer { | |
| 27 | ||
| 28 | @Getter | |
| 29 | private long commonsId; | |
| 30 | ||
| 31 | @Getter | |
| 32 | private ReportService reportService; | |
| 33 | | |
| 34 | @Override | |
| 35 | public void accept(JobContext ctx) throws Exception { | |
| 36 |
1
1. accept : removed call to edu/ucsb/cs156/happiercows/services/jobs/JobContext::log → KILLED |
ctx.log("Producing instructor report for commons id: " + commonsId); |
| 37 | Report report = reportService.createReport(commonsId); | |
| 38 |
1
1. accept : removed call to edu/ucsb/cs156/happiercows/services/jobs/JobContext::log → KILLED |
ctx.log(String.format("Instructor report %d for commons %s has been produced!", report.getId(), report.getName())); |
| 39 | } | |
| 40 | } | |
Mutations | ||
| 36 |
1.1 |
|
| 38 |
1.1 |