95 lines
2.3 KiB
C#
95 lines
2.3 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 UserDetailDto
|
||
{
|
||
/// <summary>
|
||
/// 用户 ID。
|
||
/// </summary>
|
||
[JsonConverter(typeof(SnowflakeIdJsonConverter))]
|
||
public long UserId { get; init; }
|
||
|
||
/// <summary>
|
||
/// 租户 ID。
|
||
/// </summary>
|
||
[JsonConverter(typeof(SnowflakeIdJsonConverter))]
|
||
public long TenantId { get; init; }
|
||
|
||
/// <summary>
|
||
/// 商户 ID。
|
||
/// </summary>
|
||
[JsonConverter(typeof(NullableSnowflakeIdJsonConverter))]
|
||
public long? MerchantId { 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 string[] Roles { get; init; } = Array.Empty<string>();
|
||
|
||
/// <summary>
|
||
/// 角色 ID 列表(字符串)。
|
||
/// </summary>
|
||
public string[] RoleIds { get; init; } = Array.Empty<string>();
|
||
|
||
/// <summary>
|
||
/// 权限编码列表。
|
||
/// </summary>
|
||
public string[] Permissions { get; init; } = Array.Empty<string>();
|
||
|
||
/// <summary>
|
||
/// 创建时间(UTC)。
|
||
/// </summary>
|
||
public DateTime CreatedAt { get; init; }
|
||
|
||
/// <summary>
|
||
/// 最近登录时间(UTC)。
|
||
/// </summary>
|
||
public DateTime? LastLoginAt { get; init; }
|
||
|
||
/// <summary>
|
||
/// 头像地址。
|
||
/// </summary>
|
||
public string? Avatar { get; init; }
|
||
|
||
/// <summary>
|
||
/// 并发控制版本。
|
||
/// </summary>
|
||
public byte[] RowVersion { get; init; } = Array.Empty<byte>();
|
||
}
|