Browse Source

开放平台接口

CrazyIter_Bin 2 years ago
parent
commit
2a126dc7e5

+ 1 - 2
TEAMModelOS.SDK/Models/Table/OpenApi.cs

@@ -25,8 +25,7 @@ namespace TEAMModelOS.SDK.Models
     public class OpenApi : TableEntity
     {
         public OpenApi() {
-
-            PartitionKey = "IES5-API";
+          
         } 
         /// <summary>
         /// 接口名称

+ 4 - 3
TEAMModelOS/Controllers/System/OpenApiController.cs

@@ -82,8 +82,8 @@ namespace TEAMModelOS.Controllers
       //  [AuthToken(Roles = "admin")]
         [HttpPost("get-api")]
         public async Task<IActionResult> GetApi(JsonElement json) {
-            var table = _azureStorage.GetCloudTableClient().GetTableReference("OpenApi");
-            List<OpenApi> apis = await table.FindListByDict<OpenApi>(new Dictionary<string, object>() { { "PartitionKey", "IES5-API" } });
+            var table = _azureStorage.GetCloudTableClient().GetTableReference("IESOpenApi");
+            List<OpenApi> apis = await table.FindListByDict<OpenApi>(new Dictionary<string, object>() { { "PartitionKey", "IES5-API-school" } });
             return Ok(new { apis });
         }
         /*
@@ -100,8 +100,9 @@ namespace TEAMModelOS.Controllers
         [HttpPost("get-webhook")]
         public async Task<IActionResult> GetWebhook(JsonElement json)
         {
-            var table = _azureStorage.GetCloudTableClient().GetTableReference("OpenApi");
+            var table = _azureStorage.GetCloudTableClient().GetTableReference("IESOpenApi");
             List<WebHook> webhooks = await table.FindListByDict<WebHook>(new Dictionary<string, object>() { { "PartitionKey", "IES5-WEBHOOK" } });
+            webhooks.RemoveAll(x => x.notice.Equals("school-auth-change"));
             return Ok(new { webhooks });
         }
         /*