Class UsersController
java.lang.Object
edu.ucsb.cs156.happiercows.controllers.ApiController
edu.ucsb.cs156.happiercows.controllers.UsersController
@RequestMapping("/api/admin/users")
@RestController
public class UsersController
extends ApiController
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionrestoreUser
(long userId) suspendUser
(long userId) org.springframework.http.ResponseEntity<String>
users()
Methods inherited from class edu.ucsb.cs156.happiercows.controllers.ApiController
genericMessage, getCurrentUser, handleBadRequest, handleGenericException
-
Constructor Details
-
UsersController
public UsersController()
-
-
Method Details
-
users
@PreAuthorize("hasRole(\'ROLE_ADMIN\')") @GetMapping("") public org.springframework.http.ResponseEntity<String> users() throws com.fasterxml.jackson.core.JsonProcessingException- Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
suspendUser
@PreAuthorize("hasRole(\'ROLE_ADMIN\')") @PostMapping("/suspend") public Object suspendUser(@RequestParam long userId) throws com.fasterxml.jackson.core.JsonProcessingException - Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
restoreUser
@PreAuthorize("hasRole(\'ROLE_ADMIN\')") @PostMapping("/restore") public Object restoreUser(@RequestParam long userId) throws com.fasterxml.jackson.core.JsonProcessingException - Throws:
com.fasterxml.jackson.core.JsonProcessingException
-