| | |
| | | import com.xiaopeng.api.dto.map.OrderRouteAndFareDto; |
| | | import com.xiaopeng.api.dto.map.RouteAndFareDto; |
| | | import com.xiaopeng.api.dto.operation.LonLatDto; |
| | | import com.xiaopeng.api.vo.map.PointByIpVo; |
| | | import com.xiaopeng.api.vo.map.XpDistanceAndDurationVo; |
| | | import com.xiaopeng.api.vo.operation.RouteVo; |
| | | import com.xiaopeng.common.core.constant.CacheConstants; |
| | |
| | | import com.xiaopeng.common.redis.service.RedisService; |
| | | import com.xiaopeng.map.mangodb.model.GeoPoint; |
| | | import com.xiaopeng.map.mangodb.service.XpGeoFencingPolygonService; |
| | | import com.xiaopeng.map.utils.AmapWalkingRouteUtil; |
| | | import com.xiaopeng.map.utils.GDMapGeocodingUtil; |
| | | import com.xiaopeng.map.utils.mangoUtils.MongoGeoFenceUtil; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.bson.Document; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.io.IOException; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | |
| | | return R.ok(routeVo); |
| | | } |
| | | |
| | | /** |
| | | * 根据导航ID获取车端需要的导航数据 |
| | | * @param routedID |
| | | * @return |
| | | */ |
| | | @PostMapping("/map/queryRouted") |
| | | public R<String> getOrderDistanceAndDuration(@RequestParam("routedID") String routedID){ |
| | | return R.ok(gdMapGeocodingUtil.routed(routedID)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据ip获取点位 |
| | | */ |
| | | @ApiOperation(value = "根据ip获取点位", tags = {"小程序-站点导航"}) |
| | | @GetMapping("/point/getPointByIp") |
| | | public R<PointByIpVo> getPointByIp(HttpServletRequest request) throws IOException { |
| | | String ip = request.getRemoteAddr(); |
| | | PointByIpVo pointByIpVo = AmapWalkingRouteUtil.ipLocation(ip); |
| | | return R.ok(pointByIpVo); |
| | | } |
| | | |
| | | } |