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