改为v3版本返回count

This commit is contained in:
Jian Shen
2022-09-05 17:13:01 +08:00
parent abce305189
commit 7dd0e59f2f
@@ -146,11 +146,11 @@ class GaoDeUtils {
while (result.size() < count) {
params.page = "${page}".toString()
page++
params.key = this.getGaodeKey("v5/place/around")
JSONObject json = HttpRequestUtil.getJsonContent("http://restapi.amap.com/v5/place/around", params);
params.key = this.getGaodeKey("v3/place/around")
JSONObject json = HttpRequestUtil.getJsonContent("http://restapi.amap.com/v3/place/around", params);
if (json == null) {
params.key = this.getGaodeKey("v5/place/around")
json = HttpRequestUtil.getJsonContent("http://restapi.amap.com/v5/place/around", params);
params.key = this.getGaodeKey("v3/place/around")
json = HttpRequestUtil.getJsonContent("http://restapi.amap.com/v3/place/around", params);
}
if (json && json.info && json.info == "OK") {
count = json.getString("count").toInteger()