Browse Source

短信发送接口 新增 version 参数

lifa 1 year ago
parent
commit
0a1686224c

+ 9 - 2
src/platform/ZhonTai.Admin/Services/DiTuiAPI/DiTuiAPIService.cs

@@ -358,9 +358,16 @@ namespace ZhonTai.Admin.Services.DiTuiAPI
         [HttpPost]
         [AllowAnonymous]
         [NoOprationLog]
-        public string SendCode(string phone)
+        public string SendCode(SendCodeInput input)
         {
-             //= new ISmsRepository();
+            string phone = input.Phone;
+            
+            if (string.IsNullOrEmpty(phone))
+            {
+                throw ResultOutput.Exception(string.Format("手机号不可为空"));
+            }
+
+            //= new ISmsRepository();
             var result = _smsRepository.Select.DisableGlobalFilter(FilterNames.Tenant)
                 .Where(a => a.Mobile == phone && a.Status == 0 && a.CreatedTime >= DateTime.Now.AddMinutes(-2))
                 .First(a => new

+ 20 - 0
src/platform/ZhonTai.Admin/Services/DiTuiAPI/Dto/SendCodeInput.cs

@@ -0,0 +1,20 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ZhonTai.Admin.Services.DiTuiAPI.Dto
+{
+    public class SendCodeInput
+    {
+        /// <summary>
+        ///  手机号
+        /// </summary>
+        public string Phone { get; set; }
+        /// <summary>
+        /// 版本号
+        /// </summary>
+        public string Version { get; set; }
+    }
+}