CrazyIter_Bin пре 3 година
родитељ
комит
23081e19be

+ 3 - 3
TEAMModelBI/Controllers/OpenApi/ExamController.cs

@@ -80,7 +80,7 @@ namespace TEAMModelAPI.Controllers
         }
         [ProducesDefaultResponseType]
         [HttpPost("import-exam")]
-        [ApiToken(Auth = "1102", Name = "汇入评测基础数据", Limit = false)]
+        [ApiToken(Auth = "1102", Name = "汇入评测基础数据",RWN ="W", Limit = false)]
         public async Task<IActionResult> importExam(JsonElement request)
         {
             //获取评测的ID
@@ -102,7 +102,7 @@ namespace TEAMModelAPI.Controllers
         }
         [ProducesDefaultResponseType]
         [HttpPost("upsert-record")]
-        [ApiToken(Auth = "1103", Name = "批量汇入作答数据", Limit = false)]
+        [ApiToken(Auth = "1103", Name = "批量汇入作答数据", RWN = "W", Limit = false)]
         public async Task<IActionResult> upsertRecord(JsonElement request)
         {
 
@@ -366,7 +366,7 @@ namespace TEAMModelAPI.Controllers
         }
         [ProducesDefaultResponseType]
         [HttpPost("parse-word")]
-        [ApiToken(Auth = "1104", Name = "录入试卷数据", Limit = false)]
+        [ApiToken(Auth = "1104", Name = "录入试卷数据", RWN = "W", Limit = false)]
         public async Task<IActionResult> ParseWord([FromForm] FileDto fileDto)
         {
             if (!FileType.GetExtention(fileDto.file.FileName).ToLower().Equals("docx"))

+ 9 - 12
TEAMModelBI/Startup.cs

@@ -27,7 +27,7 @@ using TEAMModelOS.SDK.Filter;
 using TEAMModelOS.SDK.Helper.Common.ReflectorExtensions;
 using TEAMModelOS.SDK.Models;
 using TEAMModelOS.SDK.Models.Service;
-using VueCliMiddleware;
+using VueCliMiddleware; 
 
 namespace TEAMModelBI
 {
@@ -223,8 +223,7 @@ namespace TEAMModelBI
 
 #if DEBUG
             //在开发模式时,自检 [ApiToken(Auth = "1")] 有重复的接口 https://teammodelos.table.core.chinacloudapi.cn/IESOpenApi
-            List<ApiTokenAttribute> auths = new List<ApiTokenAttribute>();
-            (List<OpenApi> openApis, List<ApiTokenAttribute> attributes) = ReflectorExtensions.GetMethodCustomAttribute<ApiTokenAttribute, HttpPostAttribute>(new string[] { "TEAMModelBI" });
+            (List<OpenApi> openApis, List<ApiTokenAttribute> attributes) = ReflectorExtensions.GetOpenApi(new string[] { "TEAMModelBI" });
             attributes.GroupBy(x => x.Auth).ToList().ForEach(x => {
                 if (x.Count() > 1)
                 {
@@ -233,17 +232,15 @@ namespace TEAMModelBI
             });
 
             var table = azureStorage.GetCloudTableClient().GetTableReference("IESOpenApi");
-            try
-            {
-                foreach (var item in openApis)
+            _ = table.SaveOrUpdateAll<OpenApi>(openApis);
+            (List<WebHook> webHooks, List<ApiTokenAttribute> _attributes) = ReflectorExtensions.GetWebHook(new string[] { "TEAMModelOS.SDK" });
+            _attributes.GroupBy(x => x.Auth).ToList().ForEach(x => {
+                if (x.Count() > 1)
                 {
-                    _ = table.SaveOrUpdate<OpenApi>(item);
+                    throw new Exception($"接口Auth重复定义{x.ToList()}");
                 }
-            }
-            catch (Exception ex)
-            {
-                Console.WriteLine(ex.Message);
-            }
+            });
+            _ = table.SaveOrUpdateAll<WebHook>(webHooks);
 #endif
         }
     }

+ 0 - 87
TEAMModelOS.FunctionV4/HttpTrigger/WebhookHttpTrigger.cs

@@ -1,87 +0,0 @@
-using Azure.Cosmos;
-using Azure.Storage.Blobs.Models;
-using HTEXLib.COMM.Helpers;
-using Microsoft.Azure.Cosmos.Table;
-using Microsoft.Azure.Functions.Worker;
-using Microsoft.Azure.Functions.Worker.Http;
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Net;
-using System.Reflection;
-using System.Text;
-using System.Text.Json;
-using System.Threading.Tasks;
-using TEAMModelOS.Filter;
-using TEAMModelOS.SDK;
-using TEAMModelOS.SDK.DI;
-using TEAMModelOS.SDK.Extension;
-using TEAMModelOS.SDK.Models;
-using TEAMModelOS.SDK.Models.Cosmos.Teacher;
-using TEAMModelOS.SDK.Models.Table;
-using static TEAMModelOS.SDK.Models.Teacher;
-
-namespace TEAMModelOS.FunctionV4.HttpTrigger
-{
-    public class WebhookHttpTrigger
-    {
-        private readonly AzureCosmosFactory _azureCosmos;
-        private readonly DingDing _dingDing;
-        private readonly AzureStorageFactory _azureStorage;
-        private readonly AzureRedisFactory _azureRedis;
-        public WebhookHttpTrigger(AzureCosmosFactory azureCosmos, DingDing dingDing, AzureStorageFactory azureStorage  , AzureRedisFactory azureRedis)
-        {
-            _azureCosmos = azureCosmos;
-            _dingDing = dingDing;
-            _azureStorage = azureStorage;
-            _azureRedis = azureRedis;
-        }
-        [Function("group-change")]
-        [ApiToken(Auth = "1302", Name = "课程详细信息", RWN = "N")]
-        public async Task<HttpResponseData> NoticeGroupChange([HttpTrigger(AuthorizationLevel.Anonymous, "post", Route = "webhook/group-change")] HttpRequestData request) {
-            var response = request.CreateResponse(HttpStatusCode.OK);
-            (string school, List < BusinessConfig > businessConfigs ,GroupChange data) = await  GetRequestData<GroupChange>(request);
-            if (string.IsNullOrWhiteSpace(school)) {
-               
-            }
-            return response;
-        }
-        public async Task<(string school, List<BusinessConfig> businessConfigs, T data)> GetRequestData<T>(HttpRequestData request)
-        {
-            var response = request.CreateResponse(HttpStatusCode.OK);
-            string data = await new StreamReader(request.Body).ReadToEndAsync();
-            var json = JsonDocument.Parse(data).RootElement;
-            string school = null;
-            List<BusinessConfig> businessConfigs = null ;
-            if (json.TryGetProperty("school", out JsonElement _school))
-            {
-                school = _school.GetString();
-                var table = _azureStorage.GetCloudTableClient().GetTableReference("IESOpenApi");
-                List<BusinessSchool> schools = table.FindListByDictSync<BusinessSchool>(new Dictionary<string, object> { { "PartitionKey", $"BusinessSchool" }, { "school", school } });
-                var bizid = schools.Select(x => x.bizid).ToList();
-                List<string> Codes = new List<string>();
-                bizid.ForEach(x => {
-                    Codes.Add($" RowKey {QueryComparisons.Equal} '{x}' ");
-                });
-                string tbqurey = $"PartitionKey {QueryComparisons.Equal} 'BusinessConfig'  and ( {string.Join(" or ", Codes)} )  ";
-                var result = await table.ExecuteQuerySegmentedAsync(new TableQuery<BusinessConfig>().Where(tbqurey), null);
-                if (result != null) {
-                    businessConfigs= result.Results;
-                }
-            }
-            if (json.TryGetProperty("data", out JsonElement _data))
-            {
-                return (school, businessConfigs, _data.ToObject<T>());
-            }
-            else { return (school, businessConfigs, default(T)); }
-        }
-    }
-   
-
-    public class WebhookSchoolData { 
-        public string school { get; set; }
-        public string data { get; set; }
-    }
-
-}

+ 1 - 0
TEAMModelOS.FunctionV4/Program.cs

@@ -23,6 +23,7 @@ namespace TEAMModelOS.FunctionV4
         {
 #if DEBUG
 
+            
             Debugger.Launch();
 #endif
 

+ 8 - 2
TEAMModelOS.SDK/DI/HttpTrigger/HttpTrigger.cs

@@ -66,8 +66,14 @@ namespace TEAMModelOS.SDK.DI
             if (responseMessage.StatusCode == HttpStatusCode.OK)
             {
                 string Content = await responseMessage.Content.ReadAsStringAsync();
-                Content.ToObject<JsonElement>().TryGetProperty("data", out JsonElement content);
-                return (200, $"{content}");
+                if (string.IsNullOrWhiteSpace(Content))
+                {
+                    return (200, null) ;
+                }
+                else {
+                    Content.ToObject<JsonElement>().TryGetProperty("data", out JsonElement content);
+                    return (200, $"{content}");
+                }
             }
             else
             {

+ 208 - 0
TEAMModelOS.SDK/DI/HttpTrigger/WebHookHttpTrigger.cs

@@ -0,0 +1,208 @@
+using Azure.Cosmos;
+using Azure.Storage.Blobs.Models;
+using HTEXLib.COMM.Helpers;
+using Microsoft.Azure.Cosmos.Table;
+using Microsoft.Azure.Functions.Worker;
+using Microsoft.Azure.Functions.Worker.Http;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Net;
+using System.Net.Http;
+using System.Net.Http.Json;
+using System.Reflection;
+using System.Text;
+using System.Text.Json;
+using System.Threading.Tasks;
+using TEAMModelOS.Filter;
+using TEAMModelOS.SDK;
+using TEAMModelOS.SDK.DI;
+using TEAMModelOS.SDK.Extension;
+using TEAMModelOS.SDK.Models;
+using TEAMModelOS.SDK.Models.Cosmos.Teacher;
+using TEAMModelOS.SDK.Models.Table;
+using static TEAMModelOS.SDK.Models.Teacher;
+
+namespace TEAMModelOS.SDK.DI
+{
+    public class WebHookHttpTrigger
+    {
+        private readonly AzureCosmosFactory _azureCosmos;
+        private readonly DingDing _dingDing;
+        private readonly AzureStorageFactory _azureStorage;
+        private readonly AzureRedisFactory _azureRedis;
+        private readonly HttpClient _httpClient;
+        public WebHookHttpTrigger(HttpClient httpClient,AzureCosmosFactory azureCosmos, DingDing dingDing, AzureStorageFactory azureStorage  , AzureRedisFactory azureRedis)
+        {
+            _azureCosmos = azureCosmos;
+            _dingDing = dingDing;
+            _azureStorage = azureStorage;
+            _azureRedis = azureRedis;
+            _httpClient = httpClient;
+        }
+        /// <summary>
+        /// 学校数据授权变更,学校基础信息 10开头
+        /// </summary>
+        /// <param name="request"></param>
+        /// <returns></returns>
+        [Function("school-auth-change")]
+        [ApiToken(Auth = "1001", Name = "学校数据授权变更", RWN = "N")]
+        public async Task<HttpResponseData> NoticeSchoolAuthChange([HttpTrigger(AuthorizationLevel.Anonymous, "post", Route = "webhook/school-auth-change")] HttpRequestData request)
+        {
+            var response = request.CreateResponse(HttpStatusCode.OK);
+            (  List<BusinessConfig> businessConfigs, List<string> webhookdomain, SchoolAuthChange data) = await GetRequestData<SchoolAuthChange>(request);
+            if (webhookdomain.IsNotEmpty())
+            {
+                foreach (var domain in webhookdomain)
+                {
+                    await send(new
+                    {
+                        data.addSchools,
+                        data.rmvSchools
+                    }, domain, "school-auth-change");
+                }
+            }
+            return response;
+        }
+
+        public class SchoolAuthChange
+        {
+            public string bizcode { get; set; }
+            /// <summary>
+            /// 添加的学校数据授权
+            /// </summary>
+            public List<IdSchool> addSchools { get; set; } = new List<IdSchool>();
+            /// <summary>
+            ///  取消的学校数据授权
+            /// </summary>
+            public List<IdSchool> rmvSchools { get; set; } = new List<IdSchool>();
+        }
+
+        /// <summary>
+        /// 名单变更通知,名单类12开头
+        /// </summary>
+        /// <param name="request"></param>
+        /// <returns></returns>
+        [Function("group-member-change")]
+        [ApiToken(Auth = "1201", Name = "名单成员变更", RWN = "N")]
+        public async Task<HttpResponseData> NoticeGroupChange([HttpTrigger(AuthorizationLevel.Anonymous, "post", Route = "webhook/group-member-change")] HttpRequestData request) {
+            var response = request.CreateResponse(HttpStatusCode.OK);
+            (  List < BusinessConfig > businessConfigs, List<string> webhookdomain, GroupChange data) = await  GetRequestData<GroupChange>(request);
+
+            if (    webhookdomain.IsNotEmpty()&& string.IsNullOrWhiteSpace(data.school)) {
+                foreach (var domain in webhookdomain) {
+                    await send(new
+                    {
+                        data.status,
+                        data.type,
+                        data.listid,
+                        data.tmdjoin,
+                        data.tmdleave,
+                        data.stujoin,
+                        data.stuleave,
+                        data.tchjoin,
+                        data.tchleave,
+                        data.school
+                    }, domain,"group-member-change");
+                }
+            }
+            return response;
+        }
+        /// <summary>
+        /// 测试域名的webhook是否接入
+        /// </summary>
+        /// <param name="request"></param>
+        /// <returns></returns>
+        [Function("check-domain-webhook")]
+        
+        public async Task<HttpResponseData> CheckDomainWebhook([HttpTrigger(AuthorizationLevel.Anonymous, "post", Route = "webhook/check-domain-webhook")] HttpRequestData request) {
+            string data = await new StreamReader(request.Body).ReadToEndAsync();
+            var json = JsonDocument.Parse(data).RootElement;
+            if (json.TryGetProperty("domain", out JsonElement domain) && json.TryGetProperty("https", out JsonElement _https))
+            {
+                string https = _https.ValueKind.Equals(JsonValueKind.Number) && int.Parse($"{_https}") == 1 ? "https" : "http";
+                string url = $"{https}://{domain}";
+                HttpStatusCode httpStatus = await  send(new { }, url, "check-domain-webhook");
+                var response = request.CreateResponse(httpStatus);
+                return response;
+            }
+            else {
+                var response = request.CreateResponse(HttpStatusCode.BadRequest);
+                return response;
+            }
+        }
+        /// <summary>
+        /// 消息发送方法
+        /// </summary>
+        /// <param name="data"></param>
+        /// <param name="domain"></param>
+        /// <param name="notice"></param>
+        public    async Task<HttpStatusCode> send (dynamic data,string domain, string notice) {
+            var timestamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
+            HttpResponseMessage httpResponse =await  _httpClient.PostAsJsonAsync($"{domain}/webhook", new
+            {
+                time = timestamp,
+                notice =notice,
+                data = data
+            });
+            return httpResponse.StatusCode;
+        }
+        /// <summary>
+        /// 解析HttpRequestData  传递的数据
+        /// </summary>
+        /// <typeparam name="T"></typeparam>
+        /// <param name="request"></param>
+        /// <returns></returns>
+        public async Task<( List<BusinessConfig> businessConfigs,List<string> webhookdomain, T data)> GetRequestData<T>(HttpRequestData request)
+        {
+            //var response = request.CreateResponse(HttpStatusCode.OK);
+            string data = await new StreamReader(request.Body).ReadToEndAsync();
+            var json = JsonDocument.Parse(data).RootElement;
+            string school = null;
+            List<BusinessConfig> businessConfigs = null ;
+            var table = _azureStorage.GetCloudTableClient().GetTableReference("IESOpenApi");
+            if (json.TryGetProperty("school", out JsonElement _school))
+            {
+                school = _school.GetString();
+               
+                List<BusinessSchool> schools = table.FindListByDictSync<BusinessSchool>(new Dictionary<string, object> { { "PartitionKey", $"BusinessSchool" }, { "school", school } });
+                var bizid = schools.Select(x => x.bizid).ToList();
+                List<string> Codes = new List<string>();
+                bizid.ForEach(x => {
+                    Codes.Add($" RowKey {QueryComparisons.Equal} '{x}' ");
+                });
+                string tbqurey = $"PartitionKey {QueryComparisons.Equal} 'BusinessConfig'  and ( {string.Join(" or ", Codes)} )  ";
+                var result = await table.ExecuteQuerySegmentedAsync(new TableQuery<BusinessConfig>().Where(tbqurey), null);
+                if (result != null) {
+                    businessConfigs= result.Results;
+                }
+            }
+            if (json.TryGetProperty("bizid", out JsonElement _bizid)) {
+                string tbqurey = $"PartitionKey {QueryComparisons.Equal} 'BusinessConfig'  and  RowKey {QueryComparisons.Equal} '{_bizid}' ";
+                var result = await table.ExecuteQuerySegmentedAsync(new TableQuery<BusinessConfig>().Where(tbqurey), null);
+                if (result != null)
+                {
+                    businessConfigs = result.Results;
+                }
+            }
+            if (json.TryGetProperty("data", out JsonElement _data)  && businessConfigs.IsNotEmpty())
+            {
+                var webhookdomain =  businessConfigs.Where(z => !string.IsNullOrWhiteSpace(z.webhookdomain)).ToList();
+                List<string> webhookdomains = new List<string>();
+                webhookdomain.ForEach(x => {
+                    webhookdomains.AddRange(x.webhookdomain.Split(",").Select(y =>x.https==1? $"https://{y}":$"http://{y}"));
+                });
+                return ( businessConfigs, webhookdomains, _data.ToObject<T>());
+            }
+            else { return (   businessConfigs,null , default(T)); }
+        }
+    }
+   
+
+    public class WebhookSchoolData { 
+        public string school { get; set; }
+        public string data { get; set; }
+    }
+
+}

+ 47 - 8
TEAMModelOS.SDK/Helper/Common/ReflectorExtensions/ReflectorExtensions.cs

@@ -1,6 +1,7 @@
 using AspectCore.Extensions.Reflection;
 using Microsoft.AspNetCore.Hosting;
 using Microsoft.AspNetCore.Mvc;
+using Microsoft.Azure.Functions.Worker;
 using System;
 using System.Collections.Generic;
 using System.IO;
@@ -62,17 +63,59 @@ namespace TEAMModelOS.SDK.Helper.Common.ReflectorExtensions
             }
             return attributes;
         }
-
         /// <summary>
         /// 获取T类型的属性标记的类的方法集合
         /// </summary>
         /// <typeparam name="T"></typeparam>
         /// <returns></returns>
-        public static (List<OpenApi>,List<ApiTokenAttribute>) GetMethodCustomAttribute<T,V>(string[] ScanModel)
+        public static (List<WebHook>, List<ApiTokenAttribute>) GetWebHook(string[] ScanModel)
+        {
+            List<WebHook> webHooks = new List<WebHook>();
+            Type attrT = typeof(ApiTokenAttribute);
+            Type attrV = typeof(FunctionAttribute);
+            string currentDirectory = Path.GetDirectoryName(attrT.Assembly.Location);
+            List<ApiTokenAttribute> attributes = new List<ApiTokenAttribute>();
+            if (ScanModel != null)
+            {
+                foreach (var model in ScanModel)
+                {
+                    Assembly assembly = Assembly.LoadFrom(currentDirectory + "\\" + model + ".dll");
+                    var TypeInModelTV = assembly.GetTypes().SelectMany(x => x.GetMethods()).Where(m => m.GetCustomAttributes().Where(t => t.GetType().Equals(attrT)).Any() && m.GetCustomAttributes().Where(t => t.GetType().Equals(attrV)).Any());
+                    foreach (var item in TypeInModelTV)
+                    {
+                       
+                        var funcAttr = item.GetCustomAttribute(attrV, true);
+                        var apiAttr = item.GetCustomAttribute(attrT, true);
+                        ApiTokenAttribute apiTokenAttribute = (ApiTokenAttribute)apiAttr;
+                        FunctionAttribute functionAttribute = (FunctionAttribute)funcAttr;
+                        WebHook webHook = new WebHook
+                        {
+                            PartitionKey = "IES5-WEBHOOK",
+                            RowKey = apiTokenAttribute.Auth,
+                            auth = int.Parse(apiTokenAttribute.Auth),
+                            method = "POST",
+                            name = apiTokenAttribute.Name,
+                            type = apiTokenAttribute.RWN,
+                            notice = functionAttribute.Name,
+                            url= "/webhook"
+                        };
+                        webHooks.Add(webHook);
+                        attributes.Add(apiTokenAttribute);
+                    }
+                }
+            }
+            return (webHooks, attributes);
+        }
+        /// <summary>
+        /// 获取T类型的属性标记的类的方法集合
+        /// </summary>
+        /// <typeparam name="T"></typeparam>
+        /// <returns></returns>
+        public static (List<OpenApi>,List<ApiTokenAttribute>) GetOpenApi(string[] ScanModel)
         {
             List<OpenApi> openApis = new List<OpenApi>();
-            Type attrT = typeof(T);
-            Type attrV = typeof(V);
+            Type attrT = typeof(ApiTokenAttribute);
+            Type attrV = typeof(HttpPostAttribute);
             string currentDirectory = Path.GetDirectoryName(attrT.Assembly.Location);
             List<ApiTokenAttribute> attributes = new List<ApiTokenAttribute>();
             if (ScanModel != null)
@@ -80,11 +123,7 @@ namespace TEAMModelOS.SDK.Helper.Common.ReflectorExtensions
                 foreach (var model in ScanModel)
                 {
                     Assembly assembly = Assembly.LoadFrom(currentDirectory + "\\" + model + ".dll");
-                    var TypeInModelS = assembly.GetTypes().SelectMany(x => x.GetMethods()).GroupBy(z => z.Name).ToList();
-                    //  var TypeInModelSS = assembly.GetTypes().SelectMany(x => x.GetMethods()).Where(x=>);
-
                     var TypeInModelTV = assembly.GetTypes().SelectMany(x => x.GetMethods()).Where(m=>m.GetCustomAttributes().Where(t=>t.GetType().Equals(attrT)).Any() && m.GetCustomAttributes().Where(t => t.GetType().Equals(attrV)).Any());
-                    Type attrR = typeof(RouteAttribute);
                     foreach (var item in TypeInModelTV) {
                         var routeAttr = item.ReflectedType.GetCustomAttribute<RouteAttribute>();
                         var postAttr = item.GetCustomAttribute(attrV,true);

+ 1 - 0
TEAMModelOS.SDK/Models/Cosmos/Common/Inner/CodeValue.cs

@@ -14,6 +14,7 @@ namespace TEAMModelOS.SDK.Models
         public string id { get; set; }
         public string school { get; set; }
         public string picture { get; set; }
+        public string name { get; set; }
     }
     public class IdCode
     {

+ 4 - 0
TEAMModelOS.SDK/Models/Table/BusinessConfig.cs

@@ -58,6 +58,10 @@ namespace TEAMModelOS.SDK.Models.Table
 
         public string webhookdomain { get; set; }
         /// <summary>
+        /// 是否https 0 否,1 是 
+        /// </summary>
+        public int https { get; set; } = 0;
+        /// <summary>
         /// 授权的token ,存放 scope="business",Sub="合作方id",  9e40e436-f958-498d-93cf-4242b77a17ab
         /// </summary>
         public string token { get; set; }

+ 14 - 5
TEAMModelOS.SDK/Models/Table/OpenApi.cs

@@ -46,7 +46,11 @@ namespace TEAMModelOS.SDK.Models
         public string descr { get; set; }
         public int auth { get; set; }
         /// <summary>
-        /// r,w,d,l
+        /// R读取
+        /// W写入
+        /// D删除
+        /// L列表
+        /// N通知
         /// </summary>
         public string type { get; set; }
         /// <summary>
@@ -73,11 +77,11 @@ namespace TEAMModelOS.SDK.Models
         ///public decimal cost { get; set; }
     }
     [TableName(Name = "IESOpenApi")]
-    public class Webhook : TableEntity
+    public class WebHook : TableEntity
     {
-        public Webhook()
+        public WebHook()
         {
-
+            //RowKey= auth
             PartitionKey = "IES5-WEBHOOK";
         }
         /// <summary>
@@ -98,9 +102,14 @@ namespace TEAMModelOS.SDK.Models
         public string descr { get; set; }
         public int auth { get; set; }
         /// <summary>
-        /// r,w,d,l
+        /// R读取
+        /// W写入
+        /// D删除
+        /// L列表
+        /// N通知
         /// </summary>
         public string type { get; set; }
+        public string notice { get; set; }
     }
    
     public class DefaultApp : CosmosEntity

+ 3 - 1
TEAMModelOS.SDK/TEAMModelOS.SDK.csproj

@@ -41,6 +41,8 @@
     <PackageReference Include="NPinyin.Core" Version="3.0.0" />
     <PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="6.0.0" />
     <PackageReference Include="VueCliMiddleware" Version="6.0.0" />
-
+	<PackageReference Include="Microsoft.Azure.Functions.Worker" Version="1.6.0" />
+	<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Abstractions" Version="1.1.0" />
+	<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http" Version="3.0.13" />
   </ItemGroup>
 </Project>

+ 1 - 1
TEAMModelOS/Controllers/System/OpenApiController.cs

@@ -101,7 +101,7 @@ namespace TEAMModelOS.Controllers
         public async Task<IActionResult> GetWebhook(JsonElement json)
         {
             var table = _azureStorage.GetCloudTableClient().GetTableReference("OpenApi");
-            List<Webhook> webhooks = await table.FindListByDict<Webhook>(new Dictionary<string, object>() { { "PartitionKey", "IES5-WEBHOOK" } });
+            List<WebHook> webhooks = await table.FindListByDict<WebHook>(new Dictionary<string, object>() { { "PartitionKey", "IES5-WEBHOOK" } });
             return Ok(new { webhooks });
         }
         /*