Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.ssak3.timeattack.notifications.client

import org.springframework.cloud.openfeign.FeignClient
import org.springframework.stereotype.Component
import org.springframework.web.bind.annotation.PostMapping

@Component
@FeignClient(
name = "mockerServerClient",
url = "https://b38da56d-1531-48f9-8ffa-e79114e64f31.mock.pstmn.io/fcm-message/send",
)
interface MockServerClient {
/**
* mock server 를 통한 fcm 메시지 발송
*/
@PostMapping
fun sendFcmMessageMock()
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.ssak3.timeattack.notifications.service

import com.ssak3.timeattack.common.utils.Logger
import com.ssak3.timeattack.external.firebase.domain.DevicePlatform
import com.ssak3.timeattack.notifications.client.MockServerClient
import com.ssak3.timeattack.notifications.domain.FcmMessage
import com.ssak3.timeattack.notifications.domain.FcmNotificationConstants.getRoute
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
Expand All @@ -16,6 +17,7 @@ class PushNotificationScheduler(
private val pushNotificationService: PushNotificationService,
private val fcmDeviceService: FcmDeviceService,
private val fcmPushNotificationService: FcmPushNotificationService,
private val mockServerClient: MockServerClient,
) : Logger {
@Scheduled(cron = "0 0/1 * * * ?") // 1분 단위 prod 테스트를 위해 임시로 변경
fun sendNotifications() {
Expand All @@ -37,7 +39,7 @@ class PushNotificationScheduler(
title = it.task.name,
)

fcmPushNotificationService.sendNotification(message)
mockServerClient.sendFcmMessageMock()
}
}
}
Expand Down
Loading