use of com.paascloud.provider.exceptions.MdcBizException in project paascloud-master by paascloud.
the class OpcRpcServiceImpl method getLocationById.
@Override
public String getLocationById(String addressId) {
try {
Wrapper<GaodeLocation> wrapper = opcGaodeFeignApi.getLocationByIpAddr(addressId);
if (wrapper == null) {
throw new MdcBizException(ErrorCodeEnum.GL99990002);
}
if (wrapper.error()) {
throw new MdcBizException(ErrorCodeEnum.MDC10021002);
}
GaodeLocation result = wrapper.getResult();
assert result != null;
return result.getProvince().contains("市") ? result.getCity() : result.getProvince() + GlobalConstant.Symbol.SHORT_LINE + result.getCity();
} catch (Exception e) {
log.error("getLocationById={}", e.getMessage(), e);
}
return null;
}
Aggregations