From bac405f9ac07ea91ef6968e1cf27a599d784aad5 Mon Sep 17 00:00:00 2001 From: TaeyeonRoyce Date: Fri, 17 May 2024 11:44:31 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20=EC=A3=BC=EB=AC=B8=20=ED=8E=98?= =?UTF-8?q?=EC=9D=B4=EC=A7=95=20=EC=A1=B0=ED=9A=8C=20=EC=83=81=ED=95=9C=20?= =?UTF-8?q?=EA=B0=9C=EC=88=98=20=EC=A1=B0=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/petqua/domain/order/OrderCustomRepository.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/com/petqua/domain/order/OrderCustomRepository.kt b/src/main/kotlin/com/petqua/domain/order/OrderCustomRepository.kt index c780de1e..d9cee0ca 100644 --- a/src/main/kotlin/com/petqua/domain/order/OrderCustomRepository.kt +++ b/src/main/kotlin/com/petqua/domain/order/OrderCustomRepository.kt @@ -2,11 +2,12 @@ package com.petqua.domain.order import com.petqua.common.domain.dto.DEFAULT_LAST_VIEWED_ID import com.petqua.common.domain.dto.PADDING_FOR_HAS_NEXT_PAGE -import com.petqua.common.domain.dto.PAGING_LIMIT_CEILING + +private const val ORDER_PAGING_LIMIT_CEILING = 5 data class OrderPaging( val lastViewedId: Long? = null, - val limit: Int = PAGING_LIMIT_CEILING, + val limit: Int = ORDER_PAGING_LIMIT_CEILING, val lastViewedOrderNumber: OrderNumber? = null, ) { @@ -17,7 +18,7 @@ data class OrderPaging( lastViewedOrderNumber: OrderNumber?, ): OrderPaging { val adjustedLastViewedId = if (lastViewedId == DEFAULT_LAST_VIEWED_ID) null else lastViewedId - val adjustedLimit = if (limit > PAGING_LIMIT_CEILING) PAGING_LIMIT_CEILING else limit + val adjustedLimit = if (limit > ORDER_PAGING_LIMIT_CEILING) ORDER_PAGING_LIMIT_CEILING else limit return OrderPaging(adjustedLastViewedId, adjustedLimit + PADDING_FOR_HAS_NEXT_PAGE, lastViewedOrderNumber) } }