From bfdbca37a3f1140fc08fb3f2f9650a49aef94a4a Mon Sep 17 00:00:00 2001 From: twodo0 Date: Thu, 12 Feb 2026 13:55:42 +0900 Subject: [PATCH 1/9] =?UTF-8?q?[FEAT]:=20=EA=B0=80=EA=B2=8C=EC=9D=98=20?= =?UTF-8?q?=EC=9C=A0=ED=9A=A8=ED=95=9C=20=EC=98=88=EC=95=BD=20=EA=B0=9C?= =?UTF-8?q?=EC=88=98=20=EA=B0=80=EC=A0=B8=EC=98=A4=EB=8A=94=20=EC=BF=BC?= =?UTF-8?q?=EB=A6=AC=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/booking/repository/BookingRepository.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/com/eatsfine/eatsfine/domain/booking/repository/BookingRepository.java b/src/main/java/com/eatsfine/eatsfine/domain/booking/repository/BookingRepository.java index ce500e71..52db45c1 100644 --- a/src/main/java/com/eatsfine/eatsfine/domain/booking/repository/BookingRepository.java +++ b/src/main/java/com/eatsfine/eatsfine/domain/booking/repository/BookingRepository.java @@ -2,6 +2,7 @@ import com.eatsfine.eatsfine.domain.booking.entity.Booking; import com.eatsfine.eatsfine.domain.booking.enums.BookingStatus; +import com.eatsfine.eatsfine.domain.store.entity.Store; import com.eatsfine.eatsfine.domain.user.entity.User; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; @@ -114,4 +115,10 @@ List findTableIdsWithFutureBookings( @Param("currentDate") LocalDate currentDate, @Param("currentTime") LocalTime currentTime ); + @Query("select count(b) from Booking b " + + "where b.store = :store " + + "and b.status in (com.eatsfine.eatsfine.domain.booking.enums.BookingStatus.CONFIRMED, " + + "com.eatsfine.eatsfine.domain.booking.enums.BookingStatus.PENDING, " + + "com.eatsfine.eatsfine.domain.booking.enums.BookingStatus.COMPLETED)") + Long countActiveBookings(@Param("store") Store store); } From 9a208fc4a499a89e58cfba8b147ffa9555db256a Mon Sep 17 00:00:00 2001 From: twodo0 Date: Thu, 12 Feb 2026 13:56:06 +0900 Subject: [PATCH 2/9] =?UTF-8?q?[FEAT]:=20=EB=82=B4=20=EA=B0=80=EA=B2=8C=20?= =?UTF-8?q?=EB=A6=AC=EC=8A=A4=ED=8A=B8=20=EC=A1=B0=ED=9A=8C=20DTO=20?= =?UTF-8?q?=EB=B0=8F=20=EC=BB=A8=EB=B2=84=ED=84=B0=20=EC=9E=91=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../store/converter/StoreConverter.java | 21 +++++++++++- .../domain/store/dto/StoreResDto.java | 32 +++++++++++++++++++ 2 files changed, 52 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/eatsfine/eatsfine/domain/store/converter/StoreConverter.java b/src/main/java/com/eatsfine/eatsfine/domain/store/converter/StoreConverter.java index 402e4c69..cce36f5f 100644 --- a/src/main/java/com/eatsfine/eatsfine/domain/store/converter/StoreConverter.java +++ b/src/main/java/com/eatsfine/eatsfine/domain/store/converter/StoreConverter.java @@ -79,5 +79,24 @@ public static StoreResDto.GetMainImageDto toGetMainImageDto(Long storeId, String .mainImageUrl(key) .build(); } -} + public static StoreResDto.MyStoreDto toMyStoreDto(Store store, boolean isOpenNow, Long totalBookingCount, String mainImageUrl) { + return StoreResDto.MyStoreDto.builder() + .storeId(store.getId()) + .storeName(store.getStoreName()) + .address(store.getAddress()) + .category(store.getCategory()) + .rating(store.getRating()) + .totalBookingCount(totalBookingCount) + .reviewCount(null) // 리뷰 도메인 구현 이후 추가 예정 + .mainImageUrl(mainImageUrl) + .isOpenNow(isOpenNow) + .build(); + } + + public static StoreResDto.MyStoreListDto toMyStoreListDto(List stores) { + return StoreResDto.MyStoreListDto.builder() + .stores(stores) + .build(); + } +} diff --git a/src/main/java/com/eatsfine/eatsfine/domain/store/dto/StoreResDto.java b/src/main/java/com/eatsfine/eatsfine/domain/store/dto/StoreResDto.java index 0489d542..f9eb62be 100644 --- a/src/main/java/com/eatsfine/eatsfine/domain/store/dto/StoreResDto.java +++ b/src/main/java/com/eatsfine/eatsfine/domain/store/dto/StoreResDto.java @@ -4,6 +4,7 @@ import com.eatsfine.eatsfine.domain.store.enums.Category; import com.eatsfine.eatsfine.domain.store.enums.DepositRate; import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Builder; import java.math.BigDecimal; @@ -91,4 +92,35 @@ public record GetMainImageDto( String mainImageUrl ) {} + // 내 가게 관리 리스트 응답 + @Builder + @Schema(description = "사장님용 내 가게 관리 단건 DTO") + public record MyStoreDto( + @Schema(description = "가게 ID", example = "1") + Long storeId, + @Schema(description = "가게명", example = "더 플레이스 강남점") + String storeName, + @Schema(description = "가게 주소", example = "서울 강남구 테헤란로 123") + String address, + @Schema(description = "카테고리", example = "ITALIAN") + Category category, + @Schema(description = "평점", example = "4.8") + BigDecimal rating, + @Schema(description = "누적 총 예약 수", example = "1234") + Long totalBookingCount, // 총 예약 수 + @Schema(description = "리뷰 개수", example = "256") + Long reviewCount, + @Schema(description = "대표 이미지 URL", example = "https://s3.amazonaws.com/thumb.jpg") + String mainImageUrl, + @Schema(description = "현재 영업 여부", example = "true") + boolean isOpenNow + ){} + + @Builder + @Schema(description = "사장님용 내 가게 관리 목록 응답") + public record MyStoreListDto( + @Schema(description = "소유한 가게 목록") + List stores + ){} + } From 0bf305b909eb5fc52fc3594f0c4d20747a2f0740 Mon Sep 17 00:00:00 2001 From: twodo0 Date: Thu, 12 Feb 2026 13:56:43 +0900 Subject: [PATCH 3/9] =?UTF-8?q?[FEAT]:=20=EA=B0=80=EA=B2=8C=20=EC=B9=B4?= =?UTF-8?q?=ED=85=8C=EA=B3=A0=EB=A6=AC=EC=97=90=20ITALIAN=20cnrk?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/eatsfine/eatsfine/domain/store/enums/Category.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/eatsfine/eatsfine/domain/store/enums/Category.java b/src/main/java/com/eatsfine/eatsfine/domain/store/enums/Category.java index 57e59a69..04a1b943 100644 --- a/src/main/java/com/eatsfine/eatsfine/domain/store/enums/Category.java +++ b/src/main/java/com/eatsfine/eatsfine/domain/store/enums/Category.java @@ -1,5 +1,5 @@ package com.eatsfine.eatsfine.domain.store.enums; public enum Category { - KOREAN, CHINESE, JAPANESE, WESTERN, CAFE + KOREAN, CHINESE, JAPANESE, WESTERN, ITALIAN, CAFE } From 4f568f689361fac65949b8357352b3ecab3a59d7 Mon Sep 17 00:00:00 2001 From: twodo0 Date: Thu, 12 Feb 2026 13:57:04 +0900 Subject: [PATCH 4/9] =?UTF-8?q?=EB=82=B4=20=EB=AA=A8=EB=93=A0=20=EA=B0=80?= =?UTF-8?q?=EA=B2=8C=20=EA=B0=80=EC=A0=B8=EC=98=A4=EB=8A=94=20=EC=BF=BC?= =?UTF-8?q?=EB=A6=AC=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../eatsfine/domain/store/repository/StoreRepository.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/com/eatsfine/eatsfine/domain/store/repository/StoreRepository.java b/src/main/java/com/eatsfine/eatsfine/domain/store/repository/StoreRepository.java index 6cd3f595..0e2bb64d 100644 --- a/src/main/java/com/eatsfine/eatsfine/domain/store/repository/StoreRepository.java +++ b/src/main/java/com/eatsfine/eatsfine/domain/store/repository/StoreRepository.java @@ -1,10 +1,12 @@ package com.eatsfine.eatsfine.domain.store.repository; import com.eatsfine.eatsfine.domain.store.entity.Store; +import com.eatsfine.eatsfine.domain.user.entity.User; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.query.Param; +import java.util.List; import java.util.Optional; @@ -19,4 +21,6 @@ public interface StoreRepository extends JpaRepository, StoreReposi """) Optional findByIdWithMenus(@Param("id") Long id); + List findAllByOwner(User owner); + } \ No newline at end of file From 20588d564273d0957f57fe15de03cfc63a10254b Mon Sep 17 00:00:00 2001 From: twodo0 Date: Thu, 12 Feb 2026 13:58:32 +0900 Subject: [PATCH 5/9] =?UTF-8?q?[FEAT]:=20=EB=82=B4=20=EA=B0=80=EA=B2=8C=20?= =?UTF-8?q?=EC=A1=B0=ED=9A=8C(=EB=8C=80=EC=8B=9C=EB=B3=B4=EB=93=9C?= =?UTF-8?q?=EC=9A=A9)=20=EB=A1=9C=EC=A7=81=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../store/controller/StoreController.java | 12 +++++++++ .../store/service/StoreQueryService.java | 2 ++ .../store/service/StoreQueryServiceImpl.java | 27 +++++++++++++++++++ 3 files changed, 41 insertions(+) diff --git a/src/main/java/com/eatsfine/eatsfine/domain/store/controller/StoreController.java b/src/main/java/com/eatsfine/eatsfine/domain/store/controller/StoreController.java index dbbcc4a6..7086ffbe 100644 --- a/src/main/java/com/eatsfine/eatsfine/domain/store/controller/StoreController.java +++ b/src/main/java/com/eatsfine/eatsfine/domain/store/controller/StoreController.java @@ -108,4 +108,16 @@ public ApiResponse getMainImage( return ApiResponse.of(StoreSuccessStatus._STORE_MAIN_IMAGE_GET_SUCCESS, storeQueryService.getMainImage(storeId)); } + @Operation( + summary = "내 가게 리스트 조회", + description = "사장님이 등록한 모든 가게 리스트를 조회합니다." + ) + @GetMapping("/stores/my") + @PreAuthorize("hasRole('OWNER')") + public ApiResponse getMyStores( + @CurrentUser User user + ) { + return ApiResponse.of(StoreSuccessStatus._STORE_FOUND, storeQueryService.getMyStores(user.getUsername())); + } + } diff --git a/src/main/java/com/eatsfine/eatsfine/domain/store/service/StoreQueryService.java b/src/main/java/com/eatsfine/eatsfine/domain/store/service/StoreQueryService.java index 513f7cf2..264db283 100644 --- a/src/main/java/com/eatsfine/eatsfine/domain/store/service/StoreQueryService.java +++ b/src/main/java/com/eatsfine/eatsfine/domain/store/service/StoreQueryService.java @@ -21,4 +21,6 @@ StoreResDto.StoreSearchResDto search( boolean isOpenNow(Store store, LocalDateTime now); + StoreResDto.MyStoreListDto getMyStores(String username); + } diff --git a/src/main/java/com/eatsfine/eatsfine/domain/store/service/StoreQueryServiceImpl.java b/src/main/java/com/eatsfine/eatsfine/domain/store/service/StoreQueryServiceImpl.java index 438946d5..76cc2416 100644 --- a/src/main/java/com/eatsfine/eatsfine/domain/store/service/StoreQueryServiceImpl.java +++ b/src/main/java/com/eatsfine/eatsfine/domain/store/service/StoreQueryServiceImpl.java @@ -1,6 +1,7 @@ package com.eatsfine.eatsfine.domain.store.service; import com.eatsfine.eatsfine.domain.businesshours.entity.BusinessHours; +import com.eatsfine.eatsfine.domain.booking.repository.BookingRepository; import com.eatsfine.eatsfine.domain.store.condition.StoreSearchCondition; import com.eatsfine.eatsfine.domain.store.converter.StoreConverter; import com.eatsfine.eatsfine.domain.store.dto.StoreResDto; @@ -9,6 +10,10 @@ import com.eatsfine.eatsfine.domain.store.exception.StoreException; import com.eatsfine.eatsfine.domain.store.repository.StoreRepository; import com.eatsfine.eatsfine.domain.store.status.StoreErrorStatus; +import com.eatsfine.eatsfine.domain.user.entity.User; +import com.eatsfine.eatsfine.domain.user.exception.UserException; +import com.eatsfine.eatsfine.domain.user.repository.UserRepository; +import com.eatsfine.eatsfine.domain.user.status.UserErrorStatus; import com.eatsfine.eatsfine.global.s3.S3Service; import lombok.RequiredArgsConstructor; import org.springframework.data.domain.Page; @@ -28,6 +33,8 @@ public class StoreQueryServiceImpl implements StoreQueryService { private final StoreRepository storeRepository; + private final BookingRepository bookingRepository; + private final UserRepository userRepository; private final S3Service s3Service; // 식당 검색 @@ -142,4 +149,24 @@ private boolean isEffectiveOpen(BusinessHours bh, LocalTime time, boolean isToda return false; // 영업 시간 자체가 아님 } + + @Override + public StoreResDto.MyStoreListDto getMyStores(String username) { + User user = userRepository.findByEmail(username) + .orElseThrow(() -> new UserException(UserErrorStatus.MEMBER_NOT_FOUND)); + + List myStores = storeRepository.findAllByOwner(user); + LocalDateTime now = LocalDateTime.now(); + + List storeDtos = myStores.stream() + .map(store -> { + boolean isOpen = isOpenNow(store, now); + Long totalBookingCount = bookingRepository.countActiveBookings(store); + String mainImageUrl = s3Service.toUrl(store.getMainImageKey()); + return StoreConverter.toMyStoreDto(store, isOpen, totalBookingCount, mainImageUrl); + }) + .toList(); + + return StoreConverter.toMyStoreListDto(storeDtos); + } } From 11b5c04b62afb30fa036647d8a70c9ed6c4e0bcf Mon Sep 17 00:00:00 2001 From: twodo0 Date: Thu, 12 Feb 2026 14:22:26 +0900 Subject: [PATCH 6/9] =?UTF-8?q?[REFACTOR]:=20=EB=82=B4=20=EA=B0=80?= =?UTF-8?q?=EA=B2=8C=20=EB=A6=AC=EC=8A=A4=ED=8A=B8=20=EC=A1=B0=ED=9A=8C=20?= =?UTF-8?q?=EC=9D=91=EB=8B=B5=20=EC=84=B1=EA=B3=B5=20=EC=BD=94=EB=93=9C=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../eatsfine/domain/store/controller/StoreController.java | 2 +- .../eatsfine/domain/store/status/StoreSuccessStatus.java | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/eatsfine/eatsfine/domain/store/controller/StoreController.java b/src/main/java/com/eatsfine/eatsfine/domain/store/controller/StoreController.java index 7086ffbe..36d90d0f 100644 --- a/src/main/java/com/eatsfine/eatsfine/domain/store/controller/StoreController.java +++ b/src/main/java/com/eatsfine/eatsfine/domain/store/controller/StoreController.java @@ -117,7 +117,7 @@ public ApiResponse getMainImage( public ApiResponse getMyStores( @CurrentUser User user ) { - return ApiResponse.of(StoreSuccessStatus._STORE_FOUND, storeQueryService.getMyStores(user.getUsername())); + return ApiResponse.of(StoreSuccessStatus._MY_STORE_LIST_FOUND, storeQueryService.getMyStores(user.getUsername())); } } diff --git a/src/main/java/com/eatsfine/eatsfine/domain/store/status/StoreSuccessStatus.java b/src/main/java/com/eatsfine/eatsfine/domain/store/status/StoreSuccessStatus.java index b581c921..cdda9922 100644 --- a/src/main/java/com/eatsfine/eatsfine/domain/store/status/StoreSuccessStatus.java +++ b/src/main/java/com/eatsfine/eatsfine/domain/store/status/StoreSuccessStatus.java @@ -22,7 +22,9 @@ public enum StoreSuccessStatus implements BaseCode { _STORE_MAIN_IMAGE_UPLOAD_SUCCESS(HttpStatus.OK, "STORE2005", "성공적으로 가게 대표 이미지를 업로드했습니다."), - _STORE_MAIN_IMAGE_GET_SUCCESS(HttpStatus.OK, "STORE2005", "성공적으로 가게 대표 이미지를 조회했습니다.") + _STORE_MAIN_IMAGE_GET_SUCCESS(HttpStatus.OK, "STORE2005", "성공적으로 가게 대표 이미지를 조회했습니다."), + + _MY_STORE_LIST_FOUND(HttpStatus.OK, "STORE2006", "성공적으로 내 가게 리스트를 조회했습니다.") ; From b4423613dba94f2b56fc9e3c3cc65d93405ab895 Mon Sep 17 00:00:00 2001 From: twodo0 Date: Thu, 12 Feb 2026 14:23:25 +0900 Subject: [PATCH 7/9] =?UTF-8?q?[FEAT]:=20N+1=20=EC=9D=B4=EC=8A=88=20?= =?UTF-8?q?=ED=95=B4=EA=B2=B0=EC=9D=84=20=EC=9C=84=ED=95=B4=20fetch=20join?= =?UTF-8?q?=20=EB=B0=8F=20=EB=B2=8C=ED=81=AC=20=EC=BF=BC=EB=A6=AC=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../booking/repository/BookingRepository.java | 8 ++++++++ .../store/converter/StoreConverter.java | 2 +- .../store/repository/StoreRepository.java | 1 + .../store/service/StoreQueryServiceImpl.java | 19 +++++++++++++++---- 4 files changed, 25 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/eatsfine/eatsfine/domain/booking/repository/BookingRepository.java b/src/main/java/com/eatsfine/eatsfine/domain/booking/repository/BookingRepository.java index 52db45c1..524d31e0 100644 --- a/src/main/java/com/eatsfine/eatsfine/domain/booking/repository/BookingRepository.java +++ b/src/main/java/com/eatsfine/eatsfine/domain/booking/repository/BookingRepository.java @@ -121,4 +121,12 @@ List findTableIdsWithFutureBookings( "com.eatsfine.eatsfine.domain.booking.enums.BookingStatus.PENDING, " + "com.eatsfine.eatsfine.domain.booking.enums.BookingStatus.COMPLETED)") Long countActiveBookings(@Param("store") Store store); + + @Query("select b.store.id, count(b) from Booking b " + + "where b.store in :stores " + + "and b.status in (com.eatsfine.eatsfine.domain.booking.enums.BookingStatus.CONFIRMED, " + + "com.eatsfine.eatsfine.domain.booking.enums.BookingStatus.PENDING, " + + "com.eatsfine.eatsfine.domain.booking.enums.BookingStatus.COMPLETED) " + + "group by b.store.id") + List countActiveBookingsByStores(@Param("stores") List stores); } diff --git a/src/main/java/com/eatsfine/eatsfine/domain/store/converter/StoreConverter.java b/src/main/java/com/eatsfine/eatsfine/domain/store/converter/StoreConverter.java index cce36f5f..ea61beea 100644 --- a/src/main/java/com/eatsfine/eatsfine/domain/store/converter/StoreConverter.java +++ b/src/main/java/com/eatsfine/eatsfine/domain/store/converter/StoreConverter.java @@ -80,7 +80,7 @@ public static StoreResDto.GetMainImageDto toGetMainImageDto(Long storeId, String .build(); } - public static StoreResDto.MyStoreDto toMyStoreDto(Store store, boolean isOpenNow, Long totalBookingCount, String mainImageUrl) { + public static StoreResDto.MyStoreDto toMyStoreDto(Store store, boolean isOpenNow, String mainImageUrl, Long totalBookingCount) { return StoreResDto.MyStoreDto.builder() .storeId(store.getId()) .storeName(store.getStoreName()) diff --git a/src/main/java/com/eatsfine/eatsfine/domain/store/repository/StoreRepository.java b/src/main/java/com/eatsfine/eatsfine/domain/store/repository/StoreRepository.java index 0e2bb64d..193429d9 100644 --- a/src/main/java/com/eatsfine/eatsfine/domain/store/repository/StoreRepository.java +++ b/src/main/java/com/eatsfine/eatsfine/domain/store/repository/StoreRepository.java @@ -21,6 +21,7 @@ public interface StoreRepository extends JpaRepository, StoreReposi """) Optional findByIdWithMenus(@Param("id") Long id); + @Query("select s from Store s left join fetch s.businessHours where s.owner = :owner") List findAllByOwner(User owner); } \ No newline at end of file diff --git a/src/main/java/com/eatsfine/eatsfine/domain/store/service/StoreQueryServiceImpl.java b/src/main/java/com/eatsfine/eatsfine/domain/store/service/StoreQueryServiceImpl.java index 76cc2416..5c5e53ff 100644 --- a/src/main/java/com/eatsfine/eatsfine/domain/store/service/StoreQueryServiceImpl.java +++ b/src/main/java/com/eatsfine/eatsfine/domain/store/service/StoreQueryServiceImpl.java @@ -26,6 +26,8 @@ import java.time.LocalDateTime; import java.time.LocalTime; import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; @Service @RequiredArgsConstructor @@ -151,19 +153,28 @@ private boolean isEffectiveOpen(BusinessHours bh, LocalTime time, boolean isToda } @Override - public StoreResDto.MyStoreListDto getMyStores(String username) { - User user = userRepository.findByEmail(username) + public StoreResDto.MyStoreListDto getMyStores(String email) { + User user = userRepository.findByEmail(email) .orElseThrow(() -> new UserException(UserErrorStatus.MEMBER_NOT_FOUND)); List myStores = storeRepository.findAllByOwner(user); + + // N+1 문제 해결을 위한 Bulk Query 실행 + List bookingCounts = bookingRepository.countActiveBookingsByStores(myStores); + Map bookingCountMap = bookingCounts.stream() + .collect(Collectors.toMap( + row -> (Long) row[0], + row -> (Long) row[1] + )); + LocalDateTime now = LocalDateTime.now(); List storeDtos = myStores.stream() .map(store -> { boolean isOpen = isOpenNow(store, now); - Long totalBookingCount = bookingRepository.countActiveBookings(store); + Long totalBookingCount = bookingCountMap.getOrDefault(store.getId(), 0L); String mainImageUrl = s3Service.toUrl(store.getMainImageKey()); - return StoreConverter.toMyStoreDto(store, isOpen, totalBookingCount, mainImageUrl); + return StoreConverter.toMyStoreDto(store, isOpen, mainImageUrl, totalBookingCount); }) .toList(); From c3a7c4ed7fc11d4b368cba9ed66a1d296f84cf85 Mon Sep 17 00:00:00 2001 From: twodo0 Date: Thu, 12 Feb 2026 14:35:06 +0900 Subject: [PATCH 8/9] =?UTF-8?q?[FIX]:=20=EA=B0=80=EA=B2=8C=20=EC=9D=91?= =?UTF-8?q?=EB=8B=B5=20=EC=84=B1=EA=B3=B5=20=EC=BD=94=EB=93=9C=20=EC=A4=91?= =?UTF-8?q?=EB=B3=B5=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../eatsfine/domain/store/status/StoreSuccessStatus.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/eatsfine/eatsfine/domain/store/status/StoreSuccessStatus.java b/src/main/java/com/eatsfine/eatsfine/domain/store/status/StoreSuccessStatus.java index cdda9922..95431628 100644 --- a/src/main/java/com/eatsfine/eatsfine/domain/store/status/StoreSuccessStatus.java +++ b/src/main/java/com/eatsfine/eatsfine/domain/store/status/StoreSuccessStatus.java @@ -22,9 +22,9 @@ public enum StoreSuccessStatus implements BaseCode { _STORE_MAIN_IMAGE_UPLOAD_SUCCESS(HttpStatus.OK, "STORE2005", "성공적으로 가게 대표 이미지를 업로드했습니다."), - _STORE_MAIN_IMAGE_GET_SUCCESS(HttpStatus.OK, "STORE2005", "성공적으로 가게 대표 이미지를 조회했습니다."), + _STORE_MAIN_IMAGE_GET_SUCCESS(HttpStatus.OK, "STORE2006", "성공적으로 가게 대표 이미지를 조회했습니다."), - _MY_STORE_LIST_FOUND(HttpStatus.OK, "STORE2006", "성공적으로 내 가게 리스트를 조회했습니다.") + _MY_STORE_LIST_FOUND(HttpStatus.OK, "STORE2007", "성공적으로 내 가게 리스트를 조회했습니다.") ; From 1451dda5540fa57c079f1265e6db05270494b17b Mon Sep 17 00:00:00 2001 From: twodo0 Date: Thu, 12 Feb 2026 14:35:39 +0900 Subject: [PATCH 9/9] =?UTF-8?q?[FEAT]:=20=EB=82=B4=20=EA=B0=80=EA=B2=8C=20?= =?UTF-8?q?=EB=A6=AC=EC=8A=A4=ED=8A=B8=20=EC=A1=B0=ED=9A=8C=20=EC=8B=9C=20?= =?UTF-8?q?=EB=B9=88=20=EB=A6=AC=EC=8A=A4=ED=8A=B8=20=EB=B0=A9=EC=96=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/store/service/StoreQueryServiceImpl.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/eatsfine/eatsfine/domain/store/service/StoreQueryServiceImpl.java b/src/main/java/com/eatsfine/eatsfine/domain/store/service/StoreQueryServiceImpl.java index 5c5e53ff..a8e475cb 100644 --- a/src/main/java/com/eatsfine/eatsfine/domain/store/service/StoreQueryServiceImpl.java +++ b/src/main/java/com/eatsfine/eatsfine/domain/store/service/StoreQueryServiceImpl.java @@ -152,13 +152,17 @@ private boolean isEffectiveOpen(BusinessHours bh, LocalTime time, boolean isToda return false; // 영업 시간 자체가 아님 } + // 내 가게 리스트 조회 @Override public StoreResDto.MyStoreListDto getMyStores(String email) { User user = userRepository.findByEmail(email) .orElseThrow(() -> new UserException(UserErrorStatus.MEMBER_NOT_FOUND)); List myStores = storeRepository.findAllByOwner(user); - + + if(myStores.isEmpty()) { + return StoreConverter.toMyStoreListDto(List.of()); + } // N+1 문제 해결을 위한 Bulk Query 실행 List bookingCounts = bookingRepository.countActiveBookingsByStores(myStores); Map bookingCountMap = bookingCounts.stream()