| 92 | } |
| 93 | |
| 94 | func (i *imlSubscribeService) SubscribersByProject(ctx context.Context, serviceIds ...string) ([]*Subscribe, error) { |
| 95 | w := make(map[string]interface{}) |
| 96 | if len(serviceIds) > 0 { |
| 97 | w["service"] = serviceIds |
| 98 | } |
| 99 | |
| 100 | w["apply_status"] = ApplyStatusSubscribe |
| 101 | list, err := i.store.List(ctx, w, "create_at desc") |
| 102 | if err != nil { |
| 103 | return nil, err |
| 104 | } |
| 105 | return utils.SliceToSlice(list, FromEntity), nil |
| 106 | } |
| 107 | |
| 108 | func (i *imlSubscribeService) Subscribers(ctx context.Context, service string, status int) ([]*Subscribe, error) { |
| 109 | list, err := i.store.List(ctx, map[string]interface{}{"apply_status": status, "service": service}, "create_at desc") |