| 211 | } |
| 212 | |
| 213 | func (i *imlStrategyModule) Get(ctx context.Context, id string) (*strategy_dto.Strategy, error) { |
| 214 | info, err := i.strategyService.Get(ctx, id) |
| 215 | if err != nil { |
| 216 | return nil, err |
| 217 | } |
| 218 | s := strategy_dto.ToStrategy(info) |
| 219 | for _, f := range s.Filters { |
| 220 | ff, has := strategy_filter.FilterGet(f.Name) |
| 221 | if !has { |
| 222 | return nil, fmt.Errorf("filter not found: %s", f.Name) |
| 223 | } |
| 224 | f.Title = ff.Title() |
| 225 | f.Type = ff.Type() |
| 226 | f.Label = strings.Join(ff.Labels(f.Values...), ",") |
| 227 | } |
| 228 | return s, nil |
| 229 | } |
| 230 | |
| 231 | func (i *imlStrategyModule) Create(ctx context.Context, input *strategy_dto.Create) error { |
| 232 | if input.Name == "" { |