Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.back.domain.member.member.entity.Member;
import com.back.domain.post.like.entity.PostLike;
import com.back.domain.post.like.repository.PostLikeRepository;
import com.back.domain.post.post.dto.PostDisLikedResponse;
import com.back.domain.post.post.dto.PostLikedResponse;
import com.back.domain.post.post.entity.Post;
import com.back.domain.post.post.service.PostService;
Expand Down Expand Up @@ -75,9 +76,9 @@ public void disLikePost(long postId) {
}
}

public PostLikedResponse getDisLikeCount(Long postId) {
public PostDisLikedResponse getDisLikeCount(Long postId) {
int disLikeCount = postLikeRepository.countDislikesByPostId(postId);
return new PostLikedResponse(disLikeCount);
return new PostDisLikedResponse(disLikeCount);
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ public RsData<PostLikedResponse> likePost(@PathVariable(name = "post_id") Long p
@PostMapping("/{post_id}/disliked")
public RsData<PostDisLikedResponse> disLikePost(@PathVariable(name = "post_id") Long postId) {
postLikeService.disLikePost(postId);
PostLikedResponse postLikedResponse = postLikeService.getDisLikeCount(postId);
return new RsData<>("200", "게시글 싫어요 성공", postLikedResponse);
PostDisLikedResponse postDisLikedResponse = postLikeService.getDisLikeCount(postId);
return new RsData<>("200", "게시글 싫어요 성공", postDisLikedResponse);
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.back.domain.post.comment.service.PostCommentService;
import com.back.domain.post.like.service.PostLikeService;
import com.back.domain.post.post.dto.PostDetailResponse;
import com.back.domain.post.post.dto.PostDisLikedResponse;
import com.back.domain.post.post.dto.PostLikedResponse;
import com.back.domain.post.post.entity.Post;
import com.back.domain.post.post.service.PostService;
Expand All @@ -28,10 +29,10 @@ public PostDetailResponse getDetailWithViewIncrement(Long postId) {

List<CommentAllResponse> comments = postCommentService.getAllPostCommentResponse(postId);
PostLikedResponse postLikedResponse = postLikeService.getLikeCount(postId);
PostLikedResponse postDisLikedResponse = postLikeService.getDisLikeCount(postId);
PostDisLikedResponse postDisLikedResponse = postLikeService.getDisLikeCount(postId);
String userStatus = postLikeService.getPresentStatus(postId);

return PostDetailResponse.from(post, comments, postLikedResponse.likeCount(), postDisLikedResponse.likeCount(), userStatus);
return PostDetailResponse.from(post, comments, postLikedResponse.likeCount(), postDisLikedResponse.disLikeCount(), userStatus);
}


Expand Down