74 lines
1.7 KiB
C#
74 lines
1.7 KiB
C#
using System.Text.Json.Serialization;
|
||
using TakeoutSaaS.Domain.Dictionary.Enums;
|
||
using TakeoutSaaS.Shared.Abstractions.Serialization;
|
||
|
||
namespace TakeoutSaaS.Application.Dictionary.Models;
|
||
|
||
/// <summary>
|
||
/// 字典分组 DTO。
|
||
/// </summary>
|
||
public sealed class DictionaryGroupDto
|
||
{
|
||
/// <summary>
|
||
/// 分组 ID。
|
||
/// </summary>
|
||
[JsonConverter(typeof(SnowflakeIdJsonConverter))]
|
||
public long Id { get; init; }
|
||
|
||
/// <summary>
|
||
/// 分组编码。
|
||
/// </summary>
|
||
public string Code { get; init; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 租户 ID。
|
||
/// </summary>
|
||
[JsonConverter(typeof(SnowflakeIdJsonConverter))]
|
||
public long TenantId { get; init; }
|
||
|
||
/// <summary>
|
||
/// 分组名称。
|
||
/// </summary>
|
||
public string Name { get; init; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 字典作用域。
|
||
/// </summary>
|
||
public DictionaryScope Scope { get; init; }
|
||
|
||
/// <summary>
|
||
/// 描述。
|
||
/// </summary>
|
||
public string? Description { get; init; }
|
||
|
||
/// <summary>
|
||
/// 是否允许覆盖。
|
||
/// </summary>
|
||
public bool AllowOverride { get; init; }
|
||
|
||
/// <summary>
|
||
/// 是否启用。
|
||
/// </summary>
|
||
public bool IsEnabled { get; init; }
|
||
|
||
/// <summary>
|
||
/// 创建时间(UTC)。
|
||
/// </summary>
|
||
public DateTime CreatedAt { get; init; }
|
||
|
||
/// <summary>
|
||
/// 更新时间(UTC)。
|
||
/// </summary>
|
||
public DateTime? UpdatedAt { get; init; }
|
||
|
||
/// <summary>
|
||
/// 并发控制字段。
|
||
/// </summary>
|
||
public uint RowVersion { get; init; }
|
||
|
||
/// <summary>
|
||
/// 字典项集合。
|
||
/// </summary>
|
||
public IReadOnlyList<DictionaryItemDto> Items { get; init; } = Array.Empty<DictionaryItemDto>();
|
||
}
|