|
@@ -93,6 +93,30 @@ namespace TEAMModeBI.Controllers.BITest
|
|
|
return Ok(new { state = 200 });
|
|
|
}
|
|
|
|
|
|
+ [HttpPost("get-query")]
|
|
|
+ public async Task<IActionResult> QueryTest(JsonElement jsonElement)
|
|
|
+ {
|
|
|
+ if (!jsonElement.TryGetProperty("oldId", out JsonElement oldId)) return BadRequest();
|
|
|
+ var cosmosClient = _azureCosmos.GetCosmosClient();
|
|
|
+
|
|
|
+ StandardFile tempFile = new();
|
|
|
+ try
|
|
|
+ {
|
|
|
+ //tempFile = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").ReadItemAsync<StandardFile>($"{oldId}", new PartitionKey("StandardFile"));
|
|
|
+ await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIterator<StandardFile>(queryText: $"select value(c) from c where c.id='{oldId}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("StandardFile") }))
|
|
|
+ {
|
|
|
+ tempFile = item;
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ catch(Exception ex)
|
|
|
+ {
|
|
|
+ }
|
|
|
+
|
|
|
+ return Ok(new { state = 200, tempFile });
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
|
|
|
public async Task<IActionResult> DelSchool(JsonElement jsonElement)
|
|
|
{
|
|
@@ -256,7 +280,6 @@ namespace TEAMModeBI.Controllers.BITest
|
|
|
//string Str_char1 = GenerateRandom.Str_char(1, true);
|
|
|
|
|
|
CreateSchoolInfo data = await SchoolCode.GenerateSchoolCode(createSchoolInfo, _dingDing, _environment);
|
|
|
- string temp = null;
|
|
|
return Ok(new { state = 200, data, data.id });
|
|
|
}
|
|
|
|