Getting the user list

Find the code snippet for the getAllUsers() operation:

//    Getting the User List
@GetMapping(path = ["/users"])
fun getAllUsers(): ResponseEntity<List<UserModel>> {
return ResponseEntity(userService.getAllUserList(),
HttpStatus.OK)
}

The @GetMapping(path = ["/users"]) annotation is the URL path of /users and it is a GET  request function. Here, we will get a list of the users from the database.