Пример #1
0
 @Path("/peeps/dislike")
 @Post
 @Consumes("application/json")
 public void dislike(Peep peep) {
   User loggedUser = userSession.getUser();
   postsDao.dislike(peep, loggedUser.getEmail());
   result.use(Results.status()).ok();
 }
Пример #2
0
 @Path("/peeps")
 @Post
 @Consumes("application/json")
 public void save(Peep peep) {
   User user = userSession.getUser();
   if (user != null) {
     peep.setDate(new Date());
     peep.setAuthor(user.getEmail());
     peep.setHash(user.getHashFoto());
     peep.addHashTags();
     postsDao.save(peep);
     result.include("peep", peep);
   }
 }