From b3ffa52e8fff414bf32f97e4587847993d850195 Mon Sep 17 00:00:00 2001 From: belljun3395 <195850@jnu.ac.kr> Date: Wed, 25 Sep 2024 22:55:41 +0900 Subject: [PATCH] =?UTF-8?q?[Fix/#413]=20=ED=8F=89=EC=9D=BC=EC=97=90=20?= =?UTF-8?q?=EB=A7=A4=EC=9D=BC=20=EC=A0=84=EC=86=A1=20=EC=84=A4=EC=A0=95?= =?UTF-8?q?=ED=95=9C=20=EA=B5=AC=EB=8F=85=EC=9D=B4=20=EB=B3=B4=EB=82=B4?= =?UTF-8?q?=EC=A7=80=EC=A7=80=20=EC=95=8A=EB=8A=94=20=EB=AC=B8=EC=A0=9C=20?= =?UTF-8?q?=ED=95=B4=EA=B2=B0=20(#414)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../article/reader/WorkBookSubscriberReader.kt | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/batch/src/main/kotlin/com/few/batch/service/article/reader/WorkBookSubscriberReader.kt b/batch/src/main/kotlin/com/few/batch/service/article/reader/WorkBookSubscriberReader.kt index 3936a537f..4f018f1ab 100644 --- a/batch/src/main/kotlin/com/few/batch/service/article/reader/WorkBookSubscriberReader.kt +++ b/batch/src/main/kotlin/com/few/batch/service/article/reader/WorkBookSubscriberReader.kt @@ -45,10 +45,19 @@ class WorkBookSubscriberReader( } private fun sendDayCondition(sendDayField: TableField, sendDayCode: BatchDayCode): Condition { - return if (sendDayCode == BatchDayCode.MON_TUE_WED_THU_FRI_SAT_SUN) { - sendDayField.eq(BatchDayCode.MON_TUE_WED_THU_FRI.code).or(sendDayField.eq(BatchDayCode.MON_TUE_WED_THU_FRI_SAT_SUN.code)) - } else { - sendDayField.eq(sendDayCode.code) + return when (sendDayCode) { + /** 평일인 경우 매일을 포함하여 전송한다 */ + BatchDayCode.MON_TUE_WED_THU_FRI -> { + sendDayField.eq(BatchDayCode.MON_TUE_WED_THU_FRI.code) + .or(sendDayField.eq(BatchDayCode.MON_TUE_WED_THU_FRI_SAT_SUN.code)) + } + /** 매일의 경우 매일만 전송한다 */ + BatchDayCode.MON_TUE_WED_THU_FRI_SAT_SUN -> { + sendDayField.eq(BatchDayCode.MON_TUE_WED_THU_FRI_SAT_SUN.code) + } + else -> { + throw IllegalArgumentException("Invalid sendDayCode: $sendDayCode") + } } } } \ No newline at end of file