(ctx *gin.Context, keyword string, scope strategy_dto.Scope, target string, driver string, page string, pageSize string, order string, sort string, filters string)
| 137 | } |
| 138 | |
| 139 | func (i *imlStrategyController) search(ctx *gin.Context, keyword string, scope strategy_dto.Scope, target string, driver string, page string, pageSize string, order string, sort string, filters string) ([]*strategy_dto.StrategyItem, int64, error) { |
| 140 | p, err := strconv.Atoi(page) |
| 141 | if err != nil { |
| 142 | if page != "" { |
| 143 | return nil, 0, fmt.Errorf("page error: %s", err) |
| 144 | } |
| 145 | p = 1 |
| 146 | } |
| 147 | ps, err := strconv.Atoi(pageSize) |
| 148 | if err != nil { |
| 149 | if pageSize != "" { |
| 150 | return nil, 0, fmt.Errorf("page size error: %s", err) |
| 151 | } |
| 152 | ps = 20 |
| 153 | } |
| 154 | ss := make([]string, 0) |
| 155 | json.Unmarshal([]byte(sort), &ss) |
| 156 | fs := make([]string, 0) |
| 157 | json.Unmarshal([]byte(filters), &fs) |
| 158 | list, total, err := i.strategyModule.Search(ctx, keyword, driver, scope, target, p, ps, fs, ss...) |
| 159 | if err != nil { |
| 160 | return nil, 0, err |
| 161 | } |
| 162 | |
| 163 | return list, total, nil |
| 164 | } |
| 165 | |
| 166 | func (i *imlStrategyController) GlobalStrategyList(ctx *gin.Context, keyword string, driver string, page string, pageSize string, order string, sort string, filters string) ([]*strategy_dto.StrategyItem, int64, error) { |
| 167 |
no test coverage detected