|
@@ -530,9 +530,9 @@ namespace TEAMModelOS.Controllers.Core
|
|
|
request.TryGetProperty("name", out JsonElement name);
|
|
|
request.TryGetProperty("type", out JsonElement type);
|
|
|
request.TryGetProperty("scope", out JsonElement scope);
|
|
|
- request.TryGetProperty("period", out JsonElement period);
|
|
|
+ request.TryGetProperty("periodId", out JsonElement periodId);
|
|
|
var client = _azureCosmos.GetCosmosClient();
|
|
|
- var queryslt = $"SELECT value(c) FROM c WHERE c.type='{type}' and c.period='{period}'";
|
|
|
+ var queryslt = $"SELECT value(c) FROM c WHERE c.type='{type}' and c.periodId='{periodId}'";
|
|
|
if (scope.GetString().Equals("school"))
|
|
|
{
|
|
|
await foreach (var item in client.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<Bloblog>(queryText: queryslt, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Bloblog-{name}") }))
|
|
@@ -577,8 +577,8 @@ namespace TEAMModelOS.Controllers.Core
|
|
|
/// </summary>
|
|
|
/// <param name="request"></param>
|
|
|
/// <returns></returns>
|
|
|
- [HttpPost("bloblog-upsert")]
|
|
|
- public async Task<ActionResult> BloblogUpsert(JsonElement request) {
|
|
|
+ [HttpPost("bloblog-opt")]
|
|
|
+ public async Task<ActionResult> BloblogOpt(JsonElement request) {
|
|
|
|
|
|
try
|
|
|
{
|
|
@@ -636,9 +636,9 @@ namespace TEAMModelOS.Controllers.Core
|
|
|
url = url,
|
|
|
time = now,
|
|
|
size = size != null && size.HasValue ? size.Value : 0,
|
|
|
- periodId = periodId.ValueKind.Equals(JsonValueKind.String)?$"{periodId}":null,
|
|
|
- subjectId= gradeId.ValueKind.Equals(JsonValueKind.String) ? $"{subjectId}" : null,
|
|
|
- gradeId = gradeId.ValueKind.Equals(JsonValueKind.String) ? $"{gradeId}" : null,
|
|
|
+ periodId = periodId.ValueKind.Equals(JsonValueKind.String)?$"{periodId}":"",
|
|
|
+ subjectId= gradeId.ValueKind.Equals(JsonValueKind.Array) ? subjectId.ToObject<List<string>>() : new List<string> { ""},
|
|
|
+ gradeId = gradeId.ValueKind.Equals(JsonValueKind.Array) ? gradeId.ToObject<List<string>>() : new List<string> { "" },
|
|
|
type = u
|
|
|
};
|
|
|
if (scope.GetString().Equals("school"))
|