Преглед изворни кода

学生课程数据结构设计

CrazyIter_Bin пре 4 година
родитељ
комит
d64ec9c8c6

+ 17 - 16
TEAMModelFunction/CourseServiceBus.cs

@@ -5,6 +5,8 @@ using System.Text;
 using System.Text.Json;
 using System.Threading.Tasks;
 using TEAMModelOS.SDK.DI;
+using TEAMModelOS.SDK.Extension;
+using TEAMModelOS.SDK.Models.Cosmos.Common;
 
 namespace TEAMModelFunction
 {
@@ -28,23 +30,22 @@ namespace TEAMModelFunction
         /// </data>
         /// <param name="msg"></param>
         /// <returns></returns>
-        [FunctionName("Course")]
-        public async Task StuList([ServiceBusTrigger("active-task", "course", Connection = "Azure:ServiceBus:ConnectionString")] string msg)
-        {
-            try
-            {
-                // await _dingDing.SendBotMsg($"ServiceBus,Blob(){msg}", GroupNames.醍摩豆服務運維群組);
-                var jsonMsg = JsonDocument.Parse(msg);
-                if (jsonMsg.RootElement.TryGetProperty("name", out JsonElement name) && name.ValueKind == JsonValueKind.String)
-                {
+        //[FunctionName("Course")]
+        //public async Task StuList([ServiceBusTrigger("active-task", "course", Connection = "Azure:ServiceBus:ConnectionString")] string msg)
+        //{
+        //    try
+        //    {
+        //        // await _dingDing.SendBotMsg($"ServiceBus,Blob(){msg}", GroupNames.醍摩豆服務運維群組);
+        //        var jsonMsg = JsonDocument.Parse(msg);
+        //        msg.ToObject<StuCourse>();
 
-                }
-            }
-            catch (Exception ex)
-            {
-                await _dingDing.SendBotMsg($"ServiceBus,Blob()\n{ex.Message}{ex.StackTrace}", GroupNames.醍摩豆服務運維群組);
-            }
-        }
+
+        //    }
+        //    catch (Exception ex)
+        //    {
+        //        await _dingDing.SendBotMsg($"ServiceBus,Blob()\n{ex.Message}{ex.StackTrace}", GroupNames.醍摩豆服務運維群組);
+        //    }
+        //}
 
     }
 }

+ 1 - 0
TEAMModelOS.SDK/Models/Cosmos/Common/JoinList.cs

@@ -29,6 +29,7 @@ namespace TEAMModelOS.SDK.Models.Cosmos.Common
      */
 
     /// <summary>
+    /// 暂时不使用
     /// 学生已经加入的名单列表
     /// 分学校创建的学生名单和教师创建的私人名单
     /// </summary>

+ 18 - 0
TEAMModelOS.SDK/Models/Cosmos/Common/StuCourse.cs

@@ -0,0 +1,18 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace TEAMModelOS.SDK.Models.Cosmos.Common
+{
+    public class StuCourse :CosmosEntity
+    {
+        /// <summary>
+        /// 课程的分区键课程Code
+        /// </summary>
+        public string scode { get; set; } = "Course";
+        public string name { get; set; }
+        public  string scope { get; set; }
+        public string school { get; set; }
+        public string creatorId { get; set; }
+    }
+}