Class StudentsController

java.lang.Object
edu.ucsb.cs156.organic.controllers.ApiController
edu.ucsb.cs156.organic.controllers.StudentsController

@RequestMapping("/api/students") @RestController public class StudentsController extends ApiController
  • Constructor Details

    • StudentsController

      public StudentsController()
  • Method Details

    • getStaff

      @PreAuthorize("hasRole(\'ROLE_ADMIN\')") @GetMapping("/all") public Iterable<Student> getStaff(@RequestParam Long courseId) throws com.fasterxml.jackson.core.JsonProcessingException
      Throws:
      com.fasterxml.jackson.core.JsonProcessingException
    • postStudent

      @PreAuthorize("hasAnyRole(\'ROLE_ADMIN\',\'ROLE_INSTRUCTOR\', \'ROLE_USER\')") @PostMapping("/post") public Student postStudent(@RequestParam Long courseId, @RequestParam String email, @RequestParam String fname, @RequestParam String lname, @RequestParam String studentId)
    • getStaff

      @PreAuthorize("hasRole(\'ROLE_ADMIN\')") @PostMapping(value="/upload/egrades", consumes="multipart/form-data") public Map<String,String> getStaff(@RequestParam Long courseId, @RequestParam("file") org.springframework.web.multipart.MultipartFile file) throws com.fasterxml.jackson.core.JsonProcessingException, IOException, com.opencsv.exceptions.CsvException
      Throws:
      com.fasterxml.jackson.core.JsonProcessingException
      IOException
      com.opencsv.exceptions.CsvException
    • fromEgradesCSVRow

      public Student fromEgradesCSVRow(String[] row)
    • upsertStudent

      public StudentsController.Status upsertStudent(Student student, Course course)