Browse Source

Json解释代码修改。

Signed-off-by: zouap <zouap@pcl.ac.cn>
tags/v1.22.10.1^2
zouap 3 years ago
parent
commit
b8976fed71
1 changed files with 5 additions and 3 deletions
  1. +5
    -3
      modules/aisafety/resty.go

+ 5
- 3
modules/aisafety/resty.go View File

@@ -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")
}


Loading…
Cancel
Save