|
@@ -111,7 +111,7 @@ namespace TEAMModelOS.Controllers
|
|
var id = jwt.Payload.Sub;
|
|
var id = jwt.Payload.Sub;
|
|
var client = _azureCosmos.GetCosmosClient();
|
|
var client = _azureCosmos.GetCosmosClient();
|
|
List<object> papers = new List<object>();
|
|
List<object> papers = new List<object>();
|
|
- var query = $"select c.id,c.subjectCode,c.code,c.periodCode,c.name,c.itemCount,c.level,c.pointItem,c.pointScore,c.score,c.gradeCode,c.createTime,c.sheet,c.sheetNo,c.tags ,c.mode ,c.itemSort,c.qamode,c.attachments ,c.creatorId,c.secret from c where c.id = {id}";
|
|
|
|
|
|
+ var query = $"select c.id,c.subjectCode,c.code,c.periodCode,c.name,c.itemCount,c.level,c.pointItem,c.pointScore,c.score,c.gradeCode,c.createTime,c.sheet,c.sheetNo,c.tags ,c.mode ,c.itemSort,c.qamode,c.attachments ,c.creatorId,c.secret,c.markModel from c where c.id = {id}";
|
|
await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryStreamIterator(queryText: query, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Paper-{school_code}") }))
|
|
await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryStreamIterator(queryText: query, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Paper-{school_code}") }))
|
|
{
|
|
{
|
|
using var json = await JsonDocument.ParseAsync(item.ContentStream);
|
|
using var json = await JsonDocument.ParseAsync(item.ContentStream);
|
|
@@ -190,7 +190,7 @@ namespace TEAMModelOS.Controllers
|
|
{
|
|
{
|
|
permissions= (List<string>)_permissions;
|
|
permissions= (List<string>)_permissions;
|
|
}
|
|
}
|
|
- sql.Append("select c.id,c.code,c.name,c.blob,c.periodId,c.gradeIds,c.subjectId,c.subjectName,c.score,c.useCount,c.scope,c.scoring,c.createTime,c.sheet ,c.mode ,c.sheetNo, c.tags,c.itemSort,c.qamode,c.isCodeOption,c.attachments,c.creatorId,c.secret from c");
|
|
|
|
|
|
+ sql.Append("select c.id,c.code,c.name,c.blob,c.periodId,c.gradeIds,c.subjectId,c.subjectName,c.score,c.useCount,c.scope,c.scoring,c.createTime,c.sheet ,c.mode ,c.sheetNo, c.tags,c.itemSort,c.qamode,c.isCodeOption,c.attachments,c.creatorId,c.secret ,c.markModel from c");
|
|
AzureCosmosQuery cosmosDbQuery = SQLHelper.GetSQL(dict, sql);
|
|
AzureCosmosQuery cosmosDbQuery = SQLHelper.GetSQL(dict, sql);
|
|
|
|
|
|
//if (rolse.Contains("admin"))
|
|
//if (rolse.Contains("admin"))
|
|
@@ -217,7 +217,7 @@ namespace TEAMModelOS.Controllers
|
|
}
|
|
}
|
|
if (scope.ToString().Equals("private"))
|
|
if (scope.ToString().Equals("private"))
|
|
{
|
|
{
|
|
- sql.Append("select c.id,c.code,c.name,c.blob,c.subjectName,c.score,c.useCount,c.scope,c.scoring ,c.createTime ,c.sheet,c.sheetNo ,c.mode , c.tags, c.itemSort,c.qamode,c.isCodeOption,c.attachments,c.creatorId,c.secret from c");
|
|
|
|
|
|
+ sql.Append("select c.id,c.code,c.name,c.blob,c.subjectName,c.score,c.useCount,c.scope,c.scoring ,c.createTime ,c.sheet,c.sheetNo ,c.mode , c.tags, c.itemSort,c.qamode,c.isCodeOption,c.attachments,c.creatorId,c.secret,c.markModel from c");
|
|
AzureCosmosQuery cosmosDbQuery = SQLHelper.GetSQL(dict, sql);
|
|
AzureCosmosQuery cosmosDbQuery = SQLHelper.GetSQL(dict, sql);
|
|
await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Teacher").GetItemQueryIterator<Paper>(queryDefinition: cosmosDbQuery.CosmosQueryDefinition, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Paper-{code}") }))
|
|
await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Teacher").GetItemQueryIterator<Paper>(queryDefinition: cosmosDbQuery.CosmosQueryDefinition, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Paper-{code}") }))
|
|
{
|
|
{
|