|
@@ -420,8 +420,8 @@ namespace TEAMModelOS.Controllers
|
|
|
/// <param name="request"></param>
|
|
|
/// <returns></returns>
|
|
|
[ProducesDefaultResponseType]
|
|
|
- /*[Authorize(Roles = "IES")]
|
|
|
- [AuthToken(Roles = "teacher,admin")]*/
|
|
|
+ [Authorize(Roles = "IES")]
|
|
|
+ [AuthToken(Roles = "teacher,admin")]
|
|
|
[HttpPost("find")]
|
|
|
public async Task<IActionResult> Find(JsonElement requert)
|
|
|
{
|
|
@@ -466,7 +466,7 @@ namespace TEAMModelOS.Controllers
|
|
|
stringBuilder.Append($" and c.source = '{source}' ");
|
|
|
}
|
|
|
stringBuilder.Append("order by c.createTime desc");
|
|
|
- string continuationToken = String.Empty;
|
|
|
+ string token = null;
|
|
|
//string token = default;
|
|
|
//默认不指定返回大小
|
|
|
int? topcout = null;
|
|
@@ -489,12 +489,12 @@ namespace TEAMModelOS.Controllers
|
|
|
//指定了cancellationToken continuationSchool
|
|
|
if (!token_1.ValueKind.Equals(JsonValueKind.Null) && token_1.ValueKind.Equals(JsonValueKind.String))
|
|
|
{
|
|
|
- continuationToken = token_1.GetString();
|
|
|
+ token = token_1.GetString();
|
|
|
|
|
|
}
|
|
|
}
|
|
|
List<ExamInfo> examInfo = new List<ExamInfo>();
|
|
|
- await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Common").GetItemQueryStreamIterator(queryText: stringBuilder.ToString(), continuationToken: continuationToken, requestOptions: new QueryRequestOptions() { MaxItemCount = topcout, PartitionKey = new PartitionKey($"Exam-{code}") }))
|
|
|
+ await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Common").GetItemQueryStreamIterator(queryText: stringBuilder.ToString(), continuationToken: token, requestOptions: new QueryRequestOptions() { MaxItemCount = topcout, PartitionKey = new PartitionKey($"Exam-{code}") }))
|
|
|
{
|
|
|
|
|
|
using var json = await JsonDocument.ParseAsync(item.ContentStream);
|
|
@@ -508,12 +508,12 @@ namespace TEAMModelOS.Controllers
|
|
|
}
|
|
|
if (iscontinuation)
|
|
|
{
|
|
|
- continuationToken = item.GetContinuationToken();
|
|
|
+ token = item.GetContinuationToken();
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
}
|
|
|
- return Ok(new { examInfo, token = continuationToken });
|
|
|
+ return Ok(new { examInfo, token = token });
|
|
|
}
|
|
|
catch (Exception e)
|
|
|
{
|