This commit is contained in:
2026-08-14 16:34:17 +08:00
parent e0b0e1d8c8
commit f63acae353
53 changed files with 2488 additions and 350 deletions
+10
View File
@@ -88,6 +88,16 @@ func (s *AccessService) PolicyPathResponses(ctx context.Context, authorityID uin
func (s *AccessService) SyncAPIResponses(ctx context.Context, routes []dto.APIRequest) (*dto.APISyncResponse, error) {
items := make([]*biz.API, 0, len(routes))
for i := range routes {
routes[i].Path = s.NormalizeRoutePath(routes[i].Path)
if routes[i].APIGroup == "" || routes[i].Description == "" {
group, description := routeMetadata(routes[i].Method, routes[i].Path)
if routes[i].APIGroup == "" {
routes[i].APIGroup = group
}
if routes[i].Description == "" {
routes[i].Description = description
}
}
items = append(items, apiDomain(&routes[i]))
}
return s.SyncAPIs(ctx, items)