| | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | //import com.stylefeng.guns.modular.system.model.GDFence; |
| | | //import com.stylefeng.guns.modular.system.service.IGDFenceService; |
| | | import com.stylefeng.guns.modular.system.service.IGDInterfaceService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Bean; |
| | |
| | | @Autowired |
| | | private IGDInterfaceService gdInterfaceService; |
| | | |
| | | private String key = "ba2915f8d8c1428df72e964a5f94f167"; |
| | | private String key = "ea7326a77175aba0e9435859b17bca36"; |
| | | |
| | | private JSONArray jsonArray = new JSONArray(); |
| | | |
| | |
| | | */ |
| | | public Map<String, String> getDriving(String origins, String destination, String waypoints){ |
| | | String url = "https://restapi.amap.com/v3/direction/driving?key=" + key + "&origin=" + origins + "&destination=" + destination + |
| | | "&waypoints=" + waypoints + "&extensions=base&strategy=0"; |
| | | "&waypoints=" + waypoints + "&extensions=base&strategy=2"; |
| | | String forObject = restTemplate.getForObject(url, String.class); |
| | | JSONObject jsonObject = JSON.parseObject(forObject); |
| | | String status = jsonObject.getString("status"); |