Pārlūkot izejas kodu

新增短信接收

zhoufan 4 gadi atpakaļ
vecāks
revīzija
3475424342

+ 1 - 0
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/CallCenterApi.Interface.csproj

@@ -299,6 +299,7 @@
299 299
     <Compile Include="Models\Input\QuesttionInput.cs" />
300 300
     <Compile Include="Models\Input\QuesttionItemInput.cs" />
301 301
     <Compile Include="Models\Input\RoleInput.cs" />
302
+    <Compile Include="Models\Input\SmsInput.cs" />
302 303
     <Compile Include="Models\Input\SysConfigInput.cs" />
303 304
     <Compile Include="Models\Input\UserAccountInput.cs" />
304 305
     <Compile Include="Models\Input\VoiceCategoryInput.cs" />

+ 3 - 3
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/HomeController.cs

@@ -445,10 +445,10 @@ namespace CallCenterApi.Interface.Controllers
445 445
         /// 发送短信
446 446
         /// </summary>
447 447
         /// <returns></returns>
448
-        public ActionResult Send()
448
+        public ActionResult Send(string phones, string templateCode, string templateParam)
449 449
         {
450
-            string result=SmsHelper.Send("15515701425", "614915038222241792");
451
-
450
+            //string result=SmsHelper.Send("15838094023", "614915038222241792");
451
+            string result = SmsHelper.Send(phones, templateCode, templateParam);
452 452
             return Success(result);
453 453
         }
454 454
     }

+ 12 - 0
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/Sms/SmsNewController.cs

@@ -1,4 +1,5 @@
1 1
 using CallCenterApi.Interface.Controllers.Base;
2
+using CallCenterApi.Interface.Models.Input;
2 3
 using System;
3 4
 using System.Collections.Generic;
4 5
 using System.Linq;
@@ -14,5 +15,16 @@ namespace CallCenterApi.Interface.Controllers.Sms
14 15
         {
15 16
             return Content("Index");
16 17
         }
18
+
19
+        /// <summary>
20
+        /// 接收短信
21
+        /// </summary>
22
+        /// <param name="data"></param>
23
+        /// <returns></returns>
24
+        public ActionResult Receive(SmsInput data)
25
+        {
26
+            //存入数据库
27
+            return Content("");
28
+        }
17 29
     }
18 30
 }

+ 21 - 0
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Models/Input/SmsInput.cs

@@ -0,0 +1,21 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Linq;
4
+using System.Web;
5
+
6
+namespace CallCenterApi.Interface.Models.Input
7
+{
8
+    public class SmsInput
9
+    {
10
+        public string apiKey { get; set; }
11
+        public List<SmsDetailInput> data { get; set; }
12
+    }
13
+
14
+    public class SmsDetailInput
15
+    {
16
+        public string srcId { get; set; }
17
+        public string tel { get; set; }
18
+        public string content { get; set; }
19
+        public string arriveTime { get; set; }
20
+    }
21
+}

+ 3 - 3
CallCenterCommon/CallCenter.Utility/Sms/SmsHelper.cs

@@ -16,9 +16,9 @@ namespace CallCenter.Utility
16 16
         /// <summary>
17 17
         /// 发送短信
18 18
         /// </summary>
19
-        /// <param name="phones"></param>
20
-        /// <param name="templateCode"></param>
21
-        /// <param name="templateParam"></param>
19
+        /// <param name="phones">手机号、多个手机号英文逗号隔开</param>
20
+        /// <param name="templateCode">模板编号</param>
21
+        /// <param name="templateParam">[\"工单号\"]、[\"工单号\",\"工单号\",\"工单号\",...]</param>
22 22
         /// <returns></returns>
23 23
         public static string Send(string phones,string templateCode,string templateParam="")
24 24
         {