BMC: Add from body attribute into GetNotification method

This commit is contained in:
Palash Biswas 2022-12-01 19:35:26 +05:30
parent 02243079b2
commit 2750b3d25e
3 changed files with 5 additions and 7 deletions

View File

@ -13,7 +13,7 @@ namespace BCS.BMC.FirebaseCloudMessaging.Dto
//public string DeviceId { get; set; } //public string DeviceId { get; set; }
//[JsonProperty("isAndroidDevice")] //[JsonProperty("isAndroidDevice")]
//public bool IsAndroidDevice { get; set; } //public bool IsAndroidDevice { get; set; }
//[JsonProperty("title")] [JsonProperty("title")]
public string Title { get; set; } public string Title { get; set; }
[JsonProperty("body")] [JsonProperty("body")]
public string Body { get; set; } public string Body { get; set; }

View File

@ -12,9 +12,8 @@ namespace BCS.BMC.FirebaseCloudMessaging
{ {
public class FirebaseNotificationAppService : IFirebaseNotificationAppService public class FirebaseNotificationAppService : IFirebaseNotificationAppService
{ {
private readonly ILogger _logger;
public FirebaseNotificationAppService(ILogger logger) public FirebaseNotificationAppService()
{ {
if (FirebaseApp.DefaultInstance is null) if (FirebaseApp.DefaultInstance is null)
{ {
@ -23,7 +22,6 @@ namespace BCS.BMC.FirebaseCloudMessaging
Credential = GoogleCredential.FromFile("firechat-57601-firebase-adminsdk-anscp-e04366c4d4.json") 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) public async Task GetNotification(NotificationModel notification)
{ {
_logger.LogInformation("Bwac Notifications" + notification); var data = notification;
} }
} }
} }

View File

@ -31,9 +31,9 @@ namespace BCS.BMC.Web.Controllers
} }
[HttpPost] [HttpPost]
public async Task<IActionResult> GetNotifications(NotificationModel notification) public async Task<IActionResult> GetNotifications([FromBody] NotificationModel notification)
{ {
var result = _notificationService.GetNotification(notification); // var result = _notificationService.GetNotification(notification);
return Ok(); return Ok();
} }
} }