(ctx context.Context, input *router_dto.InputSimpleAPI)
| 47 | } |
| 48 | |
| 49 | func (i *imlRouterModule) SimpleAPIs(ctx context.Context, input *router_dto.InputSimpleAPI) ([]*router_dto.SimpleItem, error) { |
| 50 | list, err := i.apiService.ListForServices(ctx, input.Services...) |
| 51 | if err != nil { |
| 52 | return nil, err |
| 53 | } |
| 54 | apiInfos, err := i.apiService.ListInfo(ctx, utils.SliceToSlice(list, func(s *api.API) string { |
| 55 | return s.UUID |
| 56 | })...) |
| 57 | if err != nil { |
| 58 | return nil, err |
| 59 | } |
| 60 | |
| 61 | return utils.SliceToSlice(apiInfos, func(item *api.Info) *router_dto.SimpleItem { |
| 62 | return &router_dto.SimpleItem{ |
| 63 | Id: item.UUID, |
| 64 | Name: item.Name, |
| 65 | Methods: item.Methods, |
| 66 | Path: item.Path, |
| 67 | } |
| 68 | }), nil |
| 69 | } |
| 70 | |
| 71 | func (i *imlRouterModule) ExportAll(ctx context.Context) ([]*router_dto.Export, error) { |
| 72 |
nothing calls this directly
no test coverage detected