AipSettings.cs 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. using Aip.Service.Aip.Models;
  2. namespace Aip.Service.Configurations
  3. {
  4. public class AipSettings
  5. {
  6. public int ProcessId { get; set; }
  7. public int AipServerId { get; set; }
  8. public int Port { get; set; }
  9. public int Bindings { get; set; }
  10. public int AipPort { get; set; }
  11. public int AipBindings { get; set; }
  12. public string AppName { get; set; } = string.Empty; // 어플리케이션 이름
  13. public string AppVersion { get; set; } = string.Empty; // 어플리케이션 버전
  14. public string ClientId { get; set; } = string.Empty; // 어플리케이션 ID(클라이언트 ID)
  15. public string TenantId { get; set; } = string.Empty; // 디렉토리(테넌트) ID
  16. public string MipData { get; set; } = string.Empty; // Mip Data Path
  17. public string Domain { get; set; } = string.Empty; // Domain
  18. public string EMail { get; set; } = string.Empty; // User E-Mail
  19. public string SecretValue { get; set; } = string.Empty; // 인증 비밀번호
  20. public string CertThumbPrint { get; set; } = string.Empty; // 인증서 지문
  21. public string LoginType { get; set; } = string.Empty; // 로그인 유형
  22. public string SourceFileDir { get; set; } = string.Empty; // 작업 파일 경로
  23. public string TargetFileDir { get; set; } = string.Empty; // 작업 완료 파일 경로
  24. public string SetLabelId { get; set; } = string.Empty; // Label 설정 GUID
  25. public string DeleteLabelId { get; set; } = string.Empty; // Label 해제 GUID
  26. public string SetTemplateId { get; set; } = string.Empty; // Protection 설정 GUID
  27. public string DeleteTemplateId { get; set; } = string.Empty; // Protection 해제 GUID
  28. public string SupportedFileExt { get; set; } = string.Empty;
  29. public string ProtectedFileExt { get; set; } = string.Empty;
  30. public AipConfig GetConfig()
  31. {
  32. return new AipConfig
  33. {
  34. AppName = AppName, // 어플리케이션 이름
  35. AppVersion = AppVersion, // 어플리케이션 버전
  36. ClientId = ClientId, // 어플리케이션 ID(클라이언트 ID)
  37. TenantId = TenantId, // 디렉토리(테넌트) ID
  38. MipData = MipData, // Mip Data Path
  39. Domain = Domain, // Domain
  40. EMail = EMail, // User E-Mail
  41. SecretValue = SecretValue, // 인증 비밀번호
  42. CertThumbPrint = CertThumbPrint, // 인증서 지문
  43. LoginType = GetLoginType(),
  44. };
  45. }
  46. public AipAuthLoginType GetLoginType()
  47. {
  48. AipAuthLoginType loginType = (AipAuthLoginType)Enum.Parse(typeof(AipAuthLoginType), LoginType, true);
  49. //if (loginType == null)
  50. //{
  51. // loginType = AipAuthLoginType.authLoginPassword;
  52. //}
  53. return loginType;
  54. }
  55. public void SetValue(string Key, string Value)
  56. {
  57. if (string.IsNullOrEmpty(Key))
  58. {
  59. return;
  60. }
  61. Key = Key.Trim();
  62. Value = Value.Trim();
  63. if (Key.Equals("AppName", StringComparison.OrdinalIgnoreCase))
  64. {
  65. AppName = Value;
  66. }
  67. else if (Key.Equals("AppVersion", StringComparison.OrdinalIgnoreCase))
  68. {
  69. AppVersion = Value;
  70. }
  71. else if (Key.Equals("ClientId", StringComparison.OrdinalIgnoreCase))
  72. {
  73. ClientId = Value;
  74. }
  75. else if (Key.Equals("TenantId", StringComparison.OrdinalIgnoreCase))
  76. {
  77. TenantId = Value;
  78. }
  79. else if (Key.Equals("MipData", StringComparison.OrdinalIgnoreCase))
  80. {
  81. MipData = Value;
  82. }
  83. else if (Key.Equals("LoginType", StringComparison.OrdinalIgnoreCase))
  84. {
  85. LoginType = Value;
  86. }
  87. else if (Key.Equals("Domain", StringComparison.OrdinalIgnoreCase))
  88. {
  89. Domain = Value;
  90. }
  91. else if (Key.Equals("EMail", StringComparison.OrdinalIgnoreCase))
  92. {
  93. EMail = Value;
  94. }
  95. else if (Key.Equals("SecretValue", StringComparison.OrdinalIgnoreCase))
  96. {
  97. SecretValue = Value;
  98. }
  99. else if (Key.Equals("CertThumbPrint", StringComparison.OrdinalIgnoreCase))
  100. {
  101. CertThumbPrint = Value;
  102. }
  103. else if (Key.Equals("SourceFileDir", StringComparison.OrdinalIgnoreCase))
  104. {
  105. SourceFileDir = Value;
  106. }
  107. else if (Key.Equals("TargetFileDir", StringComparison.OrdinalIgnoreCase))
  108. {
  109. TargetFileDir = Value;
  110. }
  111. else if (Key.Equals("SetLabelId", StringComparison.OrdinalIgnoreCase))
  112. {
  113. SetLabelId = Value;
  114. }
  115. else if (Key.Equals("DeleteLabelId", StringComparison.OrdinalIgnoreCase))
  116. {
  117. DeleteLabelId = Value;
  118. }
  119. else if (Key.Equals("SetTemplateId", StringComparison.OrdinalIgnoreCase))
  120. {
  121. SetTemplateId = Value;
  122. }
  123. else if (Key.Equals("DeleteTemplateId", StringComparison.OrdinalIgnoreCase))
  124. {
  125. DeleteTemplateId = Value;
  126. }
  127. else if (Key.Equals("SupportedFileExt", StringComparison.OrdinalIgnoreCase))
  128. {
  129. SupportedFileExt = Value.Trim().ToLower();
  130. }
  131. else if (Key.Equals("ProtectedFileExt", StringComparison.OrdinalIgnoreCase))
  132. {
  133. ProtectedFileExt = Value.Trim().ToLower();
  134. }
  135. }
  136. }
  137. }