Created
September 21, 2018 15:31
-
-
Save eldermoraes/e4b52c208a8f8a26b9fcb0350920813d to your computer and use it in GitHub Desktop.
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
@Stateless | |
@Path("playerService") | |
@Produces(MediaType.APPLICATION_JSON) | |
@Consumes(MediaType.APPLICATION_JSON) | |
public class PlayerService { | |
@EJB | |
private PlayerBean playerBean; | |
@GET | |
@Path("findById/{id}") | |
public Response findById(@PathParam("id") Long id){ | |
return Response.ok(playerBean.findById(id)).build(); | |
} | |
@GET | |
@Path("findAll") | |
public Response findAll(){ | |
return Response.ok(playerBean.findAll()).build(); | |
} | |
@POST | |
public Response save(Player player){ | |
playerBean.save(player); | |
return Response.accepted().build(); | |
} | |
@DELETE | |
public Response remove(Player player){ | |
playerBean.remove(player); | |
return Response.accepted().build(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment