| 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 | ||
| 35 |   // Backend for final exam info, similar to the above operation: | |
| 36 |   @Operation(summary = "Get final exam information for a given quarter and course enrollment code") | |
| 37 |   @GetMapping(value = "/finalsInfo", produces = "application/json") | |
| 38 |   public ResponseEntity<String> finalsInfo( | |
| 39 |       @RequestParam String quarterYYYYQ, @RequestParam String enrollCd) | |
| 40 |       throws Exception { // Looks for quarter and code | |
| 41 | ||
| 42 |     String body = ucsbCurriculumService.getFinalsInfo(quarterYYYYQ, enrollCd); | |
| 43 | ||
| 44 | 
1
1. finalsInfo : replaced return value with null for edu/ucsb/cs156/courses/controllers/UCSBCurriculumController::finalsInfo → KILLED | 
    return ResponseEntity.ok().body(body); | 
| 45 |   } | |
| 46 | ||
| 47 |   @Operation(summary = "Get list of General Education Areas") | |
| 48 |   @GetMapping(value = "/generalEducationInfo", produces = "application/json") | |
| 49 |   public ResponseEntity<String> generalEducationInfo() throws Exception { | |
| 50 |     String body = ucsbCurriculumService.getGeInfo(); | |
| 51 | 
1
1. generalEducationInfo : replaced return value with null for edu/ucsb/cs156/courses/controllers/UCSBCurriculumController::generalEducationInfo → KILLED | 
    return ResponseEntity.ok().body(body); | 
| 52 |   } | |
| 53 | } | |
Mutations | ||
| 32 | 
 
 1.1  | 
|
| 44 | 
 
 1.1  | 
|
| 51 | 
 
 1.1  |