| 1 | package edu.ucsb.cs156.dining.controllers; | |
| 2 | ||
| 3 | import com.fasterxml.jackson.databind.ObjectMapper; | |
| 4 | import edu.ucsb.cs156.dining.models.DiningCommons; | |
| 5 | import edu.ucsb.cs156.dining.services.DiningCommonsService; | |
| 6 | import io.swagger.v3.oas.annotations.Operation; | |
| 7 | import io.swagger.v3.oas.annotations.tags.Tag; | |
| 8 | import lombok.extern.slf4j.Slf4j; | |
| 9 | import org.springframework.beans.factory.annotation.Autowired; | |
| 10 | import org.springframework.web.bind.annotation.GetMapping; | |
| 11 | import org.springframework.web.bind.annotation.RequestMapping; | |
| 12 | import org.springframework.web.bind.annotation.RestController; | |
| 13 | ||
| 14 | @Slf4j | |
| 15 | @Tag(name = "API to handle get all dining commons from UCSB developer API website") | |
| 16 | @RequestMapping("/api/dining") | |
| 17 | @RestController | |
| 18 | public class DiningCommonsController extends ApiController /* implements ApplicationRunner */ { | |
| 19 | ||
| 20 | @Autowired ObjectMapper mapper; | |
| 21 | ||
| 22 | @Autowired DiningCommonsService diningCommonsService; | |
| 23 | ||
| 24 | @Operation(summary = "Get all Dining Commons") | |
| 25 | @GetMapping(value = "/all", produces = "application/json") | |
| 26 | public Iterable<DiningCommons> allDiningCommons() throws Exception { | |
| 27 | Iterable<DiningCommons> diningCommons = diningCommonsService.get(); | |
| 28 | ||
| 29 |
1
1. allDiningCommons : replaced return value with Collections.emptyList for edu/ucsb/cs156/dining/controllers/DiningCommonsController::allDiningCommons → KILLED |
return diningCommons; |
| 30 | } | |
| 31 | } | |
Mutations | ||
| 29 |
1.1 |