| 1 | package edu.ucsb.cs.scaffold.controller; | |
| 2 | ||
| 3 | import edu.ucsb.cs.scaffold.entity.PlAssessment; | |
| 4 | import edu.ucsb.cs.scaffold.repository.PlAssessmentRepository; | |
| 5 | import io.swagger.v3.oas.annotations.Operation; | |
| 6 | import io.swagger.v3.oas.annotations.Parameter; | |
| 7 | import io.swagger.v3.oas.annotations.tags.Tag; | |
| 8 | import java.util.List; | |
| 9 | import lombok.extern.slf4j.Slf4j; | |
| 10 | import org.springframework.beans.factory.annotation.Autowired; | |
| 11 | import org.springframework.security.access.prepost.PreAuthorize; | |
| 12 | import org.springframework.web.bind.annotation.GetMapping; | |
| 13 | import org.springframework.web.bind.annotation.RequestMapping; | |
| 14 | import org.springframework.web.bind.annotation.RequestParam; | |
| 15 | import org.springframework.web.bind.annotation.RestController; | |
| 16 | ||
| 17 | /** | |
| 18 | * Read-only: PlAssessments are populated by sync jobs mirroring the repo on GitHub — not by | |
| 19 | * POST/DELETE endpoints. | |
| 20 | */ | |
| 21 | @Tag(name = "PlAssessment") | |
| 22 | @RequestMapping("/api/plAssessment") | |
| 23 | @RestController | |
| 24 | @Slf4j | |
| 25 | public class PLAssessmentController extends ApiController { | |
| 26 | ||
| 27 | @Autowired private PlAssessmentRepository plAssessmentRepository; | |
| 28 | ||
| 29 | @Operation(summary = "List all PlAssessments for a PlRepo and PlInstance") | |
| 30 | @PreAuthorize("hasRole('ROLE_ADMIN') || hasRole('ROLE_INSTRUCTOR')") | |
| 31 | @GetMapping("") | |
| 32 | public List<PlAssessment> allPlAssessments( | |
| 33 | @Parameter(name = "plRepoId") @RequestParam Long plRepoId, | |
| 34 | @Parameter(name = "plInstance") @RequestParam Long plInstance) { | |
| 35 |
1
1. allPlAssessments : replaced return value with Collections.emptyList for edu/ucsb/cs/scaffold/controller/PLAssessmentController::allPlAssessments → KILLED |
return plAssessmentRepository.findByPlRepoIdAndPlInstanceId(plRepoId, plInstance); |
| 36 | } | |
| 37 | } | |
Mutations | ||
| 35 |
1.1 |