优化结构
This commit is contained in:
@@ -2,8 +2,9 @@ package service
|
||||
|
||||
import (
|
||||
"context"
|
||||
"kra/internal/biz/system"
|
||||
|
||||
"kra/internal/biz/system"
|
||||
"kra/internal/routecatalog"
|
||||
"kra/internal/service/dto"
|
||||
)
|
||||
|
||||
@@ -28,7 +29,8 @@ func (s *SystemConfigService) InitializeRoutes(ctx context.Context, input *dto.D
|
||||
apis := make([]*system.API, 0, len(routes))
|
||||
for _, route := range routes {
|
||||
path := NormalizeRoutePath(route.Path, s.settings.RouterPrefix())
|
||||
group, description := RouteMetadata(route.Method, path)
|
||||
descriptor := routecatalog.Describe(route.Method, path)
|
||||
group, description := descriptor.Group, descriptor.Description
|
||||
apis = append(apis, &system.API{Path: path, Method: route.Method, APIGroup: group, Description: description})
|
||||
}
|
||||
return s.Initialize(ctx, input, apis)
|
||||
|
||||
Reference in New Issue
Block a user