| 1 | package edu.ucsb.cs156.courses.controllers; | |
| 2 | ||
| 3 | import edu.ucsb.cs156.courses.repositories.UserRepository; | |
| 4 | import edu.ucsb.cs156.courses.services.UCSBCurriculumService; | |
| 5 | import io.swagger.v3.oas.annotations.Operation; | |
| 6 | import io.swagger.v3.oas.annotations.tags.Tag; | |
| 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 | @Tag(name = "UCSBCurriculumController") | |
| 16 | @RestController | |
| 17 | @RequestMapping("/api/public") | |
| 18 | @Slf4j | |
| 19 | public class UCSBCurriculumController extends ApiController { | |
| 20 | ||
| 21 |   @Autowired UserRepository userRepository; | |
| 22 |   @Autowired UCSBCurriculumService ucsbCurriculumService; | |
| 23 | ||
| 24 |   @Operation(summary = "Get course data for a given quarter, department, and level") | |
| 25 |   @GetMapping(value = "/basicsearch", produces = "application/json") | |
| 26 |   public ResponseEntity<String> basicsearch( | |
| 27 |       @RequestParam String qtr, @RequestParam String dept, @RequestParam String level) | |
| 28 |       throws Exception { | |
| 29 | ||
| 30 |     String body = ucsbCurriculumService.getJSON(dept, qtr, level); | |
| 31 | ||
| 32 | 1
1. basicsearch : replaced return value with null for edu/ucsb/cs156/courses/controllers/UCSBCurriculumController::basicsearch → KILLED |     return ResponseEntity.ok().body(body); | 
| 33 |   } | |
| 34 | } | |
| Mutations | ||
| 32 | 1.1 |