|
@@ -53,8 +53,6 @@ namespace TEAMModelOS.Controllers
|
|
|
[HttpPost("get-teacher-info")]
|
|
|
public async Task<IActionResult> GetTeacherInfo(JsonElement request)
|
|
|
{
|
|
|
- //Debug
|
|
|
- //string json = System.Text.Json.JsonSerializer.Serialize(id_token);
|
|
|
try
|
|
|
{
|
|
|
if (!request.TryGetProperty("id_token", out JsonElement id_token)) return BadRequest();
|
|
@@ -65,7 +63,6 @@ namespace TEAMModelOS.Controllers
|
|
|
jwt.Payload.TryGetValue("name", out object name);
|
|
|
jwt.Payload.TryGetValue("picture", out object picture);
|
|
|
List<object> schools = new List<object>();
|
|
|
- // object schools = null;
|
|
|
string defaultschool = null;
|
|
|
//TODO 取得Teacher 個人相關數據(課程清單、虛擬教室清單、歷史紀錄清單等),學校數據另外API處理,多校切換時不同
|
|
|
var client = _azureCosmos.GetCosmosClient();
|
|
@@ -75,7 +72,9 @@ namespace TEAMModelOS.Controllers
|
|
|
int total = 0;
|
|
|
int tsize = 0;
|
|
|
try {
|
|
|
+ ///教师的个人空间
|
|
|
tsize = teacher.size;
|
|
|
+ ///教师的总空间 包含 个人空间和学校赠送的空间累加
|
|
|
total = teacher.size;
|
|
|
//检查是否有加入学校,如果加入学校,则当个人空间size是0G的时候,则免费获得一个G空间,但无论加入多少个学校,只能获取一次 1G的免费空间。没有加入学校则默认0G空间,除非自己购买空间
|
|
|
int joinCount = 0;
|
|
@@ -92,7 +91,6 @@ namespace TEAMModelOS.Controllers
|
|
|
schoolExtobj.time = sc.time;
|
|
|
schoolExtobj.picture = school.RootElement.GetProperty("picture");
|
|
|
joinCount += 1;
|
|
|
-
|
|
|
var sctch = await client.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(id, new PartitionKey($"Teacher-{sc.schoolId}"));
|
|
|
if (sctch.Status == 200)
|
|
|
{
|