Files
TakeoutSaaS.AdminApi/src/Application/TakeoutSaaS.Application/Identity/Contracts/PermissionDto.cs
2025-12-27 16:47:38 +08:00

54 lines
1.3 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using System.Text.Json.Serialization;
using TakeoutSaaS.Shared.Abstractions.Serialization;
namespace TakeoutSaaS.Application.Identity.Contracts;
/// <summary>
/// 权限 DTO。
/// </summary>
public sealed class PermissionDto
{
/// <summary>
/// 权限 ID雪花序列化为字符串
/// </summary>
[JsonConverter(typeof(SnowflakeIdJsonConverter))]
public long Id { get; init; }
/// <summary>
/// 租户 ID固定权限时为基准租户
/// </summary>
[JsonConverter(typeof(SnowflakeIdJsonConverter))]
public long TenantId { get; init; }
/// <summary>
/// 父级权限 ID。
/// </summary>
[JsonConverter(typeof(SnowflakeIdJsonConverter))]
public long ParentId { get; init; }
/// <summary>
/// 排序值,值越小越靠前。
/// </summary>
public int SortOrder { get; init; }
/// <summary>
/// 权限类型group/leaf
/// </summary>
public string Type { get; init; } = string.Empty;
/// <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; }
}