| 79 | } |
| 80 | |
| 81 | func (i *imlCatalogueModule) DefaultCatalogue(ctx context.Context) (*catalogue_dto.Catalogue, error) { |
| 82 | catalogues, err := i.catalogueService.List(ctx) |
| 83 | if err != nil { |
| 84 | return nil, err |
| 85 | } |
| 86 | for _, v := range catalogues { |
| 87 | if v.Parent == "" { |
| 88 | return &catalogue_dto.Catalogue{ |
| 89 | Id: v.Id, |
| 90 | Name: v.Name, |
| 91 | Parent: v.Parent, |
| 92 | Sort: v.Sort, |
| 93 | }, nil |
| 94 | } |
| 95 | } |
| 96 | return nil, errors.New("no default catalogue") |
| 97 | } |
| 98 | |
| 99 | func (i *imlCatalogueModule) onlineSubscriber(ctx context.Context, clusterId string, sub *gateway.SubscribeRelease) error { |
| 100 | client, err := i.clusterService.GatewayClient(ctx, clusterId) |