Skip to content

Commit e098ba8

Browse files
authored
Merge pull request #106 from LeeSM0518/DVK-121-notification-confirmation-api-modifications
[DVK-121] fix: 알림 확인 API 수정
2 parents 2d1a2d5 + f72a834 commit e098ba8

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
package com.devooks.backend.notification.v1.adapter.`in`.dto
22

3+
import io.swagger.v3.oas.annotations.media.Schema
4+
35
data class CheckNotificationResponse(
4-
val count: Int,
6+
@Schema(description = "확인하지 않은 알림 개수")
7+
val countOfUncheckedNotification: Int,
58
)

src/main/kotlin/com/devooks/backend/notification/v1/adapter/in/http/NotificationRouter.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,9 @@ class NotificationRouter(
7373
): CheckNotificationResponse {
7474
val memberId = tokenService.getMemberId(Authorization(authorization))
7575
val request = CheckNotificationsRequest(memberId, notificationId)
76-
val size: Int = modifyNotificationUseCase.check(request)
77-
return CheckNotificationResponse(size)
76+
modifyNotificationUseCase.check(request)
77+
val count = getNotificationUseCase.getCountOfUnchecked(memberId)
78+
return CheckNotificationResponse(count)
7879
}
7980

8081
private suspend fun getCountOfUncheckedNotifications(memberId: UUID): ServerSentEvent<StreamCountResponse> {

src/test/kotlin/com/devooks/backend/notification/v1/adapter/in/http/NotificationRouterTest.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,10 @@ internal class NotificationRouterTest @Autowired constructor(
125125
.expectBody<CheckNotificationResponse>()
126126
.returnResult()
127127
.responseBody!!
128-
.count
128+
.countOfUncheckedNotification
129129

130130
// then
131-
assertThat(count).isOne()
131+
assertThat(count).isZero()
132132
}
133133

134134
@Test
@@ -147,9 +147,9 @@ internal class NotificationRouterTest @Autowired constructor(
147147
.expectBody<CheckNotificationResponse>()
148148
.returnResult()
149149
.responseBody!!
150-
.count
150+
.countOfUncheckedNotification
151151

152152
// then
153-
assertThat(count).isOne()
153+
assertThat(count).isZero()
154154
}
155155
}

0 commit comments

Comments
 (0)