Browse Source

HiTeachAPI 根據修正後DB模型變更回傳值內容:試卷、試題

jeff 4 years ago
parent
commit
ea1d845402
1 changed files with 4 additions and 4 deletions
  1. 4 4
      TEAMModelOS/Controllers/Client/HiTeachController.cs

+ 4 - 4
TEAMModelOS/Controllers/Client/HiTeachController.cs

@@ -134,7 +134,7 @@ namespace TEAMModelOS.Controllers.Client
                 }
                 //老師個人試題
                 List<object> items = new List<object>();
-                await foreach (var item in client.GetContainer("TEAMModelOSTemp", "Teacher").GetItemQueryStreamIterator(queryText: $"SELECT c.id, c.blob, c.type, c.points, c.field, c.subjectName, c.level, c.usageCount, c.scope from c ", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Item-{id}") }))
+                await foreach (var item in client.GetContainer("TEAMModelOSTemp", "Teacher").GetItemQueryStreamIterator(queryText: $"SELECT c.id, c.blob, c.type, c.points, c.field, c.subjectName, c.level, c.useCount, c.createDate from c ", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Item-{id}") }))
                 {
                     using var json = await JsonDocument.ParseAsync(item.ContentStream);
                     if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
@@ -147,7 +147,7 @@ namespace TEAMModelOS.Controllers.Client
                 }
                 //老師個人試券
                 List<object> papers = new List<object>();
-                await foreach (var item in client.GetContainer("TEAMModelOSTemp", "Teacher").GetItemQueryStreamIterator(queryText: $"SELECT c.id, c.name, c.blob, c.index, c.items, c.subjectName, c.score, c.scope from c ", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Paper-{id}") }))
+                await foreach (var item in client.GetContainer("TEAMModelOSTemp", "Teacher").GetItemQueryStreamIterator(queryText: $"SELECT c.id, c.name, c.blob, c.subjectName, c.score, c.useCount, c.createDate from c ", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Paper-{id}") }))
                 {
                     using var json = await JsonDocument.ParseAsync(item.ContentStream);
                     if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
@@ -322,7 +322,7 @@ namespace TEAMModelOS.Controllers.Client
 
             //校本試題
             List<object> items = new List<object>();
-            await foreach (var item in client.GetContainer("TEAMModelOSTemp", "School").GetItemQueryStreamIterator(queryText: $"SELECT c.id, c.blob, c.type, c.points, c.field, c.periodId, c.gradeIds, c.subjectId, c.level, c.usageCount, c.scope from c ", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Item-{school_code}") }))
+            await foreach (var item in client.GetContainer("TEAMModelOSTemp", "School").GetItemQueryStreamIterator(queryText: $"SELECT c.id, c.blob, c.type, c.points, c.field, c.periodId, c.gradeIds, c.subjectId, c.level, c.useCount, c.createDate from c ", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Item-{school_code}") }))
             {
                 using var json = await JsonDocument.ParseAsync(item.ContentStream);
                 if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
@@ -335,7 +335,7 @@ namespace TEAMModelOS.Controllers.Client
             }
             //校本試券
             List<object> papers = new List<object>();
-            await foreach (var item in client.GetContainer("TEAMModelOSTemp", "School").GetItemQueryStreamIterator(queryText: $"SELECT c.id, c.name, c.blob, c.index, c.items, c.periodId, c.gradeIds, c.subjectId, c.score, c.level, c.useCount, c.scope from c ", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Paper-{school_code}") }))
+            await foreach (var item in client.GetContainer("TEAMModelOSTemp", "School").GetItemQueryStreamIterator(queryText: $"SELECT c.id, c.name, c.blob, c.periodId, c.gradeIds, c.subjectId, c.score, c.useCount, c.createDate from c ", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Paper-{school_code}") }))
             {
                 using var json = await JsonDocument.ParseAsync(item.ContentStream);
                 if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)