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

Method GetStrategyLogs

controller/strategy/iml.go:227–258  ·  view source on GitHub ↗
(ctx *gin.Context, keyword string, strategyId string, start string, end string, limit string, offset string)

Source from the content-addressed store, hash-verified

225}
226
227func (i *imlStrategyController) GetStrategyLogs(ctx *gin.Context, keyword string, strategyId string, start string, end string, limit string, offset string) ([]*strategy_dto.LogItem, int64, error) {
228 now := time.Now()
229
230 s, err := genTime(start, now.Add(-time.Hour*24*30))
231 if err != nil {
232 return nil, 0, fmt.Errorf("start time error: %s", err)
233 }
234 e, err := genTime(end, now)
235 if err != nil {
236
237 return nil, 0, fmt.Errorf("end time error: %s", err)
238 }
239 if s.After(e) {
240 return nil, 0, fmt.Errorf("start time must be less than end time")
241 }
242 l, err := strconv.ParseInt(limit, 10, 64)
243 if err != nil && limit != "" {
244
245 return nil, 0, err
246 }
247 o, err := strconv.ParseInt(offset, 10, 64)
248 if err != nil && offset != "" {
249 return nil, 0, err
250 }
251 if l < 1 {
252 l = 15
253 }
254 if o < 1 {
255 o = 1
256 }
257 return i.strategyModule.GetStrategyLogs(ctx, keyword, strategyId, s, e, l, o)
258}
259
260func (i *imlStrategyController) LogInfo(ctx *gin.Context, id string) (*strategy_dto.LogInfo, error) {
261

Callers

nothing calls this directly

Calls 2

genTimeFunction · 0.85
GetStrategyLogsMethod · 0.65

Tested by

no test coverage detected