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.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.137.216.175