qinchaoyue 4 月之前
父節點
當前提交
8087040db3

+ 2 - 1
src/Hotline.Application.Tests/Application/SnapshotApplicationTest.cs

@@ -281,7 +281,8 @@ public class SnapshotApplicationTest : TestBase
         var orderSnapshot = await _orderSnapshotRepository.Queryable()
             .OrderByDescending(m => m.CreationTime).FirstAsync();
         var order = await _orderRepository.GetAsync("08dd18e0-1c9e-4aa5-8dc6-f639e8d1b3ea");
-        var token = new ThirdTokenDto { AppId = "TAjYAYuA", Secret = "c01eb299b9d784bf55681af4da86bab6ba428101" };
+        var tiqnque = _systemSettingCacheManager.TianQueAppKeySecret.Split('|');
+        var token = new ThirdTokenDto { AppId = tiqnque[0], Secret = tiqnque[1] };
         order.No = DateTime.Now.ToString("yyyyMMddhhmmssyyyy");
         orderSnapshot.DeadLine = DateTime.Now.AddDays(_systemSettingCacheManager.OvertimeBack);
         var result = await _guiderSystemService.PostOrder(order, orderSnapshot, token);

+ 5 - 1
src/Hotline/Caching/Services/SystemSettingCacheManager.cs

@@ -182,6 +182,10 @@ namespace Hotline.Caching.Services
         public int OvertimeBack =>
             GetOrDefault("08dd18e0-1c9e-4aa5-8dc6-f639e8d1b3ea", SettingConstants.OvertimeBack, "网格员回复等待时间(单元小时)", 4, "网格员回复等待时间(单位:小时), 超过该时间自动退回工单");
 
-        public string TianQueAppKeySecret => throw new NotImplementedException();
+        /// <summary>
+        /// 天阙服务AppKey|AppSecret
+        /// </summary>
+        public string TianQueAppKeySecret =>
+            GetOrDefault("08dcf4d7-3746-4f16-86b6-ef820421e5cb", SettingConstants.TianQueAppKeySecret, "天阙服务AppKey|AppSecret", "TAjYAYuA|c01eb299b9d784bf55681af4da86bab6ba428101", "天阙服务 AppKey|AppSecret, Key 和 Secret 使用 | 分隔");
     }
 }

+ 9 - 4
src/Hotline/Settings/SettingConstants.cs

@@ -658,10 +658,15 @@ namespace Hotline.Settings
         /// </summary>
         public static string AppBanner = "小程序Banner";
 
-		/// <summary>
-		/// 部门满意度明细不显示工单
-		/// </summary>
-		public const string OrgVisitDetailHiddenOrderNo = "OrgVisitDetailHiddenOrderNo";
+        /// <summary>
+        /// 天阙服务AppKey|AppSecret
+        /// </summary>
+        public static string TianQueAppKeySecret = "TianQueAppKeySecret";
+
+        /// <summary>
+        /// 部门满意度明细不显示工单
+        /// </summary>
+        public const string OrgVisitDetailHiddenOrderNo = "OrgVisitDetailHiddenOrderNo";
 
         /// <summary>
         /// 交办单是否保密

+ 2 - 17
src/TianQue.Sdk/TiqnQueService.cs

@@ -16,8 +16,6 @@ namespace TianQue.Sdk;
 
 public class TiqnQueService : IGuiderSystemService, IScopeDependency
 {
-    private readonly string appSecret = "c01eb299b9d784bf55681af4da86bab6ba428101";
-    private readonly string appKey = "TAjYAYuA";
     private readonly ILogger<TQHttpClient> _logger;
     private readonly string _url = "http://10.0.188.11:6090/api/v1/test/accept/saveAcceptInfoApi";
 
@@ -26,26 +24,13 @@ public class TiqnQueService : IGuiderSystemService, IScopeDependency
         _logger = logger;
     }
 
-    public async Task<string> PostAcceptInfo()
-    {
-
-        var bodyDic = new SortedDictionary<string, object>
-        {
-            { "p2", "p2"},
-            { "p1", "p1"}
-        };
-
-
-        return "ok";
-    }
-
     public async Task<string> PostOrder(Order order, OrderSnapshot orderSnapshot, ThirdTokenDto tokenDto)
     {
         TQHttpClient httpClient;
 #if DEBUG
-         httpClient = new TQHttpClient(appSecret, appKey, "171.94.154.2", 22, "root" , "ZGbyy@2024!", _logger);
+         httpClient = new TQHttpClient(tokenDto.Secret, tokenDto.AppId, "171.94.154.2", 22, "root" , "ZGbyy@2024!", _logger);
 #else
-         httpClient = new TQHttpClient(appSecret, appKey, _logger);
+         httpClient = new TQHttpClient(tokenDto.Secret, tokenDto.AppId, _logger);
 #endif
         var acceptInfo = order.Adapt<AcceptInfo>();
         acceptInfo.ReplyCode = order.No!; // 唯一标识