15161718192021
@RequestMapping(value="/{time}", method = RequestMethod.GET) public @ResponseBody MyData getMyData( @PathVariable long time) { return new MyData(time, "REST GET Call !!!"); }
2728293031323334
return md; } @RequestMapping(method = RequestMethod.POST) public @ResponseBody MyData postMyData() { return new MyData( System.currentTimeMillis(), "REST POST Call !!!"); }
35363738394041
@RequestMapping(value="/{time}", method = RequestMethod.DELETE) public @ResponseBody MyData deleteMyData( @PathVariable long time) { return new MyData(time, "REST DELETE Call !!!"); }
2425262728293031
+ "MyRemoteData/" + System.currentTimeMillis(); MyRemoteData mrd = restTemplate.getForObject( remote, MyRemoteData.class); return new MyData(System.currentTimeMillis(), mrd.getData()); }
23242526272829
@RequestMapping(method = RequestMethod.PUT) public @ResponseBody MyData putMyData( @RequestParam("time") long time, @RequestParam("message") String message) { return new MyData(time, message); }
2829303132333435
return new MyData(time, message); } @RequestMapping(method = RequestMethod.POST) public @ResponseBody MyData postMyData() { return new MyData( System.currentTimeMillis(), "REST POST Call !!!"); }
36373839404142