RemoteGpsBsService.java
1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package cn.com.glsx.stdinterface.modules.remote;
import cn.com.glsx.devicemonitor.api.feign.GpsBsFeignService;
import com.glsx.plat.common.utils.StringUtils;
import com.glsx.plat.core.web.R;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* GpsBsService 服务的处理层
*
* @author yll
*/
@Slf4j
@Service
public class RemoteGpsBsService {
@Autowired
private GpsBsFeignService gpsBsFeignService;
/**
* 通过经纬度获取地址
*
* @param lng 经度
* @param lat 纬度
* @return 地址
*/
public String getAddressByLngAndLat(String lng, String lat) {
if (StringUtils.isEmpty(lng) || StringUtils.isEmpty(lat)) {
return "";
}
R<String> addressR = gpsBsFeignService.getAddressByLngAndLat(lng, lat);
String address = addressR.getData(String.class);
if (StringUtils.isNullOrEmpty(address)) {
address = "";
}
return address;
}
}