Skip to content

Instantly share code, notes, and snippets.

@finsterthecat
Created January 10, 2018 16:42
Show Gist options
  • Save finsterthecat/ecccca22f2cff7c0fc62b27762e6434a to your computer and use it in GitHub Desktop.
Save finsterthecat/ecccca22f2cff7c0fc62b27762e6434a to your computer and use it in GitHub Desktop.
@PostMapping(consumes = "application/json", produces = "application/json")
@ResponseStatus(HttpStatus.CREATED)
public Hero createHero(Hero hero) {
LOG.debug("createHero: {}", hero.getName());
Hero createdHero = heroRepository.save(hero);
LOG.debug("Created hero {} with id {}", createdHero.getName(), createdHero.getId());
return createdHero;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment