Class AdminUserManagementController

java.lang.Object
io.github.navjotsrakhra.eventmanager.controller.AdminUserManagementController

@RestController @RequestMapping("/admin") public class AdminUserManagementController extends Object
The AdminUserManagementController class handles HTTP requests related to user management in the admin panel.
  • Constructor Details

    • AdminUserManagementController

      public AdminUserManagementController(UserManagementService userManagementService)
      Constructor for the AdminUserManagementController class.
      Parameters:
      userManagementService - Service for managing user roles.
  • Method Details

    • getUsers

      @GetMapping("/users") public org.springframework.http.ResponseEntity<List<UserDTO>> getUsers()
      Handles GET requests for the "/admin/users" URL and retrieves a list of all users.
      Returns:
      ResponseEntity containing a list of UserDTO objects.
    • updateUserRole

      @PostMapping("/updateUserRole/{id}") public org.springframework.http.ResponseEntity<Boolean> updateUserRole(@PathVariable Long id, @RequestBody List<Role> updatedRoles)
      Handles POST requests for the "/admin/updateUserRole/{id}" URL to update user roles.
      Parameters:
      id - The ID of the user whose roles need to be updated.
      updatedRoles - The list of updated roles for the user.
      Returns:
      ResponseEntity indicating the result of the operation.