fs-danaus
2024-03-16 a2ecbf17d6ba1c7b135fe10bb4cdfefa05b75add
提交 | 用户 | age
03d225 1 package com.yc.sdk.gaodemap.api;
F 2
3 import com.yc.entity.AttachmentConfig;
4 import com.yc.sdk.gaodemap.action.GdMapServiceInit;
5 import com.yc.sdk.gaodemap.entity.RegeoCodeEntity;
6 import com.yc.sdk.map.entity.LocationEntity;
a61f53 7 import com.yc.sdk.map.entity.SearchEntity;
03d225 8 import com.yc.sdk.map.service.AbstractMapService;
F 9 import org.springframework.beans.factory.annotation.Autowired;
10 import org.springframework.stereotype.Service;
11
12 @Service
13 public class GaoDeMapService implements AbstractMapService {
14     @Autowired
15     GdMapService gdMapService;
16     private static String KEY = AttachmentConfig.get("GaoDeWebServiceKey");
17
18     public GaoDeMapService() {
19         this.gdMapService = GdMapServiceInit.getGdMapService(KEY);
20     }
21
22     @Override
23     public LocationEntity getIPLocation(String ip) throws Exception {
24         return null;
25     }
26
27     @Override
a2ecbf 28     public Object searchByText(SearchEntity searchEntity) throws Exception {
F 29         return null;
30     }
31
32     @Override
a61f53 33     public Object nearbySearch(SearchEntity searchEntity) throws Exception {
F 34         return null;
35     }
36
37     @Override
03d225 38     public LocationEntity reverseGeocode(String longitude, String latitude, String ip) throws Exception {
F 39         RegeoCodeEntity regeoV2 = gdMapService.getRegeoV2(longitude, latitude, ip);
40         LocationEntity location = new LocationEntity();
41         location.setCountryName(regeoV2.getCountry());
42         location.setProvinceName(regeoV2.getProvince());
43         location.setCityName(regeoV2.getCity());
44         location.setSubLocality(regeoV2.getDistrict());
45         location.setThoroughfare(regeoV2.getTownship());
46         return location;
47     }
48 }