Class UserInfoController

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

@RequestMapping("/api/currentUser") @RestController public class UserInfoController extends ApiController
  • Constructor Details

    • UserInfoController

      public UserInfoController()
  • Method Details

    • getCurrentUserAsJson

      @PreAuthorize("hasRole(\'ROLE_USER\')") @GetMapping("") public org.springframework.http.ResponseEntity<String> getCurrentUserAsJson() throws com.fasterxml.jackson.core.JsonProcessingException
      Throws:
      com.fasterxml.jackson.core.JsonProcessingException
    • updateLastOnline

      @PreAuthorize("hasRole(\'ROLE_USER\')") @PostMapping("/last-online") public org.springframework.http.ResponseEntity<Instant> updateLastOnline()
    • getUsersEmails

      @PreAuthorize("hasRole(\'ROLE_USER\')") @GetMapping("/emails") public Iterable<UserEmail> getUsersEmails()
    • getStaffedCourses

      @PreAuthorize("hasRole(\'ROLE_USER\')") @GetMapping("/staffedCourses") public Iterable<Course> getStaffedCourses()