diff --git a/src/main/kotlin/com/hero/alignlab/domain/notification/application/PoseNotificationService.kt b/src/main/kotlin/com/hero/alignlab/domain/notification/application/PoseNotificationService.kt index fb68ab5..68cf17f 100644 --- a/src/main/kotlin/com/hero/alignlab/domain/notification/application/PoseNotificationService.kt +++ b/src/main/kotlin/com/hero/alignlab/domain/notification/application/PoseNotificationService.kt @@ -22,16 +22,10 @@ class PoseNotificationService( private val txTemplates: TransactionTemplates, ) { suspend fun getNotification(user: AuthUser): GetPoseNotificationResponse? { - val poseNotification = findByUidAndIsActiveOrNull(user.uid, true) ?: return null + val poseNotification = findByUidOrNull(user.uid) ?: return null return GetPoseNotificationResponse.from(poseNotification) } - suspend fun findByUidAndIsActiveOrNull(uid: Long, isActive: Boolean): PoseNotification? { - return withContext(Dispatchers.IO) { - poseNotificationRepository.findByUidAndIsActive(uid, isActive) - } - } - suspend fun registerNotification( user: AuthUser, request: RegisterPoseNotificationRequest diff --git a/src/main/kotlin/com/hero/alignlab/domain/notification/model/request/PatchPoseNotificationRequest.kt b/src/main/kotlin/com/hero/alignlab/domain/notification/model/request/PatchPoseNotificationRequest.kt index e0d0eed..c4fd3a1 100644 --- a/src/main/kotlin/com/hero/alignlab/domain/notification/model/request/PatchPoseNotificationRequest.kt +++ b/src/main/kotlin/com/hero/alignlab/domain/notification/model/request/PatchPoseNotificationRequest.kt @@ -3,6 +3,8 @@ package com.hero.alignlab.domain.notification.model.request import com.hero.alignlab.domain.notification.domain.vo.PoseNotificationDuration data class PatchPoseNotificationRequest( + /** 자세 알림 활성화 여부 */ val isActive: Boolean?, + /** 자세 알림 주기 */ val duration: PoseNotificationDuration? ) diff --git a/src/main/kotlin/com/hero/alignlab/domain/notification/model/request/RegisterPoseNotificationRequest.kt b/src/main/kotlin/com/hero/alignlab/domain/notification/model/request/RegisterPoseNotificationRequest.kt index ea37b75..01c8960 100644 --- a/src/main/kotlin/com/hero/alignlab/domain/notification/model/request/RegisterPoseNotificationRequest.kt +++ b/src/main/kotlin/com/hero/alignlab/domain/notification/model/request/RegisterPoseNotificationRequest.kt @@ -3,6 +3,8 @@ package com.hero.alignlab.domain.notification.model.request import com.hero.alignlab.domain.notification.domain.vo.PoseNotificationDuration data class RegisterPoseNotificationRequest( + /** 자세 알림 활성화 여부 */ val isActive: Boolean, + /** 자세 알림 주기 */ val duration: PoseNotificationDuration, ) diff --git a/src/main/kotlin/com/hero/alignlab/domain/notification/resource/PoseNotificationResource.kt b/src/main/kotlin/com/hero/alignlab/domain/notification/resource/PoseNotificationResource.kt index 6d3e05a..c8dac17 100644 --- a/src/main/kotlin/com/hero/alignlab/domain/notification/resource/PoseNotificationResource.kt +++ b/src/main/kotlin/com/hero/alignlab/domain/notification/resource/PoseNotificationResource.kt @@ -19,8 +19,7 @@ class PoseNotificationResource( ) { /** * **저장된 자세 알림 정보를 조회** - * - 활성화된 데이터가 있는 경우에만, 데이터를 제공 - * - 비활성화된 경우에는, 빈 데이터를 제공 + * - 조회되는 데이터가 없는 경우, 빈 데이터를 제공 * - duration * - IMMEDIATELY : 즉시 * - MIN_15 : 15분 @@ -34,7 +33,7 @@ class PoseNotificationResource( user: AuthUser, ) = poseNotificationService.getNotification(user).wrapOk() - @Operation(summary = "자세 알림 등록 또는 수정") + @Operation(summary = "자세 알림 등록") @PostMapping(path = ["/api/v1/pose-notifications"]) suspend fun registerPoseNotification( user: AuthUser,