package com.yc.sdk.gaodemap.api;
|
|
import com.yc.entity.AttachmentConfig;
|
import com.yc.sdk.gaodemap.action.GdMapServiceInit;
|
import com.yc.sdk.gaodemap.entity.RegeoCodeEntity;
|
import com.yc.sdk.huaweimap.entity.CustomerEntity;
|
import com.yc.sdk.map.entity.LocationEntity;
|
import com.yc.sdk.map.entity.SearchEntity;
|
import com.yc.sdk.map.service.AbstractMapService;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.stereotype.Service;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
@Service
|
public class GaoDeMapService implements AbstractMapService {
|
@Autowired
|
GdMapService gdMapService;
|
private static String KEY = AttachmentConfig.get("GaoDeWebServiceKey");
|
|
public GaoDeMapService() {
|
this.gdMapService = GdMapServiceInit.getGdMapService(KEY);
|
}
|
|
@Override
|
public LocationEntity getIPLocation(String ip, HttpServletRequest request) throws Exception {
|
return null;
|
}
|
@Override
|
public Object searchByText(SearchEntity searchEntity, HttpServletRequest request) throws Exception {
|
return null;
|
}
|
|
@Override
|
public Object customerList(CustomerEntity customerEntity, HttpServletRequest request) throws Exception {
|
return null;
|
}
|
|
@Override
|
public Object nearbySearch(SearchEntity searchEntity, HttpServletRequest request) throws Exception {
|
return null;
|
}
|
|
@Override
|
public LocationEntity reverseGeocode(String longitude, String latitude, String ip,HttpServletRequest request) throws Exception {
|
RegeoCodeEntity regeoV2 = gdMapService.getRegeoV2(longitude, latitude, ip);
|
LocationEntity location = new LocationEntity();
|
location.setCountryName(regeoV2.getCountry());
|
location.setProvinceName(regeoV2.getProvince());
|
location.setCityName(regeoV2.getCity());
|
location.setSubLocality(regeoV2.getDistrict());
|
location.setThoroughfare(regeoV2.getTownship());
|
return location;
|
}
|
}
|