Skip to content

Instantly share code, notes, and snippets.

@jhiemer
Created June 13, 2013 10:42
Show Gist options
  • Save jhiemer/5772812 to your computer and use it in GitHub Desktop.
Save jhiemer/5772812 to your computer and use it in GitHub Desktop.
@RequestMapping(value= {"/", ""}, method=RequestMethod.GET)
public @ResponseBody List<SlaBean> getAll() {
}
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
public @ResponseBody SlaBean get(@PathVariable UUID id, HttpServletRequest request) {
}
@RequestMapping(value= "/{id}", method=RequestMethod.PUT)
public @ResponseBody Map<String, String> update(@PathVariable UUID id, @RequestBody SlaBean slaBean,
HttpServletRequest request, HttpServletResponse response) {
return persist(id, slaBean, request, response);
}
@RequestMapping(value= {"/", ""}, method=RequestMethod.POST)
public @ResponseBody Map<String, String> save(@RequestBody SlaBean slaBean,
HttpServletRequest request, HttpServletResponse response) {
return persist(null, slaBean, request, response);
}
private @ResponseBody Map<String, String> persist(UUID id, @RequestBody SlaBean slaBean,
HttpServletRequest request, HttpServletResponse response) {
}
@RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
public @ResponseBody JSONResult delete(@PathVariable UUID id, HttpServletRequest request,
HttpServletResponse response) {
JSONResult result = new JSONResult();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment