瀏覽代碼

删除冗余代码

Li 3 年之前
父節點
當前提交
25436e73c7

+ 24 - 1
TEAMModeBI/Controllers/BITest/TestController.cs

@@ -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 });
         }
 

+ 0 - 1
TEAMModeBI/Controllers/DingDingStruc/DDStructController.cs

@@ -39,7 +39,6 @@ namespace TEAMModeBI.Controllers.DingDingStruc
         //雪花ID
         private readonly SnowflakeId _snowflakeId;  
         private readonly Option _option;
-        string type = "ddteammodel";
 
         public DDStructController(IConfiguration configuration, AzureCosmosFactory azureCosmos, AzureStorageFactory azureStorage, DingDing dingDing, IOptionsSnapshot<Option> option, CoreAPIHttpService aoreAPIHttpService, SnowflakeId snowflakeId)
         {