refactoring

This commit is contained in:
2017-02-27 19:28:32 +01:00
parent 78e5ec16ce
commit 9973f0dcc7
57 changed files with 3371 additions and 251 deletions

View File

@ -10,6 +10,7 @@ using Microsoft.AspNet.Identity;
using Yavsc.Models;
using Yavsc.Models.Google.Messaging;
using System.Collections.Generic;
using Yavsc.Models.Haircut;
namespace Yavsc.Services
{
@ -27,11 +28,11 @@ namespace Yavsc.Services
/// <returns>a MessageWithPayloadResponse,
/// <c>bool somethingsent = (response.failure == 0 &amp;&amp; response.success > 0)</c>
/// </returns>
public async Task<MessageWithPayloadResponse> NotifyBookQueryAsync(GoogleAuthSettings googleSettings, IEnumerable<string> registrationIds, BookQueryEvent ev)
public async Task<MessageWithPayloadResponse> NotifyBookQueryAsync(GoogleAuthSettings googleSettings, IEnumerable<string> registrationIds, RdvQueryEvent ev)
{
MessageWithPayloadResponse response = null;
await Task.Run(()=>{
response = googleSettings.NotifyEvent<BookQueryEvent>(registrationIds, ev);
response = googleSettings.NotifyEvent<RdvQueryEvent>(registrationIds, ev);
});
return response;
}
@ -45,6 +46,16 @@ namespace Yavsc.Services
return response;
}
public async Task<MessageWithPayloadResponse> NotifyHairCutQueryAsync(GoogleAuthSettings googleSettings,
IEnumerable<string> registrationIds, HairCutQueryEvent ev)
{
MessageWithPayloadResponse response = null;
await Task.Run(()=>{
response = googleSettings.NotifyEvent<HairCutQueryEvent>(registrationIds, ev);
});
return response;
}
public Task<bool> SendEmailAsync(SiteSettings siteSettings, SmtpSettings smtpSettings, string email, string subject, string message)
{
try