From cd9e596894c42ee87a5e34d8ca3e3ca26f3bd231 Mon Sep 17 00:00:00 2001 From: "tae.y" <0211ilyoil@gmail.com> Date: Fri, 27 Sep 2024 20:13:39 +0900 Subject: [PATCH 1/3] =?UTF-8?q?chore=20::=20=EC=99=B8=EC=B6=9C=20=EC=A1=B0?= =?UTF-8?q?=ED=9A=8C=20=EC=A0=9C=EC=95=BD=EC=A1=B0=EA=B1=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/outing/service/GetOutingServiceImpl.kt | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/dms-core/src/main/kotlin/team/aliens/dms/domain/outing/service/GetOutingServiceImpl.kt b/dms-core/src/main/kotlin/team/aliens/dms/domain/outing/service/GetOutingServiceImpl.kt index 70b19f62e..6de975c4e 100644 --- a/dms-core/src/main/kotlin/team/aliens/dms/domain/outing/service/GetOutingServiceImpl.kt +++ b/dms-core/src/main/kotlin/team/aliens/dms/domain/outing/service/GetOutingServiceImpl.kt @@ -16,6 +16,7 @@ import team.aliens.dms.domain.outing.spi.vo.OutingCompanionDetailsVO import team.aliens.dms.domain.outing.spi.vo.OutingHistoryVO import java.time.DayOfWeek import java.time.LocalDate +import java.time.LocalTime import java.util.UUID @Service @@ -39,9 +40,11 @@ class GetOutingServiceImpl( override fun getAllOutingApplicationVOsBetweenStartAndEnd(start: LocalDate, end: LocalDate) = queryOutingApplicationPort.queryAllOutingApplicationVOsBetweenStartAndEnd(start, end) - override fun getCurrentOutingApplication(studentId: UUID): CurrentOutingApplicationVO = - queryOutingApplicationPort.queryCurrentOutingApplicationVO(studentId) - ?: throw OutingApplicationNotFoundException + override fun getCurrentOutingApplication(studentId: UUID): CurrentOutingApplicationVO { + checkQueryAble() + return queryOutingApplicationPort.queryCurrentOutingApplicationVO(studentId) + ?: throw OutingApplicationNotFoundException + } override fun getOutingHistoriesByStudentNameAndDate( studentName: String?, @@ -60,4 +63,10 @@ class GetOutingServiceImpl( override fun getOutingAvailableTimeById(outingAvailableTimeId: UUID): OutingAvailableTime = queryOutingAvailableTimePort.queryOutingAvailableTimeById(outingAvailableTimeId) ?: throw OutingAvailableTimeNotFoundException + + private fun checkQueryAble(): Boolean { + val currentTime = LocalTime.now() + + return currentTime.isBefore(LocalTime.of(20, 0)) + } } From 1c5be04aa47ed18134d582401d2645c9c6723108 Mon Sep 17 00:00:00 2001 From: "tae.y" <0211ilyoil@gmail.com> Date: Fri, 27 Sep 2024 20:20:51 +0900 Subject: [PATCH 2/3] =?UTF-8?q?chore:=20(#770)=20checkService=EB=A1=9C=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../aliens/dms/domain/outing/service/CheckOutingService.kt | 2 ++ .../dms/domain/outing/service/CheckOutingServiceImpl.kt | 6 ++++++ .../dms/domain/outing/service/GetOutingServiceImpl.kt | 6 ------ .../outing/usecase/GetCurrentOutingApplicationUseCase.kt | 1 + 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/dms-core/src/main/kotlin/team/aliens/dms/domain/outing/service/CheckOutingService.kt b/dms-core/src/main/kotlin/team/aliens/dms/domain/outing/service/CheckOutingService.kt index 077fc5830..491dd92ff 100644 --- a/dms-core/src/main/kotlin/team/aliens/dms/domain/outing/service/CheckOutingService.kt +++ b/dms-core/src/main/kotlin/team/aliens/dms/domain/outing/service/CheckOutingService.kt @@ -22,4 +22,6 @@ interface CheckOutingService { outingTime: LocalTime, arrivalTime: LocalTime ) + + fun checkQueryAble() : Boolean } diff --git a/dms-core/src/main/kotlin/team/aliens/dms/domain/outing/service/CheckOutingServiceImpl.kt b/dms-core/src/main/kotlin/team/aliens/dms/domain/outing/service/CheckOutingServiceImpl.kt index d61ab6ad0..0b339e285 100644 --- a/dms-core/src/main/kotlin/team/aliens/dms/domain/outing/service/CheckOutingServiceImpl.kt +++ b/dms-core/src/main/kotlin/team/aliens/dms/domain/outing/service/CheckOutingServiceImpl.kt @@ -66,4 +66,10 @@ class CheckOutingServiceImpl( } } } + + override fun checkQueryAble(): Boolean { + val currentTime = LocalTime.now() + + return currentTime.isBefore(LocalTime.of(20, 0)) + } } diff --git a/dms-core/src/main/kotlin/team/aliens/dms/domain/outing/service/GetOutingServiceImpl.kt b/dms-core/src/main/kotlin/team/aliens/dms/domain/outing/service/GetOutingServiceImpl.kt index 6de975c4e..37a887082 100644 --- a/dms-core/src/main/kotlin/team/aliens/dms/domain/outing/service/GetOutingServiceImpl.kt +++ b/dms-core/src/main/kotlin/team/aliens/dms/domain/outing/service/GetOutingServiceImpl.kt @@ -41,7 +41,6 @@ class GetOutingServiceImpl( queryOutingApplicationPort.queryAllOutingApplicationVOsBetweenStartAndEnd(start, end) override fun getCurrentOutingApplication(studentId: UUID): CurrentOutingApplicationVO { - checkQueryAble() return queryOutingApplicationPort.queryCurrentOutingApplicationVO(studentId) ?: throw OutingApplicationNotFoundException } @@ -64,9 +63,4 @@ class GetOutingServiceImpl( queryOutingAvailableTimePort.queryOutingAvailableTimeById(outingAvailableTimeId) ?: throw OutingAvailableTimeNotFoundException - private fun checkQueryAble(): Boolean { - val currentTime = LocalTime.now() - - return currentTime.isBefore(LocalTime.of(20, 0)) - } } diff --git a/dms-core/src/main/kotlin/team/aliens/dms/domain/outing/usecase/GetCurrentOutingApplicationUseCase.kt b/dms-core/src/main/kotlin/team/aliens/dms/domain/outing/usecase/GetCurrentOutingApplicationUseCase.kt index f2c19916c..dbf729fb8 100644 --- a/dms-core/src/main/kotlin/team/aliens/dms/domain/outing/usecase/GetCurrentOutingApplicationUseCase.kt +++ b/dms-core/src/main/kotlin/team/aliens/dms/domain/outing/usecase/GetCurrentOutingApplicationUseCase.kt @@ -14,6 +14,7 @@ class GetCurrentOutingApplicationUseCase( fun execute(): GetCurrentOutingApplicationResponse { val student = studentService.getCurrentStudent() + outingService.checkQueryAble() val currentOutingApplicationVO = outingService.getCurrentOutingApplication(student.id) return GetCurrentOutingApplicationResponse.of(currentOutingApplicationVO, student.name) From 109855087029e3a9ffb9e12f33d1edf46400d9e8 Mon Sep 17 00:00:00 2001 From: "tae.y" <0211ilyoil@gmail.com> Date: Fri, 27 Sep 2024 20:27:02 +0900 Subject: [PATCH 3/3] =?UTF-8?q?chore:=20(#770)=20=EB=A9=94=EC=84=9C?= =?UTF-8?q?=EB=93=9C=20=EB=AA=85=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../aliens/dms/domain/outing/service/CheckOutingService.kt | 2 +- .../aliens/dms/domain/outing/service/CheckOutingServiceImpl.kt | 2 +- .../outing/usecase/GetCurrentOutingApplicationUseCase.kt | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/dms-core/src/main/kotlin/team/aliens/dms/domain/outing/service/CheckOutingService.kt b/dms-core/src/main/kotlin/team/aliens/dms/domain/outing/service/CheckOutingService.kt index 491dd92ff..c2a331bdc 100644 --- a/dms-core/src/main/kotlin/team/aliens/dms/domain/outing/service/CheckOutingService.kt +++ b/dms-core/src/main/kotlin/team/aliens/dms/domain/outing/service/CheckOutingService.kt @@ -23,5 +23,5 @@ interface CheckOutingService { arrivalTime: LocalTime ) - fun checkQueryAble() : Boolean + fun checkOutingApplicationQueryAble() : Boolean } diff --git a/dms-core/src/main/kotlin/team/aliens/dms/domain/outing/service/CheckOutingServiceImpl.kt b/dms-core/src/main/kotlin/team/aliens/dms/domain/outing/service/CheckOutingServiceImpl.kt index 0b339e285..9b1b544a2 100644 --- a/dms-core/src/main/kotlin/team/aliens/dms/domain/outing/service/CheckOutingServiceImpl.kt +++ b/dms-core/src/main/kotlin/team/aliens/dms/domain/outing/service/CheckOutingServiceImpl.kt @@ -67,7 +67,7 @@ class CheckOutingServiceImpl( } } - override fun checkQueryAble(): Boolean { + override fun checkOutingApplicationQueryAble(): Boolean { val currentTime = LocalTime.now() return currentTime.isBefore(LocalTime.of(20, 0)) diff --git a/dms-core/src/main/kotlin/team/aliens/dms/domain/outing/usecase/GetCurrentOutingApplicationUseCase.kt b/dms-core/src/main/kotlin/team/aliens/dms/domain/outing/usecase/GetCurrentOutingApplicationUseCase.kt index dbf729fb8..880ac20d2 100644 --- a/dms-core/src/main/kotlin/team/aliens/dms/domain/outing/usecase/GetCurrentOutingApplicationUseCase.kt +++ b/dms-core/src/main/kotlin/team/aliens/dms/domain/outing/usecase/GetCurrentOutingApplicationUseCase.kt @@ -14,7 +14,8 @@ class GetCurrentOutingApplicationUseCase( fun execute(): GetCurrentOutingApplicationResponse { val student = studentService.getCurrentStudent() - outingService.checkQueryAble() + outingService.checkOutingApplicationQueryAble() + val currentOutingApplicationVO = outingService.getCurrentOutingApplication(student.id) return GetCurrentOutingApplicationResponse.of(currentOutingApplicationVO, student.name)