Exemple #1
0
  @RequestMapping(value = "/{id}", method = RequestMethod.PUT)
  public Developer updateOne(@RequestBody Developer newDeveloper, @PathVariable Long id) {
    Developer developer = developerRespository.findOne(id);
    if (developer == null) throw new DeveloperException(id);

    newDeveloper = developerRespository.save(newDeveloper);
    return newDeveloper;
  }
Exemple #2
0
 @RequestMapping(method = RequestMethod.POST)
 @ResponseStatus(HttpStatus.CREATED)
 public Developer save(@RequestBody Developer developer) {
   return developerRespository.save(developer);
 }