Skip to content

Instantly share code, notes, and snippets.

@CheolhoJeon
Created April 28, 2020 01:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CheolhoJeon/dae7e6a461ef7f60fae4c8c2de8b8717 to your computer and use it in GitHub Desktop.
Save CheolhoJeon/dae7e6a461ef7f60fae4c8c2de8b8717 to your computer and use it in GitHub Desktop.
@GetMapping("/api/members/{id}")
public ResponseEntity<Object> member(@PathVariable Long id, HttpServletResponse response) throws IOException {
Member member = memberDao.selectById(id);
if (member == null) {
return ResponseEntity.status(HttpStatus.NOT_FOUND).body(new ErrorResponse("no member"));
}
return ResponseEntity.status(HttpStatus.OK).body(member);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment