diff --git a/src/main/java/org/gachon/checkmate/domain/post/service/PostService.java b/src/main/java/org/gachon/checkmate/domain/post/service/PostService.java index a6a8933..b6b132c 100644 --- a/src/main/java/org/gachon/checkmate/domain/post/service/PostService.java +++ b/src/main/java/org/gachon/checkmate/domain/post/service/PostService.java @@ -19,7 +19,6 @@ import org.gachon.checkmate.domain.post.dto.support.PostSearchDto; import org.gachon.checkmate.domain.post.entity.Post; import org.gachon.checkmate.domain.post.repository.PostRepository; -import org.gachon.checkmate.domain.post.utils.PostSortType; import org.gachon.checkmate.domain.post.utils.PostSortingUtils; import org.gachon.checkmate.domain.scrap.repository.ScrapRepository; import org.gachon.checkmate.global.error.exception.EntityNotFoundException; @@ -32,10 +31,10 @@ import java.time.LocalDate; import java.time.temporal.ChronoUnit; -import java.util.Comparator; import java.util.List; import java.util.stream.Collectors; +import static org.gachon.checkmate.domain.checkList.utils.MatchRateCalculator.getAccuracy; import static org.gachon.checkmate.global.error.ErrorCode.*; import static org.gachon.checkmate.global.utils.PagingUtils.convertPaging; @@ -110,12 +109,6 @@ public PostStateUpdateResponseDto updateMyPostState(Long userId, Long postId, Po return PostStateUpdateResponseDto.of(post); } - private void validatePostWriter(User user, Post post) { - if (!post.getUser().getId().equals(user.getId())) { - throw new ForbiddenException(NOT_POST_WRITER); - } - } - private List createPostSearchResponseDto(Page postSearchDtoList, CheckList checkList) { return postSearchDtoList.stream() .map(postSearchDto -> @@ -126,22 +119,16 @@ private List createPostSearchResponseDto(Page createPostSearchResponseDto(Page