Advertisement
Guest User

Untitled

a guest
Jan 5th, 2017
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. @GET
  2. @Path("/{id}/skills")
  3. @Produces(MediaType.APPLICATION_JSON)
  4. public Response getSkills(@PathParam("id")String id){
  5. Long idInLong = Long.valueOf(id);
  6. Utilisateur user = uDAO.getUserById(idInLong);
  7. if(user != null){
  8. Set<Competence> competences = user.getCompetences();
  9. return Response.status(200).entity(competences).build();
  10. }
  11. else{
  12. return Response.status(Status.NOT_FOUND.getStatusCode())
  13. .entity("No user for this id").build();
  14. }
  15. }
  16. @GET
  17. @Path("/negatives")
  18. @Produces(MediaType.APPLICATION_JSON)
  19. public List<UtilisateurBean> getUsersNegatif(){
  20. List<Utilisateur> users = uDAO.getUsersNegatif();
  21. List<UtilisateurBean> usersWithoutPassword = new ArrayList<UtilisateurBean>();
  22. for(Utilisateur u : users){
  23. usersWithoutPassword.add(new UtilisateurBean(u.getId(),u.getPseudo(),u.getName(),u.getFirstname(),u.getCode_Postal(),u.getCompetences()));
  24. }
  25. return usersWithoutPassword;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement