Advertisement
Guest User

Untitled

a guest
Mar 27th, 2017
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. AppDataService ads = new AppDataService();
  2. @GET
  3. @Path("/{appdataid}")
  4. @Produces(MediaType.APPLICATION_JSON)
  5. public AppData getAppData(@PathParam("appdataid")long appdataid){
  6. return ads.getAppData(appdataid);
  7. }
  8.  
  9. public AppDataService(){
  10. appdatas.put(1L, new AppData(1,"Success", " ", "123456"));
  11. appdatas.put(2L, new AppData(2,"Failure", " ", "654321"));
  12. }
  13. public AppData getAppData(long id){
  14. return appdatas.get(id);
  15. }
  16.  
  17. {
  18. "id": 1,
  19. "message": " ",
  20. "status": "Success",
  21. "token": "123456"
  22. }
  23.  
  24. @POST
  25. @Path("/{appdataid}")
  26. @Consumes(MediaType.APPLICATION_JSON)
  27. @Produces(MediaType.APPLICATION_JSON)
  28. public AppData getAppData(@PathParam("appdataid")long appdataid){
  29. return ads.getAppData(appdataid);
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement