52 lines
1.2 KiB
C#
52 lines
1.2 KiB
C#
using System.ComponentModel.DataAnnotations;
|
|
using System.Text.Json.Serialization;
|
|
using TakeoutSaaS.Shared.Abstractions.Serialization;
|
|
|
|
namespace TakeoutSaaS.Application.Dictionary.Contracts;
|
|
|
|
/// <summary>
|
|
/// 创建字典项请求。
|
|
/// </summary>
|
|
public sealed class CreateDictionaryItemRequest
|
|
{
|
|
/// <summary>
|
|
/// 所属分组 ID。
|
|
/// </summary>
|
|
[Required]
|
|
[JsonConverter(typeof(SnowflakeIdJsonConverter))]
|
|
public long GroupId { get; set; }
|
|
|
|
/// <summary>
|
|
/// 字典项键。
|
|
/// </summary>
|
|
[Required, MaxLength(128)]
|
|
public string Key { get; set; } = string.Empty;
|
|
|
|
/// <summary>
|
|
/// 字典项值。
|
|
/// </summary>
|
|
[Required]
|
|
public Dictionary<string, string> Value { get; set; } = new(StringComparer.OrdinalIgnoreCase);
|
|
|
|
/// <summary>
|
|
/// 是否默认项。
|
|
/// </summary>
|
|
public bool IsDefault { get; set; }
|
|
|
|
/// <summary>
|
|
/// 是否启用。
|
|
/// </summary>
|
|
public bool IsEnabled { get; set; } = true;
|
|
|
|
/// <summary>
|
|
/// 排序值。
|
|
/// </summary>
|
|
public int SortOrder { get; set; } = 100;
|
|
|
|
/// <summary>
|
|
/// 描述信息。
|
|
/// </summary>
|
|
[MaxLength(512)]
|
|
public string? Description { get; set; }
|
|
}
|