@Transactional
 public void addPost(
     String title, String text, Long partners, Long days, Date mdate, ArrayList<Point> track) {
   User currentUser = usersRepo.findOne(User.getCurrentUserId());
   // Post p = new Post(currentUser, title, text, partners, days, mdate, new Date()));
   Post p = new Post(currentUser, title, text, partners, days, new Date(), new Date(), track);
   postsRepo.save(p);
 }
Ejemplo n.º 2
0
 @RequestMapping(value = "/remove_comment", method = RequestMethod.POST)
 public ResponseEntity removeComment(@RequestBody Long commentId) {
   if (commentService.findComment(commentId).getAuthor().getId() == User.getCurrentUserId())
     commentService.removeComment(commentId);
   return new ResponseEntity(HttpStatus.OK);
 }