Вынести магические строки статусов, видов и ключей в каталоги
Литералы статусов/видов/фаз и wire-ключей заменены каталогами: значения сущностей и репозиториев — TenantStatuses/TenantLimitPeriods/InviteStatuses/ContainerKinds/ContainerSpaces/CardIds/Discovery*/PipelineQueueStatuses; контакты и виды вложений — CardContactTypes/CardFileKinds; источники и этапы отсева — PipelineRejectStages/PipelineRejectSources; ключи промптов/провайдеров — SettingsFieldKeys; wire-ключи канбана — KanbanWireKeys; режимы правил — ColumnRuleModes; операции/фазы/виды диалогов/контакты Telegram и общий BoolText — в Deal.Contracts/Deal.SharedKernel; имена метрик — DealMetrics. Значения не менялись.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using System.Globalization;
|
||||
using System.Text.Json;
|
||||
using Deal.Modules.Settings.Application.Models;
|
||||
using Deal.SharedKernel.Utilities;
|
||||
|
||||
namespace Deal.Modules.Settings.Application.Services;
|
||||
|
||||
@@ -82,11 +83,11 @@ public sealed partial class SettingsService
|
||||
return true;
|
||||
|
||||
case JsonValueKind.True:
|
||||
text = "true";
|
||||
text = BoolText.True;
|
||||
return true;
|
||||
|
||||
case JsonValueKind.False:
|
||||
text = "false";
|
||||
text = BoolText.False;
|
||||
return true;
|
||||
|
||||
default:
|
||||
@@ -218,9 +219,9 @@ public sealed partial class SettingsService
|
||||
continue;
|
||||
}
|
||||
|
||||
string apiKey = TryReadFieldText(provider.Value, "apiKey", out string storedKey) ? storedKey : string.Empty;
|
||||
string baseUrl = TryReadFieldText(provider.Value, "baseUrl", out string storedBase) ? storedBase : string.Empty;
|
||||
string model = TryReadFieldText(provider.Value, "model", out string storedModel) ? storedModel : string.Empty;
|
||||
string apiKey = TryReadFieldText(provider.Value, SettingsFieldKeys.ApiKey, out string storedKey) ? storedKey : string.Empty;
|
||||
string baseUrl = TryReadFieldText(provider.Value, SettingsFieldKeys.BaseUrl, out string storedBase) ? storedBase : string.Empty;
|
||||
string model = TryReadFieldText(provider.Value, SettingsFieldKeys.Model, out string storedModel) ? storedModel : string.Empty;
|
||||
merged[provider.Name] = new AiConfigSetting(apiKey, baseUrl, model);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user