177 lines
3.8 KiB
C#
177 lines
3.8 KiB
C#
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;
|
|
}
|