| 47 | } |
| 48 | |
| 49 | func (i *imlSubscribeModule) ExportAll(ctx context.Context) ([]*subscribe_dto.ExportSubscriber, error) { |
| 50 | list, err := i.subscribeService.List(ctx) |
| 51 | if err != nil { |
| 52 | return nil, err |
| 53 | } |
| 54 | |
| 55 | return utils.SliceToSlice(list, func(s *subscribe.Subscribe) *subscribe_dto.ExportSubscriber { |
| 56 | return &subscribe_dto.ExportSubscriber{ |
| 57 | Id: s.Id, |
| 58 | Service: s.Service, |
| 59 | Subscriber: s.Application, |
| 60 | Applier: s.Applier, |
| 61 | From: s.From, |
| 62 | } |
| 63 | }), nil |
| 64 | } |
| 65 | |
| 66 | func (i *imlSubscribeModule) getSubscribers(ctx context.Context, serviceIds []string) ([]*gateway.SubscribeRelease, error) { |
| 67 | subscribers, err := i.subscribeService.SubscribersByProject(ctx, serviceIds...) |