From 2750b3d25edfc858c366876717d69bb15b100159 Mon Sep 17 00:00:00 2001 From: Palash Biswas Date: Thu, 1 Dec 2022 19:35:26 +0530 Subject: [PATCH] BMC: Add from body attribute into GetNotification method --- .../FirebaseCloudMessaging/Dto/NotificationModel.cs | 2 +- .../FirebaseNotificationAppService.cs | 6 ++---- .../BCS.BMC.Web.Mvc/Controllers/NotificationController.cs | 4 ++-- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/BCS.BMC/src/BCS.BMC.Application/FirebaseCloudMessaging/Dto/NotificationModel.cs b/BCS.BMC/src/BCS.BMC.Application/FirebaseCloudMessaging/Dto/NotificationModel.cs index e149d2d..fb9e70a 100644 --- a/BCS.BMC/src/BCS.BMC.Application/FirebaseCloudMessaging/Dto/NotificationModel.cs +++ b/BCS.BMC/src/BCS.BMC.Application/FirebaseCloudMessaging/Dto/NotificationModel.cs @@ -13,7 +13,7 @@ namespace BCS.BMC.FirebaseCloudMessaging.Dto //public string DeviceId { get; set; } //[JsonProperty("isAndroidDevice")] //public bool IsAndroidDevice { get; set; } - //[JsonProperty("title")] + [JsonProperty("title")] public string Title { get; set; } [JsonProperty("body")] public string Body { get; set; } diff --git a/BCS.BMC/src/BCS.BMC.Application/FirebaseCloudMessaging/FirebaseNotificationAppService.cs b/BCS.BMC/src/BCS.BMC.Application/FirebaseCloudMessaging/FirebaseNotificationAppService.cs index ae777fa..71c65dc 100644 --- a/BCS.BMC/src/BCS.BMC.Application/FirebaseCloudMessaging/FirebaseNotificationAppService.cs +++ b/BCS.BMC/src/BCS.BMC.Application/FirebaseCloudMessaging/FirebaseNotificationAppService.cs @@ -12,9 +12,8 @@ namespace BCS.BMC.FirebaseCloudMessaging { public class FirebaseNotificationAppService : IFirebaseNotificationAppService { - private readonly ILogger _logger; - public FirebaseNotificationAppService(ILogger logger) + public FirebaseNotificationAppService() { if (FirebaseApp.DefaultInstance is null) { @@ -23,7 +22,6 @@ namespace BCS.BMC.FirebaseCloudMessaging Credential = GoogleCredential.FromFile("firechat-57601-firebase-adminsdk-anscp-e04366c4d4.json") }); } - _logger = logger; } @@ -47,7 +45,7 @@ namespace BCS.BMC.FirebaseCloudMessaging } public async Task GetNotification(NotificationModel notification) { - _logger.LogInformation("Bwac Notifications" + notification); + var data = notification; } } } diff --git a/BCS.BMC/src/BCS.BMC.Web.Mvc/Controllers/NotificationController.cs b/BCS.BMC/src/BCS.BMC.Web.Mvc/Controllers/NotificationController.cs index dc90161..4712d03 100644 --- a/BCS.BMC/src/BCS.BMC.Web.Mvc/Controllers/NotificationController.cs +++ b/BCS.BMC/src/BCS.BMC.Web.Mvc/Controllers/NotificationController.cs @@ -31,9 +31,9 @@ namespace BCS.BMC.Web.Controllers } [HttpPost] - public async Task GetNotifications(NotificationModel notification) + public async Task GetNotifications([FromBody] NotificationModel notification) { - var result = _notificationService.GetNotification(notification); + // var result = _notificationService.GetNotification(notification); return Ok(); } }