Class CourseStaffCSVController
java.lang.Object
edu.ucsb.cs156.frontiers.controllers.ApiController
edu.ucsb.cs156.frontiers.controllers.CourseStaffCSVController
@RequestMapping("/api/coursestaff")
@RestController
public class CourseStaffCSVController
extends ApiController
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<Object> uploadStaffCSV(Long courseId, org.springframework.web.multipart.MultipartFile file) Upload staff for a Course from a CSV file.Methods inherited from class edu.ucsb.cs156.frontiers.controllers.ApiController
doesCurrentUserHaveRole, genericMessage, getCurrentUser, handleDuplicateGroupException, handleEntityNotFoundException, handleIllegalArgument, handleNoLinkedOrgException, handleUnsupportedOperation, handleValidationException, isCurrentUserAdmin
-
Constructor Details
-
CourseStaffCSVController
public CourseStaffCSVController()
-
-
Method Details
-
uploadStaffCSV
@PreAuthorize("@CourseSecurity.hasInstructorPermissions(#root, #courseId)") @PostMapping(value="/upload/csv", consumes="multipart/form-data") public org.springframework.http.ResponseEntity<Object> uploadStaffCSV(@RequestParam Long courseId, @RequestParam("file") org.springframework.web.multipart.MultipartFile file) throws IOException, com.opencsv.exceptions.CsvException Upload staff for a Course from a CSV file. Each row should contain firstName, lastName, and email.- Parameters:
courseId- the ID of the coursefile- the CSV file to upload- Returns:
- Throws:
IOExceptioncom.opencsv.exceptions.CsvException
-