|
@@ -130,6 +130,7 @@ namespace TEAMModelOS.Controllers
|
|
|
}
|
|
|
catch(Exception ex)
|
|
|
{
|
|
|
+ await _dingDing.SendBotMsg($"IES5,{_option.Location},Teacher/init/set-teacher-info()\n{ex.Message}{ex.StackTrace}{request.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
|
|
|
return BadRequest("teacher not exist");
|
|
|
|
|
|
}
|
|
@@ -189,7 +190,7 @@ namespace TEAMModelOS.Controllers
|
|
|
{
|
|
|
area = await client.GetContainer(Constant.TEAMModelOS, "School").ReadItemAsync<Area>($"{areaId}", new PartitionKey("Base-Area"));
|
|
|
}
|
|
|
- catch (CosmosException ex)
|
|
|
+ catch (CosmosException )
|
|
|
{
|
|
|
area = null;
|
|
|
}
|
|
@@ -302,12 +303,12 @@ namespace TEAMModelOS.Controllers
|
|
|
//TODO 此API需處理對應前端返回的相關數據
|
|
|
[ProducesDefaultResponseType]
|
|
|
[HttpPost("get-school-info")]
|
|
|
- public async Task<IActionResult> GetSchoolInfo(JsonElement requert)
|
|
|
+ public async Task<IActionResult> GetSchoolInfo(JsonElement request)
|
|
|
{
|
|
|
try
|
|
|
{
|
|
|
- if (!requert.TryGetProperty("id_token", out JsonElement id_token)) return BadRequest();
|
|
|
- if (!requert.TryGetProperty("school_code", out JsonElement _school_code)) return BadRequest();
|
|
|
+ if (!request.TryGetProperty("id_token", out JsonElement id_token)) return BadRequest();
|
|
|
+ if (!request.TryGetProperty("school_code", out JsonElement _school_code)) return BadRequest();
|
|
|
string school_code = $"{_school_code}";
|
|
|
var jwt = new JwtSecurityToken(id_token.GetString());
|
|
|
if (!jwt.Payload.Iss.Equals("account.teammodel", StringComparison.Ordinal)) return BadRequest();
|
|
@@ -368,7 +369,7 @@ namespace TEAMModelOS.Controllers
|
|
|
{
|
|
|
await client.GetContainer(Constant.TEAMModelOS, "School").ReadItemAsync<ItemCond>($"{period.id}", new PartitionKey($"ItemCond-{school_code}"));
|
|
|
}
|
|
|
- catch (CosmosException ex) {
|
|
|
+ catch (CosmosException ) {
|
|
|
ItemCond itemCond = new ItemCond {
|
|
|
id = period.id,
|
|
|
pk = "ItemCond",
|
|
@@ -480,12 +481,12 @@ namespace TEAMModelOS.Controllers
|
|
|
return Ok(new { auth_token, blob_uri, blob_sas, school_base, school_courses, school_syllabus, school_classes, school_rooms, size, osblob_uri, osblob_sas, status = 200 });
|
|
|
}
|
|
|
catch (CosmosException ex) {
|
|
|
- await _dingDing.SendBotMsg($"IES5,{_option.Location},Teacher/init/get-school-info()\n{ex.Message}{ex.StackTrace}{requert.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
|
|
|
+ await _dingDing.SendBotMsg($"IES5,{_option.Location},Teacher/init/get-school-info()\n{ex.Message}{ex.StackTrace}{request.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
|
|
|
return Ok(new { status = ex.Status });
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- await _dingDing.SendBotMsg($"IES5,{_option.Location},Teacher/init/get-school-info()\n{ex.Message}{ex.StackTrace}{requert.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
|
|
|
+ await _dingDing.SendBotMsg($"IES5,{_option.Location},Teacher/init/get-school-info()\n{ex.Message}{ex.StackTrace}{request.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
|
|
|
return Ok(new { status = 500 });
|
|
|
}
|
|
|
}
|
|
@@ -601,6 +602,7 @@ namespace TEAMModelOS.Controllers
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
+ await _dingDing.SendBotMsg($"IES5,{_option.Location},Teacher/init/get-school-info()\n{ex.Message}{ex.StackTrace}{request.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
|
|
|
return BadRequest();
|
|
|
}
|
|
|
}
|