func (a *DashboardController) Stat(k *knot.WebContext) interface{} { k.Config.OutputType = knot.OutputJson a.PrepareHistoryPath() t := struct { NameId string BtnClick string }{} e := k.GetPayload(&t) if e != nil { return e.Error() } ds, _ := Getquery(t.NameId) gs := modules.NewGrabService() grabStatus := gs.CheckStat(ds) return grabStatus }
func (w *WebGrabberController) Stat(r *knot.WebContext) interface{} { r.Config.OutputType = knot.OutputJson w.PrepareHistoryPath() payload := new(colonycore.WebGrabber) err := r.GetPayload(payload) if err != nil { return helper.CreateResult(false, nil, err.Error()) } err = colonycore.Get(payload, payload.ID) if err != nil { return helper.CreateResult(false, nil, err.Error()) } o, err := toolkit.ToM(payload) if err != nil { return helper.CreateResult(false, nil, err.Error()) } grabStatus := modules.NewGrabService().CheckStat([]interface{}{o}) return helper.CreateResult(true, grabStatus, "") }