示例#1
0
        public async Task <IActionResult> NotificationsCount([FromQuery] NotificationsCountParameters parameters)
        {
            var userId = User.GetUserId();
            var userNotificationTransport = await feedRepo.GetUsersFeedNotificationTransportAsync(userId);

            var unreadCountAndLastTimestamp = await GetUnreadNotificationsCountAndLastTimestampAsync(userId, userNotificationTransport, parameters.LastTimestamp);

            return(Json(new NotificationsCountResponse
            {
                Count = unreadCountAndLastTimestamp.Item1,
                LastTimestamp = unreadCountAndLastTimestamp.Item2,
            }));
        }