ソースを参照

記入訊息發送 DB紀錄架構 (途中)

jeff 3 ヶ月 前
コミット
61ade6699a

+ 36 - 0
TEAMModelBI/Controllers/BICommon/BINoticeController.cs

@@ -1585,6 +1585,42 @@ namespace TEAMModelBI.Controllers.BICommon
             return responseMessage;
         }
 
+        //BI訊息推送DB記入
+        /// <summary>
+        /// 
+        /// </summary>
+        /// <param name="msgType">訊息類型  mail:郵件、notify:端外、sms:簡訊</param>
+        /// <param name="selType">挑選方式  single:個別、multi:批次</param>
+        /// <returns></returns>
+        private async Task CrtBiNoticeData(string msgType, string selType)
+        {
+            var cosmosClientIes = _azureCosmos.GetCosmosClient(); //IES
+            BINotice bINotice = new()
+            {
+                id = Guid.NewGuid().ToString(),
+                code = "BINotice",
+                msgType = msgType,
+                selType = selType,
+
+
+
+                //type = !string.IsNullOrEmpty($"{type}") ? type.GetInt32() : 0,
+                //jumpUrl = !string.IsNullOrEmpty($"{jumpUrl}") ? $"{jumpUrl}" : "",
+                //callbackName = !string.IsNullOrEmpty($"{callbackName}") ? $"{callbackName}" : "",
+                //refuseName = !string.IsNullOrEmpty($"{refuseName}") ? $"{refuseName}" : "",
+                //theme = $"{theme}",
+                //content = $"{content}",
+                //crowd = crowd,
+                //crowdIds = idNameCodes.Select(s => $"{s.id}_{tagServiceName}").ToList(),
+                //createId = _tmdId,
+                //sendTime = sendTime.GetInt64(),//发布时间待解决
+                //createTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(),
+                //source = !string.IsNullOrEmpty($"{source}") ? $"{source}" : "BI"
+            };
+
+            bINotice = await cosmosClientIes.GetContainer(Constant.TEAMModelOS, "Common").CreateItemAsync<BINotice>(bINotice, new PartitionKey("BINotice"));
+        }
+
         private string GetDictionaryKeyByValue(Dictionary<string, string> dic, string value)
         {
             string result = string.Empty;

+ 2 - 2
TEAMModelOS.SDK/Models/Cosmos/BI/BICommon/Notice.cs

@@ -17,11 +17,11 @@ namespace TEAMModelOS.SDK.Models.Cosmos.BI
         }
         #region 新通知類型
         /// <summary>
-        /// 訊息類型  ext:端外通知  email:Email  sms:簡訊
+        /// 訊息類型  mail:郵件、notify:端外、sms:簡訊
         /// </summary>
         public string msgType { get; set; }
         /// <summary>
-        /// 挑選方式  mul:批次  sin:個別
+        /// 挑選方式  single:個別、multi:批次
         /// </summary>
         public string selType { get; set; }
         /// <summary>