From 57b3b0851b2144073522a43640c2acc9452e1719 Mon Sep 17 00:00:00 2001 From: riku <risaku@163.com> Date: 星期三, 30 十月 2019 14:52:34 +0800 Subject: [PATCH] 新增接口: 1. 获取车辆轨迹 --- src/main/kotlin/com/flightfeather/obd/lightshare/web/ObdDataController.kt | 14 ++++++++++++++ 1 files changed, 14 insertions(+), 0 deletions(-) diff --git a/src/main/kotlin/com/flightfeather/obd/lightshare/web/ObdDataController.kt b/src/main/kotlin/com/flightfeather/obd/lightshare/web/ObdDataController.kt index e6bcaff..37fb916 100644 --- a/src/main/kotlin/com/flightfeather/obd/lightshare/web/ObdDataController.kt +++ b/src/main/kotlin/com/flightfeather/obd/lightshare/web/ObdDataController.kt @@ -2,6 +2,7 @@ import com.flightfeather.obd.lightshare.service.ObdDataService import org.springframework.web.bind.annotation.* +import java.time.Duration /** * @author riku @@ -63,4 +64,17 @@ fun getCoordinate( @PathVariable("deviceCode") deviceCode: String ) = obdDataService.getCoordinate(deviceCode) + + @GetMapping("/coordinate/track") + fun getTrack( + @RequestParam("deviceCode") deviceCode: String, + @RequestParam("startTime") startTime: String, + @RequestParam("endTime") endTime: String + ) = obdDataService.getTrack(deviceCode, startTime, endTime) + + @GetMapping("/coordinate/latest") + fun getCoordinate( + @RequestParam("page", required = false) pageNum: Int?, + @RequestParam("per_page", required = false) pageSize: Int? + ) = obdDataService.getLatestCoordinate(pageNum, pageSize) } \ No newline at end of file -- Gitblit v1.9.3