2 Commits ddbf87ec83 ... f7da64f73a

Author SHA1 Message Date
  jiangjc f7da64f73a Merge branch 'develop' of http://132.232.92.186:3000/XinXiBu/OA2023 into develop 1 month ago
  jiangjc e3558826e6 111 1 month ago

+ 0 - 15
OASystem/OASystem.Api/OAMethodLib/APNs/APNsLib.cs

@@ -1,15 +0,0 @@
-
-namespace OASystem.API.OAMethodLib.APNsLib
-{
-    public static class APNsLib
-    {
-        private static readonly IAPNsService _APNsService = AutofacIocManager.Instance.GetService<IAPNsService>();
-
-        public static async Task<Result> pushMsg(string apnsTopic, string deviceToken, NotificationType type, string title, string subtitle, string body)
-        {
-            Result rst = await _APNsService.PushNotification(apnsTopic, deviceToken, type, title, subtitle, body);
-
-            return rst;
-        }
-    }
-}

+ 2 - 1
OASystem/OASystem.Api/OAMethodLib/GeneralMethod.cs

@@ -39,6 +39,7 @@ namespace OASystem.API.OAMethodLib
         private static readonly TableOperationRecordRepository _tableOperationRecordRep = AutofacIocManager.Instance.GetService<TableOperationRecordRepository>();
         private static readonly MessageRepository _messageRep = AutofacIocManager.Instance.GetService<MessageRepository>();
         private static readonly DeviceTokenRepository _deviceTokenRep = AutofacIocManager.Instance.GetService<DeviceTokenRepository>();
+        private static readonly IAPNsService _APNsService = AutofacIocManager.Instance.GetService<IAPNsService>();
         private static readonly IHubContext<ChatHub, IChatClient> _hubContext = AutofacIocManager.Instance.GetService<IHubContext<ChatHub, IChatClient>>();
 
         private readonly static string[] weekdays = new string[] { "星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六" };
@@ -4450,7 +4451,7 @@ namespace OASystem.API.OAMethodLib
             var rst = await _deviceTokenRep.Query(s => s.Number == Numbers).SingleAsync();
             Result rst2 = new Result() { Code = -1, Msg = "" };
             if (rst != null) {
-                rst2 = await APNsLib.APNsLib.pushMsg("com.panamerican.oa2024", rst.DeviceToken, NotificationType.Alert, title, subtitle, body);
+                rst2 = await _APNsService.PushNotification("com.panamerican.oa2024", rst.DeviceToken, NotificationType.Alert, title, subtitle, body);
             }
             return rst2;
         }