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.springframework.beans.factory.annotation.Autowired; | |
8 | ||
9 | import org.springframework.http.ResponseEntity; | |
10 | import org.springframework.web.bind.annotation.GetMapping; | |
11 | import org.springframework.web.bind.annotation.RequestMapping; | |
12 | import org.springframework.web.bind.annotation.RequestParam; | |
13 | import org.springframework.web.bind.annotation.RestController; | |
14 | ||
15 | import edu.ucsb.cs156.courses.repositories.UserRepository; | |
16 | import edu.ucsb.cs156.courses.services.UCSBCurriculumService; | |
17 | ||
18 | @RestController | |
19 | @RequestMapping("/api/public") | |
20 | public class UCSBCurriculumController { | |
21 | private ObjectMapper mapper = new ObjectMapper(); | |
22 | ||
23 | @Autowired | |
24 | UserRepository userRepository; | |
25 | ||
26 | @Autowired | |
27 | UCSBCurriculumService ucsbCurriculumService; | |
28 | ||
29 | @GetMapping(value = "/basicsearch", produces = "application/json") | |
30 | public ResponseEntity<String> basicsearch(@RequestParam String qtr, @RequestParam String dept, | |
31 | @RequestParam String level) throws JsonProcessingException { | |
32 | ||
33 | String body = ucsbCurriculumService.getJSON(dept, qtr, level); | |
34 | | |
35 |
1
1. basicsearch : replaced return value with null for edu/ucsb/cs156/courses/controllers/UCSBCurriculumController::basicsearch → KILLED |
return ResponseEntity.ok().body(body); |
36 | } | |
37 | } | |
Mutations | ||
35 |
1.1 |