- refactor platformapi.AccessPlatformAPIWithRetry
This commit is contained in:
@@ -179,12 +179,7 @@ func (a *API) AccessAPI(apiStr string, jdParams map[string]interface{}) (retVal
|
||||
return request
|
||||
},
|
||||
a.config,
|
||||
func(response *http.Response) (errLevel string, err error) {
|
||||
jsonResult1, err := utils.HTTPResponse2Json(response)
|
||||
// baseapi.SugarLogger.Debug(utils.Format4Output(jsonResult1, false))
|
||||
if err != nil {
|
||||
return platformapi.ErrLevelGeneralFail, platformapi.ErrResponseDataFormatWrong
|
||||
}
|
||||
func(jsonResult1 map[string]interface{}) (errLevel string, err error) {
|
||||
code := jsonResult1["code"].(string)
|
||||
if code == ResponseCodeSuccess {
|
||||
retVal = jsonResult1
|
||||
|
||||
@@ -46,12 +46,7 @@ func (a *API) AccessStorePage(subURL string) (retVal map[string]interface{}, err
|
||||
return request
|
||||
},
|
||||
a.config,
|
||||
func(response *http.Response) (errLevel string, err error) {
|
||||
jsonResult1, err := utils.HTTPResponse2Json(response)
|
||||
// baseapi.SugarLogger.Debug(utils.Format4Output(jsonResult1, false))
|
||||
if err != nil {
|
||||
return platformapi.ErrLevelGeneralFail, platformapi.ErrResponseDataFormatWrong
|
||||
}
|
||||
func(jsonResult1 map[string]interface{}) (errLevel string, err error) {
|
||||
retVal = jsonResult1
|
||||
code := jsonResult1["code"].(string)
|
||||
if code == ResponseCodeSuccess {
|
||||
|
||||
Reference in New Issue
Block a user