using Aip.Service.Aip.Models; namespace Aip.Service.Configurations { public class AipSettings { public int ProcessId { get; set; } public int AipServerId { get; set; } public int Port { get; set; } public int Bindings { get; set; } public int AipPort { get; set; } public int AipBindings { get; set; } public string AppName { get; set; } = string.Empty; // 어플리케이션 이름 public string AppVersion { get; set; } = string.Empty; // 어플리케이션 버전 public string ClientId { get; set; } = string.Empty; // 어플리케이션 ID(클라이언트 ID) public string TenantId { get; set; } = string.Empty; // 디렉토리(테넌트) ID public string MipData { get; set; } = string.Empty; // Mip Data Path public string Domain { get; set; } = string.Empty; // Domain public string EMail { get; set; } = string.Empty; // User E-Mail public string SecretValue { get; set; } = string.Empty; // 인증 비밀번호 public string CertThumbPrint { get; set; } = string.Empty; // 인증서 지문 public string LoginType { get; set; } = string.Empty; // 로그인 유형 public string SourceFileDir { get; set; } = string.Empty; // 작업 파일 경로 public string TargetFileDir { get; set; } = string.Empty; // 작업 완료 파일 경로 public string SetLabelId { get; set; } = string.Empty; // Label 설정 GUID public string DeleteLabelId { get; set; } = string.Empty; // Label 해제 GUID public string SetTemplateId { get; set; } = string.Empty; // Protection 설정 GUID public string DeleteTemplateId { get; set; } = string.Empty; // Protection 해제 GUID public string SupportedFileExt { get; set; } = string.Empty; public string ProtectedFileExt { get; set; } = string.Empty; public AipConfig GetConfig() { return new AipConfig { AppName = AppName, // 어플리케이션 이름 AppVersion = AppVersion, // 어플리케이션 버전 ClientId = ClientId, // 어플리케이션 ID(클라이언트 ID) TenantId = TenantId, // 디렉토리(테넌트) ID MipData = MipData, // Mip Data Path Domain = Domain, // Domain EMail = EMail, // User E-Mail SecretValue = SecretValue, // 인증 비밀번호 CertThumbPrint = CertThumbPrint, // 인증서 지문 LoginType = GetLoginType(), }; } public AipAuthLoginType GetLoginType() { AipAuthLoginType loginType = (AipAuthLoginType)Enum.Parse(typeof(AipAuthLoginType), LoginType, true); //if (loginType == null) //{ // loginType = AipAuthLoginType.authLoginPassword; //} return loginType; } public void SetValue(string Key, string Value) { if (string.IsNullOrEmpty(Key)) { return; } Key = Key.Trim(); Value = Value.Trim(); if (Key.Equals("AppName", StringComparison.OrdinalIgnoreCase)) { AppName = Value; } else if (Key.Equals("AppVersion", StringComparison.OrdinalIgnoreCase)) { AppVersion = Value; } else if (Key.Equals("ClientId", StringComparison.OrdinalIgnoreCase)) { ClientId = Value; } else if (Key.Equals("TenantId", StringComparison.OrdinalIgnoreCase)) { TenantId = Value; } else if (Key.Equals("MipData", StringComparison.OrdinalIgnoreCase)) { MipData = Value; } else if (Key.Equals("LoginType", StringComparison.OrdinalIgnoreCase)) { LoginType = Value; } else if (Key.Equals("Domain", StringComparison.OrdinalIgnoreCase)) { Domain = Value; } else if (Key.Equals("EMail", StringComparison.OrdinalIgnoreCase)) { EMail = Value; } else if (Key.Equals("SecretValue", StringComparison.OrdinalIgnoreCase)) { SecretValue = Value; } else if (Key.Equals("CertThumbPrint", StringComparison.OrdinalIgnoreCase)) { CertThumbPrint = Value; } else if (Key.Equals("SourceFileDir", StringComparison.OrdinalIgnoreCase)) { SourceFileDir = Value; } else if (Key.Equals("TargetFileDir", StringComparison.OrdinalIgnoreCase)) { TargetFileDir = Value; } else if (Key.Equals("SetLabelId", StringComparison.OrdinalIgnoreCase)) { SetLabelId = Value; } else if (Key.Equals("DeleteLabelId", StringComparison.OrdinalIgnoreCase)) { DeleteLabelId = Value; } else if (Key.Equals("SetTemplateId", StringComparison.OrdinalIgnoreCase)) { SetTemplateId = Value; } else if (Key.Equals("DeleteTemplateId", StringComparison.OrdinalIgnoreCase)) { DeleteTemplateId = Value; } else if (Key.Equals("SupportedFileExt", StringComparison.OrdinalIgnoreCase)) { SupportedFileExt = Value.Trim().ToLower(); } else if (Key.Equals("ProtectedFileExt", StringComparison.OrdinalIgnoreCase)) { ProtectedFileExt = Value.Trim().ToLower(); } } } }