@PostMapping
public ResponseEntity<User> create(@RequestBody User user) {
User saved = userService.save(user);
return ResponseEntity.status(HttpStatus.CREATED).body(saved);
}@RequestBody & ResponseEntity
@RequestBody deserializes a JSON request body into a Java object; ResponseEntity gives full control over the HTTP response (status, headers, body).