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