using System.Text.Json.Serialization; using TakeoutSaaS.Domain.Identity.Enums; using TakeoutSaaS.Shared.Abstractions.Serialization; namespace TakeoutSaaS.Application.Identity.Contracts; /// /// 角色 DTO。 /// public sealed class RoleDto { /// /// 角色所属 Portal。 /// public PortalType Portal { get; init; } /// /// 角色 ID(雪花,序列化为字符串)。 /// [JsonConverter(typeof(SnowflakeIdJsonConverter))] public long Id { get; init; } /// /// 租户 ID(Portal=Tenant 必填;Portal=Admin 为空)。 /// [JsonConverter(typeof(NullableSnowflakeIdJsonConverter))] public long? TenantId { get; init; } /// /// 角色名称。 /// public string Name { get; init; } = string.Empty; /// /// 角色编码(租户内唯一)。 /// public string Code { get; init; } = string.Empty; /// /// 描述。 /// public string? Description { get; init; } }