From a93d08373dab81b4c13a199d7268a01da5fdefeb Mon Sep 17 00:00:00 2001 From: kang Date: Thu, 26 Sep 2024 12:15:39 +0900 Subject: [PATCH] chore: delete unnecessary query --- .../java/co/orange/ddanzi/service/MyPageService.java | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/main/java/co/orange/ddanzi/service/MyPageService.java b/src/main/java/co/orange/ddanzi/service/MyPageService.java index 3637645..a928906 100644 --- a/src/main/java/co/orange/ddanzi/service/MyPageService.java +++ b/src/main/java/co/orange/ddanzi/service/MyPageService.java @@ -1,9 +1,5 @@ package co.orange.ddanzi.service; -import co.orange.ddanzi.common.exception.PaymentNotFoundException; -import co.orange.ddanzi.domain.order.Order; -import co.orange.ddanzi.domain.order.Payment; -import co.orange.ddanzi.domain.product.Discount; import co.orange.ddanzi.domain.product.Product; import co.orange.ddanzi.domain.user.User; import co.orange.ddanzi.dto.common.ProductInfo; @@ -11,17 +7,13 @@ import co.orange.ddanzi.common.response.ApiResponse; import co.orange.ddanzi.common.response.Success; import co.orange.ddanzi.global.jwt.AuthUtils; -import co.orange.ddanzi.repository.DiscountRepository; import co.orange.ddanzi.repository.InterestProductRepository; -import co.orange.ddanzi.repository.OrderRepository; -import co.orange.ddanzi.repository.PaymentRepository; import jakarta.transaction.Transactional; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -62,11 +54,10 @@ public ApiResponse getMyOrder(){ @Transactional public ApiResponse getMyItem(){ User user = authUtils.getUser(); - Integer totalCount = itemService.getMyItemCount(user); List myItemList = itemService.getMyItemList(user); MyItemResponseDto responseDto = MyItemResponseDto.builder() - .totalCount(totalCount) + .totalCount(myItemList.size()) .itemProductList(myItemList) .build(); return ApiResponse.onSuccess(Success.GET_MY_ITEM_LIST_SUCCESS, responseDto);