Browse Source

BMC: Add from body attribute into GetNotification method

feature/ModificationForSentNotificationAPI
Palash Biswas 2 years ago
parent
commit
2750b3d25e
3 changed files with 5 additions and 7 deletions
  1. +1
    -1
      BCS.BMC/src/BCS.BMC.Application/FirebaseCloudMessaging/Dto/NotificationModel.cs
  2. +2
    -4
      BCS.BMC/src/BCS.BMC.Application/FirebaseCloudMessaging/FirebaseNotificationAppService.cs
  3. +2
    -2
      BCS.BMC/src/BCS.BMC.Web.Mvc/Controllers/NotificationController.cs

+ 1
- 1
BCS.BMC/src/BCS.BMC.Application/FirebaseCloudMessaging/Dto/NotificationModel.cs View File

@ -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; }


+ 2
- 4
BCS.BMC/src/BCS.BMC.Application/FirebaseCloudMessaging/FirebaseNotificationAppService.cs View File

@ -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;
}
}
}

+ 2
- 2
BCS.BMC/src/BCS.BMC.Web.Mvc/Controllers/NotificationController.cs View File

@ -31,9 +31,9 @@ namespace BCS.BMC.Web.Controllers
}
[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();
}
}


Loading…
Cancel
Save