Skip to content

Commit

Permalink
♻️ Feature/235 comment 개수에 차단유저 반영
Browse files Browse the repository at this point in the history
  • Loading branch information
Hanvp committed Oct 22, 2023
1 parent a230619 commit 113b6c4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/java/zipdabang/server/converter/RecipeConverter.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public static RecipeResponseDto.RecipePreviewDto toRecipePreviewDto(Recipe recip
.recipeName(recipe.getName())
.nickname(recipe.getMember().getNickname())
.likes(recipe.getTotalLike())
.comments(recipe.getTotalComments())
.comments(staticRecipeService.getCommentCount(recipe,member))
.isLiked(staticRecipeService.checkIsLiked(recipe, member))
.isScrapped(staticRecipeService.checkIsScrapped(recipe,member))
.isBlocked(staticRecipeService.checkOwnerBlocked(recipe,member))
Expand Down Expand Up @@ -176,7 +176,7 @@ private static RecipeResponseDto.RecipeSimpleDtoBest toResponseWeekBestDto(Recip
.createdAt(staticTimeConverter.ConvertTime(recipe.getCreatedAt()))
.updatedAt(staticTimeConverter.ConvertTime(recipe.getUpdatedAt()))
.likes(recipe.getTotalLike())
.comments(recipe.getTotalComments())
.comments(staticRecipeService.getCommentCount(recipe,member))
.scraps(recipe.getTotalScrap())
.isLiked(staticRecipeService.checkIsLiked(recipe,member))
.isScrapped(staticRecipeService.checkIsScrapped(recipe,member))
Expand Down Expand Up @@ -223,7 +223,7 @@ private static RecipeResponseDto.RecipeSimpleDto toResponseRecipeSimpleDto(Recip
.thumbnailUrl(recipe.getThumbnailUrl())
.createdAt(staticTimeConverter.ConvertTime(recipe.getCreatedAt()))
.updatedAt(staticTimeConverter.ConvertTime(recipe.getUpdatedAt()))
.comments(recipe.getTotalComments())
.comments(staticRecipeService.getCommentCount(recipe,member))
.likes(recipe.getTotalLike())
.scraps(recipe.getTotalScrap())
.isLiked(staticRecipeService.checkIsLiked(recipe,member))
Expand Down Expand Up @@ -433,7 +433,7 @@ public static RecipeResponseDto.RecipeDto toResponseRecipeDto(Recipe recipe, Boo
.createdAt(staticTimeConverter.ConvertTime(recipe.getCreatedAt()))
.updatedAt(staticTimeConverter.ConvertTime(recipe.getUpdatedAt()))
.likes(recipe.getTotalLike())
.comments(Long.valueOf(recipe.getCommentList().size()))
.comments(staticRecipeService.getCommentCount(recipe,member))
.scraps(recipe.getTotalScrap())
.isLiked(isLiked)
.isScrapped(isScrapped)
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/zipdabang/server/service/RecipeService.java
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,6 @@ public interface RecipeService {
Long getrecipeListByCategoryCounting(Long categoryId, Member member);

Long getWrittenByRecipeCounting(String writtenby, Member member);

Long getCommentCount(Recipe recipe, Member member);
}
Original file line number Diff line number Diff line change
Expand Up @@ -786,6 +786,11 @@ else if (!findComment.getRecipe().equals(findRecipe))
}
}

@Override
public Long getCommentCount(Recipe recipe, Member member) {
return commentRepositoryCustom.commentListTotalCount(member, recipe);
}

@Transactional(readOnly = false)
@Override
public Long reportComment(Long recipeId, Long commentId, Long reportId, Member member) {
Expand Down

0 comments on commit 113b6c4

Please sign in to comment.