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 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 course
      file - the CSV file to upload
      Returns:
      Throws:
      IOException
      com.opencsv.exceptions.CsvException