- Cleaned up whitespace in Directory.Build.props and Directory.Packages.props for consistency. - Reformatted project file references in PnvPanel.Api.csproj for better clarity. - Enhanced code readability in various endpoint files by adjusting line breaks and indentation. - Standardized method signatures and improved formatting in ResultExtensions and multiple endpoint classes for better maintainability.
39 lines
1.3 KiB
C#
39 lines
1.3 KiB
C#
using PnvPanel.Domain.Configs;
|
|
using PnvPanel.Domain.Inbounds;
|
|
|
|
namespace PnvPanel.Application.Configs;
|
|
|
|
/// <summary>
|
|
/// Пользователю показываем только DisplayName + протокол инбаунда — адрес/хост ноды и прочие
|
|
/// детали 3x-ui в этот DTO не попадают (см. domain-model.md). Исключение — ClientEmail: это не
|
|
/// секрет и не адрес ноды, а просто ключ клиента в 3x-ui, полезный владельцу для диагностики
|
|
/// (сверка конфига с записью в панели у админа).
|
|
/// </summary>
|
|
public sealed record VpnConfigDto(
|
|
Guid Id,
|
|
string? Label,
|
|
string ClientEmail,
|
|
VpnProtocol Protocol,
|
|
string Location,
|
|
long UsedUpBytes,
|
|
long UsedDownBytes,
|
|
DateTimeOffset? ExpiresAt,
|
|
ConfigStatus Status,
|
|
DateTimeOffset CreatedAt
|
|
)
|
|
{
|
|
public static VpnConfigDto FromDomain(VpnConfig config, Inbound inbound) =>
|
|
new(
|
|
config.Id,
|
|
config.Label,
|
|
config.ClientEmail,
|
|
config.Protocol,
|
|
inbound.DisplayName ?? inbound.Remark,
|
|
config.UsedUpBytes,
|
|
config.UsedDownBytes,
|
|
config.ExpiresAt,
|
|
config.Status,
|
|
config.CreatedAt
|
|
);
|
|
}
|