events refactoring

This commit is contained in:
2016-09-17 03:36:34 +02:00
parent 1882138e61
commit 83b3d2d2ae
13 changed files with 98 additions and 89 deletions

View File

@ -8,6 +8,6 @@ namespace Yavsc.Services
{
public interface IGoogleCloudMessageSender
{
Task<MessageWithPayloadResponse> NotifyAsync(GoogleAuthSettings googlesettings, IEnumerable<string> registrationId, YaEvent ev);
Task<MessageWithPayloadResponse> NotifyBookQueryAsync(GoogleAuthSettings googlesettings, IEnumerable<string> registrationId, BookQueryEvent ev);
}
}

View File

@ -28,11 +28,11 @@ namespace Yavsc.Services
/// <c>bool somethingsent = (response.failure == 0 &amp;&amp; response.success > 0)</c>
/// </returns>
public async Task<MessageWithPayloadResponse>
NotifyAsync(GoogleAuthSettings googleSettings, IEnumerable<string> registrationIds, YaEvent ev)
NotifyBookQueryAsync(GoogleAuthSettings googleSettings, IEnumerable<string> registrationIds, BookQueryEvent ev)
{
MessageWithPayloadResponse response = null;
await Task.Run(()=>{
response = googleSettings.NotifyEvent(registrationIds, ev);
response = googleSettings.NotifyEvent<BookQueryEvent>(registrationIds, ev);
});
return response;
}