parent
4edea6b5ef
commit
86c9839dd8
@ -0,0 +1,11 @@
|
|||||||
|
package com.internal.response;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class DriectionResponse {
|
||||||
|
|
||||||
|
private Integer distance;
|
||||||
|
|
||||||
|
private Integer duration;
|
||||||
|
}
|
@ -0,0 +1,28 @@
|
|||||||
|
package com.taxi.servicemap.controller;
|
||||||
|
|
||||||
|
import com.internal.dto.ResponseResult;
|
||||||
|
import com.internal.request.ForecastPriceDTO;
|
||||||
|
import com.taxi.servicemap.service.DirectionSevice;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/direction")
|
||||||
|
public class DriectionController {
|
||||||
|
@Autowired
|
||||||
|
private DirectionSevice directionSevice;
|
||||||
|
|
||||||
|
@GetMapping("/driving")
|
||||||
|
public ResponseResult deiving(@RequestBody ForecastPriceDTO forecastPriceDTO) {
|
||||||
|
String depLongitude = forecastPriceDTO.getDepLongitude();
|
||||||
|
String depLatitude = forecastPriceDTO.getDestLatitude();
|
||||||
|
|
||||||
|
String destLongitude = forecastPriceDTO.getDestLongitude();
|
||||||
|
String destLatitude = forecastPriceDTO.getDestLatitude();
|
||||||
|
return directionSevice.driving(depLongitude,depLatitude,
|
||||||
|
destLongitude,destLatitude );
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,18 @@
|
|||||||
|
package com.taxi.servicemap.service;
|
||||||
|
|
||||||
|
import com.internal.dto.ResponseResult;
|
||||||
|
import com.internal.response.DriectionResponse;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class DirectionSevice {
|
||||||
|
|
||||||
|
public ResponseResult driving(String depLongitude, String depLatitude,
|
||||||
|
String destLongitude, String destLatitude){
|
||||||
|
|
||||||
|
DriectionResponse driectionResponse= new DriectionResponse();
|
||||||
|
driectionResponse.setDistance(123);
|
||||||
|
driectionResponse.setDuration(2342);
|
||||||
|
return ResponseResult.success(driectionResponse);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in new issue