Пример #1
0
 @RequestMapping({"/add", "/edit/add"})
 public @ResponseBody Response<Meme> add(@RequestBody final Meme meme) {
   if (meme.hasRequiredAttributes()) {
     return service.addOrUpdate(meme);
   } else {
     return null;
   }
 }
Пример #2
0
 @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;
   }
 }
Пример #3
0
 @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;
 }
Пример #4
0
 @RequestMapping("/")
 public String index(final Map<String, Object> map) {
   final Response<Meme> response = service.listRecentFirst();
   map.put("response", response);
   return index;
 }
Пример #5
0
 @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;
 }