From 38cc01ccaa19b1e1d9b7a1c47d0254e5ca3890ac Mon Sep 17 00:00:00 2001 From: yaaan7 Date: Tue, 16 Jun 2026 16:31:05 +0900 Subject: [PATCH 1/3] =?UTF-8?q?fix:=20ALL,HOT,HOME,=20FESTIVAL=20=EC=97=90?= =?UTF-8?q?=EC=84=9C=20=EC=B6=95=EC=A0=9C=20=EA=B8=B0=EA=B0=84=EC=9D=84=20?= =?UTF-8?q?=EA=B3=A0=EB=A0=A4=ED=95=98=EC=97=AC=20=EC=A1=B0=ED=9A=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../repository/CommunityRepository.java | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/src/main/java/issueissyu/backend/domain/community/repository/CommunityRepository.java b/src/main/java/issueissyu/backend/domain/community/repository/CommunityRepository.java index a7cd180..bfbb112 100644 --- a/src/main/java/issueissyu/backend/domain/community/repository/CommunityRepository.java +++ b/src/main/java/issueissyu/backend/domain/community/repository/CommunityRepository.java @@ -47,6 +47,15 @@ public interface CommunityRepository extends JpaRepository { join fetch c.pin p join fetch p.user where c.communityType = :type + and ( + :type <> issueissyu.backend.domain.community.enums.CommunityType.FESTIVAL + or exists ( + select 1 + from EventPin ep + where ep.pin = p + and CURRENT_TIMESTAMP between ep.eventStartTime and ep.eventEndTime + ) + ) and exists ( select 1 from PinLocation pl @@ -80,6 +89,18 @@ List findFeedByTypeAndRegion( join fetch c.pin p join fetch p.user where c.communityType in :types + and ( + c.communityType not in ( + issueissyu.backend.domain.community.enums.CommunityType.STORE, + issueissyu.backend.domain.community.enums.CommunityType.FESTIVAL + ) + or exists ( + select 1 + from EventPin ep + where ep.pin = p + and CURRENT_TIMESTAMP between ep.eventStartTime and ep.eventEndTime + ) + ) and exists ( select 1 from PinLocation pl @@ -175,6 +196,18 @@ List findCardnewsFeedByTypesWithImages( where ( ( c.communityType in :regionTypes + and ( + c.communityType not in ( + issueissyu.backend.domain.community.enums.CommunityType.STORE, + issueissyu.backend.domain.community.enums.CommunityType.FESTIVAL + ) + or exists ( + select 1 + from EventPin ep + where ep.pin = p + and CURRENT_TIMESTAMP between ep.eventStartTime and ep.eventEndTime + ) + ) and exists ( select 1 from PinLocation pl @@ -221,6 +254,18 @@ List findFeedByRegionOrGlobalTypes( where ( ( c.communityType in :regionTypes + and ( + c.communityType not in ( + issueissyu.backend.domain.community.enums.CommunityType.STORE, + issueissyu.backend.domain.community.enums.CommunityType.FESTIVAL + ) + or exists ( + select 1 + from EventPin ep + where ep.pin = p + and CURRENT_TIMESTAMP between ep.eventStartTime and ep.eventEndTime + ) + ) and exists ( select 1 from PinLocation pl From c8b69904479e2857b199af932c377cffee6620ec Mon Sep 17 00:00:00 2001 From: yaaan7 Date: Tue, 16 Jun 2026 16:43:39 +0900 Subject: [PATCH 2/3] =?UTF-8?q?fix:=20STORE=20=EB=8F=84=20=EA=B8=B0?= =?UTF-8?q?=EA=B0=84=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/community/repository/CommunityRepository.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/issueissyu/backend/domain/community/repository/CommunityRepository.java b/src/main/java/issueissyu/backend/domain/community/repository/CommunityRepository.java index bfbb112..ca97f94 100644 --- a/src/main/java/issueissyu/backend/domain/community/repository/CommunityRepository.java +++ b/src/main/java/issueissyu/backend/domain/community/repository/CommunityRepository.java @@ -48,7 +48,10 @@ public interface CommunityRepository extends JpaRepository { join fetch p.user where c.communityType = :type and ( - :type <> issueissyu.backend.domain.community.enums.CommunityType.FESTIVAL + :type not in ( + issueissyu.backend.domain.community.enums.CommunityType.STORE, + issueissyu.backend.domain.community.enums.CommunityType.FESTIVAL + ) or exists ( select 1 from EventPin ep From 9860560f54f5a26bc1a00988b6c10176b26d88ca Mon Sep 17 00:00:00 2001 From: yaaan7 Date: Tue, 16 Jun 2026 17:01:30 +0900 Subject: [PATCH 3/3] =?UTF-8?q?fix:=20now()=20=EC=82=AC=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../community/repository/CommunityRepository.java | 12 ++++++++---- .../query/CommunityHotQueryServiceImpl.java | 2 ++ .../service/query/CommunityQueryServiceImpl.java | 14 ++++++++++++++ 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/src/main/java/issueissyu/backend/domain/community/repository/CommunityRepository.java b/src/main/java/issueissyu/backend/domain/community/repository/CommunityRepository.java index ca97f94..28e5fb5 100644 --- a/src/main/java/issueissyu/backend/domain/community/repository/CommunityRepository.java +++ b/src/main/java/issueissyu/backend/domain/community/repository/CommunityRepository.java @@ -56,7 +56,7 @@ or exists ( select 1 from EventPin ep where ep.pin = p - and CURRENT_TIMESTAMP between ep.eventStartTime and ep.eventEndTime + and :now between ep.eventStartTime and ep.eventEndTime ) ) and exists ( @@ -74,6 +74,7 @@ and exists ( """) List findFeedByTypeAndRegion( @Param("type") CommunityType type, + @Param("now") LocalDateTime now, @Param("locationId") Long locationId, @Param("cursorCreatedAt") LocalDateTime cursorCreatedAt, @Param("cursorId") Long cursorId, @@ -101,7 +102,7 @@ or exists ( select 1 from EventPin ep where ep.pin = p - and CURRENT_TIMESTAMP between ep.eventStartTime and ep.eventEndTime + and :now between ep.eventStartTime and ep.eventEndTime ) ) and exists ( @@ -119,6 +120,7 @@ and exists ( """) List findFeedByTypesAndRegion( @Param("types") Collection types, + @Param("now") LocalDateTime now, @Param("locationId") Long locationId, @Param("cursorCreatedAt") LocalDateTime cursorCreatedAt, @Param("cursorId") Long cursorId, @@ -208,7 +210,7 @@ or exists ( select 1 from EventPin ep where ep.pin = p - and CURRENT_TIMESTAMP between ep.eventStartTime and ep.eventEndTime + and :now between ep.eventStartTime and ep.eventEndTime ) ) and exists ( @@ -230,6 +232,7 @@ and exists ( List findFeedByRegionOrGlobalTypes( @Param("regionTypes") Collection regionTypes, @Param("globalTypes") Collection globalTypes, + @Param("now") LocalDateTime now, @Param("locationId") Long locationId, @Param("cursorCreatedAt") LocalDateTime cursorCreatedAt, @Param("cursorId") Long cursorId, @@ -266,7 +269,7 @@ or exists ( select 1 from EventPin ep where ep.pin = p - and CURRENT_TIMESTAMP between ep.eventStartTime and ep.eventEndTime + and :now between ep.eventStartTime and ep.eventEndTime ) ) and exists ( @@ -289,6 +292,7 @@ and exists ( List findHotFeedByRegionOrGlobalTypes( @Param("regionTypes") Collection regionTypes, @Param("globalTypes") Collection globalTypes, + @Param("now") LocalDateTime now, @Param("locationId") Long locationId, @Param("since") LocalDateTime since, @Param("cursorPopularity") Double cursorPopularity, diff --git a/src/main/java/issueissyu/backend/domain/community/service/query/CommunityHotQueryServiceImpl.java b/src/main/java/issueissyu/backend/domain/community/service/query/CommunityHotQueryServiceImpl.java index cdb1588..bdd4d6f 100644 --- a/src/main/java/issueissyu/backend/domain/community/service/query/CommunityHotQueryServiceImpl.java +++ b/src/main/java/issueissyu/backend/domain/community/service/query/CommunityHotQueryServiceImpl.java @@ -34,12 +34,14 @@ public class CommunityHotQueryServiceImpl implements CommunityHotQueryService { @Override public Optional findTopHotInRegion(Long locationId) { + LocalDateTime now = LocalDateTime.now(); LocalDateTime since = LocalDateTime.now().minusDays(HOT_DAYS); Pageable limit = PageRequest.of(0, 1); List communities = communityRepository.findHotFeedByRegionOrGlobalTypes( REGION_BASED_FEED_TYPES, GLOBAL_FEED_TYPES, + now, locationId, since, null, diff --git a/src/main/java/issueissyu/backend/domain/community/service/query/CommunityQueryServiceImpl.java b/src/main/java/issueissyu/backend/domain/community/service/query/CommunityQueryServiceImpl.java index b15fe1c..3a9b93d 100644 --- a/src/main/java/issueissyu/backend/domain/community/service/query/CommunityQueryServiceImpl.java +++ b/src/main/java/issueissyu/backend/domain/community/service/query/CommunityQueryServiceImpl.java @@ -249,10 +249,12 @@ public CommunityQueryService.CommunityDetailResult getCommunityDetail( private List fetchCommunities(CommunityTab tab, Long locationId, CursorKey cursorKey) { Pageable limit = PageRequest.of(0, sizeWithLookahead(cursorKey.requestSize())); + LocalDateTime now = LocalDateTime.now(); return switch (tab) { case ISSUE -> communityRepository.findFeedByTypeAndRegion( CommunityType.ISSUE, + now, locationId, cursorKey.createdAt(), cursorKey.communityId(), @@ -261,6 +263,7 @@ private List fetchCommunities(CommunityTab tab, Long locationId, Curs case STORE -> communityRepository.findFeedByTypeAndRegion( CommunityType.STORE, + now, locationId, cursorKey.createdAt(), cursorKey.communityId(), @@ -269,6 +272,7 @@ private List fetchCommunities(CommunityTab tab, Long locationId, Curs case COMMUNICATION -> communityRepository.findFeedByTypeAndRegion( CommunityType.COMMUNICATION, + now, locationId, cursorKey.createdAt(), cursorKey.communityId(), @@ -277,6 +281,7 @@ private List fetchCommunities(CommunityTab tab, Long locationId, Curs case FESTIVAL -> communityRepository.findFeedByTypeAndRegion( CommunityType.FESTIVAL, + now, locationId, cursorKey.createdAt(), cursorKey.communityId(), @@ -307,6 +312,7 @@ private List fetchCommunities(CommunityTab tab, Long locationId, Curs case ALL -> communityRepository.findFeedByRegionOrGlobalTypes( REGION_BASED_FEED_TYPES, GLOBAL_FEED_TYPES, + now, locationId, cursorKey.createdAt(), cursorKey.communityId(), @@ -344,9 +350,11 @@ private boolean usesRegion(CommunityTab tab) { private List fetchStorePromotions(Long locationId, int storeSize) { int resolvedSize = Math.min(Math.max(1, storeSize), MAX_STORE_SIZE); Pageable limit = PageRequest.of(0, resolvedSize); + LocalDateTime now = LocalDateTime.now(); List communities = communityRepository.findFeedByTypeAndRegion( CommunityType.STORE, + now, locationId, null, null, @@ -357,12 +365,14 @@ private List fetchStorePromotions(Long locationId, int } private List fetchHotPreviews(Long locationId) { + LocalDateTime now = LocalDateTime.now(); LocalDateTime since = LocalDateTime.now().minusDays(HOT_DAYS); Pageable limit = PageRequest.of(0, HOT_PREVIEW_SIZE); return toFeedItems(communityRepository.findHotFeedByRegionOrGlobalTypes( REGION_BASED_FEED_TYPES, GLOBAL_FEED_TYPES, + now, locationId, since, null, @@ -374,9 +384,11 @@ private List fetchHotPreviews(Long locationId) { private CommunityCursorPageResDTO fetchRecentNews(Long locationId, String recentCursor, int recentSize) { CursorKey cursorKey = CursorKey.parse(recentCursor, recentSize); Pageable limit = PageRequest.of(0, sizeWithLookahead(cursorKey.requestSize())); + LocalDateTime now = LocalDateTime.now(); List communities = communityRepository.findFeedByTypesAndRegion( REGION_BASED_FEED_TYPES, + now, locationId, cursorKey.createdAt(), cursorKey.communityId(), @@ -715,12 +727,14 @@ private String resolveWriterProfileUrl(CommunityType type, Pin pin) { private CommunityCursorPageResDTO getHotFeed(Long locationId, String cursor, int size) { HotCursorKey cursorKey = HotCursorKey.parse(cursor, size); + LocalDateTime now = LocalDateTime.now(); LocalDateTime since = LocalDateTime.now().minusDays(HOT_DAYS); Pageable limit = PageRequest.of(0, sizeWithLookahead(size)); List communities = communityRepository.findHotFeedByRegionOrGlobalTypes( REGION_BASED_FEED_TYPES, GLOBAL_FEED_TYPES, + now, locationId, since, cursorKey.popularity(),