- refactor platformapi.AccessPlatformAPIWithRetry

This commit is contained in:
gazebo
2019-01-12 14:04:37 +08:00
parent fc34194835
commit e124038aa2
11 changed files with 20 additions and 56 deletions

View File

@@ -98,11 +98,7 @@ func (a *API) AccessAPI(cmd string, body map[string]interface{}) (retVal *Respon
return request
},
a.config,
func(response *http.Response) (result string, err error) {
jsonResult1, err := utils.HTTPResponse2Json(response)
if err != nil {
return platformapi.ErrLevelGeneralFail, err
}
func(jsonResult1 map[string]interface{}) (result string, err error) {
Body := jsonResult1["body"].(map[string]interface{})
retVal = &ResponseResult{
ErrNo: int(utils.MustInterface2Int64(Body["errno"])),