diff --git a/src/main/java/com/pickple/server/api/comment/dto/response/CommentGetResponse.java b/src/main/java/com/pickple/server/api/comment/dto/response/CommentGetResponse.java index 5d1f9b7..e9eda86 100644 --- a/src/main/java/com/pickple/server/api/comment/dto/response/CommentGetResponse.java +++ b/src/main/java/com/pickple/server/api/comment/dto/response/CommentGetResponse.java @@ -15,9 +15,7 @@ public record CommentGetResponse( String commentContent, - String commentDate, - - boolean isVeteran + String commentDate ) { } diff --git a/src/main/java/com/pickple/server/api/comment/service/CommentQueryService.java b/src/main/java/com/pickple/server/api/comment/service/CommentQueryService.java index 9f31fdc..13631a2 100644 --- a/src/main/java/com/pickple/server/api/comment/service/CommentQueryService.java +++ b/src/main/java/com/pickple/server/api/comment/service/CommentQueryService.java @@ -8,8 +8,6 @@ import com.pickple.server.api.guest.repository.GuestRepository; import com.pickple.server.api.host.domain.Host; import com.pickple.server.api.host.repository.HostRepository; -import com.pickple.server.api.moim.domain.enums.MoimState; -import com.pickple.server.api.moim.repository.MoimRepository; import com.pickple.server.api.notice.domain.Notice; import com.pickple.server.api.notice.repository.NoticeRepository; import java.time.format.DateTimeFormatter; @@ -28,7 +26,6 @@ public class CommentQueryService { private final CommentRepository commentRepository; private final HostRepository hostRepository; private final GuestRepository guestRepository; - private final MoimRepository moimRepository; public List getCommentListByNotice(Long noticeId) { Notice notice = noticeRepository.findNoticeByIdOrThrow(noticeId); @@ -48,8 +45,6 @@ public List getCommentListByNotice(Long noticeId) { .commenterNickname(commenterInfo.getProfileNickname()) .commentContent(comment.getCommentContent()) .commentDate(comment.getCreatedAt().format(DateTimeFormatter.ofPattern("yyyy.MM.dd HH:mm:ss"))) - .isVeteran(checkVeteran(isOwner, - hostRepository.findHostByUserId(comment.getCommenter().getId()).getId())) .build(); }).collect(Collectors.toList()); } @@ -69,11 +64,4 @@ public boolean checkOwner(Long userId, Long noticeId) { return notice.getMoim().getHost().getUser().getId().equals(userId); } - private boolean checkVeteran(boolean isOwner, Long hostId) { - if (isOwner) { - int count = moimRepository.countByHostIdAndMoimState(hostId, MoimState.COMPLETED.getMoimState()); - return count >= 2; - } - return false; - } }