| 73 | } |
| 74 | |
| 75 | func (i *imlSubscribeService) SubscriptionsByApplication(ctx context.Context, applicationIds ...string) ([]*Subscribe, error) { |
| 76 | w := make(map[string]interface{}) |
| 77 | if len(applicationIds) > 0 { |
| 78 | w["application"] = applicationIds |
| 79 | } |
| 80 | |
| 81 | //w["apply_status"] = ApplyStatusSubscribe |
| 82 | list, err := i.store.List(ctx, w, "create_at desc") |
| 83 | if err != nil { |
| 84 | return nil, err |
| 85 | } |
| 86 | return utils.SliceToSlice(list, FromEntity), nil |
| 87 | } |
| 88 | |
| 89 | func (i *imlSubscribeService) DeleteByApplication(ctx context.Context, service string, application string) error { |
| 90 | _, err := i.store.DeleteWhere(ctx, map[string]interface{}{"service": service, "application": application}) |