Commit 008b5b48 by 刘鑫

DOC: 数据返回示例

1 parent afc69207
package com.dituhui.pea.order.controller; package com.dituhui.pea.order.controller;
import cn.hutool.core.date.LocalDateTimeUtil;
import com.dituhui.pea.common.Result; import com.dituhui.pea.common.Result;
import com.dituhui.pea.order.common.jackson.DateUtil; import com.dituhui.pea.order.common.jackson.DateUtil;
import com.dituhui.pea.order.common.jackson.JsonUtil; import com.dituhui.pea.order.common.jackson.JsonUtil;
...@@ -232,7 +231,11 @@ public class PeaApiController { ...@@ -232,7 +231,11 @@ public class PeaApiController {
@PostMapping("/order/increase/confirm") @PostMapping("/order/increase/confirm")
public Result<OrderConfirmResult> orderConfirm(@Validated @RequestBody OrderConfirmParam requestParam) { public Result<OrderConfirmResult> orderConfirm(@Validated @RequestBody OrderConfirmParam requestParam) {
return Result.success(new OrderConfirmResult()); OrderConfirmResult result = new OrderConfirmResult();
result.setEngineerCode(requestParam.getEngineerCode());
result.setOrderId(requestParam.getOrderId());
result.setAppointmentStatus(requestParam.getAppointmentResult());
return Result.success(result);
} }
...@@ -258,19 +261,17 @@ public class PeaApiController { ...@@ -258,19 +261,17 @@ public class PeaApiController {
/** /**
* 9.1GET 两点间里程和耗时查询 * 9.1GET 两点间里程和耗时查询
* *
* @param origin 出发点经纬度
* @param destination 目的地
* @param vehicle 交通工具:1汽车;2电动车;3自行车;4步行;默认是汽车
* @return 两点间里程和耗时 * @return 两点间里程和耗时
* @apiNote 根据交通工具查询两个坐标点之间的里程和耗时 * @apiNote 根据交通工具查询两个坐标点之间的里程和耗时
*/ */
@GetMapping("/base/distance") @PostMapping("/base/distance")
public Result<BaseDistance> baseDistance(@NotBlank @RequestParam("origin") String origin, public Result<BaseDistance> baseDistance(@RequestBody BaseDistanceParam param) {
@NotBlank @RequestParam("destination") String destination,
Integer vehicle) {
return Result.success(new BaseDistance()); BaseDistance result = new BaseDistance();
result.setOrigin(param.getOrigin());
result.setDestination(param.getDestination());
result.setVehicle(param.getVehicle());
return Result.success(result);
} }
......
...@@ -12,11 +12,11 @@ public class BaseDistance { ...@@ -12,11 +12,11 @@ public class BaseDistance {
/** /**
* 出发点 经度,纬度 * 出发点 经度,纬度
*/ */
private String origin; private BaseLocation origin;
/** /**
* 目的地 经度,纬度 * 目的地 经度,纬度
*/ */
private String destination; private BaseLocation destination;
/** /**
* 交通工具,1汽车;2电动车;3骑车;4步行 * 交通工具,1汽车;2电动车;3骑车;4步行
*/ */
......
package com.dituhui.pea.order.dto.param;
import lombok.Getter;
import lombok.Setter;
@Setter
@Getter
public class BaseDistanceParam {
/**
* 出发点经纬度
*/
private BaseLocation origin;
/**
* 出发点经纬度
*/
private BaseLocation destination;
/**
* 交通工具:1汽车;2电动车;3自行车;默认是汽车
*/
private Integer vehicle = 1;
}
package com.dituhui.pea.order.dto.param;
import lombok.Getter;
import lombok.Setter;
import javax.validation.constraints.NotNull;
@Setter
@Getter
public class BaseLocation {
/**
* 地址纬度
*/
@NotNull
private Double latitude;
/**
* 地址经度
*/
@NotNull
private Double longitude;
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!