CrazyIter_Bin 2 years ago
parent
commit
ce5850b599

+ 15 - 2
TEAMModelOS.FunctionV4/HttpTrigger/IESHttpTrigger.cs

@@ -70,6 +70,19 @@ namespace TEAMModelOS.FunctionV4.HttpTrigger
             return response;
 
 
+        }
+        /// <summary>
+        /// 数据推送接口
+        /// </summary>
+        /// <param name="req"></param>
+        /// <param name="log"></param>
+        /// <returns></returns>
+        [Function("lesson-tag-change")]
+        public async Task<HttpResponseData> LessonTagChange([HttpTrigger(AuthorizationLevel.Anonymous, "post", Route = null)] HttpRequestData req) {
+            var response = req.CreateResponse(HttpStatusCode.OK);
+            string data = await new StreamReader(req.Body).ReadToEndAsync();
+            var json = JsonDocument.Parse(data).RootElement;
+            return response;
         }
         /// <summary>
         /// 数据推送接口
@@ -83,7 +96,7 @@ namespace TEAMModelOS.FunctionV4.HttpTrigger
             var response = req.CreateResponse(HttpStatusCode.OK);
             string data = await new StreamReader(req.Body).ReadToEndAsync();
             var json = JsonDocument.Parse(data).RootElement;
-            List<OldNew> old_new = null;
+            List<KnowledgeOldNew> old_new = null;
             string school = null;
             if (json.TryGetProperty("school", out JsonElement _school))
             {
@@ -91,7 +104,7 @@ namespace TEAMModelOS.FunctionV4.HttpTrigger
             }
             if (json.TryGetProperty("old_new", out JsonElement _old_new))
             {
-                old_new = _old_new.ToObject<List<OldNew>>();
+                old_new = _old_new.ToObject<List<KnowledgeOldNew>>();
             }
             if (old_new.IsNotEmpty() && !string.IsNullOrWhiteSpace(school))
             {

+ 1 - 1
TEAMModelOS.SDK/Models/Cosmos/School/Knowledge.cs

@@ -39,7 +39,7 @@ namespace TEAMModelOS.SDK.Models
         public List<Block> blocks { get; set; } = new List<Block>();
 
     }
-    public class OldNew
+    public class KnowledgeOldNew
     {
         [Required(ErrorMessage = "_old 必须设置")]
         public string _old { get; set; }

+ 2 - 2
TEAMModelOS/Controllers/School/KnowledgesController.cs

@@ -122,10 +122,10 @@ namespace TEAMModelOS.Controllers
         {
             if (!json.TryGetProperty("school", out JsonElement school)) return BadRequest();
             Knowledge knowledge = json.GetProperty("knowledge").ToObject<Knowledge>();
-            List<OldNew> old_new = null;
+            List<KnowledgeOldNew> old_new = null;
             if (json.TryGetProperty("old_new", out JsonElement _old_new))
             {
-                old_new = _old_new.ToObject<List<OldNew>>();
+                old_new = _old_new.ToObject<List<KnowledgeOldNew>>();
             }
             ValidResult validResult = knowledge.Valid();
             if (!validResult.isVaild)