mirror of
https://github.com/Govor-team/Govor.git
synced 2026-07-21 19:54:55 +00:00
UserSession namespace was changed
This commit is contained in:
@@ -4,6 +4,7 @@ using Govor.Application.Interfaces.Infrastructure.Extensions;
|
|||||||
using Govor.Application.Interfaces.UserSession;
|
using Govor.Application.Interfaces.UserSession;
|
||||||
using Govor.Contracts.DTOs;
|
using Govor.Contracts.DTOs;
|
||||||
using Govor.Core.Models;
|
using Govor.Core.Models;
|
||||||
|
using Govor.Core.Models.Users;
|
||||||
using Govor.Data.Repositories.Exceptions;
|
using Govor.Data.Repositories.Exceptions;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
using Microsoft.AspNetCore.SignalR;
|
||||||
|
|
||||||
|
namespace Govor.API.Hubs;
|
||||||
|
|
||||||
|
public class GroupsHub : Hub
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
@@ -2,6 +2,7 @@ using AutoFixture;
|
|||||||
using Govor.Application.Interfaces.UserSession;
|
using Govor.Application.Interfaces.UserSession;
|
||||||
using Govor.Application.Services.UserSessions;
|
using Govor.Application.Services.UserSessions;
|
||||||
using Govor.Core.Models;
|
using Govor.Core.Models;
|
||||||
|
using Govor.Core.Models.Users;
|
||||||
using Govor.Core.Repositories.UserSessionsRepository;
|
using Govor.Core.Repositories.UserSessionsRepository;
|
||||||
using Govor.Data.Repositories.Exceptions;
|
using Govor.Data.Repositories.Exceptions;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
using Govor.Application.Services.UserSessions;
|
using Govor.Application.Services.UserSessions;
|
||||||
using Govor.Core.Models;
|
using Govor.Core.Models;
|
||||||
|
using Govor.Core.Models.Users;
|
||||||
using Govor.Core.Repositories.UserSessionsRepository;
|
using Govor.Core.Repositories.UserSessionsRepository;
|
||||||
using Govor.Data.Repositories.Exceptions;
|
using Govor.Data.Repositories.Exceptions;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
|
|||||||
@@ -2,5 +2,5 @@ namespace Govor.Application.Interfaces.UserSession;
|
|||||||
|
|
||||||
public interface IUserSessionReader
|
public interface IUserSessionReader
|
||||||
{
|
{
|
||||||
Task<List<Core.Models.UserSession>> GetAllSessionsAsync(Guid userId);
|
Task<List<Core.Models.Users.UserSession>> GetAllSessionsAsync(Guid userId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,10 +7,10 @@ using Govor.Data.Repositories.Exceptions;
|
|||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using Microsoft.Extensions.Options;
|
using Microsoft.Extensions.Options;
|
||||||
|
|
||||||
namespace Govor.Application.Services.UserSessions;
|
namespace Govor.Application.Services.UserSessions
|
||||||
|
|
||||||
public class UserSessionOpener : IUserSessionOpener
|
|
||||||
{
|
{
|
||||||
|
public class UserSessionOpener : IUserSessionOpener
|
||||||
|
{
|
||||||
private readonly IUserSessionsRepository _repository;
|
private readonly IUserSessionsRepository _repository;
|
||||||
private readonly ILogger<UserSessionOpener> _logger;
|
private readonly ILogger<UserSessionOpener> _logger;
|
||||||
private readonly JwtRefreshOption _options;
|
private readonly JwtRefreshOption _options;
|
||||||
@@ -68,7 +68,7 @@ public class UserSessionOpener : IUserSessionOpener
|
|||||||
var newRefreshToken = await _jwtService.GenerateRefreshTokenAsync(user);
|
var newRefreshToken = await _jwtService.GenerateRefreshTokenAsync(user);
|
||||||
var accessToken = await _jwtService.GenerateAccessTokenAsync(user);
|
var accessToken = await _jwtService.GenerateAccessTokenAsync(user);
|
||||||
|
|
||||||
var newSession = new Core.Models.UserSession
|
var newSession = new UserSession
|
||||||
{
|
{
|
||||||
UserId = user.Id,
|
UserId = user.Id,
|
||||||
DeviceInfo = deviceInfo,
|
DeviceInfo = deviceInfo,
|
||||||
@@ -85,5 +85,6 @@ public class UserSessionOpener : IUserSessionOpener
|
|||||||
return new RefreshResult(newRefreshToken, accessToken);
|
return new RefreshResult(newRefreshToken, accessToken);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
using Govor.Application.Interfaces.UserSession;
|
using Govor.Application.Interfaces.UserSession;
|
||||||
using Govor.Core.Models;
|
|
||||||
using Govor.Core.Repositories.UserSessionsRepository;
|
using Govor.Core.Repositories.UserSessionsRepository;
|
||||||
using Govor.Data.Repositories.Exceptions;
|
using Govor.Data.Repositories.Exceptions;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
@@ -17,7 +16,7 @@ public class UserSessionReader : IUserSessionReader
|
|||||||
_logger = logger;
|
_logger = logger;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<List<UserSession>> GetAllSessionsAsync(Guid userId)
|
public async Task<List<Govor.Core.Models.Users.UserSession>> GetAllSessionsAsync(Guid userId)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
using Govor.Application.Interfaces.Authentication;
|
using Govor.Application.Interfaces.Authentication;
|
||||||
using Govor.Application.Interfaces.UserSession;
|
using Govor.Application.Interfaces.UserSession;
|
||||||
using Govor.Application.Services.Authentication;
|
using Govor.Application.Services.Authentication;
|
||||||
using Govor.Core.Models;
|
using Govor.Core.Models.Users;
|
||||||
using Govor.Core.Repositories.Users;
|
using Govor.Core.Repositories.Users;
|
||||||
using Govor.Core.Repositories.UserSessionsRepository;
|
using Govor.Core.Repositories.UserSessionsRepository;
|
||||||
using Govor.Data.Repositories.Exceptions;
|
using Govor.Data.Repositories.Exceptions;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace Govor.Core.Models;
|
namespace Govor.Core.Models.Users;
|
||||||
|
|
||||||
public class UserSession
|
public class UserSession
|
||||||
{
|
{
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
using Govor.Core.Models;
|
using Govor.Core.Models.Users;
|
||||||
|
|
||||||
namespace Govor.Core.Repositories.UserSessionsRepository;
|
namespace Govor.Core.Repositories.UserSessionsRepository;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using Govor.Core.Models;
|
using Govor.Core.Models.Users;
|
||||||
|
|
||||||
namespace Govor.Core.Repositories.UserSessionsRepository;
|
namespace Govor.Core.Repositories.UserSessionsRepository;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using Govor.Core.Models;
|
using Govor.Core.Models;
|
||||||
|
using Govor.Core.Models.Users;
|
||||||
|
|
||||||
namespace Govor.Core.Repositories.UserSessionsRepository;
|
namespace Govor.Core.Repositories.UserSessionsRepository;
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
using AutoFixture;
|
using AutoFixture;
|
||||||
using Govor.Core.Models;
|
using Govor.Core.Models;
|
||||||
|
using Govor.Core.Models.Users;
|
||||||
using Govor.Data.Repositories;
|
using Govor.Data.Repositories;
|
||||||
using Govor.Data.Repositories.Exceptions;
|
using Govor.Data.Repositories.Exceptions;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
using Govor.Core.Infrastructure.Extensions;
|
using Govor.Core.Infrastructure.Extensions;
|
||||||
using Govor.Core.Models;
|
using Govor.Core.Models.Users;
|
||||||
using Govor.Core.Repositories.UserSessionsRepository;
|
using Govor.Core.Repositories.UserSessionsRepository;
|
||||||
using Govor.Data.Repositories.Exceptions;
|
using Govor.Data.Repositories.Exceptions;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
|||||||
Reference in New Issue
Block a user