Refactoring, database structure changed

This commit is contained in:
2025-03-03 00:56:32 +01:00
Unverified
parent d3805ef3db
commit c603c41c0b
913 changed files with 21764 additions and 32775 deletions

View File

@@ -0,0 +1,16 @@
using WatchIt.Database.Model.Accounts;
namespace WatchIt.DTO.Models.Controllers.Authentication;
public static class AuthenticationMappers
{
#region Authentication
public static AuthenticationResponse CreateAuthenticationResponse(string accessToken, string refreshToken) => new AuthenticationResponse
{
AccessToken = accessToken,
RefreshToken = refreshToken,
};
#endregion
}

View File

@@ -0,0 +1,7 @@
namespace WatchIt.DTO.Models.Controllers.Authentication;
public class AuthenticationRefreshRequest
{
public string AccessToken { get; set; } = null!;
public string RefreshToken { get; set; } = null!;
}

View File

@@ -0,0 +1,12 @@
namespace WatchIt.DTO.Models.Controllers.Authentication;
public class AuthenticationRequest
{
#region PROPERTIES
public string UsernameOrEmail { get; set; } = null!;
public string Password { get; set; } = null!;
public bool RememberMe { get; set; }
#endregion
}

View File

@@ -0,0 +1,12 @@
using FluentValidation;
namespace WatchIt.DTO.Models.Controllers.Authentication;
public class AuthenticationRequestValidator : AbstractValidator<AuthenticationRequest>
{
public AuthenticationRequestValidator()
{
RuleFor(x => x.UsernameOrEmail).NotEmpty();
RuleFor(x => x.Password).NotEmpty();
}
}

View File

@@ -0,0 +1,11 @@
namespace WatchIt.DTO.Models.Controllers.Authentication;
public class AuthenticationResponse
{
#region PROPERTIES
public string AccessToken { get; init; } = null!;
public string RefreshToken { get; init; } = null!;
#endregion
}