- 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

@@ -137,11 +137,7 @@ func (a *API) AccessAPI(apiStr string, params map[string]interface{}) (retVal Re
return request
},
a.config,
func(response *http.Response) (errLevel string, err error) {
jsonResult1, err := utils.HTTPResponse2Json(response)
if err != nil {
return platformapi.ErrLevelGeneralFail, platformapi.ErrResponseDataFormatWrong
}
func(jsonResult1 map[string]interface{}) (errLevel string, err error) {
status := jsonResult1["status"].(string)
if status == StatusCodeSuccess {
retVal = jsonResult1