150151152153154155156157158159160161162
return like; } public void unlike(Like like) { em.remove(like); Post post = like.getPost(); if (post != null) { Set<Like> likes = post.getLikes(); if (likes != null) { likes.remove(like); } } User user = like.getUser();
4546474849505152535455
} return null; } public Like addLike(long postId) { Post post = em.find(Post.class, postId); if (post != null) { return dao.like(current, post); } return null; }