Skip to content

Commit 4887fb7

Browse files
committed
新增 ApiDocumentHandler.SyncAsync同步Api文档方法模块地址统一增加(项目编码+/)前缀
1 parent 5e81ed4 commit 4887fb7

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

src/modules/admin/ZhonTai.Admin/Core/Handlers/ApiDocumentHandler.cs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66

77
namespace ZhonTai.Admin.Core.Handlers;
88

9+
/// <summary>
10+
/// Api文档处理器
11+
/// </summary>
912
public class ApiDocumentHandler : IApiDocumentHandler
1013
{
1114
private readonly AppConfig _appConfig;
@@ -22,6 +25,10 @@ public ApiDocumentHandler(AppConfig appConfig, ISwaggerProvider swaggerProvider,
2225
_logger = logger;
2326
}
2427

28+
/// <summary>
29+
/// 同步Api文档
30+
/// </summary>
31+
/// <returns></returns>
2532
public async Task SyncAsync()
2633
{
2734
try
@@ -40,8 +47,8 @@ public async Task SyncAsync()
4047
var apiSyncDto = new ApiSyncModel()
4148
{
4249
Label = tag.Description,
50+
Path = project.Code.ToLower() + "/" + tag.Name,
4351
ParentPath = project.Code.ToLower(),
44-
Path = tag.Name
4552
};
4653
apis.Add(apiSyncDto);
4754
}
@@ -53,7 +60,7 @@ public async Task SyncAsync()
5360
var apiSyncDto = new ApiSyncModel()
5461
{
5562
Path = path.Key,
56-
ParentPath = openApiOperation.Value.Tags.First().Name,
63+
ParentPath = project.Code.ToLower() + "/" + openApiOperation.Value.Tags.First().Name,
5764
HttpMethods = openApiOperation.Key.Method.ToLower(),
5865
Label = openApiOperation.Value.Summary
5966
};

0 commit comments

Comments
 (0)