|
@@ -120,20 +120,6 @@ namespace TEAMModelAPI
|
|
|
//在开发模式时,自检 [ApiToken(Auth = "1")] 有重复的接口 https://teammodelos.table.core.chinacloudapi.cn/IESOpenApi
|
|
|
List<ApiTokenAttribute> auths = new List<ApiTokenAttribute>();
|
|
|
(List < OpenApi > openApis ,List<Attribute> attributes ) = ReflectorExtensions.GetMethodCustomAttribute<ApiTokenAttribute, HttpPostAttribute>(new string[] { "TEAMModelAPI" });
|
|
|
- attributes.ForEach(x => {
|
|
|
- ApiTokenAttribute attribute = (ApiTokenAttribute)x;
|
|
|
- openApis.Add(new OpenApi {
|
|
|
- PartitionKey="IES5-API",
|
|
|
- RowKey= attribute.Auth,
|
|
|
- auth=int.Parse(attribute.Auth),
|
|
|
- // descr=attribute.Name,
|
|
|
- method="POST",
|
|
|
- name=attribute.Name,
|
|
|
-
|
|
|
- });
|
|
|
- auths.Add(attribute);
|
|
|
- });
|
|
|
-
|
|
|
auths.GroupBy(x => x.Auth).ToList().ForEach(x => {
|
|
|
if (x.Count() > 1)
|
|
|
{
|
|
@@ -142,8 +128,13 @@ namespace TEAMModelAPI
|
|
|
});
|
|
|
|
|
|
var table = azureStorage.GetCloudTableClient().GetTableReference("IESOpenApi");
|
|
|
- foreach (var item in openApis) {
|
|
|
- await table.SaveOrUpdate<OpenApi>(item);
|
|
|
+ try {
|
|
|
+ foreach (var item in openApis)
|
|
|
+ {
|
|
|
+ await table.SaveOrUpdate<OpenApi>(item);
|
|
|
+ }
|
|
|
+ } catch (Exception ex) {
|
|
|
+ Console.WriteLine(ex.Message);
|
|
|
}
|
|
|
#endif
|
|
|
}
|