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/public") | |
16 | public class UCSBCurriculumController { | |
17 | ||
18 | private ObjectMapper mapper = new ObjectMapper(); | |
19 | ||
20 | @Autowired UserRepository userRepository; | |
21 | ||
22 | @Autowired UCSBCurriculumService ucsbCurriculumService; | |
23 | ||
24 | @GetMapping(value = "/basicsearch", produces = "application/json") | |
25 | public ResponseEntity<String> basicsearch( | |
26 | @RequestParam String qtr, @RequestParam String dept, @RequestParam String level) | |
27 | throws JsonProcessingException { | |
28 | ||
29 | String body = ucsbCurriculumService.getJSON(dept, qtr, level); | |
30 | ||
31 |
1
1. basicsearch : replaced return value with null for edu/ucsb/cs156/courses/controllers/UCSBCurriculumController::basicsearch → KILLED |
return ResponseEntity.ok().body(body); |
32 | } | |
33 | } | |
Mutations | ||
31 |
1.1 |