parent
6c03ff40e8
commit
fe6807bca9
@ -0,0 +1,34 @@
|
||||
package com.taxi.apipassenger.controller;
|
||||
|
||||
import com.internal.dto.ResponseResult;
|
||||
import com.internal.request.ForecastPriceDTO;
|
||||
import com.taxi.apipassenger.service.ForecastPriceServcie;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@Slf4j
|
||||
public class ForecastPriceController {
|
||||
|
||||
@Autowired
|
||||
private ForecastPriceServcie forecastPriceServcie;
|
||||
|
||||
@PostMapping("/forecast-price")
|
||||
public ResponseResult forecastPrice(@RequestBody ForecastPriceDTO forecastPriceDTO) {
|
||||
log.info("出发经度," + forecastPriceDTO.getDepLongitude());
|
||||
log.info("出发纬度," + forecastPriceDTO.getDepLatitude());
|
||||
|
||||
String depLongitude = forecastPriceDTO.getDepLongitude();
|
||||
String depLatitude = forecastPriceDTO.getDestLatitude();
|
||||
|
||||
String destLongitude = forecastPriceDTO.getDestLongitude();
|
||||
String destLatitude = forecastPriceDTO.getDestLatitude();
|
||||
|
||||
log.info("目的地经度," + forecastPriceDTO.getDestLongitude());
|
||||
log.info("目的地纬度," + forecastPriceDTO.getDestLatitude());
|
||||
return forecastPriceServcie.forecastPrice(depLongitude,depLatitude,destLongitude,destLatitude);
|
||||
}
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package com.internal.request;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ForecastPriceDTO {
|
||||
|
||||
private String depLongitude;
|
||||
private String depLatitude;
|
||||
|
||||
private String destLongitude;
|
||||
private String destLatitude;
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
package com.internal.response;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ForecastPriceResponse {
|
||||
|
||||
private double price;
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.taxi</groupId>
|
||||
<artifactId>online-taxi-public</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>servcie-price</artifactId>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
@ -0,0 +1,7 @@
|
||||
package com.taxi;
|
||||
|
||||
public class Main {
|
||||
public static void main(String[] args) {
|
||||
System.out.println("Hello world!");
|
||||
}
|
||||
}
|
Loading…
Reference in new issue