版本260406
This commit is contained in:
176
OrpaonVision.Core/Security/Contracts/Commands/UserCommands.cs
Normal file
176
OrpaonVision.Core/Security/Contracts/Commands/UserCommands.cs
Normal file
@@ -0,0 +1,176 @@
|
||||
namespace OrpaonVision.Core.Security.Contracts.Commands;
|
||||
|
||||
/// <summary>
|
||||
/// 创建用户命令。
|
||||
/// </summary>
|
||||
public sealed class CreateUserCommand
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户名。
|
||||
/// </summary>
|
||||
public string UserName { get; init; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 显示名称。
|
||||
/// </summary>
|
||||
public string DisplayName { get; init; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 邮箱。
|
||||
/// </summary>
|
||||
public string Email { get; init; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 密码。
|
||||
/// </summary>
|
||||
public string Password { get; init; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 角色列表。
|
||||
/// </summary>
|
||||
public IReadOnlyList<string> Roles { get; init; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// 权限列表。
|
||||
/// </summary>
|
||||
public IReadOnlyList<string> Permissions { get; init; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// 是否激活。
|
||||
/// </summary>
|
||||
public bool IsActive { get; init; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// 备注。
|
||||
/// </summary>
|
||||
public string Remarks { get; init; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 创建者。
|
||||
/// </summary>
|
||||
public string CreatedBy { get; init; } = string.Empty;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新用户命令。
|
||||
/// </summary>
|
||||
public sealed class UpdateUserCommand
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户ID。
|
||||
/// </summary>
|
||||
public Guid UserId { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 显示名称。
|
||||
/// </summary>
|
||||
public string DisplayName { get; init; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 邮箱。
|
||||
/// </summary>
|
||||
public string Email { get; init; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 角色列表。
|
||||
/// </summary>
|
||||
public IReadOnlyList<string> Roles { get; init; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// 权限列表。
|
||||
/// </summary>
|
||||
public IReadOnlyList<string> Permissions { get; init; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// 是否激活。
|
||||
/// </summary>
|
||||
public bool IsActive { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 备注。
|
||||
/// </summary>
|
||||
public string Remarks { get; init; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 更新者。
|
||||
/// </summary>
|
||||
public string UpdatedBy { get; init; } = string.Empty;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除用户命令。
|
||||
/// </summary>
|
||||
public sealed class DeleteUserCommand
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户ID。
|
||||
/// </summary>
|
||||
public Guid UserId { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 删除原因。
|
||||
/// </summary>
|
||||
public string DeleteReason { get; init; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 删除者。
|
||||
/// </summary>
|
||||
public string DeletedBy { get; init; } = string.Empty;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重置用户密码命令。
|
||||
/// </summary>
|
||||
public sealed class ResetUserPasswordCommand
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户ID。
|
||||
/// </summary>
|
||||
public Guid UserId { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 新密码。
|
||||
/// </summary>
|
||||
public string NewPassword { get; init; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 是否下次登录必须修改密码。
|
||||
/// </summary>
|
||||
public bool ForceChangeOnNextLogin { get; init; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// 重置原因。
|
||||
/// </summary>
|
||||
public string ResetReason { get; init; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 重置者。
|
||||
/// </summary>
|
||||
public string ResetBy { get; init; } = string.Empty;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 启用/禁用用户命令。
|
||||
/// </summary>
|
||||
public sealed class ToggleUserStatusCommand
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户ID。
|
||||
/// </summary>
|
||||
public Guid UserId { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否激活。
|
||||
/// </summary>
|
||||
public bool IsActive { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 原因。
|
||||
/// </summary>
|
||||
public string Reason { get; init; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 操作者。
|
||||
/// </summary>
|
||||
public string Operator { get; init; } = string.Empty;
|
||||
}
|
||||
67
OrpaonVision.Core/Security/Contracts/Queries/UserQueryDto.cs
Normal file
67
OrpaonVision.Core/Security/Contracts/Queries/UserQueryDto.cs
Normal file
@@ -0,0 +1,67 @@
|
||||
namespace OrpaonVision.Core.Security.Contracts.Queries;
|
||||
|
||||
/// <summary>
|
||||
/// 用户查询条件。
|
||||
/// </summary>
|
||||
public sealed class UserQueryDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 关键字搜索(用户名、显示名称、邮箱)。
|
||||
/// </summary>
|
||||
public string? Keyword { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 用户状态。
|
||||
/// </summary>
|
||||
public string? Status { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 角色过滤。
|
||||
/// </summary>
|
||||
public string? Role { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建时间范围开始(UTC)。
|
||||
/// </summary>
|
||||
public DateTime? CreatedAtUtcStart { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建时间范围结束(UTC)。
|
||||
/// </summary>
|
||||
public DateTime? CreatedAtUtcEnd { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 最后登录时间范围开始(UTC)。
|
||||
/// </summary>
|
||||
public DateTime? LastLoginAtUtcStart { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 最后登录时间范围结束(UTC)。
|
||||
/// </summary>
|
||||
public DateTime? LastLoginAtUtcEnd { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否激活。
|
||||
/// </summary>
|
||||
public bool? IsActive { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 页码(从1开始)。
|
||||
/// </summary>
|
||||
public int PageIndex { get; init; } = 1;
|
||||
|
||||
/// <summary>
|
||||
/// 每页大小。
|
||||
/// </summary>
|
||||
public int PageSize { get; init; } = 20;
|
||||
|
||||
/// <summary>
|
||||
/// 排序字段。
|
||||
/// </summary>
|
||||
public string SortField { get; init; } = "UserName";
|
||||
|
||||
/// <summary>
|
||||
/// 排序方向(ASC/DESC)。
|
||||
/// </summary>
|
||||
public string SortDirection { get; init; } = "ASC";
|
||||
}
|
||||
67
OrpaonVision.Core/Security/Contracts/UserDetailDto.cs
Normal file
67
OrpaonVision.Core/Security/Contracts/UserDetailDto.cs
Normal file
@@ -0,0 +1,67 @@
|
||||
namespace OrpaonVision.Core.Security.Contracts;
|
||||
|
||||
/// <summary>
|
||||
/// 用户详情。
|
||||
/// </summary>
|
||||
public sealed class UserDetailDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户ID。
|
||||
/// </summary>
|
||||
public Guid UserId { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 用户名。
|
||||
/// </summary>
|
||||
public string UserName { get; init; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 显示名称。
|
||||
/// </summary>
|
||||
public string DisplayName { get; init; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 邮箱。
|
||||
/// </summary>
|
||||
public string Email { get; init; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 角色列表。
|
||||
/// </summary>
|
||||
public IReadOnlyList<string> Roles { get; init; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// 权限列表。
|
||||
/// </summary>
|
||||
public IReadOnlyList<string> Permissions { get; init; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// 用户状态。
|
||||
/// </summary>
|
||||
public string Status { get; init; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 最后登录时间(UTC)。
|
||||
/// </summary>
|
||||
public DateTime? LastLoginAtUtc { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建时间(UTC)。
|
||||
/// </summary>
|
||||
public DateTime CreatedAtUtc { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建者。
|
||||
/// </summary>
|
||||
public string CreatedBy { get; init; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 是否激活。
|
||||
/// </summary>
|
||||
public bool IsActive { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 备注。
|
||||
/// </summary>
|
||||
public string Remarks { get; init; } = string.Empty;
|
||||
}
|
||||
Reference in New Issue
Block a user