zhouj1203@hotmail.com 4 years ago
parent
commit
71785911a4

+ 16 - 0
TEAMModelFunction/AServiceBus.cs

@@ -0,0 +1,16 @@
+using System;
+using Microsoft.Azure.WebJobs;
+using Microsoft.Azure.WebJobs.Host;
+using Microsoft.Extensions.Logging;
+
+namespace TEAMModelFunction
+{
+    public static class AServiceBus
+    {
+        [FunctionName("AServiceBus")]
+        public static void Run([ServiceBusTrigger("mytopic", "mysubscription", Connection = "")]string mySbMsg, ILogger log)
+        {
+            log.LogInformation($"C# ServiceBus topic trigger function processed message: {mySbMsg}");
+        }
+    }
+}

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

@@ -237,12 +237,12 @@ namespace TEAMModelOS.Controllers
                 //List<IdPk> idPk = await _azureCosmos.DeleteAll<Course>(request);
                 //await client.GetContainer("TEAMModelOS", "School").DeleteItemStreamAsync(id.ToString(), new PartitionKey($"Class-{code}"));
                 StringBuilder sqlM = new StringBuilder();
-                sqlM.Append("select value(c) from c join A0 in c.courses ");
+                sqlM.Append("select value(c) from c ");
                 Dictionary<string, object> dict_management = new Dictionary<string, object>();
                 //处理ID
                 if (request.ids.IsNotEmpty())
                 {
-                    dict_management.Add("A0.course.id", request.ids.ToArray());
+                    dict_management.Add("courses[*].course.id", request.ids.ToArray());
                 }
                 List <CourseManagement> managements = new List<CourseManagement>();
                 AzureCosmosQuery cosmosDbQuery_1 = SQLHelper.GetSQL(dict_management, sqlM);