was added firebase nitifying

This commit is contained in:
Artemy
2026-03-01 16:48:06 +07:00
parent 76d7280c71
commit eab0d746b8
60 changed files with 2335 additions and 1149 deletions
@@ -0,0 +1,8 @@
namespace Govor.Application.Interfaces;
public interface IConnectionStore
{
void AddConnection(Guid userId, string connectionId);
void RemoveConnection(Guid userId, string connectionId);
IEnumerable<string> GetConnections(Guid userId);
}
@@ -0,0 +1,9 @@
using Govor.Core.Models;
namespace Govor.Application.Interfaces;
public interface IPrivateChatGroupManager
{
Task AddUsersToPrivateChatGroupAsync(PrivateChat privateChat);
Task RemoveUsersFromPrivateChatGroupAsync(PrivateChat privateChat);
}
@@ -0,0 +1,8 @@
using Govor.Core.Models;
namespace Govor.Application.Interfaces;
public interface IUserPrivateChatsCreator
{
Task<PrivateChat> CreateAsync(Guid userIdA, Guid userIdB);
}
@@ -0,0 +1,14 @@
using Govor.Application.Interfaces.PushNotifications.Models;
namespace Govor.Application.Interfaces.PushNotifications;
public interface IPushNotificationProvider
{
string Name { get; }
Task<SendPushResult> SendToTokenAsync(string token, PushMessage message);
Task<SendPushResult> SendMulticastAsync(
IReadOnlyList<string> tokens,
PushMessage message);
}
@@ -0,0 +1,10 @@
namespace Govor.Application.Interfaces.PushNotifications;
public interface IPushNotificationService
{
Task SendToUserAsync(Guid userId, string title, string body, string channelId, Dictionary<string, string>? data = null);
Task SendToUsersAsync(IEnumerable<Guid> userIds, string title, string body, string channelId, Dictionary<string, string>? data = null);
Task SendToSessionAsync(Guid sessionId, string title, string body, string channelId, Dictionary<string, string>? data = null);
}
@@ -0,0 +1,9 @@
namespace Govor.Application.Interfaces.PushNotifications.Models;
public class PushMessage
{
public string Title { get; set; } = string.Empty;
public string Body { get; set; } = string.Empty;
public Dictionary<string, string> Data { get; set; } = new();
public string? ChannelId { get; set; } = "chat_messages"; //for Android
}
@@ -0,0 +1,3 @@
namespace Govor.Application.Interfaces.PushNotifications.Models;
public record SendPushResult(int SuccessCount, int FailureCount, IEnumerable<string> FailedTokens);