Backend login and register
This commit is contained in:
12
src/Application/DTOs/PagedResult.cs
Normal file
12
src/Application/DTOs/PagedResult.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
namespace Application.DTOs;
|
||||
|
||||
public class PagedResult<T>
|
||||
{
|
||||
public List<T> Items { get; set; } = [];
|
||||
public int TotalCount { get; set; }
|
||||
public int PageNumber { get; set; }
|
||||
public int PageSize { get; set; }
|
||||
public int TotalPages => (int)Math.Ceiling((double)TotalCount / PageSize);
|
||||
public bool HasPreviousPage => PageNumber > 1;
|
||||
public bool HasNext => PageNumber < TotalPages;
|
||||
}
|
||||
8
src/Application/DTOs/ResetPasswordDto.cs
Normal file
8
src/Application/DTOs/ResetPasswordDto.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
namespace Application.DTOs;
|
||||
|
||||
public record ResetPasswordDto
|
||||
{
|
||||
public required string Email { get; init; }
|
||||
public required string EmailToken { get; init; }
|
||||
public required string NewPassword { get; init; }
|
||||
}
|
||||
10
src/Application/DTOs/UserDto.cs
Normal file
10
src/Application/DTOs/UserDto.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
namespace Application.DTOs;
|
||||
|
||||
public record UserDto
|
||||
{
|
||||
public int Id { get; init; }
|
||||
public required string Email { get; init; }
|
||||
public required string Username { get; init; }
|
||||
public DateTime LastLogin { get; init; }
|
||||
public List<string> Roles { get; init; } = [];
|
||||
}
|
||||
Reference in New Issue
Block a user