1 | package edu.ucsb.cs156.dining.controllers; | |
2 | ||
3 | import edu.ucsb.cs156.dining.entities.UCSBAPIDiningCommons; | |
4 | import edu.ucsb.cs156.dining.services.UCSBAPIDiningCommonsService; | |
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.security.access.prepost.PreAuthorize; | |
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 | import java.util.List; | |
14 | ||
15 | /** Controller for UCSB Dining Commons API */ | |
16 | @Tag(name = "UCSBAPIDiningCommonsController") | |
17 | @RestController | |
18 | @RequestMapping("/api/diningcommons") | |
19 | @Slf4j | |
20 | public class UCSBAPIDiningCommonsController { | |
21 | ||
22 | @Autowired | |
23 | private UCSBAPIDiningCommonsService diningCommonsService; | |
24 | ||
25 | @Operation(summary = "Get all dining commons from UCSB API") | |
26 | @PreAuthorize("hasRole('ROLE_USER')") | |
27 | @GetMapping("/all") | |
28 | public List<UCSBAPIDiningCommons> getAllDiningCommons() throws Exception { | |
29 |
1
1. getAllDiningCommons : replaced return value with Collections.emptyList for edu/ucsb/cs156/dining/controllers/UCSBAPIDiningCommonsController::getAllDiningCommons → KILLED |
return diningCommonsService.getAllDiningCommons(); |
30 | } | |
31 | } | |
Mutations | ||
29 |
1.1 |