diff --git a/modules/aisafety/resty.go b/modules/aisafety/resty.go index 868adeb91..31d66b880 100644 --- a/modules/aisafety/resty.go +++ b/modules/aisafety/resty.go @@ -38,11 +38,13 @@ type ReturnMsg struct { Data ReturnData `json:"data"` Times int64 `json:"times"` } + type ReturnData struct { ID int `json:"id"` No string `json:"no"` StandardJson string `json:"standardJson"` Code int `json:"code"` + Msg string `json:"msg"` Status int `json:"status"` } @@ -243,10 +245,10 @@ func GetTaskStatus(jobID string) (*ReturnMsg, error) { log.Info("error =" + err.Error()) return nil, fmt.Errorf("Get task status error: %v", err) } else { - var reMap *ReturnMsg - err = json.Unmarshal(res.Body(), reMap) + var reMap ReturnMsg + err = json.Unmarshal(res.Body(), &reMap) if err == nil { - return reMap, nil + return &reMap, nil } else { return nil, fmt.Errorf("get error,code not 0") }