MCPcopy Index your code
hub / github.com/APIParkLab/APIPark / search

Method search

controller/strategy/iml.go:139–164  ·  view source on GitHub ↗
(ctx *gin.Context, keyword string, scope strategy_dto.Scope, target string, driver string, page string, pageSize string, order string, sort string, filters string)

Source from the content-addressed store, hash-verified

137}
138
139func (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
166func (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

Callers 2

GlobalStrategyListMethod · 0.95
ServiceStrategyListMethod · 0.95

Calls 1

SearchMethod · 0.65

Tested by

no test coverage detected