| 1 | package edu.ucsb.cs156.happiercows.jobs; | |
| 2 | ||
| 3 | import org.springframework.beans.factory.annotation.Autowired; | |
| 4 | import org.springframework.stereotype.Service; | |
| 5 | ||
| 6 | import edu.ucsb.cs156.happiercows.repositories.CowHerdRepository; | |
| 7 | import edu.ucsb.cs156.happiercows.repositories.GameRepository; | |
| 8 | import edu.ucsb.cs156.happiercows.repositories.FarmerRepository; | |
| 9 | import edu.ucsb.cs156.happiercows.repositories.UserRepository; | |
| 10 | import edu.ucsb.cs156.jobs.services.JobContextConsumer; | |
| 11 | import edu.ucsb.cs156.happiercows.services.GamePlusBuilderService; | |
| 12 | import lombok.extern.slf4j.Slf4j; | |
| 13 | ||
| 14 | @Service | |
| 15 | @Slf4j | |
| 16 | public class UpdateCowHealthJobFactory { | |
| 17 | ||
| 18 | @Autowired | |
| 19 | private GameRepository gameRepository; | |
| 20 | | |
| 21 | @Autowired | |
| 22 | private FarmerRepository farmerRepository; | |
| 23 | ||
| 24 | @Autowired | |
| 25 | private UserRepository userRepository; | |
| 26 | ||
| 27 | @Autowired | |
| 28 | private GamePlusBuilderService gamePlusBuilderService; | |
| 29 | ||
| 30 | @Autowired | |
| 31 | private CowHerdRepository cowHerdRepository; | |
| 32 | ||
| 33 | public JobContextConsumer create() { | |
| 34 | log.info("gameRepository = " + gameRepository); | |
| 35 | log.info("farmerRepository = " + farmerRepository); | |
| 36 |
1
1. create : replaced return value with null for edu/ucsb/cs156/happiercows/jobs/UpdateCowHealthJobFactory::create → KILLED |
return new UpdateCowHealthJob( |
| 37 | gameRepository, | |
| 38 | farmerRepository, | |
| 39 | userRepository, | |
| 40 | gamePlusBuilderService, | |
| 41 | cowHerdRepository); | |
| 42 | } | |
| 43 | } | |
Mutations | ||
| 36 |
1.1 |