|
@@ -31,6 +31,9 @@ func GetEdbDataFromThsHttp(edbCode, startDate, endDate string) (item EdbDataFrom
|
|
|
}
|
|
|
|
|
|
body, err, _ := postCurl(thsUrl, dataMap, 0)
|
|
|
+ if err != nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
|
|
|
tmpItems := new(EdbDataFromThsInterface)
|
|
|
err = json.Unmarshal(body, &tmpItems)
|
|
@@ -111,6 +114,9 @@ func GetFutureGoodDataFromThsHttp(edbCode, startDate, endDate string) (item Futu
|
|
|
}
|
|
|
|
|
|
body, err, _ := postCurl(thsUrl, dataMap, 0)
|
|
|
+ if err != nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
|
|
|
tmpItems := new(FutureGoodDataFromThsInterface)
|
|
|
err = json.Unmarshal(body, &tmpItems)
|
|
@@ -211,8 +217,8 @@ func postCurl(urlStr string, dataMap map[string]interface{}, num int) (body []by
|
|
|
}
|
|
|
num++
|
|
|
return postCurl(urlStr, dataMap, num)
|
|
|
- } else if response.ErrorCode != 1 {
|
|
|
- utils.FileLog.Info(fmt.Sprint("post data err", ";url:", urlStr, ";params:", reqStr, ";response:", string(body)))
|
|
|
+ } else if response.ErrorCode != 0 {
|
|
|
+ utils.FileLog.Info(fmt.Sprint("post data err:", response.ErrMsg, ";url:", urlStr, ";params:", reqStr, ";response:", string(body)))
|
|
|
err = errors.New(response.ErrMsg)
|
|
|
return
|
|
|
}
|