use of de.tum.in.www1.artemis.web.rest.dto.PageableSearchDTO in project ArTEMiS by ls1intum.
the class UserResource method getAllUsers.
/**
* GET users : get all users.
*
* @param userSearch the pagination information for user search
* @return the ResponseEntity with status 200 (OK) and with body all users
*/
@GetMapping("users")
@PreAuthorize("hasRole('ADMIN')")
public ResponseEntity<List<UserDTO>> getAllUsers(@ApiParam PageableSearchDTO<String> userSearch) {
final Page<UserDTO> page = userRepository.getAllManagedUsers(userSearch);
HttpHeaders headers = PaginationUtil.generatePaginationHttpHeaders(ServletUriComponentsBuilder.fromCurrentRequest(), page);
return new ResponseEntity<>(page.getContent(), headers, HttpStatus.OK);
}
use of de.tum.in.www1.artemis.web.rest.dto.PageableSearchDTO in project Artemis by ls1intum.
the class UserResource method getAllUsers.
/**
* GET users : get all users.
*
* @param userSearch the pagination information for user search
* @return the ResponseEntity with status 200 (OK) and with body all users
*/
@GetMapping("users")
@PreAuthorize("hasRole('ADMIN')")
public ResponseEntity<List<UserDTO>> getAllUsers(@ApiParam PageableSearchDTO<String> userSearch) {
final Page<UserDTO> page = userRepository.getAllManagedUsers(userSearch);
HttpHeaders headers = PaginationUtil.generatePaginationHttpHeaders(ServletUriComponentsBuilder.fromCurrentRequest(), page);
return new ResponseEntity<>(page.getContent(), headers, HttpStatus.OK);
}
Aggregations