MCPcopy Create free account
hub / github.com/APIParkLab/APIPark / APIs

Method APIs

controller/ai/iml.go:97–134  ·  view source on GitHub ↗
(ctx *gin.Context, keyword string, providerId string, start string, end string, page string, pageSize string, sortCondition string, asc string, models string, services string)

Source from the content-addressed store, hash-verified

95}
96
97func (i *imlStatisticController) APIs(ctx *gin.Context, keyword string, providerId string, start string, end string, page string, pageSize string, sortCondition string, asc string, models string, services string) ([]*ai_dto.APIItem, *ai_dto.Condition, int64, error) {
98 s, err := strconv.ParseInt(start, 10, 64)
99 if err != nil {
100 return nil, nil, 0, err
101 }
102
103 e, err := strconv.ParseInt(end, 10, 64)
104 if err != nil {
105 return nil, nil, 0, err
106 }
107
108 p, err := strconv.Atoi(page)
109 if err != nil {
110 if page != "" {
111 return nil, nil, 0, err
112 }
113 p = 1
114 }
115
116 ps, err := strconv.Atoi(pageSize)
117 if err != nil {
118 if pageSize != "" {
119 return nil, nil, 0, err
120 }
121 ps = 20
122 }
123 ms := make([]string, 0)
124 if models != "" {
125 json.Unmarshal([]byte(models), &ms)
126 ms = append(ms, models)
127 }
128 ss := make([]string, 0)
129 if services != "" {
130 json.Unmarshal([]byte(services), &ss)
131 ss = append(ss, services)
132 }
133 return i.module.APIs(ctx, keyword, providerId, s, e, p, ps, sortCondition, asc == "true", ms, ss)
134}

Callers

nothing calls this directly

Calls 1

APIsMethod · 0.65

Tested by

no test coverage detected