feat: 系统参数应用层与验证

This commit is contained in:
2025-12-02 12:53:06 +08:00
parent dd15a88ff4
commit 3b2b376787
18 changed files with 771 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
using MediatR;
using TakeoutSaaS.Application.App.SystemParameters.Dto;
namespace TakeoutSaaS.Application.App.SystemParameters.Commands;
/// <summary>
/// 创建系统参数命令。
/// </summary>
public sealed class CreateSystemParameterCommand : IRequest<SystemParameterDto>
{
/// <summary>
/// 参数键。
/// </summary>
public string Key { get; set; } = string.Empty;
/// <summary>
/// 参数值。
/// </summary>
public string Value { get; set; } = string.Empty;
/// <summary>
/// 描述。
/// </summary>
public string? Description { get; set; }
/// <summary>
/// 排序值。
/// </summary>
public int SortOrder { get; set; } = 100;
/// <summary>
/// 是否启用。
/// </summary>
public bool IsEnabled { get; set; } = true;
}

View File

@@ -0,0 +1,14 @@
using MediatR;
namespace TakeoutSaaS.Application.App.SystemParameters.Commands;
/// <summary>
/// 删除系统参数命令。
/// </summary>
public sealed record DeleteSystemParameterCommand : IRequest<bool>
{
/// <summary>
/// 参数 ID。
/// </summary>
public long ParameterId { get; init; }
}

View File

@@ -0,0 +1,40 @@
using MediatR;
using TakeoutSaaS.Application.App.SystemParameters.Dto;
namespace TakeoutSaaS.Application.App.SystemParameters.Commands;
/// <summary>
/// 更新系统参数命令。
/// </summary>
public sealed record UpdateSystemParameterCommand : IRequest<SystemParameterDto?>
{
/// <summary>
/// 参数 ID。
/// </summary>
public long ParameterId { get; init; }
/// <summary>
/// 参数键。
/// </summary>
public string Key { get; init; } = string.Empty;
/// <summary>
/// 参数值。
/// </summary>
public string Value { get; init; } = string.Empty;
/// <summary>
/// 描述。
/// </summary>
public string? Description { get; init; }
/// <summary>
/// 排序值。
/// </summary>
public int SortOrder { get; init; } = 100;
/// <summary>
/// 是否启用。
/// </summary>
public bool IsEnabled { get; init; } = true;
}