Skip to content

Commit

Permalink
[+] add notification logging
Browse files Browse the repository at this point in the history
  • Loading branch information
zavyalov-daniil committed Mar 7, 2024
1 parent 921aee6 commit e7abdc0
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@ package office.effective.features.notifications.routes
import io.github.smiley4.ktorswaggerui.dsl.route
import io.ktor.http.*
import io.ktor.server.application.*
import io.ktor.server.request.*
import io.ktor.server.response.*
import io.ktor.server.routing.*
import office.effective.common.notifications.FcmNotificationSender
import office.effective.common.notifications.INotificationSender
import org.koin.core.context.GlobalContext
import org.slf4j.LoggerFactory

/**
* Route for Google calendar push notifications
Expand All @@ -16,6 +19,8 @@ fun Route.calendarNotificationsRouting() {
val messageSender: INotificationSender = GlobalContext.get().get()

post() {
val logger = LoggerFactory.getLogger(FcmNotificationSender::class.java)
logger.info("[calendarNotificationsRouting] received push notification: \n{}", call.receive<String>())
messageSender.sendEmptyMessage("booking")
call.respond(HttpStatusCode.OK)
}
Expand Down

0 comments on commit e7abdc0

Please sign in to comment.