Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @GET
- @Path("/{id}/skills")
- @Produces(MediaType.APPLICATION_JSON)
- public Response getSkills(@PathParam("id")String id){
- Long idInLong = Long.valueOf(id);
- Utilisateur user = uDAO.getUserById(idInLong);
- if(user != null){
- Set<Competence> competences = user.getCompetences();
- return Response.status(200).entity(competences).build();
- }
- else{
- return Response.status(Status.NOT_FOUND.getStatusCode())
- .entity("No user for this id").build();
- }
- }
- @GET
- @Path("/negatives")
- @Produces(MediaType.APPLICATION_JSON)
- public List<UtilisateurBean> getUsersNegatif(){
- List<Utilisateur> users = uDAO.getUsersNegatif();
- List<UtilisateurBean> usersWithoutPassword = new ArrayList<UtilisateurBean>();
- for(Utilisateur u : users){
- usersWithoutPassword.add(new UtilisateurBean(u.getId(),u.getPseudo(),u.getName(),u.getFirstname(),u.getCode_Postal(),u.getCompetences()));
- }
- return usersWithoutPassword;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement