Browse Source
Merge pull request #18327 from abpframework/liangshiwei/api-definition
Sort the API Definition
pull/18381/head
maliming
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with
8 additions and
2 deletions
-
framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AspNetCoreApiDescriptionModelProvider.cs
-
framework/src/Volo.Abp.Http/Volo/Abp/Http/Modeling/ApplicationApiDescriptionModel.cs
-
framework/src/Volo.Abp.Http/Volo/Abp/Http/Modeling/ModuleApiDescriptionModel.cs
|
|
|
@ -79,6 +79,7 @@ public class AspNetCoreApiDescriptionModelProvider : IApiDescriptionModelProvide |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
model.NormalizeOrder(); |
|
|
|
return model; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -22,7 +22,7 @@ public class ApplicationApiDescriptionModel |
|
|
|
return new ApplicationApiDescriptionModel |
|
|
|
{ |
|
|
|
Modules = new ConcurrentDictionary<string, ModuleApiDescriptionModel>(), //TODO: Why ConcurrentDictionary?
|
|
|
|
Types = new Dictionary<string, TypeApiDescriptionModel>() |
|
|
|
Types = new SortedDictionary<string, TypeApiDescriptionModel>() |
|
|
|
}; |
|
|
|
} |
|
|
|
|
|
|
|
@ -55,4 +55,9 @@ public class ApplicationApiDescriptionModel |
|
|
|
|
|
|
|
return subModel; |
|
|
|
} |
|
|
|
|
|
|
|
public void NormalizeOrder() |
|
|
|
{ |
|
|
|
Modules = Modules.OrderBy(x => x.Key).ToDictionary(x => x.Key, x => x.Value); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -35,7 +35,7 @@ public class ModuleApiDescriptionModel |
|
|
|
{ |
|
|
|
RootPath = rootPath, |
|
|
|
RemoteServiceName = remoteServiceName, |
|
|
|
Controllers = new Dictionary<string, ControllerApiDescriptionModel>() |
|
|
|
Controllers = new SortedDictionary<string, ControllerApiDescriptionModel>() |
|
|
|
}; |
|
|
|
} |
|
|
|
|
|
|
|
|