Ver Fonte

新增測試環境

ChingYi há 8 meses atrás
pai
commit
ea8b481b00
1 ficheiros alterados com 12 adições e 3 exclusões
  1. 12 3
      DocAI/DocAI.cs

+ 12 - 3
DocAI/DocAI.cs

@@ -22,6 +22,7 @@ namespace KdanCommon.DocAI
         // DocAI website : https://kdanai.azurewebsites.net/swagger/index.html
 
         private static string DocAIDomain = "https://kdanai.azurewebsites.net";
+        private static string DocAIPreparingDomain = "https://kdanai-test.azurewebsites.net";
 
         private HttpClient _httpClient = null;
         private string _appName = null;
@@ -31,15 +32,23 @@ namespace KdanCommon.DocAI
         private Uri _verifyUserUri = null;
         private Uri _redactInfoExtractUri = null;
 
-        public DocAI(string appName, string appVersion)
+        public DocAI(string appName, string appVersion, bool isPreparing)
         {
             _httpClient = new HttpClient();
             _appName = appName;
             _appVersion = appVersion;
             _platform = "uwp";
 
-            _verifyUserUri = new Uri($"{DocAIDomain}/verify_user");
-            _redactInfoExtractUri = new Uri($"{DocAIDomain}/redact_info_extract");
+            if (isPreparing)
+            {
+                _verifyUserUri = new Uri($"{DocAIPreparingDomain}/verify_user");
+                _redactInfoExtractUri = new Uri($"{DocAIPreparingDomain}/redact_info_extract");
+            }
+            else
+            {
+                _verifyUserUri = new Uri($"{DocAIDomain}/verify_user");
+                _redactInfoExtractUri = new Uri($"{DocAIDomain}/redact_info_extract");
+            }
         }
 
         ~DocAI()