initial commit

This commit is contained in:
2026-07-21 15:36:49 +07:00
commit 77f66132bc
2640 changed files with 850901 additions and 0 deletions
@@ -0,0 +1,12 @@
namespace Application.Common.Services.SecurityManager;
public record CreateUserResultDto
{
public string? UserId { get; init; }
public string? Email { get; init; }
public string? FirstName { get; init; }
public string? LastName { get; init; }
public bool? EmailConfirmed { get; init; }
public bool? IsBlocked { get; init; }
public bool? IsDeleted { get; init; }
}
@@ -0,0 +1,12 @@
namespace Application.Common.Services.SecurityManager;
public record DeleteUserResultDto
{
public string? UserId { get; init; }
public string? Email { get; init; }
public string? FirstName { get; init; }
public string? LastName { get; init; }
public bool? EmailConfirmed { get; init; }
public bool? IsBlocked { get; init; }
public bool? IsDeleted { get; init; }
}
@@ -0,0 +1,9 @@
namespace Application.Common.Services.SecurityManager;
public record GetMyProfileListResultDto
{
public string? Id { get; init; }
public string? FirstName { get; init; }
public string? LastName { get; init; }
public string? CompanyName { get; init; }
}
@@ -0,0 +1,6 @@
namespace Application.Common.Services.SecurityManager;
public record GetRoleListResultDto
{
public string? Id { get; init; }
public string? Name { get; init; }
}
@@ -0,0 +1,13 @@
namespace Application.Common.Services.SecurityManager;
public record GetUserListResultDto
{
public string? Id { get; init; }
public string? FirstName { get; init; }
public string? LastName { get; init; }
public string? Email { get; init; }
public bool? EmailConfirmed { get; init; }
public bool? IsBlocked { get; init; }
public bool? IsDeleted { get; init; }
public DateTime? CreatedAt { get; init; }
}
@@ -0,0 +1,131 @@
namespace Application.Common.Services.SecurityManager;
public interface ISecurityService
{
public Task<LoginResultDto> LoginAsync(
string email,
string password,
CancellationToken cancellationToken = default
);
public Task<LogoutResultDto> LogoutAsync(
string userId,
CancellationToken cancellationToken = default
);
public Task<RegisterResultDto> RegisterAsync(
string email,
string password,
string confirmPassword,
string firstName,
string lastName,
string companyName = "",
CancellationToken cancellationToken = default
);
public Task<string> ConfirmEmailAsync(
string email,
string code,
CancellationToken cancellationToken = default
);
public Task<string> ForgotPasswordAsync(
string email,
CancellationToken cancellationToken = default
);
public Task<string> ForgotPasswordConfirmationAsync(
string email,
string tempPassword,
string code,
CancellationToken cancellationToken = default
);
public Task<RefreshTokenResultDto> RefreshTokenAsync(
string refreshToken,
CancellationToken cancellationToken
);
public Task<List<GetMyProfileListResultDto>> GetMyProfileListAsync(
string userId,
CancellationToken cancellationToken
);
public Task UpdateMyProfileAsync(
string userId,
string firstName,
string lastName,
string companyName,
CancellationToken cancellationToken
);
public Task ChangePasswordAsync(
string userId,
string oldPassword,
string newPassword,
string confirmNewPassword,
CancellationToken cancellationToken
);
public Task<List<GetRoleListResultDto>> GetRoleListAsync(
CancellationToken cancellationToken
);
public Task<List<GetUserListResultDto>> GetUserListAsync(
CancellationToken cancellationToken
);
public Task<CreateUserResultDto> CreateUserAsync(
string email,
string password,
string confirmPassword,
string firstName,
string lastName,
bool emailConfirmed = true,
bool isBlocked = false,
bool isDeleted = false,
string createdById = "",
CancellationToken cancellationToken = default
);
public Task<UpdateUserResultDto> UpdateUserAsync(
string userId,
string firstName,
string lastName,
bool emailConfirmed = true,
bool isBlocked = false,
bool isDeleted = false,
string updatedById = "",
CancellationToken cancellationToken = default
);
public Task<DeleteUserResultDto> DeleteUserAsync(
string userId,
string deletedById = "",
CancellationToken cancellationToken = default
);
public Task UpdatePasswordUserAsync(
string userId,
string newPassword,
CancellationToken cancellationToken
);
public Task<List<string>> GetUserRolesAsync(
string userId,
CancellationToken cancellationToken = default
);
public Task<List<string>> UpdateUserRoleAsync(
string userId,
string roleName,
bool accessGranted,
CancellationToken cancellationToken = default
);
public Task ChangeAvatarAsync(
string userId,
string avatar,
CancellationToken cancellationToken
);
}
@@ -0,0 +1,15 @@
namespace Application.Common.Services.SecurityManager;
public record LoginResultDto
{
public string? AccessToken { get; init; }
public string? RefreshToken { get; init; }
public string? UserId { get; init; }
public string? Email { get; init; }
public string? FirstName { get; init; }
public string? LastName { get; init; }
public string? CompanyName { get; init; }
public string? Avatar { get; init; }
public List<MenuNavigationTreeNodeDto>? MenuNavigation { get; init; }
public List<string>? Roles { get; init; }
}
@@ -0,0 +1,13 @@
namespace Application.Common.Services.SecurityManager;
public record LogoutResultDto
{
public string? AccessToken { get; init; }
public string? RefreshToken { get; init; }
public string? UserId { get; init; }
public string? Email { get; init; }
public string? FirstName { get; init; }
public string? LastName { get; init; }
public string? CompanyName { get; init; }
public List<string>? UserClaims { get; init; }
}
@@ -0,0 +1,23 @@
namespace Application.Common.Services.SecurityManager;
public class MenuNavigationTreeNodeDto
{
public string Id { get; set; }
public string Name { get; set; }
public string? Pid { get; set; }
public string? NavURL { get; set; }
public bool HasChild { get; set; }
public bool Expanded { get; set; }
public bool IsSelected { get; set; }
public MenuNavigationTreeNodeDto(string param_id, string param_name, string? param_pid = null, string? param_navURL = null, bool param_hasChild = false, bool param_expanded = false, bool param_selected = false)
{
Id = param_id;
Name = param_name;
Pid = param_pid;
NavURL = param_navURL;
HasChild = param_hasChild;
Expanded = param_expanded;
IsSelected = param_selected;
}
}
@@ -0,0 +1,15 @@
namespace Application.Common.Services.SecurityManager;
public record RefreshTokenResultDto
{
public string? AccessToken { get; init; }
public string? RefreshToken { get; init; }
public string? UserId { get; init; }
public string? Email { get; init; }
public string? FirstName { get; init; }
public string? LastName { get; init; }
public string? CompanyName { get; init; }
public string? Avatar { get; init; }
public List<MenuNavigationTreeNodeDto>? MenuNavigation { get; init; }
public List<string>? Roles { get; init; }
}
@@ -0,0 +1,10 @@
namespace Application.Common.Services.SecurityManager;
public record RegisterResultDto
{
public string? UserId { get; init; }
public string? Email { get; init; }
public string? FirstName { get; init; }
public string? LastName { get; init; }
public string? CompanyName { get; init; }
}
@@ -0,0 +1,12 @@
namespace Application.Common.Services.SecurityManager;
public record UpdateUserResultDto
{
public string? UserId { get; init; }
public string? Email { get; init; }
public string? FirstName { get; init; }
public string? LastName { get; init; }
public bool? EmailConfirmed { get; init; }
public bool? IsBlocked { get; init; }
public bool? IsDeleted { get; init; }
}