|
@@ -53,8 +53,39 @@ namespace TEAMModelOS.Controllers
|
|
_azureRedis = azureRedis;
|
|
_azureRedis = azureRedis;
|
|
_azureStorage = azureStorage;
|
|
_azureStorage = azureStorage;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ ///<summary>
|
|
|
|
+ ///查询教师的阅卷任务列表
|
|
|
|
+ /// </summary>
|
|
|
|
+ /// <data>
|
|
|
|
+ /// ! "code":"tmdid"
|
|
|
|
+ /// </data>
|
|
|
|
+ /// <param name="request"></param>
|
|
|
|
+ /// <returns></returns>
|
|
|
|
+ [ProducesDefaultResponseType]
|
|
|
|
+ [HttpPost("find-task")]
|
|
|
|
+ public async Task<IActionResult> FindTask(JsonElement requert) {
|
|
|
|
+ List<CorrectTask> tasks = new List<CorrectTask>();
|
|
|
|
+ try
|
|
|
|
+ {
|
|
|
|
+ var client = _azureCosmos.GetCosmosClient();
|
|
|
|
+
|
|
|
|
+ //活动分区
|
|
|
|
+ if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
|
|
|
|
+ await foreach (var item in client.GetContainer("TEAMModelOS", "Teacher").GetItemQueryIterator<CorrectTask>(queryText: $"select value(c) from c ",
|
|
|
|
+ requestOptions: new QueryRequestOptions() { PartitionKey = new Azure.Cosmos.PartitionKey($"CorrectTask-{code}") }))
|
|
|
|
+ {
|
|
|
|
+ tasks.Add(item);
|
|
|
|
+ }
|
|
|
|
+ return Ok(new { tasks = tasks });
|
|
|
|
+ }
|
|
|
|
+ catch (Exception ex)
|
|
|
|
+ {
|
|
|
|
+ await _dingDing.SendBotMsg($"OS,{_option.Location},common/Correct/find-task()\n{ex.Message}{ex.StackTrace}", GroupNames.醍摩豆服務運維群組);
|
|
|
|
+ return Ok(new { tasks = tasks });
|
|
|
|
+ }
|
|
|
|
+ }
|
|
/*
|
|
/*
|
|
-
|
|
|
|
{
|
|
{
|
|
"id":"uuid",//新增为null或者空
|
|
"id":"uuid",//新增为null或者空
|
|
"code":"hbcn",
|
|
"code":"hbcn",
|