Search in sources :

Example 1 with DistanceResolveDTO

use of com.chao.cloud.common.extra.map.tencent.distance.DistanceResolveDTO in project chao-cloud by chaojunzi.

the class TencentMapService method distanceOneToMany.

/**
 * 距离计算
 */
@Override
public DistanceResolveDTO distanceOneToMany(DistanceVO vo) throws Exception {
    vo.setKey(key);
    Map<String, Object> map = BeanUtil.beanToMap(vo);
    String get = HttpUtil.get(distanceUrl, map);
    DistanceResolveDTO dto = JSONUtil.toBean(get, DistanceResolveDTO.class);
    if (!SUCCESS.equals(dto.getStatus())) {
        throw new BusinessException(dto.getMessage());
    }
    return dto;
}
Also used : BusinessException(com.chao.cloud.common.exception.BusinessException) DistanceResolveDTO(com.chao.cloud.common.extra.map.tencent.distance.DistanceResolveDTO)

Aggregations

BusinessException (com.chao.cloud.common.exception.BusinessException)1 DistanceResolveDTO (com.chao.cloud.common.extra.map.tencent.distance.DistanceResolveDTO)1