| 1 | package edu.ucsb.cs156.courses.controllers; | |
| 2 | ||
| 3 | import com.fasterxml.jackson.core.JsonProcessingException; | |
| 4 | ||
| 5 | import com.fasterxml.jackson.databind.ObjectMapper; | |
| 6 | ||
| 7 | import org.slf4j.Logger; | |
| 8 | import org.slf4j.LoggerFactory; | |
| 9 | import org.springframework.beans.factory.annotation.Autowired; | |
| 10 | ||
| 11 | import org.springframework.http.ResponseEntity; | |
| 12 | import org.springframework.web.bind.annotation.GetMapping; | |
| 13 | import org.springframework.web.bind.annotation.RequestMapping; | |
| 14 | import org.springframework.web.bind.annotation.RequestParam; | |
| 15 | import org.springframework.web.bind.annotation.RestController; | |
| 16 | ||
| 17 | import edu.ucsb.cs156.courses.repositories.UserRepository; | |
| 18 | import edu.ucsb.cs156.courses.services.UCSBCurriculumService; | |
| 19 | ||
| 20 | @RestController | |
| 21 | @RequestMapping("/api/sections") | |
| 22 | public class UCSBSectionsController { | |
| 23 |     private final Logger logger = LoggerFactory.getLogger(UCSBSectionsController.class); | |
| 24 | ||
| 25 |     private ObjectMapper mapper = new ObjectMapper(); | |
| 26 | ||
| 27 |     @Autowired | |
| 28 |     UserRepository userRepository; | |
| 29 | ||
| 30 |     @Autowired | |
| 31 |     UCSBCurriculumService ucsbCurriculumService; | |
| 32 | ||
| 33 |     @GetMapping(value = "/basicsearch", produces = "application/json") | |
| 34 |     public ResponseEntity<String> basicsearch(@RequestParam String qtr, @RequestParam String dept, | |
| 35 |             @RequestParam String level) throws JsonProcessingException { | |
| 36 | ||
| 37 |         String body = ucsbCurriculumService.getSectionJSON(dept, qtr, level); | |
| 38 | ||
| 39 | ||
| 40 | 
1
1. basicsearch : replaced return value with null for edu/ucsb/cs156/courses/controllers/UCSBSectionsController::basicsearch → KILLED | 
        return ResponseEntity.ok().body(body); | 
| 41 |     }       | |
| 42 | ||
| 43 |     @GetMapping(value = "/sectionsearch", produces = "application/json") | |
| 44 |     public ResponseEntity<String> sectionsearch(@RequestParam String qtr, @RequestParam String enrollCode) { | |
| 45 |              | |
| 46 |         String body = ucsbCurriculumService.getSection(enrollCode, qtr); | |
| 47 | ||
| 48 | 
1
1. sectionsearch : replaced return value with null for edu/ucsb/cs156/courses/controllers/UCSBSectionsController::sectionsearch → KILLED | 
        return ResponseEntity.ok().body(body); | 
| 49 |     } | |
| 50 | } | |
Mutations | ||
| 40 | 
 
 1.1  | 
|
| 48 | 
 
 1.1  |