Updating a user

Find the code snippet for updateUser() operation:

//    Updating a User
@PutMapping(path = ["/user/{id}"])
fun updateUser(@RequestBody userModel: UserModel, @PathVariable("id") id: Int): ResponseEntity<UserModel> {
userService.updateUser(userModel, id)
return ResponseEntity(userModel, HttpStatus.OK)
}

The @PutMapping(path = ["/user/{id}"]) annotation is the URL path of "/user/{id}", and it is a PUT request with a specific ID. Here, we will update the specific user details in 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.144.107.193