|
@@ -19,6 +19,7 @@ using TEAMModelOS.SDK.DI.AzureCosmos.Inner;
|
|
using TEAMModelOS.SDK.Extension;
|
|
using TEAMModelOS.SDK.Extension;
|
|
using TEAMModelOS.SDK.Helper.Common.CollectionHelper;
|
|
using TEAMModelOS.SDK.Helper.Common.CollectionHelper;
|
|
using TEAMModelOS.SDK.Helper.Common.StringHelper;
|
|
using TEAMModelOS.SDK.Helper.Common.StringHelper;
|
|
|
|
+using System.Dynamic;
|
|
|
|
|
|
namespace TEAMModelOS.Controllers
|
|
namespace TEAMModelOS.Controllers
|
|
{
|
|
{
|
|
@@ -401,13 +402,15 @@ namespace TEAMModelOS.Controllers
|
|
var response = await client.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(classId.ToString(), new PartitionKey($"Class-{code}"));
|
|
var response = await client.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(classId.ToString(), new PartitionKey($"Class-{code}"));
|
|
if (response.Status == 200)
|
|
if (response.Status == 200)
|
|
{
|
|
{
|
|
|
|
+ dynamic courseResult = new ExpandoObject();
|
|
using var json = await JsonDocument.ParseAsync(response.ContentStream);
|
|
using var json = await JsonDocument.ParseAsync(response.ContentStream);
|
|
|
|
+ courseResult.id = json.RootElement.GetProperty("id").GetString();
|
|
|
|
+ courseResult.courses = new List<coursesInClass>();
|
|
if (json.RootElement.TryGetProperty("courses", out JsonElement coursesJobj))
|
|
if (json.RootElement.TryGetProperty("courses", out JsonElement coursesJobj))
|
|
{
|
|
{
|
|
- Dictionary<string, object> dictc = new Dictionary<string, object>();
|
|
|
|
- dictc["courses"] = coursesJobj.ToObject<object>();
|
|
|
|
- courses.Add(dictc);
|
|
|
|
|
|
+ courseResult.courses = coursesJobj.ToObject<object>();
|
|
}
|
|
}
|
|
|
|
+ courses.Add(courseResult);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
////[Jeff] 取得Class表中課程安排 (Class.courses)
|
|
////[Jeff] 取得Class表中課程安排 (Class.courses)
|