Advertisement
Guest User

Untitled

a guest
Oct 26th, 2016
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. @Path("/employees")
  2. public class EmployResource {
  3.  
  4.  
  5.  
  6. static EmployService employService = null;
  7. public void setEmployService(EmployService employService){
  8. this.employService = employService;
  9. }
  10. @GET
  11. @Produces(MediaType.TEXT_PLAIN)
  12. public String test(){
  13. User user = new User();
  14. user.setFullName("awais");user.setUserName("ahmad.fcc");
  15. employService.addUser(user);
  16. return "CONGRATULATIONS YOU DID IT";
  17. }
  18.  
  19. @POST
  20. @Path("login")
  21. @Produces(MediaType.APPLICATION_XML)
  22. public Employ login(@FormParam("username")String username,@FormParam("password")String password){
  23. Employ employ =employService.getEmploy(username, password);
  24. return employ;
  25. }
  26. @POST
  27. @Path("loc")
  28. @Consumes(MediaType.APPLICATION_XML)
  29. public void TrackedLocation(TrackedLocation trackedLocation){
  30. employService.addTrackedLocation(trackedLocation);
  31. }
  32.  
  33. @POST
  34. @Path("posttest")
  35. public Response postTest(@FormParam("username")String username,@FormParam("password")String password){
  36. return Response.status(200).entity("username: "+username +"n password: "+password).build();
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement