Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- AppDataService ads = new AppDataService();
- @GET
- @Path("/{appdataid}")
- @Produces(MediaType.APPLICATION_JSON)
- public AppData getAppData(@PathParam("appdataid")long appdataid){
- return ads.getAppData(appdataid);
- }
- public AppDataService(){
- appdatas.put(1L, new AppData(1,"Success", " ", "123456"));
- appdatas.put(2L, new AppData(2,"Failure", " ", "654321"));
- }
- public AppData getAppData(long id){
- return appdatas.get(id);
- }
- {
- "id": 1,
- "message": " ",
- "status": "Success",
- "token": "123456"
- }
- @POST
- @Path("/{appdataid}")
- @Consumes(MediaType.APPLICATION_JSON)
- @Produces(MediaType.APPLICATION_JSON)
- public AppData getAppData(@PathParam("appdataid")long appdataid){
- return ads.getAppData(appdataid);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement