(ctx *gin.Context, name string)
| 44 | } |
| 45 | |
| 46 | func (i *imlStrategyController) FilterGlobalRemote(ctx *gin.Context, name string) ([]*strategy_dto.Title, []any, int64, string, string, error) { |
| 47 | f, has := strategy_filter.RemoteFilter(name) |
| 48 | if !has { |
| 49 | return nil, nil, 0, "", "", fmt.Errorf("filter not found: %s", name) |
| 50 | } |
| 51 | scopeAllow := false |
| 52 | for _, s := range f.Scopes() { |
| 53 | if s == strategy_filter.ScopeGlobal { |
| 54 | scopeAllow = true |
| 55 | break |
| 56 | } |
| 57 | } |
| 58 | if !scopeAllow { |
| 59 | return nil, nil, 0, "", "", fmt.Errorf("scope not allowed: %s", name) |
| 60 | } |
| 61 | |
| 62 | list, total, err := f.RemoteList(ctx, "", nil, -1, -1) |
| 63 | if err != nil { |
| 64 | return nil, nil, 0, "", "", err |
| 65 | } |
| 66 | return utils.SliceToSlice(f.Titles(), func(l strategy_filter.OptionTitle) *strategy_dto.Title { |
| 67 | return &strategy_dto.Title{ |
| 68 | Field: l.Field, |
| 69 | Title: l.Title, |
| 70 | } |
| 71 | }), list, total, f.Key(), f.Key(), nil |
| 72 | } |
| 73 | |
| 74 | func (i *imlStrategyController) FilterServiceRemote(ctx *gin.Context, serviceId string, name string) ([]*strategy_dto.Title, []any, int64, string, string, error) { |
| 75 | f, has := strategy_filter.RemoteFilter(name) |
nothing calls this directly
no test coverage detected