| 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.GameRepository; | |
| 7 | import edu.ucsb.cs156.happiercows.repositories.FarmerRepository; | |
| 8 | import edu.ucsb.cs156.happiercows.repositories.HerdRepository; | |
| 9 | import edu.ucsb.cs156.happiercows.repositories.UserRepository; | |
| 10 | import edu.ucsb.cs156.jobs.services.JobContextConsumer; | |
| 11 | import lombok.extern.slf4j.Slf4j; | |
| 12 | ||
| 13 | @Service | |
| 14 | @Slf4j | |
| 15 | public class SetCowHealthJobFactory { | |
| 16 | ||
| 17 | @Autowired | |
| 18 | private GameRepository gameRepository; | |
| 19 | | |
| 20 | @Autowired | |
| 21 | private FarmerRepository farmerRepository; | |
| 22 | ||
| 23 | @Autowired | |
| 24 | private UserRepository userRepository; | |
| 25 | ||
| 26 | @Autowired | |
| 27 | private HerdRepository herdRepository; | |
| 28 | ||
| 29 | public JobContextConsumer create(Long gameID, double health) { | |
| 30 | log.info("gameRepository = " + gameRepository); | |
| 31 | log.info("farmerRepository = " + farmerRepository); | |
| 32 |
1
1. create : replaced return value with null for edu/ucsb/cs156/happiercows/jobs/SetCowHealthJobFactory::create → KILLED |
return new SetCowHealthJob(gameID, health, gameRepository, farmerRepository, userRepository, herdRepository); |
| 33 | } | |
| 34 | } | |
Mutations | ||
| 32 |
1.1 |