@RequestMapping(
      value = "/users/{id}",
      method = RequestMethod.GET,
      produces = MediaType.APPLICATION_JSON_VALUE)
  public ResponseEntity getUser(@PathVariable(value = "id") Integer id) {

    return new ResponseEntity<>(userService.getUser(id), new HttpHeaders(), HttpStatus.OK);
  }
  @RequestMapping(
      value = "/users",
      method = RequestMethod.GET,
      produces = MediaType.APPLICATION_JSON_VALUE)
  public ResponseEntity getUsers() {

    return new ResponseEntity<>(userService.getUsers(), new HttpHeaders(), HttpStatus.OK);
  }
  @RequestMapping(
      value = "/users",
      method = RequestMethod.POST,
      consumes = MediaType.APPLICATION_JSON_VALUE,
      produces = MediaType.APPLICATION_JSON_VALUE)
  public ResponseEntity saveUser(@RequestBody User user) {

    return new ResponseEntity<>(userService.editUser(user), new HttpHeaders(), HttpStatus.CREATED);
  }
  @RequestMapping(
      value = "/contact/{id}",
      method = RequestMethod.POST,
      produces = MediaType.APPLICATION_JSON_VALUE)
  public ResponseEntity saveContact(
      @RequestBody Contact contact, @PathVariable(value = "id") Integer id) {

    return new ResponseEntity<>(
        userService.addContact(contact, id), new HttpHeaders(), HttpStatus.CREATED);
  }
  @RequestMapping(value = "/contact/{id}", method = RequestMethod.DELETE)
  public ResponseEntity deleteContact(@PathVariable(value = "id") Integer id) {

    userService.deleteContact(id);
    return new ResponseEntity<>("OK", new HttpHeaders(), HttpStatus.OK);
  }