Add user online presence tracking and notification

Introduced interfaces and services for tracking user online status, including IOnlineUserStore, IUserNotificationScopeService, and IUserPresenceReader. Added PresenceHub for real-time presence updates via SignalR. Updated OnlinePingingController to use new services and return online status and last seen. Extended UserDto with IsOnline property. Updated dependency injection and privacy settings enum. Removed obsolete IUserPresenceService.
This commit is contained in:
Artemy
2025-07-23 21:07:29 +07:00
parent cbff5857e7
commit 31fdf4cb37
13 changed files with 231 additions and 11 deletions
@@ -0,0 +1,9 @@
namespace Govor.Application.Interfaces.UserOnlineStatus;
public interface IOnlineUserStore
{
void SetOnlineUser(Guid userId);
void SetOfflineUser(Guid userId);
bool IsOnline(Guid userId);
IReadOnlyCollection<Guid> GetAllOnlineUsers();
}
@@ -0,0 +1,6 @@
namespace Govor.Application.Interfaces.UserOnlineStatus;
public interface IUserNotificationScopeService
{
Task<List<Guid>> GetNotifiedUsers(Guid userId);
}
@@ -0,0 +1,6 @@
namespace Govor.Application.Interfaces.UserOnlineStatus;
public interface IUserPresenceReader
{
Task<DateTime?> GetLastSeenAsync(Guid userId);
}