diff --git a/src/main/java/com/gongjakso/server/domain/post/repository/PostRepository.java b/src/main/java/com/gongjakso/server/domain/post/repository/PostRepository.java index 7d11b8d2..df1274f0 100644 --- a/src/main/java/com/gongjakso/server/domain/post/repository/PostRepository.java +++ b/src/main/java/com/gongjakso/server/domain/post/repository/PostRepository.java @@ -130,7 +130,7 @@ public interface PostRepository extends JpaRepository { Page findAllPostsJoinedWithStackNamesByTitleContainsAndPostTypeTrueAndDeletedAtIsNullAndFinishDateAfterAndStatusAndMeetingCityContainsAndMeetingTownContainsAndStackNamesStackNameTypeContainsOrderByScrapCountDescPostIdDesc (@Param("searchWord") String searchWord, @Param("currentTimestamp") LocalDateTime currentTimestamp, @Param("status") PostStatus status, @Param("meetingCity") String meetingCity, @Param("meetingTown") String meetingTown, @Param("stackNameType") String stackNameType,Pageable pageable); - List findAllByMemberAndStatusAndDeletedAtIsNullOrderByCreatedAtDesc(Member member, PostStatus status); + List findAllByMemberAndStatusInAndDeletedAtIsNullOrderByCreatedAtDesc(Member member, List statusList); Page findAllByPostIdInOrMember(List postIdList, Member member, Pageable pageable); } diff --git a/src/main/java/com/gongjakso/server/domain/post/service/PostService.java b/src/main/java/com/gongjakso/server/domain/post/service/PostService.java index 3d7803b1..eb064670 100644 --- a/src/main/java/com/gongjakso/server/domain/post/service/PostService.java +++ b/src/main/java/com/gongjakso/server/domain/post/service/PostService.java @@ -24,10 +24,12 @@ import java.time.LocalDateTime; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import java.util.Optional; import java.util.stream.Collectors; +import static com.gongjakso.server.domain.post.enumerate.PostStatus.EXTENSION; import static com.gongjakso.server.domain.post.enumerate.PostStatus.RECRUITING; import static com.gongjakso.server.global.exception.ErrorCode.*; @@ -336,7 +338,8 @@ public List getMyPostList(Member member) { // Validation // Business Logic - List postList = postRepository.findAllByMemberAndStatusAndDeletedAtIsNullOrderByCreatedAtDesc(member, RECRUITING); + List statusList = Arrays.asList(RECRUITING, EXTENSION); + List postList = postRepository.findAllByMemberAndStatusInAndDeletedAtIsNullOrderByCreatedAtDesc(member, statusList); // Return return postList.stream()