Push: global usings

This commit is contained in:
Nikolay Rechkin 2022-08-23 13:10:37 +03:00
parent c8e4ea7cec
commit 7f38657ce6
6 changed files with 12 additions and 12 deletions

View File

@ -126,6 +126,8 @@ global using Autofac;
global using AutoMapper; global using AutoMapper;
global using AutoMapper.QueryableExtensions; global using AutoMapper.QueryableExtensions;
global using Google.Apis.Auth.OAuth2;
global using MailKit.Security; global using MailKit.Security;
global using Microsoft.AspNetCore.Http; global using Microsoft.AspNetCore.Http;
@ -162,3 +164,6 @@ global using Telegram.Bot;
global using static ASC.Security.Cryptography.EmailValidationKeyProvider; global using static ASC.Security.Cryptography.EmailValidationKeyProvider;
global using JsonIgnoreAttribute = System.Text.Json.Serialization.JsonIgnoreAttribute; global using JsonIgnoreAttribute = System.Text.Json.Serialization.JsonIgnoreAttribute;
global using FirebaseAdminMessaging = FirebaseAdmin.Messaging;
global using FirebaseApp = FirebaseAdmin.FirebaseApp;
global using AppOptions = FirebaseAdmin.AppOptions;

View File

@ -26,7 +26,6 @@
namespace ASC.Core.Common.Notify.Push; namespace ASC.Core.Common.Notify.Push;
[Scope] [Scope]
public class FirebaseDao public class FirebaseDao
{ {

View File

@ -25,6 +25,7 @@
// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode // International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
namespace ASC.Core.Common.Notify.Push.Dao; namespace ASC.Core.Common.Notify.Push.Dao;
[Serializable] [Serializable]
public class NotifyData public class NotifyData
{ {

View File

@ -25,6 +25,7 @@
// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode // International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
namespace ASC.Core.Common.Notify.Push.Dao; namespace ASC.Core.Common.Notify.Push.Dao;
[Serializable] [Serializable]
public class NotifyFileData public class NotifyFileData
{ {

View File

@ -25,6 +25,7 @@
// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode // International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
namespace ASC.Core.Common.Notify.Push.Dao; namespace ASC.Core.Common.Notify.Push.Dao;
public class NotifyFolderData public class NotifyFolderData
{ {
[JsonProperty("id")] [JsonProperty("id")]

View File

@ -24,13 +24,6 @@
// content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0 // content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0
// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode // International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
using ASC.Core.Common.Notify.Push.Dao;
using FirebaseAdmin;
using FirebaseAdmin.Messaging;
using Google.Apis.Auth.OAuth2;
namespace ASC.Core.Common.Notify.Push; namespace ASC.Core.Common.Notify.Push;
[Scope] [Scope]
@ -107,18 +100,18 @@ public class FirebaseHelper
{ {
if ((bool)fb.IsSubscribed) if ((bool)fb.IsSubscribed)
{ {
var m = new FirebaseAdmin.Messaging.Message() var m = new FirebaseAdminMessaging.Message()
{ {
Data = new Dictionary<string, string>{ Data = new Dictionary<string, string>{
{ "data", msg.Data } { "data", msg.Data }
}, },
Token = fb.FirebaseDeviceToken, Token = fb.FirebaseDeviceToken,
Notification = new Notification() Notification = new FirebaseAdminMessaging.Notification()
{ {
Body = msg.Content Body = msg.Content
} }
}; };
FirebaseMessaging.DefaultInstance.SendAsync(m); FirebaseAdminMessaging.FirebaseMessaging.DefaultInstance.SendAsync(m);
} }
} }
} }