44 lines
1.1 KiB
C#
44 lines
1.1 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 class RoleDto
|
||
{
|
||
/// <summary>
|
||
/// 角色所属 Portal。
|
||
/// </summary>
|
||
public PortalType Portal { get; init; }
|
||
|
||
/// <summary>
|
||
/// 角色 ID(雪花,序列化为字符串)。
|
||
/// </summary>
|
||
[JsonConverter(typeof(SnowflakeIdJsonConverter))]
|
||
public long Id { get; init; }
|
||
|
||
/// <summary>
|
||
/// 租户 ID(Portal=Tenant 必填;Portal=Admin 为空)。
|
||
/// </summary>
|
||
[JsonConverter(typeof(NullableSnowflakeIdJsonConverter))]
|
||
public long? TenantId { get; init; }
|
||
|
||
/// <summary>
|
||
/// 角色名称。
|
||
/// </summary>
|
||
public string Name { get; init; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 角色编码(租户内唯一)。
|
||
/// </summary>
|
||
public string Code { get; init; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 描述。
|
||
/// </summary>
|
||
public string? Description { get; init; }
|
||
}
|