74 lines
1.7 KiB
C#
74 lines
1.7 KiB
C#
using System.Text.Json.Serialization;
|
||
using TakeoutSaaS.Domain.Identity.Enums;
|
||
using TakeoutSaaS.Shared.Abstractions.Serialization;
|
||
|
||
namespace TakeoutSaaS.Application.Identity.Contracts;
|
||
|
||
/// <summary>
|
||
/// 用户列表项 DTO。
|
||
/// </summary>
|
||
public sealed record UserListItemDto
|
||
{
|
||
/// <summary>
|
||
/// 用户 ID。
|
||
/// </summary>
|
||
[JsonConverter(typeof(SnowflakeIdJsonConverter))]
|
||
public long UserId { get; init; }
|
||
|
||
/// <summary>
|
||
/// 租户 ID。
|
||
/// </summary>
|
||
[JsonConverter(typeof(SnowflakeIdJsonConverter))]
|
||
public long TenantId { get; init; }
|
||
|
||
/// <summary>
|
||
/// 登录账号。
|
||
/// </summary>
|
||
public string Account { get; init; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 展示名称。
|
||
/// </summary>
|
||
public string DisplayName { get; init; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 手机号。
|
||
/// </summary>
|
||
public string? Phone { get; init; }
|
||
|
||
/// <summary>
|
||
/// 邮箱。
|
||
/// </summary>
|
||
public string? Email { get; init; }
|
||
|
||
/// <summary>
|
||
/// 用户状态。
|
||
/// </summary>
|
||
public IdentityUserStatus Status { get; init; }
|
||
|
||
/// <summary>
|
||
/// 是否处于锁定状态。
|
||
/// </summary>
|
||
public bool IsLocked { get; init; }
|
||
|
||
/// <summary>
|
||
/// 是否已删除。
|
||
/// </summary>
|
||
public bool IsDeleted { get; init; }
|
||
|
||
/// <summary>
|
||
/// 角色编码列表。
|
||
/// </summary>
|
||
public string[] Roles { get; init; } = Array.Empty<string>();
|
||
|
||
/// <summary>
|
||
/// 创建时间(UTC)。
|
||
/// </summary>
|
||
public DateTime CreatedAt { get; init; }
|
||
|
||
/// <summary>
|
||
/// 最近登录时间(UTC)。
|
||
/// </summary>
|
||
public DateTime? LastLoginAt { get; init; }
|
||
}
|