| 1 | package edu.ucsb.cs156.frontiers.jobs; | |
| 2 | ||
| 3 | import edu.ucsb.cs156.frontiers.entities.Course; | |
| 4 | import edu.ucsb.cs156.frontiers.entities.Team; | |
| 5 | import edu.ucsb.cs156.frontiers.enums.RepositoryPermissions; | |
| 6 | import edu.ucsb.cs156.frontiers.services.RepositoryService; | |
| 7 | import edu.ucsb.cs156.frontiers.services.jobs.JobContext; | |
| 8 | import edu.ucsb.cs156.frontiers.services.jobs.JobContextConsumer; | |
| 9 | import lombok.Builder; | |
| 10 | ||
| 11 | @Builder | |
| 12 | public class CreateTeamRepositoriesJob implements JobContextConsumer { | |
| 13 | Course course; | |
| 14 | RepositoryService repositoryService; | |
| 15 | String repositoryPrefix; | |
| 16 | Boolean isPrivate; | |
| 17 | RepositoryPermissions permissions; | |
| 18 | ||
| 19 | @Override | |
| 20 | public Course getCourse() { | |
| 21 |
1
1. getCourse : replaced return value with null for edu/ucsb/cs156/frontiers/jobs/CreateTeamRepositoriesJob::getCourse → KILLED |
return this.course; |
| 22 | } | |
| 23 | ||
| 24 | @Override | |
| 25 | public void accept(JobContext ctx) throws Exception { | |
| 26 | ctx.log("Creating team repositories..."); | |
| 27 | ||
| 28 | for (Team team : course.getTeams()) { | |
| 29 |
1
1. accept : removed call to edu/ucsb/cs156/frontiers/services/RepositoryService::createTeamRepository → KILLED |
repositoryService.createTeamRepository( |
| 30 | course, team, repositoryPrefix, isPrivate, permissions); | |
| 31 | } | |
| 32 | ctx.log("Done"); | |
| 33 | } | |
| 34 | } | |
Mutations | ||
| 21 |
1.1 |
|
| 29 |
1.1 |