Created
July 1, 2019 14:53
-
-
Save recursivecodes/e67492d2f99b13f7d56dd5a61cabeb3e to your computer and use it in GitHub Desktop.
UserResource.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Path("/{id}") | |
@GET | |
@Produces(MediaType.APPLICATION_JSON) | |
public Response getById(@PathParam("id") String id) { | |
User user = userRepository.get(id); | |
if( user != null ) { | |
return Response.ok(user).build(); | |
} | |
else { | |
return Response.status(404).build(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment