From 370869af6200c9e9e2c2ca8db9d375ff253ff3ce Mon Sep 17 00:00:00 2001 From: usbharu <64310155+usbharu@users.noreply.github.com> Date: Mon, 29 Jan 2024 20:55:08 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=E3=83=87=E3=83=95=E3=82=A9=E3=83=AB?= =?UTF-8?q?=E3=83=88=E5=BC=95=E6=95=B0=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../infrastructure/exposed/Page.kt | 24 ++++++++++++------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/src/main/kotlin/dev/usbharu/hideout/application/infrastructure/exposed/Page.kt b/src/main/kotlin/dev/usbharu/hideout/application/infrastructure/exposed/Page.kt index 33902372..cff9e245 100644 --- a/src/main/kotlin/dev/usbharu/hideout/application/infrastructure/exposed/Page.kt +++ b/src/main/kotlin/dev/usbharu/hideout/application/infrastructure/exposed/Page.kt @@ -23,14 +23,20 @@ sealed class Page { } companion object { - fun of(maxId: Long?, sinceId: Long?, minId: Long?, limit: Int?): Page = if (minId != null) { - PageByMinId( - maxId, minId, limit - ) - } else { - PageByMaxId( - maxId, sinceId, limit - ) - } + fun of( + maxId: Long? = null, + sinceId: Long? = null, + minId: Long? = null, + limit: Int? = null + ): Page = + if (minId != null) { + PageByMinId( + maxId, minId, limit + ) + } else { + PageByMaxId( + maxId, sinceId, limit + ) + } } }