@RequestMapping({"/add", "/edit/add"}) public @ResponseBody Response<Meme> add(@RequestBody final Meme meme) { if (meme.hasRequiredAttributes()) { return service.addOrUpdate(meme); } else { return null; } }
@RequestMapping("/remove") public @ResponseBody Response<Meme> removememe(@RequestBody final Meme meme) { if (meme.hasRequiredAttributes()) { final Response<Meme> deletedMeme = service.delete(meme); return deletedMeme; } else { return null; } }
@RequestMapping("/view/{x}x{y}/{memeId}") public String view( @PathVariable final long x, @PathVariable final long y, @PathVariable final long memeId, final Map<String, Object> map) { final Response<Meme> response = service.get(memeId); map.put("response", response); return viewer; }
@RequestMapping("/") public String index(final Map<String, Object> map) { final Response<Meme> response = service.listRecentFirst(); map.put("response", response); return index; }
@RequestMapping("/edit/{memeId}") public String edit(@PathVariable final long memeId, final Map<String, Object> map) { final Response<Meme> response = service.get(memeId); map.put("response", response); return editor; }