| 23 | } |
| 24 | |
| 25 | func (i *imlStrategyService) All(ctx context.Context, scope int, target string) ([]*Strategy, error) { |
| 26 | w := make(map[string]interface{}) |
| 27 | w["scope"] = scope |
| 28 | if target != "" { |
| 29 | w["target"] = target |
| 30 | } |
| 31 | list, err := i.store.List(ctx, w) |
| 32 | if err != nil { |
| 33 | return nil, err |
| 34 | } |
| 35 | return utils.SliceToSlice(list, FromEntity), nil |
| 36 | } |
| 37 | |
| 38 | func (i *imlStrategyService) Restore(ctx context.Context, id string) error { |
| 39 | _, err := i.store.UpdateWhere(ctx, map[string]interface{}{"uuid": id}, map[string]interface{}{"is_delete": false}) |