- refactor platformapi.AccessPlatformAPIWithRetry
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user